yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #02466
Re: small question (SpherePack)
Hi Jan :-)
I think this question is appropriate for the mailing list. After
generating the packing with
> from yade import pack
> sp=pack.randomPeriPack(radius=1.,rRelFuzz=0.,initSize=Vector3().ONE*10.)
>
you can iterate over sp to get the data, like this:
for s in sp: print s[0], s[1] # s is (center,radius)
or
for center,radius in sp: print center,radius
You can also access each sphere by its index, so
for i in range(0,len(sp)): print sp[i][0], sp[i][1]
will also do, but it looks like writing c in python (i.e. ugly).
I will add this to SpherePack's docs
https://yade-dem.org/sphinx/yade.pack.html#yade._packSpheres.SpherePack
(later), thanks for a good question.
Cheers, Vaclav
PS. As member of yade-users, you should receive this mail from the list. I
put you in cc to make sure this time, though. If you reply to this message,
make sure you send your response to yade-users@xxxxxxxxxxxxxxxxxxx rather
than to me personally.
Follow ups