incremental-delaunay
Incremental Delaunay triangulation data structure.
Warning This module has problems in >3D. For those cases you should use delaunay-triangulate instead.
Example
var createTriangulation = //Create a 2D triangulation with some pointsvar triangulation = //Insert some random pointtriangulation //Get all points in the triangulationconsole //Get all cells in the triangulationconsole //Locate a triangle containing a pointconsole
Example output:
points= -1e+30 -1e+30 1e+30 -1e+30 0 1e+30 0 1 1 0 1 1 1 2 cells= 5 6 3 3 6 2 6 1 2 5 1 6 4 5 3 4 1 5 3 0 4 0 1 4 0 3 2 located triangle= 3 0 4
API
var createTriangulation =
Constructor
var triangulation = createTriangulation(dimension, points)
Creates a triangulation
dimension
is the dimension of the ambient spacepoints
is an array of points
Returns A DelaunayTriangulation
object
Methods
triangulation.cells
An array of all cells in the triangulation
triangulation.points
An array of all points in the triangulation
triangulation.insert(point)
Adds point
to the triangulation
triangulation.locate(point)
Returns the simplex containing point
Credits
(c) 2013-2014 Mikola Lysenko. MIT License