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;
//
}
bRet = Standard_False;
aNbItMax = 15;
+ anEps = Precision::SquareConfusion();
//
GeomAPI_ProjectPointOnSurf& aProj=theContext->ProjPS(aF);
//
aPS=aProjPL.NearestPoint();
//
aPS.SetXYZ(aPS.XYZ()+2.*aTolE*aDB.XYZ());
- aProj.Perform(aPS);
+ aProj.Perform(aPS);
if (!aProj.IsDone()) {
return bRet;
}
aProjPL.Perform(aPS);
aPS=aProjPL.NearestPoint();
//
- //
do {
aP1.SetXYZ(aPS.XYZ()+aDt*aDB.XYZ());
//
aPOut = aProjPL.NearestPoint();
//
gp_Vec aV(aPS, aPOut);
+ if (aV.SquareMagnitude() < anEps) {
+ return bRet;
+ }
aDB.SetXYZ(aV.XYZ());
} while (aDist > aDTol && --aNbItMax);
//
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) {
--- /dev/null
+puts "=========="
+puts "OCC25600"
+puts "=========="
+puts ""
+####################################################
+# Wrong result of Boolean FUSE operation
+####################################################
+
+restore [locate_data_file bug25600_helix_pipe.brep] b1
+restore [locate_data_file bug25600_sphere_2.brep] b2
+
+bclearobjects
+bcleartools
+baddobjects b1
+baddtools b2
+bfillds -s
+bbop result 1
+
+set square 12.2258
+
+set nb_v_good 3
+set nb_e_good 6
+set nb_w_good 3
+set nb_f_good 3
+set nb_sh_good 1
+set nb_sol_good 1
+set nb_compsol_good 0
+set nb_compound_good 1
+set nb_shape_good 18
+
+set 2dviewer 1