0025735: Wrong solid is considered as valid by checkshape
authorpkv <pkv@opencascade.com>
Thu, 5 Feb 2015 09:49:05 +0000 (12:49 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 5 Feb 2015 09:50:14 +0000 (12:50 +0300)
Changes:
class BRepCheck_Solid
method:
   void BRepCheck_Solid::Minimum()
has been changed. The treatment of shells with INTERNAL faces has been added.

Added test case bugs/modalg_5/bug25735

Added TODOs in test cases according to issue 25735.

16 files changed:
src/BRepCheck/BRepCheck_Solid.cxx
tests/boolean/bcut_complex/O3
tests/boolean/bcut_complex/O4
tests/boolean/bcut_complex/O5
tests/boolean/bcut_complex/O6
tests/boolean/bfuse_complex/O5
tests/boolean/bfuse_complex/O6
tests/boolean/bopfuse_complex/H1
tests/boolean/boptuc_complex/D5
tests/bugs/modalg_2/bug497_3
tests/bugs/modalg_4/bug62
tests/bugs/modalg_4/bug697_2
tests/bugs/modalg_4/bug697_4
tests/bugs/modalg_4/bug697_7
tests/bugs/modalg_4/bug697_8
tests/bugs/modalg_5/bug25735 [new file with mode: 0644]

index 170f142..d49be1b 100644 (file)
@@ -197,7 +197,7 @@ void BRepCheck_Solid::Minimum()
   myMin = Standard_True;
   //
   Standard_Boolean bFound, bIsHole, bFlag;
-  Standard_Integer i, j, aNbVTS, aNbVTS1;
+  Standard_Integer i, j, aNbVTS, aNbVTS1, iCntSh, iCntShInt;
   TopoDS_Solid aZ;
   TopoDS_Iterator aIt, aItF;
   TopoDS_Builder aBB;
@@ -228,6 +228,8 @@ void BRepCheck_Solid::Minimum()
   // 2. 
   //    - Too many growths,
   //    - There is smt of the solid that is out of solid
+  iCntSh=0;
+  iCntShInt=0;
   aIt.Initialize(myShape);
   for (; aIt.More(); aIt.Next()) {
     const TopoDS_Shape& aSx=aIt.Value();
@@ -254,9 +256,12 @@ void BRepCheck_Solid::Minimum()
       }
     }
     if (bFound) {
+      ++iCntShInt;
       continue;
     }
     //
+    ++iCntSh;
+    //
     // Skip not closed shells
     if (!BRep_Tool::IsClosed(aSh)) {
       continue;
@@ -271,6 +276,12 @@ void BRepCheck_Solid::Minimum()
     aVTS.Append(aTS);
   }//for (; aIt.More(); aIt.Next()) {
   //
+  if (!iCntSh && iCntShInt) {
+    // all shells in the solid are internal
+    BRepCheck::Add(myMap(myShape), 
+                   BRepCheck_BadOrientationOfSubshape);
+  }
+  //
   aNbVTS=aVTS.Size();
   if (aNbVTS<2) {
     return;
index 3f27ed5..137ee0a 100644 (file)
@@ -1,4 +1,5 @@
 puts "TODO #22911 ALL: Error : The area of the resulting shape is"
+puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
 
 restore [locate_data_file CTO908_topo101-o1.brep] obj1
 restore [locate_data_file CTO908_topo101-t1.brep] tool1
index 5ffdb95..73249d1 100644 (file)
@@ -1,4 +1,5 @@
 puts "TODO #22911 ALL: Error : The area of the resulting shape is"
+puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
 
 restore [locate_data_file CTO908_topo101-o2.brep] obj2
 restore [locate_data_file CTO908_topo101-t2.brep] tool2
index b580eeb..582f6da 100644 (file)
@@ -1,4 +1,5 @@
 puts "TODO #22911 ALL: Error : The area of the resulting shape is"
+puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
 
 restore [locate_data_file CTO908_topo102-o.brep] obj
 restore [locate_data_file CTO908_topo102-t.brep] tool
index 32ab33c..6d2f0af 100644 (file)
@@ -1,4 +1,5 @@
 puts "TODO #22911 ALL: Error : The area of the resulting shape is"
+puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
 
 restore [locate_data_file CTO908_topo103-o.brep] obj
 restore [locate_data_file CTO908_topo103-t.brep] tool
index 4a65537..5d715b7 100644 (file)
@@ -1,3 +1,5 @@
+puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
+
 restore [locate_data_file CTO908_topo104-o1.brep] wheel
 restore [locate_data_file CTO908_topo104-o2.brep] jante
 
index 84cb170..0797c5f 100644 (file)
@@ -1,3 +1,5 @@
+puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
+
 restore [locate_data_file CTO908_topo106-p.brep] poche
 restore [locate_data_file CTO908_topo106-n.brep] nervure
 
index 992835e..714b72c 100644 (file)
@@ -1,4 +1,5 @@
 puts "TODO #22911 ALL: Error : The area of the resulting shape is"
+puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
 
 restore [locate_data_file a102] a
 restore [locate_data_file b136] b
index d9ec876..eae899c 100644 (file)
@@ -1,4 +1,5 @@
 puts "TODO ?OCC24925 ALL: Error : The area of the resulting shape is"
+puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
 
 restore [locate_data_file a102] a
 restore [locate_data_file b136] b
index 22cea61..1c0df91 100755 (executable)
@@ -1,3 +1,5 @@
+puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
+
 puts "========="
 puts " OCC497 "
 puts "(case 3)"
index ccafb69..9dd59e6 100755 (executable)
@@ -1,4 +1,6 @@
 puts "TODO ?OCC12345 ALL: Error : The square of result shape is"
+puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
+
 puts "================"
 puts "OCC62"
 puts "BUC61001"
index 3c852d7..d706ae1 100755 (executable)
@@ -1,4 +1,6 @@
 puts "TODO OCC12345 ALL: Error : The square of result shape is"
+puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
+
 puts "============"
 puts "OCC697"
 puts "============"
index ff64016..dc752ba 100755 (executable)
@@ -1,4 +1,6 @@
 puts "TODO OCC12345 ALL: Error : The square of result shape is"
+puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
+
 puts "============"
 puts "OCC697"
 puts "============"
index ab6b25d..54a4708 100755 (executable)
@@ -1,4 +1,6 @@
 puts "TODO OCC12345 ALL: Error : The square of result shape is"
+puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
+
 puts "============"
 puts "OCC697"
 puts "============"
index 5686cfe..b832ac3 100755 (executable)
@@ -1,4 +1,6 @@
 puts "TODO OCC12345 ALL: Error : The square of result shape is"
+puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to"
+
 puts "============"
 puts "OCC697"
 puts "============"
diff --git a/tests/bugs/modalg_5/bug25735 b/tests/bugs/modalg_5/bug25735
new file mode 100644 (file)
index 0000000..88e7b3b
--- /dev/null
@@ -0,0 +1,21 @@
+puts "=========="
+puts "OCC25735"
+puts "=========="
+puts ""
+######################################################
+# Wrong solid is considered as valid by checkshape
+######################################################
+
+restore [locate_data_file bug25735_r5] result
+
+decho off
+set info [checkshape result]
+decho on
+
+if { [regexp "Faulty shapes in variables faulty_1" ${info}] != 1 } {
+  puts "Error : There are no mistakes by checkshape-command"
+} else {
+  puts "OK : There are mistakes by checkshape-command"
+}
+
+set 2dviewer 1