- 받침 기준 카드, 도면 불러오기(xlsx·csv·dxf), 도면 참조 표·오버레이 제거 - 교각마다 솔플레이트 규칙 입력: 받침높이 H(솔플레이트 포함) 211, 교직 L 1000, 교축 W 1100, 종단 기울기 S −0.5 % (기본값, 가정 표시) - 중심 두께 T = ⌈22 + L·|S|/200⌉ 로 계산해 얇은 쪽 T2가 22 mm 이상이 되게 함 (기본값 T 25, T2 22.5, h3 = H − T = 186) - geometry·scene·SVG는 교각 규칙에서 만든 같은 솔플레이트 계획을 모든 받침에 사용 Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
42 lines
1.8 KiB
TypeScript
42 lines
1.8 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
||
import { SOLPLATE_RULE_DEFAULT, solplateCenterT, solplatePlan, solplateRuleIssues } from '../src/core/solplate-rule';
|
||
|
||
describe('솔플레이트 규칙 (C안, 2026-11-03)', () => {
|
||
it('default 211 · 1000 × 1100 · −0.5 %: T = 25, T1 = 27.5, T2 = 22.5, h3 = 211 − 25 = 186', () => {
|
||
const p = solplatePlan(SOLPLATE_RULE_DEFAULT);
|
||
expect(p.T).toBe(25);
|
||
expect(p.T1).toBeCloseTo(27.5, 9);
|
||
expect(p.T2).toBeCloseTo(22.5, 9);
|
||
expect(p.h3).toBe(186);
|
||
expect(p.L).toBe(1000);
|
||
expect(p.W).toBe(1100);
|
||
});
|
||
|
||
it('the centre thickness is the smallest whole mm that keeps T2 at 22 mm or more', () => {
|
||
for (const [L, S] of [[1000, -0.5], [1100, -0.5], [1000, -2], [800, -1.91], [1200, -3]] as const) {
|
||
const T = solplateCenterT(L, S);
|
||
expect(T - (L * Math.abs(S)) / 200).toBeGreaterThanOrEqual(22);
|
||
expect(solplateCenterT(L, S) - 1 - (L * Math.abs(S)) / 200).toBeLessThan(22);
|
||
}
|
||
});
|
||
|
||
it('T1 + T2 = 2T for any rule', () => {
|
||
const p = solplatePlan({ heightMm: 220, lengthMm: 900, widthMm: 800, slopePct: -1.2 });
|
||
expect(p.T1 + p.T2).toBeCloseTo(2 * p.T, 9);
|
||
});
|
||
|
||
it('the default rule has no input issues', () => {
|
||
expect(solplateRuleIssues(SOLPLATE_RULE_DEFAULT)).toEqual([]);
|
||
});
|
||
|
||
it('reports a bearing height that does not exceed the solplate centre thickness', () => {
|
||
expect(solplateRuleIssues({ ...SOLPLATE_RULE_DEFAULT, heightMm: 25 })).toHaveLength(1);
|
||
});
|
||
|
||
it('reports non-positive plan sizes and a non-numeric slope', () => {
|
||
expect(solplateRuleIssues({ ...SOLPLATE_RULE_DEFAULT, lengthMm: 0 }).length).toBeGreaterThan(0);
|
||
expect(solplateRuleIssues({ ...SOLPLATE_RULE_DEFAULT, widthMm: -1 }).length).toBeGreaterThan(0);
|
||
expect(solplateRuleIssues({ ...SOLPLATE_RULE_DEFAULT, slopePct: NaN }).length).toBeGreaterThan(0);
|
||
});
|
||
});
|