diff --git a/src/view/block-rebar-plan-svg.ts b/src/view/block-rebar-plan-svg.ts index 3dd7dc1..85723c0 100644 --- a/src/view/block-rebar-plan-svg.ts +++ b/src/view/block-rebar-plan-svg.ts @@ -56,6 +56,16 @@ export function blockRebarPlanSvg(m: PierModel, pairIndex = 0): string { parts.push(``); } } + // Dimensions: the S2 layout along the 교축 (below the block), the S1 layout along the 교각축 (beside it), the block width. + const layout = (count: number, spacing: number, firstEnd: number) => `${firstEnd.toFixed(1)} · ${count - 1}@${spacing}=${(count - 1) * spacing} · ${firstEnd.toFixed(1)}`; + const a2d = barsAcross(wC * 1000, s.spacingS2, s); + const a1d = barsAcross(wA * 1000, s.spacingS1, s); + const [bx, by] = P(wA / 2 + 0.22, 0); + parts.push(`${layout(a2d.count, a2d.spacing, a2d.firstEnd)}`); + const [rx, ry] = P(0, wC / 2 + 0.22); + parts.push(`${layout(a1d.count, a1d.spacing, a1d.firstEnd)}`); + const [wx, wy] = P(-wA / 2 - 0.2, 0); + parts.push(`${Math.round(wC * 1000)}`); return P; }; diff --git a/tests/block-rebar-plan-svg.test.ts b/tests/block-rebar-plan-svg.test.ts index 0109a95..256ec1e 100644 --- a/tests/block-rebar-plan-svg.test.ts +++ b/tests/block-rebar-plan-svg.test.ts @@ -26,3 +26,17 @@ describe('받침블럭 배근 평면 (승인 2026-10-26)', () => { expect(svg).toContain('>S1<'); }); }); + +describe('받침블럭 배근 평면 치수 (승인 2026-10-26)', () => { + it('shows the S2 layout 162.5 · 7@125=875 · 162.5 and the block width 1200', () => { + const svg = blockRebarPlanSvg(buildPier(loadP1()), 0); + expect(svg).toContain('162.5 · 7@125=875 · 162.5'); + expect(svg).toContain('>1200<'); + }); + + it('a 일체 pair shows the 2500 block width and the 19-bar S2 layout', () => { + const svg = blockRebarPlanSvg(buildPier({ ...loadP1(), bearingLayout: '일체' }), 0); + expect(svg).toContain('>2500<'); + expect(svg).toContain('@125=2250'); + }); +});