coloring
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(
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:/
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Stránský
- Solved:
- Last query:
- Last reply: