Commit 2a6e2ac6 authored by ajfoul's avatar ajfoul

change name and configure output for smoothie

parent 092563f6
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension>
<name>THLaser GCode Exporter</name>
<id>org.thinkhaus.filter.thlaser</id>
<name>ShinyLaser Gcode</name>
<id>com.istartup.shinylaser</id>
<effect>
<object-type>path</object-type>
......@@ -10,18 +10,18 @@
</effects-menu>
</effect>
<dependency type="executable" location="extensions">thlaser.py</dependency>
<dependency type="executable" location="extensions">shinylaser.py</dependency>
<dependency type="executable" location="extensions">inkex.py</dependency>
<script>
<command reldir="extensions" interpreter="python">thlaser.py</command>
<command reldir="extensions" interpreter="python">shinylaser.py</command>
</script>
<param name='tab' type="notebook">
<page name='tab' _gui-text='Help'>
<_param name="fullhelp" type="description">THLaser converts inkscape paths to Gcode. (v1.30)
<_param name="fullhelp" type="description">ShinyLaser exports inkscape paths to Gcode compatible with Smoothieware laser module.
This script is a fork of Gcodetools v1.2 by Nick Drobchenko. It is currently maintained by Peter Rogers (peter.rogers@gmail.com) at think|haus.</_param>
This extenstion is a fork of THLaser v1.30, by Peter Rogers at think|haus, which is itself a fork of Gcodetools v1.2 by Nick Drobchenko.</_param>
</page>
<page name='tab' _gui-text='Advanced'>
......@@ -35,14 +35,14 @@ This script is a fork of Gcodetools v1.2 by Nick Drobchenko. It is currently mai
</page>
<page name='tab' _gui-text='Preferences'>
<param name="filename" type="string" _gui-text="File name: ">output.ngc</param>
<param name="filename" type="string" _gui-text="File name: ">output.g</param>
<param name="directory" type="string" _gui-text="Directory: "></param>
<_param name="help" type="description">(blank is your desktop)</_param>
<param name="feed" type="int" min="0" max="1000" _gui-text="Cut Feedrate:">60</param>
<param name="Mfeed" type="int" min="0" max="5000" _gui-text="Traversal Feedrate:">300</param>
<param name="laser" type="int" min="0" max="100" _gui-text="Laser Intensity (0-100):">10</param>
<param name="laser" type="float" precision="2" min="0" max="1" _gui-text="Laser Intensity (0.0-1):">0.1</param>
<param name="homebefore" type="boolean" _gui-text="HOMEALL (G28) Before:">true</param>
<param name="homeafter" type="boolean" _gui-text="HOMEALL (G28) After:">false</param>
<param name="homeafter" type="boolean" _gui-text="Home X & Y After:">false</param>
<param name="Xscale" type="float" precision="4" min="-1000" max="1000" _gui-text="Scale along X axis:">1</param>
<param name="Yscale" type="float" precision="4" min="-1000" max="1000" _gui-text="Scale along Y axis:">1</param>
......
#!/usr/bin/env python
"""
ShinyLaser
"""
"""
think|haus gcode inkscape extension
-----------------------------------
......@@ -92,7 +97,7 @@ _ = inkex._
###
################################################################################
VERSION = "1.30"
VERSION = "1.0.1"
STRAIGHT_TOLERANCE = 0.0001
STRAIGHT_DISTANCE_TOLERANCE = 0.0001
......@@ -430,9 +435,9 @@ class Gcode_tools(inkex.Effect):
# added move (laser off) feedrate and laser intensity; made all int rather than float - (ajf)
self.OptionParser.add_option("-p", "--feed", action="store", type="int", dest="feed", default="60", help="Cut Feed rate in unit/min")
self.OptionParser.add_option("-m", "--Mfeed", action="store", type="int", dest="Mfeed", default="300", help="Move Feed rate in unit/min")
self.OptionParser.add_option("-l", "--laser", action="store", type="int", dest="laser", default="10", help="Laser intensity (0-100)")
self.OptionParser.add_option("-b", "--homebefore", action="store", type="inkbool", dest="homebefore", default=True, help="Home all axis beofre starting (G28)")
self.OptionParser.add_option("-a", "--homeafter", action="store", type="inkbool", dest="homeafter", default=False, help="Home all axis at end of job (G28)")
self.OptionParser.add_option("-l", "--laser", action="store", type="float", dest="laser", default="0.5", help="Laser intensity (0.0-1.0)")
self.OptionParser.add_option("-b", "--homebefore", action="store", type="inkbool", dest="homebefore", default=True, help="Home all beofre starting (G28)")
self.OptionParser.add_option("-a", "--homeafter", action="store", type="inkbool", dest="homeafter", default=False, help="Home X Y at end of job")
self.OptionParser.add_option("", "--biarc-tolerance", action="store", type="float", dest="biarc_tolerance", default="1", help="Tolerance used when calculating biarc interpolation.")
......@@ -622,14 +627,14 @@ class Gcode_tools(inkex.Effect):
elif s[1] == 'line':
if lg=="G00":
#gcode += "G01 " + self.make_args([None,None,s[5][0]+depth]) + feed +"\n" + LASER_ON
gcode += LASER_ON + " S%i" % self.options.laser + "\n"
gcode += "G01 " +self.make_args(si[0]) + " F%i" % self.options.feed + "\n"
gcode += LASER_ON + "\n"
gcode += "G01 " + "S%.2f " % self.options.laser + self.make_args(si[0]) + " F%i" % self.options.feed + "\n"
lg = 'G01'
elif s[1] == 'arc':
if lg=="G00":
#gcode += "G01 " + self.make_args([None,None,s[5][0]+depth]) + feed +"\n" + LASER_ON
gcode += LASER_ON + " S%i" % self.options.laser + "\n"
gcode += LASER_ON + "\n"
dx = s[2][0]-s[0][0]
dy = s[2][1]-s[0][1]
......@@ -641,7 +646,7 @@ class Gcode_tools(inkex.Effect):
gcode += cwArc
else:
gcode += ccwArc
gcode += " " + self.make_args(si[0] + [None, dx, dy, None]) + " F%i" % self.options.feed + "\n"
gcode += " " + "S%.2f " % self.options.laser + self.make_args(si[0] + [None, dx, dy, None]) + " F%i" % self.options.feed + "\n"
else:
r = (r1.mag()+r2.mag())/2
......@@ -649,21 +654,21 @@ class Gcode_tools(inkex.Effect):
gcode += cwArc
else:
gcode += ccwArc
gcode += " " + self.make_args(si[0]) + " R%f" % (r*self.options.Xscale) + " F%i" % self.options.feed + "\n"
gcode += " " + "S%.2f " % self.options.laser + self.make_args(si[0]) + " R%f" % (r*self.options.Xscale) + " F%i" % self.options.feed + "\n"
lg = cwArc
else:
if lg=="G00":
#gcode += "G01 " + self.make_args([None,None,s[5][0]+depth]) + feed +"\n" + LASER_ON
gcode += LASER_ON + " S%i" % self.options.laser + "\n"
gcode += "G01 " +self.make_args(si[0]) + " F%i" % self.options.feed + "\n"
gcode += LASER_ON + "\n"
gcode += "G01 " + "S%.2f " % self.options.laser + self.make_args(si[0]) + " F%i" % self.options.feed + "\n"
lg = 'G01'
if si[1] == 'end':
gcode += LASER_OFF
if self.options.homeafter:
gcode += "\n\nG00 X0 Y0 F4000 ; home all"
gcode += "\n\nG00 X0 Y0 F4000 ; home"
return gcode
......
G21 ; All units in mm
; Cut Feedrate 400
; Move Feedrate 4000
; Traversal Feedrate 4000
G28 ; home all
G0 X0 Y0 ; home
M5
......@@ -30,4 +30,4 @@ G02 S0.1 X67.763619 Y71.178072 I-35.354888 J35.353184 F400
G01 S0.1 X67.763619 Y71.178072 F400
M5
G28 ; home all
G0 X0 Y0 ; home
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