From: azv Date: Tue, 28 Jul 2020 15:48:16 +0000 (+0300) Subject: Issue #3279: Incorrect result of 1D-Fillet with boundary value of radius X-Git-Tag: V9_6_0a1~37 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=63d86e00e1e6a482fcad527ae0b883deccceed11;p=modules%2Fshaper.git Issue #3279: Incorrect result of 1D-Fillet with boundary value of radius Additional check if the fillet edge eats the original edges. --- diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Fillet1D.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Fillet1D.cpp index 440822088..e937beab9 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Fillet1D.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Fillet1D.cpp @@ -110,15 +110,21 @@ void GeomAlgoAPI_Fillet1D::build(const GeomShapePtr& theBaseWire, // create fillet builder GEOMImpl_Fillet1d aFilletBuilder(anEdge1, anEdge2, aPlane->impl()); - if (!aFilletBuilder.Perform(theRadius)) { - // store the failed vertex and continue + bool isOk = aFilletBuilder.Perform(theRadius); + TopoDS_Edge aFilletEdge; + if (isOk) { + GeomPointPtr aPoint = aVE->first->vertex()->point(); + aFilletEdge = aFilletBuilder.Result(aPoint->impl(), anEdge1, anEdge2); + isOk = !aFilletEdge.IsNull(); + } + + if (!isOk) { + // something gone wrong and the fillet edge is not constructed, + // just store the failed vertex and continue myFailedVertices.push_back(*aVIt); continue; } - GeomPointPtr aPoint = aVE->first->vertex()->point(); - TopoDS_Edge aFilletEdge = aFilletBuilder.Result(aPoint->impl(), anEdge1, anEdge2); - // store modified shapes myGenerated[aVE->first].push_back(convert(aFilletEdge)); SetOfShapes::const_iterator aEIt = aVE->second.begin(); diff --git a/src/GeomAlgoImpl/GEOMImpl_Fillet1d.cxx b/src/GeomAlgoImpl/GEOMImpl_Fillet1d.cxx index 6ed7b3eac..3f3c2d74e 100644 --- a/src/GeomAlgoImpl/GEOMImpl_Fillet1d.cxx +++ b/src/GeomAlgoImpl/GEOMImpl_Fillet1d.cxx @@ -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;