Direkt zum Hauptinhalt

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

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:

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