Difference between revisions of "Laser CNC"

From DiLab
Jump to: navigation, search
(Inkscape for Laser cutting)
(A short tutorial)
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{TocRight}}
 
= Laser Cutting and engraving =
 
= Laser Cutting and engraving =
  
Line 14: Line 15:
 
= Inkscape for Laser cutting =
 
= Inkscape for Laser cutting =
 
A few short and useful tutorial videos:
 
A few short and useful tutorial videos:
* [https://www.youtube.com/watch?v=Dwqlf5iirbM Laser Cutting With Inkscape Tutorial]
+
* [https://youtu.be/Dwqlf5iirbM Laser Cutting With Inkscape Tutorial]
 
* [https://www.youtube.com/watch?v=6gvnLMa58qQ Inkscape with Jtech Laser Tools plugin for g-code]
 
* [https://www.youtube.com/watch?v=6gvnLMa58qQ Inkscape with Jtech Laser Tools plugin for g-code]
  
Notes: about Inkscape and Linux
+
== A short tutorial ==
 +
# Open Inkscape
 +
# Menu: File => Document properties: Set material size (height, width to 100x100 mm)
 +
# Draw your thing, for example, a letter A in your favorite font. or a heart: ♥
 +
# Optionally resize. Can use lock icon in the toolbar to keep the aspect ratio.
 +
# Menu: Object=> Align and Distribute toolbox, and center the drawing on the page.
 +
# Menu: Path => Object to path. You may see no difference until the next step.
 +
# Menu: View => Display mode => Outline
 +
# Extensions => Gcodetools => Path to Gcode
 +
#* Select tab: Preferences => enter File name and the Directory as appropriate
 +
#* Select tab: Path to Gcode => Apply
 +
# Open the new Gcode file and make the necessary edits
 +
 
 +
Notes:
 +
* After creating the Gcode file you may have to edit the header and footer sections, for example, to select the laser and turn it off for your device. You may create files "header" and "footer" ant place in the Gcode file directory prior to generation, then they will be included in the final file rather than the default header and footer.
 +
 
 
== Inkscape extensions: Gcodetools  ==
 
== Inkscape extensions: Gcodetools  ==
 +
 +
The following notes are for using Inkscape on Linux, e.g. Ubuntu. On Windows or MacOS you may encounter similar problems, depending on your software, e.g. Python configuration.
 +
 
====Problem1: python 2.7 vs 3 for gcodetools====
 
====Problem1: python 2.7 vs 3 for gcodetools====
* There is an extension for Gcode export.  
+
Gcodetools is an extension for Inkscape for G-code export.  
* It appears to be written for Python 2, while the newest Inkscape appears to be running Python 3. There might be problems with running the extensions. Change the default version for python to be 2.7 like this:
+
It appears to be written for Python 2, while the newest Inkscape appears to be running Python 3. There might be problems with running the extensions. Change the default version for python to be 2.7 like this:
** Open Inkscape preferences, usually here: <code>~/.config/inkscape/preferences.xml</code>
+
* Open Inkscape preferences, usually here: <code>~/.config/inkscape/preferences.xml</code>
** Search for  
+
* Search for  
 
  <group
 
  <group
 
     id="extensions"
 
     id="extensions"
Line 29: Line 48:
 
     org.ekips.filter.gears.pitch="20"
 
     org.ekips.filter.gears.pitch="20"
 
     org.ekips.filter.gears.angle="20" />
 
     org.ekips.filter.gears.angle="20" />
** Change to - add the following:
+
* Change to - add the following:
 
  <group
 
  <group
 
     id="extensions"
 
     id="extensions"
Line 36: Line 55:
 
     org.ekips.filter.gears.pitch="20"
 
     org.ekips.filter.gears.pitch="20"
 
     org.ekips.filter.gears.angle="20" />
 
     org.ekips.filter.gears.angle="20" />
** More info here: https://wiki.inkscape.org/wiki/index.php/Extension_Interpreters
+
* More info here: https://wiki.inkscape.org/wiki/index.php/Extension_Interpreters
  
 
===Problem2: unittouu===
 
===Problem2: unittouu===
Line 55: Line 74:
 
* For Inkscape version 0.92:
 
* For Inkscape version 0.92:
 
** [https://jtechphotonics.com/Downloads/Inkscape/JTP_Laser_Tool_V2_2%20-%20inkscape%209_2%20version.zip Click here to download the plugin]
 
** [https://jtechphotonics.com/Downloads/Inkscape/JTP_Laser_Tool_V2_2%20-%20inkscape%209_2%20version.zip Click here to download the plugin]
 +
 +
Here is a Youtube tutorial for how to use it:
 +
* [https://www.youtube.com/watch?v=6gvnLMa58qQ Inkscape with Jtech Laser Tools plugin for g-code]
  
 
= Resources =
 
= Resources =
 
* G-code description and codes [https://en.wikipedia.org/wiki/G-code on Wikipedia]
 
* G-code description and codes [https://en.wikipedia.org/wiki/G-code on Wikipedia]

Revision as of 19:33, 25 August 2020

Laser Cutting and engraving

Life cycle:

  1. Design the 2D object (Inkscape, or any graphical editor)
  2. Export to a compatible format: Gcode or DXF
    • Use Inkscape extensions to generate the g-code, such as
    • Gcodetools - included with Inkscape, but not as well supported
    • Jtech Laser Tool plugin
  3. Send it (the G-code program or DXF file) to the laser cutter. This is usually done with another program, such as

Inkscape for Laser cutting

A few short and useful tutorial videos:

A short tutorial

  1. Open Inkscape
  2. Menu: File => Document properties: Set material size (height, width to 100x100 mm)
  3. Draw your thing, for example, a letter A in your favorite font. or a heart: ♥
  4. Optionally resize. Can use lock icon in the toolbar to keep the aspect ratio.
  5. Menu: Object=> Align and Distribute toolbox, and center the drawing on the page.
  6. Menu: Path => Object to path. You may see no difference until the next step.
  7. Menu: View => Display mode => Outline
  8. Extensions => Gcodetools => Path to Gcode
    • Select tab: Preferences => enter File name and the Directory as appropriate
    • Select tab: Path to Gcode => Apply
  9. Open the new Gcode file and make the necessary edits

Notes:

  • After creating the Gcode file you may have to edit the header and footer sections, for example, to select the laser and turn it off for your device. You may create files "header" and "footer" ant place in the Gcode file directory prior to generation, then they will be included in the final file rather than the default header and footer.

Inkscape extensions: Gcodetools

The following notes are for using Inkscape on Linux, e.g. Ubuntu. On Windows or MacOS you may encounter similar problems, depending on your software, e.g. Python configuration.

Problem1: python 2.7 vs 3 for gcodetools

Gcodetools is an extension for Inkscape for G-code export. It appears to be written for Python 2, while the newest Inkscape appears to be running Python 3. There might be problems with running the extensions. Change the default version for python to be 2.7 like this:

  • Open Inkscape preferences, usually here: ~/.config/inkscape/preferences.xml
  • Search for
<group
    id="extensions"
    …
    org.ekips.filter.gears.pitch="20"
    org.ekips.filter.gears.angle="20" />
  • Change to - add the following:
<group
    id="extensions"
    python-interpreter="/usr/bin/python2.7"
    …
    org.ekips.filter.gears.pitch="20"
    org.ekips.filter.gears.angle="20" />

Problem2: unittouu

After running gcodetools extension you may get the error:

AttributeError: 'module' object has no attribute 'unittouu'

The solution is to update the gcodetools.py as follows. For me, this was on the line 5864 where inkex.unittouu() is called. The problem is that it is referenced as

doc_height = inkex.unittouu(...

Fix this as follows:

doc_height = self.unittouu(...

Inkscape extensions: JTechPhotonics

Alternative, easy to use extension for inkscape to create gcode is J Tech Laser Tool Plugin

Here is a Youtube tutorial for how to use it:

Resources