From ed7be8674ec15f35cc22cd8331924647b1c143b9 Mon Sep 17 00:00:00 2001 From: Markus Lampert Date: Sat, 12 Dec 2020 23:17:02 -0800 Subject: [PATCH] meld h and v speeds for v-carve commands depending on incline --- src/Mod/Path/PathScripts/PathGeom.py | 2 +- src/Mod/Path/PathScripts/PathVcarve.py | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Mod/Path/PathScripts/PathGeom.py b/src/Mod/Path/PathScripts/PathGeom.py index 1b6c67848d..69f116f594 100644 --- a/src/Mod/Path/PathScripts/PathGeom.py +++ b/src/Mod/Path/PathScripts/PathGeom.py @@ -222,7 +222,7 @@ def speedBetweenPoints(p0, p1, hSpeed, vSpeed): pitch = pitch + 1 while pitch > 1: pitch = pitch - 1 - print(" pitch = %g %g (%.2f, %.2f, %.2f) -> %.2f" % (pitch, math.atan2(xy(d).Length, d.z), d.x, d.y, d.z, xy(d).Length)) + PathLog.debug(" pitch = %g %g (%.2f, %.2f, %.2f) -> %.2f" % (pitch, math.atan2(xy(d).Length, d.z), d.x, d.y, d.z, xy(d).Length)) speed = vSpeed + pitch * (hSpeed - vSpeed) if speed > hSpeed and speed > vSpeed: return max(hSpeed, vSpeed) diff --git a/src/Mod/Path/PathScripts/PathVcarve.py b/src/Mod/Path/PathScripts/PathVcarve.py index 472c61fc4f..dd713923d6 100644 --- a/src/Mod/Path/PathScripts/PathVcarve.py +++ b/src/Mod/Path/PathScripts/PathVcarve.py @@ -260,14 +260,12 @@ class ObjectVcarve(PathEngraveBase.ObjectOp): path.append(Path.Command("G0 Z{}".format(obj.SafeHeight.Value))) e = edges[0] p = e.valueAt(e.FirstParameter) - path.append(Path.Command("G0 X{} Y{} Z{}".format(p.x, p.y, - obj.SafeHeight.Value))) - c = Path.Command("G1 X{} Y{} Z{} F{}".format(p.x, p.y, p.z, - obj.ToolController.HorizFeed.Value)) - path.append(c) + path.append(Path.Command("G0 X{} Y{} Z{}".format(p.x, p.y, obj.SafeHeight.Value))) + hSpeed = obj.ToolController.HorizFeed.Value + vSpeed = obj.ToolController.VertFeed.Value + path.append(Path.Command("G1 X{} Y{} Z{} F{}".format(p.x, p.y, p.z, vSpeed))) for e in edges: - path.extend(PathGeom.cmdsForEdge(e, - hSpeed=obj.ToolController.HorizFeed.Value)) + path.extend(PathGeom.cmdsForEdge(e, hSpeed=hSpeed, vSpeed=vSpeed)) return path