]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/GeomAlgoAPI/GeomAlgoAPI_Fillet1D.cpp
Salome HOME
Issue #3279: Incorrect result of 1D-Fillet with boundary value of radius
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_Fillet1D.cpp
index 440822088b3ee32b7c07e1dff2e231d413061659..e937beab9164e29f7b2fd91a5cbd178bf9b9cc59 100644 (file)
@@ -110,15 +110,21 @@ void GeomAlgoAPI_Fillet1D::build(const GeomShapePtr& theBaseWire,
 
     // create fillet builder
     GEOMImpl_Fillet1d aFilletBuilder(anEdge1, anEdge2, aPlane->impl<gp_Pln>());
-    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<gp_Pnt>(), 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<gp_Pnt>(), anEdge1, anEdge2);
-
     // store modified shapes
     myGenerated[aVE->first].push_back(convert(aFilletEdge));
     SetOfShapes::const_iterator aEIt = aVE->second.begin();