yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #28549
[Question #703662]: How to count the number of spheres and how to change the color of the facet
New question #703662 on Yade:
https://answers.launchpad.net/yade/+question/703662
hello all
How does the following code count the number of spheres and how to change the color of the facet
##########################
from yade import pack
import gts, os.path, locale
surf=gts.read(open('2222.gts'))
surf1=gts.read(open('1111.gts'))
if surf.is_closed():
pred=pack.inGtsSurface(surf)
aabb=pred.aabb()
dim0=aabb[1][0]-aabb[0][0]; radius=dim0/100. # get some characteristic dimension, use it for radius
O.bodies.append(pack.regularHexa(pred,radius=radius,gap=radius/4.))
for b in O.bodies:
b.shape.color = (0,191/255.,1)
#surf.translate(0, 0, -(aabb[1][2] - aabb[0][2])) # move surface down so that facets are underneath the falling spheres
O.bodies.append(pack.gtsSurface2Facets(surf1,wire=True))
#####################################
look forward to your reply
Thanks
--
You received this question notification because your team yade-users is
an answer contact for Yade.