Files
Pier_v1/tests/rebar-bearing.test.ts
T
ypshimandClaude Haiku 5.5 b962cf1a1c feat(core): bearing-block drawing check and coping rebar C3 (plan C2·C3)
- Drawing check (spec §6.3): an integrated 2500 × 1200 block gives 18@125 = 2250
  along (ends 50 + 75) and 7@125 = 875 across (ends 162.5).
- C3 coping rebar, from RAG/코핑철근.md (2026-10-22 final):
  - C10: 9 bars @300 at 4800–7200 (k_max 4, beyond the Level edge).
  - C9 / C11: 18 bars each @250 outward, ends at 300 and 11700 (end gap 300).
  - Refuses a coping too short for C9 (RB-K01).
  - Side bars C12 5 rows / C13 2 rows at the 42.538 break; C14 38 bars;
    C15 11 bars, C16 22 bars.
- spec §6.4 is older than 코핑철근.md (C10/C9/C11 layout, C12 row count, C14
  dimensions). This follows the final document; spec §6.4 needs an update.
- Not yet: C1–C8 main bars (shape and lengths), the C12/C13 bar lengths and
  shapes, the drawing check of the coping sheet, and the ③ screen.

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

50 lines
2.1 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 { barsAcross, bearingBlockRebar, blockBars, totals } from '../src/core/rebar/bearing-block';
import { loadP1 } from './helpers';
describe('받침블럭 철근 (spec §6.3, plan C2)', () => {
it('a 1200 block takes 8 bars at 125 mm: 7 gaps = 875, ends 162.5 each', () => {
const a = barsAcross(1200);
expect(a.count).toBe(8);
expect(a.spacing).toBe(125);
expect((a.count - 1) * a.spacing).toBe(875);
expect(a.firstEnd).toBeCloseTo(162.5, 6);
});
it('each bar is 1100 + 700 × 2 = 2500 mm long', () => {
for (const bar of blockBars(150)) expect(bar.length).toBe(2500);
});
it('coping embedment: S2 600 (front) / 550 (back), S1 619.1 (front) / 569.1 (back), as in the spec', () => {
const front = blockBars(150);
const back = blockBars(200);
expect(front.find((b) => b.name === 'S2')!.embedment).toBeCloseTo(600, 6);
expect(back.find((b) => b.name === 'S2')!.embedment).toBeCloseTo(550, 6);
expect(front.find((b) => b.name === 'S1')!.embedment).toBeCloseTo(619.1, 6);
expect(back.find((b) => b.name === 'S1')!.embedment).toBeCloseTo(569.1, 6);
});
it('P1: 10 blocks, 80 bars each of S1 and S2 (spec table: 8 本 per block)', () => {
const m = buildPier(loadP1());
const rebar = bearingBlockRebar(m);
expect(rebar).toHaveLength(10);
expect(totals(rebar)).toEqual({ S1: 80, S2: 80 });
});
});
describe('받침블럭 도면 재현 (spec §6.3)', () => {
it('integrated block 2500 × 1200: 18@125 = 2250 along (ends 50 + 75), 7@125 = 875 across (ends 50 + 113 ≈ 162.5)', () => {
const along = barsAcross(2500);
expect(along.spacing).toBe(125);
expect(along.count - 1).toBe(18);
expect((along.count - 1) * along.spacing).toBe(2250);
expect(along.firstEnd).toBeCloseTo(125, 6);
const across = barsAcross(1200);
expect(across.count - 1).toBe(7);
expect((across.count - 1) * across.spacing).toBe(875);
expect(across.firstEnd).toBeCloseTo(162.5, 6); // 50 + 75 + 37.5, printed as 50 + 113 in the drawing
});
});