BRepAlgoAPI_Cut breaks the shape

Hello, I want to get a model that eliminates shape2 from shape1.
However, the following program will break the shape.
Is there any good solution?

[code]

TopoDS_Shape shapeTmp = shape1;
TopoDS_Shape shapeRet;
for( TopExp_Explorer expS( shape2, TopAbs_SOLID ); expS.More(); expS.Next() ) {
    BRepAlgoAPI_Cut cut( shapeTmp, expS.Current() );
    cut.Build();
    shapeRet = cut.Shape();
    shapeTmp = shapeRet;
}

[environment]

Opencascade: V7.6.3
OS: Windows 10 Pro 64bit
CPU: Intel(R) Core(TM) i7-8550U
Memory: 16GB

Best regards.

Mikhail Sazonov's picture

If the result is obviously unexpected then you are welcome to register a bug in the bugtracker..

Keito Okajima's picture

Hello, Mikhail.
Thank you for your reply.
I asked because I wasn't sure if it was a bug or not.
I also registered this issue in the bug tracker.
https://tracker.dev.opencascade.org/view.php?id=33131