X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FCurveCreator%2FCurveCreator_Section.cxx;h=cb14becbf0bf630dd1e0718e7afae80a5f58b70a;hb=09ece3edc1896e16a412b35810d76411f06d68ec;hp=2b9beda578e425f79c1af0f5c09ace3732531b2f;hpb=c5226abebfe42b79d94cb0b36b05f6777702d0c0;p=modules%2Fgeom.git diff --git a/src/CurveCreator/CurveCreator_Section.cxx b/src/CurveCreator/CurveCreator_Section.cxx index 2b9beda57..cb14becbf 100644 --- a/src/CurveCreator/CurveCreator_Section.cxx +++ b/src/CurveCreator/CurveCreator_Section.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2013-2023 CEA, EDF, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -35,12 +35,19 @@ Handle(TColgp_HArray1OfPnt) CurveCreator_Section::GetDifferentPoints( int theDim Handle(TColgp_HArray1OfPnt) points; std::vector aTmpPoints; + CurveCreator::Coordinates::const_iterator aPIt = myPoints.begin(); CurveCreator::Coordinates::const_iterator aPItLast = myPoints.end(); - const gp_Pnt aFirstPoint( - *aPIt, *(aPIt + 1), (theDimension == 2) ? 0 : *(aPIt + 2)); - gp_Pnt aPoint = aFirstPoint; - aTmpPoints.push_back(aPoint); + + gp_Pnt aFirstPoint; + gp_Pnt aPoint; + + if( myPoints.size() > 0 ) + { + aFirstPoint = gp_Pnt(*aPIt, *(aPIt + 1), (theDimension == 2) ? 0 : *(aPIt + 2)); + aPoint = aFirstPoint; + aTmpPoints.push_back(aPoint); + } for (; aPIt != aPItLast; aPIt += theDimension) {