浏览代码

- fixed the CNCJob geometry created with HPGL preprocessor

Marius Stanciu 6 年之前
父节点
当前提交
0574f7a039
共有 3 个文件被更改,包括 5 次插入3 次删除
  1. 1 0
      README.md
  2. 2 2
      camlib.py
  3. 2 1
      preprocessors/hpgl.py

+ 1 - 0
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

+ 2 - 2
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':

+ 2 - 1
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):