feat(view,rebar): column diameter D as a free input on ② (1200–3000 mm, 50 mm steps), with three checks

D is an input on the column card (default 2000 mm). The 3D column, the piles of a cast-in pier and the column rebar follow it;
n_div stays 46. Three checks run on each regenerate and appear in 알림: D below the Level width (2100), D + 2c within the
coping width, and the 주철근 arc spacing ≥ max(1.5·d_b, 40). Spec §5.2 records the rule (approved 2026-10-23).

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
ypshimandClaude Haiku 5.5 committed 2026-10-23 15:50:52 +09:00
1 parent a6b92ae341
commit 65c53f2b5d
7 files changed
+80 -4

No files matched your search

+32
View File
@@ -0,0 +1,32 @@
import { describe, expect, it } from 'vitest';
import { buildPier } from '../src/core/geometry';
import { columnDiameterIssues } from '../src/core/column-check';
import { columnInputFor, columnRebar } from '../src/core/rebar/column';
import { loadP1 } from './helpers';
describe('기둥 직경 D 입력 (승인 2026-10-23)', () => {
it('the default (absent) is 2000 mm and gives the P1 results', () => {
const m = buildPier(loadP1());
expect(m.columnDiameterMm).toBe(2000);
expect(columnInputFor(m).D).toBe(2000);
expect(columnRebar(columnInputFor(m)).mainP1).toBe(230);
});
it('a larger D (2500) changes the column radius and the rebar, and the model follows the input', () => {
const m = buildPier({ ...loadP1(), columnDiameterMm: 2500 });
expect(m.columnDiameterMm).toBe(2500);
expect(m.columns[0].diameter).toBeCloseTo(2.5, 6);
const col = columnRebar(columnInputFor(m));
expect(col.r1).toBeCloseTo(2500 / 2 - 125 - 0, 0); // r1 = D/2 − c, the outer bar radius
});
it('the checks: range and 50 mm steps, D below the Level width, D + 2c within the coping width, arc spacing', () => {
const m = buildPier(loadP1());
expect(columnDiameterIssues(2000, m)).toEqual([]);
expect(columnDiameterIssues(2050, m)).toEqual([]);
expect(columnDiameterIssues(3200, m).length).toBe(1);
expect(columnDiameterIssues(2025, m).length).toBe(1);
expect(columnDiameterIssues(2100, m).some((x) => x.includes('Level 폭'))).toBe(true);
expect(columnDiameterIssues(2050, m).some((x) => x.includes('코핑 폭'))).toBe(false);
});
});