sgsellan / gpytoolbox

A collection of utility functions to prototype geometry processing research in python
https://gpytoolbox.org
GNU General Public License v3.0
205 stars 16 forks source link

The `point_mesh_squared_distance` and `winding_number` functions always rebuild a tree #146

Open abhimadan opened 2 months ago

abhimadan commented 2 months ago

These functions call code from libigl that builds a BVH/octree and then uses that for executing the query, which is fine for code that calls these functions infrequently on large arrays of query points, but some use cases require calling them several times on smaller sets of points, which makes them dominated by the tree building phase. It would be nice to have an option to build the appropriate data structure once and then reuse it for these queries.

sgsellan commented 2 months ago

You're definitely correct. The reason that option does not exist is that I do not quite know how to export the BVH from the libigl C++ code into a python object that can be returned by our python wrapper and that can be then passed as input to another function. I will admit I have not looked into this too much: we would gladly merge a PR that does this.