General Polygon Clipper

In December 2021 a copy of the GPC code (v2.32) was placed on GitHub under the MIT License by Paint.NET author Rick Brewster.

GPC can compute the following clip operations: difference, intersection, exclusive-or and union.

The clip operation output from GPC is a set of polygon contours or tristrips.

The following four images show examples of GPC computing operations between two polygon sets.

In each example, the areas resulting from the GPC operation between the two sets of polygons are rendered in colour.

Example of GPC Difference
Example of GPC Difference
Example of GPC Intersection
Example of GPC Intersection
Example of GPC Union
Example of GPC Union
Example of GPC Exclusive-or
Example of GPC Exclusive-or