Grasshopper

algorithmic modeling for Rhino

Hello!!! I need to fill a closed planar curve with circles, but i need the distance of 2.5mm between circles, only inside the closed planar curve, can anybody help me?

Views: 3650

Replies to This Discussion

Seach this forum for circle packing. If you find a packing with touching circles, you can shrink the cicles by half your required distance.

If you need the circels to touch the original palanr curve, you just need to offset this by half your distance and pack this larger outline.

Thanks...

Can the circles vary in radius ?

Is 2.5mm a minimum or a target average distance ?

Do they need to form a compact packing (ie connecting centres of tangent circles gives a triangulation) ?

2.5mm is the distance between them, the diameters can vary, but would like to point 3 or 4 values ​​only. Thanks for the attention!!!

Hi,

I don't know if you just need custom gh components, but if scripted solutions is good, then this should do the job. 

David Rutten is to cite for this vb script.

I just updated it, and added the desired distance routine.

Best,

M.

Attachments:

This is awesome, thanks Marios, but can you explain briefly what happens in this script?

Thanks

Hi Omar,

Please refer to this Discussion in order to get a better understanding. It is a quite simple, not dynamic (kind of limited) circle packing algorithm, trial and error based that runs for 1000 iterations.

Best,

M.

Wooowwwwwwwwwwww!!!! Exactly!!! The VB Script is awesome... but, it's possible to do this with only grasshopper definition? It's exactly that i need!!! Many Thanks!!! I have only one question: Some circles are out of the closed planar curve.... It's possible to do only inside the closed planar curve?

It's not possible with only native gh. You'll have to use some kind of add-on like Hoopsnake or Daniel Piker's Kangaroo (thus the many questions above). kangaroo's physics based nature can provide a much better result in terms of packing, I am certain that there should be a definition available around at the forum.

ps. I can't replicate having circles outside of the referenced curve. can you post a screenshot?

M.

Sorry my friend... The curve that i used, was not 2D... the curve was 3D, when i project to a plane, and performed the definition again, the result is fine.... sorry for the question...

Many thanks for your help!!!

Hi Marios,

I am trying to modify your script to give fixed circle diameters of 0.25mm at distances in the range 0.35 to 0.45 mm apart. I need to try to find the maximum number of circles that could fit a given boundary.

Is this possible and how?

Thanks for any help.

Bill 

hello Bill,

Unfortunately this is not possible with this script. As I mention above, this is a brute implementation of a circle packing routine. To get fittest results, hence the max of circles within a certain boundary you will have to recalculate each circle's position for every iteration.

this calls for a dynamic equilibrium approach (suitable for kangaroo if you don't want to code),

Luckily this was on top of the discussions list right now so take a look a this spring system method. I think you can alter it to fit your interests.

Altering this code won't have any particular effect as you have to tackle this issue with a different process.

best,

M

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service