Files
Pier_v1/tests/helpers.ts
T
ypshimandClaude Opus 5.5 a0b0929e13 feat(bearing): 교각 솔플레이트를 2026-11-06 결정으로 (짝 받침 S · 열 T · 거더 하면 고정)
받침방위각_솔플레이트검토.md §3과 시안(Version 110–113)을 따른다 (사용자 결정 2026-11-06: 시안 적용).
11-03 C안(받침높이 H 고정, h3 = H − T, S 입력)을 대체한다.
- S: 교량 전체(A1, P1 … Pn, A2) 거더 짝 받침의 z 차 / 수평거리. 없으면 교각 종단경사 입력 →
  다른 열 같은 순번 값(가정, WS03) → 0 %(WS03). 받침별 직접 수정(수정됨)
- 평면 L = A + 100, W = B + 100 (받침별 A × B, 기본 700 × 640 가정), h3 181
- T = 열마다 max(22, ⌈22 + L·|S|/2⌉), 열 T 직접 수정 가능(T2 < T_min → WS02).
  T1은 오르막 쪽(3D 쐐기의 두꺼운 끝도 그쪽), T2 반대쪽
- 거더 하면 고정: 블럭 상면 = z − (T − T_ref), T_ref 30
- 짝 받침은 불러오기·프로젝트 열기 때 교량 전체로 계산해 교각 생성에 넘김
- ② 카드: h3·T_ref·T_min·여유·열 T·종단경사 입력, 표에 짝 받침·S 근거·받침별 S/A/B 수정·검산 W08·검사
- P1 검증(A1과 함께): S −1.908 … −1.902 %, L 800 · W 740 · T 30 · T1 38 · T2 22, 블럭 높이 변화 없음
- 블럭·솔플레이트 테스트는 A1–P1 짝 문맥으로 실행 (짝이 없으면 S 0 · T 22 · 블럭 +8 mm)
교대(QA-15 C안)와 Pier 시트 종단경사 열 읽기는 아직 남음.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 14:48:10 +09:00

49 lines
2.3 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 { readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import * as XLSX from 'xlsx';
import { parseWorkbook } from '../src/core/parseWorkbook';
import type { PierInput } from '../src/core/types';
import { parseAbutments } from '../src/core/abut/parse';
import { type BearingPair, girderPairs } from '../src/core/bearing-pair';
import { buildPier, type PierModel } from '../src/core/geometry';
/** Spec workbook (RAG/Pier ui_xxx.xlsx, sheet intent.PR, all tables on one sheet). Used by single-sheet tests. */
const SPEC_PATH = fileURLToPath(new URL('../public/samples/P1.xlsx', import.meta.url));
/** User input (RAG/운곡교P1입력.xlsx, three sheets 교각 · IP · 받침). This is the P1 input used by the app and tests. */
const INPUT_PATH = fileURLToPath(new URL('../public/samples/운곡교P1입력.xlsx', import.meta.url));
export function loadWorkbook(path: string = SPEC_PATH): XLSX.WorkBook {
return XLSX.read(readFileSync(path), { type: 'buffer' });
}
export function loadInputWorkbook(): XLSX.WorkBook {
return loadWorkbook(INPUT_PATH);
}
export function loadP1(): PierInput {
const { piers, issues } = parseWorkbook(loadInputWorkbook());
if (issues.length) throw new Error(`P1 parse issues: ${JSON.stringify(issues)}`);
const p1 = piers.find((p) => p.name === 'P1');
if (!p1) throw new Error('P1 not found');
return p1;
}
/**
* P1 with its bridge context (2026-11-06): the girder pairs A1 ①–⑤ ↔ P1 ①–⑤ from the same input workbook, so the
* solplate slope S is computed (−1.908 … −1.902 %, T 30) as in the app where A1 is loaded with P1.
*/
export function p1Pairs(): BearingPair[] {
const a1 = parseAbutments(loadInputWorkbook()).abutments.find((a) => a.name === 'A1');
if (!a1) throw new Error('A1 not found');
const p1 = loadP1();
return girderPairs([
{ name: 'A1', bearings: a1.bearings.map((b) => ({ no: b.no, x: b.pos.e, y: b.pos.n, z: b.z, azimuthDeg: b.azimuthDeg! })) },
{ name: p1.name, bearings: p1.bearings.map((b) => ({ no: b.no, x: b.x, y: b.y, z: b.z, azimuthDeg: b.azimuthDeg })) },
]);
}
/** buildPier for P1 (with changes) in its bridge context. */
export function buildP1(changes: Partial<PierInput> = {}): PierModel {
return buildPier({ ...loadP1(), ...changes }, { pairs: p1Pairs() });
}