mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0027302: Invalid curves number in intersection result
1. In frame of the fix for #27282 issue, we have obtained several prolonged curves, which have common point(s). Fix for this issue joins these curves if it is possible. 2. ElCLib::InPeriod(...) method has been improved. Now it has become more faster (in general cases) and more reliable (in frame of FLT_OVERFLOW and DIVISION_BY_ZERO cases processing). Creation of test case for issue #27302 Test case tests\bugs\modalg_6\bug27282_2 has been adjusted in accordance with its new behavior.
This commit is contained in:
@@ -48,20 +48,25 @@ static Standard_Real PIPI = M_PI + M_PI;
|
||||
|
||||
//=======================================================================
|
||||
//function : InPeriod
|
||||
//purpose :
|
||||
//purpose : Value theULast is never returned.
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ElCLib::InPeriod(const Standard_Real U,
|
||||
const Standard_Real UFirst,
|
||||
const Standard_Real ULast)
|
||||
Standard_Real ElCLib::InPeriod(const Standard_Real theU,
|
||||
const Standard_Real theUFirst,
|
||||
const Standard_Real theULast)
|
||||
{
|
||||
Standard_Real u = U, period = ULast - UFirst;
|
||||
Standard_Real Eps = Epsilon(period);
|
||||
if( Precision::IsInfinite(theU) ||
|
||||
Precision::IsInfinite(theUFirst) ||
|
||||
Precision::IsInfinite(theULast))
|
||||
{//In order to avoid FLT_Overflow exception
|
||||
return theU;
|
||||
}
|
||||
|
||||
while (Eps < (UFirst-u)) u += period;
|
||||
while (Eps > (ULast -u)) u -= period;
|
||||
if ( u < UFirst) u = UFirst;
|
||||
return u;
|
||||
const Standard_Real aPeriod = theULast - theUFirst;
|
||||
|
||||
if(aPeriod < Epsilon(theULast))
|
||||
return theU;
|
||||
|
||||
return Max(theUFirst, theU + aPeriod*Ceiling((theUFirst-theU)/aPeriod));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
Reference in New Issue
Block a user