feat(rebar): 정면 dimension chains computed from the 3D bar positions (기둥 중심 = 0)

- chainDims groups the repeated gaps (n@pitch = total) and writes a single gap as its length.
- Top chain: the 전단·띠 stations (C9 @250, C10 @300) from the coping ends.
- Lower chain: the upper C14 bars measured from the column centre (0), so
  the 10@1000 span starts at the column centre.
- Stations are the lowest s of their pieces; pieces within 160 mm are one station.
- P1 gives the 시안 values: 300 · 18@250=4500 · 8@300=2400 · 18@250=4500 · 300 and
  900 · 10@1000=10000 · 900.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-10-26 14:54:45 +09:00
1 parent c0d46220fd
commit a18a15db7b
3 files changed
+72 -32

No files matched your search

+17 -2
View File
@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest';
import { buildPier } from '../src/core/geometry';
import { buildRebar3D } from '../src/view/rebar3d';
import { copingBarGroup, copingFrontSvg, copingSectionSvg } from '../src/view/coping-rebar-svg';
import { chainDims, copingBarGroup, copingFrontSvg, copingSectionSvg } from '../src/view/coping-rebar-svg';
import { loadP1 } from './helpers';
const model = buildPier(loadP1());
@@ -59,8 +59,23 @@ describe('정면 번호 풍선과 치수 (승인 2026-10-26, 시안 ③)', () =>
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('10@1000=10000');
expect(svg).toContain('기둥 중심');
expect(svg).toContain('주철근 (C1–C8)');
expect(svg).toContain('전단·띠 (C9–C11)');
});
});
describe('정면 치수는 3D 철근 위치에서 계산 (승인 2026-10-26)', () => {
it('the chains come from the bar positions and match the 시안 values', () => {
const svg = copingFrontSvg(scene.records, model.copingL * 1000, model.columns[0].s);
const texts = [...svg.matchAll(/font-size="150"[^>]*>([^<]*)</g)].map((x) => x[1]);
expect(texts).toEqual(['300', '18@250=4500', '8@300=2400', '18@250=4500', '300', '900', '10@1000=10000', '900', '기둥 중심']);
});
});
describe('chainDims', () => {
it('groups repeated gaps and writes a single gap as its length', () => {
expect(chainDims([300, 550, 800, 1100], 0, 1400).map((d) => d.text)).toEqual(['300', '2@250=500', '2@300=600']);
});
});