Boundary facets of alpha shape
Find Boundary of 3-D 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 using an alpha radius of 1.5.
shp = alphaShape(P,1.5); plot(shp) axis equal
Compute and plot only the boundary of the alpha shape.
[tri, xyz] = boundaryFacets(shp); trisurf(tri,xyz(:,1),xyz(:,2),xyz(:,3),... 'FaceColor','cyan','FaceAlpha',0.3) axis equal
bf — Boundary facets
Boundary facets, returned as a matrix.
bf is of size
is the number of boundary facets and
n is the number of
vertices per facet.
P — Vertex coordinates
Vertex coordinates, returned as a matrix.
P is of size
N is the number of points on the boundary of the
alpha shape and
dim is either
3 (for either a 2-D or 3-D alpha shape).
Introduced in R2014b