The Clipper library performs clipping and offsetting for both lines and polygons. All four boolean clipping operations are supported - intersection, union, difference and exclusive-or. Polygons can be of any shape including self-intersecting polygons.
17 March 2016:
Since it's been some time since the last update, some may be wondering if I no longer plan further updates. I do have plans for more updates but I also have a chronic health condition (not life threatening) that's set me back, and I don't really have a good idea when I'll restart development.
- Line and polygon clipping - intersection, union, difference & xor
- Line and polygon offsetting with 3 types of joining - miter, square and round
- Polygons can be of any shape, including self-intersecting polygons
- Minkowski Addition and Minkowski Difference functions included
- The library is written in Delphi, C++, C# and Python
- Comprehensive documentation
- Demos use AGG, Cairo, OpenGL, GDI+ & Graphics32 graphics libraries
- The library is significantly faster than commercial alternatives
- Third-party modules for Perl, Ruby and Python languages
excellent library, very helpful.
Well designed, very well performing and the support is great as well.
Great, it works great and is very fast !!!
Very nice. After playing with CGAL and boost geometry for my application (a 3D print screw generator github hzeller/gcode-multi-shell-extrude ) that needs polygon offsetting, I settled with Clipper. Clipper is simple to use and does the job very nicely. The aforementioned libraries are very complicated (they over-use the C++ templating system; it is hard to figure out how to get back your data), add significant dependencies, and had trouble in corner-cases (negative offsets). With Clipper, the implementation was as simple as it gets (copy my Polygon content into ClipperLib::Path, offset, copy Path back to Polygon), and corner-cases (negative offsets!) work just fine.