-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow non-uniform point densities #5
Comments
How about accepting a closure of the form Fn(V) -> F allowing for a different minimum radius at each position in space (V and F according to the template parameters you usually use). Of course, this is not perfect, the sample position for the function will depend only on the existing Poisson sample, but I don't know how to sample between a point and the next point, when it is the next point we want to generate… I don't know about Ebeida, but with Bridson this will be very simple to implement. |
There's also the possibility for anisotropy. But it's not so easy to make an interface for that and I don't know if anyone will ever use this… |
Yeah that was what I thought first too, but I was unsure how to actually make it work well. If there is sudden changes on the minimum radii the result might end up completely different what the closure tells the algorithm to do. Here is a paper the talks about poisson-disk distributions with variable radii. |
According to that paper, what I proposed is called "Prior" method and works okay. I think the other options from the paper may not be easy to implement with Bridson. If somebody wants to implement another method (Current, Bigger or Smaller), we can add another enum option. |
Oh and if there are sudden changes in the function, there's really not much we can do about it. Garbage in -> garbage out. |
I tried to implement this by making radius in Taking it as closure means that So we can either wait for Also taking just closure isn't enough to Bridsons algorithm allow varying radii: Because it uses grid to speed up spatial searches, maximum radius used is also needed to calculate right cell size (And grid needs to be changed so it can contain multiple samples. Propably small size optimized vector?). (I also would really like to enforce that the closure returns valid values for radii, but thats propably pipe dream. Oh well) |
Would it help to box the closure? If so, would that be so bad? |
Yeah, that would be possibility... I wasn't considering it, because the closure is so small for the uniform case: just returning value and having that impose dynamic dispatch seem silly. The times you need to call the closure is exactly the amount of samples (in the prior method) so O(n) which doesn't change algorithms complexity. If we also allowed other variations, it would be more important (still O(n), but would be called once for each try). |
Have some way to specify somekind of non-uniformity for point densities.
The text was updated successfully, but these errors were encountered: