feat(rebar): 주철근 기본간격·끝단 여유를 입력과 연동, CP04 홀수 개수 경고
- widthLayout이 코핑 배근 입력(mainSpacing, mainEndGap)을 받는다. 결과에 spacing 필드 추가 - 3D 주철근 위치의 125 하드코딩 제거 (철근표와 3D가 같은 간격을 씀) - CP04: 주철근 개수 n+3이 홀수면 cycle-1·cycle-2 분할 불가 경고 (적용은 막지 않음) - P1 기본값(125 · 80)에서는 결과와 경고 없음 (테스트로 확인) Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d2c5f90092
commit
1e6b8db7e9
4 files changed
+44
-12
No files matched your search
@@ -1,6 +1,10 @@
|
||||
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 { buildPier } from '../src/core/geometry';
|
||||
import { rebarSummary } from '../src/core/rebar/summary';
|
||||
import { DEFAULT_COPING_REBAR } from '../src/core/rebar/coping-settings';
|
||||
import { loadP1 } from './helpers';
|
||||
|
||||
describe('C1–C8 상·하면 주철근 (코핑철근.md §5, plan C3)', () => {
|
||||
it('nominal diameters: H29 28.6, S32 31.8 (documents use these, not the round numbers)', () => {
|
||||
@@ -19,6 +23,26 @@ describe('C1–C8 상·하면 주철근 (코핑철근.md §5, plan C3)', () => {
|
||||
expect(w.text).toBe('127 · 110.5 · 21@125 · 110.5 · 127');
|
||||
});
|
||||
|
||||
it('주철근 기본간격 input drives the layout: 140 → 19@140 (22 bars, even), 120 → 22@120 (25, odd)', () => {
|
||||
const w140 = widthLayout(3100, { ...DEFAULT_COPING_REBAR, mainSpacing: 140 });
|
||||
expect(w140.spacing).toBe(140);
|
||||
expect(w140.n).toBe(19);
|
||||
expect(w140.count).toBe(22);
|
||||
expect(w140.text).toBe(`${w140.yE} · ${w140.g} · 19@140 · ${w140.g} · ${w140.yE}`);
|
||||
const w120 = widthLayout(3100, { ...DEFAULT_COPING_REBAR, mainSpacing: 120 });
|
||||
expect(w120.n).toBe(22);
|
||||
expect(w120.count).toBe(25);
|
||||
});
|
||||
|
||||
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([]);
|
||||
const odd = buildPier({ ...loadP1(), copingRebar: { mainSpacing: 120 } });
|
||||
const warnings = rebarSummary(odd).warnings.filter((w) => w.code === 'CP04');
|
||||
expect(warnings).toHaveLength(1);
|
||||
expect(warnings[0].target).toBe('coping');
|
||||
});
|
||||
|
||||
it('heights: 43.284 / 43.184 / 43.084 for the three top rows (상면 단 간격 100)', () => {
|
||||
expect(topRowEl(43.284, 1)).toBe(43.284);
|
||||
expect(topRowEl(43.284, 2)).toBe(43.184);
|
||||
|
||||
Reference in new issue
Block a user