feat(view): round bar bends at the centre-line radius; bend factors as inputs on ③
Bars drawn through several points are one tube each, with every bend rounded by R·tan(φ/2) at the centre-line radius (inner factor × d + d/2). The inside-radius factors (D16 and below, D19–D25, D29–D35, D38 and above) are inputs in 공통 설정, with KDS-based defaults 2 / 3 / 4 / 5. The size-class limits sit in one place (SIZE_CLASS), which also fixes D25 (25.4) being read as the D29–D35 class in hookLength. The helper bendDeduction gives the centre-line deduction for the length option, which is not yet applied to the 철근표 lengths. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
03bb1f9929
commit
30e5e75c22
7 files changed
+146
-21
No files matched your search
@@ -68,8 +68,8 @@ describe('project file round trip (spec §8, plan B3)', () => {
|
||||
describe('③ 공통 설정 in the project file', () => {
|
||||
it('fck and fy are kept through save and open; older files get the defaults through the app', () => {
|
||||
const p = sampleProject();
|
||||
const withCommon = { ...p, common: { fck: 35, grade: { D: 300, H: 400, S: 500 } } };
|
||||
expect(parseProject(serializeProject(withCommon)).common).toEqual({ fck: 35, grade: { D: 300, H: 400, S: 500 } });
|
||||
const withCommon = { ...p, common: { fck: 35, grade: { D: 300, H: 400, S: 500 }, bend: { small16: 2, main25: 3, main35: 4, main51: 5 } } };
|
||||
expect(parseProject(serializeProject(withCommon)).common).toEqual(withCommon.common);
|
||||
expect(parseProject(serializeProject(p)).common).toBeUndefined();
|
||||
});
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { buildPier } from '../src/core/geometry';
|
||||
import { DEFAULT_MATERIAL, fyOf, isAssumedMaterial, materialFrom } from '../src/core/rebar/common';
|
||||
import { DEFAULT_BEND, DEFAULT_MATERIAL, fyOf, isAssumedMaterial, materialFrom } from '../src/core/rebar/common';
|
||||
import { rebarSummary } from '../src/core/rebar/summary';
|
||||
import { loadP1 } from './helpers';
|
||||
|
||||
@@ -19,7 +19,7 @@ describe('③ 철근 강도: 규격 접두어별 입력 (승인 2026-10-23)', ()
|
||||
});
|
||||
|
||||
it('an older file that stored fyH / fyS is read into the grade map', () => {
|
||||
expect(materialFrom({ fck: 35, fyH: 400, fyS: 400 })).toEqual({ fck: 35, grade: { D: 300, H: 400, S: 400 } });
|
||||
expect(materialFrom({ fck: 35, fyH: 400, fyS: 400 })).toEqual({ fck: 35, grade: { D: 300, H: 400, S: 400 }, bend: DEFAULT_BEND });
|
||||
});
|
||||
|
||||
it('a value outside SD300 · SD400 · SD500 falls back to the default for its prefix', () => {
|
||||
@@ -34,3 +34,18 @@ describe('③ 철근 강도: 규격 접두어별 입력 (승인 2026-10-23)', ()
|
||||
expect(same).toBe(base);
|
||||
});
|
||||
});
|
||||
|
||||
import { bendDeduction, bendRadius } from '../src/core/rebar/common';
|
||||
|
||||
describe('굽힘 반경 (승인 2026-10-23, 입력)', () => {
|
||||
it('centre-line radius = inner factor × d + d/2, by size class', () => {
|
||||
expect(bendRadius(25.4, DEFAULT_BEND)).toBeCloseTo(3 * 25.4 + 12.7, 6); // H25: main25
|
||||
expect(bendRadius(28.6, DEFAULT_BEND)).toBeCloseTo(4 * 28.6 + 14.3, 6); // H29: main35
|
||||
expect(bendRadius(15.9, DEFAULT_BEND)).toBeCloseTo(2 * 15.9 + 7.95, 6); // H16: small16
|
||||
});
|
||||
|
||||
it('a 90° bend loses (2 − π/2)·R of centre line against the sharp corner', () => {
|
||||
const R = 100;
|
||||
expect(bendDeduction(Math.PI / 2, R)).toBeCloseTo((2 - Math.PI / 2) * R, 6);
|
||||
});
|
||||
});
|
||||
@@ -108,11 +108,11 @@ describe('확대기초 B9 · B10 · B11 · B12 in 3D (확대기초철근 (1).md
|
||||
expect(rb.byName.get('B9')!.length).toBe(306 * 3);
|
||||
});
|
||||
|
||||
it('B10-1 / B10-2: 18 each (9 levels × 2 faces), each three pieces; B11 60, B12 47', () => {
|
||||
expect(rb.byName.get('B10-1')!.length).toBe(18 * 3);
|
||||
expect(rb.byName.get('B10-2')!.length).toBe(18 * 3);
|
||||
expect(rb.byName.get('B11')!.length).toBe(60 * 3);
|
||||
expect(rb.byName.get('B12')!.length).toBe(47 * 3);
|
||||
it('B10-1 / B10-2: 18 each (9 levels × 2 faces); B11 60, B12 47 — one tube per bar (bends rounded, 수정 2026-10-23)', () => {
|
||||
expect(rb.byName.get('B10-1')!.length).toBe(18);
|
||||
expect(rb.byName.get('B10-2')!.length).toBe(18);
|
||||
expect(rb.byName.get('B11')!.length).toBe(60);
|
||||
expect(rb.byName.get('B12')!.length).toBe(47);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user