PD: [skip ci] set angle constraints for groove

This commit is contained in:
wmayer
2021-03-03 14:55:19 +01:00
parent 2caa07c291
commit 86751fd944
2 changed files with 6 additions and 0 deletions

View File

@@ -55,6 +55,8 @@ namespace PartDesign {
PROPERTY_SOURCE(PartDesign::Groove, PartDesign::ProfileBased)
const App::PropertyAngle::Constraints Groove::floatAngle = { Base::toDegrees<double>(Precision::Angular()), 360.0, 1.0 };
Groove::Groove()
{
addSubType = FeatureAddSub::Subtractive;
@@ -62,6 +64,7 @@ Groove::Groove()
ADD_PROPERTY_TYPE(Base,(Base::Vector3d(0.0f,0.0f,0.0f)),"Groove", App::Prop_ReadOnly, "Base");
ADD_PROPERTY_TYPE(Axis,(Base::Vector3d(0.0f,1.0f,0.0f)),"Groove", App::Prop_ReadOnly, "Axis");
ADD_PROPERTY_TYPE(Angle,(360.0),"Groove", App::Prop_None, "Angle");
Angle.setConstraints(&floatAngle);
ADD_PROPERTY_TYPE(ReferenceAxis,(0),"Groove",(App::PropertyType)(App::Prop_None),"Reference axis of Groove");
}
@@ -86,6 +89,7 @@ App::DocumentObjectExecReturn *Groove::execute(void)
return new App::DocumentObjectExecReturn("Angle of groove too large");
angle = Base::toRadians<double>(angle);
// Reverse angle if selected
if (Reversed.getValue() && !Midplane.getValue())
angle *= (-1.0);

View File

@@ -68,6 +68,8 @@ public:
protected:
/// updates Axis from ReferenceAxis
void updateAxis(void);
static const App::PropertyAngle::Constraints floatAngle;
};
} //namespace PartDesign