[DL,DVL]=VLdistance(VL)
VL : | Vertex list |
DL : | Distance list | |
DVL : | Distance vector list |
VLnorm(VLsample(3))
VLdistance(VLsample(3))
The function VLdistance
calculates the distance between consecutive vertices in a given vertex list (VL). It is part of the SolidGeometry library and is designed to be efficient, with version 4.0 being significantly faster than previous versions.
VLui
.The function begins by checking if any input arguments are provided. If not, it defaults to using VLui
as the vertex list.
The core of the function involves calculating the distance between each vertex and the next one in the list. This is achieved by using the circshift
function to shift the vertex list by one position, effectively aligning each vertex with its successor. The difference between these aligned lists is then passed to the VLnorm
function, which computes the distance vector list (DVL
) and the distance list (DL
).
The function is optimized for speed, as indicated by the comment that it is 10 times faster than using VLangle
for the same purpose.
Note: The function does not define the first value for VLnorm
and the last value for VLdistance
, as these are inherently undefined in the context of the operation being performed.