once again, I have a problem with boolean operations:
I want to cut one cylinder from another so that I
obtain a ring. After that, the ring is to be fused with a torus.
My code is as follows:
double rr = 50.0;
double rs = 4.00;
double h = 15.0;
TopoDS_Shape torus = BRepPrimAPI_MakeTorus (rr-rs, rs).Shape ();
TopoDS_Shape cylinder1 = BRepPrimAPI_MakeCylinder (rr, h).Shape ();
TopoDS_Shape cylinder2 = BRepPrimAPI_MakeCylinder (rr - 2 * rs, h).Shape ();
TopoDS_Shape cut = BRepAlgoAPI_Cut(cylinder1, cylinder2);
TopoDS_Shape fuse = BRepAlgoAPI_Fuse(torus, cut);
Unfortunately, an exception is raised during the fuse operation:
Strange enough, everything works fine, if I fuse cylinder1 and torus
first and cut cylinder2 afterwards.
I also tried to use class BRepAlgo_Fuse instead of
BRepAlgoAPI_Fuse. With this algo I didn't have the exception, but the
result was not what I expected (Some faces are missing).
Does anybody know, what's wrong with my code?
What is the meaning of the exception?
Many thanks in advance