faster_poisson
This is a library that implements various methods of Poisson disk sampling.
Each method returns a set of points where no two are less than a fixed distance from each other.
Usage
The easiest way to use this library is with the [Poisson2D], [Poisson3D], and [PoissonND] types.
You can generate points all at once with the run method, or lazily with the iter method.
To change parameters like the grid dimensions or minimum distance, [Poisson] uses a fluent interface pattern.
use ;
// Sample points from a 6 x 4 grid with minimum distance 0.5.
let poisson_2d = new.dims.radius;
let samples_2d = poisson_2d.run;
// The default side length of the grid is 1.0 and the default radius is 0.1.
let poisson_3d = new;
let samples_3d = poisson_3d.run;
// For dimensions higher than 3, use PoissonND.
let poisson_4d = new;
// Points are generated lazily, so this is fast.
let samples_4d_100: = poisson_4d.iter.take.collect;
For smaller 2D grids (< 1,000,000 points) it is probably faster to use [PoissonDart2D].