rtree
rtree copied to clipboard
getting intersections for many query points
Hi,
Thank you for this very useful library.
I am trying to use the trimeshlibrary to query the nearest pooint on a 3d mesh for a large set of query points and it is quite slow. One major bottleneck is the line here https://github.com/mikedh/trimesh/blob/63e35a5652c9525a6a8070271c2bac8f4d13105b/trimesh/proximity.py#L64
candidates = [list(rtree.intersection(b)) for b in bounds]
which loops in python over the array bounds that is length nb_of_point.
Ideally rtree.intersection would accept a list of boxes, implement the loop in c++ and return the list of list of candidates (similarly to scipy.spatial.KDTree.query_ball_point). Would it be possible to implement instead the loop in C++ in rtree by having rtree supporting arrays of size n x 6 as inputs in the intersectionmethod as mentioned here https://github.com/mikedh/trimesh/issues/1116?
Would the binding method used in rtree allow to do that loop in C++, or would that require using cython for example ?
Noticed this issue is quite similar to https://github.com/Toblerity/rtree/issues/172.