PartDesign: decouple refine and other geometric computation (#17008)

This commit is contained in:
Florian Foinant-Willig
2024-12-02 17:57:30 +01:00
committed by GitHub
parent 32e339447a
commit 115667f73a
14 changed files with 141 additions and 5 deletions

View File

@@ -126,6 +126,13 @@ short Helix::mustExecute() const
App::DocumentObjectExecReturn* Helix::execute()
{
if (onlyHasToRefine()){
TopoShape result = refineShapeIfActive(rawShape, RefineErrorPolicy::Warn);
Shape.setValue(result);
return App::DocumentObject::StdReturn;
}
// Validate and normalize parameters
HelixMode mode = static_cast<HelixMode>(Mode.getValue());
if (mode == HelixMode::pitch_height_angle) {
@@ -268,6 +275,8 @@ App::DocumentObjectExecReturn* Helix::execute()
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Error: Result has multiple solids"));
}
// store shape before refinement
this->rawShape = result;
Shape.setValue(getSolid(result));
return App::DocumentObject::StdReturn;
}
@@ -290,6 +299,8 @@ App::DocumentObjectExecReturn* Helix::execute()
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Error: Result has multiple solids"));
}
// store shape before refinement
this->rawShape = boolOp;
boolOp = refineShapeIfActive(boolOp, RefineErrorPolicy::Warn);
Shape.setValue(getSolid(boolOp));
}
@@ -319,6 +330,8 @@ App::DocumentObjectExecReturn* Helix::execute()
return new App::DocumentObjectExecReturn(QT_TRANSLATE_NOOP("Exception", "Error: Result has multiple solids"));
}
// store shape before refinement
this->rawShape = boolOp;
boolOp = refineShapeIfActive(boolOp, RefineErrorPolicy::Warn);
Shape.setValue(getSolid(boolOp));
}