how to set the orientation quaternion parameter so as to fully rotate a 3-d object

Asked by kaiset

Hey I am doing a research to check the rebound response of an irregular particle against the ground.
As my particle is irregular, the orientation of the particle could have an impact on the rebound response, after all, different contact point could make a big difference.
I want to cover all orientations.
Please help me with how to set the orientation quaternion so as to realize my intention.

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

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.

Can you help with this problem?

Provide an answer of your own, or ask kaiset for more information if necessary.

To post a message you must log in.