Filed by #244 (p7-s4), which added the public simplifier and deliberately did not do this.
The duplication
p7-s4 adds roadmaker::simplify_polyline in core/include/roadmaker/geometry/simplify.hpp — Ramer–Douglas–Peucker over an open polyline, returning the indices kept, iterative rather than recursive.
core/src/mesh/surface_boundary.cpp has had a private static decimate_ring since p2-s7. It solves the same problem for closed rings, via Clipper2's RamerDouglasPeucker, returning points.
Two RDP implementations in one kernel is one too many.
Why p7-s4 did not unify them
Not oversight — deliberate, and stated in the plan. decimate_ring gates every interior Steiner point in all three surface fill pipelines. Changing which vertices it keeps moves geometry in every surface, which breaks the byte-identity assertions that a large part of the mesh suite rests on. That is precisely the hazard #442 documented when it fixed Clipper2Lib::PointInPolygon, and it does not belong inside a feature sprint for an unrelated subsystem.
Scope
Do not
Fold this into an unrelated sprint. It is a mesh-output change wearing a refactor's clothes.
Filed by #244 (p7-s4), which added the public simplifier and deliberately did not do this.
The duplication
p7-s4 adds
roadmaker::simplify_polylineincore/include/roadmaker/geometry/simplify.hpp— Ramer–Douglas–Peucker over an open polyline, returning the indices kept, iterative rather than recursive.core/src/mesh/surface_boundary.cpphas had a private staticdecimate_ringsince p2-s7. It solves the same problem for closed rings, via Clipper2'sRamerDouglasPeucker, returning points.Two RDP implementations in one kernel is one too many.
Why p7-s4 did not unify them
Not oversight — deliberate, and stated in the plan.
decimate_ringgates every interior Steiner point in all three surface fill pipelines. Changing which vertices it keeps moves geometry in every surface, which breaks the byte-identity assertions that a large part of the mesh suite rests on. That is precisely the hazard #442 documented when it fixedClipper2Lib::PointInPolygon, and it does not belong inside a feature sprint for an unrelated subsystem.Scope
simplify_polylineto closed rings (or add asimplify_ringbeside it) and re-expressdecimate_ringon top.surface_boundary.cppconverts toPathDat that point.Do not
Fold this into an unrelated sprint. It is a mesh-output change wearing a refactor's clothes.