Each bearing gets a solplate wedge: tapered along the 교축 with T1 on the 시점 side, underside at the bearing top (block top + h3). A, B come from the drawing's ELEVATION table, S and T1/T2 from the SOLPLATE table (NO, S(%), L, W, T, T1, T2), read by position. The 공통 규칙 (T 30, margin 100, h3 181) feed the plan; changing them regenerates the piers. A new "솔플레이트" part can be shown or hidden. A solplate table is read only when its S values are found; a missing S is reported. Also commits the option-1 test change (drawing EL.X minus Excel z). Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
35 lines
1.9 KiB
TypeScript
35 lines
1.9 KiB
TypeScript
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);
|
|
});
|
|
|
|
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 } });
|
|
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));
|
|
expect(box.max.y).toBeCloseTo(top, 3);
|
|
});
|
|
|
|
it('without plans the scene has an empty solplate part', () => {
|
|
const scene = buildPierScene(buildPier(loadP1()));
|
|
expect(scene.parts.solplates.children.length).toBe(0);
|
|
});
|
|
});
|