feat(rebar): dimensions on the block rebar plan

- The S2 layout along the 교축 (below the block), the S1 layout along the 교각축
  (beside it), and the block width, in the same form as the C–C section.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-10-26 14:19:52 +09:00
1 parent dd590b899c
commit fa1ec3e864
2 files changed
+24

No files matched your search

+10
View File
@@ -56,6 +56,16 @@ export function blockRebarPlanSvg(m: PierModel, pairIndex = 0): string {
parts.push(`<circle cx="${p1[0]}" cy="${p1[1]}" r="14" fill="#B4531F"></circle><circle cx="${p2[0]}" cy="${p2[1]}" r="14" fill="#B4531F"></circle>`);
}
}
// 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(`<text x="${bx}" y="${by}" text-anchor="middle" font-size="80" fill="#0F5C66">${layout(a2d.count, a2d.spacing, a2d.firstEnd)}</text>`);
const [rx, ry] = P(0, wC / 2 + 0.22);
parts.push(`<text x="${rx}" y="${ry}" text-anchor="start" font-size="80" fill="#B4531F">${layout(a1d.count, a1d.spacing, a1d.firstEnd)}</text>`);
const [wx, wy] = P(-wA / 2 - 0.2, 0);
parts.push(`<text x="${wx}" y="${wy}" text-anchor="end" font-size="90" fill="#18212B">${Math.round(wC * 1000)}</text>`);
return P;
};
+14
View File
@@ -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');
});
});