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:
@@ -115,6 +115,17 @@ export function snapExistingStation(
|
||||
});
|
||||
}
|
||||
|
||||
/** 격자 측점 + 끝 측점 — 파이썬 `general_stations` 짝(노선 따라감 site 맞춤 · 380-3). */
|
||||
export function gridStations(totalM: number, intervalM: number): number[] {
|
||||
if (!(totalM > 0 && intervalM > 0)) return [0];
|
||||
const values = Array.from(
|
||||
{ length: Math.floor(totalM / intervalM) + 1 },
|
||||
(_, i) => i * intervalM,
|
||||
);
|
||||
if (totalM - values[values.length - 1] > EPS) values.push(totalM);
|
||||
return values;
|
||||
}
|
||||
|
||||
/** 놓는 꼴 따라 맞춤 — site = 가장 가까운 기존 측점 · 그 밖 = 정수 m. */
|
||||
export const snapStationFor = (chainageM: number, placement: string | null | undefined): number =>
|
||||
placement === "site" ? snapExistingStation(chainageM) : snapStructureStation(chainageM);
|
||||
|
||||
Reference in New Issue
Block a user