# filling grid with circle shapes?

## Recommended Posts

Hi, I am trying to fill up a grid with circles with random radius like below rough drawing but the actual circle counts has to be about 300,000.

What would be ideal way to do this in houdini?

I've tried to use bullet to throw bunch of sphere primitives and let me fille a box and flat it to get the shape but if there is more procedural way to do this, please let me know!

##### Share on other sites

Hi, I am trying to fill up a grid with circles with random radius like below rough drawing but the actual circle counts has to be about 300,000.

What would be ideal way to do this in houdini?

I've tried to use bullet to throw bunch of sphere primitives and let me fille a box and flat it to get the shape but if there is more procedural way to do this, please let me know!

##### Share on other sites

forums.odforce.net/index.php?/topic/12892-square-packing/

forums.odforce.net/index.php?/topic/6494-poor-mans-circle-packing/

might be of help?

##### Share on other sites

forums.odforce.net/index.php?/topic/12892-square-packing/

forums.odforce.net/index.php?/topic/6494-poor-mans-circle-packing/

might be of help?

Thank you eetu.

##### Share on other sites

Thank you eetu.

I wrote a python circle packing otl a while ago, my computers at the genius bar right now but I'll try to post it tomorrow

##### Share on other sites

http://mrkunz.com/circle-packing-theorem/

If your still looking for a solution, I just posted some experiments I've been doing. Using the pcfarthest vop might be the easiest way to go if you want to place a really large # of points.

##### Share on other sites

I was thinking that you might get a "better" looking distribution of points if you ran an iteration or two of Lloyd's relaxation on it before calculating the circle radii.

LloydsRelax.hipnc

• 1

##### Share on other sites

I was thinking that you might get a "better" looking distribution of points if you ran an iteration or two of Lloyd's relaxation on it before calculating the circle radii.

Cool! That's a very interesting technique - thanks for sharing it!

I was also considering using noise to color the geo before scattering points or applying a particle system with basic magnetic properties to get some intersting arrangements.

What do you think would be the best way to get all the circles to be mutually tangent? I was thinking of using a solver sop with a foreach loop and slowly growing each circle, but I'm not sure if there's a less "brute force" method?

Edited by jkunz07

##### Share on other sites

You can try using closest the neighbour point after the Triangulate2D as your radius.

##### Share on other sites

You can try using closest the neighbour point after the Triangulate2D as your radius.

Er, scratch that, it doesn't work that well. Although you could try using it as your initial guess before incrementally expanding your radii.

##### Share on other sites

I was playing with the idea of circle packing the other day, came up with this.

It runs off a more iterative aggregation model, checking random points perpendicular to existing ones and seeing if a randomly sized circle can be created.

Could probably be a lot more efficient though.

circle_packing.hipnc

## Create an account

Register a new account