]> OCCT Git - occt.git/commitdiff
0026379: Wrong result produced by the volume maker algorithm
authoremv <emv@opencascade.com>
Thu, 9 Jul 2015 11:17:49 +0000 (14:17 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 9 Jul 2015 11:20:02 +0000 (14:20 +0300)
1. class BOPAlgo_ShellSplitter
static method void RefineShell(TopoDS_Shell& theShell,
                               BOPCol_ListOfShape& aLShX)
Added protection from INTERNAL edges.

2. class BOPAlgo_MakerVolume
method void BOPAlgo_MakerVolume::MakeBox(BOPCol_MapOfShape& theBoxFaces)
Creation of the overlapping box of proper size.

Test-cases for issue #26379

src/BOPAlgo/BOPAlgo_MakerVolume.cxx
src/BOPAlgo/BOPAlgo_ShellSplitter.cxx
tests/boolean/volumemaker/C1
tests/boolean/volumemaker/C2
tests/bugs/modalg_6/bug26379_1 [new file with mode: 0644]
tests/bugs/modalg_6/bug26379_2 [new file with mode: 0644]

index 3b10f0714e727b5a00c93642c76765e0daa645da..3e4f1a81893d82418ae592120ed833c84fac7393 100644 (file)
@@ -244,7 +244,7 @@ void BOPAlgo_MakerVolume::MakeBox(BOPCol_MapOfShape& theBoxFaces)
   //
   Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, anExt;
   //
-  anExt = myBBox.SquareExtent() * 0.5;
+  anExt = sqrt(myBBox.SquareExtent()) * 0.5;
   myBBox.Enlarge(anExt);
   myBBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
   //
index 71f6d1786760e08cd59557dbe6a842df8fe0cb22..b188eb136317d97f7716731e049ee4b0c90a7fe5 100644 (file)
@@ -347,7 +347,6 @@ void BOPAlgo_ShellSplitter::SplitBlock(BOPTools_ConnexityBlock& aCB)
                                      TopAbs_EDGE, 
                                      TopAbs_FACE, 
                                      aEFMap);
-                                    
   }
   //
   aItF.Initialize (myShapes);
@@ -501,7 +500,7 @@ void RefineShell(TopoDS_Shell& theShell,
                                    TopAbs_EDGE, 
                                    TopAbs_FACE, 
                                    aMEF);
-                                  
+  //
   aNbMEF=aMEF.Extent();
   for (i=1; i<=aNbMEF; ++i) {
     const TopoDS_Shape& aE=aMEF.FindKey(i);
@@ -531,7 +530,7 @@ void RefineShell(TopoDS_Shell& theShell,
     aLFP.Append(aF1);
     //
     // Trying to reach the branch point
-    for (;;)  {  
+    for (;;) {
       aItLFP.Initialize(aLFP);
       for (; aItLFP.More(); aItLFP.Next()) { 
         const TopoDS_Shape& aFP=aItLFP.Value();
@@ -543,6 +542,10 @@ void RefineShell(TopoDS_Shell& theShell,
             continue;
           }
           //
+          if (aE.Orientation() == TopAbs_INTERNAL) {
+            continue;
+          }
+          //
           if (BRep_Tool::Degenerated(aE)) {
             continue;
           }
@@ -578,7 +581,7 @@ void RefineShell(TopoDS_Shell& theShell,
         aLFP.Append(aFP1);
       }
       aLFP1.Clear();
-    }// for (;;)  {
+    }// for (;;) {
     //
     aNbMFB=aMFB.Extent();
     if (aNbMFB) {
@@ -592,7 +595,7 @@ void RefineShell(TopoDS_Shell& theShell,
       aLShX.Append(aShX);
     }
   }//for (; aIt.More(); aIt.Next()) {
-}    
+}
 //=======================================================================
 //function : MakeShells
 //purpose  : 
index 5ebbb01e941f685991d8d46eec28010908aeba42..5527397339f215c196e7c0046e1d12304a379322 100644 (file)
@@ -1,9 +1,9 @@
 # test script on make volume operation
 # plane
 
-puts "TODO OCC26020 ALL: Faulty shapes in variables faulty_1 to faulty_"
+puts "TODO ?OCC26020 ALL: Faulty shapes in variables faulty_1 to faulty_"
 puts "TODO ?OCC26020 ALL: Error : The area of the resulting shape is"
-puts "TODO OCC26020 ALL: Error: bopcheck failed"
+puts "TODO ?OCC26020 ALL: Error: bopcheck failed"
 
 # planar face 
 plane pln_f1 -331.49269816258993 -487.15663197846379 -460.05843051255943 -0.29784456643004237 0.75470958022277179 -0.58455287508322795
index 42e0f76869aec172fc440efc2da615505d52ffe7..c64f03899b467f492d6342a4e787b80afb09ef3a 100644 (file)
@@ -1,7 +1,9 @@
 # test script on make volume operation
 # plane
 
-puts "TODO OCC26020 ALL: Faulty shapes in variables faulty_1 to faulty_"
+puts "TODO ?OCC26020 ALL: Faulty shapes in variables faulty_1 to faulty_"
+puts "TODO OCC26020 ALL: Error: bopcheck failed"
+puts "TODO OCC26020 ALL: Error : The area of the resulting shape is"
 
 # planar face 
 plane pln_f1 0 840 1.2212453270876722e-014 0 -1 -1.1102230246251565e-016
diff --git a/tests/bugs/modalg_6/bug26379_1 b/tests/bugs/modalg_6/bug26379_1
new file mode 100644 (file)
index 0000000..ee6f83f
--- /dev/null
@@ -0,0 +1,24 @@
+puts "========"
+puts "OCC26379"
+puts "========"
+puts ""
+#######################################################
+# Wrong result produced by the volume maker algorithm
+#######################################################
+
+restore [locate_data_file OCC26379-csf_2.brep] cf
+mkvolume result cf -ni
+
+vinit
+vsetdispmode 1
+vdisplay result
+vfit
+
+set bug_info [vreadpixel 350 310 name]
+if {$bug_info != "DARKGOLDENROD3 1"} {
+  puts "ERROR: OCC26379 is reproduced. Volume is incorrect."
+}
+
+set square 6.60933e+006
+
+set only_screen 1
diff --git a/tests/bugs/modalg_6/bug26379_2 b/tests/bugs/modalg_6/bug26379_2
new file mode 100644 (file)
index 0000000..d482284
--- /dev/null
@@ -0,0 +1,24 @@
+puts "========"
+puts "OCC26379"
+puts "========"
+puts ""
+#######################################################
+# Wrong result produced by the volume maker algorithm
+#######################################################
+
+restore [locate_data_file OCC26379-csf_3.brep] cf
+mkvolume result cf -ni
+
+vinit
+vsetdispmode 1
+vdisplay result
+vfit
+
+set bug_info [vreadpixel 350 310 name]
+if {$bug_info != "DARKGOLDENROD3 1"} {
+  puts "ERROR: OCC26379 is reproduced. Volume is incorrect."
+}
+
+set square 7.22211e+006
+
+set only_screen 1