Euclid Namespace
| Type/Module | Description |
|
When Euclid is opened this module will be auto-opened. It only contains extension members for type Polyline2D: the boolean operations of the Kontur module directly on closed Polyline2Ds, without creating a Kontur first. Every Polyline2D is one region under the NonZero fill rule, so its orientation does not matter and a self intersecting Polyline2D is filled wherever it winds around. All results are simple closed contours: no self intersections, no overlaps, outer contours counter clockwise, holes clockwise. A fresh engine is created per call. For many operations in a row, for other fill rules or for regions of several paths use Kontur and KonturEngine. |
|
|
Functions on the Euclid.Kontur.ClipType enum. |
|
|
On Euclid.Kontur. The kind of boolean operation between a subject and a clip Kontur. |
|
|
Functions on the Euclid.Kontur.FillRule enum. |
|
|
On Euclid.Kontur. Determines how the winding number of a point decides whether the point is inside a Kontur./// The winding number counts how often the paths of a Kontur wind around a point, counter clockwise turns count +1, clockwise turns count -1. 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. |
|
|
Boolean operations on Kontur values with a fresh engine per call and the default tolerance of 1e-6. For many operations in a row create one KonturEngine and reuse it, that avoids all allocations but the results. |
|
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. |
|
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. |
Euclid.Kontur