image2gcode 1.1.0__tar.gz → 1.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"""
|
|
3
3
|
image2gcode: convert an image to gcode.
|
|
4
4
|
"""
|
|
5
|
-
__version__ = "1.
|
|
5
|
+
__version__ = "1.2.0"
|
|
6
6
|
|
|
7
7
|
import sys
|
|
8
8
|
import argparse
|
|
@@ -176,7 +176,8 @@ def main() -> int:
|
|
|
176
176
|
sys.exit(1)
|
|
177
177
|
|
|
178
178
|
# load and convert image to B&W
|
|
179
|
-
|
|
179
|
+
# flip image updown because Gcode and raster image coordinate system differ
|
|
180
|
+
narr = np.flipud(loadImage(args.image.name,args.showimage))
|
|
180
181
|
|
|
181
182
|
print('Area: ' + str(round(narr.shape[1] * args.pixelsize,2)) + "mm x " + str(round(narr.shape[0] * args.pixelsize,2)) + "mm (XY)")
|
|
182
183
|
print('> pixelsize', args.pixelsize, 'mm^2, speed', args.speed, 'mm/min, maxpower ' + str(args.maxpower) + ', offset', args.offset)
|
|
@@ -187,8 +188,8 @@ def main() -> int:
|
|
|
187
188
|
if args.validate:
|
|
188
189
|
args.gcode.close()
|
|
189
190
|
with open(args.gcode.name, "r") as fgcode:
|
|
190
|
-
#
|
|
191
|
-
img = gcode2image(Namespace(gcode = fgcode, offset = False, showG0 = True, grid = False))
|
|
191
|
+
# flip to raster image coordinate system
|
|
192
|
+
img = np.flipud(gcode2image(Namespace(gcode = fgcode, offset = False, showG0 = True, grid = False)))
|
|
192
193
|
|
|
193
194
|
# convert to image
|
|
194
195
|
img = Image.fromarray(img)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|