An incredibly fast and robust JavaScript library for Delaunay triangulation of 2D points.
Delaunator is a JavaScript library that computes Delaunay triangulations from sets of 2D points. It solves the problem of efficiently generating triangular meshes for applications like Voronoi diagrams, geographic mapping, and scientific visualization. The library is designed for speed and reliability, handling large datasets with robust geometric calculations.
JavaScript developers working on data visualization, mapping applications, computational geometry, or graphics programming who need fast triangulation of 2D points.
Developers choose Delaunator for its exceptional performance, robustness with degenerate inputs, and efficient memory usage through flat array data structures. It serves as the core triangulation engine for popular tools like D3's Voronoi implementation.
An incredibly fast JavaScript library for Delaunay triangulation of 2D points
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks show it processes 1 million points in under a second, outperforming competitors like d3-voronoi by 5-10x, making it ideal for large datasets.
Uses robust-predicates to handle degenerate inputs like collinear points accurately, preventing common geometric failures in production.
Stores results in typed arrays (e.g., Uint32Array) reducing memory footprint and improving performance in web and Node.js applications.
The update() method allows modifying coordinates without re-triangulating from scratch, useful for iterative algorithms like Lloyd's relaxation.
Returns triangulation as flat arrays of indices, requiring additional code to convert into usable triangles or meshes, as shown in the README examples.
Lacks any drawing or rendering capabilities; users must integrate with libraries like D3 or Canvas to visualize results, adding complexity.
Only handles 2D point sets, so it cannot be used for 3D spatial analysis or volumetric applications without significant workarounds.
Concepts like halfedges and hull indices are non-intuitive and require understanding of computational geometry to utilize effectively, increasing the learning curve.