question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cannot distribute in 0-1 range? (contrary to fast implementation)

See original GitHub issue

Hi, thanks for this really nice lib!

I just tested both this implementation and the fast-2d-poisson-disk-sampling implementation.

With the fast implementation, I can generate normalized positions values in the 0-1 range, but cannot with this implementation: using fill() only returns 1 point, trying to use next() returns null

code used:

var pds = new PoissonDiskSampling({
    shape: [1, 1],
    minDistance: 0.05,
    tries: 10,
});

I want to use a distanceFunction, so my workaround will be to use shape: [10, 10] and divide everything back, but it’s not elegant and might lead to errors.

Do you see a reason why it fails?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
juliendorracommented, Feb 25, 2022

Hi! Thanks a lot for the super quick reply 😃🙏👍🚀

I’m using the min.js from the CDN URL on the readme (wanted to test it quick! 😅😄)

0reactions
kchapeliercommented, Feb 26, 2022

The CDN issue is now resolved.

The updated URL is https://cdn.jsdelivr.net/gh/kchapelier/poisson-disk-sampling@2.2.3/build/poisson-disk-sampling.min.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fastest implementation of sine, cosine and square root in C++ ...
Here's the guaranteed fastest possible sine function in C++: ... in the approximation is equally distributed across the range of outputs.
Read more >
ranger: A Fast Implementation of Random Forests
Ranger is a fast implementation of random forests (Breiman 2001) or recursive partitioning, par- ticularly suited for high dimensional data.
Read more >
Network Traffic Distribution – Elastic Load Balancing FAQs
Elastic Load Balancing automatically distributes incoming application traffic across multiple targets in one or more Availability Zones (AZs).
Read more >
Designing the Distribution Network in a Supply Chain
Based on the choices for the two decisions, there are six distinct distribution network designs that are classified as follows: 1. Manufacturer storage...
Read more >
Web Content Accessibility Guidelines (WCAG) 2.1 - W3C
The publication of WCAG 2.1 does not deprecate or supersede WCAG 2.0. ... 1.4.1 Use of Color; 1.4.2 Audio Control; 1.4.3 Contrast (Minimum) ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found