Zeeuw polygon/polyline clipping demo

This page demonstrates the Zeeuw clipper implementation in the WW.Math library for clipping 2D polygons and polylines. The algorithm is an evolution of the Vatti clipping algorithm, but it also handles horizontal edges, overlapping edges and vertices that coincide with another vertex or edge.

The .NET implementation of the clipper can be found in the WW assembly: WW.Math.Geometry.ZeeuwClipper2D and ZeeuwClipper3D (which handles 3D polylines). The implementation uses floating point arithmetic.

For questions please check the questions and general support forum. Bugs can be reported on the bugs and issues forum.

The default input polygons originate from article "A closed set of algorithms for performing set operations on polygonal regions in the plane" by Michael V. Leonov, Alexey G. Nikitin.

Back Fill mode: Even-odd Non-zero Operation Intersection Union Difference Exclusive or
(Assembly version: WW, Version=, Culture=neutral, PublicKeyToken=87d16b8f7b531b65)

Clip result image: blue: clip region, red: subject region, green: clip result region. Clip result


version Date Description 12 Mar 2018
  • Reworked the handling of overlapping edges. Detect cancelling overlapping edge pairs if they are adjacent in the edge list. 2 Feb 2018
  • Bug fix: fixed Zeeuw polygon clipping issue in a specific case with coincident vertices.
  • Simplified the handling of local maxima and (crossing) polygons passing from below the scan point to above the scan point. 28 Dec 2017
  • Fixed bug in handling coincident intersections. 28 Dec 2017
  • Fixed bugs in handling of self-intersecting hole polygons (especially in the non-zero polygon fill mode). 25 Dec 2017
  • Added union, difference, and exclusive-or clip operations.
  • Fixed bugs in handling of local maxima with multiple coincident edges for different clip operations. 18 Dec 2017
  • Initial version.