Files
Pier_v1/tests/rebar-summary.test.ts
T
ypshimandClaude Haiku 5.5 7340f8c1a1 feat(rebar): 계단부 C15·C16을 모델의 실제 계단으로 만든다 (T형·다주형 공통)
T형은 P1 문서의 고정 위치(2.196~12.000 m)·높이·11개를 써서 코핑 길이가 다르면 철근이 코핑 밖으로 나갔고,
다주형은 높은 계단 전체에 C15 하나만 두었다. 공통 규칙 (step-bars.ts):
- 열마다(전·후열 단차가 있으면 각 쪽) 최저 상면 + h_16(100) 이상 구간이 계단, 경계는 mm 반올림
- 이웃보다 모두 높은 구간 C15(⊓), 나머지 계단 C16(L형, 낮은 쪽 다리, 높은 쪽으로 l_d 연장)
- 폭 방향: T형은 주철근 내부 격자 하나 건너, 다주형은 상면 주철근 하나 건너
- 양쪽이 높은 계단은 RB-S01 알림, RB-M04 폐지. 꺾임은 편 좌표의 한 개(꺾은 철근)
P1 문서값(C15 11 × 3852, C16 22 × 4070/4069, 137.5 · 10@250)을 그대로 재현한다.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-11-10 16:53:15 +09:00

66 lines
3.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, expect, it } from 'vitest';
import { buildPier } from '../src/core/geometry';
import { rebarSummary } from '../src/core/rebar/summary';
import { loadP1 } from './helpers';
const { rows, warnings } = rebarSummary(buildPier(loadP1()));
const count = (name: string) => rows.find((r) => r.name === name)!.count;
describe('③ 철근표 요약 (P1)', () => {
it('bearing blocks: S1 and S2 80 bars each', () => {
expect(count('S1')).toBe(80);
expect(count('S2')).toBe(80);
});
it('coping: C1–C8 12 each, C9 18, C10 9, C11 18, C13 20 (5 rows × 일자 2 + ㄷ 2), C12 8 (2 rows), C14 38, C15 11, C16 22', () => {
for (const n of ['C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8']) expect(count(n)).toBe(12);
expect(count('C9')).toBe(18);
expect(count('C10')).toBe(9);
expect(count('C11')).toBe(18);
expect(count('C13')).toBe(20);
expect(count('C12')).toBe(8);
expect(count('C14')).toBe(38);
expect(count('C15')).toBe(11);
expect(count('C16')).toBe(22);
});
it('column: P1 230, P2 230, couplers 368, P3 39, P5 19, P4 8, P6 32', () => {
expect(count('P1')).toBe(230);
expect(count('P2')).toBe(230);
expect(count('주철근 커플러')).toBe(368);
expect(count('띠철근 커플러')).toBe(35);
expect(count('P3')).toBe(39);
expect(count('P5')).toBe(19);
expect(count('P4')).toBe(8);
expect(count('P6')).toBe(32);
});
it('footing (방향 교환): B1–B4 40 each, B5–B8 31 each, B10-1 16, B10-2 16, B11 30, B12 24 (k = 8)', () => {
for (const n of ['B1', 'B2', 'B3', 'B4']) expect(count(n)).toBe(40);
for (const n of ['B5', 'B6', 'B7', 'B8']) expect(count(n)).toBe(31);
expect(count('B10-1')).toBe(16);
expect(count('B10-2')).toBe(16);
expect(count('B11')).toBe(30);
expect(count('B12')).toBe(24);
});
it('B9: 306 bars (320 on the grid less 14 in the column zone); warnings: B6 needs a splice (13646 > 12000)', () => {
expect(count('B9')).toBe(306);
expect(warnings.map((w) => w.code)).toEqual(['I02', 'RB-S04', 'RB-F08']); // defaults are assumed values (I02); bearing embedment 619–669 < 882 (RB-S04)
expect(warnings.find((w) => w.code === 'RB-F08')!.bar).toBe('B6');
// B6 is split into two pieces (추천안): each piece is about half the 13646 bar plus half the lap.
expect(rows.find((r) => r.name === 'B6')!.length!).toBeCloseTo(7776, 0);
});
it('lengths from the documents: C12 11746, C14 3447.5, C15 3852, C16 4070, P3 ≈ C_t + 1.3·l_d, P5 ≈ C_t', () => {
// C12 has several lengths now: its straight bars are pieces (수정 2026-10-23); 11746 is the first 일자.
expect(rows.find((r) => r.name === 'C12')!.pieces!.some((p) => p.length === 11746)).toBe(true);
expect(rows.find((r) => r.name === 'C14')!.length).toBe(3447.5);
expect(rows.find((r) => r.name === 'C15')!.length).toBe(3852);
// C16 has two lengths (3·4구간), so the row lists them as pieces (2026-11-10).
expect(rows.find((r) => r.name === 'C16')!.pieces).toEqual([{ length: 4070, count: 11 }, { length: 4069, count: 11 }]);
expect(rows.find((r) => r.name === 'P5')!.length).toBeCloseTo(5657.7, 0);
expect(rows.find((r) => r.name === 'P3')!.length!).toBeCloseTo(5657.7 + 1146.6, 0);
});
});