Forum: Poser Python Scripting


Subject: Useful Code Snippets

structure opened this issue on Jun 27, 2019 ยท 94 posts


adp001 posted Sat, 16 May 2020 at 9:15 AM

And a real fast function to compute the distance between 2 verts:

def distance_e(v, u):
    # Distance with Numpy "einsum"
    # https://semantive.com/blog/high-performance-computation-in-python-numpy-2/
    z = v - u
    return NP.sqrt(NP.einsum('i,i->', z, z))