Circle Packing in Enclosed Boundary - Unwanted Overlap

Hi @texasvodkas

The boundary curve input for the compact circle packing goal keeps each of the outer circles of the packing touching this curve at a single point.


If you want some circles to touch the boundary at 2 points (so they nestle into the sharp corners), this needs another goal.
Here’s one I made which keeps a point at equal distance from a pair of curves. So if you identify the corners and the parts of the boundary either side, it can keep a circle touching the boundary on both.

circpack_corner.gh (14.9 KB)

Note though that once we pin some circles in the corners like this, no perfect compact circle packing with given connectivity generally exists. For that the points need to have the freedom to slide around the boundary.
Also - I realised that when using the boundary curve input for the circle packing goal, the orientation of the curve matters (as it uses the relation between the curve tangent and the mesh normal to keep the circles on the inside of the curve). For a future release I’ll try and make it detect the correct curve orientation automatically, but currently you might sometimes have to flip the curve.

5 Likes