quadtree

A Quadtree implementation

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install quadtree
choosenim install quadtree
git clone https://github.com/Nycto/QuadtreeNim

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
quadtree - - - - - - -

Source

Repository https://github.com/Nycto/QuadtreeNim
Homepage https://github.com/Nycto/QuadtreeNim
Registry Source nimble_official

README

QuadtreeNim Build Status

A Quadtree library in Nim. Quadtrees are a way of indexing objects on a grid. You can find a reasonable introduction here:

http://gamedevelopment.tutsplus.com/tutorials/make-your-game-pop-with-particle-effects-and-quadtrees--gamedev-2138

API Docs

http://nycto.github.io/QuadtreeNim/quadtree.html

A Small Example

import quadtree

type Box = tuple[x, y, width, height: int]
    ## This represents whatever type you want to store in the tree

var tree = newQuadtree[Box]()

tree.insert( (x: 1, y: 1, width: 5, height: 4) )
tree.insert( (x: 2, y: 3, width: 5, height: 5) )
tree.insert( (x: 19, y: 4, width: 3, height: 1) )

# Grab all the elements that are near (2, 2)
echo tree.fetch(2, 2)

License

This library is released under the MIT License, which is pretty spiffy. You should have received a copy of the MIT License along with this program. If not, see http://www.opensource.org/licenses/mit-license.php