You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks for creating this crate!
For my use case (swarm simulation), I'm searching for nearby entities using KDTree::within. However as it only returns the indices, I'm re-calculating the distances of neighbours to use downstream. I see internally that KDTree::within is already calculating it for candidate points, so was wondering if they could also be returned alongside the indices?
The text was updated successfully, but these errors were encountered:
That sounds like you probably ideally want to use nearest neighbors instead of within. This is tracked by #97.
The RTree implementation already has the nearest neighbor implementation, but an improvement will be to expose it as a rust Iterator instead of collecting into a Vec, see #98 for a WIP but not yet functional implementation.
In this case, the item yielded by the iterator includes both the id and the (squared) distance:
I think this approach would work the best for you as well: to implement an iterator-based nearest-neighbor search and then you can stop iteration once you've hit a certain number or distance.
Hi, thanks for creating this crate!
For my use case (swarm simulation), I'm searching for nearby entities using KDTree::within. However as it only returns the indices, I'm re-calculating the distances of neighbours to use downstream. I see internally that KDTree::within is already calculating it for candidate points, so was wondering if they could also be returned alongside the indices?
The text was updated successfully, but these errors were encountered: