Circle packing based on amount of circles

Hi again!

I am trying to fill a 2D curve with equal sized circles based on a variable amount of circles.
So for a small amount the radius of the circles will be bigger and the circles will be optimally aranged within the curve.
The circles must stay within the curve and cannot intersect.

What is the best way to do this?

See this discussion:

Also this one which adjusts the radius automatically: