1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0026651: IntTools_FClass2d gives incorrect result of classification

This commit is contained in:
ifv
2015-09-11 14:01:45 +03:00
committed by bugmaster
parent eeec098631
commit cdf4594a46
4 changed files with 32 additions and 5 deletions

View File

@@ -39,7 +39,19 @@ Standard_Integer Geom2dInt_Geom2dCurveTool::NbSamples (const Adaptor2d_Curve2d&
nbs*= C.Degree();
Standard_Real anb = t1/t * nbs;
nbs = (Standard_Integer)anb;
if(nbs < 4.0) nbs=4;
if(nbs < 4) nbs=4;
}
else if (typC == GeomAbs_Circle)
{
//Try to reach deflection = eps*R, eps = 0.01
const Standard_Real minR = 1.; //eps = 0.01
Standard_Real R = C.Circle().Radius();
if(R > minR)
{
Standard_Real angl = 0.283079; //2.*ACos(1. - eps);
Standard_Integer n = RealToInt(Abs(U1 - U0) / angl);
nbs = Max(n, nbs);
}
}
if(nbs>300)
@@ -49,7 +61,22 @@ Standard_Integer Geom2dInt_Geom2dCurveTool::NbSamples (const Adaptor2d_Curve2d&
}
//============================================================
Standard_Integer Geom2dInt_Geom2dCurveTool::NbSamples (const Adaptor2d_Curve2d& C) {
return C.NbSamples();
Standard_Integer nbs = C.NbSamples();
GeomAbs_CurveType typC = C.GetType();
if (typC == GeomAbs_Circle)
{
//Try to reach deflection = eps*R, eps = 0.01
const Standard_Real minR = 1.; //eps = 0.01
Standard_Real R = C.Circle().Radius();
if(R > minR)
{
Standard_Real angl = 0.283079; //2.*ACos(1. - eps);
Standard_Integer n = RealToInt((C.LastParameter()-C.FirstParameter()) / angl);
nbs = Max(n, nbs);
}
}
return nbs;
}