0032444: Modeling Algorithm - BRepOffsetAPI_MakePipeShell crash when using -DT mode...
authorakaftasev <akaftasev@opencascade.com>
Wed, 20 Oct 2021 10:02:09 +0000 (13:02 +0300)
committersmoskvin <smoskvin@opencascade.com>
Fri, 29 Oct 2021 14:18:18 +0000 (17:18 +0300)
Added checking for null edges in BRepFill_TrimShellCorner::ChooseSection()

src/BRepFill/BRepFill_TrimShellCorner.cxx
tests/bugs/modalg_7/bug32444 [new file with mode: 0644]

index 78a232e..65ce9a9 100644 (file)
@@ -890,6 +890,11 @@ Standard_Boolean BRepFill_TrimShellCorner::ChooseSection(const TopoDS_Shape& Com
     if (LastEdge.IsNull())
       return Standard_False;
 
+    if (FirstEdge.IsNull() || LastEdge.IsNull())
+    {
+      return Standard_False;
+    }
+
     BB.Add(NewWire, FirstEdge);
 
     if (!FirstEdge.IsSame(LastEdge))
diff --git a/tests/bugs/modalg_7/bug32444 b/tests/bugs/modalg_7/bug32444
new file mode 100644 (file)
index 0000000..6ff8240
--- /dev/null
@@ -0,0 +1,25 @@
+puts "============================================"
+puts "0032444: BRepOffsetAPI_MakePipeShell crash when using -DT mode and DT_ShapeDivide on the spine"
+puts "============================================"
+puts ""
+
+restore [locate_data_file bug32444.brep] s
+restore [locate_data_file bug32444_1.brep] p1
+restore [locate_data_file bug32444_2.brep] p2
+restore [locate_data_file bug32444_3.brep] p3
+restore [locate_data_file bug32444_4.brep] p4
+restore [locate_data_file bug32444_5.brep] p5
+restore [locate_data_file bug32444_6.brep] p6
+
+DT_ShapeDivide s s 0.001
+
+mksweep s 
+setsweep -DT
+addsweep p1
+addsweep p2
+addsweep p3
+addsweep p4
+addsweep p5
+addsweep p6
+
+buildsweep r -C -S