for(a = anInter.NbPoints(); a > 0; a--)
{
aPoint = anInter.Point(a);
- if (aPoint.Distance(theStart) < aTol)
- if (!theStartConnected)
- return Standard_True;
- if (aPoint.Distance(theEnd) < aTol)
+ if ( aPoint.Distance(theStart) < aTol && !theStartConnected )
+ return Standard_True;
+ if (aPoint.Distance(theEnd) < aTol * 200)
return Standard_True;
if (gp_Vec2d(aPoint, theStart).IsOpposite(gp_Vec2d(aPoint, theEnd), anAngTol))
return Standard_True;
}
Standard_Real aDX = theRight->GetParam() - theLeft->GetParam();
- if (aDX < gp::Resolution()/*Precision::Confusion() / 1000000.*/)
+ if ( aDX < Precision::Confusion() / 1000000.)
{
a = theRight->HasSolution(myRadius);
if (a)
{
Standard_Integer aNear = theLeft->GetNear(a);
- Standard_Real aA = (theRight->GetDiff(aNear) - theLeft->GetDiff(a)) / aDX;
+ Standard_Real aA = (theRight->GetDiff(aNear) - theLeft->GetDiff(a)) / aDX;
Standard_Real aB = theLeft->GetDiff(a) - aA * theLeft->GetParam();
Standard_Real aC = theLeft->GetValue(a) - theLeft->GetDiff(a) * theLeft->GetParam() +
aA * theLeft->GetParam() * theLeft->GetParam() / 2.0;
Standard_Real aDet = aB * aB - 2.0 * aA * aC;
+
+ if ( fabs(aDet) < gp::Resolution() )
+ continue;
if (fabs(aA) < Precision::Confusion())
{ // linear case
for(a = 1; a <= myV.Length(); a++)
{
aDY = thePoint->myV.Value(a) - myV.Value(a);
- if (aDiffsSet)
- myD.SetValue(a, aDY / aDX);
- else
- myD.Append(aDY / aDX);
+ if ( aDiffsSet )
+ myD.SetValue(a, fabs(aDX) > gp::Resolution() ? (aDY/aDX) : 0);
+ else
+ myD.Append( fabs(aDX) > gp::Resolution() ? (aDY/aDX) : 0);
}
return Standard_True;
}
}
if (aDiffsSet)
{
- if (fabs(aDY / aDX) < fabs(myD.Value(a)))
+ if ( fabs(aDX) > gp::Resolution() && fabs(aDY / aDX) < fabs(myD.Value(a)))
myD.SetValue(a, aDY / aDX);
+ else
+ myD.SetValue(a, 0);
}
else
{
- myD.Append(aDY / aDX);
+ myD.Append( fabs(aDX) > gp::Resolution() ? aDY/aDX : 0);
}
}
if (aNear)
{
- if (fabs(aDiff / aDX) > 1.e+7)
+ if ( fabs(aDX) < gp::Resolution() || fabs(aDiff / aDX) > 1.e+7)
{
aNear = 0;
}
Handle(GEOM_Function) aRefShape = aCI.GetShape();
TopoDS_Shape aShape = aRefShape->GetValue();
+ if (aShape.IsNull())
+ return 0;
if (aShape.ShapeType() != TopAbs_WIRE)
Standard_ConstructionError::Raise("Wrong arguments: polyline as wire must be given");
double rad = aCI.GetR();
+ if ( rad < Precision::Confusion())
+ return 0;
+
// collect vertices for make fillet
TopTools_ListOfShape aVertexList;
TopTools_MapOfShape mapShape;