Cross Wall Risk

"/home/yossef/notes/git/projects/maplibra/risks/Cross Wall Risk.md"

path: maplibra/risks/Cross Wall Risk.md

- **fileName**: Cross Wall Risk
- **Created on**: 2026-06-16 00:48:42

Cross Wall Risk

Migrated from: obs_vault

Parent: ../modules/Snapping.md

This note explains how a route line can appear to cross a wall or blocker.

Status

Mitigated — Fixes applied to close the three main failure modes.

Likely Cause Chain

  1. ../flows/Graph Construction.md samples nodes and builds graph edges from MVF geometry.
  2. ../flows/Wall Detection.md validates points and segments against buffered blockers.
  3. ../modules/Route Smoothing.md simplifies and curves the route after graph search.
  4. Segment checks are sampled, so thin blockers can fall between samples.

Failure Modes (Fixed)

1. Sparse segment validation — FIXED

smoothRouteHuman, smoothRouteUltra, and smoothRouteBalanced only validated every 2nd/3rd/4th segment (i += 2/3/4). This meant 50-75% of smoothed segments were never checked. Fix: Changed all loops to i += 1.

2. Sample distance too coarse — FIXED

isSegmentWalkable used smoothSampleDistance=1m for point-in-polygon checks. Walls thinner than 1m could be missed. Fix: Capped sample step at 0.5m and raised minimum to 2 samples per segment.

3. Smoothing curves through walls — MITIGATED

Chaikin and Catmull-Rom generate interpolated points not in the A* path. Mitigation: The validation fallback chain (Chaikin → Catmull-Rom → simplified) catches invalid curves. With Fix 1+2, the validation is now comprehensive.

Remaining Risk

See Also