feat(rebar): 상면 주철근(C1–C6) 이음 무시/반영, 위치 기둥 중심/단부
- 기본 '이음 무시' (사양 결정). '반영'이면 정척(12000) 초과 철근을 l_s 겹침 2조각으로 나눔 - 위치: 기둥 중심 = 전체의 절반, 단부 = 정척 안에서 가장 끝 쪽 (짧은 조각 = 전체 + l_s − 12000, 긴 조각 = 12000) - 철근표 조각 목록과 비고, 3D 두 조각(l_s 겹침)에 반영 - STANDARD_BAR를 common.ts로 옮겨 순환 import 방지 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
72053be420
commit
496e0ea4e5
10 files changed
+130
-16
No files matched your search
@@ -1,6 +1,6 @@
|
||||
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';
|
||||
import { bottomPiece, topBarLength, topRowEl, topSplicePieces, widthLayout } from '../src/core/rebar/coping-main';
|
||||
import { buildPier } from '../src/core/geometry';
|
||||
import { rebarSummary } from '../src/core/rebar/summary';
|
||||
import { DEFAULT_COPING_REBAR } from '../src/core/rebar/coping-settings';
|
||||
@@ -54,6 +54,42 @@ describe('C1–C8 상·하면 주철근 (코핑철근.md §5, plan C3)', () => {
|
||||
expect([s1.spacing, s1.actual, s1.basis]).toEqual(['130', '130', 'input']);
|
||||
});
|
||||
|
||||
it('상면 이음 (승인 2026-10-26): 기둥 중심 → total/2 + l_s/2 each; 단부 → total + l_s − 12000 and 12000', () => {
|
||||
const center = topSplicePieces(12000, 1, 'center')!;
|
||||
expect(center.lap).toBeGreaterThan(1700);
|
||||
expect(center.pieces[0]).toBeCloseTo(12744 / 2 + center.lap / 2, 3);
|
||||
expect(center.pieces[1]).toBeCloseTo(center.pieces[0], 3);
|
||||
expect(center.pieces[0] + center.pieces[1]).toBeCloseTo(12744 + center.lap, 3);
|
||||
|
||||
const end = topSplicePieces(12000, 1, 'end')!;
|
||||
expect(end.pieces[0]).toBeCloseTo(12744 + end.lap - 12000, 3);
|
||||
expect(end.pieces[1]).toBeCloseTo(12000, 3);
|
||||
});
|
||||
|
||||
it('상면 이음: a bar within the standard length is not split', () => {
|
||||
expect(topSplicePieces(10000, 1, 'center')).toBeNull();
|
||||
});
|
||||
|
||||
it('철근표: 이음 무시 → 단일 길이 12744 · 반영(기둥 중심) → 2조각, 각 조각 개수 = 행 개수', () => {
|
||||
const ignore = rebarSummary(buildPier(loadP1())).rows.find((r) => r.name === 'C1')!;
|
||||
expect(ignore.length).toBeCloseTo(12744, 0);
|
||||
expect(ignore.pieces).toBeUndefined();
|
||||
|
||||
const applied = rebarSummary(buildPier({ ...loadP1(), topSplice: { mode: 'apply', at: 'center' } })).rows;
|
||||
const c1 = applied.find((r) => r.name === 'C1')!;
|
||||
const lap = topSplicePieces(12000, 1, 'center')!.lap;
|
||||
expect(c1.length).toBeNull();
|
||||
expect(c1.pieces).toHaveLength(2);
|
||||
expect(c1.pieces![0].count).toBe(c1.count);
|
||||
expect(c1.pieces![0].length).toBeCloseTo(12744 / 2 + lap / 2, 3);
|
||||
expect(c1.pieces![1].length).toBeCloseTo(12744 / 2 + lap / 2, 3);
|
||||
expect(c1.note).toContain('기둥 중심');
|
||||
|
||||
const end = rebarSummary(buildPier({ ...loadP1(), topSplice: { mode: 'apply', at: 'end' } })).rows.find((r) => r.name === 'C1')!;
|
||||
expect(end.pieces![1].length).toBeCloseTo(12000, 3);
|
||||
expect(end.note).toContain('단부');
|
||||
});
|
||||
|
||||
it('CP04: the default P1 has an even count (no warning); 기본간격 120 gives an odd count and a CP04 warning', () => {
|
||||
const base = rebarSummary(buildPier(loadP1())).warnings.filter((w) => w.code === 'CP04');
|
||||
expect(base).toEqual([]);
|
||||
|
||||
Reference in new issue
Block a user