voronoid 0.0.2

3D Voronoi tessellation in Rust: a fast, feature-rich grid-based approach ready for WASM and TypeScript.
Documentation
use voronoid::{BoundingBox, Tessellation, Algorithm3DGrid, Cell3DFaces};

fn main() {
    // Initialize Rayon explicitly so thread creation (clone3) happens
    // before the heavy calculation we want to profile.
    rayon::ThreadPoolBuilder::new().build_global().unwrap();

    // Define bounds for the simulation
    let bounds = BoundingBox::new([0.0, 0.0, 0.0], [100.0, 100.0, 100.0]);

    // Create the tessellation instance with a spatial grid (20x20x20)
    // Adjusting grid size affects the binning performance
    let mut tess = Tessellation::<3, Cell3DFaces, _>::new(bounds, Algorithm3DGrid::new(20, 20, 20, &bounds));

    // Generate a large number of random points to stress the algorithm
    // 10,000 points is usually enough to get a good profile
    tess.random_generators(100000);

    // Run the calculation (this is the hot path)
    tess.calculate();
}