0026644: ShapeUpgrade_UnifySameDomain - strange behavior
authorgka <gka@opencascade.com>
Thu, 10 Sep 2015 14:11:05 +0000 (17:11 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 10 Sep 2015 14:12:07 +0000 (17:12 +0300)
Made modification to get valid shape after operation ShapeUpgrade_UnifySameDomain for non-manifold input shape

Test case for issue CR26644

src/ShapeUpgrade/ShapeUpgrade_UnifySameDomain.cxx
tests/bugs/heal/bug26644 [new file with mode: 0644]

index 60ef5a3..346bf43 100644 (file)
@@ -1072,23 +1072,17 @@ static void putIntWires(TopoDS_Shape& theFace, TopTools_SequenceOfShape& theWire
 
 void ShapeUpgrade_UnifySameDomain::UnifyFaces()
 {
-  //Handle(ShapeBuild_ReShape) myContext = new ShapeBuild_ReShape;
-  TopoDS_Shape aResShape = myContext->Apply(myShape);
-
+  // creating map of edge faces
+  TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces;
+  TopExp::MapShapesAndAncestors(myShape, TopAbs_EDGE, TopAbs_FACE, aMapEdgeFaces);
   // processing each shell
   TopExp_Explorer exps;
   for (exps.Init(myShape, TopAbs_SHELL); exps.More(); exps.Next()) {
     TopoDS_Shell aShell = TopoDS::Shell(exps.Current());
-
-    // creating map of edge faces
-    TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces;
-    TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMapEdgeFaces);
-
+    
     // map of processed shapes
     TopTools_MapOfShape aProcessed;
 
-    //Handle(ShapeBuild_ReShape) aContext = new ShapeBuild_ReShape;
-
     Standard_Integer NbModif = 0;
     Standard_Boolean hasFailed = Standard_False;
     Standard_Real tol = Precision::Confusion();
diff --git a/tests/bugs/heal/bug26644 b/tests/bugs/heal/bug26644
new file mode 100644 (file)
index 0000000..bd6400f
--- /dev/null
@@ -0,0 +1,46 @@
+puts "========"
+puts "OCC26644"
+puts "========"
+puts ""
+#######################################################################
+# ShapeUpgrade_UnifySameDomain - strange behavior
+#######################################################################
+
+restore [locate_data_file bug26644_input.brep] a
+
+# 1
+checkarea a 158.466 1e-1 0.01
+
+nbshapes a -t
+
+vinit
+vsetdispmode 1
+vclear
+vdisplay a
+vfit
+vdump ${imagedir}/${casename}_1.png
+
+# 2
+unifysamedom r a +f +e -b
+
+checkshape r f
+
+checkarea a 158.466 1e-1 0.01
+
+set nbshapes_expected "
+Number of shapes in shape
+ VERTEX    : 32
+ EDGE      : 50
+ WIRE      : 23
+ FACE      : 23
+ SHELL     : 3
+ SOLID     : 3
+ COMPSOLID : 0
+ COMPOUND  : 1
+ SHAPE     : 135
+"
+checknbshapes r -ref ${nbshapes_expected} -t -m "Shape Upgrade"
+
+vclear
+vdisplay r
+vdump ${imagedir}/${casename}_2.png