]> OCCT Git - occt-copy.git/commitdiff
0030522: Modeling Algorithms - BRepBuilderAPI_MakeWire produces different wires depen...
authoremv <emv@opencascade.com>
Mon, 18 Mar 2019 07:46:27 +0000 (10:46 +0300)
committeremv <emv@opencascade.com>
Mon, 18 Mar 2019 07:46:27 +0000 (10:46 +0300)
The following improvement has been implemented in BRepLib_MakeWire class to make it more reliable:
1. Quit adding edges of a wire into result if the current edges have not been added. Return NotDone status.

Test case for the issue.

src/BRepLib/BRepLib_MakeWire.cxx
tests/bugs/modalg_7/bug30522 [new file with mode: 0644]

index c0de4f9b7fa70e4af33c55cc16ad90a0e901acf7..0e967655680bdc8a76b0e5a0e312b7494dc1c517 100644 (file)
@@ -128,10 +128,11 @@ BRepLib_MakeWire::BRepLib_MakeWire(const TopoDS_Wire& W,
 
 void  BRepLib_MakeWire::Add(const TopoDS_Wire& W)
 {
-  TopExp_Explorer ex(W,TopAbs_EDGE);
-  while (ex.More()) {
-    Add(TopoDS::Edge(ex.Current()));
-    ex.Next();
+  for (TopoDS_Iterator it(W); it.More(); it.Next())
+  {
+    Add(TopoDS::Edge(it.Value()));
+    if (myError != BRepLib_WireDone)
+      break;
   }
 }
 
diff --git a/tests/bugs/modalg_7/bug30522 b/tests/bugs/modalg_7/bug30522
new file mode 100644 (file)
index 0000000..b4e80cb
--- /dev/null
@@ -0,0 +1,22 @@
+puts "========"
+puts "0030522: Modeling Algorithms - BRepBuilderAPI_MakeWire produces different wires depending on the order of parameters"
+puts "========"
+puts ""
+
+restore [locate_data_file bug30522_w_line12.brep] w1
+restore [locate_data_file bug30522_w_line21.brep] w2
+
+if {![regexp "Wire not done" [wire r12 w1 w2]]} {
+  if {[lindex [nbshapes r12] 10] != 8} {
+    puts "Error: The wires have been unified incorrectly"
+  }
+}
+
+wire r21 w2 w1
+
+checkshape r21
+checknbshapes r21 -edge 8 -vertex 8
+
+smallview +Y+Z
+donly r21; fit
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png