Other form of GlobalPlacement Rotation

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
manos
Posts: 432
Joined: Thu Nov 12, 2020 10:48 am
Location: Greece

Other form of GlobalPlacement Rotation

Post by manos »

Hi
The rotation of GlobalPlacement can be presented in many forms: The getGlobalPlacement uses the form :Euler angles and Angle. But another form would be very usefull too, like : Vector (rotation axis) and float (rotation angle) . Is there any way to get Global Placement Rotation in this or another way ?
Any help is welcomed.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Other form of GlobalPlacement Rotation

Post by openBrain »

:? '.Angle' and '.Axis' are exactly this.
'.Angle' isn't linked to Euler angles, which are standalone.
manos
Posts: 432
Joined: Thu Nov 12, 2020 10:48 am
Location: Greece

Re: Other form of GlobalPlacement Rotation

Post by manos »

openBrain wrote: Fri Sep 23, 2022 6:37 pm :? '.Angle' and '.Axis' are exactly this.
'.Angle' isn't linked to Euler angles, which are standalone.
Unfortunately both obj.Placement.Rotation.Axis and obj.Placement.Rotation.Angle refer to the Local Coordinate System not to the Global.

Thanks anyway.
openBrain
Veteran
Posts: 9034
Joined: Fri Nov 09, 2018 5:38 pm
Contact:

Re: Other form of GlobalPlacement Rotation

Post by openBrain »

Code: Select all

obj.getGlobalPlacement().Rotation.Axis
obj.getGlobalPlacement().Rotation.Angle
A placement is a placement, whatever the way you got it.
manos
Posts: 432
Joined: Thu Nov 12, 2020 10:48 am
Location: Greece

Re: Other form of GlobalPlacement Rotation

Post by manos »

openBrain wrote: Fri Sep 23, 2022 7:16 pm

Code: Select all

obj.getGlobalPlacement().Rotation.Axis
obj.getGlobalPlacement().Rotation.Angle
A placement is a placement, whatever the way you got it.
I hadn't tried with parenthesis. I am a stupid.

Thanks a lot openBrain.
Post Reply