KiCad PCB EDA Suite
Loading...
Searching...
No Matches
POISSON_DISK Namespace Reference

Functions

std::vector< VECTOR2DToroidalUnitTile (double aMinDist, uint32_t aSeed)
 Bridson's "Fast Poisson Disk Sampling in Arbitrary Dimensions" with toroidal boundary conditions on the unit square [0, 1) × [0, 1).
 

Function Documentation

◆ ToroidalUnitTile()

std::vector< VECTOR2D > POISSON_DISK::ToroidalUnitTile ( double aMinDist,
uint32_t aSeed )

Bridson's "Fast Poisson Disk Sampling in Arbitrary Dimensions" with toroidal boundary conditions on the unit square [0, 1) × [0, 1).

"Toroidal" means the minimum-distance check wraps around the unit-square edges, so the resulting point set tiles seamlessly without near-touches at boundaries.

Output is fully deterministic per (aMinDist, aSeed).

Parameters
aMinDistMinimum distance between samples. Must be in (0, 0.5].
aSeedRNG seed
Returns
Sample positions in [0, 1) × [0, 1).

Definition at line 32 of file poisson_disk.cpp.

References grid, M_PI, rng, torDistSq(), VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by PCB_VIA_STITCH::bakedPoissonTile(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().