www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/Surfaceof3DTriangulationExample.m

    %% Surface of 3-D Triangulation  
% Use |freeBoundary| to extract the facets of a 3-D triangulation that cover
% the surface of an object.   

% Copyright 2015 The MathWorks, Inc.


%% 
% 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);