Fri, 08/19/2022 - 19:58
Forums:
Hi,
I'm trying to do rotation on top level / root labels of step file and got some strange behavior of CAD Assistant.
When selecting root compound with 2 shapes and rotaing it the 2 compounds seem to set their world space to localspace and snap back to identity.
I did a small gif to show what I mean and also attached the step file (made with freecad).
I'm also having trouble setting the TopLoc_Location after rotation of root labels. Is this in general a bug? I wanted to file a bug report on Mantis but it keeps telling me that my account is disabled or that my username/password is wrong but it is fine!
This is my (partial and pseudo) code:
void rotate(gp_Ax1 axis, double degree) { aShapeTool = XCAFDoc_DocumentTool::ShapeTool(m_Document TDF_LabelSequence rootLabels; aShapeTool->GetFreeShapes(rootLabels); for (int i = 0; i < rootLabels.Length();i++) { TDF_Label l = rootLabels.Value(i); TopLoc_Location loc = XCAFDoc_ShapeTool::GetLocation(GetLabel()); gp_Trsf orient; orient.SetRotation(axis, degree); gp_Trsf result(loc.Transformation().Multiplied(orient)); XCAFDoc_Location::Set(l, TopLoc_Location(result)); } }
Thanks for any help!
Best regards
-Michael
Attachments:
Fri, 08/19/2022 - 20:53
The line
should be
Mon, 08/22/2022 - 10:06
Hello Michael, as for CAD Assistant - I've registered a bug report for this scenario.