From 1396309093ef46a0c02076f95e97e78cc80ff7a9 Mon Sep 17 00:00:00 2001 From: tarman3 Date: Sat, 20 Dec 2025 19:20:01 +0200 Subject: [PATCH] CAM: AxisMap Dressup - Invert axis --- src/Mod/CAM/Path/Dressup/Gui/AxisMap.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/Mod/CAM/Path/Dressup/Gui/AxisMap.py b/src/Mod/CAM/Path/Dressup/Gui/AxisMap.py index b0b2651243..c167abacd5 100644 --- a/src/Mod/CAM/Path/Dressup/Gui/AxisMap.py +++ b/src/Mod/CAM/Path/Dressup/Gui/AxisMap.py @@ -68,6 +68,12 @@ class ObjectDressup: "Path", QT_TRANSLATE_NOOP("App::Property", "The radius of the wrapped axis"), ) + obj.addProperty( + "App::PropertyBool", + "Reverse", + "Path", + QT_TRANSLATE_NOOP("App::Property", "Reverse rotary axis direction"), + ) obj.AxisMap = ("X->A", "Y->A", "X->B", "Y->B", "X->C", "Y->C") obj.AxisMap = "Y->A" obj.Radius = 45 @@ -88,6 +94,15 @@ class ObjectDressup: if prop == "Path" and obj.ViewObject: obj.ViewObject.signalChangeIcon() + def onDocumentRestored(self, obj): + if not hasattr(obj, "Reverse"): + obj.addProperty( + "App::PropertyBool", + "Reverse", + "Path", + QT_TRANSLATE_NOOP("App::Property", "Reverse rotary axis direction"), + ) + def execute(self, obj): inAxis = obj.AxisMap[0] @@ -113,6 +128,8 @@ class ObjectDressup: newparams = dict(cmd.Parameters) remapvar = newparams.pop(inAxis, None) if remapvar is not None: + if obj.Reverse: + remapvar = -remapvar newparams[outAxis] = math.degrees(remapvar / obj.Radius.Value) locdiff = dict(set(newparams.items()) - set(lastPar.items())) if len(locdiff) == 1 and outAxis in locdiff: