


f=surfaceclean(f,v)
remove surface patches that are located inside
the bounding box faces
author: Qianqian Fang, <q.fang at neu.edu>
date: 2008/04/08
input:
v: surface node list, dimension (nn,3)
f: surface face element list, dimension (be,3)
output:
f: faces free of those on the bounding box
-- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)


0001 function f=surfaceclean(f,v) 0002 % 0003 % f=surfaceclean(f,v) 0004 % 0005 % remove surface patches that are located inside 0006 % the bounding box faces 0007 % 0008 % author: Qianqian Fang, <q.fang at neu.edu> 0009 % date: 2008/04/08 0010 % 0011 % input: 0012 % v: surface node list, dimension (nn,3) 0013 % f: surface face element list, dimension (be,3) 0014 % 0015 % output: 0016 % f: faces free of those on the bounding box 0017 % 0018 % -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net) 0019 % 0020 pos=v; 0021 mi=min(pos); 0022 ma=max(pos); 0023 0024 idx0=find(abs(pos(:,1)-mi(1))<1e-6); 0025 idx1=find(abs(pos(:,1)-ma(1))<1e-6); 0026 0027 idy0=find(abs(pos(:,2)-mi(2))<1e-6); 0028 idy1=find(abs(pos(:,2)-ma(2))<1e-6); 0029 0030 idz0=find(abs(pos(:,3)-mi(3))<1e-6); 0031 idz1=find(abs(pos(:,3)-ma(3))<1e-6); 0032 0033 f=removeedgefaces(f,v,idx0); 0034 f=removeedgefaces(f,v,idx1); 0035 f=removeedgefaces(f,v,idy0); 0036 f=removeedgefaces(f,v,idy1); 0037 f=removeedgefaces(f,v,idz0); 0038 f=removeedgefaces(f,v,idz1); 0039 0040 function f=removeedgefaces(f,v,idx1) 0041 mask=zeros(length(v),1); 0042 mask(idx1)=1; 0043 f(find(sum(mask(f)')==3),:)=[];