Files
Pier_v1/tests/coping-steps.test.ts

32 lines
1.3 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { buildPier } from '../src/core/geometry';
import { loadP1 } from './helpers';
const m = buildPier(loadP1());
const front = m.blocks.filter((b) => b.row === '전열');
const back = m.blocks.filter((b) => b.row === '후열');
describe('② 코핑 계단 구간 표 (2단계 읽기 전용, 시안 삽도)', () => {
it('P1 has five step segments from 0.000 to 12.000 m, as in the 삽도', () => {
expect(m.segments.length).toBe(5);
expect(m.segments[0].s0).toBeCloseTo(0, 6);
expect(m.segments[0].s1).toBeCloseTo(2.196, 3);
expect(m.segments[4].s1).toBeCloseTo(12, 6);
});
it('the front and back coping tops are 43.411 and 43.411 in the first segment, with no lateral step', () => {
expect(m.segments[0].top).toBeCloseTo(43.411, 3);
expect(back[0].bottom).toBeCloseTo(43.411, 3);
expect(Math.round((m.segments[0].top - back[0].bottom) * 1000)).toBe(0);
});
it('block heights including the 50 mm pad are 150 at the front and 200 at the back, as in the 삽도', () => {
expect(Math.round((front[0].padTop - front[0].bottom) * 1000)).toBe(150);
expect(Math.round((back[0].padTop - back[0].bottom) * 1000)).toBe(200);
});
it('d_IP2 is 1.134 m, as in the 삽도', () => {
expect(m.dIp2).toBeCloseTo(1.134, 3);
});
});