0001 function [Vlist] = vb_boundary_edge(F,V)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 DEBUG = 0;
0014
0015
0016
0017 Jedge = [F(:,1), F(:,2); F(:,2), F(:,3);F(:,3), F(:,1)];
0018
0019
0020 jx = find(Jedge(:,1) > Jedge(:,2));
0021 jj = Jedge(jx,1);
0022 Jedge(jx,1) = Jedge(jx,2);
0023 Jedge(jx,2) = jj;
0024
0025
0026 Jedge = sortrows(Jedge);
0027 Nedge = size(Jedge,1);
0028 Jdiff = Jedge(1:Nedge-1,:) - Jedge(2:Nedge,:);
0029
0030
0031 ix = find( sum(abs(Jdiff),2) == 0 );
0032
0033
0034
0035 Id = ones(Nedge,1);
0036 Id(ix) = 0;
0037 Id(ix+1) = 0;
0038
0039 jx = find(Id > 0);
0040
0041
0042 Fedge = Jedge(jx,:);
0043
0044 if DEBUG == 1
0045 NL = size(Fedge,1);
0046
0047 for n=1:NL
0048 plot3(V(Fedge(n,:),1),V(Fedge(n,:),2),V(Fedge(n,:),3),'r-')
0049 hold on
0050 end
0051 end
0052
0053 Vlist = [];
0054 Flist = [];
0055 Nline = 0;
0056
0057
0058
0059 while ~isempty(Fedge)
0060
0061 [ID, Fedge] = vb_close_line(Fedge);
0062 Nline = Nline + 1;
0063 Vlist{Nline} = ID;
0064 end
0065
0066 if DEBUG == 1
0067 for n=1:Nline
0068 ID = Vlist{n};
0069 plot3(V(ID,1),V(ID,2),V(ID,3),'r-')
0070 hold on
0071 plot3(V([ID(1) ID(n)],1),V([ID(1) ID(n)],2),V([ID(1) ID(n)],3),'r-')
0072 end
0073 end
0074
0075 return
0076
0077
0078 return