From 52608d308199aab2b01d402e1297c0b1ccf9905b Mon Sep 17 00:00:00 2001 From: PaddleStroke Date: Sun, 18 Jan 2026 23:58:41 +0100 Subject: [PATCH] PartDesign: allow makeShellFromUpToFace to update extrusion direction Updated makeShellFromUpToShape to accept the direction vector by reference. This allows the method to reverse the direction internally if required to successfully reach the target face, fixing cases where the extrusion would otherwise fail or go the wrong way. Note: While passing the direction as a non-const reference is a quick fix for this regression, it is acknowledged as non-ideal and should be considered for future refactoring. --- src/Mod/PartDesign/App/FeatureExtrude.cpp | 2 +- src/Mod/PartDesign/App/FeatureExtrude.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/PartDesign/App/FeatureExtrude.cpp b/src/Mod/PartDesign/App/FeatureExtrude.cpp index 430eafb6ef..d7032a1a40 100644 --- a/src/Mod/PartDesign/App/FeatureExtrude.cpp +++ b/src/Mod/PartDesign/App/FeatureExtrude.cpp @@ -154,7 +154,7 @@ void FeatureExtrude::onChanged(const App::Property* prop) ProfileBased::onChanged(prop); } -TopoShape FeatureExtrude::makeShellFromUpToShape(TopoShape shape, TopoShape sketchshape, gp_Dir dir) +TopoShape FeatureExtrude::makeShellFromUpToShape(TopoShape shape, TopoShape sketchshape, gp_Dir& dir) { // Find nearest/furthest face diff --git a/src/Mod/PartDesign/App/FeatureExtrude.h b/src/Mod/PartDesign/App/FeatureExtrude.h index 70cdd827fa..80006422ec 100644 --- a/src/Mod/PartDesign/App/FeatureExtrude.h +++ b/src/Mod/PartDesign/App/FeatureExtrude.h @@ -99,7 +99,7 @@ protected: * by removing the farthest face from the sketchshape in the direction * if farthest is nearest (circular) then return the initial shape */ - TopoShape makeShellFromUpToShape(TopoShape shape, TopoShape sketchshape, gp_Dir dir); + TopoShape makeShellFromUpToShape(TopoShape shape, TopoShape sketchshape, gp_Dir& dir); /** * Disables settings that are not valid for the current method