0027309: Result of UnifySameDomain has InvalidMultiConnexity error
authormsv <msv@opencascade.com>
Fri, 25 Mar 2016 16:19:35 +0000 (19:19 +0300)
committerbugmaster <bugmaster@opencascade.com>
Fri, 8 Apr 2016 08:42:37 +0000 (11:42 +0300)
The update of the set of boundary edges has been added for the case when faces containing milti-connected edges are excluded from merging.

Update test cases for unifysamedom to generate snapshots.

src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx
tests/bugs/modalg_6/bug27082_1
tests/bugs/modalg_6/bug27082_1i
tests/bugs/modalg_6/bug27082_2
tests/bugs/modalg_6/bug27082_2i
tests/bugs/modalg_6/bug27082_3
tests/bugs/modalg_6/bug27082_3i
tests/bugs/modalg_6/bug27309 [new file with mode: 0644]

index 7181894..6189e4c 100644 (file)
@@ -1208,8 +1208,25 @@ void ShapeUpgrade_UnifySameDomain::UnifyFaces()
               anAvoidFaces.Add(aLF.Last());
             }
             for (i = 1; i <= faces.Length(); ) {
-              if (anAvoidFaces.Contains(faces(i)))
+              if (anAvoidFaces.Contains(faces(i))) {
+                // update the boundaries of merged area, for that
+                // remove from 'edges' the edges of this face and add to 'edges' 
+                // the edges of this face that were not present in 'edges' before
+                TopExp_Explorer ex(faces(i), TopAbs_EDGE);
+                for (; ex.More(); ex.Next()) {
+                  TopoDS_Shape aE = ex.Current();
+                  Standard_Integer j;
+                  for (j = 1; j <= edges.Length(); j++) {
+                    if (edges(j).IsSame(aE))
+                      break;
+                  }
+                  if (j <= edges.Length())
+                    edges.Remove(j);
+                  else
+                    edges.Append(aE);
+                }
                 faces.Remove(i);
+              }
               else
                 i++;
             }
index a58a1a2..6181fcf 100644 (file)
@@ -16,3 +16,5 @@ don result
 smallview; l; fit
 bopcheck result
 checknbshapes result -m UnifySameDomain -face 22 -edge 40
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
index 0a0ff3b..1633beb 100644 (file)
@@ -16,3 +16,5 @@ don result
 smallview; l; fit
 bopcheck result
 checknbshapes result -m UnifySameDomain -face 14 -edge 28
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
index cbe7bc5..359282c 100644 (file)
@@ -15,3 +15,5 @@ don result
 smallview; l; fit
 bopcheck result
 checknbshapes result -m UnifySameDomain -face 37 -edge 94
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
index 82ee825..0ded3c1 100644 (file)
@@ -15,3 +15,5 @@ don result
 smallview; l; fit
 bopcheck result
 checknbshapes result -m UnifySameDomain -face 33 -edge 86
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
index 4728c05..dcdf765 100644 (file)
@@ -13,3 +13,5 @@ don result
 smallview; l; fit
 bopcheck result
 checknbshapes result -m UnifySameDomain -face 249 -edge 600
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
index 49d91b0..a48b0bb 100644 (file)
@@ -13,3 +13,5 @@ don result
 smallview; l; fit
 bopcheck result
 checknbshapes result -m UnifySameDomain -face 225 -edge 576
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/bugs/modalg_6/bug27309 b/tests/bugs/modalg_6/bug27309
new file mode 100644 (file)
index 0000000..aa3a0ab
--- /dev/null
@@ -0,0 +1,17 @@
+puts "============"
+puts "OCC27309"
+puts "============"
+puts ""
+###############################
+## Result of UnifySameDomain has InvalidMultiConnexity error
+###############################
+
+restore [locate_data_file bug27309_shape.brep] a
+unifysamedom result a
+
+don result
+smallview; l; fit
+checkshape result
+checknbshapes result -m UnifySameDomain -face 28 -edge 66
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png