feat(380-3): 노선 따라간 사토장 · 토취장 = 새 노선 일반 측점 맞춤 · test_322_2 마스터 판 독립
- follow_structures ↔ followStructures(intervalM): site 꼴 = 새 노선 일반 측점(격자 · 끝) 중 가장 가까운 곳 · 그 밖 정수 m 그대로 - 파이썬 snap_existing_station ↔ TS snapExistingStation · general_stations ↔ gridStations 짝 - 브라우저 노선 초안 따라감(Pipeline_Grade) = 측점 간격 넘김 · 서버 노선 저장 따라감 = 서버 간격 - test_322_2: B05 목록 고정 수 23 대신 both 목록 수와 같음(M02 켬끔 판마다 다름) - 시험 test_380_3_site_follow(거울 · 가운데면 앞 측점 · 좌표 없음 그대로) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VmC34fsxxbweEG3RUjs3Mn
This commit is contained in:
@@ -45,6 +45,14 @@ def snap_structure_station(chainage_m: float, stations: Sequence[float]) -> floa
|
||||
return max(0.0, min(whole, float(math.floor(end + _EPS))))
|
||||
|
||||
|
||||
def snap_existing_station(chainage_m: float, stations: Sequence[float]) -> float:
|
||||
"""가장 가까운 기존 측점(가운데면 앞) · 비면 정수 m — TS `snapExistingStation` 짝."""
|
||||
value = float(chainage_m)
|
||||
if not math.isfinite(value) or not stations:
|
||||
return snap_structure_station(value, stations)
|
||||
return float(min(stations, key=lambda at: (round(abs(float(at) - value), 6), float(at))))
|
||||
|
||||
|
||||
def route_general_stations(total_m: float) -> list[float]:
|
||||
"""노선 길이의 일반 측점 — 서버 측점 간격(`SECTION_STATION_INTERVAL_M`)."""
|
||||
return general_stations(total_m, SECTION_STATION_INTERVAL_M)
|
||||
|
||||
Reference in New Issue
Block a user