From: emv Date: Mon, 18 Mar 2019 07:46:27 +0000 (+0300) Subject: 0030522: Modeling Algorithms - BRepBuilderAPI_MakeWire produces different wires depen... X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=fde63ce40bee63abac23cab7811694b2dbead506;p=occt-copy.git 0030522: Modeling Algorithms - BRepBuilderAPI_MakeWire produces different wires depending on the order of parameters 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. --- diff --git a/src/BRepLib/BRepLib_MakeWire.cxx b/src/BRepLib/BRepLib_MakeWire.cxx index c0de4f9b7f..0e96765568 100644 --- a/src/BRepLib/BRepLib_MakeWire.cxx +++ b/src/BRepLib/BRepLib_MakeWire.cxx @@ -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 index 0000000000..b4e80cbda5 --- /dev/null +++ b/tests/bugs/modalg_7/bug30522 @@ -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