Files
Pier_v1/tests/rebar-coping-lengths.test.ts
T
ypshimandClaude Haiku 5.5 1c6194cd48 feat(core): cap bars of C9–C11 and piece count (추천안 for Q-K5)
- Recommended l_cap = h − 100 (top cover), so l_cap stays below h (RB-K04).
  Cap length = 1740 + 2·l_cap. The shear rows show U and cap ranges.
- Piece count 6 per position (3 closed stirrups × U + cap): C9 + C10 + C11 gives
  270 pieces, as in the document.
- P1/P2 per-line pieces are shown from the document (기둥철근.md §3.2).
- Tests: cap length and the 270 check.
- Not verified in a browser.

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

39 lines
1.6 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);
});
});