Delphi**function** Execute(clipType: TClipType; fillRule: TFillRule): boolean; **out** solution: TPathsD;

**function** Execute(clipType: TClipType; fillRule: TFillRule): boolean;

**out** solution: TPathsD; **out** openSolution: TPathsD;

**function** Execute(clipType: TClipType; fillRule: TFillRule): boolean; **var** solution: TPolyTreeD;

**function** Execute(clipType: TClipType; fillRule: TFillRule): boolean;

**var** solution: TPolyTreeD; **out** openSolution: TPathsD;

C++**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);

C# **public bool** Execute(ClipType clipType, FillRule fillRule, PathsD solution);

**public bool** Execute(ClipType clipType, FillRule fillRule,

PathsD solution, PathsD openSolution);

**public bool** Execute(ClipType clipType, FillRule fillRule, PolyTreeD solution);

**public bool** Execute(ClipType clipType, FillRule fillRule,

PolyTreeD solution, PathsD openSolution);

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
**rounding**)

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, Rounding, AddClip, AddOpenSubject, AddSubject, PolyTree64, PolyTreeD, ClipType, FillRule, PathsD

Copyright ©2010-2022 Angus Johnson - Clipper2 1.1.0 - Help file built on 25 Jan 2023