diff --git a/src/Mod/PartDesign/App/FeatureGroove.cpp b/src/Mod/PartDesign/App/FeatureGroove.cpp index 27cc5653a8..7738a9a5a2 100644 --- a/src/Mod/PartDesign/App/FeatureGroove.cpp +++ b/src/Mod/PartDesign/App/FeatureGroove.cpp @@ -55,6 +55,8 @@ namespace PartDesign { PROPERTY_SOURCE(PartDesign::Groove, PartDesign::ProfileBased) +const App::PropertyAngle::Constraints Groove::floatAngle = { Base::toDegrees(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(angle); + // Reverse angle if selected if (Reversed.getValue() && !Midplane.getValue()) angle *= (-1.0); diff --git a/src/Mod/PartDesign/App/FeatureGroove.h b/src/Mod/PartDesign/App/FeatureGroove.h index 3e154fd5a0..e60f791c73 100644 --- a/src/Mod/PartDesign/App/FeatureGroove.h +++ b/src/Mod/PartDesign/App/FeatureGroove.h @@ -68,6 +68,8 @@ public: protected: /// updates Axis from ReferenceAxis void updateAxis(void); + + static const App::PropertyAngle::Constraints floatAngle; }; } //namespace PartDesign