nmwsharp / potpourri3d

An invigorating blend of 3D geometry tools in Python.
MIT License
441 stars 35 forks source link

Geodesic pairwise distance #7

Open dhorka opened 2 years ago

dhorka commented 2 years ago

Hi,

I would like to get the geodesic pairwise distance of a mesh. I saw that there are some methods to get the distance for a specific each. However, I did not see how to get efficiently the pairwise distance.

Thanks,

nmwsharp commented 5 months ago

(long-delayed response in case it's useful for others)

I'd suggest simply calling these algorithms in a for-loop over all vertices. The underlying algorithms do not have offer any special accelerations for the case of computing all-pairs distance. We could add a helper function for all-pairs, but it would just be a for-loop in C++ :) it might save a little overhead (so I'd be happy to take a PR adding it), but not a ton.

The stateful heat geodesic solver takes advantage of precomputation, so it should be reasonably fast for this intended use case.