// Make Spline TColgp_Array1OfPnt listP( 0, 2 ); listP.SetValue( 0, gp_Pnt( 100, 0, 100 ) ); listP.SetValue( 1, gp_Pnt( 50, 0, 100 ) ); Handle(Geom_BSplineCurve) SPL1 = GeomAPI_PointsToBSpline( listP,1,8); BRepBuilderAPI_MakeEdge makeSplineEdge( SPL1 ); TopoDS_Wire wireSpline = BRepBuilderAPI_MakeWire(makeSplineEdge.Edge()).Wire(); BRepBuilderAPI_MakeWire makeWire1; BRepBuilderAPI_MakeWire makeWire2; // profile1 makeWire1.Add( BRepBuilderAPI_MakeEdge( gp_Pnt( 10, 0, 0 ), gp_Pnt( 10, -10, 0 ) ) ); makeWire1.Add( BRepBuilderAPI_MakeEdge( gp_Pnt( 10, -10, 0 ), gp_Pnt( 20, -10, 0 ) ) ); makeWire1.Add( BRepBuilderAPI_MakeEdge( gp_Pnt( 20, -10, 0 ), gp_Pnt( 20, 0, 0 ) ) ); makeWire1.Add( BRepBuilderAPI_MakeEdge( gp_Pnt( 20, 0, 0 ), gp_Pnt( 10, 0, 0 ) ) ); TopoDS_Wire wire1 = makeWire1.Wire(); if ( wire1.Closed() == Standard_True ) { qDebug("wire1.Closed() == Standard_True"); } // profile2 makeWire2.Add( BRepBuilderAPI_MakeEdge( gp_Pnt( 100, 0, 90 ), gp_Pnt( 100, -10, 90 ) ) ); makeWire2.Add( BRepBuilderAPI_MakeEdge( gp_Pnt( 100, -10, 90 ), gp_Pnt( 110, -10, 90 ) ) ); makeWire2.Add( BRepBuilderAPI_MakeEdge( gp_Pnt( 110, -10, 90 ), gp_Pnt( 110, 0, 90 ) ) ); makeWire2.Add( BRepBuilderAPI_MakeEdge( gp_Pnt( 110, 0, 90 ), gp_Pnt( 100, 0, 90 ) ) ); TopoDS_Wire wire2 = makeWire2.Wire(); if ( wire2.Closed() == Standard_True ) { qDebug("wire2.Closed() == Standard_True"); } // BRepOffsetAPI_MakePipeShell BRepOffsetAPI_MakePipeShell broMkPipeShell( wireSpline ); broMkPipeShell.Add( wire1 ); broMkPipeShell.Add( wire2 ); broMkPipeShell.Build(); if ( broMkPipeShell.GetStatus() != BRepBuilderAPI_PipeDone ) { // ("broMkPipeShell.GetStatus() != BRepBuilderAPI_PipeDone"); return; } if ( broMkPipeShell.MakeSolid() == Standard_False ) { // ("broMkPipeShell.MakeSolid() == Standard_False"); } TopoDS_Shape shapeSweeped = broMkPipeShell.Shape();