- 옮김: B04 2 · B05 23 · B06 11 · A00_Common/design 13 (9,299 줄) · 이미 logic/ 에 있던 16 파일 그대로 - 안 옮김: 묶음 입구(package.json build:*) · 파이썬 · 순수지만 계산 아닌 8 (보기 결선 · 콜백 · API 타입 · 갈아끼움 알림판) - import 266 줄(142 파일) · 시험 · 주석 · 짝 표시 문자열 경로 고침 · B05 · B06 CLAUDE.md 짝 줄 logic/ - 시험 도우미 새 경로: 가짜 require 열쇠 · B05()/B06() 부름 · 형제 import 자리 · tsc 묶어 돌리는 시험 · 정규식 · rglob - design_view_cross 줄 한도 시험 685 → 688 (긴 import 경로 줄바꿈 3줄) - 확인: typecheck 0 · 서버 묶음 넷(corridor · server-calc · b07-extent · b07-note) 다시 지어 코드 같음(//#region 경로 주석만 다름) · 관련 시험 270 파일 — 남은 실패 19 는 옮기기 전과 같음 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014utrjfoW831Vc5wJUd13kL
68 lines
2.3 KiB
JavaScript
68 lines
2.3 KiB
JavaScript
/* 노면공 확폭 구간 규칙(PLAN 87-3) — `design_structure_widening.ts` 를 그 자리에서 트랜스파일해 Node 로 돌림. */
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
const ts = require(path.join(__dirname, "..", "..", "config", "node_modules", "typescript"));
|
|
|
|
const file = path.join(
|
|
__dirname,
|
|
"..",
|
|
"..",
|
|
"A00_Common",
|
|
"design",
|
|
"logic/design_structure_widening.ts",
|
|
);
|
|
const js = ts.transpileModule(fs.readFileSync(file, "utf8"), {
|
|
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 },
|
|
}).outputText;
|
|
const box = { exports: {} };
|
|
new Function("exports", "module", js)(box.exports, box);
|
|
const w = box.exports;
|
|
|
|
// 곡선 둘(앞 No.1+0~No.3+0 · 뒤 No.5+0~No.6+0) 사이에 직선 측점 하나 — 확폭 좌우 합
|
|
const at = (chainage_m, left = 0, right = 0) => ({
|
|
chainage_m,
|
|
design: { widening_left_m: left, widening_right_m: right },
|
|
});
|
|
const stations = [
|
|
at(0),
|
|
at(20, 0.3, 0),
|
|
at(40, 0.75, 0),
|
|
at(60, 0.4, 0),
|
|
at(80),
|
|
at(100, 0, 0.5),
|
|
at(120, 0, 0.6),
|
|
at(140),
|
|
];
|
|
const runs = w.wideningRuns(stations, 0, 140);
|
|
const inner = w.wideningRuns(stations, 30, 110); // 범위가 곡선을 가로지름
|
|
const off = w.formatOff([[20, 60]]);
|
|
const out = {
|
|
runs,
|
|
inner,
|
|
none: w.wideningRuns(stations, 0, 10),
|
|
fallback: w.wideningOf({ chainage_m: 1, curve_widening_m: 0.9, curve_outer_side: "left" }),
|
|
fallbackStraight: w.wideningOf({ chainage_m: 1, curve_widening_m: 0.9, curve_outer_side: null }),
|
|
off,
|
|
parsed: w.parseOff("20-60, 100-120,bad,5"),
|
|
isOff: runs.map((r) => w.isRunOff(r, off)),
|
|
toggledOff: w.toggleRun(runs, "", runs[1]),
|
|
toggledBoth: w.toggleRun(runs, off, runs[1]),
|
|
toggledOn: w.toggleRun(runs, off, runs[0]),
|
|
stale: w.offForRuns(runs, "20-60,0-5,100-130"),
|
|
empty: w.offForRuns([], "20-60"),
|
|
// 확폭 면적(138-2) — 앞뒤 확폭 0 측점까지 사다리꼴 · 범위로 자름
|
|
area: runs.map((r) => w.wideningArea(stations, r, { start: 0, end: 140 })),
|
|
areaClipped: w.wideningArea(stations, runs[0], { start: 30, end: 140 }),
|
|
areaSingle: w.wideningArea(
|
|
[at(0), at(20, 1, 0), at(40)],
|
|
{ start_m: 20, end_m: 20, widening_m: 1 },
|
|
{ start: 0, end: 40 },
|
|
),
|
|
areaMissing: w.wideningArea(
|
|
stations,
|
|
{ start_m: 999, end_m: 999, widening_m: 1 },
|
|
{ start: 0, end: 140 },
|
|
),
|
|
};
|
|
process.stdout.write(JSON.stringify(out));
|