New question #689932 on Yade:
https://answers.launchpad.net/yade/+question/689932

Hi all,

I want to set the color for my sample so that I can see the deformation by the 
colorful band, as shown in this paper[1].

here is the code for coloring
#####################
for b in O.bodies:
        if isinstance(b.shape,Sphere):
                if 0  < b.state.pos[2] <= 0.02:
                        b.shape.color = (0.3,0,0.1)
                elif  0.02 < b.state.pos[2] <= 0.04:
                        b.shape.color = (0.3,0.1,1)
                elif  0.04 < b.state.pos[2] <= 0.06:
                        b.shape.color = (0.9,0.9,1)
###########################

 the reason why we can see the deformed colorful band after the sample was 
deformed is that the colored particles go to another place. 

for my code, I set the particle color by the vertical height. since the 
vertical height doesn't change, so the colorful band will still be horizontal 
or not??? 
For example, if one particle in one region is black. when it goes into another 
region, will it change into another kind of color? 
that is to say, if the color of one particle is set at the beginning, will it 
color changes when it goes into another region?

thanks in advance.
Yong


reference:
https://link.springer.com/article/10.1007/s11440-020-00951-7

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.

_______________________________________________
Mailing list: https://launchpad.net/~yade-users
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to