Circle Packing: Some Overlap - Others Gap

Is there a fix as to why, on the same surface, my circles appear to be overlapping dramatically in some areas yet leaving unfilled gaps in others? I have toyed with strength settings of both the OnMesh and SphereCollide Components of K2 using an adapted version of Daniel Piker’s sphere collide example script, with only marginally improved results. Changing the radius to try and fill the gaps causes more unwanted overlap and entropy than gaps that it fills. It also appears that the circles like to gather at the edges of my surface. Is there something about the topology of my surface that makes it difficult for the circle packing script to solve appropriately?

circle pack overlap-gap.gh (23.1 KB)

I suspect there are may be two reasons:
a) for the packing method you’re using, you may need more circles to get better interaction:


and b), the surface has a wide range of curvature, making it harder for the larger circles to find a comfy spot. Perhaps you could try the ImgCircles goal instead, to fit a nicer gradient between areas of wider and tighter curvature. This component also allows you to set boundary curves:

quick sample:
Circle Pack_Srf Curvature.gh (19.8 KB)

2 Likes