why the boolean operation BRepAlgo_Cut throws a TopoDS_FrozenShape exception.

this is what my codes look like:

TopoDS_Shape box1 = BRepPrimAPI_MakeBox(30, 30, 30);
TopoDS_Shape box2 = BRepPrimAPI_MakeBox(gp_Pnt(0, 0, 10), 30, 30, 10);
TopoDS_Shape box3 = BRepPrimAPI_MakeBox(gp_Pnt(10, 0, 0), 10, 30, 30);
box1 = BRepAlgo_Cut(box1, box2);
box1 = BRepAlgo_Cut(box1, box3);// the TopoDS_FrozenShape throws here

Did I use BRepAlgo_Cut in wrong way? Looking forward to replies, thx!

Forum supervisor's picture

Dear Tom,
The specified problem was not reproduced neither on OCCT6.6.0 nor on OCCT6.5.4.
See the attached brep file with the resulting shape and Draw reproducer below.
> pload ALL
> box b1 30 30 30
> box b2 0 0 10 30 30 10
> box b3 10 0 0 10 30 30
> bop b1 b2
> bopcut b1
> bop b1 b3
> bopcut b1
> save b1 cut_result.brep
Regards

Thomas Rabenbauer's picture

Thx to the reply. I'm pretty sure I test these code on OCCT6.6. I find out BRepAlgoAPI_Cut seems doesn't case the problem, what's differences between them?
Thx!

Forum supervisor's picture

Dear Tom,
You may easy check implementation of boolean operation commands in the file
BOPTest_BOPCommands.cxx.
Regards