refactor(472-4 ① 추가 측점 따라감): 서버 추가 측점 따라감도 TS 한 벌 — followPlusRows · Node 입구 facility.plus_follow

- common_util_route_follow.ts followPlusRows(땅 위 자리 → 새 노선 정수 m · 같은 m 하나) · followPlusStations 가 그것을 씀
- Plus_Stations.follow_plus_stations = run_calc 겉(옮긴 수 · 쓰기 그대로) · follow_structures 끌림 걷음
- 등록부 node:facility.plus_follow · NODE_IDS · 시험 test_472_4_follow_node(옛 코드 빨강) · 368_2 · 459 통과

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 09:37:00 +09:00
co-authored by Claude Opus 5.5
parent cca08daa11
commit 39adebdaf5
7 changed files with 90 additions and 32 deletions
+1
View File
@@ -25,6 +25,7 @@ NODE_IDS = frozenset(
"excavation.trench",
"corridor.mesh",
"profile.seat",
"facility.plus_follow",
}
)
+17 -4
View File
@@ -14,7 +14,8 @@
* - `placeOnLine` 의 좌표 없는 관 · `rebasePipeDraft` 는 TS 만 — 좌표 없는 세션 관 초안(정본 PUT 꼴)을 따라가기
* 전 자리로 · 노선을 저장한 [저장]이 서버가 따라 옮긴 관 위에 초안을 얹음(349-0u).
* - `rebaseStructureDraft` 도 TS 만 — 구조물 초안을 서버가 따라 옮긴 정본 위에(459 · 관 짝).
* - `followPlusStations` ↔ 파이썬 `B05_Profile_Plus_Stations.follow_plus_stations`(459 · 노선 초안 동안).
* - `followPlusRows` = 추가 측점 따라감 한 벌 — 서버도(Node 입구 `facility.plus_follow` · 472-4 ①) ·
* `followPlusStations` = 노선 초안 동안(옛 선 위 자리에서).
* - `routeOutside` ↔ 파이썬 `route_outside`(459 · 노선 밖 = 측점 계획 · 알약에서 뺌 · 좌표 그대로) — 따라감이
* `outside: true` 를 붙임(파생값 · 저장 때 뺌 · 서버는 측점 세울 때 다시 셈).
* 거울 시험 = resources/tester/test_344_2_route_pairs.py.
@@ -221,8 +222,21 @@ export function rebaseStructureDraft<S extends StructureLike>(
});
}
/** 땅 위 자리(x · y)가 있는 추가 측점이 새 선(`to`)을 따라감 — 정수 m · 누가거리 순 · 같은 m 하나(앞엣것) ·
* 좌표 그대로. 서버 정본(`plus_stations.json`)도 이 셈(Node 입구 `facility.plus_follow` · 472-4 ①). */
export function followPlusRows<R extends FollowingStructure>(
rows: ReadonlyArray<R>,
to: ReadonlyArray<XY>,
): R[] {
const seen = new Set<number>();
return followStructures(rows, to)
.map(({ item }) => item)
.sort((a, b) => a.chainage_m! - b.chainage_m!)
.filter((item) => !seen.has(item.chainage_m!) && seen.add(item.chainage_m!));
}
/** 추가 측점이 노선을 따라감(459) — 옛 선(`from`) 위 누가거리의 땅 위 자리를 새 선(`to`)에 투영한 정수 m
* (같은 m 하나 · 오름차순). 파이썬 `follow_plus_stations` 짝(`follow_structures` 같은 셈). */
* (같은 m 하나 · 오름차순 · 노선 초안 동안 = 좌표가 아직 옛 선 위). */
export function followPlusStations(
list: ReadonlyArray<number>,
from: ReadonlyArray<XY>,
@@ -232,8 +246,7 @@ export function followPlusStations(
list.map((chainage_m) => ({ chainage_m })),
from,
);
const moved = followStructures(placed, to).map(({ item }) => item.chainage_m!);
return [...new Set(moved)].sort((a, b) => a - b);
return followPlusRows(placed, to).map((item) => item.chainage_m!);
}
/** 따라가기만 한 관 = 정본과 같은 땅 위 자리(m) — 서버 좌표가 mm 3자리라 그 반올림 폭. */