How to color particles based on their orientation?
Hey,
I am trying to color my particles (2-Sphere-Clumps) according to their orientation, to analyze how they arrange horrizontely. However, I cannot find this option within th analyst coloring section. Can I still do this somehow within the analyst section or do I need to use Python API?
Thanks and best regards
Leandro
Answers
-
Hi Leandro,
The EDEM Analyst doesn't allow you to colour particles by orientation unfortunately, you can export the orientation matrix (3x3 orthogonal matrix) and this data is also available via EDEMpy but not directly in the analyst.
It's worth noting that the orientation matrix is the matrix required to rotate the particle back to the position shown in the Creator, so this is always relative to the particle defined in the Creator.
RegardsStephen
1 -
Hi Stephen,
thank you very much, that helps me already! Which component of the orientation (XX, YY, ...) do I have to export to determine the angle according to the attached figure "Par_Orientation". Could you please explain this again? Also attached are screenshots of the creator view and the analyst view. I want to consider only the 2-dimensional case.
Thank you very much and kind regards
Leandro0 -
Mrage said:
Hi Stephen,
thank you very much, that helps me already! Which component of the orientation (XX, YY, ...) do I have to export to determine the angle according to the attached figure "Par_Orientation". Could you please explain this again? Also attached are screenshots of the creator view and the analyst view. I want to consider only the 2-dimensional case.
Thank you very much and kind regards
LeandroHi Leandro,
This is a useful link for visualising the matrix:
http://www.euclideanspace.com/maths/algebra/matrix/transforms/examples/index.htm
also
https://en.wikipedia.org/wiki/Rotation_matrix
EDEM is always going to have a 3D matrix but if working in 2D you can just take for example the YY orientation value which is cos(Theta).
RegardsStephen
1 -
Thanks Stephen,
just to make sure. If i get the following 3x3 orthogonal matrix,
XX YX ZX XY YY ZY XZ YZ ZZ how can i calculate the angle of the rotation around the y-axis (Theta_Y). I found the following solution:
Theta_Y = arctan2(XZ, (XX^2+XZ^2))
This works for simple examples I have been going throgh. But would this be the correct approch?
Thanks a lot!
Leandro
0 -
In case anybody is intrested.: I solved my case using scipy libary. Basically what i was looking for are "euler angles"! Here is an example:
from scipy.spatial.transform import Rotation as R
import numpy as np
r = R.from_quat([0, 0, np.sin(np.pi/4), np.cos(np.pi/4)])
r.as_matrix() array([[ 2.22044605e-16, -1.00000000e+00, 0.00000000e+00], [ 1.00000000e+00, 2.22044605e-16, 0.00000000e+00], [ 0.00000000e+00, 0.00000000e+00, 1.00000000e+00]])
r.as_euler('zyx', degrees=True) array([90., 0., 0.])
0