Releases: Elan456/fastquadtree
1.5.0 - KNN for RectQuadTree
RectQuadTree: New Nearest Neighbor Methods
New Features
nearest_neighbor(xy, *, as_item=False) — Find the single closest rectangle to a query point.
nearest_neighbors(xy, k, *, as_items=False) — Find the k closest rectangles to a query point, returned in order of increasing distance.
Both methods use euclidean distance to the nearest edge of each rectangle, making them ideal for spatial proximity queries against axis-aligned bounding boxes.
Example
# Find the 3 closest rectangles to a point
results = rqt.nearest_neighbors((15.0, 15.0), k=3, as_items=True)
for item in results:
print(f"Rectangle {item.id_} at {item.geom}")
Use Cases
These methods are particularly useful for game development scenarios involving rectangular geometry. You can quickly determine which wall, platform, or obstacle is closest to a player or NPC for collision detection, pathfinding, or proximity triggers.
1.4.3
- Rust core now uses a default max-depth based on its dtype's maximum precision to avoid OOM when inserting identical points.
Full Changelog: 1.4.2...1.4.3
1.4.2
What's Changed
- Several minor optimizations around NumPy query handling
- Doc improvements
- Ball pit runnable can dynamically switch quadtree provider
Full Changelog: 1.4.1...1.4.2
1.4.1
Full Changelog: 1.4.0...1.4.1
1.4.0 - NumPy Queries
Adds the query_np method for both Rect and Point quadtree. It offers massive performance improvements over the typical query by utilizing NumPy arrays instead of creating Python integers, floats, and tuples.
1.3.2
Full Changelog: 1.3.1...1.3.2
1.3.1
Full Changelog: 1.3.0...1.3.1
1.3.0 - Generic Coordinate Type
Full Changelog: 1.2.3...1.3.0
1.2.3
Full Changelog: 1.2.2...1.2.3
1.2.2
What's Changed
- Update README.md by @KyleZheng1284 in #6
New Contributors
- @KyleZheng1284 made their first contribution in #6
Full Changelog: 1.2.1...1.2.2