- 하한 검사 = 모든 평면 조작이 applyEdit 에서 지난 걸음과 견줌 · 새로 깨면 그 걸음으로 되돌림 · 까닭 상태줄(끼우기 · 지우기 · 놓기 · 방향키 · 곡선 칸) · 손잡이 끌기도 걸음마다 검사 - 곡선 삭제 = 내각 155° 미만이면 막지 않고 경고(상태줄 · 알림) - 끌기 · 손잡이 놓을 때 스냅 켬이면 「함께 밀린 교점 · 못 맞춘 곡선」 보고 - 스냅 끔 · 간격 바꿈 = 계산 줄에 초안 바로(tellDraft) - R · 길이 고정 · 넣은 R = 곡선표 edits 칸(짝 B05_Profile_Route_NodeEdits.py ↔ flattenServerPlan) · 다시 열면 넣은 값으로 - 상태줄 = 겹친 노드(0.5 m 안) · 못 그린 곡선 표시 - 시험 test_430_route_edit_rules · 배선 바뀐 시험 둘(352-3 · 390-4) · 398-2 도우미 알림 가짜 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TteK8mfYZetk5P3bEZkyVZ
49 lines
1.8 KiB
Python
49 lines
1.8 KiB
Python
"""노드마다 넣은 편집값(430) — 곡선 켬끔 · 넣은 R · 고정(R | 길이) · 고정 길이 → 곡선표 `edits`.
|
|
|
|
⚠ 짝: `logic/B05_Profile_UI_RouteEdit_Edits.ts` `flattenServerPlan`(`RouteNodeEdit`)이 읽음 ·
|
|
거울 시험 `resources/tester/test_430_route_edit_rules.py`.
|
|
|
|
곡선표 `curves` 는 **그린** R(접선 자리에 눌린 값)만 있어, 그것으로 다시 열면 눌린 R 이
|
|
넣은 값으로 굳고 R · 길이 고정이 [저장] 뒤 사라짐 — 넣은 값을 따로 둠. 자리 = 저장 노드
|
|
(앞 노드에서 0.5 m 안인 점은 `build_planned_polyline` 과 같이 거름).
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import math
|
|
from typing import Any
|
|
|
|
from common_util.common_util_route_polyline import DUPLICATE_TOLERANCE_M
|
|
|
|
_LOCKS = ("radius", "arc")
|
|
|
|
|
|
def node_edits(
|
|
points: list[tuple[float, float]],
|
|
flags: list[bool] | None,
|
|
radii: list[float | None] | None,
|
|
locks: list[str | None] | None = None,
|
|
arcs: list[float | None] | None = None,
|
|
) -> list[dict[str, Any]]:
|
|
"""점마다의 편집값 — 겹친 점은 빼고 저장 노드와 같은 자리로. 칸이 짧으면 기본값(켬 · 자동)."""
|
|
|
|
def at(values: list | None, index: int, default: Any = None) -> Any:
|
|
return values[index] if values is not None and index < len(values) else default
|
|
|
|
kept: list[tuple[float, float]] = []
|
|
edits: list[dict[str, Any]] = []
|
|
for index, point in enumerate(points):
|
|
if kept and math.dist(kept[-1], point) <= DUPLICATE_TOLERANCE_M:
|
|
continue
|
|
kept.append(point)
|
|
lock = at(locks, index)
|
|
edits.append(
|
|
{
|
|
"curve": bool(at(flags, index, True)),
|
|
"radius_m": at(radii, index),
|
|
"lock": lock if lock in _LOCKS else None,
|
|
"arc_m": at(arcs, index),
|
|
}
|
|
)
|
|
return edits
|