From 0c4931e8737cc1e3f40fe516dcecf3bfe3095db1 Mon Sep 17 00:00:00 2001 From: akaftasev Date: Wed, 20 Oct 2021 13:02:09 +0300 Subject: [PATCH] 0032444: Modeling Algorithm - BRepOffsetAPI_MakePipeShell crash when using -DT mode and DT_ShapeDivide on the spine Added checking for null edges in BRepFill_TrimShellCorner::ChooseSection() --- src/BRepFill/BRepFill_TrimShellCorner.cxx | 5 +++++ tests/bugs/modalg_7/bug32444 | 25 +++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tests/bugs/modalg_7/bug32444 diff --git a/src/BRepFill/BRepFill_TrimShellCorner.cxx b/src/BRepFill/BRepFill_TrimShellCorner.cxx index 78a232e75d..65ce9a96f6 100644 --- a/src/BRepFill/BRepFill_TrimShellCorner.cxx +++ b/src/BRepFill/BRepFill_TrimShellCorner.cxx @@ -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 index 0000000000..6ff8240f78 --- /dev/null +++ b/tests/bugs/modalg_7/bug32444 @@ -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