diff --git a/B06_Section/B06_Section_Engine_Design_Geometry.py b/B06_Section/B06_Section_Engine_Design_Geometry.py index bc790a10..cefdf8c2 100644 --- a/B06_Section/B06_Section_Engine_Design_Geometry.py +++ b/B06_Section/B06_Section_Engine_Design_Geometry.py @@ -127,9 +127,12 @@ class _SectionGeometry: auto_ditch = True # ground_at 이 없으면 보수적으로 생성 choice = ditch_choice if choice is None and legacy_ditch_enabled is not None: - choice = ( - None if bool(legacy_ditch_enabled) == auto_ditch else bool(legacy_ditch_enabled) - ) + choice = bool(legacy_ditch_enabled) + # ⚠ **자동과 같은 값을 고른 것은 「자동」으로 본다**(2026-09-09). 화면 토글이 2단이라 + # 「자동으로 되돌리기」 단추가 없다 — 되돌리려면 원래 값으로 다시 누르는 수밖에 + # 없는데, 그것을 선택으로 굳히면 **다시 같은 병**(지형이 바뀌어도 안 따라감)이 된다. + if choice is not None and bool(choice) == auto_ditch: + choice = None # 양성(both_fill)은 측구가 설 자리가 없다 — 선택보다 기하가 먼저다. self.has_ditch = auto_ditch if (choice is None or section_mode == "both_fill") else choice #: 그 측점에 **사용자가 정한 선택**(없으면 자동). 결과와 갈라 내보낸다. diff --git a/common_util/common_util_cross_design_geometry.ts b/common_util/common_util_cross_design_geometry.ts index 2dd43f0a..a4cb1081 100644 --- a/common_util/common_util_cross_design_geometry.ts +++ b/common_util/common_util_cross_design_geometry.ts @@ -193,8 +193,12 @@ export class SectionGeometry { let choice = params.ditchChoice ?? null; const legacy = params.ditchEnabled; if (choice === null && legacy !== null && legacy !== undefined) { - choice = Boolean(legacy) === autoDitch ? null : Boolean(legacy); + choice = Boolean(legacy); } + // ⚠ **자동과 같은 값을 고른 것은 「자동」으로 본다**(짝: 파이썬). 토글이 2단이라 + // 「자동으로 되돌리기」 단추가 없고, 원래 값으로 다시 누른 것을 선택으로 굳히면 + // **다시 같은 병**이 된다. + if (choice !== null && Boolean(choice) === autoDitch) choice = null; // 양성(both_fill)은 측구가 설 자리가 없다 — 선택보다 기하가 먼저다. this.hasDitch = choice === null || params.sectionMode === "both_fill" ? autoDitch : choice; /** 그 측점에 **사용자가 정한 선택**(없으면 자동). 결과와 갈라 내보낸다. */