FAQ

Can I use floating point coordinates with Clipper?

Yes you can. The Clipper Library has two classes which perform clipping operations - Clipper64 and ClipperD. The former class accepts 64bit integer coordinates, whereas the latter class accepts double float coordinates.

If I have a choice, does it make any difference whether I use integer or floating point coordinates when doing clipping operations?

Yes there will be a small difference. The Clipper Library uses integer coordinates internally in order to preserve numerical robustness, so floating point coordinates will be converted to and from integers before and after clipping respectively. By using integer coordinates you'll avoid the small overhead of these conversions.

How does Clipper handle polygons with holes?

Polygon regions are defined by associating specific fill rules with paths. Inner paths, that outline holes, generally wind in the opposite direction to outer paths.

Sometimes polygons in solutions share a common edge.
Are these a bugs?

No, though this should be fairly uncommon. (See notes on touching polygons here.)

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

Yes, see Union.

The polygons produced by InflatePaths and / or ClipperOffset have tiny artefacts?
Are these bugs?

No. Sometimes very small segments in offset paths are at unexpected angles due to integer rounding. When these offset paths are themselves offset several times, this can exaggerate these angled segments. So perhaps the best way to remove these tiny artefacts is by using the library's RamerDouglasPeucker function.

Is there an easy way to reverse polygon orientations?

Yes, see ReversePath, Clipper64.ReverseSolution and ClipperOffset.ReverseSolution

 

See Also

Overview, Clipper64, Clipper64.ReverseSolution, ClipperD, ClipperOffset, ClipperOffset.ReverseSolution, InflatePaths, RamerDouglasPeucker, ReversePath, Union, FillRule