Parcourir la source

calculate bounding box after fixing up spaces

Thomas Buck il y a 1 an
Parent
révision
4ee95110e5
1 fichiers modifiés avec 4 ajouts et 4 suppressions
  1. 4
    4
      tools/gcode_center_outline.py

+ 4
- 4
tools/gcode_center_outline.py Voir le fichier

@@ -63,8 +63,11 @@ def main():
63 63
             print("File exists: " + f)
64 64
             sys.exit(1)
65 65
 
66
+    with open(in_file, 'r') as fi, open(out_tmp_file, 'w') as fo:
67
+        convert_gcode(fi, fo)
68
+
66 69
     bb = ( None, None, None, None )
67
-    with open(in_file, 'r') as f:
70
+    with open(out_tmp_file, 'r') as f:
68 71
         bb = file_bounding_box(f)
69 72
 
70 73
     x_min, x_max, y_min, y_max = bb
@@ -73,9 +76,6 @@ def main():
73 76
     off = ( -x_min + (machine_size[0] - size[0]) / 2.0, -y_min + (machine_size[1] - size[1]) / 2.0 )
74 77
     zero_point = ( -off[0], -off[1] )
75 78
 
76
-    with open(in_file, 'r') as fi, open(out_tmp_file, 'w') as fo:
77
-        convert_gcode(fi, fo)
78
-
79 79
     with open(out_tmp_file, 'r') as fi, open(out_file, 'w') as fo:
80 80
         patch_offset(fi, fo, zero_point)
81 81
 

Chargement…
Annuler
Enregistrer