MoI discussion forum
MoI discussion forum

Full Version: FILL AREA WITH OBJECTS EQUALLY SPACED

From: AlexPolo
8 Feb 2021   [#1]
Hi Trying to work out best way to fill an closed area with a set number of other closed curves and have them equally spaced with each other.

Image showing problem 80 circles to be distributed equally within the red bounding semi circle. Any vague scripts anyone is aware of would be helpful.



thanks Alex.

Attachments:
SPACING.3dm

Image Attachments:
FILL SPACING DISTRIBUTE.JPG 


From: bemfarmer
8 Feb 2021   [#2] In reply to [#1]
Hi Alex,

See December 2020 posts of Equidistant array on surface / automatic Pave

The remarkable D3-force program can be used to do repulsion of circles. It is actually a charting/node graph program, but they also use physics of repulsion and attraction. Their boundaries are a box, not a semicircle.
Google "D3-force observable". They can also repel from the exterior of a very large circle, using its center point.

Maybe next year I'll have time to pursue this...Repulsion could be from many small fixed boundary circles, on the desired curved boundaries.

Coding Train has a few videos of doing repulsion and attraction with Javascript/ processing.
https://www.youtube.com/watch?v=OAcXnzRNiCY

But neither of the above sources has a ready to use program for your project.

- Brian

A hexagonal layout of uniform circles could be expected.
Maybe try making a hexagonal layout of say 100 circles in a rectangle encompasing your D shape.
Place the layout over your D, and deduct circles in the exterior and intersecting the boundary, aiming for 80.
If the interior circle count is below 80, scale down the array a bit.
If the interior circle count is above 80, scale up the array a bit.

Or vice-versa,
Create a hex layout of circles, place the D over them, count circles, and scale the D shape up or down appropriately, to get 80 interior circles.
Then scale Both the new D and the 80 circles, so that the new D is the same size as your D.

Left out a step to make the diameter of the circles the same as at the start...

http://www.packomania.com/
From: Michael Gibson
8 Feb 2021   [#3] In reply to [#1]
Hi Alex, you might find some ideas on this thread:
http://moi3d.com/forum/index.php?webtag=MOI&msg=10052.1

Probably the best bet is using a Grasshopper component for Rhino:
https://www.grasshopper3d.com/video/circle-packing

- Michael
From: bemfarmer
8 Feb 2021   [#4]
Re-arranging to hex grid. Drawing a few hexagons helps with manipulation.
Scale circles. Move to fit+/-.
ScaleIndividual Script to shrink the circles back to size.
CenterPoint script is helpful.
Better, but not done.
Could repeat...
- Brian
Edit, Deleted atachment.
Google search of "Locomotive steam boiler", images, show hex "D" layout.
From: AlexPolo
8 Feb 2021   [#5]
Hi Brian and Michael,

Thanks for the input and advice I am modelling a flange for a heat exchange unit and came up with this as a manual solution.
A series of semi circle arcs which I used unwrap curve. Worked out the length of each curve and used array over curve once I knew how many per curve. Gave a good enough result not perfect but should disperse heat even enough. Will explore Circle Packing in Rhino but was on tight time frame on this one so sometimes time spent learning new tricks versus getting the knuckles dirty and knocking it out.




Image Attachments:
MANUAL SOLUTION.JPG 


From: bemfarmer
8 Feb 2021   [#6] In reply to [#5]
Hi Alex.
Your solution looks excellent.
Maybe a fibonanacci layout would work?

-Brian
From: Frenchy Pilou (PILOU)
9 Feb 2021   [#7]
Scatter tools, dispersion ...? by Max Smirnov
http://moi3d.com/forum/index.php?webtag=MOI&msg=6486.1
From: Barry-H
17 Feb 2021   [#8] In reply to [#1]
Hi Alex,
I have created a basic spacing nod file on the Nodeeditor that can set minimum gaps.
The dimensions that can be adjusted are shown on the photo.
The number of arcs are 12 but if you need more let me know.
Anyway hope this helps.
Barry

Edit:
Nodeeditor added.

Attachments:
ABH Packing 160221X.zip

Image Attachments:
Screenshot (593).png 


From: AlexPolo
18 Feb 2021   [#9]
Hi Barry,
Many thanks for taking time in putting this together looks great - I have a large collection of your scripts and your input is gold.
I am having trouble running the node am I missing some components?
Alex.


Image Attachments:
NOD EDITOR.JPG 


From: Barry-H
18 Feb 2021   [#10] In reply to [#9]
Hi Alex,
I have updated my previous post adding the Nodeeditor I used plus a modification
to the nod file collating the outputs into one so you can see the total number of circles.
Cheers
Barry
From: AlexPolo
19 Feb 2021   [#11]
Hi Barry,

Thanks again for your input looks great and working for me now - Will add to my collection of BARRY SCRIPTS your insight is well appreciated - my NODE skills are basic and looking at your MACRO section makes my head spin :) your contributions to the MOI community highlight how such an agile tool can be used to solve high end problems.

Keep powering on
Alex.