Triangulation facets referenced by only one triangle or tetrahedron
FBtri = freeBoundary(TR)
[FBtri,FBpoints] = freeBoundary(TR)
[FBtri,FBpoints] = freeBoundary(TR) also returns a matrix containing the vertices of the free boundary facets.
Triangulation connectivity list, returned as a matrix that contains the following information:
The vertex IDs in FBtri reference a specific matrix, depending on the syntax you choose:
Free boundary points, returned as a matrix containing the coordinates of the vertices of the free boundary facets. Each row of FBpoints contains coordinates of a vertex.
A row number of the matrix, TR.Points or FBpoints. Use this ID to refer a specific vertex in the triangulation.
Use freeBoundary to extract the facets of a 3-D triangulation that cover the surface of an object.
Load a 3-D triangulation.
load tetmesh; TR = triangulation(tet,X);
Compute the boundary triangulation.
[FBtri,FBpoints] = freeBoundary(TR);
Plot the boundary triangulation.
trisurf(FBtri,FBpoints(:,1),FBpoints(:,2),FBpoints(:,3), ... 'FaceColor','cyan','FaceAlpha', 0.8);
Use freeBoundary when you want to highlight the outer edges of a 2-D Delaunay triangulation.
Create a triangulation from a random set of points.
x = gallery('uniformdata',[20,1],0); y = gallery('uniformdata',[20,1],1); DT = delaunayTriangulation(x,y);
Find the free boundary edges.
fe = freeBoundary(DT)';
Plot the mesh and highlight the free boundary edges in red.
triplot(DT); hold on; plot(x(fe),y(fe),'-r','LineWidth',2) ; hold off;