Files
Aislo/resources/tester/helper_368_4_probe_station.cjs
T
eomsangdonandClaude Opus 5.5 2454bd4ba0 feat(B05 종단): 원지반 점 작은 창 = 지금 계획선(초안 포함 · 묶음 같은 계산) (368-4)
- 묶음 출력 읽기만 · ground · cross 단계 함수를 그 자리 측점 하나로 다시 부름(파생 저장 · 캐시 안 씀)
- 그 자리 측점 = [측점 추가] 뒤 묶음 측점과 같은 틀 · 반경 · 확폭(logic/design_pipeline_probe_station)
- 격자 없음 · 분석 지형 다름 = 서버 미리 뜨기 + 「저장 계획선 기준」 한 줄 · 창 글에 계획고
- 묶음 cross 차례마다 떠 있는 창 다시 그림
- 거울 시험 test_368_4(곡선표 있음 · 없음 · 직선 · 곡선 안)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013QyNXY2TUKXCFMwAca2APG
2026-10-17 13:05:23 +09:00

51 lines
2.2 KiB
JavaScript

/* 368-4 아무 누가거리 측점 하나 거울 — 진짜 `design_pipeline_probe_station.ts`(probeStation) 와
* `B05_Profile_Sections_Stations.ts`(buildStations + 추가 측점)를 Node 로 돌려 같은 측점인지 냄.
* 입력 argv[2] JSON {line, curves, pipes, structures, types, at: [m...]} · 짝 = test_368_4_probe_station.py. */
const fs = require("fs");
const path = require("path");
const ts = require(path.join(__dirname, "..", "..", "config", "node_modules", "typescript"));
const CATALOG = require("./helper_322_catalog_module.cjs");
const ROOT = path.join(__dirname, "..", "..");
const cache = new Map();
function loadTs(full) {
if (cache.has(full)) return cache.get(full);
const js = ts.transpileModule(fs.readFileSync(full, "utf8"), {
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 },
}).outputText;
const box = { exports: {} };
cache.set(full, box.exports);
const localRequire = (request) => {
if (CATALOG.isCatalogRequest(request)) return CATALOG;
if (request.startsWith(".")) return loadTs(path.join(path.dirname(full), `${request}.ts`));
return require(request);
};
new Function("exports", "module", "require", js)(box.exports, box, localRequire);
return box.exports;
}
const logic = loadTs(path.join(ROOT, "B05_Profile", "logic", "B05_Profile_Sections_Stations.ts"));
const station = loadTs(path.join(ROOT, "common_util", "common_util_structure_station.ts"));
const probe = loadTs(
path.join(ROOT, "A00_Common", "design", "logic", "design_pipeline_probe_station.ts"),
);
const job = JSON.parse(fs.readFileSync(process.argv[2], "utf8"));
const build = (curves) =>
logic.buildStations(job.line, curves, job.pipes, job.structures, {
types: job.types,
stationSnap: false,
});
const out = [];
for (const curves of [job.curves, []]) {
for (const at of job.at) {
station.setPlusStations(null);
const before = build(curves);
const mine = probe.probeStation(job.line, curves, before, at);
station.setPlusStations(() => [at]);
const after = build(curves).find((s) => s.key === mine.key) ?? null;
out.push({ curves: curves.length, at, mine, after });
}
}
process.stdout.write(JSON.stringify(out));