- 상세 내용 아래 「확폭 구간」 상자: 범위 안 확폭 > 0 측점을 이어진 구간으로 묶어 구간마다 켬/끔 단추(기본 켬) · 끈 구간 = options.widening_off "시작-끝,…"(측점 m) · 안 맞는 값 무시 · 횡단 자료 없으면 안내 - 횡단 측점 읽기 손잡이 pipeSections(design_structure_pipe_calc) · 구간 규칙 design_structure_widening(순수) - 물넘이 겹침 안내 = 시작 · 종료 측점을 고치라는 문구 - 시험: test_87_widening_runs(새) · ui_checks 52-10 · 52-15 시작 · 종료 측점 꼴로 맞춤 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BVPp2o6Mh2FZJr72yW3ofZ
55 lines
1.8 KiB
JavaScript
55 lines
1.8 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",
|
|
"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"),
|
|
};
|
|
process.stdout.write(JSON.stringify(out));
|