enter image description hereI have asked this question in physics, math and chemistry (see my other sites). I have gotten some good advice but no definitive way to determine this. I am surprised there’s not already a program to determine questions like this. I thought I would reach out to you guys and see what you thought. Anyway if I knew anything about programming or the capabilities of engines like Blender I would imagine Each sphere having a repulsion to each other at close range but overall a strong attraction to each other so that overall an accumulated symmetrical and spherical shape forms. Then once the accumulation forms could there be a way to count the surface spheres and the interior spheres?

  • $\begingroup$ I thought blender was capable of creating 3-D animation?. Could you at least advise another program where I could ask this question? $\endgroup$ Oct 2, 2020 at 15:53
  • 2
    $\begingroup$ related youtube.com/watch?v=cmdOmOCfo90 $\endgroup$
    – lemon
    Oct 3, 2020 at 6:13
  • $\begingroup$ Probably if you can attach some reference image to illustarte that. If you are looking for automatic way you would have to ask for some script. $\endgroup$
    – vklidu
    Oct 3, 2020 at 14:18
  • $\begingroup$ Interesting Question. Can you elaborate how percise or scientific your interest is? $\endgroup$
    – A M
    Oct 10, 2020 at 20:01
  • $\begingroup$ I had some interesting results with rigidbodys and force fields but came to a point were i had doubts if the behavior is part of the phenomenon or lays in some specifics of how forcefields work in blender internaly. You should experiment with one strong negative forcefield and and weak forcefields with small max Distance parented to your rigidbody objekts. Instanciate those via Particle System as suggested and play with the forces. Those could be controlled via drivers or Animation Nodes. The phenomenon in my setup was a strong momentum that formed a kind of radial galaxy motion. $\endgroup$
    – A M
    Oct 10, 2020 at 20:04

2 Answers 2


Rigid Body

According to your image you can use Rigid Body physics.

  • Add sphere as Particle in Physics properties add Rigid Body > type Active > Collision Shape Sphere
  • Add sphere as Emitter, enable Particles System > source Volume > Render as Object
  • Go to modifier properties and press Convert
  • Add sphere as Collider object, go to physics properties and enable Rigid Body > Passive > shape Mesh

enter image description here

When you finish with a spheres shaped into a ball (state in blend file) you can select spheres on a surface with Dynamic Paint.

In general - go to last frame of animation. Select all "particle" spheres and Join ⎈ Ctrl+J them into a single object. Disable Rigid Body and enable Dynamic Paint > Canvas > from Paint to aWeight. At the bottom you can see a red field of vertex group, click plus icon so group is created. Go to Data properties and unsure this data block is unique for this object and is not used for other object. If next the data name is some number (like 2 or higher) click on that. Then select "collider" sphere, scale it down so half of particle spheres on surface is out of collider sphere. Again disable Rigid Body and enable Dynamic Paint but now as a Brush type. Play once animation. Like that collider "paints" on all vertecies of particles inside collider. Now with particle object selected go to modifiers and Apply Dynamic Paint here. Now when you switch to edit mode and from data properties click on Select under Vertex Group all vertices inside a collider sphere are selected now. Invert selection Crtl+I and select Linked cmd+L. Now all vertices of spheres on surface are selected. Separate by Selection P. Now you have spheres on surface as separate object. To count them, simply Separate by Loose Parts P. Now you can see (in 2.91 text next to Tool shelf, left top corner of 3D view editor) how many spheres takes to cover surface.

  • For 180 spheres - 121 out / 59 in
  • For 100 spheres - 74 out / 26 in


Since any work with forces is a bit random (also thanks to more ways how to store spheres in the same shape as seen in lemon's link) you can try to use Icosphere as a base mesh for quite even distribution of vertices on a surface.

enter image description here

Spheres are distributed via Instancing - parent small Sphere to Icosphere ⎇ Alt+P and enable in Properties Editor > Object > Instancing > Verts

  • $\begingroup$ Thanks for your input. Overall it’s important that the programming have the two competing forces. (1) Each individual sphere is repulsing against other spheres the closer they get to each other. (2) all the spheres are strongly attracted to each other, and accumulate as close to spherical shape as they can. The two forces working together will smooth out the symmetric shape of the accumulated spheres. If you experiment with an actual handful of small spheres you will see that the packing goes from tight to lose and back to tight again as you add one sphere at a time. $\endgroup$ Oct 3, 2020 at 14:53
  • 1
    $\begingroup$ OK this is great. I’ve got it working now. Thanks again for your help. $\endgroup$ Oct 11, 2020 at 8:05
  • $\begingroup$ Is there a way to make each sphere have a repulsion based on an inverse square? $\endgroup$ Oct 21, 2020 at 17:31

Your question is quite interesting. As while messing with it, i found a way to remove particle collision, so first of all thnx.
failed before after effect

coming to your question, your self proposed answer should work by using an emmiter particle system and 2 cahrge force fields + a drag force field:
enter image description here
But judging from your quistion you just want a sphere filled with spheres and seperate the outer layer?:

anyway here is both:
enter image description here


  • 1
    $\begingroup$ Thanks for looking at this. Yes I am looking for a program or formula that will tell me the number of surface spheres no matter what the total number N is. I’m by surface spheres I mean any spear on the surface or a sphere touching a sphere on the surface. With 100 total steers that’s not gonna leave very many on the interior. If you have a total of 200 spheres the interior will grow. As all the spheres accumulate the individual repulsion helps smooth out the overall symmetry of the accumulated sphere shape. Thanks $\endgroup$ Oct 3, 2020 at 1:33
  • $\begingroup$ in your second image (The animation) did you use the two forces I suggested? (1) Each sphere repulsing against all the others the closer they get. (2) All the spheres strongly attracted to each other, causing them to accumulate into a basic spherical shape. $\endgroup$ Oct 3, 2020 at 15:28
  • $\begingroup$ (1) each particle sphere has strong negative charge equal to its radius. and a small negative charge on a large distance. (2) in the middle there is a seperate sphere that has a positive charge. If you simpely want to know how many spheres are on the outside you can just use particle systm that emits from the volume with a hexagonal grid distribution $\endgroup$
    – Alex bries
    Oct 3, 2020 at 18:56
  • $\begingroup$ He, i just searched for it, and apperently you can only fit up to 12 spheres within another sphere where there is an optimal solution known. en.wikipedia.org/wiki/Sphere_packing_in_a_sphere, so your question might be harder than it seems $\endgroup$
    – Alex bries
    Oct 3, 2020 at 19:51
  • $\begingroup$ No I am not trying to pack spheres into another sphere. Just take any number of equally sized spheres and accumulate them into a reasonably sphere shape. $\endgroup$ Oct 3, 2020 at 20:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .