Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

poisson-disc-sampler

1.1.0 • Public • Published

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');

install

npm i poisson-disc-sampler

Downloadsweekly downloads

16

version

1.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability