For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings


Need to speed up your development?
Have a look at our:

Samples & Tools


Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

BRepAlgoAPI_Cut problem

Anonymous's picture

Hello !

I have a problem with the cut operation between a TopoDS_Compound and a TopoDS_Solid. I have a solid obtained from the cut of the two axial cylinders with the same height, point, Z direction, but with different radius. Next, the result is cut with another cylinder which has the same properties as the cylinder with the lowest radius. After this cut, the internal faces dissappear and the result is not valid. If you iterate through the result, you will encounter invalid faces, that means faces which point to invalid addresses in memory !

The bug can be reproduced using the following commands in the AISViewer program :

vinit box b1 10 10 10 pcylinder cyl 2 10 ttranslate cyl 5 5 0 cut result b1 cyl pcylinder cyl2 2 10 ttranslate cyl2 5 5 0 cut res1 result cyl2 vdisplay res1

You can see that the internal faces of the resulting body are missing.

Also, you can use the following C++ code inside any MFC program ( with the same result ) :

TopoDS_Shape box = BRepPrimAPI_MakeBox( gp_Pnt( -7, -50, 0 ), gp_Pnt( 7, 50, 20 ) );

TopoDS_Shape cyl1 = BRepPrimAPI_MakeCylinder( 30, 20 );

TopoDS_Shape cyl2 = BRepPrimAPI_MakeCylinder( 20, 20 );

TopoDS_Shape cyl4 = BRepPrimAPI_MakeCylinder( 20, 20 );

TopoDS_Shape resCut = BRepAlgoAPI_Cut( cyl1, cyl2 );

TopoDS_Shape resFuse = BRepAlgoAPI_Fuse( box, resCut );

TopoDS_Shape resCutFinal = BRepAlgoAPI_Cut( resCut, cyl4 );

Handle(AIS_Shape) aDisplay = new AIS_Shape( resCutFinal );





If you try to use TopoDS_Shape resCutFinal = BRepAlgoAPI_Cut( resFuse, cyl4 ), you will get a runtime error.

I have tried to build a TopoDS_Solid from the result of the first cylinders cut, but the result is the same : the common faces are deleted.

Has someone a solution to this ?

Best regards,


Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.