Open huonghld opened 2 years ago
One solution is cKDTree:
from scipy.spatial import cKDTree
tree = cKDTree(mesh1.vertices)
dists,neighbors=tree.query(mesh2.vertices,k=1)
for v,i,d in zip(mesh2.vertices,neighbors,dists):
print(f'vertex={v}, neighbor={mesh1.vertices[i]}, dist={d}')
Another way via trimesh directly:
dists,neighbors=obj1.kdtree.query(obj2.vertices)
for v,i,d in zip(obj2.vertices,neighbors,dists):
print(f'vertex={v}, neighbor={obj1.vertices[i]}, dist={d}')
Hello, Thank you so much for your awesome work!
Is there any way to calculate the difference between 2 meshes by storing the distance between vertices? I think I should need to find the closest point of each vertex, but I'm new to python and trimesh, Could you give an example of this?
Thanks a lot!