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.
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++;
}
smallview; l; fit
bopcheck result
checknbshapes result -m UnifySameDomain -face 22 -edge 40
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
smallview; l; fit
bopcheck result
checknbshapes result -m UnifySameDomain -face 14 -edge 28
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
smallview; l; fit
bopcheck result
checknbshapes result -m UnifySameDomain -face 37 -edge 94
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
smallview; l; fit
bopcheck result
checknbshapes result -m UnifySameDomain -face 33 -edge 86
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
smallview; l; fit
bopcheck result
checknbshapes result -m UnifySameDomain -face 249 -edge 600
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
smallview; l; fit
bopcheck result
checknbshapes result -m UnifySameDomain -face 225 -edge 576
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
--- /dev/null
+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