Salome HOME
Minor changes.
[modules/hydro.git] / src / HYDROCurveCreator / CurveCreator_Utils.cxx
index 322d856e523dc247d833bfe7f8774d38c5466602..7be2d6b379927d604455637c003b95cf18f3bb6d 100644 (file)
@@ -225,7 +225,13 @@ void CurveCreator_Utils::constructShape( const CurveCreator_ICurve* theCurve,
         // compute BSpline
         Handle(Geom_BSplineCurve) aBSplineCurve;
         GeomAPI_Interpolate aGBC(aHCurvePoints, aSectIsClosed, gp::Resolution());
-        aGBC.Load(aTangents, aTangentFlags);
+        // correct the spline degree to be as 3 for non-periodic spline if number of points
+        // less than 3. It is need to have a knot in each spline point. This knots are used
+        // to found a neighbour points when a new point is inserted between two existing.
+        if (!aSectIsClosed ) {
+          if (aHCurvePoints->Length() == 3)
+            aGBC.Load(aTangents, aTangentFlags);
+        }
 
         aGBC.Perform();
         if ( aGBC.IsDone() )