PD: Add deprecation warning if Midplane is set

This commit is contained in:
Chris Hennes
2025-12-08 22:38:58 -06:00
committed by Kacper Donat
parent 5ad6a1ba58
commit 67948d60a2
2 changed files with 19 additions and 0 deletions

View File

@@ -129,6 +129,23 @@ bool FeatureExtrude::hasTaperedAngle() const
|| fabs(TaperAngle2.getValue()) > Base::toRadians(Precision::Angular());
}
void FeatureExtrude::onChanged(const App::Property* prop)
{
if (prop == &Midplane) {
// Deprecation notice: Midplane property is deprecated and has been replaced by SideType in
// FreeCAD 1.1 when FeatureExtrude was refactored.
Base::Console().warning(
"The 'Midplane' property is deprecated and has been replaced by the 'SideType' "
"property in FeatureExtrude. Please update your script, this property will be "
"removed in a future version.\n"
);
if (Midplane.getValue()) {
SideType.setValue("Symmetric");
}
}
ProfileBased::onChanged(prop);
}
TopoShape FeatureExtrude::makeShellFromUpToShape(TopoShape shape, TopoShape sketchshape, gp_Dir dir)
{
@@ -932,6 +949,7 @@ void FeatureExtrude::onDocumentRestored()
SideType.setValue("Two sides");
}
else if (Midplane.getValue()) {
// This code is probably now dead, replaced by the onChanged watcher for the Midplane value
Midplane.setValue(false);
SideType.setValue("Symmetric");
}

View File

@@ -77,6 +77,7 @@ protected:
void onDocumentRestored() override;
Base::Vector3d computeDirection(const Base::Vector3d& sketchVector, bool inverse);
bool hasTaperedAngle() const;
void onChanged(const App::Property* prop) override;
/// Options for buildExtrusion()