Skip to content

mesh: unify decimate_ring onto the public polyline simplifier #498

Description

@JArmandoAnaya

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pillar:P2Road to Parity pillar P2

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions