Using Populate Geometry and setting a fix distance between points

Hi,

I want to populate points on a given surface and be able to define a distance between these points. I searched the forum but couldn’t find the right solution. I appreciate if you can help me with this.

Thanks,


06 MARCH 2019 - SAME DISTANCE POINTS.gh (9.5 KB)

Look into circle packing with kangaroo.

Here’s an example definition that will let you pack circles on a surface
https://github.com/Dan-Piker/Kangaroo-examples/blob/master/collisions_and_packing/CirclePackOnSurface.gh

I downloaded the file but unable to set a distance between distributed points
I guess there should be a way to set the point counts based on a distance of points.

CirclePackOnSurface1.gh (34.2 KB)

The minimum distance between the points will be double the radius, provided they do not overlap.
You can increase gradually the number of points until they fill the surface without overlapping.

There isn’t a way to know exactly in advance how many circles of a given radius will fit on a shape, but you could get a first approximation using the area and expected packing density.
If you didn’t want to adjust it manually this would also be a fairly simple thing to script to add circles until the surface was full.

Thanks for your reply. If I want to explain how the program works, these points represent a column in building and that’s why I need to set a number for the span. Let’s say 5 meters or 3 meters etc. The circle is not important as the shape of column will change to rectangle or triangle but for now is circle.
here is a sketch of what I mean.

can you draw that manually point by point and between every 2 points the same distance ?
i think you will get a triangular grid

trigrid.gh (19.1 KB)

because you’re setting radii instead - if you use the example by @DanielPiker, meaning that the diameter of the circle is the length of the line therefore the distance between points.

right, again because they’re simply helpers…
If you use Daniel’s example you can set it up with a second kangaroo solver to make the lines from proximity reach a length after the circle packing, though it isn’t the only way:

Bear in mind that if you change the length number (like at the end of the video) you’ll compromise your distances - keeping it @ 1 helps

dear @DanielPiker @anon39580149 @René_Corella @tigerpix @Michael_Pryor
I am working on a setup to fill either a rectangular or circular surface with a specified number of circles (e.g., 200), all having the same radius. The goal is to first distribute the circles randomly with the minimum possible distance between them. Then, I aim to redistribute the circles randomly with the maximum possible distance between them.
Any guidance on achieving this would be greatly appreciated!
test 1.gh (36.5 KB)

If what you want is to pack the circles in way that maximises the minimum distance between any pair of circles, then the definitions in this thread do what you need

Here’s one of those updated to use the new script component:
Circles_in_a_square_adaptive.gh (95.0 KB)

Dear @DanielPiker,

Your work is always impressive! Thank you so much for supporting the Grasshopper community.

I’ve reviewed the file you provided, but it doesn’t fully achieve what I have in mind. I may not have explained my goal clearly at first, so I’ll try to clarify it here.

I would like to set a boundary domain (either a circle or a rectangle) and fill it with a fixed number of circles—let’s say 200. All circles should have the same radius. The task involves two distinct configurations:

  1. Minimum Distance Configuration: In this setup, the circles should be randomly distributed within the boundary, with the goal of minimizing the distance between them. This configuration would lead the circles to cluster toward the center of the boundary.
  2. Maximum Distance Configuration: In this setup, the circles should also be randomly distributed, but with the goal of maximizing the distance between them. As a result, the circles would spread out across the entire boundary, moving as far apart as possible.

I’m wondering if this can be achieved using Grasshopper with Kangaroo, or perhaps through a C++ script or Python. The idea is for Kangaroo to iteratively calculate the distances between the circle centers and adjust their positions until reaching the optimal arrangement, either minimizing or maximizing the distances as needed.

Thank you again for your assistance!

What’s still not clear to me is what you mean by maximise ‘the’ distance between them.
For 200 points there are 39800 distances.

You can maximise the smallest distance (this is the classic form of circle packing optimisation - equivalent to finding the arrangement of non overlapping equal circles with the largest possible radius).

You could also maximise the total, or the total of the squared distances, or total of just the distances between points and their Delaunay neighbours…

@DanielPiker Yes, that’s what I meant by maximizing or minimizing the distance—it’s the distance between any point and its Delaunay neighbors

@René_Corella IS THERE ANY GHF FOR THIS!

Dear @René_Corella, would you be able to share the Grasshopper file featured in your video? I’d greatly appreciate it.

Hello @Mr.Ralf,

Pardon this late reply.
I do not find that file - I must have done stuff on the original file posted then deleted it. I’m a bit perplexed, I must have skipped sharing it by accident.

I wonder if a combination of ‘attraction/repulsion’ of points combined with collision would be a way? I remember seeing some related kangaroo examples. Anyway, I can look into it later today or tomorrow (apologies again). Not sure I have an answer.

Best,
RC

dear @René_Corella
Thank you for your response. I would greatly appreciate any help or suggestions you could offer.