Generators of Poisson Disc point distributions.
- 2D Poisson Disc point distributions generated using Bridson's Algorithm
See these two pages for easy to digest explainations of the algorithm:
-
Add the following to your project's pubspec.yaml and run
pub get
:dependencies: poisson_disc: '^2.0.0'
-
Add the correct import for your project:
import 'package:poisson_disc/bridson2.dart' as bridson2;
-
Invoke:
for (Vector2 v in bridson2.generate(wdth: 256, hght: 128, toroidal: true)) { // Do something with points here }
-
./example/bridson2
Demonstrates toroidal and non-toroidal Poisson Disc distributions an compares probability distributions of points for each.