From 41c1ecd34058b604d96b83950e1ad59555438786 Mon Sep 17 00:00:00 2001 From: ypshim Date: Mon, 26 Oct 2026 15:01:08 +0900 Subject: [PATCH] =?UTF-8?q?fix(rebar):=20draw=20the=20lower=20=EC=A0=95?= =?UTF-8?q?=EB=A9=B4=20chain=20and=20the=20=EA=B8=B0=EB=91=A5=20=EC=A4=91?= =?UTF-8?q?=EC=8B=AC=20tick=20at=20the=20column=20position?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- src/view/coping-rebar-svg.ts | 7 +++++-- tests/coping-rebar-svg.test.ts | 12 ++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/view/coping-rebar-svg.ts b/src/view/coping-rebar-svg.ts index 48f9b8c..86e66e1 100644 --- a/src/view/coping-rebar-svg.ts +++ b/src/view/coping-rebar-svg.ts @@ -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(`${d.text}`); + const x1 = d.from + col; + const x2 = d.to + col; + parts.push(`${d.text}`); } - parts.push(`기둥 중심 (0)`); + parts.push(`기둥 중심 (0)`); parts.push(`코핑 길이 ${lengthMm}`); // Bubbles: one per bar group, a leader from the bubble to the middle of the group's bars. diff --git a/tests/coping-rebar-svg.test.ts b/tests/coping-rebar-svg.test.ts index e59dc22..a0e7e1d 100644 --- a/tests/coping-rebar-svg.test.ts +++ b/tests/coping-rebar-svg.test.ts @@ -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(` [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); + }); +});