import { describe, expect, it } from 'vitest'; import { shearULength, shearUHeight } from '../src/core/rebar/coping'; // Coping 12000 (코핑철근.md §4.3 · §12): lower U = 1740 + 2h. const L = 12000; describe('C9·C10 하부 U 길이 (코핑철근.md §4.3)', () => { it('C9 first (x 300) 3522, C9 last (x 4550) 6098, C10 outer (x 4800) 6249, Level (x 6000) 6340', () => { expect(shearULength(300, L)).toBeCloseTo(3522, 0); expect(shearULength(4550, L)).toBeCloseTo(6098, 0); expect(shearULength(4800, L)).toBeCloseTo(6249, 0); expect(shearULength(6000, L)).toBeCloseTo(6340, 0); }); it('heights h: 890.9 at the end, 2178.8 at the last C9, 2300 on the Level', () => { expect(shearUHeight(300, L)).toBeCloseTo(890.9, 1); expect(shearUHeight(4550, L)).toBeCloseTo(2178.8, 1); expect(shearUHeight(6000, L)).toBe(2300); }); it('mirrors on the right half', () => { expect(shearULength(11700, L)).toBeCloseTo(3522, 0); }); }); import { capLength, PIECES_PER_POSITION } from '../src/core/rebar/coping'; import { rebarSummary } from '../src/core/rebar/summary'; import { buildPier } from '../src/core/geometry'; import { loadP1 } from './helpers'; describe('삿갓과 조각 수 (코핑철근.md §4.3, Q-K5 추천안)', () => { it('cap length 1740 + 2·(h − 100) and the piece total 270 for C9 + C10 + C11', () => { expect(capLength(4800, L)).toBeCloseTo(1740 + 2 * (2254.5 - 100), 0); const rows = rebarSummary(buildPier(loadP1())).rows; const pieces = ['C9', 'C10', 'C11'].reduce((sum, n) => sum + rows.find((r) => r.name === n)!.count * PIECES_PER_POSITION, 0); expect(pieces).toBe(270); }); }); import { shearSegments } from '../src/core/rebar/coping'; describe('전단철근 구간 표 (시안 ③)', () => { it('left slope C9 0.300–4.550 (18, @250), Level C10 4.800–7.200 (9, @300), right slope C11 7.450–11.700 (18, @250)', () => { const [left, level, right] = shearSegments(12000); expect([left.from, left.to, left.count, left.spacing]).toEqual([300, 4550, 18, 250]); expect([level.from, level.to, level.count, level.spacing]).toEqual([4800, 7200, 9, 300]); expect([right.from, right.to, right.count, right.spacing]).toEqual([7450, 11700, 18, 250]); }); }); describe('전단철근 구간 표 다주형', () => { it('2주형 (columns 2400 and 9600): left 3, Level 1 9, Level 2 9, between 18, right 3', () => { const segs = shearSegments(12000, [2400, 9600]); expect(segs.map((g) => [g.segment, g.count])).toEqual([ ['좌 경사', 3], ['Level 1', 9], ['Level 2', 9], ['기둥 사이 1', 18], ['우 경사', 3], ]); }); });