Update to make it compatible with 0.92

parent c63bc046
About This Project
------------------
This project was intended to build and all in one exporting plugin for laser cutters and Inkscape 0.91. It has not been tested on lower versions of Inkscape but may work..
This project was intended to build and all in one exporting plugin for laser cutters and Inkscape 0.9x. It has not been tested on lower versions of Inkscape but may work..
The plugin builds gcode that is compatible with a fork of MarlinKimbra designed to run on laser cutters found at https://git.nexlab.net/machinery/MarlinKimbra and
compatible with the original TurkneyTyranny patches to Marlin.
......@@ -92,6 +92,8 @@ This script is released under the license GPL v2.
Change log
--------------------
6-May-2017 - added default DPI and set default to 96 to make it compatible with inkscape >= 0.92
23-May-2016 - many new options for MarlinKimbra added features
26-Feb-2015 - 2 hours : Forked from user ajfoul to extend functionality of smoothie laser power levels 0.0 to 1.0, generic Marlin power levels being 0 to 100.
......
......@@ -84,6 +84,7 @@ For the latest revision please visit https://github.com/TurnkeyTyranny/laser-gco
<item value="mm">mm</item>
<item value="in">in</item>
</param>
<param name="udpi" type="int" min="90", max="270" _gui_text="Default inkscape dpi (90-270, inkscape >= 0.92 uses 96, <= 0.91 uses 90)">96</param>
<param name="invert" type="boolean" _gui-text="Swap colors">true</param>
<param name="dither" type="boolean" _gui-text="Apply dithering">false</param>
<param name="colorspace" type="int" min="2" max="256" _gui-text="color space. 0 to reduce derived from power">256</param>
......
......@@ -494,6 +494,7 @@ class Gcode_tools(inkex.Effect):
self.OptionParser.add_option("", "--showimg", action="store", type="inkbool", dest="showimg", default=False, help="Show rastered images")
self.OptionParser.add_option("", "--colorspace", action="store", type="int", dest="colorspace", default="256", help="reduce colorspace")
self.OptionParser.add_option("", "--dpi", action="store", type="int", dest="dpi", default="270", help="set DPI for inkscape export")
self.OptionParser.add_option("", "--udpi", action="store", type="int" dest="udpi", default="96", help="set DPI for default inkscape resolution")
self.OptionParser.add_option("", "--invert", action="store", type="inkbool", dest="invert", default=True, help="swap to negative colors")
self.OptionParser.add_option("", "--cooler", action="store", type="float", dest="cooler", default="0.0", help="set cooler temperature. 0 to disable")
self.OptionParser.add_option("", "--cooleronstop", action="store", type="inkbool", dest="cooleronstop", default=False, help="continue to cool down when finished")
......@@ -1438,10 +1439,10 @@ class Gcode_tools(inkex.Effect):
gcode = self.header;
if (self.options.unit == "mm"):
self.unitScale = 0.282222222222
self.unitScale = round(1.0/(self.options.udpi/25.4), 12) #0.282222222222
gcode += "G21 ; All units in mm\n"
elif (self.options.unit == "in"):
self.unitScale = 0.011111
self.unitScale = round(1.0/self.option.udpi, 12) #0.011111
gcode += "G20 ; All units in in\n"
else:
inkex.errormsg(("You must choose mm or in"))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment