Clipping and offsetting algorithms
For optimizing geometry for cutting technologies there are a lot of important tools and algorithms out there to solve a lot of common problems. There are a lot of clipping algorithms out there. Most of them work kind a sweep line algorithm - that's a kind of scanning routine which mostly works by visiting elements and brute-forcing them with different methods.
https://de.m.wikipedia.org/wiki/Sweep_(Informatik)
Greiner Hormann Clipping Algorithm
used for polygon clipping. It can process both self-intersecting and non-convex polygons) - also known as EvenOdd problem
- https://github.com/karimbahgat/Clippy (works for polygons, not for bezier paths)
- https://oreillymedia.github.io/Using_SVG/extras/ch06-fill-rule.html see "winding rule"
Bentley Ottmann Clipping Algorithm
a sweep line algorithm for listing all crossings in a set of line segments, i.e. it finds the intersection points (or, simply, intersections) of line segments (does not work for bezier paths)
Bush algorithm
https://github.com/anvaka/isect
Sutherland–Hodgman Algorithm
Vatti Clipping Algorithm
Allows clipping of any number of arbitrarily shaped subject polygons by any number of arbitrarily shaped clip polygons. Unlike the Sutherland–Hodgman and Weiler–Atherton polygon clipping algorithms, the Vatti algorithm does not restrict the types of polygons that can be used as subjects or clips. Even complex (self-intersecting) polygons, and polygons with holes can be processed. The algorithm is generally applicable only in 2D space.
Libraries:
- https://github.com/karimbahgat/Clippy
- https://github.com/fonttools/pyclipper (works for lines and polygons, not for bezier paths)
-
clipping and offsetting lines and polygons → performs line & polygon clipping - intersection, union, difference & exclusive-or, and line & polygon offsetting
- http://www.angusj.com/delphi/clipper/documentation/Docs/Overview/_Body.htm
- https://sourceforge.net/projects/polyclipping
-
Weiler-Atherton Algorithm
Martinez-Rueda polygon clipping algorithm
Libraries:
Offsetting curves
A really good primer about Bezier curves can be found at https://pomax.github.io/bezierinfo/#offsetting
Keine Kommentare