Skip to content

Conversation

@dbaston
Copy link
Member

@dbaston dbaston commented Dec 18, 2025

This PR:

  • Reworks the CircularArc class to hold a reference to a CoordinateSequence and position, rather than holding coordinates as values. This makes it easier for the CircularArcIntersetor to access the Z and M values of arc points, without CircularArc having to store everything as CoordinateXYZM. The CircularArc may also own its own CoordinateSequence, though this is mostly used for tests and should maybe be removed.

  • Updates the CircularArcIntersector class to perform Z/M interpolation, with behavior modeled on that of LineIntersector. In particular, the Z/M values of intersection points are interopalted unless they match an arc endpoint, in which case they are taken from the endpoint with preference to the first arc. (This means that, like LineIntersector, the intersection of A and B may be different from the intersection of B and A.) Z/M interpolation on intersection points is performed between arc end points (p0, p2) and the arc control point (p1). Control points are not preserved in the the output; output arcs will have a control point generated at the angle midway between arc endpoints.

  • Adds a hierarchy of curve-capable noding classes. The idea here was to leave SegmentString / Noder / IntersectionAdder unchanged, so the following classes are added:

    • ArcString: equivalent of SegmentString, but for arcs
    • PathString : a parent of SegmentString and ArcString
    • ArcNoder : a derivative of Noder, who can also node not only a vector of SegmentStrings, but also a vector of PathStrings
    • NodablePath: a PathString to which intersection points can be added (interface)
    • NodableArcString: like it sounds. Captures the functionality of NodedSegmentString, SegmentNode, and SegmentNodeList.
    • ArcIntersector: An interface like SegmentIntersector that requires handling of the four possibleSegmentString / ArcString combinations
    • ArcIntersectionAdder: Analog of IntersectionAdder that implements ArcIntersector.
  • "Upgrades" the brute-force SimpleNoder from a Noder to an ArcNoder.

  • Makes GeometryNoder fall back to a SimpleNoder if it receives curved inputs. Otherwise, it sticks with the default MCIndexNoder.

There are a few FIXME / TODO items remaining that I would address before merging.

@dbaston dbaston force-pushed the arc-noding-4 branch 2 times, most recently from c54480c to dec2787 Compare January 19, 2026 18:02
@dbaston dbaston added Curves Enhancement New feature or feature improvement. labels Jan 20, 2026
@dbaston dbaston merged commit 0154023 into libgeos:main Jan 29, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Curves Enhancement New feature or feature improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant