From 0574f7a039598fbb3d67996b242523f8de4cc9ed Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Mon, 16 Dec 2019 20:32:00 +0200 Subject: [PATCH] - fixed the CNCJob geometry created with HPGL preprocessor --- README.md | 1 + camlib.py | 4 ++-- preprocessors/hpgl.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 96092fd3..83314f54 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ CAD program, and create G-Code for Isolation routing. - made sure that in Geometry Editor the self.app.mouse attribute is updated with the current mouse position (x, y) - updated the preprocessor files - fixed the HPGL preprocessor +- fixed the CNCJob geometry created with HPGL preprocessor 15.12.2019 diff --git a/camlib.py b/camlib.py index 7d3dc52d..32e3813d 100644 --- a/camlib.py +++ b/camlib.py @@ -3945,8 +3945,8 @@ class CNCjob(Geometry): match_pa = re.search(r"^PA(\s*-?\d+\.\d+?),(\s*\s*-?\d+\.\d+?)*;$", gline) if match_pa: command['G'] = 0 - command['X'] = float(match_pa.group(1).replace(" ", "")) - command['Y'] = float(match_pa.group(2).replace(" ", "")) + command['X'] = float(match_pa.group(1).replace(" ", "")) / 40 + command['Y'] = float(match_pa.group(2).replace(" ", "")) / 40 match_pen = re.search(r"^(P[U|D])", gline) if match_pen: if match_pen.group(1) == 'PU': diff --git a/preprocessors/hpgl.py b/preprocessors/hpgl.py index 013e62f1..8e8acde3 100644 --- a/preprocessors/hpgl.py +++ b/preprocessors/hpgl.py @@ -16,7 +16,8 @@ class hpgl(FlatCAMPostProc): coordinate_format = "%.*f" def start_code(self, p): - gcode = 'IN;' + gcode = 'IN;\n' + gcode += 'PU;' return gcode def startz_code(self, p):