From c0d46220fd7dcc03dc28665b04f622c1436e3ea0 Mon Sep 17 00:00:00 2001 From: ypshim Date: Mon, 26 Oct 2026 14:46:38 +0900 Subject: [PATCH] =?UTF-8?q?feat(rebar):=20second=20dimension=20line=20and?= =?UTF-8?q?=20legend=20on=20the=20coping=20=EC=A0=95=EB=A9=B4=20(=EC=8B=9C?= =?UTF-8?q?=EC=95=88=20=E2=91=A2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The column-centre line 900 · 10@1000=10000 (기둥 중심부터) · 900, from the design values, under the first dimension. - A legend of the bar groups and their colours under the drawing. Co-Authored-By: Claude Haiku 5.5 --- src/view/coping-rebar-svg.ts | 29 ++++++++++++++++++++++++++++- tests/coping-rebar-svg.test.ts | 9 +++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/view/coping-rebar-svg.ts b/src/view/coping-rebar-svg.ts index 77b3b22..4f47b4f 100644 --- a/src/view/coping-rebar-svg.ts +++ b/src/view/coping-rebar-svg.ts @@ -73,6 +73,19 @@ export function copingFrontSvg(records: BarRecord[], lengthMm: number): string { x = x2; } } + // Second line (시안): the column-centre span 900 · 10@1000=10000 · 900, from the design values. + const dimY2 = dimY - 600; + const LOWER: { text: string; len: number }[] = [ + { text: '900', len: 900 }, + { text: '10@1000=10000 (기둥 중심부터)', len: 10000 }, + { text: '900', len: 900 }, + ]; + let x2 = minX; + for (const d of LOWER) { + const xe = x2 + d.len; + parts.push(`${d.text}`); + x2 = xe; + } parts.push(`코핑 길이 ${lengthMm}`); // Bubbles: one per bar group, a leader from the bubble to the middle of the group's bars. @@ -105,10 +118,24 @@ export function copingFrontSvg(records: BarRecord[], lengthMm: number): string { parts.push(`${c.label}`); } + // Legend (시안): the bar groups and their line styles, under the drawing. + const LEGEND: { label: string; group: keyof typeof COLOR }[] = [ + { label: '주철근 (C1–C8)', group: 'main' }, + { label: '전단·띠 (C9–C11)', group: 'loop' }, + { label: '측면 수평 (C12–C13)', group: 'side' }, + { label: '직각·보조 · 계단부 (C14–C16)', group: 'step' }, + ]; + const legendY = maxY + 2300; + let lx = minX; + for (const item of LEGEND) { + parts.push(`${item.label}`); + lx += 2600; + } + const vx = minX - 1500; const vy = minY - 1900; const vw = maxX - minX + 3000; - const vh = maxY - minY + 3400; + const vh = legendY - minY + 1900 + 400; return `${parts.join('')}`; } diff --git a/tests/coping-rebar-svg.test.ts b/tests/coping-rebar-svg.test.ts index 4e405eb..f9143de 100644 --- a/tests/coping-rebar-svg.test.ts +++ b/tests/coping-rebar-svg.test.ts @@ -55,3 +55,12 @@ describe('정면 번호 풍선과 치수 (승인 2026-10-26, 시안 ③)', () => expect(svg).toContain('코핑 길이 12000'); }); }); + +describe('정면 두 번째 치수선과 범례 (승인 2026-10-26, 시안)', () => { + const svg = copingFrontSvg(scene.records, model.copingL * 1000); + it('writes the column-centre span 10@1000=10000 and the legend', () => { + expect(svg).toContain('10@1000=10000 (기둥 중심부터)'); + expect(svg).toContain('주철근 (C1–C8)'); + expect(svg).toContain('전단·띠 (C9–C11)'); + }); +});