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);
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;
// 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 );
}
TopoDS_Shape anEdge = anExp.Current();
if ( !anEdgeToEdgeMap.IsBound( anEdge ) )
aListOfNewEdge.Append( anEdge );
- else
+ else if (!anEdgeToEdgeMap.Find( anEdge ).IsNull())
aListOfNewEdge.Append( anEdgeToEdgeMap.Find( anEdge ) );
}