jbuckmccready / CavalierContours

2D polyline library for offsetting, combining, etc.
MIT License
421 stars 79 forks source link

Add Implementation for Combining Closed Polylines #2

Closed jbuckmccready closed 4 years ago

jbuckmccready commented 4 years ago

Given two closed non-self intersecting polylines that overlap one another find a new polyline that describes their combined outline. This is equivalent to a Boolean AND operation on polygons. Implementation likely involves finding intersects between polylines, discarding internal slices, and stitching slices together at intersect points.

jbuckmccready commented 4 years ago

Added function for computing winding number that can be used for point in polyline test (to be used for boolean operation algorithms). See commit https://github.com/jbuckmccready/CavalierContours/commit/957447fb8260f53c24e6a08325b77987b05fe816

jbuckmccready commented 4 years ago

Added all combine operations (Union, Exclude, Intersect, and XOR). See commit https://github.com/jbuckmccready/CavalierContours/commit/e6800f9c9f07accdffc1499f50537ae5c78c749b