Files
Pier_v1/tests/rebar-column.test.ts
T
ypshimandClaude Haiku 5.5 5cc166c2e1 feat(core): RB-C07 — delete P4 ties that interfere with the footing top bars
- A P4 is deleted when |z_P4 − z_bar| < (d_P4 + d_bar)/2 against B5 and B1
  (the 확대기초 top layer, from the 상면). B11/B12 are not checked (Q-C9 무시).
- The P6 crossties start from the first kept P4.
- Tests: the document's example keeps all 8; B5 moved to −70 deletes the P4 at
  −60; a P4 just outside the limit is kept.

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

87 lines
3.0 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 { columnRebar } from '../src/core/rebar/column';
const c = columnRebar();
describe('기둥 철근 C4 (기둥철근.md, plan C4)', () => {
it('P1 radius 875, P2 radius 843.2 (touching; centre gap = d_P1)', () => {
expect(c.r1).toBe(875);
expect(c.r2).toBe(843.2);
expect(c.angleStepDeg).toBeCloseTo(360 / 46, 9);
});
it('heights: P1 top 15147, P2 top ≈ 14539 (l_d of S32 at fck 27, 1836.9 ≈ the document 1836)', () => {
expect(c.zTop1).toBe(15147);
expect(Math.abs(c.zTop2 - 14539)).toBeLessThan(1);
});
it('couplers P1 at +3 / 6 / 9 / 12 m, P2 at +150 above each', () => {
expect(c.couplerP1).toEqual([3000, 6000, 9000, 12000]);
expect(c.couplerP2).toEqual([3150, 6150, 9150, 12150]);
});
it('main bar pieces 230 + 230, couplers 4 × 46 × 2 = 368', () => {
expect(c.mainP1).toBe(230);
expect(c.mainP2).toBe(230);
expect(c.couplers).toBe(368);
});
it('tie radius 900.45, circumference ≈ 5657.7', () => {
expect(c.tieRadius).toBe(900.45);
expect(c.tieCircumference).toBeCloseTo(5657.7, 1);
});
it('P3: l_e = 2340, 38 ties from 2.340 at @300 (top 13.440)', () => {
expect(c.zTopT).toBe(13724);
expect(c.lE).toBe(2340);
expect(c.p3Count).toBe(38);
expect(c.p3[0]).toBe(2340);
expect(c.p3[c.p3.length - 1]).toBe(13440);
});
it('P5: 19 ties @120 from 2.220 down to 0.060', () => {
expect(c.p5Count).toBe(19);
expect(c.p5[0]).toBe(2220);
expect(c.p5[c.p5.length - 1]).toBe(60);
});
it('P4: 8 ties @120 from −0.060 to −0.900 (none removed in the example)', () => {
expect(c.p4Count).toBe(8);
expect(c.p4[0]).toBe(-60);
expect(c.p4[c.p4.length - 1]).toBe(-900);
});
it('P4 semicircle ≈ 2828.9', () => {
expect(c.p4SemicircleLength).toBeCloseTo(2828.9, 0);
});
it('P6: 8 levels from −0.060 to 12.540, 4 bars each = 32, length ≈ 2071', () => {
expect(c.p6Levels).toEqual([-60, 1740, 3540, 5340, 7140, 8940, 10740, 12540]);
expect(c.p6Count).toBe(32);
expect(c.p6Length).toBeCloseTo(2071, 0);
});
});
import { deleteInterferingP4, footingTopBars } from '../src/core/rebar/column';
describe('RB-C07 P4 삭제 규칙 (기둥철근.md §6.2)', () => {
it('the example: no P4 interferes with the top bars (B5 −100, B1 −127): 8 kept, 0 deleted', () => {
expect(c.p4Count).toBe(8);
expect(c.p4Deleted).toEqual([]);
const r = deleteInterferingP4([-60, -180], footingTopBars(2000));
expect(r.deleted).toEqual([]);
});
it('hypothetical: B5 moved to −70 deletes the P4 at −60 (|−60 + 70| = 10 < 23.85)', () => {
const bars = [{ name: 'B5', z: -70, d: 28.6 }];
const r = deleteInterferingP4([-60, -180, -300], bars);
expect(r.deleted).toEqual([{ z: -60, bar: 'B5' }]);
expect(r.kept).toEqual([-180, -300]);
});
it('a P4 just outside the limit is kept: |−60 + 84| = 24 ≥ 23.85', () => {
const r = deleteInterferingP4([-60], [{ name: 'B5', z: -84, d: 28.6 }]);
expect(r.kept).toEqual([-60]);
});
});