
Tue, 11/09/2021 - 14:21
Forums:
Hi, I have a project where I want to cut a TopoDS_Shape (in this case a Cube imported from a Unity with CADExchanger and then used BRepBuilderAPI_Sewing and BOPAlgo_MakerVolume on it to make it a solid) with another TopoDS_Shape(which is again a Cylinderimported from a Unity with CADExchanger and then used BRepBuilderAPI_Sewing and BOPAlgo_MakerVolume on it to make it a solid). When I try to move cylinder close to the center of the cube it teleports to to other symmetrical side of the Cube (look at attachments). I have tried not using BRepBuilderAPI_Sewing and BOPAlgo_MakerVolume on Cylinder but it did not work. How can I achieve what I want? Also I am adding my move function below
TopoDS_Shape MoveShape(Standard_Real x, Standard_Real y, Standard_Real z, const TopoDS_Shape& aShape)
{
gp_Trsf trsf;
trsf.SetTransformation(gp_Ax3(gp_Pnt(x, y, z), gp_Dir()));
TopLoc_Location loc = TopLoc_Location(trsf);
return aShape.Moved(loc);
}
Attachments:
Tue, 11/09/2021 - 16:34
If you want to move a shape on a certain vector you should use SetTranslation, rather than SetTransformation.
Wed, 11/10/2021 - 08:23
OK, thank you. Another question is about the usage of set translation: First I will trsf.setTranslation((0,0,0),point_A), then if I want to move it again will I use trsf.SetTranslation((0,0,0),point_B) or trsf.SetTranslation(point_A,point_B) ?
Wed, 11/10/2021 - 09:43
Now, it does not move at all :P
Edit: NVM my values were tooooooo low