Scaling and Cut operation

Hi I want to do a Cut operation between Two shape (for example two cube)

I create a first Shape box1=BRepPrimAPI_MakeBox(gp_Pnt(-2,-2,-2),gp_Pn(2,2,2)) box2=BRepPrimAPI_MakeBox(gp_Pnt(-1,-1,-1),gp_Pn(1,1,1)) The box2 is inside the box1 then I want to scale the box2 on Z axis to pierce the box1. gp_Trsf t; t.SetValues(1,0,0,0,

0,1,0,0,

0,0,4,0,

Precision::Angular(),

Precision::Confusion()); TopLoc_Location aNewLocation(t); TopoDS_Shape box3= box2.Moved(aNewLocation);

cutShape = BRepAlgoAPI_Cut(box1,box3);

but I obtaint a wrong result I don't know if it was the fault of my scaling or the fault of the cut operation ?

S. Routelous's picture

Hi,

did you try BRepBuilderAPI_Transform to do the translation ?

Stephane

x-lhomme's picture

Yes , and I obtain the same wrong result

Michael Sazonov's picture

Dear Lhomme,

You should use general transformation. It is gp_GTrsf. To transform a shape use BRepBuilderAPI_GTransform. See on-line manual at http://www.opencascade.org/doc31/toptools/P_36_4.htm