import { describe, expect, it } from 'vitest'; import { buildPier } from '../src/core/geometry'; import { solplateGeometry } from '../src/core/solplate'; import { loadP1, p1Pairs } from './helpers'; // P1 with its A1 girder pairs (2026-11-06): S −1.908 %, L 800 × W 740, T 30, T1 38 / T2 22, h3 181. const model = buildPier(loadP1(), { pairs: p1Pairs() }); const front1 = model.blocks.filter((b) => b.row === '전열')[0]; describe('솔플레이트 기하 (결정 2026-11-06)', () => { it('L = A + 100 = 800 along the girder and W = B + 100 = 740 across it', () => { const g = solplateGeometry(front1, front1.plan); expect(g.L).toBeCloseTo(0.8, 6); expect(g.W).toBeCloseTo(0.74, 6); }); it('T1 = 38 mm on one end, T2 = 22 mm on the other, and T1 + T2 = 2T', () => { const g = solplateGeometry(front1, front1.plan); expect(g.T1 * 1000).toBeCloseTo(38, 6); expect(g.T2 * 1000).toBeCloseTo(22, 6); expect((g.T1 + g.T2) * 1000).toBeCloseTo(60, 6); const thick = g.corners.filter((c) => Math.abs(c[1] - (g.bottom + g.T1)) < 1e-9); expect(thick.length).toBe(2); }); it('the underside is the bearing top: pad top (EL.X) + h3 (181 mm)', () => { const g = solplateGeometry(front1, front1.plan); expect(g.bottom).toBeCloseTo(front1.padTop + 0.181, 6); }); it('volume = L·W·T (the taper averages to the row thickness)', () => { const g = solplateGeometry(front1, front1.plan); expect(g.volume).toBeCloseTo(g.L * g.W * 0.03, 9); }); it('the solplate is centred on the block and follows the row direction', () => { const g = solplateGeometry(front1, front1.plan); const c = g.corners.reduce((acc, p) => [acc[0] + p[0] / 8, acc[1] + p[2] / 8] as [number, number], [0, 0]); expect(c[0]).toBeCloseTo(front1.s, 6); expect(c[1]).toBeCloseTo(front1.n, 6); }); });