
Sat, 02/19/2022 - 09:11
Hi,
I finally got the Euler angles thing figured out. This works quite well: I load a step file (SC_Setup00.jpg), which results in a misoriented model. I then rotate that to the desired position (SC_Setup01.jpg) and press "Set" (SC_Setup02.jpg).
gp_Trsf t = model->Transformation();
const TopoDS_Shape& base = model->Shape();
TopoDS_Shape nModel = base.Located(TopLoc_Location(t));
view3D->removeShape(model);
model = new AIS_Shape(nModel);
Hereby the new position and orientation of the model becomes the new base position, i.e. new transformations start with the base position - so exactly what I wanted.
Unfortunately, the same procedure does not work for the workpiece. I create a box based on the bounding box. Then I change size and position until it fits for me.
When I then execute "Set" (same sequence as for the model), the box jumps back to zero with a corner (SE_Setup03.jpg). Of course, this is not the way I want it.
How can I prevent this, or what have I overlooked?
P.S.: is it possible to embed uploaded images in the post? - if so, how?
Sat, 02/19/2022 - 11:29
You should be able inserting images in "Filtered HTML" editor using dedicated button or by pasting image from clipboard (Ctrl+V).