yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #19298
Re: [Question #679422]: how to set the orientation quaternion parameter so as to fully rotate a 3-d object
Question #679422 on Yade changed:
https://answers.launchpad.net/yade/+question/679422
Status: Open => Answered
Jérôme Duriez proposed the following answer:
Hi,
Let's start with an example:
O.bodies.append(box((1,1,1),(4,2,1))) # a box wider along x-axis than along y-axis
quat = Quaternion((0,0,1),pi/3.) # a rotation by pi/3 around z axis
O.bodies[0].state.ori = quat * O.bodies[0].state.ori # we rotate the box : look at the qt.View() (the graphical interface), the box is now wider along y-axis for instance
Then, your intention should be fulfilled by testing N cases with N
different "quat", that you have to choose to sufficiently cover all
possible orientations.
Note the above code can be condensed into
"O.bodies.append(box((1,1,1),(4,2,1),Quaternion((0,0,1),pi/3.)))"
Maybe it would help to precise what kind of YADE shape you'll use in
your YADE simulations of irregular particles.
--
You received this question notification because your team yade-users is
an answer contact for Yade.