Delaunay Triangulation

Delaunay Triangulation implementation written with swift


Create array of Vertex.

Using CDT vertices must be sorted and validated. I.e. sorted into closed polygon. Duplicates will be deleted by internal algorithm. By default index of the Vertex is -1. For CDT, index must be set in same order as in polygon .

Constrained Delaunay Triangulation

let triangles = CDT().triangulate(vertices, holes)

Constrained Delaunay Triangulation implemented in the way its utilize Delaunay and then remove trianles for holes and triangles out of constraines. Future improvements can by applied, test triangles before adding them to the list for original Delaunay triangulation process.

Triangulation Example

Simple Delauney

Generate a set of vertices and pass them into Delaunay().triangulate(vertices) which will then return the optimal set of triangles.

See the example project for more details.

Triangulation Example

-- Inspired by AlexLittlejohn/DelaunaySwift De-fork repository since implementation more then 80% is rewritten and extended greately.


  • Swift Tools 5.3.0
View More Packages from this Author


  • None
Last updated: Mon Nov 14 2022 09:27:41 GMT-0500 (GMT-05:00)