From e55b718cd63fcd33891c47644680c687010fadcf Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 21 Feb 2019 16:55:59 +0100 Subject: [PATCH] fixes 0003694: Part->Boolean->Cut should show error message if a non-solid (Shell, etc.) is selected --- src/Mod/Part/App/FeaturePartBoolean.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Mod/Part/App/FeaturePartBoolean.cpp b/src/Mod/Part/App/FeaturePartBoolean.cpp index 4079b94826..6253649f5a 100644 --- a/src/Mod/Part/App/FeaturePartBoolean.cpp +++ b/src/Mod/Part/App/FeaturePartBoolean.cpp @@ -89,7 +89,15 @@ App::DocumentObjectExecReturn *Boolean::execute(void) std::unique_ptr mkBool(makeOperation(BaseShape, ToolShape)); if (!mkBool->IsDone()) { - return new App::DocumentObjectExecReturn("Boolean operation failed"); + std::stringstream error; + error << "Boolean operation failed"; + if (BaseShape.ShapeType() != TopAbs_SOLID) { + error << std::endl << base->Label.getValue() << " is not a solid"; + } + if (ToolShape.ShapeType() != TopAbs_SOLID) { + error << std::endl << tool->Label.getValue() << " is not a solid"; + } + return new App::DocumentObjectExecReturn(error.str()); } TopoDS_Shape resShape = mkBool->Shape(); if (resShape.IsNull()) {