diff --git a/src/Extrema/Extrema_GExtPC.gxx b/src/Extrema/Extrema_GExtPC.gxx index 59002f4f38..499aa6b663 100644 --- a/src/Extrema/Extrema_GExtPC.gxx +++ b/src/Extrema/Extrema_GExtPC.gxx @@ -118,7 +118,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++) @@ -139,6 +139,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.