Files
Pier_v1/tests/block-rebar-settings.test.ts
T
ypshimandClaude Haiku 5.5 e1497176ea feat(rebar): block rebar settings as input (S1·S2 spacing separate, S1 depth from the cover and bar diameters)
- PierInput.blockRebar (partial): cover top, side cover, first gap, spacing S1
  and S2 (separate), leg length. Defaults are the P1 values, so P1 is unchanged.
- S2 depth = top cover; S1 depth = top cover + S1/2 + S2/2 (H19: 69.1 at the default).
- The model carries the settings; the bearing-block rebar, the 3D bars, and the
  summary use them.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-10-26 14:08:58 +09:00

26 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { buildPier } from '../src/core/geometry';
import { barDepths, bearingBlockRebar, DEFAULT_BLOCK_REBAR, totals } from '../src/core/rebar/bearing-block';
import { loadP1 } from './helpers';
describe('받침블럭 철근 설정 (승인 2026-10-26)', () => {
it('the defaults give the P1 depths: S2 50, S1 69.1 (= 피복 + S1/2 + S2/2 with H19)', () => {
expect(barDepths(DEFAULT_BLOCK_REBAR)).toEqual({ S2: 50, S1: 50 + 19.1 });
});
it('S1 depth follows the top cover: 피복 60 → S1 79.1, S2 60', () => {
expect(barDepths({ ...DEFAULT_BLOCK_REBAR, coverTop: 60 })).toEqual({ S2: 60, S1: 60 + 19.1 });
});
it('separate spacings: S1 @100 across 1200 gives 10 bars; S2 stays @125 (8 bars)', () => {
const m = buildPier({ ...loadP1(), blockRebar: { spacingS1: 100 } });
const t = totals(bearingBlockRebar(m));
expect(t.S1).toBe(10 * 10);
expect(t.S2).toBe(8 * 10);
});
it('P1 with the defaults keeps S1 80 and S2 80', () => {
expect(totals(bearingBlockRebar(buildPier(loadP1())))).toEqual({ S1: 80, S2: 80 });
});
});