From 5be4570d1262595d04e43d7a33fed6f0b0e9fbca Mon Sep 17 00:00:00 2001 From: sliptonic Date: Thu, 20 Jan 2022 17:38:52 -0600 Subject: [PATCH] add a material allowance property --- .../Gui/Resources/panels/PageOpHelixEdit.ui | 55 +++++++++++++------ src/Mod/Path/PathScripts/PathHelix.py | 23 +++++++- 2 files changed, 59 insertions(+), 19 deletions(-) diff --git a/src/Mod/Path/Gui/Resources/panels/PageOpHelixEdit.ui b/src/Mod/Path/Gui/Resources/panels/PageOpHelixEdit.ui index 5658602b78..52e5468f8f 100644 --- a/src/Mod/Path/Gui/Resources/panels/PageOpHelixEdit.ui +++ b/src/Mod/Path/Gui/Resources/panels/PageOpHelixEdit.ui @@ -14,6 +14,19 @@ Form + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -81,14 +94,14 @@ - + Direction - + <html><head/><body><p>The direction for the helix, clockwise or counter clockwise.</p></body></html> @@ -105,14 +118,14 @@ - + Step over percent - + <html><head/><body><p>Specify the percent of the tool diameter each helix will be offset to the previous one.</p><p><br/></p><p>A step over of 100% means no overlap of the individual cuts.</p></body></html> @@ -131,24 +144,32 @@ + + + + Extra Offset + + + + + + + + + + - - - - Qt::Vertical - - - - 20 - 40 - - - - + + + Gui::InputField + QLineEdit +
Gui/InputField.h
+
+
diff --git a/src/Mod/Path/PathScripts/PathHelix.py b/src/Mod/Path/PathScripts/PathHelix.py index 644570f8ad..c8efaaa6b2 100644 --- a/src/Mod/Path/PathScripts/PathHelix.py +++ b/src/Mod/Path/PathScripts/PathHelix.py @@ -134,6 +134,15 @@ class ObjectHelix(PathCircularHoleBase.ObjectOp): "Helix Drill", QT_TRANSLATE_NOOP("App::Property", "Starting Radius"), ) + obj.addProperty( + "App::PropertyDistance", + "OffsetExtra", + "Helix Drill", + QT_TRANSLATE_NOOP( + "App::Property", + "Extra value to stay away from final profile- good for roughing toolpath", + ), + ) ENUMS = self.helixOpPropertyEnumerations() for n in ENUMS: @@ -148,6 +157,16 @@ class ObjectHelix(PathCircularHoleBase.ObjectOp): QT_TRANSLATE_NOOP("App::Property", "Starting Radius"), ) + if not hasattr(obj, "OffsetExtra"): + obj.addProperty( + "App::PropertyDistance", + "OffsetExtra", + "Helix Drill", + QT_TRANSLATE_NOOP( + "App::Property", + "Extra value to stay away from final profile- good for roughing toolpath", + ), + ) def circularHoleExecute(self, obj, holes): """circularHoleExecute(obj, holes) ... generate helix commands for each hole in holes""" PathLog.track() @@ -177,13 +196,13 @@ class ObjectHelix(PathCircularHoleBase.ObjectOp): "step_down": obj.StepDown.Value, "step_over": obj.StepOver / 100, "tool_diameter": tooldiamter, - "inner_radius": obj.StartRadius.Value, + "inner_radius": obj.StartRadius.Value + obj.OffsetExtra.Value, "direction": obj.Direction, "startAt": obj.StartSide, } for hole in holes: - args["hole_radius"] = hole["r"] / 2 + args["hole_radius"] = (hole["r"] / 2) - (obj.OffsetExtra.Value) startPoint = FreeCAD.Vector(hole["x"], hole["y"], obj.StartDepth.Value) endPoint = FreeCAD.Vector(hole["x"], hole["y"], obj.FinalDepth.Value) args["edge"] = Part.makeLine(startPoint, endPoint)