[PD] disallow angles <=0 for holes and revolution

neither the taper, drill or countersink angle can be zero or negative for a valid hole, thus set a constraint
This commit is contained in:
donovaly
2021-03-02 04:02:23 +01:00
committed by wmayer
parent 6c57cebc9b
commit 2caa07c291
4 changed files with 12 additions and 0 deletions

View File

@@ -645,6 +645,8 @@ const char* Hole::ThreadDirectionEnums[] = { "Right", "Left", NULL};
PROPERTY_SOURCE(PartDesign::Hole, PartDesign::ProfileBased)
const App::PropertyAngle::Constraints Hole::floatAngle = { Base::toDegrees<double>(Precision::Angular()), 360.0, 1.0 };
Hole::Hole()
{
addSubType = FeatureAddSub::Subtractive;
@@ -683,6 +685,7 @@ Hole::Hole()
ADD_PROPERTY_TYPE(HoleCutDepth, (0.0), "Hole", App::Prop_None, "Head cut deth");
ADD_PROPERTY_TYPE(HoleCutCountersinkAngle, (90.0), "Hole", App::Prop_None, "Head cut countersink angle");
HoleCutCountersinkAngle.setConstraints(&floatAngle);
ADD_PROPERTY_TYPE(DepthType, (0L), "Hole", App::Prop_None, "Type");
DepthType.setEnums(DepthTypeEnums);
@@ -693,12 +696,14 @@ Hole::Hole()
DrillPoint.setEnums(DrillPointEnums);
ADD_PROPERTY_TYPE(DrillPointAngle, (118.0), "Hole", App::Prop_None, "Drill point angle");
DrillPointAngle.setConstraints(&floatAngle);
ADD_PROPERTY_TYPE(DrillForDepth, ((long)0), "Hole", App::Prop_None,
"The size of the drill point will be taken into\n account for the depth of blind holes");
ADD_PROPERTY_TYPE(Tapered, (false),"Hole", App::Prop_None, "Tapered");
ADD_PROPERTY_TYPE(TaperedAngle, (90.0), "Hole", App::Prop_None, "Tapered angle");
TaperedAngle.setConstraints(&floatAngle);
ADD_PROPERTY_TYPE(ThreadDepthType, (0L), "Hole", App::Prop_None, "Thread depth type");
ThreadDepthType.setEnums(ThreadDepthTypeEnums);