Get Rotation Properties

Hi

Is it possible to acquire the 3d rotation properties about the X, Y, and Z axis for a given edge?
I would greatly appreciate it if someone could point me in the right direction.

Regards
Jacques Coetzee

Alexander Luger's picture

Hello Jacques,

I would use the class BRepBuilderAPI_Transform to perform a transformation (rotation) on a topological entity.

Regards,
Alex

Jacques Coetzee's picture

Hi Alex

Thank you for the response.
Unfortunately, I do not have to apply a rotation to a topological entity, but rather request the current rotation of the entity about the 3 Cartesian axis.

Regards
Jacques Coetzee

Alexander Luger's picture

Hi Jacques,

get the local coordinate system (TopLoc_Location) of a TopoDS_Shape with Location(). TopLoc_Location has a function Transformation(), which should give you information on the transformation associated with this coordinate system. I hope this helps you in any way.

Regards,
Alex

Jacques Coetzee's picture

Thank you for the response.

This method does unfortunately not work. All angles returned are 0.
I think this is because I have not applied any transformations since the Edges were created, but these edges still have some Euler angles relative to the axis non the less.

I will be looking in calculating these angles manually in the meantime.

Regards
Jacques Coetzee

Sharjith Naramparambath's picture

I'd suggest, get the Location() of the TopoDS_Shape and create a gp_Tsrf from the global to the local and find the Euler angles by first calling GetRotation() which returns the gp_Quaternion and then calling GetEulerAngles.