TopoNaming: restore defenses against multisolids when enabled

This commit is contained in:
bgbsww
2024-05-21 21:42:05 -04:00
parent db85748e7d
commit c54a98718f
5 changed files with 27 additions and 4 deletions

View File

@@ -198,6 +198,9 @@ App::DocumentObjectExecReturn *Chamfer::execute()
shape = refineShapeIfActive(shape);
shape = getSolid(shape);
}
if (!isSingleSolidRuleSatisfied(shape.getShape())) {
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported."));
}
this->Shape.setValue(shape);
if (failed) {
return new App::DocumentObjectExecReturn(

View File

@@ -717,8 +717,10 @@ App::DocumentObjectExecReturn* FeatureExtrude::buildExtrusion(ExtrudeOptions opt
return new App::DocumentObjectExecReturn(
QT_TRANSLATE_NOOP("Exception", "Resulting shape is not a solid"));
}
solRes = refineShapeIfActive(solRes);
if (!isSingleSolidRuleSatisfied(solRes.getShape())) {
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported."));
}
this->Shape.setValue(getSolid(solRes));
}
else if (prism.hasSubShape(TopAbs_SOLID)) {
@@ -726,10 +728,17 @@ App::DocumentObjectExecReturn* FeatureExtrude::buildExtrusion(ExtrudeOptions opt
prism.makeElementFuse(prism.getSubTopoShapes(TopAbs_SOLID));
}
prism = refineShapeIfActive(prism);
this->Shape.setValue(getSolid(prism));
prism = getSolid(prism);
if (!isSingleSolidRuleSatisfied(prism.getShape())) {
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported."));
}
this->Shape.setValue(prism);
}
else {
prism = refineShapeIfActive(prism);
if (!isSingleSolidRuleSatisfied(prism.getShape())) {
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported."));
}
this->Shape.setValue(prism);
}

View File

@@ -114,6 +114,9 @@ App::DocumentObjectExecReturn *Fillet::execute()
shape = refineShapeIfActive(shape);
shape = getSolid(shape);
}
if (!isSingleSolidRuleSatisfied(shape.getShape())) {
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported."));
}
this->Shape.setValue(shape);
if (failed) {

View File

@@ -352,7 +352,11 @@ App::DocumentObjectExecReturn *Groove::execute()
return new App::DocumentObjectExecReturn("Resulting shape is not a solid");
boolOp = refineShapeIfActive(boolOp);
Shape.setValue(getSolid(boolOp));
boolOp = getSolid(boolOp);
if (!isSingleSolidRuleSatisfied(boolOp.getShape())) {
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported."));
}
Shape.setValue(boolOp);
return App::DocumentObject::StdReturn;
}
catch (Standard_Failure& e) {

View File

@@ -532,7 +532,11 @@ App::DocumentObjectExecReturn *Loft::execute(void)
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Resulting shape is not a solid"));
boolOp = refineShapeIfActive(boolOp);
Shape.setValue(getSolid(boolOp));
boolOp = getSolid(boolOp);
if (!isSingleSolidRuleSatisfied(boolOp.getShape())) {
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Result has multiple solids: that is not currently supported."));
}
Shape.setValue(boolOp);
return App::DocumentObject::StdReturn;
}
catch (Standard_Failure& e) {