0001 function edge = mesh_edges(FV)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 tic;
0022 fprintf('...searching for mesh edges...');
0023
0024 nvertex = size(FV.vertices,1);
0025 nface = size(FV.faces,1);
0026
0027
0028 edge = sparse(nvertex,nvertex);
0029
0030 for f = 1:nface,
0031
0032
0033 Diff = [FV.vertices(FV.faces(f,[1 2 3]),:) - FV.vertices(FV.faces(f,[2 3 1]),:)];
0034 Norm = sqrt( sum(Diff.^2, 2) );
0035
0036 edge(FV.faces(f,1),FV.faces(f,2)) = Norm(1);
0037 edge(FV.faces(f,2),FV.faces(f,3)) = Norm(2);
0038 edge(FV.faces(f,3),FV.faces(f,1)) = Norm(3);
0039
0040
0041 edge(FV.faces(f,2),FV.faces(f,1)) = Norm(1);
0042 edge(FV.faces(f,3),FV.faces(f,2)) = Norm(2);
0043 edge(FV.faces(f,1),FV.faces(f,3)) = Norm(3);
0044 end
0045
0046 t=toc;
0047 fprintf('done (%5.2f sec).\n',t);
0048
0049 return