feat(bearing): 솔플레이트 규칙을 교각별 입력으로 바꾸고 도면 불러오기 제거 (C안)
- 받침 기준 카드, 도면 불러오기(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>
This commit is contained in:
1 parent
f25e36c050
commit
36b26209df
23 files changed
+257
-1081
No files matched your search
@@ -2,44 +2,38 @@ import { describe, expect, it } from 'vitest';
|
||||
import * as THREE from 'three';
|
||||
import { buildPier } from '../src/core/geometry';
|
||||
import { solplateGeometry } from '../src/core/solplate';
|
||||
import { BEARING_ELEVATION_REF, SOLPLATE_REF } from '../src/core/bearing-ref';
|
||||
import { buildPierScene } from '../src/view/scene';
|
||||
import { loadP1 } from './helpers';
|
||||
|
||||
const plans = SOLPLATE_REF.map((s, i) => ({ no: s.no, A: BEARING_ELEVATION_REF[i].A, B: BEARING_ELEVATION_REF[i].B, S: s.s }));
|
||||
|
||||
describe('솔플레이트 모델과 3D (2단계, 승인 2026-10-23)', () => {
|
||||
it('without plans there is no solplate; with plans every bearing has one', () => {
|
||||
expect(buildPier(loadP1()).blocks.every((b) => b.plan === undefined)).toBe(true);
|
||||
const m = buildPier({ ...loadP1(), bearingPlans: plans, solplate: { T: 30, margin: 100, h3: 181 } });
|
||||
expect(m.blocks.every((b) => b.plan !== undefined)).toBe(true);
|
||||
expect(m.blocks[0].plan!.A).toBe(700);
|
||||
describe('솔플레이트 모델과 3D (C안, 2026-11-03)', () => {
|
||||
it('every pier has a solplate plan from its rule; the default gives T 25 and h3 186', () => {
|
||||
const m = buildPier(loadP1());
|
||||
expect(m.blocks.every((b) => b.plan.T === 25 && b.plan.h3 === 186)).toBe(true);
|
||||
});
|
||||
|
||||
it('the 3D scene has one solplate wedge per bearing, and its height is the bearing top plus T', () => {
|
||||
const m = buildPier({ ...loadP1(), bearingPlans: plans, solplate: { T: 30, margin: 100, h3: 181 } });
|
||||
it('a pier rule changes its own plan: 받침높이 211 and slope −1 % give T 27 and h3 184', () => {
|
||||
const m = buildPier({ ...loadP1(), solplate: { heightMm: 211, lengthMm: 1000, widthMm: 1100, slopePct: -1 } });
|
||||
expect(m.blocks[0].plan.T).toBe(27);
|
||||
expect(m.blocks[0].plan.h3).toBe(184);
|
||||
});
|
||||
|
||||
it('the 3D scene has one solplate wedge per bearing, and its highest point is the thick end of the tallest one', () => {
|
||||
const m = buildPier(loadP1());
|
||||
const scene = buildPierScene(m);
|
||||
const wedges = scene.parts.solplates.children;
|
||||
expect(wedges.length).toBe(10);
|
||||
const box = new THREE.Box3().setFromObject(scene.parts.solplates);
|
||||
// The highest point is the thick (시점) end of the tallest wedge: underside (block top + h3) + T1.
|
||||
const top = Math.max(...m.blocks.map((b) => solplateGeometry(b, 181, { A: b.plan!.A, B: b.plan!.B, margin: 100, T: 30, slopePct: b.plan!.S }).bottom + solplateGeometry(b, 181, { A: b.plan!.A, B: b.plan!.B, margin: 100, T: 30, slopePct: b.plan!.S }).T1));
|
||||
const top = Math.max(...m.blocks.map((b) => solplateGeometry(b, b.plan).bottom + solplateGeometry(b, b.plan).T1));
|
||||
expect(box.max.y).toBeCloseTo(top, 3);
|
||||
});
|
||||
|
||||
it('without plans the scene has an empty solplate part', () => {
|
||||
it('the 교량받침 본체 is one box per bearing: the plan less 100 mm on each side, height h3 (186 mm)', () => {
|
||||
const scene = buildPierScene(buildPier(loadP1()));
|
||||
expect(scene.parts.solplates.children.length).toBe(0);
|
||||
});
|
||||
|
||||
it('the 교량받침 본체 is one box per bearing: the solplate plan less 100 mm on each side, height h3 (181 mm)', () => {
|
||||
const m = buildPier({ ...loadP1(), bearingPlans: plans, solplate: { T: 30, margin: 100, h3: 181 } });
|
||||
const scene = buildPierScene(m);
|
||||
const bodies = scene.parts.bearings.children;
|
||||
expect(bodies.length).toBe(10);
|
||||
const one = new THREE.Box3().setFromObject(bodies[0]);
|
||||
expect(one.max.y - one.min.y).toBeCloseTo(0.181, 3);
|
||||
// Body 1: L = 800 − 200 = 600 across the 교각축 직각, W = 740 − 200 = 540 along the 교축; the row skew turns it a few degrees.
|
||||
expect(Math.max(one.max.x - one.min.x, one.max.z - one.min.z)).toBeGreaterThan(0.54);
|
||||
expect(one.max.y - one.min.y).toBeCloseTo(0.186, 3);
|
||||
// Body: L − 200 = 800 across the 교각축 직각, W − 200 = 900 along the 교축; the row skew turns it a few degrees.
|
||||
expect(Math.max(one.max.x - one.min.x, one.max.z - one.min.z)).toBeGreaterThan(0.85);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user