diff --git a/B05_Profile/B05_Profile_UI_Corridor_Modes.ts b/B05_Profile/B05_Profile_UI_Corridor_Modes.ts index fd91d5a7c..c613cbfec 100644 --- a/B05_Profile/B05_Profile_UI_Corridor_Modes.ts +++ b/B05_Profile/B05_Profile_UI_Corridor_Modes.ts @@ -17,6 +17,7 @@ import type { TerrainHeightIndex } from "./B05_Profile_UI_Corridor_Terrain"; import type { TerrainBandSplit } from "./B05_Profile_UI_Corridor_Split"; import { buildPatchSkirts } from "./B05_Profile_UI_Corridor_Skirt"; import { deformTerrain } from "./B05_Profile_UI_Corridor_Deform_Terrain"; +import { tinTerrain } from "./B05_Profile_UI_Corridor_Tin"; import { legacyCorridorOf, legacyReady } from "./B05_Profile_UI_Corridor_Legacy"; import { readStateRaw, writeStateRaw } from "../A00_Common/b_page_state"; @@ -156,7 +157,13 @@ export const CORRIDOR_MODES: CorridorMode[] = [ terrain: ({ split, build, bounds, heightIndex }) => heightIndex ? deformTerrain(split, build, bounds, heightIndex) : null, }, - // 제안 ② — 다른 창이 여기 한 줄: { id: "proposal2", corridor: …, terrain: … }, + // 제안 ②(115-6) — 노면부만 그리고 비탈 · 지형 이음은 단일 삼각망(TIN). + { + id: "proposal2", + corridor: (build) => roadOnly(build), + terrain: ({ split, build, bounds, heightIndex }) => + heightIndex ? tinTerrain(split, build, bounds, heightIndex) : null, + }, ]; export function modeOf(id: CorridorModeId): CorridorMode | null { diff --git a/resources/tester/helper_115_6_corridor_tin.cjs b/resources/tester/helper_115_6_corridor_tin.cjs index 9f7ed3f25..b1aa8229b 100644 --- a/resources/tester/helper_115_6_corridor_tin.cjs +++ b/resources/tester/helper_115_6_corridor_tin.cjs @@ -554,4 +554,17 @@ const r6 = (v) => Math.round(v * 1e6) / 1e6; results.berm = { stats: out.stats, missing, sectionErr: r6(sectionErr), gaps: gap.gaps }; } +// ⑤ 3D 방식 등록부(115-5) — 「제안 ②」 자리에 TIN 지형이 등록됐나. +{ + globalThis.window = globalThis.window || {}; + const Modes = loadTs(B05("B05_Profile_UI_Corridor_Modes")); + const mode = Modes.modeOf("proposal2"); + results.registry = { + slot: Modes.MODE_SLOTS.some(([id]) => id === "proposal2"), + registered: Boolean(mode), + hasTerrain: typeof mode?.terrain === "function", + noIndex: mode?.terrain ? mode.terrain({ heightIndex: null }) : "none", + }; +} + process.stdout.write(JSON.stringify(results)); diff --git a/resources/tester/test_115_6_corridor_tin.py b/resources/tester/test_115_6_corridor_tin.py index 2eb65b456..e0ad94d7d 100644 --- a/resources/tester/test_115_6_corridor_tin.py +++ b/resources/tester/test_115_6_corridor_tin.py @@ -73,6 +73,13 @@ def test_berm_bend_lines(results): assert r["gaps"] == 0 +def test_registered_as_proposal2(results): + r = results["registry"] + assert r["slot"] is True + assert r["registered"] is True and r["hasTerrain"] is True + assert r["noIndex"] is None # 높이 색인 없으면 다른 방식(띠 자르기)으로 + + def test_dependencies_two_only(): with open(os.path.join(ROOT, "config", "package.json"), encoding="utf-8") as f: deps = json.load(f)["dependencies"]