def getDistance(self,p1,p2): ret= ((p2.x-p1.x)**2) + ((p2.y-p1.y)**2) + ((p2.z-p1.z)**2) ret=math.sqrt(ret) return ret
Its a blender script function. It takes the vertices point of two 3d vertices, to calculate their distance to each other.
Looks like it
Yeah, it does resemble a Pythagoras :-)
I'm sure Blender has function for this that makes use of more advanced features.
Or do:
(p2-p1).length
which uses Blender's vector maths. (which is natively implemented, so should be faster)
I'll try using the referenced algo.