feat(core): coping main bars C1–C8 (plan C3) and column rebar C4

- Nominal bar diameters (H29 28.6, S32 31.8, …) as used by the documents. With
  them, C7/C8 l_s = 1.3·l_d(28.6, fck 27) = 1717.6, which is the document's 1717.
- C1–C8 (코핑철근.md §5): width layout 127 · 110.5 · 21@125 · 110.5 · 127 with 24
  bars (12 + 12); heights 43.284 / 43.227 / 43.170; top bar lengths 12744 /
  12629.6 / 12515.2; bottom pieces ≈ 7448.
- C4 (기둥철근.md): P1 r 875 and P2 r 843.2; couplers P1 +3/6/9/12 m, P2 +150;
  230 + 230 main pieces and 368 couplers; tie radius 900.45; P3 38 at @300 from
  2.340; P5 19 at @120; P4 8 at @120 from −0.060; P6 8 levels × 4 = 32, length
  ≈ 2071.
- Not yet: C4 interference checks (P4 vs B11, Q-C9), bar lengths of P3/P5/P4
  and coupler shapes, the coping/column drawing checks, and the ③ screen.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-10-22 11:28:03 +09:00
1 parent b962cf1a1c
commit a403ab9641
5 files changed
+325

No files matched your search

+63
View File
@@ -0,0 +1,63 @@
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);
});
});
+45
View File
@@ -0,0 +1,45 @@
import { describe, expect, it } from 'vitest';
import { developmentLength, hookLength, NOMINAL_DIAMETER, spliceLength } from '../src/core/rebar/common';
import { bottomPiece, topBarLength, topRowEl, widthLayout } from '../src/core/rebar/coping-main';
describe('C1–C8 상·하면 주철근 (코핑철근.md §5, plan C3)', () => {
it('nominal diameters: H29 28.6, S32 31.8 (documents use these, not the round numbers)', () => {
expect(NOMINAL_DIAMETER.H29).toBe(28.6);
expect(NOMINAL_DIAMETER.S32).toBe(31.8);
});
it('width layout for B 3100: edge 127, ends 110.5, 21@125, 24 bars (12 + 12)', () => {
const w = widthLayout(3100);
expect(w.yE).toBe(127);
expect(w.S).toBe(2846);
expect(w.n).toBe(21);
expect(w.g).toBe(110.5);
expect(w.count).toBe(24);
expect(w.cyclePerKind).toBe(12);
expect(w.text).toBe('127 · 110.5 · 21@125 · 110.5 · 127');
});
it('heights: 43.284 / 43.227 / 43.170 for the three top rows', () => {
expect(topRowEl(43.284, 1)).toBe(43.284);
expect(topRowEl(43.284, 2)).toBe(43.227);
expect(topRowEl(43.284, 3)).toBe(43.17);
});
it('top bar lengths 12744 / 12629.6 / 12515.2 (path + 2 × 472 hook)', () => {
expect(topBarLength(12000, 1)).toBeCloseTo(12744, 0);
expect(topBarLength(12000, 2)).toBeCloseTo(12629.6, 0);
expect(topBarLength(12000, 3)).toBeCloseTo(12515.2, 0);
});
it('bottom piece ≈ 7448 with l_s = 1717.6 (1.3 × l_d of H29 at fck 27) — the document shows 1717', () => {
const b = bottomPiece();
expect(b.path).toBeCloseTo(12235.6, 6);
expect(b.ls).toBeCloseTo(1717.6, 0);
expect(b.piece).toBeCloseTo(7448, 0);
});
it('hook 472 (16.5 × 28.6) and splice from the same formula as C1', () => {
expect(hookLength('main90', NOMINAL_DIAMETER.H29)).toBeCloseTo(472, 0);
expect(spliceLength(NOMINAL_DIAMETER.H29, 400, 27)).toBeCloseTo(1.3 * developmentLength(NOMINAL_DIAMETER.H29, 400, 27), 9);
});
});