0027894: Crash when calling ShapeUpgrade_UnifySameDomain
authormsv <msv@opencascade.com>
Thu, 9 Feb 2017 12:44:06 +0000 (15:44 +0300)
committerapn <apn@opencascade.com>
Thu, 9 Feb 2017 13:16:13 +0000 (16:16 +0300)
- Avoid getting pcurve of edge on not connected face.
- Avoid building wire of empty set of edges.

Small correction of test case for issue CR27894

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

index d28f0aa..adb252f 100644 (file)
@@ -1374,7 +1374,7 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape
         if (IsSameDomain(aFace,anCheckedFace, myLinTol, myAngTol)) {
 
           // hotfix for 27271: prevent merging along periodic direction.
-          if (IsLikeSeam(edge, aFace, aBaseSurface))
+          if (IsLikeSeam(edge, anCheckedFace, aBaseSurface))
             continue;
 
           // replacing pcurves
@@ -1574,6 +1574,8 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape
             }
             sawo.Add(c2d->Value(f).XY(),c2d->Value(l).XY());
           }
+          if (sawo.NbEdges() == 0)
+            continue;
           sawo.Perform();
 
           // constructind one degenerative edge
diff --git a/tests/bugs/heal/bug27894 b/tests/bugs/heal/bug27894
new file mode 100644 (file)
index 0000000..a2064ba
--- /dev/null
@@ -0,0 +1,15 @@
+puts "============"
+puts "OCC27894"
+puts "============"
+puts ""
+###############################
+## Crash when calling ShapeUpgrade_UnifySameDomain
+###############################
+
+stepread [locate_data_file bug27894_usd_raises_Standard_NullObject.stp] a *
+renamevar a_1 a
+unifysamedom result a
+
+checknbshapes result -m UnifySameDomain -face 18 -edge 45
+
+checkview -display result -2d -path ${imagedir}/${test_image}.png