FAQ

Why does Clipper use integer coordinates, not floats?

This has been done to preserve numerical robustness. Early versions of the library did use floating point coordinates, but it became apparent that floating point imprecision was always going to cause occasional errors.

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 typically a power of 10 depending on the desired precision). Then with the solution paths, divide the returned coordinates by this same scaling factor. Clipper accepts integer coordinates as large as ±4.6e18, so it can accommodate very large scaling.

Does Clipper handle polygons with holes?

'Holes' are defined using the suppied polygon filling rule. (See also Clipper.Execute)

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

No, though this should happen rarely as of version 6. (See Clipper.Execute for more about this.)

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. (You don't have to assign both subject and clip polygons.)

The OffsetPaths function is returning tiny artefacts? Could this be a bug?

The precision of the input coordinates may be a problem. Because the Clipper Library only operates on integer coordinates, you may need to scale your coordinates (eg by a factor of 10) to improve precision when passing them to the OffsetPaths function. (Reverse any scaling on the output polygons too.)

Is there an easy way to reverse polygon orientations?

Yes, see ReversePaths.

 

My drawings contain lots of ellipses and arcs. How can I perform clipping operations or offsetting on these?

You'll have to convert then to paths. Many graphics libraries have 'flatten path' routines. (See also the Beziers unit that's included in this library. However, there's no documentation on it yet.)

See Also

Clipper.Execute, OffsetPaths, ReversePaths, PolyFillType