Skip to content

Rotations from FreeCAD to GDML file #112

Answered by mhindi2
IanLuebbers-UIUC asked this question in Q&A
Discussion options

You must be logged in to vote

@IanLuebbers-UIUC , here is the code we use (and which I wrote). FreeCAD had its own conversion from quaternions to rotations about x, y, z, but I found that it did not work all the time. I believe my code works in all cases, but I obviously have not tested the universe of possibilities! The rotations are about the fixed X, Y, Z axes, not body axes. I am sorry, but I forget now whether in geant the translation happens before or after the rotation. Easisest thing to do is to do some experiments and check.

def quaternion2XYZ(rot):
    """
    convert a quaternion rotation to a sequence of rotations around X, Y, Z
    Here is my (Munther Hindi) derivation:
    First, the rotation matrices fo…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@IanLuebbers-UIUC
Comment options

Comment options

You must be logged in to vote
1 reply
@IanLuebbers-UIUC
Comment options

Comment options

You must be logged in to vote
3 replies
@IanLuebbers-UIUC
Comment options

@mhindi2
Comment options

mhindi2 Jun 9, 2023
Collaborator

@mhindi2
Comment options

mhindi2 Jun 9, 2023
Collaborator

Answer selected by IanLuebbers-UIUC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants