FAQ

Why does Clipper use integer coordinates, not floats?

Initially Clipper did use floating point coordinates but the clipping algorithm wasn't numerically robust. Consequently, very occasionally errors occurred which prevented Clipper from returning a solution. These issues have completely resolved since swapping to integer coordinates.

How do I use floating point coordinates with Clipper?

It's a simple task to multiply your floating point coordinates by a scaling factor that's a power of 10 (depending on the desired precision). Then with the solution polygons, divide the returned coordinates by this same scaling factor. Clipper accepts integer coordinates as large as +/-6.5 e18, so it can accommodate very large scaling factors.

Does Clipper handle polygons with holes?

Polygon 'holes' are implied simply by having their orientations opposite that of their container polygons.

Why are there separate fill rules for Subject and Clip polygons?

Because users may want to use different fill rules for these polygons. However it's important to note that these fill rules apply solely within subject and clip polygons to define their respective regions. These rules aren't applied to the clip operation itself where subject and clip polygons are merged into a single solution. If you wish for a fill rule to apply to the merging of subject and clip polygons as well - typically during a UNION operation, then you should UNION all the polygons as subjects without assigning any clip polygons.

Which fill rule does the boolean clipping operation use?

Perhaps the easiest way to explain what happens during clipping is to consider the following. First the subject and clip polygons are filled using their respective fill rules. With the subject polygons, assign a winding count (WC) of +1 to any filled region and a WC of 0 to any unfilled region. Do likewise with the clip polygons. Then the following winding rules apply to the clipping operation ...
  ♦ Intersection: add subject and clip regions and return those regions where WC == +2
  ♦ Union: add subject and clip regions and return those regions where WC > 0
  ♦ Difference: subtract clip from subject regions and return those regions where WC == +1
  ♦ XOR: subtract clip from subject regions and return those regions where WC != 0

Some solution polygons share a common edge. Is this a bug?

No. However Clipper tries very hard to minimize this by merging polygons that share a common edge.

I have lots of polygons that I want to 'union'. Can I do this in one operation?

Yes. Just add all the polygons as subject polygons to the Clipper object and don't assign any clip polygons.