Files
Pier_v1/tests/column-elevation-svg.test.ts
ypshimandClaude Haiku 5.5 c82aff3713 feat(rebar): 기둥 정면 삽도 (P 번호, 단부 배치구간·기초 안 깊이 계산값 표시)
- view/column-elevation-svg.ts: 기둥 정면 SVG. 띠철근 P3·P5·P4·P6, 주철근 P1·P2, 커플러를 계산 결과 그대로 그림
- 번호는 P1–P6 (승인), 간섭(B11–P4)은 표시하지 않음 (검토 제외)
- 단부 배치구간 l_e = max(l_e,min, n·s + s/2)와 기초 안 깊이(0.5·H_f → m4·s)는 기존 계산값을 그림과 캡션에 표시
- 기둥 입력 라벨 K → P 번호

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-10-26 16:37:36 +09:00

37 lines
1.4 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { buildPier } from '../src/core/geometry';
import { columnInputFor, columnRebar } from '../src/core/rebar/column';
import { columnElevationSvg } from '../src/view/column-elevation-svg';
import { loadP1 } from './helpers';
const count = (svg: string, cls: string) => svg.split(`class="${cls}"`).length - 1;
describe('기둥 정면 삽도 (승인 2026-10-26)', () => {
const m = buildPier(loadP1());
const input = columnInputFor(m);
const col = columnRebar(input);
const svg = columnElevationSvg(input, col);
it('draws one line per computed tie level (P3, P5, P4, P6)', () => {
expect(count(svg, 'p3')).toBe(col.p3.length);
expect(count(svg, 'p5')).toBe(col.p5.length);
expect(count(svg, 'p4')).toBe(col.p4.length);
expect(count(svg, 'p6')).toBe(col.p6Levels.length);
});
it('labels use the P numbers and the values that produced them', () => {
expect(svg).toContain('@300');
expect(svg).toContain('@120');
expect(svg).toContain('@3000');
expect(svg).toContain(`l_e ${col.lE} = max(${col.lEmin}, 19@120 + 60)`);
expect(svg).toContain(`기초 안 깊이 ${Math.round(input.rP4 * input.Hf)}`);
expect(svg).not.toMatch(/\bK[1-6]\b/);
});
it('draws the P1 and P2 bars on both sides (4 vertical lines)', () => {
expect(count(svg, 'p1')).toBe(2);
expect(count(svg, 'p2')).toBe(2);
expect(count(svg, 'coupler')).toBe(col.couplerP1.length * 2);
});
});