From 934f47b645a3047da36bf5f74b7d4e23fb4e28d4 Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 24 Jan 2018 19:22:42 +0300 Subject: [PATCH] Fix for issue #2423: verify that maximal degree in Filling is enough to interpolate given number of section. --- src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp index 338409aa5..0dc3861f5 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp @@ -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); -- 2.39.2