Documentation Center

  • Trial Software
  • Product Updates

delaunayTriangulation class

Superclasses: triangulation

Delaunay triangulation in 2-D and 3-D

Description

Use the delaunayTriangulation class to create a 2-D or 3-D triangulation from a set of points. When your points are in 2-D, you can specify edge constraints .

You can perform a variety of topological and geometric queries on a delaunayTriangulation, including any triangulation query. For example, locate a facet that contains a specific point, find the vertices of the convex hull, or compute the Voronoi Diagram.

Construction

DT = delaunayTriangulation(P) creates a Delaunay triangulation from the points in P. Matrix P has 2 or 3 columns, depending on whether your points are in 2-D or 3-D space.

DT = delaunayTriangulation(P,C) specifies the edge constraints in matrix C. In this case, P specifies points in 2-D. Each row of C defines the start and end vertex IDs of a constrained edge.

DT = delaunayTriangulation(x,y) creates a 2-D Delaunay triangulation from the point coordinates in the column vectors, x and y.

DT = delaunayTriangulation(x,y,C) specifies the edge constraints in matrix C.

DT = delaunayTriangulation(x,y,z) creates a 3-D Delaunay triangulation from the point coordinates in the column vectors, x, y, and z.

DT = delaunayTriangulation() creates an empty Delaunay triangulation.

Input Arguments

P

Input points, specified as a matrix whose columns are the x, y, (and possibly z) coordinates of the triangulation points. The row numbers of P are the vertex IDs in the triangulation.

x

x-coordinates vector, specified as a column vector containing the x-coordinates of the triangulation points.

y

y-coordinates vector, specified as a column vector containing the y-coordinates of the triangulation points.

z

z-coordinates vector, specified as a column vector containing the z-coordinates of the triangulation points.

C

Vertex IDs of constrained edges, specified as a 2-column matrix. Each row of C corresponds to a constrained edge and contains two IDs:

  • C(j,1) is the ID of the vertex at the start of an edge.

  • C(j,2) is the ID of the vertex at end of the edge.

You can specify edge constraints for 2-D triangulations only.

Properties

Points

Points in the triangulation, represented as a matrix containing the following information:

  • Each row in DT.Points contains the coordinates of a vertex.

  • Each row number of DT.Points is a vertex ID.

ConnectivityList

Triangulation connectivity list, represented as a matrix. This matrix contains the following information:

  • Each row represents a triangle or tetrahedron in the triangulation.

  • Each row number of DT.ConnectivityList is a Triangle or Tetrahedron ID.

  • Each element is a vertex ID.

Constraints

Constrained edges, represented as a two-column matrix of vertex IDs. Each row of DT.Constraints corresponds to a constrained edge and contains two IDs:

  • DT.Constraints(j,1) is the ID of the vertex at the start of an edge.

  • DT.Constraints(j,2) is the ID of the vertex at end of the edge.

DT.Constraints is an empty matrix when the triangulation has no constrained edges.

Methods

convexHullConvex hull
isInteriorTest if triangle is in interior of 2-D constrained Delaunay triangulation
nearestNeighborVertex closest to specified location
pointLocationTriangle or tetrahedron containing specified location
voronoiDiagramVoronoi diagram

Inherited Methods

barycentricToCartesianConverts point coordinates from barycentric to Cartesian
cartesianToBarycentricConverts point coordinates from Cartesian to barycentric
circumcenterCircumcenter of triangle or tetrahedron
edgeAttachmentsTriangles or tetrahedra attached to specified edge
edgesTriangulation edges
faceNormalTriangulation face normal
featureEdgesTriangulation sharp edges
freeBoundaryTriangulation facets referenced by only one triangle or tetrahedron
incenterIncenter of triangle or tetrahedron
isConnectedTest if two vertices are connected by edge
neighborsNeighbors to specified triangle or tetrahedron
sizeSize of triangulation connectivity list
vertexAttachmentsTriangles or tetrahedra attached to specified vertex
vertexNormalTriangulation vertex normal

Definitions

Delaunay Triangulation

In a 2-D Delaunay triangulation, the circumcircle associated with each triangle does not contain any points in its interior. Similarly, a 3-D Delaunay triangulation does not have any points in the interior of the circumsphere associated with each tetrahedron. This definition extends to N-D, although delaunayTriangulation supports only 2-D and 3-D.

Vertex ID

A row number of the matrix, DT.Points. Use this ID to refer a specific vertex in the triangulation.

Triangle or Tetrahedron ID

A row number of the matrix, DT.ConnectivityList. Use this ID to refer a specific triangle or tetrahedron.

Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects in the MATLAB® documentation.

Examples

expand all

2-D Delaunay Triangulation

Create a 2-D delaunayTriangulation for 30 random points.

P = gallery('uniformdata',[30 2],0);
DT = delaunayTriangulation(P)
DT = 

  delaunayTriangulation with properties:

              Points: [30x2 double]
    ConnectivityList: [50x3 double]
         Constraints: []

Plot the triangulation.

figure
triplot(DT)

3-D Delaunay Triangulation

Create a 3-D delaunayTriangulation for 30 random points.

x = gallery('uniformdata',[30 1],0);
y = gallery('uniformdata',[30 1],1);
z = gallery('uniformdata',[30 1],2);
DT = delaunayTriangulation(x,y,z)
DT = 

  delaunayTriangulation with properties:

              Points: [30x3 double]
    ConnectivityList: [111x4 double]
         Constraints: []

Plot the triangulation at 30% opacity with a light blue face color.

faceColor  = [0.6875 0.8750 0.8984];
figure
tetramesh(DT,'FaceColor',faceColor,'FaceAlpha',0.3);

See Also

| |

Was this topic helpful?