Skip to content

feat(pipeline): shared centerline vertical-profile smoother for roads #231

Description

@nigel-hall-codes

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions