diff --git a/src/Extrema/Extrema_GExtPC.gxx b/src/Extrema/Extrema_GExtPC.gxx index d931d9e3e0..7fdee7543a 100644 --- a/src/Extrema/Extrema_GExtPC.gxx +++ b/src/Extrema/Extrema_GExtPC.gxx @@ -120,7 +120,7 @@ void Extrema_GExtPC::Perform(const ThePoint& P) Standard_Integer anIdx; - // Find first and last used knot + // Find first and last used knot. Standard_Integer aFirstUsedKnot = aFirstIdx, aLastUsedKnot = aLastIdx; for(anIdx = aFirstIdx; anIdx <= aLastIdx; anIdx++) @@ -141,6 +141,16 @@ void Extrema_GExtPC::Perform(const ThePoint& P) break; } + if (aFirstUsedKnot == aLastUsedKnot) + { + // Degenerated case: + // Some bounds lies out of curve param space. + // In this case build one interval with [myuinf, myusup]. + // Parameters of these indexes will be redefined. + aFirstUsedKnot = aFirstIdx; + aLastUsedKnot = aFirstIdx + 1; + } + mysample = (TheCurveTool::BSpline(aCurve))->Degree() + 1; // Fill sample points.