From 6082ce76e05fb15eec9501be57184e92e5b48cb7 Mon Sep 17 00:00:00 2001 From: luvtofish Date: Sun, 11 Dec 2022 11:21:22 -0600 Subject: [PATCH] code cleanup --- .../Path/Post/scripts/dynapath_4060_post.py | 33 +++++++------------ 1 file changed, 12 insertions(+), 21 deletions(-) diff --git a/src/Mod/Path/Path/Post/scripts/dynapath_4060_post.py b/src/Mod/Path/Path/Post/scripts/dynapath_4060_post.py index c1f9a2a8a4..1d697c5225 100644 --- a/src/Mod/Path/Path/Post/scripts/dynapath_4060_post.py +++ b/src/Mod/Path/Path/Post/scripts/dynapath_4060_post.py @@ -442,23 +442,17 @@ def parse(pathobj): if param == "F" and ( currLocation[param] != c.Parameters[param] or OUTPUT_DOUBLES ): - if c.Name not in [ - "G0", - "G00", - ]: - speed = Units.Quantity( - c.Parameters["F"], FreeCAD.Units.Velocity - ) - if speed.getValueAs(UNIT_SPEED_FORMAT) > 0.0: - outstring.append( - param - + format( - float(speed.getValueAs(UNIT_SPEED_FORMAT)), - precision_string, - ) + speed = Units.Quantity( + c.Parameters["F"], FreeCAD.Units.Velocity + ) + if speed.getValueAs(UNIT_SPEED_FORMAT) > 0.0: + outstring.append( + param + + format( + float(speed.getValueAs(UNIT_SPEED_FORMAT)), + precision_string, ) - else: - continue + ) elif param == "Z" and ( c.Parameters["Z"] == clearanceHeight and c.Parameters["Z"] != lastZ @@ -520,10 +514,8 @@ def parse(pathobj): k = c.Parameters["K"] if ABSOLUTE_CIRCLE_CENTER: k += lastZ - if command == ("G18" or "G19"): - outstring.append( - param + PostUtils.fmt(k, PRECISION, UNITS) - ) + if command == ("G18" or "G19"): + outstring.append(param + PostUtils.fmt(k, PRECISION, UNITS)) elif param == "Q": pos = Units.Quantity(c.Parameters["Q"], FreeCAD.Units.Length) outstring.append( @@ -571,7 +563,6 @@ def parse(pathobj): float(pos.getValueAs(UNIT_FORMAT)), precision_string ) ) - # save the last X, Y values if "X" in c.Parameters: lastX = c.Parameters["X"]