How to generate PopGeo with minimum distance between points as input?

Hi, I have a surface on which I want to generate random points, and I’ve already done this being able to choose the number of points and the seed.
However I would like to do the same thing but instead of inputting the number of points, I would like to input the minimum distance between points, so that the quantity is generated accordingly.

It’s possible to do it?

Thanks!
Random points GH.gh (8.4 KB)
Rhino7 file.3dm (854.3 KB)

One (easy but a bit brute force) approach is to generate a much denser distribution than you need, then cull duplicates with the minimum distance as your tolerance and the ‘leave one’ option.

1 Like

Thank you, it works pretty well!
If anyone else has other solutions they are welcome.

1 Like

Related:

There’s various ways to do “quality” rnd pts … but get the simplest (as you asked). Using a Point3dList for prox checks (existed collection VS candidate pt).

BrepFace_EvenRandomPtsOnFace_V1.gh (20.1 KB)

Hello Peter,

sorry to bump this old topic, but I found your component very usefull. I’m just trying to figure out what the InnerAtt and OuterAtt inputs exactly control.

Thank you so much in advance!

btw, did you create this C# component?

2 nested loops (i.e. an outer and an inner using a classic while (true)) are on duty . Outer/Inner attempts vars control the exit conditions (hope dies last … but it does anyway).

yes

BTW: There’s other ways to do that (way faster).

Like creating a 2d grid, “distort” randomly pts (in ±x/y) and then map these pts to the underlying BrepFace Surface while keeping the ones contained in the Face.

Or … taking into account outer/inner BrepFaces Loops