Distributing Spheres on a Surface with Offset and Collision Detection

You can look for discussions of both sphere packing and circle packing, since to generate a circle packing on a curved surface, we typically first generate a sphere packing with the sphere centers on the surface, then generate circles at these points in the tangent plane to the surface.