Crates.io | poisson |
lib.rs | poisson |
version | 0.10.1 |
source | src |
created_at | 2015-05-25 00:33:18.908972 |
updated_at | 2019-10-04 16:09:59.962164 |
description | Poisson-disk distribution generator. |
homepage | |
repository | https://github.com/WaDelma/poisson |
max_upload_size | |
id | 2193 |
size | 66,553 |
This is a library for generating n-dimensional poisson-disk distributions.
It generates distribution of points in [0, 1)d where:
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.
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());
}