]> OCCT Git - occt-copy.git/commitdiff
0026420: BOPAlgo_Builder resets "Closed" flag in the result
authoremv <emv@opencascade.com>
Wed, 29 Jul 2015 12:29:42 +0000 (15:29 +0300)
committerabv <abv@opencascade.com>
Wed, 2 Sep 2015 11:38:37 +0000 (14:38 +0300)
Set flag Closed to new Wires and Shells created in General Fuse algorithm if necessary.

Test-cases for issue #26420

src/BOPAlgo/BOPAlgo_BuilderFace.cxx
src/BOPAlgo/BOPAlgo_Builder_1.cxx
src/BOPAlgo/BOPAlgo_WireSplitter.lxx
tests/bugs/modalg_6/bug26420_1 [new file with mode: 0644]
tests/bugs/modalg_6/bug26420_2 [new file with mode: 0644]
tests/bugs/modalg_6/bug26420_3 [new file with mode: 0644]

index b1c5387c0de6b399f181c3477976f1fb465ff683..09acefd67ffa29e7b4bb9c936cf1ecfd69edd801 100644 (file)
@@ -445,6 +445,7 @@ void BOPAlgo_BuilderFace::PerformLoops()
         }//for (; aIt.More(); aIt.Next()) { 
       }//for (; aItE.More(); aItE.Next()) {
     }//for (; aItW.More(); aItW.Next()) {
+    aW.Closed(BRep_Tool::IsClosed(aW));
     myLoopsInternal.Append(aW);
   }//for (; aItM.More(); aItM.Next()) {
 }
@@ -817,6 +818,7 @@ void MakeInternalWires(const BOPCol_MapOfShape& theME,
         }
       }
     }
+    aW.Closed(BRep_Tool::IsClosed(aW));
     theWires.Append(aW);
   }
 }
index fd628c75006bce122f066c8d55cba6b6df587b7b..5c1e98a35f716b210816f9a38a8c848de0c0b306 100644 (file)
 #include <BOPDS_ShapeInfo.hxx>
 
 #include <BOPTools_AlgoTools.hxx>
+#include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
+#include <IntTools_Context.hxx>
+#include <TopAbs_ShapeEnum.hxx>
+#include <TopoDS_Iterator.hxx>
+#include <TopoDS_Shape.hxx>
 
 //=======================================================================
 //function : FillImagesVertices
     }
   }
   //
+  aCIm.Closed(BRep_Tool::IsClosed(aCIm));
+  //
   BOPCol_ListOfShape aLSIm(myAllocator);
   aLSIm.Append(aCIm);
   myImages.Bind(theS, aLSIm); 
index 01fa726fb8ff60e82d8205c91003f6adbac6e0c0..d3481e7619c7930293a6dd5b275a9031c8407cd5 100644 (file)
@@ -13,6 +13,7 @@
 // commercial license or contractual agreement.
 
 #include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
 
 #include <TopoDS_Edge.hxx>
 
@@ -85,7 +86,7 @@ typedef NCollection_IndexedDataMap<TopoDS_Shape, \
 //purpose  : 
 //=======================================================================
   inline void BOPAlgo_WireSplitter::MakeWire(BOPCol_ListOfShape& aLE, 
-                                            TopoDS_Wire& aWire)
+                                             TopoDS_Wire& aWire)
 {
   BRep_Builder aBB;
   aBB.MakeWire(aWire);
@@ -94,4 +95,5 @@ typedef NCollection_IndexedDataMap<TopoDS_Shape, \
   for (; aIt.More(); aIt.Next()){
     aBB.Add(aWire, aIt.Value());
   }
+  aWire.Closed(BRep_Tool::IsClosed(aWire));
 }
diff --git a/tests/bugs/modalg_6/bug26420_1 b/tests/bugs/modalg_6/bug26420_1
new file mode 100644 (file)
index 0000000..07c44da
--- /dev/null
@@ -0,0 +1,21 @@
+puts "========"
+puts "OCC26420"
+puts "========"
+puts ""
+######################################################
+# BOPAlgo_Builder resets "Closed" flag in the result
+######################################################
+
+polyline pp 0 4 0 7 4 0 7 6 0 0 6 0 0 4 0
+vertex v0 5 4 0
+vertex v1 4 6 0
+bclearobjects
+bcleartools
+baddobjects v0 v1 pp
+bfillds
+bbuild r
+explode r w
+set bug_info [whatis r_1]
+if {[lindex $bug_info 8] != "Closed"} {
+  puts "ERROR: OCC26420 is reproduced. Flag CLOSED is not set."
+}
diff --git a/tests/bugs/modalg_6/bug26420_2 b/tests/bugs/modalg_6/bug26420_2
new file mode 100644 (file)
index 0000000..dda0d80
--- /dev/null
@@ -0,0 +1,22 @@
+puts "========"
+puts "OCC26420"
+puts "========"
+puts ""
+######################################################
+# BOPAlgo_Builder resets "Closed" flag in the result
+######################################################
+
+polyline pp 0 4 0 7 4 0 7 6 0 0 6 0 0 4 0
+mkplane ff pp
+vertex v0 5 4 0
+vertex v1 4 6 0
+bclearobjects
+bcleartools
+baddobjects v0 v1 ff
+bfillds
+bbuild r
+explode r w
+set bug_info [whatis r_1]
+if {[lindex $bug_info 8] != "Closed"} {
+  puts "ERROR: OCC26420 is reproduced. Flag CLOSED is not set."
+}
diff --git a/tests/bugs/modalg_6/bug26420_3 b/tests/bugs/modalg_6/bug26420_3
new file mode 100644 (file)
index 0000000..5c06f26
--- /dev/null
@@ -0,0 +1,20 @@
+puts "========"
+puts "OCC26420"
+puts "========"
+puts ""
+######################################################
+# BOPAlgo_Builder resets "Closed" flag in the result
+######################################################
+
+box bb 0 0 0 5 5 5
+explode bb sh
+polyline pp -1 -1 2 -1 6 2 6 6 2 6 -1 2 -1 -1 2
+mkplane pl pp
+baddobjects pl bb_1
+bfillds
+bbuild r
+explode r sh
+set bug_info [whatis r_1]
+if {[lindex $bug_info 8] != "Closed"} {
+  puts "ERROR: OCC26420 is reproduced. Flag CLOSED is not set."
+}