🌀 a simple Bridson's algorithm implementation
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test add tests for specifying rngs Sep 19, 2015
.gitignore
README.md
package.json
poisson-disc-sampler.js

README.md

poisson-disc-sampler

This code is based on Mike Bostock's implementation of Jason Davies' implementation of Bridson's algorithm.

// width, height, radius
var sampler = poissonDiscSampler(1000, 500, 10);

var sample;

while ((sample = sampler())) {
  console.log('x, y:', sample[0], sample[1]);
}

console.log('no space left for other points now, all done');