MESHEDGELENGTH Lengths of edges of a polygonal or polyhedral mesh. output = meshEdgeLength(V, E, F) Example meshEdgeLength See also
0001 function lengths = meshEdgeLength(varargin) 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@inrae.fr 0015 % Created: 2010-10-04, using Matlab 7.9.0.529 (R2009b) 0016 % Copyright 2010-2024 INRA - Cepia Software Platform 0017 0018 % parse input arguments 0019 [vertices, edges, faces] = parseMeshData(varargin{:}); 0020 if isempty(edges) 0021 edges = meshEdges(faces); 0022 end 0023 0024 % extract vertices 0025 p1 = vertices(edges(:, 1), :); 0026 p2 = vertices(edges(:, 2), :); 0027 0028 % compute euclidean distance betwenn the two vertices 0029 lengths = sqrt(sum((p2-p1).^2, 2));