MESHEDGELENGTH Lengths of edges of a polygonal or polyhedral mesh. output = meshEdgeLength(V, E, F) Example meshEdgeLength See also ------ Author: David Legland e-mail: david.legland@grignon.inra.fr Created: 2010-10-04, using Matlab 7.9.0.529 (R2009b) Copyright 2010 INRA - Cepia Software Platform.
0001 function lengths = meshEdgeLength(vertices, edges, faces) %#ok<INUSD> 0002 %MESHEDGELENGTH Lengths of edges of a polygonal or polyhedral mesh. 0003 % 0004 % output = meshEdgeLength(V, E, F) 0005 % 0006 % Example 0007 % meshEdgeLength 0008 % 0009 % See also 0010 % 0011 % 0012 % ------ 0013 % Author: David Legland 0014 % e-mail: david.legland@grignon.inra.fr 0015 % Created: 2010-10-04, using Matlab 7.9.0.529 (R2009b) 0016 % Copyright 2010 INRA - Cepia Software Platform. 0017 0018 % extract vertices 0019 p1 = vertices(edges(:, 1), :); 0020 p2 = vertices(edges(:, 2), :); 0021 0022 % compute euclidean distance betwenn the two vertices 0023 lengths = sqrt(sum((p2-p1).^2, 2));