diff --git a/src/ProjLib/ProjLib_ProjectedCurve.cxx b/src/ProjLib/ProjLib_ProjectedCurve.cxx index cbdd84ae92..f1cfe27176 100644 --- a/src/ProjLib/ProjLib_ProjectedCurve.cxx +++ b/src/ProjLib/ProjLib_ProjectedCurve.cxx @@ -53,6 +53,7 @@ #include #include #include +#include //======================================================================= //function : IsoIsDeg @@ -482,7 +483,16 @@ void ProjLib_ProjectedCurve::Load(const Handle(Adaptor3d_HCurve)& C) IsTrimmed[0] = Standard_True; f = f + dt; myCurve = myCurve->Trim(f, l, Precision::Confusion()); - Vsingular[0] = ElCLib::Parameter(L, P); + // Searching the parameter on the basis curve for surface of revolution + Extrema_ExtPC anExtr(P, mySurface->BasisCurve()->Curve(), myTolerance); + if (anExtr.IsDone()) + { + Standard_Integer anIndex = 1; + while (!anExtr.IsMin(anIndex) && anIndex < anExtr.NbExt()) anIndex++; + Vsingular[0] = anExtr.Point(anIndex).Parameter(); + } + else + Vsingular[0] = ElCLib::Parameter(L, P); //SingularCase[0] = 3; } @@ -492,7 +502,16 @@ void ProjLib_ProjectedCurve::Load(const Handle(Adaptor3d_HCurve)& C) IsTrimmed[1] = Standard_True; l = l - dt; myCurve = myCurve->Trim(f, l, Precision::Confusion()); - Vsingular[1] = ElCLib::Parameter(L, P); + // Searching the parameter on the basis curve for surface of revolution + Extrema_ExtPC anExtr(P, mySurface->BasisCurve()->Curve(), myTolerance); + if (anExtr.IsDone()) + { + Standard_Integer anIndex = 1; + while (!anExtr.IsMin(anIndex) && anIndex < anExtr.NbExt()) anIndex++; + Vsingular[1] = anExtr.Point(anIndex).Parameter(); + } + else + Vsingular[1] = ElCLib::Parameter(L, P); //SingularCase[1] = 4; } } diff --git a/tests/bugs/moddata_3/bug25494 b/tests/bugs/moddata_3/bug25494 new file mode 100644 index 0000000000..3c6d92d1a7 --- /dev/null +++ b/tests/bugs/moddata_3/bug25494 @@ -0,0 +1,14 @@ +puts "================" +puts "OCC25494" +puts "================" +puts "" +####################################################################### +# Wrong result obtained by projection algorithm +####################################################################### + +restore [locate_data_file bug25494_s.draw] s +restore [locate_data_file bug25494_c.draw] c + +project c2d c s + +dump c2d