yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #18735
[Question #677828]: creat many polyhedra in a box
New question #677828 on Yade:
https://answers.launchpad.net/yade/+question/677828
hello
i want to creat many polyhedra in a box with same size and i tried the code below, to replace the sphere with polyhedra i created:
from yade import pack, qt
from yade import polyhedra_utils,pack
import random
#creat a polyhedra
polyMat = PolyhedraMat(density=3000,young=1e10,poisson=.5,frictionAngle=atan(0.8))
O.materials.append(polyMat)
t=polyhedra_utils.polyhedra(polyMat,(.6,.6,.6),v=[(0,0,0),(0,0,1),(0,1,0),(1,0,0)])
sp=pack.SpherePack()
list=sp.makeCloud((0,0,0),(2,2,2),rMean=.1,rRelFuzz=.6,periodic=True)
#replace the sphere with polyhedra
for s in list
O.bodies.append(t)
but it didn't work, the list turn out to be an int type, not a list, i would appreciate it if you can help me
--
You received this question notification because your team yade-users is
an answer contact for Yade.