Skip to content

Commit

Permalink
PartDesign: fix pattern transformation
Browse files Browse the repository at this point in the history
  • Loading branch information
realthunder authored and wwmayer committed Jul 31, 2020
1 parent aefe6e1 commit 4a5cca3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Mod/PartDesign/App/FeatureTransformed.cpp
Expand Up @@ -240,6 +240,9 @@ App::DocumentObjectExecReturn *Transformed::execute(void)

// create an untransformed copy of the support shape
Part::TopoShape supportShape(supportTopShape);

gp_Trsf trsfInv = supportShape.getShape().Location().Transformation().Inverted();

supportShape.setTransform(Base::Matrix4D());
TopoDS_Shape support = supportShape.getShape();

Expand All @@ -264,6 +267,11 @@ App::DocumentObjectExecReturn *Transformed::execute(void)
feature->getAddSubShape(fuseShape, cutShape);
if (fuseShape.isNull() && cutShape.isNull())
return new App::DocumentObjectExecReturn("Shape of addsub feature is empty");
gp_Trsf trsf = feature->getLocation().Transformation().Multiplied(trsfInv);
if (!fuseShape.isNull())
fuseShape = fuseShape.makETransform(trsf);
if (!cutShape.isNull())
cutShape = cutShape.makETransform(trsf);
}
else {
return new App::DocumentObjectExecReturn("Only additive and subtractive features can be transformed");
Expand Down

0 comments on commit 4a5cca3

Please sign in to comment.