Class PolyNode
PolyNodes are encapsulated within a PolyTree container, and together provide a data structure representing the parent-child relationships of polygon contours returned by the Clipper:Execute method.
A PolyNode object represents a single polygon. Its IsHole property indicates whether it's an outer or a hole. PolyNodes may own any number of PolyNode children (Childs), where children of outer polygons are holes, and children of holes are (nested) outer polygons.
Methods
- PolyNode:ChildCount ()
-
Returns:
-
uint
Number of children directly owned by the node.
- PolyNode:GetChild (index[, opts])
-
Get one of the node's children.
Outer PolyNode childs contain hole PolyNodes, and hole PolyNode childs contain nested outer PolyNodes.
Parameters:
- index uint Child index, from 1 to PolyNode:ChildCount.
- opts
table
Options, which include:
- out: If this is a PolyNode, it will be populated and used as the return value.
Returns:
- PolyNode:GetContour ([opts])
-
Parameters:
- opts
table
Options, which include:
- out: If this is a Path, it will be populated and used as the return value.
Returns:
- opts
table
- PolyNode:GetNext ([opts])
-
Parameters:
- opts
table
Options, which include:
- out: If this is a PolyNode, it will be populated and used as the return value.
Returns:
-
PolyNode or nil
N
- opts
table
- PolyNode:GetParent ([opts])
-
Parameters:
- opts
table
Options, which include:
- out: If this is a PolyNode, it will be populated and used as the return value.
Returns:
See also:
- opts
table
- PolyNode:IsHole ()
-
Returns:
- PolyNode:IsOpen ()
-
Returns:
-
boolean
Did the node's contour result from a clipping operation on
an open contour (path)?
Only top-level PolyNodes can contain open contours.
- PolyNode:ToTree ([opts])
-
Parameters:
- opts
table
Options, which include:
- out: If this is a PolyTree, it will be populated and used as the return value.
Returns:
- opts
table