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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.0
    41
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.0
    41
  • 1.0.0
    0

Package Sidebar

Install

npm i poisson-disc-sampler

Weekly Downloads

25

Version

1.1.0

License

MIT

Last publish

Collaborators

  • beaugunderson