fix(B05): 유령 마커가 계속 뜨던 이유 — 화면이 표고 null을 0으로 눕히고 있었다

앞 커밋(53ab941)에서 "표고 없는 점은 안 그린다"를 넣었는데도 그대로 보였다.
restorePoints -> placed()가 마커에 넘기기 전에 z: point.z ?? 0으로 바꿔, 마커 쪽에서는
표고를 아는 점(0m)으로 보였기 때문이다. 판정이 걸릴 자리가 없었다.

- PlacedRoutePoint.z를 number | null로 바꿔 "모름"을 모름 그대로 들고 다닌다.
- placed()는 z ?? null, 서버로 보낼 때(routePoint)만 null -> undefined로 바꾼다.
- modelToScene은 표고가 정해진 점만 받는다(z: number) — 호출부에서 이미 해결한 값을 준다.

typecheck·prettier 통과. 백엔드가 정적으로 서빙하는 번들(config/node_modules/.build)도
다시 빌드했다 — :8000으로 보면 서버 기동 때 만든 옛 번들이 떠서 수정이 반영되지 않는다.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-08 18:21:22 +09:00
co-authored by Claude Opus 5
parent 53ab941aef
commit d9f6fbdff1
2 changed files with 7 additions and 4 deletions
+3 -2
View File
@@ -8,7 +8,8 @@ export interface PlacedRoutePoint {
type: RoutePointKind;
x: number;
y: number;
z: number;
/** 표고(m). `null`은 **모른다**는 뜻 — 계획노선 CSV로 만든 점이 그렇다. 0으로 눕히면 안 된다. */
z: number | null;
radius_m?: number;
}
@@ -72,7 +73,7 @@ function disposeGroup(group: THREE.Group): void {
group.clear();
}
export function modelToScene(point: Pick<PlacedRoutePoint, "x" | "y" | "z">, bounds: ModelBounds) {
export function modelToScene(point: { x: number; y: number; z: number }, bounds: ModelBounds) {
const cx = (bounds.x[0] + bounds.x[1]) / 2;
const cy = (bounds.y[0] + bounds.y[1]) / 2;
const cz = (bounds.z[0] + bounds.z[1]) / 2;
+4 -2
View File
@@ -97,7 +97,8 @@ function placed(
type,
x: point.x,
y: point.y,
z: point.z ?? 0,
// 표고를 모르면 모르는 채로 넘긴다 — 0으로 눕히면 마커가 지형 한참 아래 평면에 깔린다.
z: point.z ?? null,
...(type === "ap" || type === "fp" ? { radius_m: (point as CirclePoint).radius_m ?? 25 } : {}),
};
}
@@ -114,7 +115,8 @@ function restorePoints(latest: RouteLatestResponse): RouteDesignPoints {
}
function routePoint(point: PlacedRoutePoint): RoutePoint {
return { x: point.x, y: point.y, z: point.z };
// 서버 스키마는 표고를 빼면 "모름"으로 받는다 — null은 undefined로 바꿔 보낸다.
return { x: point.x, y: point.y, z: point.z ?? undefined };
}
function circlePoint(point: PlacedRoutePoint): CirclePoint {