Files
Pier_v1/tests/rebar-coping.test.ts
T
ypshimandClaude Opus 5.5 2b26b7c095 fix(rebar): 측면 수평 C12 = 상단 · C13 = 하단 변화구간 (엑셀 Pier B357–G358)
T형과 다주형 모두 엑셀 Pier 시트 철근표(C12 상단, C13 하단(변화구간))에 맞춰
측면 수평철근 번호를 서로 바꾼다 (사용자 결정 2026-11-06).
- 경사 하면에서 끊기는 아래 단 → C13, 끝면까지 가는 위 단 → C12
- 철근표 위치·비고 문구, 3D, 다주형 생성기가 같은 원천(sideRows)을 따른다
- C14 높이 순서를 유지하도록 측면 단을 아래(C13) → 위(C12) 순서로 넘김
- 테스트 기대값의 번호를 교환 (P1: C12 2단 8개, C13 5단 20개)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 14:29:50 +09:00

65 lines
2.3 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 { c14Total, COPING_END_GAP, copingSideBars, sideRows, shearBars, STEP_BAR_COUNTS } from '../src/core/rebar/coping';
// P1 coping: L 12000, one column at the centre (T형).
const L = 12000;
describe('코핑 철근 (코핑철근.md, plan C3)', () => {
it('end gap is cover + e_add = 300', () => {
expect(COPING_END_GAP).toBe(300);
});
it('C10: 9 bars @300 from 4800 to 7200 (k_max 4, beyond the Level edge at 4950 / 7050)', () => {
const { c10 } = shearBars(L);
expect(c10).toHaveLength(9);
expect(c10[0]).toBe(4800);
expect(c10[c10.length - 1]).toBe(7200);
expect(c10[1] - c10[0]).toBe(300);
});
it('C9 and C11: 18 bars each @250 outward, first at 4550 / 7450, last at 300 / 11700', () => {
const b = shearBars(L);
expect(b.c9).toHaveLength(18);
expect(b.c11).toHaveLength(18);
expect(b.c9[b.c9.length - 1]).toBe(4550);
expect(b.c9[0]).toBe(300);
expect(b.c11[0]).toBe(7450);
expect(b.c11[b.c11.length - 1]).toBe(11700);
expect(b.endGap).toBe(300);
});
it('total shear bars per face: 9 + 18 + 18 = 45 positions', () => {
const b = shearBars(L);
expect(b.c10.length + b.c9.length + b.c11.length).toBe(45);
});
it('a coping too short for C9 is refused (RB-K01)', () => {
expect(() => shearBars(2200)).toThrow('RB-K01');
});
it('C13 has 5 rows below the break at 42.538, C12 has 2 rows at and above it', () => {
const r = sideRows(41.288, 42.538);
expect(r.c13).toEqual([41.288, 41.538, 41.788, 42.038, 42.288]);
expect(r.c12).toEqual([42.538, 42.788]);
});
it('C13 일자 lengths 3717 / 5333 / 6950 / 8567 / 10183 and C12 11746 for L 12000 (코핑철근.md §6.2 table)', () => {
const s = copingSideBars(12000, 41.288, 42.538);
const expected = [3717, 5333, 6950, 8567, 10183];
s.c13.forEach((r, i) => expect(r.straight).toBeCloseTo(expected[i], 0));
expect(s.c13[0].xw).toBeCloseTo(4141.7, 1);
s.c12.forEach((r) => {
expect(r.xw).toBe(127);
expect(r.straight).toBe(11746);
});
});
it('C14: 38 bars = 2 × 11 upper + 5 + 6 + 3 + 2 lower', () => {
expect(c14Total()).toBe(38);
});
it('C15 11 bars, C16 22 bars', () => {
expect(STEP_BAR_COUNTS).toEqual({ C15: 11, C16: 22 });
});
});