From 34a0b4463a023676d97bdac7e94d0b05c0658597 Mon Sep 17 00:00:00 2001 From: pkv Date: Thu, 5 Feb 2015 12:49:05 +0300 Subject: [PATCH] 0025735: Wrong solid is considered as valid by checkshape 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. --- src/BRepCheck/BRepCheck_Solid.cxx | 13 ++++++++++++- tests/boolean/bcut_complex/O3 | 1 + tests/boolean/bcut_complex/O4 | 1 + tests/boolean/bcut_complex/O5 | 1 + tests/boolean/bcut_complex/O6 | 1 + tests/boolean/bfuse_complex/O5 | 2 ++ tests/boolean/bfuse_complex/O6 | 2 ++ tests/boolean/bopfuse_complex/H1 | 1 + tests/boolean/boptuc_complex/D5 | 1 + tests/bugs/modalg_2/bug497_3 | 2 ++ tests/bugs/modalg_4/bug62 | 2 ++ tests/bugs/modalg_4/bug697_2 | 2 ++ tests/bugs/modalg_4/bug697_4 | 2 ++ tests/bugs/modalg_4/bug697_7 | 2 ++ tests/bugs/modalg_4/bug697_8 | 2 ++ tests/bugs/modalg_5/bug25735 | 21 +++++++++++++++++++++ 16 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 tests/bugs/modalg_5/bug25735 diff --git a/src/BRepCheck/BRepCheck_Solid.cxx b/src/BRepCheck/BRepCheck_Solid.cxx index 170f142b59..d49be1bdec 100644 --- a/src/BRepCheck/BRepCheck_Solid.cxx +++ b/src/BRepCheck/BRepCheck_Solid.cxx @@ -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; diff --git a/tests/boolean/bcut_complex/O3 b/tests/boolean/bcut_complex/O3 index 3f27ed5148..137ee0a771 100644 --- a/tests/boolean/bcut_complex/O3 +++ b/tests/boolean/bcut_complex/O3 @@ -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 diff --git a/tests/boolean/bcut_complex/O4 b/tests/boolean/bcut_complex/O4 index 5ffdb95703..73249d1e49 100644 --- a/tests/boolean/bcut_complex/O4 +++ b/tests/boolean/bcut_complex/O4 @@ -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 diff --git a/tests/boolean/bcut_complex/O5 b/tests/boolean/bcut_complex/O5 index b580eeb6f0..582f6da0a2 100644 --- a/tests/boolean/bcut_complex/O5 +++ b/tests/boolean/bcut_complex/O5 @@ -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 diff --git a/tests/boolean/bcut_complex/O6 b/tests/boolean/bcut_complex/O6 index 32ab33c3f6..6d2f0af7bb 100644 --- a/tests/boolean/bcut_complex/O6 +++ b/tests/boolean/bcut_complex/O6 @@ -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 diff --git a/tests/boolean/bfuse_complex/O5 b/tests/boolean/bfuse_complex/O5 index 4a65537950..5d715b7a0f 100644 --- a/tests/boolean/bfuse_complex/O5 +++ b/tests/boolean/bfuse_complex/O5 @@ -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 diff --git a/tests/boolean/bfuse_complex/O6 b/tests/boolean/bfuse_complex/O6 index 84cb17076c..0797c5fcbe 100644 --- a/tests/boolean/bfuse_complex/O6 +++ b/tests/boolean/bfuse_complex/O6 @@ -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 diff --git a/tests/boolean/bopfuse_complex/H1 b/tests/boolean/bopfuse_complex/H1 index 992835e17c..714b72c8a1 100644 --- a/tests/boolean/bopfuse_complex/H1 +++ b/tests/boolean/bopfuse_complex/H1 @@ -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 diff --git a/tests/boolean/boptuc_complex/D5 b/tests/boolean/boptuc_complex/D5 index d9ec8760f5..eae899ce92 100644 --- a/tests/boolean/boptuc_complex/D5 +++ b/tests/boolean/boptuc_complex/D5 @@ -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 diff --git a/tests/bugs/modalg_2/bug497_3 b/tests/bugs/modalg_2/bug497_3 index 22cea61e68..1c0df91ce8 100755 --- a/tests/bugs/modalg_2/bug497_3 +++ b/tests/bugs/modalg_2/bug497_3 @@ -1,3 +1,5 @@ +puts "TODO OCC25735 ALL: Faulty shapes in variables faulty_1 to" + puts "=========" puts " OCC497 " puts "(case 3)" diff --git a/tests/bugs/modalg_4/bug62 b/tests/bugs/modalg_4/bug62 index ccafb69df1..9dd59e6a0c 100755 --- a/tests/bugs/modalg_4/bug62 +++ b/tests/bugs/modalg_4/bug62 @@ -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" diff --git a/tests/bugs/modalg_4/bug697_2 b/tests/bugs/modalg_4/bug697_2 index 3c852d7e5f..d706ae12ca 100755 --- a/tests/bugs/modalg_4/bug697_2 +++ b/tests/bugs/modalg_4/bug697_2 @@ -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_4/bug697_4 b/tests/bugs/modalg_4/bug697_4 index ff640160a1..dc752baeab 100755 --- a/tests/bugs/modalg_4/bug697_4 +++ b/tests/bugs/modalg_4/bug697_4 @@ -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_4/bug697_7 b/tests/bugs/modalg_4/bug697_7 index ab6b25d678..54a47084d4 100755 --- a/tests/bugs/modalg_4/bug697_7 +++ b/tests/bugs/modalg_4/bug697_7 @@ -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_4/bug697_8 b/tests/bugs/modalg_4/bug697_8 index 5686cfef05..b832ac3899 100755 --- a/tests/bugs/modalg_4/bug697_8 +++ b/tests/bugs/modalg_4/bug697_8 @@ -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 index 0000000000..88e7b3b252 --- /dev/null +++ b/tests/bugs/modalg_5/bug25735 @@ -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