Skip to content

Commit

Permalink
PartDesign: fix FeatureDressUp base checking
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder authored and wwmayer committed Feb 14, 2020
1 parent 469614e commit 3a90022
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
24 changes: 12 additions & 12 deletions src/Mod/PartDesign/App/FeatureDressUp.cpp
Expand Up @@ -50,17 +50,12 @@ DressUp::DressUp()
ADD_PROPERTY(Base,(0));
Placement.setStatus(App::Property::ReadOnly, true);

ADD_PROPERTY_TYPE(SupportTransform,(false),"Base", App::Prop_None,
"Enable support for transform patterns");
ADD_PROPERTY_TYPE(SupportTransform,(true),"Base", App::Prop_None,
"Enable support for transformed patterns");

addSubType = Additive;
}

void DressUp::setupObject() {
SupportTransform.setValue(true);
FeatureAddSub::setupObject();
}

short DressUp::mustExecute() const
{
if (Base.getValue() && Base.getValue()->isTouched())
Expand Down Expand Up @@ -191,14 +186,19 @@ void DressUp::onChanged(const App::Property* prop)
s = getBaseShape();
else
s = Shape.getShape();
} else if (!SupportTransform.getValue()) {
addSubType = base->getAddSubType();
s = base->AddSubShape.getShape();
} else {
addSubType = base->getAddSubType();
if(!SupportTransform.getValue())
s = base->AddSubShape.getShape();
else if(addSubType == Additive)
s = Shape.getShape().cut(base->getBaseShape());
auto baseBase = base->getBaseObject(true);
if(!baseBase) {
s = Shape.getShape();
addSubType = Additive;
} else if (addSubType == Additive)
s = Shape.getShape().cut(base->getBaseTopoShape().getShape());
else
s = TopoShape(base->getBaseShape()).cut(Shape.getValue());
s = base->getBaseTopoShape().cut(Shape.getValue());
}
AddSubShape.setValue(s);
}
Expand Down
2 changes: 0 additions & 2 deletions src/Mod/PartDesign/App/FeatureDressUp.h
Expand Up @@ -45,8 +45,6 @@ class PartDesignExport DressUp : public PartDesign::FeatureAddSub
App::PropertyLinkSub Base;
App::PropertyBool SupportTransform;

virtual void setupObject();

short mustExecute() const;
/// updates the Placement property from the Placement of the BaseFeature
void positionByBaseFeature(void);
Expand Down

0 comments on commit 3a90022

Please sign in to comment.