yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #24362
[Question #693993]: Change Mask and Color of a ClumpCloud
New question #693993 on Yade:
https://answers.launchpad.net/yade/+question/693993
Dear all,
I need to change the mask of a clump cloud to make it invisible respect other elements. I tried two (SOLUTION 1 and 2) ways but didn't work.
Here's the cloud generation and the trials.
I don't know if could help, but this section is inside a function, user called ( def Fill() ).
### CODE
# r1,r2,r3 are only float numbers.
c1=SpherePack([((0,0,0),.5*r1),((0.5*r1,0,0),.7*r1),((r1,0,0),.5*r1)])
c2=SpherePack([((0,0,0),.3*r3),((.2*r3,0,0),.3*r3),((0,0,.2*r3),.3*r3),((.2*r3,0,.2*r3),.3*r3)])
c3=SpherePack([((0,0,0),.5*r2),((.3*r3,0,0),.5*r2),((0,0,.3*r3),.5*r2),])
c4=SpherePack([((0,0,0),.25*r3)])
sp=pack.SpherePack()
sp.makeClumpCloud((.05,.8,.05),(1.95,4.5,.95),[c1,c2,c3,c4],periodic=False)
sp.toSimulation()
O.bodies.updateClumpProperties(discretization=20)
## SOLUTION 1
for b in O.bodies:
if b.isClump:
b.mask=2
b.shape.color=[0,1,0] # just to visualize
## SOLUTION 2
clumps=[]
for i in O.bodies:
if isinstance(i.shape,Clump):
clumps+=[i.id]
for i in clumps:
O.bodies[i].mask=2
O.bodies[i].shape.color=[0,1,0] # just to visualize
#########
Thanks for the help.
Regards,
Nicola
--
You received this question notification because your team yade-users is
an answer contact for Yade.