Repository navigation
ClipType
enum ClipType { Intersection, Union, Difference, Xor };There are four boolean operations:
- AND (intersection) - regions covered by both subject and clip polygons
- OR (union) - regions covered by subject or clip polygons, or both polygons
- NOT (difference) - regions covered by subject, but not clip polygons
- XOR (exclusive or) - regions covered by subject or clip polygons, but not both
Of these four operations, only difference is non-commutative. This means that subject and clip paths are interchangeable except when performing difference operations (and as long as subject paths are closed).
All polygon clipping is performed with a Clipper object with the specific boolean operation indicated by the ClipType parameter passed in its Execute method.
With regard to open paths (polylines), clipping rules generally match those of closed paths (polygons).
However, when there are both polyline and polygon subjects, the following clipping rules apply:
- union operations - polylines will be clipped by any overlapping polygons so that only non-overlapped portions will be returned in the solution, together with solution polygons
- intersection, difference and xor operations - polylines will be clipped by 'clip' polygons, and there will be not interaction between polylines and any subject polygons.
Example of clipping behaviour when mixing polyline and polygon subjects:
Copyright © 2010-2025 Angus Johnson. Clipper2 is distributed under the Boost Software License.
Headers
- clipper.h
- clipper.core.h
- clipper.engine.h
- clipper.export.h
- clipper.minkowski.h
- clipper.offset.h
- clipper.rectclip.h
- clipper.triangulation.h
Classes
Data types and structure definitions
- ClipType
- EndType
- FillRule
- JoinType
- Path64
- PathD
- Paths64
- PathsD
- Point64
- PointD
- PointInPolygonResult
- Rect64
- RectD
- TriangulateResult
- ZCallback64
- ZCallbackD
Static Functions
- Area
- BooleanOp
- Difference
- InflatePaths
- Intersect
- IsPositive
- MakePath
- MinkowskiDiff
- MinkowskiSum
- PointInPolygon
- PolyTreeToPaths64
- PolyTreeToPathsD
- RectClip
- RectClipLines
- ReversePath
- SimplifyPaths
- TranslatePath
- Triangulate
- TrimCollinear
- Union
- XOR
Topics