alphaTriangulation
Triangles or tetrahedra that make up an alpha shape, with the point coordinates.
Category: Mathematics > Computational Geometry
Syntax
tri = alphaTriangulation(shp)
Returns the connectivity list of the simplices inside the shape.
[tri, xyz] = alphaTriangulation(shp)
Also returns the coordinates of the points.
Description
The result is the part of the Delaunay triangulation of the points that is kept for the current Alpha. Raising alpha adds simplices; lowering it removes them. The rows of tri index into the rows of xyz, so the pair can be passed directly to a plotting call such as trisurf or triplot.
Input arguments
shp- An
alphaShapeobject.
Output arguments
tri- Matrix of point indices: three columns per triangle for a 2-D shape, four per tetrahedron for a 3-D one.
xyz- The point coordinates, one row per point.
Example
Triangles of a 2-D alpha shape
x = [0 1 1 0 0.5]';
y = [0 0 1 1 0.5]';
shp = alphaShape(x, y, 1);
[tri, xyz] = alphaTriangulation(shp)
Output
tri = 4×3
5 2 3
1 2 5
5 4 1
3 4 5
xyz = 5×2
0 0
1.0000 0
1.0000 1.0000
0 1.0000
0.5000 0.5000