diff --git a/src/BOPTools/BOPTools_AlgoTools.cxx b/src/BOPTools/BOPTools_AlgoTools.cxx index 1594f27b24..f24ef626f4 100644 --- a/src/BOPTools/BOPTools_AlgoTools.cxx +++ b/src/BOPTools/BOPTools_AlgoTools.cxx @@ -99,7 +99,8 @@ static gp_Pnt& aPOut, Handle(IntTools_Context)& theContext, GeomAPI_ProjectPointOnSurf& aProjPL, - const Standard_Real aDt); + const Standard_Real aDt, + const Standard_Real aTolE); static Standard_Real MinStep3D(const TopoDS_Edge& theE1, const TopoDS_Face& theF1, @@ -1825,14 +1826,18 @@ void GetFaceDir(const TopoDS_Edge& aE, GeomAPI_ProjectPointOnSurf& aProjPL, const Standard_Real aDt) { + Standard_Real aTolE; + gp_Pnt aPx; + // BOPTools_AlgoTools3D::GetNormalToFaceOnEdge(aE, aF, aT, aDN); if (aF.Orientation()==TopAbs_REVERSED){ aDN.Reverse(); } + // + aTolE=BRep_Tool::Tolerance(aE); aDB = aDN^aDTgt; // - gp_Pnt aPx; - if (!FindPointInFace(aF, aP, aDB, aPx, theContext, aProjPL, aDt)) { + if (!FindPointInFace(aF, aP, aDB, aPx, theContext, aProjPL, aDt, aTolE)) { BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge(aE, aF, aT, aPx, aDN, theContext); aProjPL.Perform(aPx); @@ -1841,7 +1846,6 @@ void GetFaceDir(const TopoDS_Edge& aE, aDB.SetXYZ(aVec.XYZ()); } } - //======================================================================= //function : FindPointInFace //purpose : Find a point in the face in direction of @@ -1852,12 +1856,13 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF, gp_Pnt& aPOut, Handle(IntTools_Context)& theContext, GeomAPI_ProjectPointOnSurf& aProjPL, - const Standard_Real aDt) + const Standard_Real aDt, + const Standard_Real aTolE) { Standard_Integer aNbItMax; Standard_Real aDist, aDTol, aPM; Standard_Boolean bRet; - gp_Pnt aP1; + gp_Pnt aP1, aPS; // aDTol = Precision::Angular(); aPM = aP.XYZ().Modulus(); @@ -1869,10 +1874,27 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF, // GeomAPI_ProjectPointOnSurf& aProj=theContext->ProjPS(aF); // + aPS=aP; + aProj.Perform(aPS); + if (!aProj.IsDone()) { + return bRet; + } + aPS=aProj.NearestPoint(); + aProjPL.Perform(aPS); + aPS=aProjPL.NearestPoint(); + // + aPS.SetXYZ(aPS.XYZ()+2.*aTolE*aDB.XYZ()); + aProj.Perform(aPS); + if (!aProj.IsDone()) { + return bRet; + } + aPS=aProj.NearestPoint(); + aProjPL.Perform(aPS); + aPS=aProjPL.NearestPoint(); + // + // do { - aP1.SetCoord(aP.X()+aDt*aDB.X(), - aP.Y()+aDt*aDB.Y(), - aP.Z()+aDt*aDB.Z()); + aP1.SetXYZ(aPS.XYZ()+aDt*aDB.XYZ()); // aProj.Perform(aP1); if (!aProj.IsDone()) { @@ -1884,7 +1906,7 @@ Standard_Boolean FindPointInFace(const TopoDS_Face& aF, aProjPL.Perform(aPOut); aPOut = aProjPL.NearestPoint(); // - gp_Vec aV(aP, aPOut); + gp_Vec aV(aPS, aPOut); aDB.SetXYZ(aV.XYZ()); } while (aDist > aDTol && --aNbItMax); // @@ -2006,8 +2028,8 @@ Standard_Boolean BOPTools_AlgoTools::IsOpenShell(const TopoDS_Shell& aSh) //function : IsInvertedSolid //purpose : //======================================================================= -Standard_Boolean - BOPTools_AlgoTools::IsInvertedSolid(const TopoDS_Solid& aSolid) +Standard_Boolean BOPTools_AlgoTools::IsInvertedSolid + (const TopoDS_Solid& aSolid) { Standard_Real aTolS; TopAbs_State aState; diff --git a/tests/boolean/bcut_complex/N9 b/tests/boolean/bcut_complex/N9 index a8dbbd3189..2160d785ae 100644 --- a/tests/boolean/bcut_complex/N9 +++ b/tests/boolean/bcut_complex/N9 @@ -1,8 +1,8 @@ # Original bug : pro14942 # Date : 26Aout98 -#CR23958 puts "TODO #22911 ALL: Faulty shapes in variables faulty_1 to faulty_" -#CR23958 puts "TODO #22911 ALL: Error : The area of the resulting shape is" +puts "TODO #22911 ALL: Faulty shapes in variables faulty_1 to faulty_" +puts "TODO #22911 ALL: Error : The area of the resulting shape is" restore [locate_data_file CTO904_pro14942a.rle] a restore [locate_data_file pro14942b.rle] b diff --git a/tests/boolean/bfuse_complex/P1 b/tests/boolean/bfuse_complex/P1 index cc85ebf969..1438afa6ba 100644 --- a/tests/boolean/bfuse_complex/P1 +++ b/tests/boolean/bfuse_complex/P1 @@ -1,4 +1,5 @@ puts "TODO ?OCC24157 ALL: Error : The area of the resulting shape is" +puts "TODO #22911 ALL: Faulty shapes in variables faulty_1 to faulty_" # cts17861 restore [locate_data_file CTO900_cts17861a.rle] a diff --git a/tests/boolean/bopcommon_complex/J1 b/tests/boolean/bopcommon_complex/J1 old mode 100644 new mode 100755 index fe368bff81..7ca6e583cf --- a/tests/boolean/bopcommon_complex/J1 +++ b/tests/boolean/bopcommon_complex/J1 @@ -1,3 +1,6 @@ +puts "TODO #22911 ALL: Error : The bopcommon is not valid. The area is" +puts "TODO #22911 ALL: Error : The area of the resulting shape is" + restore [locate_data_file a158] a restore [locate_data_file b148] b diff --git a/tests/bugs/modalg_2/bug472_3 b/tests/bugs/modalg_2/bug472_3 index 1e67122a87..d76522f905 100755 --- a/tests/bugs/modalg_2/bug472_3 +++ b/tests/bugs/modalg_2/bug472_3 @@ -1,7 +1,7 @@ #puts "TODO OCC12345 ALL: Faulty shapes in variables faulty_1 to faulty_" #puts "TODO OCC12345 ALL: Error : The square of result shape is" -puts "TODO OCC12345 ALL: Error : The command is not valid" -puts "TODO OCC12345 ALL: Error : Result shape is WRONG because it must contains" +#puts "TODO OCC12345 ALL: Error : The command is not valid" +#puts "TODO OCC12345 ALL: Error : Result shape is WRONG because it must contains" puts "========================" puts " OCC472 " @@ -20,8 +20,8 @@ checkshape b2 bfuse result b1 b2 -set nb_v_good 5 -set nb_e_edge 7 -set square 0 +set nb_v_good 66 +set nb_e_edge 107 +set square 31657.5 set 2dviewer 0 diff --git a/tests/bugs/modalg_5/bug24154 b/tests/bugs/modalg_5/bug24154 index fe2550e50b..abe5d0fd21 100644 --- a/tests/bugs/modalg_5/bug24154 +++ b/tests/bugs/modalg_5/bug24154 @@ -12,18 +12,19 @@ restore [locate_data_file bug24154_b.brep] b2 bop b1 b2 bopcut result -set square 2.68434e+06 +#set square 2.68434e+06 +set square 5.21269e+06 set volume 7.35468e+07 # Analysis of "nbshapes res" set nb_v_good 18 -set nb_e_good 27 -set nb_w_good 11 -set nb_f_good 11 +set nb_e_good 36 +set nb_w_good 18 +set nb_f_good 18 set nb_sh_good 1 set nb_sol_good 1 set nb_compsol_good 0 set nb_compound_good 1 -set nb_shape_good 70 +set nb_shape_good 93 set 2dviewer 1 diff --git a/tests/bugs/modalg_5/bug25432 b/tests/bugs/modalg_5/bug25432 new file mode 100644 index 0000000000..c0baa1686e --- /dev/null +++ b/tests/bugs/modalg_5/bug25432 @@ -0,0 +1,33 @@ +puts "============" +puts "OCC25432" +puts "============" +puts "" +######################################################################### +# Wrong result obtained by MakerVolume operator. +######################################################################### + +restore [locate_data_file bug25432_qz.brep] q + +explode q f +mkvolume result q_1 q_2 q_3 q_4 q_5 q_6 q_7 q_8 q_9 q_10 q_11 -ni + +regexp {Mass +: +([-0-9.+eE]+)} [vprops result] full volume + +set expected_volume 0.26776 +set tol_abs_volume 1.0e-4 +set tol_rel_volume 0.0001 +checkreal "Volume" ${volume} ${expected_volume} ${tol_abs_volume} ${tol_rel_volume} + +set square 3.59972 + +set nb_v_good 12 +set nb_e_good 20 +set nb_w_good 11 +set nb_f_good 11 +set nb_sh_good 2 +set nb_sol_good 2 +set nb_compsol_good 0 +set nb_compound_good 1 +set nb_shape_good 59 + +set 2dviewer 1 diff --git a/tests/bugs/moddata_2/bug26_1 b/tests/bugs/moddata_2/bug26_1 index 476c818ee8..9179ba8ae6 100755 --- a/tests/bugs/moddata_2/bug26_1 +++ b/tests/bugs/moddata_2/bug26_1 @@ -1,3 +1,5 @@ +puts "TODO CR25432 ALL: Error : The square of result shape is" + puts "================" puts "OCC26" puts "================" diff --git a/tests/bugs/moddata_2/bug26_2 b/tests/bugs/moddata_2/bug26_2 index ef87c178b5..c9f5ec6105 100755 --- a/tests/bugs/moddata_2/bug26_2 +++ b/tests/bugs/moddata_2/bug26_2 @@ -1,3 +1,5 @@ +puts "TODO CR25432 ALL: Error : The square of result shape is" + puts "================" puts "OCC26" puts "================"