Keystone of #230 (road smoothness). See sdlc/#230/plan.md, prior-art.md, analysis.md on branch sdlc/#230-idea.
Goal
Add a shared centerline vertical-profile smoother so roads stop reproducing high-frequency terrain noise, without regressing #219 (steep-grade conform).
What
- Add
_smooth_centerline_profile() in python/sfmap/geometry/road.py.
- Apply it identically in:
- Mesh pass —
road.py::_build_single_road, after _anchor_centerline.
- Stamp pass —
stamping.py::stamp_roads, on sampled_y before _iter_road_footprint.
- Filter interior Y only; keep anchored endpoints and all XZ exact.
- Use a curvature / second-derivative limiter along arc length (preferred over a moving average so genuine straight grades pass untouched). Parameter = arc-length window in metres.
Critical invariant
Stamp grade and mesh grade must remain bit-identical for the same input — otherwise the road tears a seam (the exact failure #219 fixed).
Acceptance
- No seam/facet regression on steep grades (Lombard).
- High-frequency wiggle on flat input is attenuated.
- Ships the first
python/tests/: endpoint + XZ preservation, stamp==mesh profile equality, straight-ramp passthrough, synthetic-noise attenuation.
Keystone of #230 (road smoothness). See
sdlc/#230/plan.md,prior-art.md,analysis.mdon branchsdlc/#230-idea.Goal
Add a shared centerline vertical-profile smoother so roads stop reproducing high-frequency terrain noise, without regressing #219 (steep-grade conform).
What
_smooth_centerline_profile()inpython/sfmap/geometry/road.py.road.py::_build_single_road, after_anchor_centerline.stamping.py::stamp_roads, onsampled_ybefore_iter_road_footprint.Critical invariant
Stamp grade and mesh grade must remain bit-identical for the same input — otherwise the road tears a seam (the exact failure #219 fixed).
Acceptance
python/tests/: endpoint + XZ preservation, stamp==mesh profile equality, straight-ramp passthrough, synthetic-noise attenuation.