Computes the 2d Delaunay triangulation of a point set.
Namespace:
ceometric.ComputationalGeometryAssembly: ceometric.ComputationalGeometry (in ceometric.ComputationalGeometry.dll) Version: 2.2.0.0 (2.2.0.0)
Syntax
| C# |
|---|
public class DelaunayTriangulation2d |
| Visual Basic (Declaration) |
|---|
Public Class DelaunayTriangulation2d |
| Visual C++ |
|---|
public ref class DelaunayTriangulation2d |
Remarks
A Delaunay triangulation maximizes the minimum angle of each triangle in the triangulation.
This class implements a fast and robust O(n*log(n)) randomized incremental
algorithm due to Guibas et al. using exact arithmetic.
Examples
// instantiate a 2d Delaunay triangulation DelaunayTriangulation2d dt = new DelaunayTriangulation2d(); // assign the points to triangulate dt.TriangulationPoints = SamplePoints.SupershapeStarfish(10000); // compute the triangulation dt.Triangulate(); // add a point to the existing triangulation dt.AddPointToCurrentTriangulation(new Point(0.5,0.5,0)); // visualize Scene sc = new Scene(); sc.Add(dt.GetTriangles(), "Delaunay", 3); sc.WriteDxf(@"c:\Delaunay.dxf"); // Rasterize the current triangulation over a [0.01,0.01]-raster dt.RasterizeCurrentTriangulation(0.01, 0.01); // some properties of the triangulation Console.WriteLine(dt.NumberOfTriangles + " triangles created on " + dt.TriangulationPoints.Count + " raster points"); Console.WriteLine("Triangulated area: " + dt.Area); // visualize the rastered triangulation sc = new Scene(); sc.Add(dt.GetTriangles(), "Delaunay_rastered", 3); sc.WriteDxf(@"c:\Delaunay_rastered.dxf");
Inheritance Hierarchy
System..::.Object
ceometric.ComputationalGeometry..::.DelaunayTriangulation2d
ceometric.ComputationalGeometry..::.ConformingDelaunayTriangulation2d
ceometric.ComputationalGeometry..::.DelaunayTriangulation2d
ceometric.ComputationalGeometry..::.ConformingDelaunayTriangulation2d