Files
Pier_v1/tests/column-section-svg.test.ts
T
ypshimandClaude Haiku 5.5 550b508e7a feat(rebar): 단면 삽도 순서 P3·P4·P5, 치수선·규격 표기·커플러 지시선
- 단면 순서와 문자를 삽도에 맞춤: A 일반(P3), B 확대기초 안(P4, 반원 2·커플러 2), C 단부(P5, 커플러 1)
- 각 단면에 지름 2000과 125 · 875 치수선 표시 (D, c, r1에서 계산)
- 규격과 간격 표기: P1·P2 S32 Div.46, P3·P4·P5 H19 @ 입력값
- 커플러는 띠철근 위 점에서 지시선을 따라 원 밖의 작은 원으로 표시
- P4 형상과 기본 간격은 문서 값 유지 (입력으로 삽도 값 @100 입력 가능)

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

35 lines
1.3 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { buildPier } from '../src/core/geometry';
import { columnInputFor, columnRebar } from '../src/core/rebar/column';
import { columnSectionSvg } from '../src/view/column-section-svg';
import { loadP1 } from './helpers';
const count = (svg: string, cls: string) => svg.split(`class="${cls}"`).length - 1;
describe('기둥 단면 A·B·C (승인 2026-10-26, 추천)', () => {
const m = buildPier(loadP1());
const input = columnInputFor(m);
const col = columnRebar(input);
it('A 일반: no coupler, P1 and P2 at all 46 angles, no P6 chords', () => {
const svg = columnSectionSvg('A', input, col);
expect(count(svg, 'coupler')).toBe(0);
expect(count(svg, 'p1')).toBe(input.nDiv);
expect(count(svg, 'p2')).toBe(input.nDiv);
expect(count(svg, 'p6')).toBe(0);
});
it('C 단부 (P5): one coupler on a full ring', () => {
const svg = columnSectionSvg('C', input, col);
expect(count(svg, 'coupler')).toBe(1);
expect(count(svg, 'p5')).toBe(1);
});
it('B 확대기초 안 (P4): two semicircles, two couplers, and the four P6 chords at its P6 level', () => {
const svg = columnSectionSvg('B', input, col);
expect(count(svg, 'coupler')).toBe(2);
expect(count(svg, 'p4')).toBe(2);
expect(count(svg, 'p6')).toBe(4);
});
});