From d3afb32487b8f145b29fd07b4e7d6bc4c3fb077f Mon Sep 17 00:00:00 2001 From: WandererFan Date: Thu, 8 Sep 2016 14:27:04 -0400 Subject: [PATCH] Avoid Bnd_Box is void exception when shapes don't intersect. --- src/Mod/TechDraw/App/DrawViewSection.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Mod/TechDraw/App/DrawViewSection.cpp b/src/Mod/TechDraw/App/DrawViewSection.cpp index 075353839..a036c6fbe 100644 --- a/src/Mod/TechDraw/App/DrawViewSection.cpp +++ b/src/Mod/TechDraw/App/DrawViewSection.cpp @@ -28,6 +28,8 @@ #ifndef _PreComp_ # include +#include +#include #include #include #include @@ -196,6 +198,12 @@ App::DocumentObjectExecReturn *DrawViewSection::execute(void) return new App::DocumentObjectExecReturn("Section cut has failed"); TopoDS_Shape rawShape = mkCut.Shape(); + Bnd_Box testBox; + BRepBndLib::Add(rawShape, testBox); + testBox.SetGap(0.0); + if (testBox.IsVoid()) { //prism & input don't intersect. rawShape is garbage, don't bother. + return DrawView::execute(); + } geometryObject->setTolerance(Tolerance.getValue()); geometryObject->setScale(Scale.getValue());