1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0022488: Typo in Geom2d_BSplineCurve::LocateU() - which uses a value not adjusted to period for periodic B-Splines

This commit is contained in:
szy
2012-03-10 13:53:24 +04:00
committed by inv
parent e2e80ff797
commit 41c52af3a7
3 changed files with 28 additions and 24 deletions

View File

@@ -711,23 +711,24 @@ void Geom2d_BSplineCurve::LocateU
PeriodicNormalization(NewU); //Attention a la periode
Standard_Real UFirst = CKnots (1);
Standard_Real ULast = CKnots (CKnots.Length());
if (Abs (NewU - UFirst) <= Abs(ParametricTolerance)) { I1 = I2 = 1; }
else if (Abs (U - ULast) <= Abs(ParametricTolerance)) {
Standard_Real PParametricTolerance = Abs(ParametricTolerance);
if (Abs (NewU - UFirst) <= PParametricTolerance) { I1 = I2 = 1; }
else if (Abs (NewU - ULast) <= PParametricTolerance) {
I1 = I2 = CKnots.Length();
}
else if (NewU < UFirst - Abs(ParametricTolerance)) {
else if (NewU < UFirst) {
I2 = 1;
I1 = 0;
}
else if (NewU > ULast + Abs(ParametricTolerance)) {
else if (NewU > ULast) {
I1 = CKnots.Length();
I2 = I1 + 1;
}
else {
I1 = 1;
BSplCLib::Hunt (CKnots, NewU, I1);
while ( Abs( CKnots(I1+1) - NewU) <= Abs(ParametricTolerance)) I1++;
if ( Abs( CKnots(I1) - NewU) <= Abs(ParametricTolerance)) {
while ( Abs( CKnots(I1+1) - NewU) <= PParametricTolerance) I1++;
if ( Abs( CKnots(I1) - NewU) <= PParametricTolerance) {
I2 = I1;
}
else {