Files
Pier_v1/tests/solplate-scene.test.ts
T
ypshimandClaude Haiku 5.5 36b26209df 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>
2026-11-03 11:07:51 +09:00

40 lines
2.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, expect, it } from 'vitest';
import * as THREE from 'three';
import { buildPier } from '../src/core/geometry';
import { solplateGeometry } from '../src/core/solplate';
import { buildPierScene } from '../src/view/scene';
import { loadP1 } from './helpers';
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('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);
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('the 교량받침 본체 is one box per bearing: the plan less 100 mm on each side, height h3 (186 mm)', () => {
const scene = buildPierScene(buildPier(loadP1()));
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.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);
});
});