THLaser Plugin

From ThinkHausWiki
Jump to: navigation, search

This page covers how to use the Inkscape gcode exporter plugin.

How to use the plugin

  1. Create/open your file in inkscape
  2. Select the paths to export
  3. Select "think|haus laser gcode" from the extensions menu, you should see a dialog box
  4. Under the Preferences tab, enter the output file and the feed rate
  5. Change other options as needed
  6. Click Apply to run the plugin

If you have "Draw Curves" selected, the plugin will add coloured paths over the paths that were exported. The colour indicates the G command that was generated for that path. Red indicates G1 (straight line), alternating blue/green indicates G2 or G3 (arc).

If you prefer a different CAD tool, export a DXF and try to convert using inkscape + plugin. If that doesn't work, see Starting from a DXF.

If you see any weirdness when you run the plugin (eg output is mangled, individual paths are rotated or resized), try copying the paths into a new file.

The gcode commands output by the plugin include scale and offset variables, making them somewhat tricky to read. Something like:

 G00 X[4.5*#1+#8] Y[2*#2+#9]
 #1, #2 are the X and Y scale, 
 #8, #9 are the X and Y offsets. 

Assuming defaults for everything (scale factor of 1 and no offset), and assuming the units are inches the above command would move the head to X=4.5 and Y=2.0.

If you have any text elements in your design, you might seriously consider using the [1] Evil Mad Scientist Labs Hershey Font Extension for Inkscape - it produces MUCH better results.

Working with layers

The plugin inserts a tool change operation between processing layers:

  T02 (select tool)
  M06 (tool change)

The M06 gcode command causes EMC to pause the job, and prompts the user with an dialog box indicating the user to switch out the tool. The Txx command indicates what tool number to use. The plugin processes layers in the order which they appear in the inkscape layers box (click Layer menu, then Layers...). Any objects that don't belong in a layer (ie appear under the root) are outputted at the end of the file.

Breaking up a job into layers is useful if you want to cut and etch in the same file, or you need to make certain cuts before others (eg cutting inside bits before outside bits).

Coordinate system

As of plugin version 1.28 the Inkscape workspace coordinate system should match with that of the laser bed. That is position (0, 0) in Inkscape (bottom-left corner) should correspond with position (0, 0) on the laser. This should make it a lot easier to setup your job.

You do however need to be aware of the touch off coordinates in EMC and how that works. Basically when you set the touch off value for an axis you're telling EMC where the cutting head is in the job coordinate space. So if you move the X axis to some point along the table, then touch off and enter 4" as the value, you're telling EMC that the head is at X=4 in the job coordinate space (aka Inkscape's coordinate space).

As easy way to deal with all this:

  1. In Inkscape position your job conveniently near to the origin (0, 0)
  2. Put your material on the laser bed, where you like it. Use the test fire button to get it right.
  3. Manually move the head to where you'd like the Inkscape origin to go
  4. Touch off the X and Y axis, enter a value of 0 for both

That should shift the Inkscape axis directly under the laser head.

Fonts and text

So you want to include text in your laser job. It's important to choose the right font for the job, depending on how large the text will be and what sort of effect you're looking for. If your text is large, you can use pretty much any font you like and it will be fine. Smaller text, say below 10pt, becomes problematic when etching. First, when the laser spends a bit of time in the same area, your material tends to collect a lot of heat. That excess heat will make your cuts look "blobby", and if you're etching your etches will look blobby too. This is compounded by the fact that TTF fonts (what Inkscape and most other programs use) are made up of outlines with shaded interiors.

We think of a letter "T" as two lines - across and down. But actually it's rendered as an outline with a shaded interior. When you export your text to gcode (after converting objects to paths) the laser will cut/etch the outline, not the interior. When your text is small, that's a lot of extra lasering in the same area and that contributes to the blobbiness.

The second problem is that small, outlined fonts look visually cluttered making them difficult to read. It's less of a problem with larger fonts, but it also depends on how far away your viewer is. (eg arms length, across the room, etc) A nice solution to this is to use stick fonts, like what many CAD programs do. There is a nice font set free for download:

But this fontset is not without complications. Because the TTF standard requires fonts to be defined by closed paths, what they've done with the CAMBAM fonts is collapsed the outlines to get rid of the font interiors. So although that "T" will look like it's made from two sticks, it's technically still an outline. (though the outline traces back over itself to make it look like a stick font) The side effect of this is that all your lettering will be lasered over twice, so be careful with your etching and set the power level appropriately.

Installing the extension

Current version:

Previous version:

Have a look at the GIT repository too if you like:

The historic version is here. The plugin appears to work only with the Inkscape 0.47 or later (tested with 0.48). Extract the two files (thlaser.py and thlaser.inx). Where you put these files depends on what OS you are running:

  • On Windows put them in c:\Program Files\Inkscape\share\extensions.
  • On OSX put them in /Applications/Inkscape.app/Contents/Resources/extensions.
  • On Linux put them in /usr/share/inkscape/extensions.
  • Alternatively, on Linux put them in ~/.config/inkscape/extensions

Inkscape troubleshooting

  • The extension will trace all paths it has exported. Check to see whether everything you wanted exported is traced.
  • Sometimes objects get created outside layers. This shouldn't be a problem with the current version of the plugin, but has been in past and may be worth looking at anyways. To open the XML source view press Shift+Ctrl+X. (useful for getting an overview of the whole document structure)
  • Make sure to convert objects to path before trying to export them. I find it works to select everything you want exported, ungroup, then object to path, then ungroup, then object to path. Hopefully that'll turn everything into a path.
  • To select all objects from all layers, press Ctrl-Alt-A. Only objects from layers that are visible and unlocked will be selected.
  • If you want to select everything in the current layer press Ctrl+A