Files
Aislo/resources/tester/helper_349_0v_span.cjs
T
eomsangdonandClaude Opus 5.5 0714e9653e feat(B05 종단): 종단곡선 기본 L 20 m · 초기값 R 500 m 넘는 꼭짓점 곡선 없음 · 법정 R · L 미달 경고 (432-1)
- config 기본 L 20 · 초기값 직선 문턱 500 m ↔ TS `logic/B05_Profile_Profile_CurveLaw.ts` 상수 짝
- 초기값(1차 지반 종단 · 추천 [적용])만 정책 `no_curve_keys` 로 얼림 · 손 편집 · R 이면 기본 곡선
- 법정 종단곡선 최소 R · L 미달 = 경고 글(파이썬 · TS 같은 글) + 종단 요약줄 「종단곡선 미달」
- 노선 [저장]은 옛 정책(L · 열쇠) 이어받음 · 바뀐 자리 새 꼭짓점만 새 지반 열쇠(`carry_policy` ↔ `carryNoCurveKeys`)
- 시험 test_432_1 + 헬퍼 스텁 넷

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XWh5wNNycMkbwMpACz1rte
2026-10-18 16:20:03 +09:00

61 lines
2.3 KiB
JavaScript

/* 349-0v 바뀐 구간 거울 — 화면 planline 단계 차례 그대로: 새 노선 = `buildEditedPolyline`(노드 초안) ·
* 옛 노선 = 저장 계획 폴리라인 · `changedSpan` → `carryBase` · `carryEdits`(400). 입력 argv[2] JSON · 출력 JSON.
*/
const fs = require("fs");
const path = require("path");
const ts = require(path.join(__dirname, "..", "..", "config", "node_modules", "typescript"));
const ROOT = path.join(__dirname, "..", "..");
function loadTs(file, stubs = {}) {
const js = ts.transpileModule(fs.readFileSync(path.join(ROOT, file), "utf8"), {
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 },
}).outputText;
const box = { exports: {} };
const localRequire = (request) => {
if (stubs[request]) return stubs[request];
throw new Error(`stub 없음: ${request} (${file})`);
};
new Function("exports", "module", "require", js)(box.exports, box, localRequire);
return box.exports;
}
const curve = loadTs("B05_Profile/logic/B05_Profile_UI_RouteEdit_Curve.ts");
const straightJudge = loadTs("B05_Profile/logic/B05_Profile_Profile_Straight.ts");
const curveLaw = loadTs("B05_Profile/logic/B05_Profile_Profile_CurveLaw.ts");
const pivot = loadTs("B05_Profile/logic/B05_Profile_UI_Profile_Pivot.ts", {
"./B05_Profile_Profile_Straight": straightJudge,
});
const alignment = loadTs("B05_Profile/logic/B05_Profile_UI_Profile_Alignment.ts", {
"./B05_Profile_UI_Profile_Pivot": pivot,
"./B05_Profile_Profile_Straight": straightJudge,
"./B05_Profile_Profile_CurveLaw": curveLaw,
});
const carry = loadTs("B05_Profile/logic/B05_Profile_Grade_Carry.ts", {
"./B05_Profile_UI_Profile_Alignment": alignment,
});
const input = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
const xy = (line) => line.map(([x, y]) => ({ x, y }));
const built = curve.buildEditedPolyline(
input.nodes,
input.curveOn,
input.curveRadius,
input.minRadiusM,
);
const old = xy(input.old_line);
const now = xy(built.vertices);
const span = carry.changedSpan(old, now);
process.stdout.write(
JSON.stringify({
new_line: built.vertices,
span,
result: span
? {
basePvi: carry.carryBase(old, now, input.base_pvi, input.ground_pvi),
edits: carry.carryEdits(old, now, input.base_pvi, input.edits, input.stations, 20),
}
: null,
}),
);