From de5c8574d3388fa2f8ba0f6c35f2ef27db0567e8 Mon Sep 17 00:00:00 2001 From: David Osterberg Date: Fri, 8 Jan 2021 13:33:37 +0100 Subject: [PATCH] PartDesign: Fix small bugs in the Pipe feature - Previously a subtractive pipe on a body with no solids would create a solid. Now Pipe will generate an error. - Fix incorrect property header. Previously Pipe was identifying itself as Pad (copy paste error) --- src/Mod/PartDesign/App/FeaturePipe.cpp | 3 +++ src/Mod/PartDesign/App/FeaturePipe.h | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Mod/PartDesign/App/FeaturePipe.cpp b/src/Mod/PartDesign/App/FeaturePipe.cpp index 6007e1d6d4..fa25ac00eb 100644 --- a/src/Mod/PartDesign/App/FeaturePipe.cpp +++ b/src/Mod/PartDesign/App/FeaturePipe.cpp @@ -303,6 +303,9 @@ App::DocumentObjectExecReturn *Pipe::execute(void) AddSubShape.setValue(result); if(base.IsNull()) { + if (getAddSubType() == FeatureAddSub::Subtractive) + return new App::DocumentObjectExecReturn("Pipe: There is nothing to subtract from\n"); + result = refineShapeIfActive(result); Shape.setValue(getSolid(result)); return App::DocumentObject::StdReturn; diff --git a/src/Mod/PartDesign/App/FeaturePipe.h b/src/Mod/PartDesign/App/FeaturePipe.h index ce563fbbe4..17da66afcc 100644 --- a/src/Mod/PartDesign/App/FeaturePipe.h +++ b/src/Mod/PartDesign/App/FeaturePipe.h @@ -33,12 +33,12 @@ namespace PartDesign class PartDesignExport Pipe : public ProfileBased { - PROPERTY_HEADER(PartDesign::Pad); + PROPERTY_HEADER(PartDesign::Pipe); public: Pipe(); - + App::PropertyLinkSub Spine; App::PropertyBool SpineTangent; App::PropertyLinkSub AuxillerySpine; @@ -57,7 +57,7 @@ public: return "PartDesignGui::ViewProviderPipe"; } //@} - + protected: ///get the given edges and all their tangent ones void getContiniusEdges(Part::TopoShape TopShape, std::vector< std::string >& SubNames); @@ -72,14 +72,14 @@ private: }; class PartDesignExport AdditivePipe : public Pipe { - + PROPERTY_HEADER(PartDesign::AdditivePipe); public: AdditivePipe(); }; class PartDesignExport SubtractivePipe : public Pipe { - + PROPERTY_HEADER(PartDesign::SubtractivePipe); public: SubtractivePipe(); @@ -88,4 +88,4 @@ public: } //namespace PartDesign -#endif // PART_Pad_H +#endif // PART_Pipe_H