]> OCCT Git - occt.git/commitdiff
0027032: [Regression to 6.9.1] Result of bcut has the same volume as the object
authormsv <msv@opencascade.com>
Mon, 28 Dec 2015 11:48:06 +0000 (14:48 +0300)
committerbugmaster <bugmaster@opencascade.com>
Wed, 13 Jan 2016 12:49:03 +0000 (15:49 +0300)
- Avoid reducing tolerance of the original edges in BOPAlgo_PaveFiller::CorrectToleranceOfSE
- If a boundary edge is considered coincident with a section curve then increase its tolerance more carefully, using real distance instead of extended reached tolerance.
- New test case bugs/modalg_6/bug27032
- Test cases boolean/gdml_private/E4-F3 have been amended to check area of the result.

- Puts TODO in test cases boolean gdml_private ZI5,ZI7,ZJ7.

17 files changed:
src/BOPAlgo/BOPAlgo_PaveFiller.hxx
src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx
src/IntTools/IntTools_Context.cxx
src/IntTools/IntTools_Context.hxx
tests/boolean/gdml_private/E4
tests/boolean/gdml_private/E5
tests/boolean/gdml_private/E6
tests/boolean/gdml_private/E7
tests/boolean/gdml_private/E8
tests/boolean/gdml_private/E9
tests/boolean/gdml_private/F1
tests/boolean/gdml_private/F2
tests/boolean/gdml_private/F3
tests/boolean/gdml_private/ZI5
tests/boolean/gdml_private/ZI7
tests/boolean/gdml_private/ZJ7
tests/bugs/modalg_6/bug27032 [new file with mode: 0644]

index ab440e4ae1bc183557ca13bbe701ca6d7e76dbd2..c9db7dc42676adaa4c4a5f623685d078c83e210f 100644 (file)
@@ -188,7 +188,10 @@ protected:
   
   Standard_EXPORT void PutBoundPaveOnCurve (const TopoDS_Face& theF1, const TopoDS_Face& theF2, const Standard_Real theTolR3D, BOPDS_Curve& theNC, BOPCol_ListOfInteger& theLBV);
   
-  Standard_EXPORT Standard_Boolean IsExistingPaveBlock (const Handle(BOPDS_PaveBlock)& thePB, const BOPDS_Curve& theNC, const Standard_Real theTolR3D, const BOPDS_IndexedMapOfPaveBlock& theMPB, Handle(BOPDS_PaveBlock)& thePBOut);
+  Standard_EXPORT Standard_Boolean IsExistingPaveBlock
+    (const Handle(BOPDS_PaveBlock)& thePB, const BOPDS_Curve& theNC,
+     const Standard_Real theTolR3D, const BOPDS_IndexedMapOfPaveBlock& theMPB,
+     Handle(BOPDS_PaveBlock)& thePBOut, Standard_Real& theTolNew);
   
   Standard_EXPORT Standard_Boolean IsExistingPaveBlock (const Handle(BOPDS_PaveBlock)& thePB, const BOPDS_Curve& theNC, const Standard_Real theTolR3D, const BOPCol_ListOfInteger& theLSE);
   
index e195bb1e983860208cecf55f332cd7edc9482752..bc973bddd340d0cc845a026c959eec49d0e63a5e 100644 (file)
@@ -521,7 +521,8 @@ void BOPAlgo_PaveFiller::MakeBlocks()
           continue;
         }
         //
-        bExist=IsExistingPaveBlock(aPB, aNC, aTolR3D, aMPBOnIn, aPBOut);
+        Standard_Real aTolNew;
+        bExist=IsExistingPaveBlock(aPB, aNC, aTolR3D, aMPBOnIn, aPBOut, aTolNew);
         if (bExist) {
           if (aMPBAdd.Add(aPBOut)) {
             Standard_Boolean bInBothFaces = Standard_True;
@@ -532,8 +533,10 @@ void BOPAlgo_PaveFiller::MakeBlocks()
               nE = aPBOut->Edge();
               const TopoDS_Edge& aE = *(TopoDS_Edge*)&myDS->Shape(nE);
               aTolE = BRep_Tool::Tolerance(aE);
-              if (aTolR3D > aTolE) {
-                UpdateEdgeTolerance(nE, aTolR3D);
+              if (aTolNew < aFF.TolReal())
+                aTolNew = aFF.TolReal();  // use real tolerance of intersection
+              if (aTolNew > aTolE) {
+                UpdateEdgeTolerance(nE, aTolNew);
               }
               bInBothFaces = Standard_False;
             } 
@@ -1097,7 +1100,7 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock
     return !bRet;
   } 
   //
-  Standard_Real aT1, aT2, aTm, aTx, aTol;
+  Standard_Real aT1, aT2, aTm, aTx, aTol, aDist;
   Standard_Integer nE, iFlag;
   gp_Pnt aPm;
   Bnd_Box aBoxPm;
@@ -1120,7 +1123,7 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock
       const TopoDS_Edge& aE=(*(TopoDS_Edge *)(&aSIE.Shape()));
       aTol = BRep_Tool::Tolerance(aE);
       aTol = aTol > theTolR3D ? aTol : theTolR3D;
-      iFlag=myContext->ComputePE(aPm, aTol, aE, aTx);
+      iFlag=myContext->ComputePE(aPm, aTol, aE, aTx, aDist);
       if (!iFlag) {
         return bRet;
       }
@@ -1138,7 +1141,8 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock
      const BOPDS_Curve& theNC,
      const Standard_Real theTolR3D,
      const BOPDS_IndexedMapOfPaveBlock& theMPBOnIn,
-     Handle(BOPDS_PaveBlock)& aPBOut)
+     Handle(BOPDS_PaveBlock)& aPBOut,
+     Standard_Real& theTolNew)
 {
   Standard_Boolean bRet;
   Standard_Real aT1, aT2, aTm, aTx;
@@ -1165,6 +1169,7 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock
   aBoxP2.Add(aP2);
   aBoxP2.Enlarge(theTolR3D);
   //
+  theTolNew = 0.;
   aNbPB = theMPBOnIn.Extent();
   for (i = 1; i <= aNbPB; ++i) {
     const Handle(BOPDS_PaveBlock)& aPB = theMPBOnIn(i);
@@ -1181,19 +1186,24 @@ Standard_Boolean BOPAlgo_PaveFiller::IsExistingPaveBlock
     iFlag2 = (nV12 == nV21 || nV12 == nV22) ? 2 : 
       (!aBoxSp.IsOut(aBoxP2) ? 1 : 0);
     if (iFlag1 && iFlag2) {
+      Standard_Real aDist;
       if (aBoxSp.IsOut(aBoxPm) || myContext->ComputePE(aPm, 
                                                        theTolR3D, 
                                                        aSp, 
-                                                       aTx)) {
+                                                       aTx, theTolNew)) {
         continue;
       }
       //
       if (iFlag1 == 1) {
-        iFlag1 = !myContext->ComputePE(aP1, theTolR3D, aSp, aTx);
+        iFlag1 = !myContext->ComputePE(aP1, theTolR3D, aSp, aTx, aDist);
+        if (theTolNew < aDist)
+          theTolNew = aDist;
       }
       //
       if (iFlag2 == 1) {
-        iFlag2 = !myContext->ComputePE(aP2, theTolR3D, aSp, aTx);
+        iFlag2 = !myContext->ComputePE(aP2, theTolR3D, aSp, aTx, aDist);
+        if (theTolNew < aDist)
+          theTolNew = aDist;
       }
       //
       if (iFlag1 && iFlag2) {
@@ -2525,7 +2535,7 @@ void BOPAlgo_PaveFiller::CorrectToleranceOfSE()
         for (; aItLPB.More(); aItLPB.Next()) {
           const Handle(BOPDS_PaveBlock)& aPB = aItLPB.Value();
           Standard_Integer nE;
-          if (!aPB->HasEdge(nE)) {
+          if (!aPB->HasEdge(nE) || aPB->OriginalEdge() >= 0) {
             continue;
           }
           const TopoDS_Edge& aE = TopoDS::Edge(myDS->Shape(nE));
index a84b20cbb9669dd3e529eb7474981fca141a24a9..66e66cb1b17b8c53509b49b2763e27c1d10d699a 100644 (file)
@@ -481,12 +481,13 @@ Standard_Integer IntTools_Context::ComputePE
   (const gp_Pnt& aP1,
    const Standard_Real aTolP1,
    const TopoDS_Edge& aE2,
-   Standard_Real& aT)
+   Standard_Real& aT,
+   Standard_Real& aDist)
 {
   if (!BRep_Tool::IsGeometric(aE2)) { 
     return -2;
   }
-  Standard_Real aDist, aTolE2, aTolSum;
+  Standard_Real aTolE2, aTolSum;
   Standard_Integer aNbProj;
   //
   GeomAPI_ProjectPointOnCurve& aProjector=ProjPC(aE2);
index 16e6621c840f1ae7332355259f8826798db14fb5..d7ff8ad21597e06e5ec816df1787024aecf0ae13 100644 (file)
@@ -108,7 +108,9 @@ Standard_EXPORT virtual  ~IntTools_Context();
   //! 1. the edge is degenerated (-1)
   //! 2. the edge does not contain 3d curve and pcurves (-2)
   //! 3. projection algorithm failed (-3)
-  Standard_EXPORT Standard_Integer ComputePE (const gp_Pnt& theP, const Standard_Real theTolP, const TopoDS_Edge& theE, Standard_Real& theT);
+  Standard_EXPORT Standard_Integer ComputePE (const gp_Pnt& theP, const Standard_Real theTolP,
+                                              const TopoDS_Edge& theE, Standard_Real& theT,
+                                              Standard_Real& theDist);
   
 
   //! Computes parameter of the vertex aV on
index 5c89a026cb4f8af862e65a89f1c5b91e76c881e3..136b8f0bb9b05a7bf88649ee65f4fb5c65dce09f 100644 (file)
@@ -1,2 +1,2 @@
 source [locate_data_file 20000_casemate-inf.prt.2.gdml.tcl]
-
+checkprops result -s 2.94595e+006
index d7e8c67fded7e4525de9e56e644a81b24e9c2ada..160c6aae8b1dbf153a238bb90a458e72ecae9540 100644 (file)
@@ -1,2 +1,2 @@
 source [locate_data_file 20000_casemate-sup.prt.2.gdml.tcl]
-
+checkprops result -s 3.02422e+006
index acc5a1ff886299dee3b095f3e083a88469f4fb3d..a0aa65db87192b8ec1372595dbb53c814df2e5c1 100644 (file)
@@ -1,2 +1,2 @@
 source [locate_data_file 20000_casemate.asm.2.gdml.tcl]
-
+checkprops result -s 5.97016e+006
index f67e0782d2c80b22e92b5b8ad744362b50cd1bed..db170875fffe9b3c08b5d63e7419e4f0f517fcf9 100644 (file)
@@ -1,2 +1,2 @@
 source [locate_data_file 20000_casemate_inf.asm.2.gdml.tcl]
-
+checkprops result -s 2.94595e+006
index dbe2a5b935dd5067c73bf1e2b40fd80ce886327c..db360affe119e5fe3045a9dbee4d8743aa5d7b8a 100644 (file)
@@ -1,2 +1,2 @@
 source [locate_data_file 20000_casemate_ne.asm.2.gdml.tcl]
-
+checkprops result -s 5.97016e+006
index 7b28acd5fd2f5f7f6e3411143bf7e48eed67e557..6b3c31def4e72bd9b4d0099eb35ea0dc2e144ded 100644 (file)
@@ -1,2 +1,2 @@
 source [locate_data_file 20000_casemate_no.asm.2.gdml.tcl]
-
+checkprops result -s 5.97016e+006
index a1c6655349bd7875f2e682133471ea673d2495c9..3520f0711fe992ad2fdcdb97670356e808a93f94 100644 (file)
@@ -1,2 +1,2 @@
 source [locate_data_file 20000_casemate_se.asm.2.gdml.tcl]
-
+checkprops result -s 5.97016e+006
index d33d279bfbd8d4d2d906fb2ea3dbcdc1036697b6..a16846efa83a35c9cabdf2650c4a23950409ed60 100644 (file)
@@ -1,2 +1,2 @@
 source [locate_data_file 20000_casemate_so.asm.2.gdml.tcl]
-
+checkprops result -s 5.97016e+006
index 4ded60cdf9e5142e1e63340dc60d41d2389c5515..884dd07fb47ecdaaee7956297868e6cac600b424 100644 (file)
@@ -1,2 +1,2 @@
 source [locate_data_file 20000_casemate_sup.asm.2.gdml.tcl]
-
+checkprops result -s 3.02422e+006
index 7fc4a44d0f690847f02f82b2ed2efbbde649f350..4540588e57aed05056ea5d3d867bcd7eedb00821 100644 (file)
@@ -1,2 +1,4 @@
+puts "TODO ?OCC27052 All: Faulty shapes in variables faulty_1 to"
+
 source [locate_data_file equipement_chambre.asm.1.gdml.tcl]
 
index 6351da7bc53152d1f750441cb9ebf2699cdd017c..e6bb6b86be7585bd509ac62fecc7161dcf21b96d 100644 (file)
@@ -1,3 +1,4 @@
+puts "TODO ?OCC27052 All: Faulty shapes in variables faulty_1 to"
 puts "TODO OCC26018 ALL: bopcheck failed"
 source [locate_data_file mos2014-asm-scf-final.asm.1.gdml.tcl]
 
index a4adc5c8be565fbc827d4a5d24c92acd83b0d9a2..952af7c23d00bc6a988703c1d2c86fa4f836ad93 100644 (file)
@@ -1,3 +1,4 @@
+puts "TODO ?OCC27052 All: Faulty shapes in variables faulty_1 to"
 puts "TODO OCC26018 ALL: bopcheck failed"
 source [locate_data_file mos2014-scf-final.prt.1.gdml.tcl]
 
diff --git a/tests/bugs/modalg_6/bug27032 b/tests/bugs/modalg_6/bug27032
new file mode 100644 (file)
index 0000000..1acea13
--- /dev/null
@@ -0,0 +1,14 @@
+puts "========"
+puts "OCC27032"
+puts "========"
+puts ""
+##########################################################################################
+# Result of bcut has the same volume as the object
+##########################################################################################
+
+restore [locate_data_file OCC27032_sh.brep] a
+
+explode a
+bcut result a_1 a_2
+
+checkprops result -s 1.80949e+006