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

0025600: Wrong result of Boolean FUSE operation

class BOPTools_AlgoTools
1. method Standard_Boolean FindPointInFace(const TopoDS_Face& aF,
                                 const gp_Pnt& aP,
                                 gp_Dir& aDB,
                                 gp_Pnt& aPOut,
                                 Handle(IntTools_Context)& theContext,
                                 GeomAPI_ProjectPointOnSurf& aProjPL,
                                 const Standard_Real aDt,
                                 const Standard_Real aTolE)
Use different method of finding a point in the face if the start and projected points are close to each other.

2. method Standard_Real MinStep3D(const TopoDS_Edge& theE1,
                        const TopoDS_Face& theF1,
                        const BOPTools_ListOfCoupleOfShape& theLCS,
                        const gp_Pnt& aP)
The min 3D step has been increased for the spherical faces.

Test case for issue CR25600

Correction of test case for issue CR25600
This commit is contained in:
emv
2014-12-25 18:08:44 +03:00
committed by bugmaster
parent 7c32c7c41f
commit b9f6147d75
3 changed files with 57 additions and 18 deletions

View File

@@ -1860,7 +1860,7 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF,
const Standard_Real aTolE)
{
Standard_Integer aNbItMax;
Standard_Real aDist, aDTol, aPM;
Standard_Real aDist, aDTol, aPM, anEps;
Standard_Boolean bRet;
gp_Pnt aP1, aPS;
//
@@ -1871,6 +1871,7 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF,
}
bRet = Standard_False;
aNbItMax = 15;
anEps = Precision::SquareConfusion();
//
GeomAPI_ProjectPointOnSurf& aProj=theContext->ProjPS(aF);
//
@@ -1884,7 +1885,7 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF,
aPS=aProjPL.NearestPoint();
//
aPS.SetXYZ(aPS.XYZ()+2.*aTolE*aDB.XYZ());
aProj.Perform(aPS);
aProj.Perform(aPS);
if (!aProj.IsDone()) {
return bRet;
}
@@ -1892,7 +1893,6 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF,
aProjPL.Perform(aPS);
aPS=aProjPL.NearestPoint();
//
//
do {
aP1.SetXYZ(aPS.XYZ()+aDt*aDB.XYZ());
//
@@ -1907,6 +1907,9 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF,
aPOut = aProjPL.NearestPoint();
//
gp_Vec aV(aPS, aPOut);
if (aV.SquareMagnitude() < anEps) {
return bRet;
}
aDB.SetXYZ(aV.XYZ());
} while (aDist > aDTol && --aNbItMax);
//
@@ -1948,26 +1951,33 @@ Standard_Real MinStep3D(const TopoDS_Edge& theE1,
aR = 0.;
aBAS.Initialize(aF, Standard_False);
GeomAbs_SurfaceType aSType = aBAS.GetType();
if (aSType == GeomAbs_Cylinder) {
switch (aSType) {
case GeomAbs_Cylinder: {
aR = aBAS.Cylinder().Radius();
break;
}
else if (aSType == GeomAbs_Cone) {
case GeomAbs_Cone: {
gp_Lin aL(aBAS.Cone().Axis());
aR = aL.Distance(aP);
break;
}
else if (aSType == GeomAbs_Sphere) {
case GeomAbs_Sphere: {
aDtMin = Max(aDtMin, 5.e-4);
aR = aBAS.Sphere().Radius();
break;
}
else if (aSType == GeomAbs_Torus) {
case GeomAbs_Torus: {
aR = aBAS.Torus().MajorRadius();
break;
}
else if (aSType == GeomAbs_SurfaceOfRevolution) {
aDtMin = 5.e-4;
default:
aDtMin = Max(aDtMin, 5.e-4);
break;
}
//
if (aR > 100.) {
Standard_Real d = Precision::PConfusion();
aDtMin = sqrt(d*d + 2*d*aR);
Standard_Real d = 10*Precision::PConfusion();
aDtMin = Max(aDtMin, sqrt(d*d + 2*d*aR));
}
//
if (aDt > aDtMax) {