From: vsr Date: Tue, 19 Oct 2010 14:00:27 +0000 (+0000) Subject: 0021036: EDF 1633 GEOM: A degenerated edge is created in Fillet_1D X-Git-Tag: V5_1_5rc1~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=99388a9c6422c610988a38acc8567d5fd48fa5e1;p=modules%2Fgeom.git 0021036: EDF 1633 GEOM: A degenerated edge is created in Fillet_1D --- diff --git a/src/GEOMImpl/GEOMImpl_Fillet1d.cxx b/src/GEOMImpl/GEOMImpl_Fillet1d.cxx index 0a3af9f8b..cafc9bd78 100644 --- a/src/GEOMImpl/GEOMImpl_Fillet1d.cxx +++ b/src/GEOMImpl/GEOMImpl_Fillet1d.cxx @@ -504,18 +504,15 @@ TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint, else anEnd = aNearest->GetParam(); - //Check the case when start and end are identical. This happens - //when the edge decreases to size 0. Old ww5 allows such - //cases. So we are again bug compatible - if (fabs(aStart - anEnd) < Precision::PConfusion()/*gp::Resolution()*/) - anEnd = 0.01; - //Divide edge - BRepBuilderAPI_MakeEdge aDivider1(aCurve, aStart, anEnd); - if (myEdgesExchnged) - theEdge2 = aDivider1.Edge(); - else - theEdge1 = aDivider1.Edge(); - + if (fabs(aStart - anEnd) > Precision::Confusion()) + { + //Divide edge + BRepBuilderAPI_MakeEdge aDivider1(aCurve, aStart, anEnd); + if (myEdgesExchnged) + theEdge2 = aDivider1.Edge(); + else + theEdge1 = aDivider1.Edge(); + } aCurve = BRep_Tool::Curve(myEdge2, aStart, anEnd); aCurve->D1(aNearest->GetParam2(), aPoint2, aDir); @@ -526,16 +523,14 @@ TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint, else anEnd = aNearest->GetParam2(); - //Check the case when start and end are identical. This happens - //when the edge decreases to size 0. Old ww5 allows such - //cases. So we are again bug compatible - if (fabs(aStart - anEnd) < Precision::PConfusion()/*gp::Resolution()*/) - anEnd = 0.01; - BRepBuilderAPI_MakeEdge aDivider2(aCurve, aStart, anEnd); - if (myEdgesExchnged) - theEdge1 = aDivider2.Edge(); - else - theEdge2 = aDivider2.Edge(); + if (fabs(aStart - anEnd) > Precision::Confusion()) + { + BRepBuilderAPI_MakeEdge aDivider2(aCurve, aStart, anEnd); + if (myEdgesExchnged) + theEdge1 = aDivider2.Edge(); + else + theEdge2 = aDivider2.Edge(); + } delete aNearest; return aResult; diff --git a/src/GEOMImpl/GEOMImpl_Fillet1dDriver.cxx b/src/GEOMImpl/GEOMImpl_Fillet1dDriver.cxx index 1056f0108..d173fba61 100644 --- a/src/GEOMImpl/GEOMImpl_Fillet1dDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_Fillet1dDriver.cxx @@ -235,9 +235,9 @@ Standard_Integer GEOMImpl_Fillet1dDriver::Execute(TFunction_Logbook& log) const // check if face edges modified, // if yes, than map to original edges (from vertex-edges list), because edges can be modified before - if (!aModifE1.IsNull() && !aModifE1.IsSame( anEdge1 )) + if (aModifE1.IsNull() || !anEdge1.IsSame( aModifE1 )) addEdgeRelation( anEdgeToEdgeMap, TopoDS::Edge(aVertexEdges.First()), aModifE1 ); - if (!aModifE2.IsNull() && !aModifE2.IsSame( anEdge2 )) + if (aModifE2.IsNull() || !anEdge2.IsSame( aModifE2 )) addEdgeRelation( anEdgeToEdgeMap, TopoDS::Edge(aVertexEdges.Last()), aModifE2 ); } @@ -251,7 +251,7 @@ Standard_Integer GEOMImpl_Fillet1dDriver::Execute(TFunction_Logbook& log) const TopoDS_Shape anEdge = anExp.Current(); if ( !anEdgeToEdgeMap.IsBound( anEdge ) ) aListOfNewEdge.Append( anEdge ); - else + else if (!anEdgeToEdgeMap.Find( anEdge ).IsNull()) aListOfNewEdge.Append( anEdgeToEdgeMap.Find( anEdge ) ); }