kdtree-3d-rust 1.0.0

A fast, memory-safe 3D KD-tree implementation
Documentation
  • Coverage
  • 19.23%
    10 out of 52 items documented0 out of 25 items with examples
  • Size
  • Source code size: 42.55 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 846.48 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • WyoMurf/kdtree
    4 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • WyoMurf

3D KD-Tree (Rust Implementation)

This directory contains the unified Rust implementation of a 3D KD-Tree, parameterized using Rust Generics and Traits to support i32, i64, and i128 coordinate widths dynamically.

Compilation & Usage

You do not need any build-time feature flags to choose between 32-bit, 64-bit, and 128-bit coordinate widths. The Tree struct uses a generic type parameter bounded by a custom Coord trait. Function names remain clean and idiomatic, without any bit-size suffixes.

use kdtree3d::{Tree, KdBox};

fn main() {
    // Instantiate a 32-bit KDTree
    let mut tree32: Tree<&str, i32> = Tree::new();
    let box32: KdBox<i32> = [0, 0, 0, 10, 10, 10];
    tree32.insert("item32", box32);

    // Instantiate a 64-bit KDTree
    let mut tree64: Tree<&str, i64> = Tree::new();
    let box64: KdBox<i64> = [0, 0, 0, 10, 10, 10];
    tree64.insert("item64", box64);

    // Instantiate a 128-bit KDTree
    let mut tree128: Tree<&str, i128> = Tree::new();
    let box128: KdBox<i128> = [0, 0, 0, 10, 10, 10];
    tree128.insert("item128", box128);
}

Testing

Run the test suite using standard cargo commands:

cargo test