From 35007e30e5523181e4eeca92be3262e6b61d27aa Mon Sep 17 00:00:00 2001 From: "Zheng, Lei" Date: Sun, 26 Jul 2020 20:29:45 +0800 Subject: [PATCH] PartDesign: fix pattern transformation --- src/Mod/PartDesign/App/FeatureTransformed.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Mod/PartDesign/App/FeatureTransformed.cpp b/src/Mod/PartDesign/App/FeatureTransformed.cpp index b6204a6c76..1818338dbc 100644 --- a/src/Mod/PartDesign/App/FeatureTransformed.cpp +++ b/src/Mod/PartDesign/App/FeatureTransformed.cpp @@ -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(); @@ -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");