fixes 0003694: Part->Boolean->Cut should show error message if a non-solid (Shell, etc.) is selected

This commit is contained in:
wmayer
2019-02-21 16:55:59 +01:00
parent 56fb560e4f
commit e55b718cd6

View File

@@ -89,7 +89,15 @@ App::DocumentObjectExecReturn *Boolean::execute(void)
std::unique_ptr<BRepAlgoAPI_BooleanOperation> 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()) {