Skip to content

Triangulate

Seth Hillbrand edited this page Oct 29, 2026 · 2 revisions

Home › clipper.h › Triangulate

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);

  

See Also

Union, TriangulateResult

Clone this wiki locally