KonturEngine Type
Runs boolean operations on Kontur values. Holds all scratch buffers of the algorithm, so that repeated operations on one engine do not allocate anything but the result Polyline2Ds. Not thread safe, use one engine per thread. The tolerance is absolute, in the units of the coordinates: points closer than the tolerance are the same point, a point closer than the tolerance to a segment lies on it. See DESIGN.md section 2.
Constructors
| Constructor |
Description
|
|
|
Instance members
| Instance member |
Description
|
Full Usage:
this.Execute
Parameters:
Kontur
-
The subject Kontur.
clip : Kontur
-
The clip Kontur. May be empty, then Union returns the subject simplified under its fill rule.
op : ClipType
-
Union, Intersection, Difference (subject minus clip) or Xor.
Returns: Kontur
A simple Kontur with fill rule Positive: no self intersections, no overlaps, outer contours counter clockwise, holes clockwise.
Input vertices of the result keep their exact coordinates.
|
Runs one boolean operation between a subject and a clip Kontur. The fill rule of each Kontur decides what is inside it, see the docs of FillRule.
|
Full Usage:
this.ExecuteWithData
Parameters:
KonturData<'T>
-
The subject Kontur with one value per point.
clip : KonturData<'T>
-
The clip Kontur with one value per point. May be empty, then Union returns the subject simplified under its fill rule.
op : ClipType
-
Union, Intersection, Difference (subject minus clip) or Xor.
onCrossing : CrossedSegment<'T> -> CrossedSegment<'T> -> 'T
-
Returns the value of a new vertex from the two segments crossing there.
The first segment is the subject segment when a subject segment crosses a clip segment.
For a crossing of two segments of the same Kontur it is the earlier one, by path and then by point.
Returns: KonturData<'T>
A simple Kontur with fill rule Positive, as from Execute, and one array of values per result contour,
with one value per point, the closing point included. The result can be the input of the next operation.
Type parameters: 'T |
Runs one boolean operation like Execute, and also hands the values of the input points on to the vertices of the result, for tracking where each result vertex comes from. An input vertex that is part of the result keeps the value of its input point. That includes an input vertex lying on a segment of the other Kontur, it is no new vertex. Points within tolerance of each other become one result vertex, which keeps the value of the first of them: subject before clip, then the earlier path, then the earlier point. An input point wins over a crossing within tolerance of it. A new vertex where two segments cross gets the value that onCrossing returns for the two segments. onCrossing is called once for every crossing that is part of the result, after the result contours are complete, so a crossing that two result contours share gets the same value in both. Operations without data pay nothing for this: the engine records only integers, and only while this method runs.
|
|
|
Full Usage:
this.SimplifyWithData
Parameters:
KonturData<'T>
-
The Kontur with one value per point.
onCrossing : CrossedSegment<'T> -> CrossedSegment<'T> -> 'T
-
Returns the value of a new vertex from the two segments crossing there, the earlier one first.
Returns: KonturData<'T>
A simple Kontur with fill rule Positive and one array of values per result contour.
Type parameters: 'T |
Resolves the self intersections and overlaps of one Kontur under its fill rule, like Simplify, and hands the values of its points on to the vertices of the result, see ExecuteWithData.
|
Full Usage:
this.Tolerance
Returns: float
|
The absolute tolerance of this engine.
|
|
|
Full Usage:
this.UnionAllWithData
Parameters:
KonturData<'T> seq
-
The Kontur values with one value per point.
onCrossing : CrossedSegment<'T> -> CrossedSegment<'T> -> 'T
-
Returns the value of a new vertex from the two segments crossing there, the earlier one first.
Returns: KonturData<'T>
A simple Kontur with fill rule Positive and one array of values per result contour.
Type parameters: 'T |
Union of any number of Kontur values like UnionAll, and hands the values of their points on to the vertices of the result, see ExecuteWithData. Every Kontur is simplified on its own first, then all results are merged in one NonZero pass, so onCrossing may get segments of earlier results, carrying values it returned itself.
|
Static members
| Static member |
Description
|
Full Usage:
KonturEngine.DefaultTolerance
Returns: float
|
The default absolute tolerance: 1e-6
|
Euclid.Kontur