Struct poisson::PoissonDisk [] [src]

pub struct PoissonDisk<R> where R: Rng {
    // some fields omitted
}

Generates poisson-disk distribution in [0, 1]² area with O(N log N) time and space complexity relative to the number of samples generated. Based on Gamito, Manuel N., and Steve C. Maddock. "Accurate multidimensional Poisson-disk sampling." ACM Transactions on Graphics (TOG) 29.1 (2009): 8.

Examples

extern crate rand;
extern crate poisson;

let mut poisson = poisson::PoissonDisk::new(rand::weak_rng(), 0.1);
let mut vecs = vec![];
poisson.create(&mut vecs);
println!("{:?}", vecs);

Methods

impl<R> PoissonDisk<R> where R: Rng
[src]

fn new(rand: R, radius: f64) -> PoissonDisk<R>

Creates new PoissonDisk with random generator and radius specified. Radius should be ]0, √2 / 2]

fn create(&mut self, points: &mut Vec<Vec2>)

Populates given vector with poisson-disk distribution [0, 1]²