Expand description
bluenoise-rs
bluenoise provides an implementation of poisson disk sampling
in two dimensions, with glam
as the underlying maths library.
It aims to be fast, well documented and easy to use, taking
advantage of a few optimisations
to dramatically speed up compute speed.
§Examples
use bluenoise::BlueNoise;
use rand_pcg::Pcg64Mcg;
let mut noise = BlueNoise::<Pcg64Mcg>::new(50.0, 50.0, 10.0);
let noise = noise.with_samples(10).with_seed(10);
for point in noise.take(10) {
println!("{}, {}", point.x, point.y);
}
use bluenoise::WrappingBlueNoise;
use rand::SeedableRng;
use rand_pcg::Pcg64Mcg;
let mut noise = WrappingBlueNoise::from_rng(50.0, 50.0, 10.0, Pcg64Mcg::seed_from_u64(10));
let noise = noise.with_samples(10);
for point in noise.take(10) {
println!("{}, {}", point.x, point.y);
}
Structs§
- Blue
Noise - Provides a source of
BlueNoise
in a given area at some density. - Wrapping
Blue Noise - Provides a source of
WrappingBlueNoise
in a given area at some density, where the distance between two points wraps around the edges of the box. This can be used to generate tiling blue noise.