X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FGeomAlgoImpl%2FGEOMImpl_Fillet1d.cxx;h=4f462b0c58b98714c56d4c1196be820875a0c537;hb=59610176acaef6df307f9a2ec24fe3a14bfaef0b;hp=b9aef213c74f7e97bd693df1757067e6d5338494;hpb=a0fa395fd2a0ddb16cb9aed4dab180f2681b4447;p=modules%2Fshaper.git diff --git a/src/GeomAlgoImpl/GEOMImpl_Fillet1d.cxx b/src/GeomAlgoImpl/GEOMImpl_Fillet1d.cxx index b9aef213c..4f462b0c5 100644 --- a/src/GeomAlgoImpl/GEOMImpl_Fillet1d.cxx +++ b/src/GeomAlgoImpl/GEOMImpl_Fillet1d.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -578,7 +578,7 @@ TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint, aTargetPoint2d.SetCoord(aX, aY); // choose the nearest circle - Standard_Real aDistance, aP; + Standard_Real aDistance = Precision::Infinite(); GEOMImpl_Fillet1dPoint *aNearest; Standard_Integer a; TColStd_ListIteratorOfListOfReal anIter(myResultParams); @@ -589,7 +589,7 @@ TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint, fillPoint(aPoint); if (!aPoint->HasSolution(myRadius)) continue; - aP = fabs(aPoint->GetCenter().Distance(aTargetPoint2d) - myRadius); + Standard_Real aP = fabs(aPoint->GetCenter().Distance(aTargetPoint2d) - myRadius); if (!aNearest || aP < aDistance) { aNearest = aPoint; @@ -664,6 +664,10 @@ TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint, else theEdge1 = aDivider1.Edge(); } + else { + // error: filleted edge becomes degenerated + aResult = TopoDS_Edge(); + } aCurve = BRep_Tool::Curve(myEdge2, aStart, anEnd); aCurve->D1(aNearest->GetParam2(), aPoint2, aDir); @@ -682,6 +686,10 @@ TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint, else theEdge2 = aDivider2.Edge(); } + else { + // error: filleted edge becomes degenerated + aResult = TopoDS_Edge(); + } delete aNearest; return aResult; @@ -715,7 +723,7 @@ Standard_Boolean GEOMImpl_Fillet1dPoint::ComputeDifference(GEOMImpl_Fillet1dPoin { Standard_Integer a; Standard_Boolean aDiffsSet = (myD.Length() != 0); - Standard_Real aDX = thePoint->GetParam() - myParam, aDY; + Standard_Real aDX = thePoint->GetParam() - myParam, aDY = 0.0; if (thePoint->myV.Length() == myV.Length()) { // absolutely the same points for(a = 1; a <= myV.Length(); a++)