Skip to content

Consider a “query_pairs” method #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
matsupin opened this issue Feb 3, 2025 · 1 comment
Open

Consider a “query_pairs” method #40

matsupin opened this issue Feb 3, 2025 · 1 comment

Comments

@matsupin
Copy link

matsupin commented Feb 3, 2025

Hi,

Really interesting tool that you have there, thank you for making it available!

I wonder if it would be possible to introduce a query_pairs type method in a future version, like the one provided by cKDTree in the scipy.spatial module. Ideally, it would return a numpy array of index pairs.

This could prove particularly useful for quickly accessing colliding pairs of AABBs without having to perform any further manipulation in Python.

Currently, to do this I need to use np.vectorize, np.repeat and np.concatenate to convert the nested lists from batch_query into flat arrays and then apply a boolean mask to remove duplicate and undesired pairs. Unfortunately, this whole process cancels out any performance gains from the parallelized C++ calculations.

Please, let me know!

@atksh
Copy link
Owner

atksh commented Feb 12, 2025

Hi, @matsupin

Thank you for your suggestion! I will adding a method query_intersections() that would efficiently enumerate pairs of intersecting AABBs.

Since AABB intersection checks are based on simple bounding box overlap rather than distance calculations, I believe parameters like r (radius) and p (norm) from query_pairs() are unnecessary for this method.

Would this approach meet your needs? Let me know if you have any specific requirements or use cases I should consider!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants