Wed, 04/12/2023 - 00:48
Forums:
I have the following code which produces a fusion of a thrusections shape with a sphere:
const double radius = 1.8;
Handle(Geom_Circle) c1 = GC_MakeCircle(gp_Pnt(1, 0, 0), gp_Pnt(1, 0, 1), radius);
Handle(Geom_Circle) c2 = GC_MakeCircle(gp_Pnt(0, 0, 2), gp_Pnt(0, 0, 3), 2);
Handle(Geom_Circle) c3 = GC_MakeCircle(gp_Pnt(0, 0, 3), gp_Pnt(0, 0, 4), 2.5);
Handle(Geom_Circle) c4 = GC_MakeCircle(gp_Pnt(0, 0, 12), gp_Pnt(0, 0, 13), 3);
Handle(Geom_Circle) c5 = GC_MakeCircle(gp_Pnt(0, 0, 20), gp_Pnt(0, 0, 21), 3.5);
const TopoDS_Wire& w1 = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(c1));
const TopoDS_Wire& w2 = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(c2));
const TopoDS_Wire& w3 = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(c3));
const TopoDS_Wire& w4 = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(c4));
const TopoDS_Wire& w5 = BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(c5));
const std::vector<TopoDS_Wire>& sectionWires{ w1, w2, w3, w4, w5 };
const TopoDS_Shape& top = MakeSkin(sectionWires);
const TopoDS_Shape& base = BRepPrimAPI_MakeSphere(gp_Pnt(1, 0, 0), radius);
const TopoDS_Shape& fused = BRepAlgoAPI_Fuse(top, base);
The issue is that the final shape ('fused') is missing the bottom half of the sphere as shown in the attached picture.
I tested this with 7.7.0 and 7.7.1. Win x64 for both.
Interesting thing is that if 'radius' is changed from 1.8 to 1.7 or 1.9, it works fine.
Attachments:
Wed, 04/12/2023 - 00:50
This is what MakeSkin looks like:
TopoDS_Shape MakeSkin(const std::vector<TopoDS_Wire>& wires_) { BRepOffsetAPI_ThruSections thruSections(true, false, 0.01); thruSections.SetSmoothing(true); for (const TopoDS_Wire& wire : wires_) { if (wire.IsNull()) continue; thruSections.AddWire(wire); } thruSections.Build(); return thruSections.Shape(); }Thu, 04/13/2023 - 03:49
Hello,
can you create a ticket in the bugtracker? https://tracker.dev.opencascade.org
If you can't, I create. This problem looks like a bug (at the moment we working in the same ticket with fusing with sphere, but it can be not connected)
Best regards, Dmitrii.