I'm trying to fuse a cylinder with a sphere, where the sphere is offset by a certain amount. This seems to fail (produces a broken solid) when the sphere's offset is close to the cylinder's radius. It works better at other angles.
The code I'm using to do this is:
TopoDS_Shape ves = BRepPrimAPI_MakeSphere(500);
TopoDS_Shape noz = BRepPrimAPI_MakeCylinder(50, 580);
transform.SetTranslation(gp_Vec(0, 50, 0));
TopoDS_Shape transformed = BRepBuilderAPI_Transform(ves, transform);
TopoDS_Shape fused = BRepAlgoAPI_Fuse(transformed, noz);
Can someone help me with this?