Dear all, I have encountered a problem when using the BRepFill_Pipe function.
I created a face that I want to sweep along a wire. Once, the wire is a straight line -- and that works -- and once the wire is a twisted helix -- that does not work. The runtime error that I get in the command BRepFill_Pipe(aHelixWire,ptFace) is the following: terminate called after throwing an instance of 'Standard_NullObject'.
The figure shows the successfully swept face along the straight line and what the helix looks like.
I have rendered all kinds of shapes and they all look fine.
Here is a snippet of code:
// Helix
Handle_Geom_CylindricalSurface aCylinder = new Geom_CylindricalSurface(gp::XOY(), myPinDiameter/2.0);
gp_Lin2d aLine2d(gp_Pnt2d(0.0, 0.0), gp_Dir2d(-2.0*M_PI, -myP));
Handle_Geom2d_TrimmedCurve aSegment = GCE2d_MakeSegment(aLine2d, 0.0, M_PI);
TopoDS_Edge aHelixEdge = BRepBuilderAPI_MakeEdge(aSegment, aCylinder, 0.0, myPinLength/myP * sqrt(pow(2.0*M_PI,2) + pow(myP,2)));
TopoDS_Wire aHelixWire = BRepBuilderAPI_MakeWire(aHelixEdge);
// Line
TopoDS_Edge aLineEdge = BRepBuilderAPI_MakeEdge(gp_Pnt(myD2,0.0,0),gp_Pnt(myD2,2.0,0));
TopoDS_Wire aLineWire = BRepBuilderAPI_MakeWire(aLineEdge);
// Trepazoid
gp_Pnt pntV1(myD2, 0.0, -myP/ 4.0);
gp_Pnt pntV2(myD , 0.0, -myP/16.0);
gp_Pnt pntV3(myD , 0.0, myP/16.0);
gp_Pnt pntV4(myD2, 0.0, myP/ 4.0);
Handle(Geom_TrimmedCurve) segV12 = GC_MakeSegment(pntV1, pntV2);
Handle(Geom_TrimmedCurve) segV23 = GC_MakeSegment(pntV2, pntV3);
Handle(Geom_TrimmedCurve) segV34 = GC_MakeSegment(pntV3, pntV4);
Handle(Geom_TrimmedCurve) segV41 = GC_MakeSegment(pntV4, pntV1);
TopoDS_Edge ed1 = BRepBuilderAPI_MakeEdge(segV12);
TopoDS_Edge ed2 = BRepBuilderAPI_MakeEdge(segV23);
TopoDS_Edge ed3 = BRepBuilderAPI_MakeEdge(segV34);
TopoDS_Edge ed4 = BRepBuilderAPI_MakeEdge(segV41);
TopoDS_Wire ptWire = BRepBuilderAPI_MakeWire(ed1,ed2,ed3,ed4);
TopoDS_Face ptFace = BRepBuilderAPI_MakeFace(ptWire);
// does not work :(
TopoDS_Shape aHelixPipe = BRepFill_Pipe(aHelixWire,ptFace).Shape();
// does work ;)
TopoDS_Shape aLinePipe = BRepFill_Pipe(aLineWire,ptFace).Shape();
What could I have done wrongly? Any help is appreciated.