// 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 gp_Pnt CirPnt; makeWire1.Add( BRepBuilderAPI_MakeEdge( gp_Pnt( 0, 0, 0 ), gp_Pnt( 0, -10, 0 ) ) ); CirPnt.SetXYZ( gp_XYZ( 5, -10, 0) ); gp_Ax2 CirAx1( CirPnt, gp::DY().Reversed() ); gp_Circ circ1( CirAx1, 5 ); makeWire1.Add( BRepBuilderAPI_MakeEdge( circ1, gp_Pnt( 0, -10, 0 ), gp_Pnt( 10, -10, 0 ) ) ); makeWire1.Add( BRepBuilderAPI_MakeEdge( gp_Pnt( 10, -10, 0 ), gp_Pnt( 10, 0, 0 ) ) ); CirPnt.SetXYZ( gp_XYZ( 5, 0, 0) ); gp_Ax2 CirAx2( CirPnt, gp::DY() ); gp_Circ circ2( CirAx2, 5 ); makeWire1.Add( BRepBuilderAPI_MakeEdge( circ2, gp_Pnt( 10, 0, 0 ), gp_Pnt( 0, 0, 0 ) ) ); TopoDS_Wire wire1 = makeWire1.Wire(); // profile2 makeWire2.Add( BRepBuilderAPI_MakeEdge( gp_Pnt( 100, 0, 100 ), gp_Pnt( 100, -10, 100 ) ) ); CirPnt.SetXYZ( gp_XYZ( 105, -10, 100) ); gp_Ax2 CirAx3( CirPnt, gp::DY().Reversed() ); gp_Circ circ3( CirAx3, 5 ); makeWire2.Add( BRepBuilderAPI_MakeEdge( circ3, gp_Pnt( 100, -10, 100 ), gp_Pnt( 110, -10, 100 ) ) ); makeWire2.Add( BRepBuilderAPI_MakeEdge( gp_Pnt( 110, -10, 100 ), gp_Pnt( 110, 0, 100 ) ) ); CirPnt.SetXYZ( gp_XYZ( 105, 0, 100) ); gp_Ax2 CirAx4( CirPnt, gp::DY() ); gp_Circ circ4( CirAx4, 5 ); makeWire2.Add( BRepBuilderAPI_MakeEdge( circ4, gp_Pnt( 110, 0, 100 ), gp_Pnt( 100, 0, 100 ) ) ); TopoDS_Wire wire2 = makeWire2.Wire(); // 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();