I have been working on a problem in the last few days. This is due to the creation of self-avoidance of random walks using a summary algorithm, and then to implement another code that puts spherical inclusions in a 3d lattice. I wrote two codes, one code generates the coordinates of the spheres using the Self algorithm, which avoids random walks, and then another code uses the coordinates generated by the first program, and then creates a 3d lattice in abaqus with spherical inclusions in it.
The result that will be generated after the codes are run: 
Now the enlarged part (marked with a red border) 
Problem: Generated spheres merge with each other. To avoid this, I ran out of ideas. I just need some direction or algorithm of work .
The code I wrote is as follows: code 1: generates the coordinates of the spheres
Another code is not required because the second code does not have geometric calculations. Any help or some direction on how to avoid a collision of spheres is very useful , thanks to everyone
ayaan source share