Triangulation that fills alpha shape
Create a set of 3-D points.
[x1, y1, z1] = sphere(24); x1 = x1(:); y1 = y1(:); z1 = z1(:); x2 = x1+5; P = [x1 y1 z1; x2 y1 z1]; P = unique(P,'rows');
Create and plot an alpha shape for the point cloud using an alpha radius of 1.
shp = alphaShape(P,1); plot(shp)
alphaTriangulation to recover the triangulation that defines the domain of the alpha shape.
tri = alphaTriangulation(shp);
Find the total number of tetrahedra that make up the alpha shape.
numtetrahedra = size(tri,1)
numtetrahedra = 3729
Triangulation, returned as a matrix.
tri is of size
mtri is the number of triangles or tetrahedra in the
alpha shape and
nv is the number of vertices. The value
3 for 2-D alpha shapes and
4 for 3-D alpha shapes.
P— Vertex coordinates
Vertex coordinates, returned as a matrix.
P is of size
N is the number of points in the alpha shape and
dim is either
3 (for either a 2-D or 3-D alpha shape).