One size packing of spheres

Asked by Alexander Eulitz [Eugen]

Does anyone know of a script which creates a packing of spheres with the same radius each? I'm sure there is such a script around. But I dont find it. Maybe someone can help me.
Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Alexander Eulitz [Eugen]
Solved:
Last query:
Last reply:
Revision history for this message
Christian Jakob (jakob-ifgt) said :
#1

Hi,

Try one these:

examples/funnel.py
examples/mill.py
examples/triax-tutorial/script-session1

you may need to set relFuzz = 0 in makeCloud to get equal-sized distribution.

btw, you can easily search your examples folder with grep:

grep -r -n makeCloud /path/to/YADE/examples/

-> gives all scripts, that contain "makeCloud" command

Revision history for this message
Alexander Eulitz [Eugen] (kubeu) said :
#2

Hi,
thanks for this!
setting rRelFuz=0 with makeCloud works fine.
Best example script is:
examples/packs.packs.py

There you can find various ways of adding e.g. packs.
I use this one:
    kw={'material':0}
    O.bodies.append(pack.regularHexa (pack.inCylinder((+1,1,+2.5),(0,3,+5),1),radius=.1,gap=0.1,color=(0,1,1),**kw))
This gives you a cylinder filled with equally sized spheres (which are not clumped together. If you want a clumped packing use "appendClumped" instead).
But be careful with setting "gap". If you set it too low, your packing will explode

Maybe this helps somebody else