Salome HOME
Fix for issue #2423: verify that maximal degree in Filling is enough to interpolate...
authorazv <azv@opencascade.com>
Wed, 24 Jan 2018 16:22:42 +0000 (19:22 +0300)
committerazv <azv@opencascade.com>
Wed, 24 Jan 2018 16:22:42 +0000 (19:22 +0300)
src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp

index 338409aa5b32d38e8a04e18b0b94759f94ec8e8b..0dc3861f5af0ea5185352ed099e0bfb53d9a87a8 100644 (file)
@@ -97,7 +97,12 @@ void GeomAlgoAPI_Filling::buildByEdges()
 
   // a 'tolerance' is used to compare 2 knots
   aSection.Perform(Precision::PConfusion());
-  Handle(GeomFill_Line) aLine = new GeomFill_Line((int)aCurves.size());
+  int aNbCurves = (int)aCurves.size();
+  Handle(GeomFill_Line) aLine = new GeomFill_Line(aNbCurves);
+
+  // check myMaxDegree >= aCurves.size() - 1 to be able to interpolate a surface
+  if (myMaxDegree + 1 < aNbCurves)
+    return;
 
   // perform filling by sections
   GeomFill_AppSurf anAppSurf(myMinDegree, myMaxDegree, myTol3D, myTol2D, myNbIter);