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 Fri, 02/07/2014 - 13:30
Hello Jacques,
I would use the class BRepBuilderAPI_Transform to perform a transformation (rotation) on a topological entity.
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.
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.
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.
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.
Fri, 02/07/2014 - 13:30
Hello Jacques,
I would use the class BRepBuilderAPI_Transform to perform a transformation (rotation) on a topological entity.
Regards,
Alex
Fri, 02/07/2014 - 13:34
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
Fri, 02/07/2014 - 15:18
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
Sat, 02/08/2014 - 14:01
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
Mon, 02/10/2014 - 19:19
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.