Skip to content

Releases: Elan456/fastquadtree

1.5.0 - KNN for RectQuadTree

02 Dec 02:54

Choose a tag to compare

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

24 Nov 07:36

Choose a tag to compare

  • 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

10 Nov 03:39

Choose a tag to compare

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

03 Nov 14:38

Choose a tag to compare

Full Changelog: 1.4.0...1.4.1

1.4.0 - NumPy Queries

03 Nov 05:52

Choose a tag to compare

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

31 Oct 14:31

Choose a tag to compare

Full Changelog: 1.3.1...1.3.2

1.3.1

22 Oct 19:03

Choose a tag to compare

Full Changelog: 1.3.0...1.3.1

1.3.0 - Generic Coordinate Type

22 Oct 18:05

Choose a tag to compare

1.2.3

22 Oct 01:00

Choose a tag to compare

Full Changelog: 1.2.2...1.2.3

1.2.2

21 Oct 19:52

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: 1.2.1...1.2.2