yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #07335
Re: [Question #226352]: 2D biaxial compression task completion
Question #226352 on Yade changed:
https://answers.launchpad.net/yade/+question/226352
Status: Open => Answered
Jan Stránský proposed the following answer:
Hello,
(1) you could solve it yourself :-)
for b in O.bodies:
> if isinstance(b.shape,Sphere):
> pos = b.state.pos
> if pos[0] <3.5 and pos[1] < 3.5: b.shape.color = (1,0,0) #
> area 1
> elif pos[0] >= 3.5 and pos[1] <3.5: b.shape.color = (0,1,0) #
> area 2
> elif pos[0] >= 3.5 and pos[1] >= 3.5: b.shape.color = (0,0,1) #
> area 3
> else: b.shape.pos = (1,1,0) #
> area 4
>
b.shape.pos = (1,1,0) does not assign color ;-) sorry if I wrote it in one
of previous emails..
(2) see https://answers.launchpad.net/yade/+question/219884
cheers
Jan
--
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.