@@ -65,6 +65,11 @@ Updated script to export rasters with top left as the origin or bottom left.
Changelog 2015-04-10
Fixed a bug with exporting paths when the origin was the top left.
Disabled raster horizintal movement optimisation as it has a bug. Rasters will be a little slower but will come out oriented correctly. Search for line : row2 = rowData
Changelog 2015-04-11
Added back in raster optimising, it's not perfect but it's mostly there. Only a little slow parsing white vertical space now.
Found that raster optimisation code seems to be changing the pixel data at the end of the line somewhere. I'm not sure how since it's meant to just be cutting part of the data line out not changing it. will need to investigate further.
Added option to the menu for users to disable raster optimisations.
"""
###
...
...
@@ -463,6 +468,7 @@ class Gcode_tools(inkex.Effect):
self.OptionParser.add_option("","--min-arc-radius",action="store",type="float",dest="min_arc_radius",default="0.0005",help="All arc having radius less than minimum will be considered as straight line")
@@ -660,37 +656,69 @@ class Gcode_tools(inkex.Effect):
returnend
first=True
#does this line have any data?
defis_blank_line(arr):
foriinrange(len(arr)):
if(arr[i]>0):
returnFalse
returnTrue
#return the last pixel that holds data.
deflast_in_list(arr):
end=len(arr)
foriinrange(len(arr)):
if(arr[i]>0):
end=i
returnend
#Flip the image top to bottom.
row=curve['data'][::-1]
previousRight=99999999999
previousLeft=0
firstRow=True
first=True
forward=True
forindex,rowDatainenumerate(row):
splitRight=0
splitLeft=0
if(index+1<len(row)):
#Turnkey - 11-04-15
#The below allows iteration over blank lines, while still being 'mostly' optimised for path. could still do with a little improvement for optimising horizontal movement and extrenuous for loops.