feat(rebar): rebar strength per 규격 prefix as inputs on ③ (D SD300, H SD400, S SD500)
fyH and fyS become a grade per prefix (D · H · S), chosen from SD300 · SD400 · SD500. The defaults are the P1 values, so the P1 results do not change. Each bar takes its grade from its 규격 (fyOf). The 철근표 has a 강도 column. Older files that stored fyH / fyS are read into the grade map. Only fck is still an assumed value (I02). Approved 2026-10-23. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
398fa997e2
commit
b3533b69df
11 files changed
+102
-37
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, fyH: 400, fyS: 500 } };
|
||||
expect(parseProject(serializeProject(withCommon)).common).toEqual({ fck: 35, fyH: 400, fyS: 500 });
|
||||
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 } });
|
||||
expect(parseProject(serializeProject(p)).common).toBeUndefined();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,36 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { buildPier } from '../src/core/geometry';
|
||||
import { DEFAULT_MATERIAL, fyOf, isAssumedMaterial, materialFrom } from '../src/core/rebar/common';
|
||||
import { rebarSummary } from '../src/core/rebar/summary';
|
||||
import { loadP1 } from './helpers';
|
||||
|
||||
describe('③ 철근 강도: 규격 접두어별 입력 (승인 2026-10-23)', () => {
|
||||
it('defaults: D = SD300, H = SD400, S = SD500, the same as the P1 values', () => {
|
||||
expect(DEFAULT_MATERIAL.grade).toEqual({ D: 300, H: 400, S: 500 });
|
||||
expect(fyOf(DEFAULT_MATERIAL, 'H19')).toBe(400);
|
||||
expect(fyOf(DEFAULT_MATERIAL, 'S32')).toBe(500);
|
||||
expect(fyOf(DEFAULT_MATERIAL, 'D22')).toBe(300);
|
||||
});
|
||||
|
||||
it('only fck is assumed now; the grades are confirmed inputs', () => {
|
||||
expect(isAssumedMaterial(DEFAULT_MATERIAL)).toBe(true);
|
||||
expect(isAssumedMaterial({ ...DEFAULT_MATERIAL, fck: 35 })).toBe(false);
|
||||
expect(isAssumedMaterial({ ...DEFAULT_MATERIAL, grade: { D: 300, H: 400, S: 400 } })).toBe(true);
|
||||
});
|
||||
|
||||
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 } });
|
||||
});
|
||||
|
||||
it('a value outside SD300 · SD400 · SD500 falls back to the default for its prefix', () => {
|
||||
expect(materialFrom({ fck: 27, grade: { S: 600 } }).grade.S).toBe(500);
|
||||
expect(materialFrom(undefined)).toEqual(DEFAULT_MATERIAL);
|
||||
});
|
||||
|
||||
it('the P1 values do not change with the defaults (S = SD500 gives the same C7 length)', () => {
|
||||
const model = buildPier(loadP1());
|
||||
const base = rebarSummary(model).rows.find((r) => r.name === 'C7')!.length;
|
||||
const same = rebarSummary(model, materialFrom({ fck: 27, grade: { D: 300, H: 400, S: 500 } })).rows.find((r) => r.name === 'C7')!.length;
|
||||
expect(same).toBe(base);
|
||||
});
|
||||
});
|
||||
@@ -27,7 +27,7 @@ describe('③ 공통 설정: fck · fy 입력 (spec §6.2)', () => {
|
||||
});
|
||||
|
||||
it('a non-default material drops the I02 warning', () => {
|
||||
const codes = rebarSummary(model, { ...DEFAULT_MATERIAL, fyS: 600 }).warnings.map((w) => w.code);
|
||||
const codes = rebarSummary(model, { ...DEFAULT_MATERIAL, fck: 35 }).warnings.map((w) => w.code);
|
||||
expect(codes).not.toContain('I02');
|
||||
});
|
||||
});
|
||||
@@ -23,7 +23,7 @@ describe('② 부재별 fck (spec §6.2 · ②)', () => {
|
||||
const common = { ...DEFAULT_MATERIAL, fck: 30 };
|
||||
expect(materialFor(common, { coping: 35 }, 'coping').fck).toBe(35);
|
||||
expect(materialFor(common, { coping: 35 }, 'column').fck).toBe(30);
|
||||
expect(materialFor(common, { coping: 35 }, 'coping').fyS).toBe(common.fyS);
|
||||
expect(materialFor(common, { coping: 35 }, 'coping').grade).toEqual(common.grade);
|
||||
});
|
||||
|
||||
it('a coping fck changes only the coping rows (C15 stair legs use the H19 development length)', () => {
|
||||
|
||||
Reference in new issue
Block a user