Posted this at math stack exchange as well, but alas no replies! So, I have been trying to find ways of distributing particles of spherical or other shape in 3D space, e.g. rectangular space. Random() and checking for overlaps will only get you up to a certain volume fraction percentage, then it is nearly impossible to find a non-overlapping position. I know there is a way to "drive" particles in empty spaces by some sort of Monte Carlo distribution or using some kind of potential difference? A dirty example in pseudo code or Matlab would be awesome!

  • 2
    $\begingroup$ Thank you so much, I did not even know it had a name! Poisson disk sampling! $\endgroup$ – nabber Nov 14 '17 at 21:38