Creating a pipe from boolean cut on cylinders.

Hi all,

I am trying to create a pipe by performing subtraction between two cylinders but getting a wrong shape. Instead of a pipe, the resulting shape is just the outer cylinder. Here is the dimensions:

TopoDS_Shape cylinder1 = BRepPrimAPI_MakeCylinder(gp_Pnt(0.0, 0.0, 0.0),
gp_Dir(1.0, 0.0, 0.0), 3e-6, 5e-5, 360).Shape();
TopoDS_Shape cylinder2 = BRepPrimAPI_MakeCylinder(gp_Pnt(0.0, 0.0, 0.0),
gp_Dir(1.0, 0.0, 0.0), 7e-6, 5e-5, 360).Shape();
BRepAlgoAPI_Cut cutOp(cylinder2,cylinder1);
TopoDS_Shape pipe = cutOp.Shape();

I thought that the problem might have been from overlapping faces so I tried making the inner cylinder longer but the result is still the same. Also, the intersection of these two cylinders is empty. Does anyone know what might have caused this and a possible solution?

Thanks.

Guido van Hilst not specified's picture

Hi, I saw you had some strange parameters: 3e-6, very small?

Also the angle in occ is always in radians..

See example: Make a tube.

More examples....

Mikhail Sazonov's picture

The radiuses of your cylinders are too close to Precision::Confusion() value, equal to 1e-7. If your model has size in meters I recommend to switch to mm (so scale up 1000 times).

Also, I agree with the previous author, you must point angle in radians. And in the case of full 360 deg cylinder it is better to use another method that does not take the angle.