diff --git a/src/GeomFill/GeomFill_SweepSectionGenerator.cxx b/src/GeomFill/GeomFill_SweepSectionGenerator.cxx index ba5535c1d8..e3514cdfb5 100644 --- a/src/GeomFill/GeomFill_SweepSectionGenerator.cxx +++ b/src/GeomFill/GeomFill_SweepSectionGenerator.cxx @@ -338,7 +338,7 @@ void GeomFill_SweepSectionGenerator::Perform(const Standard_Boolean Polynomial) myFirstSect = GeomConvert::CurveToBSplineCurve(Circ,Convert_QuasiAngular); } - + if (myType <= 3 && myType >=1 ) { for (Standard_Integer i = 2; i <= myNbSections; i++) { @@ -605,16 +605,33 @@ void GeomFill_SweepSectionGenerator::Section Standard_Real Alpha = U - myAdpPath->FirstParameter(); Alpha /= myAdpPath->LastParameter() - myAdpPath->FirstParameter(); - Standard_Real U1 = - ( 1- Alpha) * myAdpFirstSect->FirstParameter() + - Alpha * myAdpFirstSect->LastParameter(); - + Standard_Real U1 = ( 1- Alpha) * myAdpFirstSect->FirstParameter() + + Alpha * myAdpFirstSect->LastParameter(); + + if (myAdpFirstSect->GetType() == GeomAbs_Line) + { + if (Precision::IsInfinite(myAdpFirstSect->FirstParameter()) || + Precision::IsInfinite(myAdpFirstSect->LastParameter())) + { + gp_Lin aLine = myAdpFirstSect->Line(); + U1 = ElCLib::Parameter(aLine, PPath); + } + } gp_Pnt P1 = myAdpFirstSect->Value(U1); Standard_Real U2 = ( 1- Alpha) * myAdpLastSect->FirstParameter() + Alpha * myAdpLastSect->LastParameter(); - + + if (myAdpLastSect->GetType() == GeomAbs_Line) + { + if (Precision::IsInfinite(myAdpLastSect->FirstParameter()) || + Precision::IsInfinite(myAdpLastSect->LastParameter())) + { + gp_Lin aLine = myAdpLastSect->Line(); + U2 = ElCLib::Parameter(aLine, PPath); + } + } gp_Pnt P2 = myAdpLastSect->Value(U2); gp_Ax2 Axis; diff --git a/src/GeometryTest/GeometryTest_SurfaceCommands.cxx b/src/GeometryTest/GeometryTest_SurfaceCommands.cxx index 58a0a620ba..5415293acc 100644 --- a/src/GeometryTest/GeometryTest_SurfaceCommands.cxx +++ b/src/GeometryTest/GeometryTest_SurfaceCommands.cxx @@ -207,6 +207,20 @@ static Standard_Integer tuyau (Draw_Interpretor& di, Pipe.Init(path, firstS, lastS); } else { + if (narg == 6 && !Option_NS && Draw::Atof(a[5]) != 0) + { + Handle(Geom_Curve) lastS = DrawTrSurf::GetCurve(a[isect + 1]); + Cont = GeomAbs_C2; + Pipe = GeomFill_Pipe(path, firstS, lastS, Draw::Atof(a[5])); + Pipe.Perform(Standard_True); + Handle(Geom_Surface) aSurface; + if (Pipe.IsDone()) + { + aSurface = Pipe.Surface(); + } + DrawTrSurf::Set(a[1], aSurface); + return 0; + } // tuyau a N sections, N>=2 TColGeom_SequenceOfCurve Seq; Seq.Clear(); @@ -399,12 +413,12 @@ void GeometryTest::SurfaceCommands(Draw_Interpretor& theCommands) theCommands.Add("tuyau", - "tuyau [-NS] result Path Curve/Radius [Curve2] [Curve3] ... \n the option -NS is used only with 2 sections.\n With it, is going from the first section to the last section \n Without, is a pipe by evolutive section ", + "tuyau [-NS] result Path Curve/Radius [Curve2] [Curve3] ... [Radius]\n the option -NS is used only with 2 sections.\n With it, is going from the first section to the last section \n Without, is a pipe by evolutive section ", __FILE__, tuyau,g); theCommands.Add("partuyau", - "tuyau result Path Curve/Radius [Curve2]\n the parametrization of the surface in the V direction will be as the Path", + "tuyau result Path Curve/Radius [Curve2] [Radius]\n the parametrization of the surface in the V direction will be as the Path", __FILE__, tuyau,g); diff --git a/tests/pipe/bugs/bug31631 b/tests/pipe/bugs/bug31631 new file mode 100644 index 0000000000..1b7d832ecf --- /dev/null +++ b/tests/pipe/bugs/bug31631 @@ -0,0 +1,24 @@ +puts "============" +puts "0031631: Modeling Algorithms - Invalid result of Pipe builder" +puts "============" +puts "" + +pload ALL + +restore [locate_data_file bug31631_1.brep] path +restore [locate_data_file bug31631_2.brep] sup1 +restore [locate_data_file bug31631_3.brep] sup2 + +tuyau res1 path sup1 sup2 6.35001275 + +tuyau res2 path sup2 sup1 6.35001275 + +mkface face1 res1 +mkface face2 res2 + +checkprops face1 -s 352.49 +checkprops face2 -s 352.49 + +checkview -display face1 -3d -path ${imagedir}/${test_image}.png + +puts "TEST COMPLETED" \ No newline at end of file