mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0028856: Extrema between two curves gives wrong result
Treatment for large Lipschitz constant is added Test case is added
This commit is contained in:
parent
1eeef710bb
commit
35dced1c14
@ -211,6 +211,7 @@ void Extrema_GenExtCC::Perform()
|
||||
C2.Intervals(anIntervals2, aContinuity);
|
||||
|
||||
// Lipchitz constant computation.
|
||||
const Standard_Real aMaxLC = 10000.;
|
||||
Standard_Real aLC = 9.0; // Default value.
|
||||
const Standard_Real aMaxDer1 = 1.0 / C1.Resolution(1.0);
|
||||
const Standard_Real aMaxDer2 = 1.0 / C2.Resolution(1.0);
|
||||
@ -226,6 +227,11 @@ void Extrema_GenExtCC::Perform()
|
||||
{
|
||||
isConstLockedFlag = Standard_True;
|
||||
}
|
||||
if (aMaxDer > aMaxLC)
|
||||
{
|
||||
aLC = aMaxLC;
|
||||
isConstLockedFlag = Standard_True;
|
||||
}
|
||||
if (C1.GetType() == GeomAbs_Line)
|
||||
{
|
||||
aMaxDer = 1.0 / C2.Resolution(1.0);
|
||||
|
@ -343,6 +343,10 @@ Standard_Boolean math_GlobOptMin::computeLocalExtremum(const math_Vector& thePnt
|
||||
//=======================================================================
|
||||
void math_GlobOptMin::computeInitialValues()
|
||||
{
|
||||
const Standard_Real aMinLC = 0.01;
|
||||
const Standard_Real aMaxLC = 1000.;
|
||||
const Standard_Real aMinEps = 0.1;
|
||||
const Standard_Real aMaxEps = 100.;
|
||||
Standard_Integer i;
|
||||
math_Vector aCurrPnt(1, myN);
|
||||
math_Vector aBestPnt(1, myN);
|
||||
@ -374,10 +378,10 @@ void math_GlobOptMin::computeInitialValues()
|
||||
|
||||
myC = myInitC;
|
||||
aLipConst *= Sqrt(myN) / aStep;
|
||||
if (aLipConst < myC * 0.1)
|
||||
myC = Max(aLipConst * 0.1, 0.01);
|
||||
else if (aLipConst > myC * 5)
|
||||
myC = Min(myC * 5, 50.0);
|
||||
if (aLipConst < myC * aMinEps)
|
||||
myC = Max(aLipConst * aMinEps, aMinLC);
|
||||
else if (aLipConst > myC * aMaxEps)
|
||||
myC = Min(myC * aMaxEps, aMaxLC);
|
||||
|
||||
// Clear all solutions except one.
|
||||
if (myY.Size() != myN)
|
||||
|
13
tests/bugs/modalg_7/bug28856
Normal file
13
tests/bugs/modalg_7/bug28856
Normal file
@ -0,0 +1,13 @@
|
||||
puts "========"
|
||||
puts "OCC28856"
|
||||
puts "========"
|
||||
puts ""
|
||||
########################################
|
||||
# Extrema between two curves gives wrong result
|
||||
########################################
|
||||
|
||||
# Restore the initial shape
|
||||
restore [locate_data_file bug28856_shapes.brep] e
|
||||
explode e
|
||||
distmini dd e_1 e_2
|
||||
checkprops dd -l 0.101881
|
Loading…
x
Reference in New Issue
Block a user