| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| |
|
| | #include <Mod/Part/App/FCBRepAlgoAPI_Fuse.h>
|
| | #include <Precision.hxx>
|
| | #include <TopExp_Explorer.hxx>
|
| | #include <TopoDS.hxx>
|
| | #include <TopoDS_Face.hxx>
|
| |
|
| |
|
| | #include <App/DocumentObject.h>
|
| | #include <Base/Console.h>
|
| | #include <Base/Exception.h>
|
| |
|
| | #include "FeaturePad.h"
|
| |
|
| | using namespace PartDesign;
|
| |
|
| |
|
| |
|
| |
|
| |
|
| | const char* Pad::TypeEnums[]
|
| | = {"Length", "UpToLast", "UpToFirst", "UpToFace", "?TwoLengths", "UpToShape", nullptr};
|
| |
|
| | PROPERTY_SOURCE(PartDesign::Pad, PartDesign::FeatureExtrude)
|
| |
|
| | Pad::Pad()
|
| | {
|
| | addSubType = FeatureAddSub::Additive;
|
| |
|
| | ADD_PROPERTY_TYPE(SideType, (0L), "Pad", App::Prop_None, "Type of sides definition");
|
| | ADD_PROPERTY_TYPE(Type, (0L), "Side1", App::Prop_None, "Pad type for side 1");
|
| | ADD_PROPERTY_TYPE(Type2, (0L), "Side2", App::Prop_None, "Pad type for side 2");
|
| | SideType.setEnums(SideTypesEnums);
|
| | Type.setEnums(TypeEnums);
|
| | Type2.setEnums(TypeEnums);
|
| | ADD_PROPERTY_TYPE(Length, (10.0), "Side1", App::Prop_None, "Pad length");
|
| | ADD_PROPERTY_TYPE(Length2, (10.0), "Side2", 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, (nullptr), "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, (nullptr), "Side1", App::Prop_None, "Face where pad will end");
|
| | ADD_PROPERTY_TYPE(UpToShape, (nullptr), "Side1", App::Prop_None, "Faces or shape(s) where pad will end");
|
| | ADD_PROPERTY_TYPE(UpToFace2, (nullptr), "Side2", App::Prop_None, "Face where pad will end on side2");
|
| | ADD_PROPERTY_TYPE(
|
| | UpToShape2,
|
| | (nullptr),
|
| | "Side2",
|
| | App::Prop_None,
|
| | "Faces or shape(s) where pad will end on side2"
|
| | );
|
| | ADD_PROPERTY_TYPE(Offset, (0.0), "Side1", App::Prop_None, "Offset from face in which pad will end");
|
| | ADD_PROPERTY_TYPE(
|
| | Offset2,
|
| | (0.0),
|
| | "Side2",
|
| | App::Prop_None,
|
| | "Offset from face in which pad will end on side 2"
|
| | );
|
| | Offset.setConstraints(&signedLengthConstraint);
|
| | Offset2.setConstraints(&signedLengthConstraint);
|
| | ADD_PROPERTY_TYPE(TaperAngle, (0.0), "Side1", App::Prop_None, "Taper angle");
|
| | TaperAngle.setConstraints(&floatAngle);
|
| | ADD_PROPERTY_TYPE(TaperAngle2, (0.0), "Side2", App::Prop_None, "Taper angle for 2nd direction");
|
| | TaperAngle2.setConstraints(&floatAngle);
|
| |
|
| |
|
| |
|
| | Length.setConstraints(nullptr);
|
| | Length2.setConstraints(nullptr);
|
| | }
|
| |
|
| |
|
| | App::DocumentObjectExecReturn* Pad::execute()
|
| | {
|
| | return buildExtrusion(ExtrudeOption::MakeFace | ExtrudeOption::MakeFuse);
|
| | }
|
| |
|