BRepAlgoAPI_Cut failed to cut a cylinder from another

hi, I've been working with Open cascade for some time, mostly used with its geometry boolean apis.
Recently I've found a problem when cylinder generated by following codes will not be cutted correctly with BRepAlgoAPI_Cut

"
TopoDS_Shape cylinderSmall = BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(-0.1212,0.98989,-0.213313),gp_Dir(1,0,1)),10,800);
TopoDS_Shape cylinderBig = BRepPrimAPI_MakeCylinder(gp_Ax2(gp_Pnt(-0.1212,0.98989,-0.213313),gp_Dir(1,0,1)),100,100);
//TopoDS_Shape ret = BRepAlgo_Cut(cylinderBig,cylinderSmall);
TopoDS_Shape ret = BRepAlgoAPI_Cut(cylinderBig,cylinderSmall);
return ret;
"
but the strange thing is BRepAlgo_Cut can work in this case.
I've tried to debug for a long time, but got no clue. Can you fix this or tell me how to work on it?

Forum supervisor's picture

Dear kylin,
The case also is not reproducible in OCCT654 environment.
See below the script and attached result.
Draw[]> pload ALL
Draw[]> plane pln1 -0.1212 0.98989 -0.213313 1 0 1
Draw[]> pcyl cy1 pln1 10 800
Draw[]> pcyl cy2 pln1 100 100
Draw[]> fit
Draw[]> bop cy2 cy1
Draw[]> bopcut Result
Draw[]> fit
Draw[]> checkshape Result
## This shape seems to be valid
Draw[]> vdisplay Result
Draw[]> save Result Result24295.brep
Regards

kylin's picture

Dear supervisor
I'm sorry, the code I've posted is not the code where error happened.
The error code is below. It was supposed that a hole should exist in the bigger cylinder, but there's none.(There's only a tiny difference of the parameters in the two codes.)

Draw[]> pload ALL
Draw[]> plane pln1 -0.1212 0.98989 -0.213313 1 0 1
Draw[]> plane pln2 -0.1212 0.98989 -0.213313 0.71111111 0 0.71111112
Draw[]> pcyl cy1 pln1 10 800
Draw[]> pcyl cy2 pln2 100 100
Draw[]> fit
Draw[]> bop cy2 cy1
Draw[]> bopcut Result
Draw[]> fit
Draw[]> checkshape Result
Draw[]> vdisplay Result

you can see, there's no hole in the cylinder but a small piece of circle in the bottom of the cylinder. This is the error I was talking about.
Thank you for your patience and your guide of the usage of the script tool.
Hope this would help.

Also there's a question, what should I do if I want to change the Precise value during the runtime?

Regards

kylin's picture

The wrong result is attached. Thank you for your attention.

Forum supervisor's picture

Dear kylin,
I would like to inform you that the posted problem (after your correction) has been checked and reproduced. The result contains Not Closed Shell.
I suggest you to register the issue in Mantis Bugtracker which is available via the Collaborative portal - http://dev.opencascade.org/index.php?q=home/get_involved.
If the problem is critical for you, you may contact us via the Contact Form http://www.opencascade.org/about/contacts/.
Regards

kylin's picture

Dear supervisor
Thank you for your guidance, I'll go further until this be done.
Regards