Repository navigation
Triangulate
Home › clipper.h › Triangulate
TriangulateResult Triangulate(const Paths64& subject, Paths64& solution, bool useDelaunay = true);
TriangulateResult Triangulate(const PathsD& subject, int decPlaces, PathsD& solution, bool useDelaunay = true);This function Triangulates subject polygons. By default, the algorithm performs Constrained Delaunay Triangulation, but the function can also produce simpler triangles that avoids the overhead of Delaunay compliance.
While polygons in clipping operations may intersect and even self-intersect, subject polygons passed to this function must not intersect, either with other polygons or through self-intersections. If intersections are possible in subject polygons, these must be removed (eg. via a Union operation) before performing Triangulation, otherwise the function will fail.
Example:
SvgReader sr = SvgReader(folder + "coral3.svg");
PathsD subject = sr.paths;
Triangulate(subject, 0, sol, true);
DisplaySolution("coral3_t.svg", sol, multicolor);
Copyright © 2010-2025 Angus Johnson. Clipper2 is distributed under the Boost Software License.
Headers
- clipper.h
- clipper.core.h
- clipper.engine.h
- clipper.export.h
- clipper.minkowski.h
- clipper.offset.h
- clipper.rectclip.h
- clipper.triangulation.h
Classes
Data types and structure definitions
- ClipType
- EndType
- FillRule
- JoinType
- Path64
- PathD
- Paths64
- PathsD
- Point64
- PointD
- PointInPolygonResult
- Rect64
- RectD
- TriangulateResult
- ZCallback64
- ZCallbackD
Static Functions
- Area
- BooleanOp
- Difference
- InflatePaths
- Intersect
- IsPositive
- MakePath
- MinkowskiDiff
- MinkowskiSum
- PointInPolygon
- PolyTreeToPaths64
- PolyTreeToPathsD
- RectClip
- RectClipLines
- ReversePath
- SimplifyPaths
- TranslatePath
- Triangulate
- TrimCollinear
- Union
- XOR
Topics