[PD] Pad/Pocket: sort out common code

- sort out a constraint used by Pad and Pocket
- also unify Length2 parameter naming
This commit is contained in:
Uwe
2022-01-08 00:45:19 +01:00
parent f31fe30c57
commit e2f883fcc4
4 changed files with 11 additions and 10 deletions

View File

@@ -66,15 +66,14 @@ Pad::Pad()
ADD_PROPERTY_TYPE(Type, (0L), "Pad", App::Prop_None, "Pad type");
Type.setEnums(TypeEnums);
ADD_PROPERTY_TYPE(Length, (100.0), "Pad", App::Prop_None,"Pad length");
ADD_PROPERTY_TYPE(Length2, (100.0), "Pad", App::Prop_None,"Second Pad length");
ADD_PROPERTY_TYPE(Length, (100.0), "Pad", App::Prop_None, "Pad length");
ADD_PROPERTY_TYPE(Length2, (100.0), "Pad", App::Prop_None, "Pad length in 2nd direction");
ADD_PROPERTY_TYPE(UseCustomVector, (false), "Pad", App::Prop_None, "Use custom vector for pad direction");
ADD_PROPERTY_TYPE(Direction, (Base::Vector3d(1.0, 1.0, 1.0)), "Pad", App::Prop_None, "Pad direction vector");
ADD_PROPERTY_TYPE(ReferenceAxis, (0), "Pad", App::Prop_None, "Reference axis of direction");
ADD_PROPERTY_TYPE(AlongSketchNormal, (true), "Pad", App::Prop_None, "Measure pad length along the sketch normal direction");
ADD_PROPERTY_TYPE(UpToFace, (0), "Pad", App::Prop_None, "Face where pad will end");
ADD_PROPERTY_TYPE(Offset, (0.0), "Pad", App::Prop_None, "Offset from face in which pad will end");
static const App::PropertyQuantityConstraint::Constraints signedLengthConstraint = {-DBL_MAX, DBL_MAX, 1.0};
Offset.setConstraints(&signedLengthConstraint);
// Remove the constraints and keep the type to allow to accept negative values