1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

Modeling - NURB Convert fix for degenerated #295

Fix logic for processing degenerated edges in NewPolygon function
This commit is contained in:
dpasukhi 2025-01-28 10:41:23 +00:00
parent 16d112481e
commit 78fb1869fe

View File

@ -515,15 +515,16 @@ Standard_Boolean BRepTools_NurbsConvertModification::NewPolygon(const TopoDS_Edg
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
if (aCurve.IsNull() || aNewCurve.IsNull()) // skip processing degenerated edges
{
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;
}
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;