PartDesign: Refactor single-solid rule enforcement
This refactors a single solid rule checking code from using the solid count directly to using well abstracted `isSingleSolidRuleSatisfied` method. This makes code easier to read and is the basis for next step which is allowing users to disable this checks.
This commit is contained in:
committed by
Adrián Insaurralde Avalos
parent
f937d4579a
commit
935bdf9a0f
@@ -398,8 +398,7 @@ App::DocumentObjectExecReturn *Pipe::execute()
|
||||
if (boolOp.IsNull())
|
||||
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Resulting shape is not a solid"));
|
||||
|
||||
int solidCount = countSolids(boolOp);
|
||||
if (solidCount > 1) {
|
||||
if (!isSingleSolidRuleSatisfied(boolOp)) {
|
||||
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception",
|
||||
"Result has multiple solids: that is not currently supported."));
|
||||
}
|
||||
@@ -418,8 +417,7 @@ App::DocumentObjectExecReturn *Pipe::execute()
|
||||
if (boolOp.IsNull())
|
||||
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Resulting shape is not a solid"));
|
||||
|
||||
int solidCount = countSolids(boolOp);
|
||||
if (solidCount > 1) {
|
||||
if (!isSingleSolidRuleSatisfied(boolOp)) {
|
||||
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception",
|
||||
"Result has multiple solids: that is not currently supported."));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user