I found this photo in some topic about circle packing. I wonder how the solver algorithm works in this case. This is extract from CirclePackOnSurface.gh by Dan-Piker found on github.
Here there is a repulsion between the centres of overlapping circles, and also a constraint keeping them on the target surface. It solves this iteratively to minimize the energy and find an equilibrium.
Thank you for your answer.
How does constraint work that circles are partially out of the target surface? Is this constraint is applied only for centres?
Yes, in that definition only the centres are kept on the target surface.
If you want to keep the whole circles on the surface, one way is to inset boundaries of the target surface by the radius like this:
diskpack_offset.gh (20.1 KB)