feat(rebar): coping front view and 단면·폐합 section from the 3D bar records (승인 2026-10-26)
- rebar3d records every bar (name, stretch, local points, diameter) next to its mesh, so the 2D drawings use the same data as the 3D view. - view/coping-rebar-svg.ts: the 정면 (along the coping length, EL vertical) and the 단면·폐합 at a chosen station (the bars crossing it, C9–C11 loops included). - ③ coping tab: 정면 / 단면·폐합 toggle and the station input. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
32e8dad7dc
commit
57f7c148ec
4 files changed
+157
-1
No files matched your search
@@ -0,0 +1,34 @@
|
||||
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 { loadP1 } from './helpers';
|
||||
|
||||
const model = buildPier(loadP1());
|
||||
const scene = buildRebar3D(model);
|
||||
|
||||
describe('코핑 배근 정면 · 단면 (승인 2026-10-26)', () => {
|
||||
it('the 3D bar records include the coping bars, the same data as the meshes', () => {
|
||||
const coping = scene.records.filter((r) => /^C\d/.test(r.name));
|
||||
expect(coping.length).toBeGreaterThan(0);
|
||||
expect(scene.records.length).toBeGreaterThan(coping.length - 1);
|
||||
});
|
||||
|
||||
it('the front view draws one polyline per coping bar', () => {
|
||||
const coping = scene.records.filter((r) => /^C\d/.test(r.name));
|
||||
const svg = copingFrontSvg(scene.records, model.copingL * 1000);
|
||||
expect((svg.match(/<polyline/g) ?? []).length).toBe(coping.length);
|
||||
});
|
||||
|
||||
it('groups the bars: C1–C8 main, C9–C11 loops, C12–C13 sides, C14–C16 steps', () => {
|
||||
expect(copingBarGroup('C1')).toBe('main');
|
||||
expect(copingBarGroup('C9')).toBe('loop');
|
||||
expect(copingBarGroup('C12')).toBe('side');
|
||||
expect(copingBarGroup('C15')).toBe('step');
|
||||
});
|
||||
|
||||
it('the section at mid-length shows the bars that cross it', () => {
|
||||
const svg = copingSectionSvg(scene.records, model.copingL / 2);
|
||||
expect((svg.match(/<circle/g) ?? []).length).toBeGreaterThan(0);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user