fix(rebar): draw the lower 정면 chain and the 기둥 중심 tick at the column position
- The chain is computed from the column centre (0) and is now drawn at the column's position on the coping (x = column s), so the 0 sits on the column. - P1: the 10@1000 span runs from 1000 to 11000 mm, centred on the column at 6000 mm. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a4ae6de485
commit
41c1ecd340
2 files changed
+17
-2
No files matched your search
@@ -107,10 +107,13 @@ export function copingFrontSvg(records: BarRecord[], lengthMm: number, columnSm
|
||||
const col = columnSm * 1000;
|
||||
const lowerChain = chainDims(positionsOf(c14Upper).map((v) => v - col), minX - col, maxX - col);
|
||||
const dimY2 = dimY - 900;
|
||||
// The chain is computed from the column centre (0); it is drawn at the column's position on the coping (x = col).
|
||||
for (const d of lowerChain) {
|
||||
parts.push(`<line x1="${d.from}" y1="${dimY2}" x2="${d.to}" y2="${dimY2}" stroke="#18212B" stroke-width="10"></line><text x="${(d.from + d.to) / 2}" y="${dimY2 - 110}" text-anchor="middle" font-size="220" fill="#18212B">${d.text}</text>`);
|
||||
const x1 = d.from + col;
|
||||
const x2 = d.to + col;
|
||||
parts.push(`<line x1="${x1}" y1="${dimY2}" x2="${x2}" y2="${dimY2}" stroke="#18212B" stroke-width="10"></line><text x="${(x1 + x2) / 2}" y="${dimY2 - 110}" text-anchor="middle" font-size="220" fill="#18212B">${d.text}</text>`);
|
||||
}
|
||||
parts.push(`<line x1="0" y1="${dimY2 - 200}" x2="0" y2="${dimY2 + 200}" stroke="#B4531F" stroke-width="12"></line><text x="60" y="${dimY2 + 320}" font-size="200" fill="#B4531F">기둥 중심 (0)</text>`);
|
||||
parts.push(`<line x1="${col}" y1="${dimY2 - 200}" x2="${col}" y2="${dimY2 + 200}" stroke="#B4531F" stroke-width="12"></line><text x="${col + 60}" y="${dimY2 + 320}" font-size="200" fill="#B4531F">기둥 중심 (0)</text>`);
|
||||
parts.push(`<text x="${midX}" y="${minY - 3000}" text-anchor="middle" font-size="260" fill="#18212B">코핑 길이 ${lengthMm}</text>`);
|
||||
|
||||
// Bubbles: one per bar group, a leader from the bubble to the middle of the group's bars.
|
||||
|
||||
@@ -79,3 +79,15 @@ describe('chainDims', () => {
|
||||
expect(chainDims([300, 550, 800, 1100], 0, 1400).map((d) => d.text)).toEqual(['300', '2@250=500', '2@300=600']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('아래 치수선의 0 = 기둥 중심 (승인 2026-10-26)', () => {
|
||||
it('the column-centre tick sits at the middle of the 10@1000 span (the 10 intervals are centred on the column)', () => {
|
||||
const col = model.columns[0].s * 1000;
|
||||
const svg = copingFrontSvg(scene.records, model.copingL * 1000, model.columns[0].s);
|
||||
expect(svg).toContain(`<line x1="${col}" y1=`);
|
||||
const seg = [...svg.matchAll(/<line x1="([-\d.]+)" y1="[-\d.]+" x2="([-\d.]+)" y2="[-\d.]+" stroke="#18212B" stroke-width="10"/g)].map((m) => [Number(m[1]), Number(m[2])]);
|
||||
const span = seg.find(([a, b]) => b - a > 9000 && b - a < 11000);
|
||||
expect(span).toBeDefined();
|
||||
expect((span![0] + span![1]) / 2).toBeCloseTo(col, 0);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user