Kontur Type
A Kontur (German for contour) is a region of the plane defined by one or more closed Polyline2Ds and a fill rule. Paths may self intersect, overlap each other, or be nested. The fill rule decides what is inside. The fill rule belongs to the Kontur, not to the boolean operation, unlike in Clipper. Subject and clip get separate winding numbers on every edge, and each fill rule is applied to its own winding number before the boolean combines them. So two different fill rules never conflict, they are two independent decisions. What this buys is one pass instead of two: an EvenOdd glyph unioned with a NonZero CAD outline works in one operation. With a fill rule per operation the glyph would have to be simplified first, then unioned. Kontur values returned by a boolean operation are always simple: no self intersections, no overlaps, outer paths counter clockwise, holes clockwise, and their fill rule is Positive. Such a result reads the same under NonZero, Positive and EvenOdd, so the rule of a result never has to be changed. A Kontur does not copy the Polyline2Ds it is given. They are still mutable, so they must not be changed in a way that opens them while the Kontur is in use.
Instance members
| Instance member |
Description
|
Full Usage:
this.AsString
Returns: string
|
Format this Kontur into a string with its fill rule, count of paths and count of points.
|
|
The axis aligned bounding rectangle around all paths. Fails on an empty Kontur.
|
|
Tests if the point is inside this Kontur according to its fill rule. Points exactly on a path may give either result.
|
|
How the winding number decides what is inside this Kontur.
|
Full Usage:
this.IsEmpty
Returns: bool
|
TRUE if this Kontur has no paths.
|
Full Usage:
this.PathCount
Returns: int
|
The count of paths in this Kontur.
|
|
The closed paths of this Kontur. Each path stores its first point twice, as first and as last point. This is the live internal list, do not add open paths to it.
|
Full Usage:
this.SignedArea
Returns: float
|
The sum of the signed areas of all paths. Counter clockwise paths count positive. This is the area of the Kontur only if the paths do not overlap and holes are oriented opposite to their outer path, which is the case for every Kontur returned by a boolean operation.
|
|
Counts how often the paths of this Kontur wind around the point. The sum of Polyline2D.WindingNumber over all paths. Points exactly on a path may give either side's result.
|
Static members
| Static member |
Description
|
Full Usage:
Kontur.create (paths, ?fillRule)
Parameters:
Polyline2D seq
-
The closed Polyline2Ds. Each must have its first point repeated as last point and at least three distinct points.
?fillRule : FillRule
-
Optional, FillRule.NonZero by default. How the winding number decides what is inside. See the docs of FillRule for why the rule belongs to the Kontur.
Returns: Kontur
A new Kontur.
|
Creates a Kontur from closed paths and a fill rule. The paths are not copied, the Kontur refers to the given Polyline2Ds.
|
Full Usage:
Kontur.createSingleton (path, ?fillRule)
Parameters:
Polyline2D
-
The closed Polyline2D. It must have its first point repeated as last point and at least three distinct points.
?fillRule : FillRule
-
Optional, FillRule.NonZero by default. How the winding number decides what is inside.
Returns: Kontur
A new Kontur with one path.
|
Creates a Kontur from one closed path.
|
|
Euclid.Kontur