0030905: Modeling Algorithms - Faulty shapes in UnifySameDomain
authoremv <emv@opencascade.com>
Tue, 20 Aug 2019 11:23:29 +0000 (14:23 +0300)
committerapn <apn@opencascade.com>
Fri, 23 Aug 2019 13:56:39 +0000 (16:56 +0300)
Make face FORWARD before adding wire in it.

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

index 6489c4e..5edb2c1 100644 (file)
@@ -2691,10 +2691,11 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape
       }
       else if (NewFaces.Length() == 1)
       {
+        TopoDS_Shape aNewFace = NewFaces(1).Oriented (TopAbs_FORWARD);
         for (Standard_Integer ii = 1; ii <= NewWires.Length(); ii++)
-          BB.Add(NewFaces(1), NewWires(ii));
+          BB.Add(aNewFace, NewWires(ii));
         for (Standard_Integer ii = 1; ii <= InternalWires.Length(); ii++)
-          BB.Add(NewFaces(1), InternalWires(ii));
+          BB.Add(aNewFace, InternalWires(ii));
         myContext->Merge(faces, NewFaces(1));
       }
       else
diff --git a/tests/bugs/modalg_7/bug30905 b/tests/bugs/modalg_7/bug30905
new file mode 100644 (file)
index 0000000..5f06a62
--- /dev/null
@@ -0,0 +1,16 @@
+puts "======================================================="
+puts "0030905: Modeling Algorithms - Invalid shapes in UnifySameDomain"
+puts "======================================================="
+puts ""
+
+restore [locate_data_file bug30905.brep] a
+
+unifysamedom result a
+
+checkshape result
+
+checknbshapes result -solid 1 -shell 1 -face 56 -wire 61 -edge 148 -vertex 93 -t
+
+checkprops result -s 835.815 -v 339.409
+
+checkview -display result -2d -path ${imagedir}/${test_image}.png