Repository navigation
ClipperD Execute
Home › clipper.engine.h › ClipperD › ClipperD.Execute
bool Execute(ClipType clip_type, FillRule fill_rule, PathsD& solution);
bool Execute(Clip_type clipType, FillRule fill_rule,
PathsD& solution, PathsD& open_solution);
bool Execute(Clip_type clipType, FillRule fill_rule, PolyTreeD& solution);
bool Execute(Clip_type clipType, FillRule fill_rule,
PolyTreeD& solution, PathsD& open_solution);Once subject and clip paths have been assigned (see AddSubject, AddOpenSubject and AddClip methods), Execute can then perform the specified clipping operation (intersection, union, difference or XOR).
The solution parameter can be either a PathsD or a PolyTreeD, though since the PathsD structure is simpler and more easily populated (with clipping about 5% faster), it should generally be preferred.
While polygons in solutions should never intersect (either with other polygons or with themselves), they will frequently be nested such that outer polygons will contain inner 'hole' polygons with in turn may contain outer polygons (to any level of nesting). And given that PolyTreeD and PolyTree64 preserve these parent-child relationships, these two PolyTree classes will be very useful to some users.
There are several things to note about the solution paths returned:
- PolyTrees are structured such that outside polygons will always be at the top most level (ie childs of polytree)
- polygons in PathsD on the other hand won't appear any particular order, though polygons with larger Y coordinates tend to be listed first.
- polygon 'holes' will always wind in a negative direction (in both PathsD and in PolyTreeD)
- the solution's fill rule is undefined since it's consistent with any fill type except Negative
- polygons may still on occasions share common ('touching') edges
- polygons should never overlap or be self-intersecting (however, see notes on robustness)
The FillRule parameter identifies the filling rule that's to be applied to all input polygons.
Execute can also be called multiple times without reassigning subject and clip polygons (ie when different clipping operations are required on the same polygon sets).
Examples, Robustness, AddClip, AddOpenSubject, AddSubject, PolyTree64, PolyTreeD, ClipType, FillRule, PathsD
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