Poisson disk sampling
Generates a sampling of points in [0, 1)2 where:
- Sample points fill the space uniformly.
- Sample points stay a given minimum distance apart.
This is equivalent to uniformly filling a unit square with non-overlapping disks of equal radius, where the radius is half the minimum distance.
Due to their blue noise properties, Poisson disk samplings can be used for object placement in procedural texture/world generation, digital stippling, sampling in rendering, or (re)meshing.
Examples
Generate a non-tiling Poisson disk sampling in [0, 1)2 with disk radius 0.1 using a slower but more accurate algorithm.
use ;
use SeedableRng;
use SmallRng;
Generate a tiling Poisson disk sampling in [0, 1)2 with approximately 100 samples and relative disk radius 0.9 using a faster but less accurate algorithm.
# use ;
# use SeedableRng;
# use SmallRng;