Change Mask and Color of a ClumpCloud
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. I don't get errors but changes aren't applied.
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=
c2=
c3=
c4=
sp=
sp.
sp.
O.bodies.
## SOLUTION 1
for b in O.bodies:
if b.isClump:
## SOLUTION 2
clumps=[]
for i in O.bodies:
if isinstance(
for i in clumps:
#########
Thanks for the help.
Regards,
Nicola
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Jan Stránský
- Solved:
- 2020-11-14
- Last query:
- 2020-11-14
- Last reply:
- 2020-11-13
|
#1 |
Hello,
masking / coloring clump itself basically has no effect (as you observed).
Try to apply the changes to its members [1].
cheers
Jan
[1] https:/
Nicola (nicolamarigo) said : | #2 |
Thank you Jan for the advice, however I've tried in some ways but I couldn't get the result.
Do you mind explicitly tell me what I need to code?
thanks,
Nicola
Nicola (nicolamarigo) said : | #3 |
Thanks Jan Stránský, that solved my question.
Jan Stránský (honzik) said : | #4 |
> I've tried in some ways but I couldn't get the result. Do you mind explicitly tell me what I need to code?
please, firstly do not mind explicitly tell us what code you have tried.
for future reference, a MWE:
###
sphs = [s1,s2,s3,s4,s5] = [sphere((x,0,0),.5) for x in range(5)]
clump1id,ids = O.bodies.
clump2id,ids = O.bodies.
clumpIds = (clump1id,clump2id)
colors = ((1,0,0),(0,0,1))
for color,i in zip(colors,
b = O.bodies[i]
ids = b.shape.
for j in ids:
O.bodies[j].sha
###
cheers
Jan