]> OCCT Git - occt.git/commitdiff
0033421: Modeling Algorithms - ShapeUpgrade_UnifySameDomain throws exception
authorakaftasev <akaftasev@opencascade.com>
Tue, 1 Aug 2023 12:10:47 +0000 (13:10 +0100)
committerjfa <jfa@opencascade.com>
Tue, 17 Oct 2023 08:41:54 +0000 (09:41 +0100)
In method ShapeUpgrade_UnifySameDomain::IntUnifyFaces() the searched edge is finally checked that it is not empty before accessing it.

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

index 117931b3b1804d9864e1db013e4d780b0a719e3e..a8a0b7f759ccd9a5cf169a7c1aecd085926ffa00 100644 (file)
@@ -3535,6 +3535,10 @@ void ShapeUpgrade_UnifySameDomain::IntUnifyFaces(const TopoDS_Shape& theInpShape
               
               ReconstructMissedSeam (RemovedEdges, F_RefFace, CurEdge, CurVertex, CurPoint,
                                      Uperiod, Vperiod, NextEdge, NextPoint);
+              if (NextEdge.IsNull())
+              {
+                return;
+              }
             }
             else
               return;
diff --git a/tests/bugs/heal/bug33421 b/tests/bugs/heal/bug33421
new file mode 100644 (file)
index 0000000..fcfebd2
--- /dev/null
@@ -0,0 +1,19 @@
+puts "TODO CR33439 ALL: Error :  is WRONG because number of EDGE entities in shape"
+puts "TODO CR33439 ALL: Error :  is WRONG because number of WIRE entities in shape"
+puts "TODO CR33439 ALL: Error :  is WRONG because number of FACE entities in shape"
+
+puts "========================================="
+puts "0033421: Modeling Algorithms - ShapeUpgrade_UnifySameDomain fails"
+puts "========================================="
+puts ""
+
+pcylinder c1 10 10
+copy c1 c2
+tmirror c2 0 0 10 0 0 1
+bop c1 c2
+bopfuse c3
+
+unifysamedom result c3
+
+checknbshapes result -t -solid 1 -shell 1 -face 3 -wire 3 -edge 3 -vertex 3
+checkview -display result -2d -path ${imagedir}/${test_image}.png