From: nds Date: Tue, 24 Dec 2013 12:16:39 +0000 (+0000) Subject: Refs #276 - Closed spline consisting from 2 points has no edge X-Git-Tag: BR_hydro_v_0_7~69 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=800bae800a1ae13ab1012dbe9e21fb84a00a3484;p=modules%2Fhydro.git Refs #276 - Closed spline consisting from 2 points has no edge --- diff --git a/src/HYDROCurveCreator/CurveCreator_Utils.cxx b/src/HYDROCurveCreator/CurveCreator_Utils.cxx index 322d856e..7be2d6b3 100644 --- a/src/HYDROCurveCreator/CurveCreator_Utils.cxx +++ b/src/HYDROCurveCreator/CurveCreator_Utils.cxx @@ -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() )