Skip to content

Commit

Permalink
[PartDesign] Draft angle property change from App::PropertyFloatConst…
Browse files Browse the repository at this point in the history
…raint to App::PropertyAngle
  • Loading branch information
mwganson authored and wwmayer committed Sep 14, 2019
1 parent 79a7228 commit ecd4038
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/Mod/PartDesign/App/FeatureDraft.cpp
Expand Up @@ -65,12 +65,10 @@ using namespace PartDesign;

PROPERTY_SOURCE(PartDesign::Draft, PartDesign::DressUp)

const App::PropertyFloatConstraint::Constraints floatAngle = {0.0,89.99,0.1};

Draft::Draft()
{
ADD_PROPERTY(Angle,(1.5));
Angle.setConstraints(&floatAngle);
ADD_PROPERTY_TYPE(NeutralPlane,(0),"Draft",(App::PropertyType)(App::Prop_None),"NeutralPlane");
ADD_PROPERTY_TYPE(PullDirection,(0),"Draft",(App::PropertyType)(App::Prop_None),"PullDirection");
ADD_PROPERTY(Reversed,(0));
Expand Down Expand Up @@ -105,7 +103,10 @@ App::DocumentObjectExecReturn *Draft::execute(void)
return new App::DocumentObjectExecReturn("No faces specified");

// Draft angle
double angle = Angle.getValue() / 180.0 * M_PI;
double angle = Angle.getValue();
angle = angle >= 90.0 ? 89.99 : angle < 0.0 ? 0.0 : angle;
Angle.setValue(angle);
angle = angle / 180.0 * M_PI;

// Pull direction
gp_Dir pullDirection;
Expand Down
3 changes: 2 additions & 1 deletion src/Mod/PartDesign/App/FeatureDraft.h
Expand Up @@ -25,6 +25,7 @@
#define PARTDESIGN_FEATUREDRAFT_H

#include <App/PropertyStandard.h>
#include <App/PropertyUnits.h>
#include <App/PropertyLinks.h>
#include "FeatureDressUp.h"

Expand All @@ -38,7 +39,7 @@ class PartDesignExport Draft : public DressUp
public:
Draft();

App::PropertyFloatConstraint Angle;
App::PropertyAngle Angle;
App::PropertyLinkSub NeutralPlane;
App::PropertyLinkSub PullDirection;
App::PropertyBool Reversed;
Expand Down

0 comments on commit ecd4038

Please sign in to comment.