How would one approach distributing points according to Poisson disc sampling?

First on a plane, then – next level – on a sphere.

PS: Are questions like this better asked in the Grasshopper forum?

How would one approach distributing points according to Poisson disc sampling?

First on a plane, then – next level – on a sphere.

PS: Are questions like this better asked in the Grasshopper forum?

It’s fine asking here.

You sure you want to implement this from scratch? The Populate components already do something quite similar (though they take the number-of-samples approach not the distance-between-samples approach of Poisson discs).

You almost certainly won’t be able to do this using regular components because of the large amount of looping/testing/inserting/removing/repeating this algorithm requires. It’ll need to be done through code I’m afraid.

Want no, but guess I’ve no choice.

Poisson disk distribution looks much nicer in my opinion. Also, I need to have a guaranteed minimum distance between points. The number of points would be fixed.

Those two are potentially mutually exclusive. You either get to space N points in such a way as to maximize the distances between them, or you get to space points at least x units apart. You cannot put 100 points in a 5x5 area and demand they don’t approach each other within 3 units.

But yeah, it sounds like some sort of C# or Python approach will be needed.

*Populate* maximizes the distance between points? I can be sure that no two points are too close together? I.e. “too close” depends on the number of points on the sphere.

I suppose you always analyse the result to see what the minimum distance for the set is.

Kind of a trail and error mamual itterative approach but possibly the most practical solution in the ahort term?

-Willem

Mwah… it tries to. You can use the Proximity3D component with a group size of 1 to find the nearest neighbour for all points in a set.

to be more specific, it will try N times to insert a point into the collection which is furthest away from all existing points. N is Max(50, Sqrt(M)) where M is the number of existing points.

1 Like

Thanks, this information is very helpful, saves a lot of time trying to guess what *Populate* does! *Are the algorithms employed by Grasshopper documented publicly somewhere?*

*Populate* could do the trick for now, as long as I check distances manually. May need to implement proper disc sampling eventually.

Nope. Maybe someday I’ll put them on GitHub though.

1 Like

One thing you can also try is over-populate, then reduce your point set using the Cull Duplicates component.

This wouldn’t allow me to specify the exact number of desired points.

True, but it would *ensure* none of your points are closer together than some fixed value.

Hi,

Here’s a Poisson disk sampling python component adapted for Grasshopper.

Source code is from here.

Poisson disk.gh (7.1 KB)

3 Likes