12 releases (breaking)

✓ Uses Rust 2018 edition

0.10.1 Oct 4, 2019
0.9.0 Sep 24, 2017
0.8.0 Mar 19, 2016
0.7.1 Nov 1, 2015
0.5.0 Jun 26, 2015

#269 in Data structures

Download history 9/week @ 2019-07-19 4/week @ 2019-07-26 2/week @ 2019-08-02 11/week @ 2019-08-09 1/week @ 2019-08-16 152/week @ 2019-08-23 25/week @ 2019-08-30 32/week @ 2019-09-06 11/week @ 2019-09-13 55/week @ 2019-09-20 20/week @ 2019-09-27 30/week @ 2019-10-04 4/week @ 2019-10-11 35/week @ 2019-10-18 25/week @ 2019-10-25

117 downloads per month

MIT license

39KB
1K SLoC

poisson

Documentation Crates.io License: MIT Build Status Coverage Status

This is a library for generating n-dimensional poisson-disk distributions.

It generates distribution of points in [0, 1)d where:

  • For each point there is disk of certain radius which doesn't intersect with any other disk of other points
  • Samples fill the space uniformly

Due it's blue noise properties poisson-disk distribution can be used for object placement in procedural texture/world generation, as source distribution for digital stipling, as distribution for sampling in rendering or for (re)meshing.

Usage

Works with nalgebra 0.16 and rand 0.5

extern crate nalgebra as na;

use rand::FromEntropy;
use rand::rngs::SmallRng;

use poisson::{Builder, Type, algorithm};

fn main() {
    let poisson =
        Builder::<_, na::Vector2<f64>>::with_radius(0.1, Type::Normal)
            .build(SmallRng::from_entropy(), algorithm::Ebeida);
    println!("{:?}", poisson.generate());
}

Dependencies

~1.5MB
~24K SLoC