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)
This commit is contained in:
David Osterberg
2021-01-08 13:33:37 +01:00
committed by abdullahtahiriyo
parent 8924bd4734
commit de5c8574d3
2 changed files with 9 additions and 6 deletions

View File

@@ -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;

View File

@@ -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