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

0028909: Algorithm of BO is stuck while fusing shell and edges

Approximation parameters: degmin, degmax, max number of segments, boundary condition, maximal distance of projecting are added in interface of classes ProjLib_ProjectedCurve, ProjLib_ComputeApprox,
ProjLib_ComputeApproxOnPolarSurface
Algorithm of Approx/Approx_ComputeCLine is modified in order to treat maximal number of segments allowed for cutting.
Algorithm of method BOPTools_AlgoTools2D::MakePCurveOnFace(...) is modified in order to manage cases with big edge tolerances.
Test case added
Some test cases were modified according to new behavior of algorithms
This commit is contained in:
ifv
2017-07-11 10:15:28 +03:00
committed by bugmaster
parent 23e8067c74
commit f998596a10
17 changed files with 743 additions and 163 deletions

View File

@@ -629,11 +629,13 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
Handle(GeomAdaptor_HCurve) aBAHC = new GeomAdaptor_HCurve(aC3D, aT1, aT2);
//
Standard_Real aTolR;
Standard_Real aTR = Precision::Confusion();//1.e-7;
Standard_Real aMaxTol = 1.e3 * aTR; //0.0001
Standard_Boolean isAnaSurf = ProjLib::IsAnaSurf(aBAHS);
//when the type of surface is GeomAbs_SurfaceOfRevolution
if (pBAS->GetType() == GeomAbs_SurfaceOfRevolution) {
Standard_Real aTR;
//
aTR=Precision::Confusion();//1.e-7;
if (pBAS->GetType() == GeomAbs_SurfaceOfRevolution)
{
if (TolReached2d > aTR) {
aTR=TolReached2d;
}
@@ -642,23 +644,44 @@ void BOPTools_AlgoTools2D::MakePCurveOnFace
ProjLib::MakePCurveOfType(aProj1, aC2D);
aTolR = aProj1.GetTolerance();
}
else {
ProjLib_ProjectedCurve aProjCurv(aBAHS, aBAHC);// 1
else
{
ProjLib_ProjectedCurve aProjCurv(aBAHS);
Standard_Integer aDegMin = -1, aDegMax = -1, aMaxSegments = -1;
Standard_Real aMaxDist = -1;
AppParCurves_Constraint aBndPnt = AppParCurves_TangencyPoint;
if ((TolReached2d >= 10. * aTR) && (TolReached2d <= aMaxTol || isAnaSurf))
{
aTR = Min(aMaxTol, 0.1*TolReached2d);
aMaxSegments = 100;
aMaxDist = 1.e3*TolReached2d;
if(!isAnaSurf)
{
aBndPnt = AppParCurves_PassPoint;
}
}
else if(TolReached2d > aMaxTol)
{
aTR = Min(TolReached2d, 1.e3 * aMaxTol);
aMaxDist = 1.e2 * aTR;
aMaxSegments = 100;
}
aProjCurv.Load(aTR);
aProjCurv.SetDegree(aDegMin, aDegMax);
aProjCurv.SetMaxSegments(aMaxSegments);
aProjCurv.SetBndPnt(aBndPnt);
aProjCurv.SetMaxDist(aMaxDist);
aProjCurv.Perform(aBAHC);
ProjLib::MakePCurveOfType(aProjCurv, aC2D);
aTolR=aProjCurv.GetTolerance();
}
//
if (aC2D.IsNull()) {
ProjLib_ProjectedCurve aProjCurvAgain(aBAHS, aBAHC, TolReached2d);// 2
if (aC2D.IsNull() && (aTR < aMaxTol || aTR < TolReached2d))
{
aTR = Max(TolReached2d, aMaxTol);
ProjLib_ProjectedCurve aProjCurvAgain(aBAHS, aBAHC, aTR);// 2
ProjLib::MakePCurveOfType(aProjCurvAgain, aC2D);
aTolR = aProjCurvAgain.GetTolerance();
//
if (aC2D.IsNull()) {
Standard_Real aTR=0.0001;
ProjLib_ProjectedCurve aProj3(aBAHS, aBAHC, aTR);// 3
ProjLib::MakePCurveOfType(aProj3, aC2D);
aTolR = aProj3.GetTolerance();
}
}
//
if(aC2D.IsNull())