Преглед на файлове

- fixed display HPGL code geometry on canvas
- added build folder to gitignore list

Marius Stanciu преди 7 години
родител
ревизия
b9cbe97f4d
променени са 3 файла, в които са добавени 12 реда и са изтрити 1 реда
  1. 2 1
      .gitignore
  2. 1 0
      README.md
  3. 9 0
      camlib.py

+ 2 - 1
.gitignore

@@ -1,3 +1,4 @@
 *.pyc
 .idea/
-tests/tmp/
+tests/tmp/
+build/

+ 1 - 0
README.md

@@ -12,6 +12,7 @@ CAD program, and create G-Code for Isolation routing.
 19.01.2019
 
 - added initial implementation of HPGL postprocessor
+- fixed display HPGL code geometry on canvas
 
 11.01.2019
 

+ 9 - 0
camlib.py

@@ -5212,6 +5212,13 @@ class CNCjob(Geometry):
                 command['Y'] = float(match_z.group(2).replace(" ", "")) * 0.025
                 command['Z'] = float(match_z.group(3).replace(" ", "")) * 0.025
 
+        elif 'hpgl' in self.pp_excellon_name or 'hpgl' in self.pp_geometry_name:
+            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(" ", ""))
+
         else:
             match = re.search(r'^\s*([A-Z])\s*([\+\-\.\d\s]+)', gline)
             while match:
@@ -5260,6 +5267,8 @@ class CNCjob(Geometry):
             if 'Z' in gobj:
                 if 'Roland' in self.pp_excellon_name or 'Roland' in self.pp_geometry_name:
                     pass
+                elif 'hpgl' in self.pp_excellon_name or 'hpgl' in self.pp_geometry_name:
+                    pass
                 elif ('X' in gobj or 'Y' in gobj) and gobj['Z'] != current['Z']:
                     log.warning("Non-orthogonal motion: From %s" % str(current))
                     log.warning("  To: %s" % str(gobj))