cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

J-Link Export Coordinate system rotations as axis angle rotations

amedina
1-Newbie

J-Link Export Coordinate system rotations as axis angle rotations

I'm trying to export a coordinate system from pro/e as a location (2,3,4)
and its axis rotations (90,34,15).

I kind of got something going. It looks like both the XAxis, Y&Z and the
matrix for a transform will give a rotation transform.

The thing is that, its not the same as the axis rotation angles shown in
pro/e when you go to the rotate coordinate datum section.

basically the default system is:
[100]
[010]
[001]

and if you rotate it say 90 degrees on the Z axis you get:
[010]
[-100]
[001]

So the positive X axis is where the positive Y axis used to be
I expect to use the cross product and the dot product in a atan2 function
to give me a signed angle, but look:
X and Y will be plus or minus 90 degrees while Z shows no rotation at all.
[001]->[001]

So eventually I came to the rodrigues formula for rotations :

shown in the pro/e coordinate system window.

If you got an idea of what i'm talking about, I could use some help.

Rotations in matrix algebra are so neat and interesting for sure.

This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
3 REPLIES 3
FV
17-Peridot
17-Peridot
(To:amedina)

Hi all,


Alfonso, please take a look at 'Matrix Decomposition' chapter of 'Geometric Tools for Computer Graphics' book (http://www.amazon.com/Geometric-Computer-Graphics-Morgan-Kaufmann/dp/1558605940). Pro/E uses RzRxRy factor.


HIH.


Feliks.

In Reply to alfonso medina:


I'm trying to export a coordinate system from pro/e as a location (2,3,4)
and its axis rotations (90,34,15).

I kind of got something going. It looks like both the XAxis, Y&Z and the
matrix for a transform will give a rotation transform.

The thing is that, its not the same as the axis rotation angles shown in
pro/e when you go to the rotate coordinate datum section.

basically the default system is:
[100]
[010]
[001]

and if you rotate it say 90 degrees on the Z axis you get:
[010]
[-100]
[001]

So the positive X axis is where the positive Y axis used to be
I expect to use the cross product and the dot product in a atan2 function
to give me a signed angle, but look:
X and Y will be plus or minus 90 degrees while Z shows no rotation at all.
[001]->[001]

So eventually I came to the rodrigues formula for rotations :
http://en.wikipedia.org/wiki/Rodrigues'_rotation_formula

and I'm trying to figure out how I can get alpha, beta and gama from the
matrix. I "think " this is what I'm after. I think these are the angles
shown in the pro/e coordinate system window.

If you got an idea of what i'm talking about, I could use some help.

Rotations in matrix algebra are so neat and interesting for sure.

I think that the reason you are seeing values that don't match what you see in ProE is because of what object owns the csys. Is the csys created in the assembly or is it created in the part. If it's created in the part then you might need to translate it's matrix to the assembly csys. Look in the API Wizard for Coordinate System Transformations.

Patrick Williams | Engineering Systems | c: 616.947.2110
[cid:image001.jpg@01CE0F4C.4A893440]

I have yet to try this, but it looks like it will work:

cosine/sine etc rotation matrix (XYZ for pro/e as stated by williams, this
one is for ZXY, just coz that's where the page was flipped in the book)
cycz-sxsysz -cxsz czsy + cysxsz
czsxsy + cysz cxcz -cyczsx + sysz
-cxsy sx cxcy


simplified matrix:
r00 r01 r02
r10 r11 r12
r20 r21 r22


To find the axis rotations:

if (r21 < +1)
{
if (r21 > -1)
{
thetaX = asin(r21);
thetaZ = atan2(-r01,r11);
thetaY = atan2(-r20,r22);
}
else // r21 = -1
{
// Not a unique solution: thetaY - thetaZ = atan2(r02,r00)
thetaX = -pi/2;
thetaZ = -atan2(r02,r00);
thetaY = 0;
}
}
else // r21 = +1
{
// Not a unique solution: thetaY + thetaZ = atan2(r02,r00)
thetaX = +pi/2;
thetaZ = atan2(r02,r00);
thetaY = 0;
}


Top Tags