mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0025494: Wrong result obtained by projection algorithm
Calculation of last parameter of projected curve was changed for the projecting of a curve to surface of revolution, if the curve is intersected with the axis of revolution Test case for issue CR25494
This commit is contained in:
parent
9bb81d6ce8
commit
f70d6437bd
@ -53,6 +53,7 @@
|
|||||||
#include <Geom2d_TrimmedCurve.hxx>
|
#include <Geom2d_TrimmedCurve.hxx>
|
||||||
#include <ElCLib.hxx>
|
#include <ElCLib.hxx>
|
||||||
#include <GeomLib.hxx>
|
#include <GeomLib.hxx>
|
||||||
|
#include <Extrema_ExtPC.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsoIsDeg
|
//function : IsoIsDeg
|
||||||
@ -482,7 +483,16 @@ void ProjLib_ProjectedCurve::Load(const Handle(Adaptor3d_HCurve)& C)
|
|||||||
IsTrimmed[0] = Standard_True;
|
IsTrimmed[0] = Standard_True;
|
||||||
f = f + dt;
|
f = f + dt;
|
||||||
myCurve = myCurve->Trim(f, l, Precision::Confusion());
|
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;
|
//SingularCase[0] = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -492,7 +502,16 @@ void ProjLib_ProjectedCurve::Load(const Handle(Adaptor3d_HCurve)& C)
|
|||||||
IsTrimmed[1] = Standard_True;
|
IsTrimmed[1] = Standard_True;
|
||||||
l = l - dt;
|
l = l - dt;
|
||||||
myCurve = myCurve->Trim(f, l, Precision::Confusion());
|
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;
|
//SingularCase[1] = 4;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
14
tests/bugs/moddata_3/bug25494
Normal file
14
tests/bugs/moddata_3/bug25494
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user