in mult-fusion feature check if input shapes are valid
This commit is contained in:
@@ -136,24 +136,30 @@ App::DocumentObjectExecReturn *MultiFuse::execute(void)
|
||||
#else
|
||||
BRepAlgoAPI_Fuse mkFuse;
|
||||
TopTools_ListOfShape shapeArguments,shapeTools;
|
||||
shapeArguments.Append(s.front());
|
||||
const TopoDS_Shape& shape = s.front();
|
||||
if (shape.IsNull())
|
||||
throw Base::RuntimeError("Input shape is null");
|
||||
shapeArguments.Append(shape);
|
||||
|
||||
for (std::vector<TopoDS_Shape>::iterator it = s.begin()+1; it != s.end(); ++it) {
|
||||
if (it->IsNull())
|
||||
throw Base::Exception("Input shape is null");
|
||||
throw Base::RuntimeError("Input shape is null");
|
||||
shapeTools.Append(*it);
|
||||
}
|
||||
|
||||
mkFuse.SetArguments(shapeArguments);
|
||||
mkFuse.SetTools(shapeTools);
|
||||
mkFuse.Build();
|
||||
if (!mkFuse.IsDone())
|
||||
throw Base::Exception("MultiFusion failed");
|
||||
throw Base::RuntimeError("MultiFusion failed");
|
||||
|
||||
TopoDS_Shape resShape = mkFuse.Shape();
|
||||
for (std::vector<TopoDS_Shape>::iterator it = s.begin(); it != s.end(); ++it) {
|
||||
history.push_back(buildHistory(mkFuse, TopAbs_FACE, resShape, *it));
|
||||
}
|
||||
#endif
|
||||
if (resShape.IsNull())
|
||||
throw Base::Exception("Resulting shape is null");
|
||||
throw Base::RuntimeError("Resulting shape is null");
|
||||
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/Part/Boolean");
|
||||
|
||||
Reference in New Issue
Block a user