fix(rebar): section labels once per bar and spots once

- The coping section listed every piece of a bar as its own crossing, so the
  same spot and name were drawn many times. Each spot is drawn once and each
  bar name is written once.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-10-26 14:28:33 +09:00
1 parent 57f7c148ec
commit 32cf01a29f
2 files changed
+26 -2

No files matched your search

+9
View File
@@ -32,3 +32,12 @@ describe('코핑 배근 정면 · 단면 (승인 2026-10-26)', () => {
expect((svg.match(/<circle/g) ?? []).length).toBeGreaterThan(0);
});
});
describe('단면 · 폐합 글자 겹침 (승인 2026-10-26)', () => {
it('writes each bar name once, and each spot once', () => {
const svg = copingSectionSvg(scene.records, 6);
const labels = (svg.match(/<text /g) ?? []).length;
const names = new Set((svg.match(/font-size="120"[^>]*>(C\d+)</g) ?? []).map((s) => s.replace(/.*>/, '')));
expect(labels).toBe(names.size);
});
});