outface=outersurf(node,face) extract the out-most shell of a complex surface mesh author: Qianqian Fang, <q.fang at neu.edu> input: node: node coordinates face: surface triangle list output: outface: the out-most shell of the surface mesh -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)
0001 function outface=outersurf(node,face) 0002 % 0003 % outface=outersurf(node,face) 0004 % 0005 % extract the out-most shell of a complex surface mesh 0006 % 0007 % author: Qianqian Fang, <q.fang at neu.edu> 0008 % 0009 % input: 0010 % node: node coordinates 0011 % face: surface triangle list 0012 % 0013 % output: 0014 % outface: the out-most shell of the surface mesh 0015 % 0016 % -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net) 0017 % 0018 0019 face=face(:,1:3); 0020 0021 ed=surfedge(face); 0022 if(~isempty(ed)) 0023 error('open surface is detected, you have to close it first, consider meshcheckrepair() with meshfix option'); 0024 end 0025 0026 [no,el]=fillsurf(node,face); 0027 0028 outface=volface(el); 0029 0030 [no,outface]=removeisolatednode(no,outface); 0031 maxfacenode=max(outface(:)); 0032 0033 [I,J]=ismember(round(no(1:maxfacenode,:)*1e10),round(node*1e10),'rows'); 0034 0035 % if(sum(I)~=maxfacenode) 0036 % error('mesh tessellation failed'); 0037 % end 0038 outface=J(outface); 0039 [ii,jj]=find(outface==0); 0040 outface(ii,:)=[];