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.
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;
}
}
--- /dev/null
+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