diff --git a/src/BRepTools/BRepTools_NurbsConvertModification.cxx b/src/BRepTools/BRepTools_NurbsConvertModification.cxx index 57e4d9806d..d2f47f8496 100644 --- a/src/BRepTools/BRepTools_NurbsConvertModification.cxx +++ b/src/BRepTools/BRepTools_NurbsConvertModification.cxx @@ -508,24 +508,25 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewPolygon(const TopoDS_Edg return Standard_False; } - // update parameters of polygon - if (thePoly->HasParameters()) + if (!thePoly->HasParameters()) { - Standard_Real aTol = BRep_Tool::Tolerance(theEdge); - Standard_Real aFirst, aLast; - Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theEdge, aFirst, aLast); - Handle(Geom_Curve) aNewCurve = newCurve(myMap, theEdge, aFirst, aLast); - if (aCurve.IsNull() || aNewCurve.IsNull()) // skip processing degenerated edges - { - return Standard_False; - } - TColStd_Array1OfReal& aParams = thePoly->ChangeParameters(); - for (Standard_Integer anInd = aParams.Lower(); anInd <= aParams.Upper(); ++anInd) - { - Standard_Real& aParam = aParams(anInd); - gp_Pnt aPoint = aCurve->Value(aParam); - newParameter(aPoint, aNewCurve, aFirst, aLast, aTol, aParam); - } + return Standard_False; + } + // update parameters of polygon + Standard_Real aTol = BRep_Tool::Tolerance(theEdge); + Standard_Real aFirst, aLast; + Handle(Geom_Curve) aCurve = BRep_Tool::Curve(theEdge, aFirst, aLast); + Handle(Geom_Curve) aNewCurve = newCurve(myMap, theEdge, aFirst, aLast); + if (aCurve.IsNull() || aNewCurve.IsNull()) // skip processing degenerated edges + { + return Standard_False; + } + TColStd_Array1OfReal& aParams = thePoly->ChangeParameters(); + for (Standard_Integer anInd = aParams.Lower(); anInd <= aParams.Upper(); ++anInd) + { + Standard_Real& aParam = aParams(anInd); + gp_Pnt aPoint = aCurve->Value(aParam); + newParameter(aPoint, aNewCurve, aFirst, aLast, aTol, aParam); } return Standard_True; }