triangulation

Stores a 2-D or 3-D triangulation and answers queries about it.

Category: Mathematics > Computational Geometry

Syntax

TR = triangulation(T, P)

Creates a triangulation from the connectivity list T and the point coordinates P.

TR = triangulation(T, x, y)

Same, with the coordinates of a 2-D triangulation given as separate column vectors.

TR = triangulation(T, x, y, z)

Same, for 3-D points.

Description

The object keeps the points and the connectivity list together and offers query methods such as pointLocation, vertexAttachments, vertexNormal, neighbors and freeBoundary. It does not build a mesh by itself: the connectivity list normally comes from delaunay, or from an external mesher.

The properties can be read with dot notation, for example TR.Points and TR.ConnectivityList.

Input arguments

T
m-by-3 (triangles) or m-by-4 (tetrahedra) matrix of indices into the points.
P
n-by-2 or n-by-3 matrix of point coordinates.

Output arguments

TR
A triangulation object with properties Points and ConnectivityList.

Example

Two triangles forming a square

P = [0 0; 1 0; 1 1; 0 1];
T = [1 2 3; 1 3 4];
TR = triangulation(T, P);
disp(size(TR.Points))
disp(TR.ConnectivityList)
Output
     4     2
     1     2     3
     1     3     4

See also

delaunay delaunayTriangulation triplot TriRep