Files
Pier_v1/tests/rebar-coping-lengths.test.ts
T
ypshimandClaude Haiku 5.5 8ac5d2973c feat(view): 전단철근 구간 표 on the ③ coping tab (시안 ③)
- Segments of C9 (좌 경사), C10 (Level), C11 (우 경사): first and last bar in
  metres, spacing, count, and bar number. From the bar positions (코핑철근.md §3).
- Test: 0.300–4.550 (18 @250), 4.800–7.200 (9 @300), 7.450–11.700 (18 @250).
- Not verified in a browser.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-10-22 12:17:12 +09:00

50 lines
2.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 { 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]);
});
});