0021036: EDF 1633 GEOM: A degenerated edge is created in Fillet_1D

This commit is contained in:
vsr 2010-10-19 14:00:27 +00:00
parent 93a152798f
commit 99388a9c64
2 changed files with 20 additions and 25 deletions

View File

@ -504,18 +504,15 @@ TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint,
else else
anEnd = aNearest->GetParam(); anEnd = aNearest->GetParam();
//Check the case when start and end are identical. This happens if (fabs(aStart - anEnd) > Precision::Confusion())
//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 //Divide edge
BRepBuilderAPI_MakeEdge aDivider1(aCurve, aStart, anEnd); BRepBuilderAPI_MakeEdge aDivider1(aCurve, aStart, anEnd);
if (myEdgesExchnged) if (myEdgesExchnged)
theEdge2 = aDivider1.Edge(); theEdge2 = aDivider1.Edge();
else else
theEdge1 = aDivider1.Edge(); theEdge1 = aDivider1.Edge();
}
aCurve = BRep_Tool::Curve(myEdge2, aStart, anEnd); aCurve = BRep_Tool::Curve(myEdge2, aStart, anEnd);
aCurve->D1(aNearest->GetParam2(), aPoint2, aDir); aCurve->D1(aNearest->GetParam2(), aPoint2, aDir);
@ -526,16 +523,14 @@ TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint,
else else
anEnd = aNearest->GetParam2(); anEnd = aNearest->GetParam2();
//Check the case when start and end are identical. This happens if (fabs(aStart - anEnd) > Precision::Confusion())
//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); BRepBuilderAPI_MakeEdge aDivider2(aCurve, aStart, anEnd);
if (myEdgesExchnged) if (myEdgesExchnged)
theEdge1 = aDivider2.Edge(); theEdge1 = aDivider2.Edge();
else else
theEdge2 = aDivider2.Edge(); theEdge2 = aDivider2.Edge();
}
delete aNearest; delete aNearest;
return aResult; return aResult;

View File

@ -235,9 +235,9 @@ Standard_Integer GEOMImpl_Fillet1dDriver::Execute(TFunction_Logbook& log) const
// check if face edges modified, // check if face edges modified,
// if yes, than map to original edges (from vertex-edges list), because edges can be modified before // 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 ); 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 ); 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(); TopoDS_Shape anEdge = anExp.Current();
if ( !anEdgeToEdgeMap.IsBound( anEdge ) ) if ( !anEdgeToEdgeMap.IsBound( anEdge ) )
aListOfNewEdge.Append( anEdge ); aListOfNewEdge.Append( anEdge );
else else if (!anEdgeToEdgeMap.Find( anEdge ).IsNull())
aListOfNewEdge.Append( anEdgeToEdgeMap.Find( anEdge ) ); aListOfNewEdge.Append( anEdgeToEdgeMap.Find( anEdge ) );
} }