Using the Inkscape Laser Tool Plug-In
You can get the newest version of the Inkscape tool at our Github website here:
In case you didn’t see the overview of the new laser G Code creating plug-in, you can get the overview here:
Download and Overview
This tutorial will go over how to create drawings and text in inkscape and then create the G Code file needed to run on your 3D printer or CNC machine. We will cover a couple of common items that you can do in inkscape and then use with your laser.
Drawing Text for cutting/engraving
Drawing Objects for cutting/engraving
Drawing Multiple Objects for cutting/engraving
Importing Pictures or Images for cutting/engraving
Creating C Gode for Engraving and Cutting on the Same Drawing
Overview
The new plug-in allows for multiple commands for laser on and off for all the different versions of printers as well as the ability for multiple passes for cutting. Here is a description of the features of the plug-in.
- Laser ON Command: The command for turning ON the laser. For example, M03 or M106.
- Laser OFF Command: The command for turning OFF the laser. For example, M05 or M107.
- Travel Speed: The speed of the machine when the laser is OFF in mm/min.
- Laser Speed: The speed of the machine when the laser is ON in mm/min.
- Laser Power: If you have PWM control, then you can adjust this. For J Tech firmware and most 3D printers use a number between 0 and 255 (255 being full power). For GRBL 0.9 and 1 standard, use a number between 0 and 12000 (12000 being full power). If you don’t have PWM, keep at max power (either 255 or 12000).
- Power On Delay: This will turn on the laser and wait to move until the delay is complete. It is used to heat up the material and initiate the burning process. Delay in ms for 3D printers and seconds for GRBL.
- Passes: If cutting, this will repeat the entire path by the number of passes. If engraving leave as 1.
- Pass Depth: This will move Z axis down by this amount for each pass. For example, 3mm piece of material with 3 passes might use 1mm per pass to cut all the way through.
- Directory: The directory to store the file.
- Filename: Name of the file.
- Add numeric suffix to filename: Adds a number to the name in case there already is a file with the same name in the directory.
- All Units: Change the units to either mm or inches. This will make everything in inches or mm.
- Live preview: Shows the path being generated.
- Apply: Click to run the converter.
*We change the look of the plugin sometimes, so the pictures of the plugin might be slightly different. This overview section will always have the newest plugin explanations.
Drawing Text
Engraving text into materials is a very common need for the laser upgrade. Here is how to accomplish this.
Step 1: Use the TEXT tool in inkscape to draw your text. The bottom left corner is you 0,0 location of you machine.
Step 2: You need to convert the object into a path. All items drawn in inkscape are a vector object. You can convert them into a “path” that will actually “draw” the object. The laser then takes this path to generate the G Code.
Step 3: Under “Extensions” click on “Generate G Code” and “J Tech Photonics Laser Tool.
Step 4: Fill out the Laser Tool Dialog. For more information on the specific items click here.
Step 5: When finished filling out the form, click APPLY to start.
Step 6: The laser path will be outlined and the code will be generated in the location provided in the tool.
Here is an example of the G Code file produced.
Drawing Other Objects
Similar to the text, you can draw anything you want with the other tools. Just at the end when you want to convert it to G Code for the laser. Here is an example of a swirl:
Drawing Multiple Objects
In order to draw multiple objects in the same toolpath, you must first group all of the objects and convert to path before generating. Here is an example:
Step 1: Draw your separate objects.
Step 2: Group your objects.
Step 3: Turn them all into a path.
Step 4: Start the Laser Tool converter.
Step 5: Press Apply and run the converter.
Importing Black and White Pictures
A cool thing to engrave are black and white “high contrast” images that only have two colors. Here are the steps to engrave them.
Step 1: Import your image on “file -> Import”. Note it is two colors.
Step 2: Trace the outline of the image to get the path for the laser.
Step 3: Using edge detection, update the image and press “OK” to apply the changes.
Step 4: Delete the original layer underneath the new edge detected layer.
Step 5: Select “object to path” to create laser path.
Step 6: Generate your laser G Code file by entering your parameters and pressing “Apply”. The laser path will be outlined.
Creating C Gode for Engraving and Cutting on the Same Drawing
For cutting and engraving on the same file in inkscape, you need to make at two “objects”. One object will be the engraving and one will be the cut outline. Select the engraving object and click “object to path” and run the inkscape plugin. Put the engraving laser speed for the engraving. Then, click on the cut object (like a line border) and click “object to path” and run the plugin again. This time, put the speed to be a cutting speed (a lot slower) and use multiple passes if needed. Change the name of the file and press apply (or have the “add numeric suffix” button enabled). You will now have a “engraving” G Code file and a “cut” g code file. You can either combine the two in the same file, or you can run the engraving code first, then run the cut code *without* moving the part you are working on. It should all line up if nothing moves.
You can do this process for as many objects as you want to have different parameters in the inkscape Laser Tool Plugin.
In this example, we have imported a drawing we would like to engrave at one speed and then cut the outside border.
Step 1: Ungroup objects into separate items. *note* If you have drawn several things on your drawing by yourself, then you would do the opposite. You would group your items you want the same parameters together.
Step 2: Select items you want to have the same parameters. If you want to engrave items all at the same speed for example. Hold the shift key down to select multiple objects.
Step 3: Press “object to path”
Step 4: Open Laser Tool Plugin. Make sure “Live Preview” is Unchecked (Live preview assumes you want the whole page engraved the same). Then, enter parameters for the engraving and press “Apply”. This will generate a G Code file for the engraving portion of the drawing.
Step 5: Deselect the engraving objects and just select the cut object (or objects). Press “object to path” again and then change the parameters in the Laser Tool Plugin. In this case, we lowered the laser speed and increased the passes to 5. Press “Apply” to generate another G Code file for the cutting.
Step 6: G Code files.
You now will have at least two separate G Code files, one for engraving and one for cutting (in this example). You can either run them one after another as long as you do not move your workpiece. Alternatively, you can combine the files into one using a text editor and run it at the same time.
So there it is! Now you are ready to start creating!
Buy your laser upgrade kit now!
Remember Safety First!
We sell laser shielding to block laser radiation and reflections!
This is great! Looks like you’ve been experimenting!
Great software here!
This is great, I got some good and nice burnings with nice finishes, but I´m getting son vertical lines, seems to be a problem with the g-code because those lines are made when the laser doesn’t turn off, its not a driver problem, do you have some mail or something similar to get help with this problem, I’m working with a 1w 445nm laser, for test.
If you are getting vertical lines then there is a problem with the output file. In large imported images, sometimes the output file will miss a “space” between the Y coordinate and the Feedrate command. This will cause the G Code parser to ignore the line and assume you meant “0”, which sends the laser to the bottom of the engraving.
To fix this: Open the file in a text editor (like notepad for example). Then, use the find and replace function. Let’s say you put the laser on feedrate as 500. Then, find all instances of “F500″ and replace it with ” F500″. Note the space before the “F”. Do this for the laser off feedrate as well. Save your file and it should fix the problem.
please i need help during exporting gcode for laser cutting it goes very fast during cutting straight lines which maked me problems …
so could you help me fixing that problem
We have made a new version of the inkscape plugin that removes the G0 (rapid) commands and replaces them with G1 (coordinated motion with feedrate control). Rapid commands take a separate feedrate that is in your machine. Coordinated motion G1 commands will follow the feedrate from the G Code file. Download and use the new plugin. If you have files you want to change, then use a text editor and “find and replace” G0 to G1.
How do I get it to do the fill, instead of just the outline?
I have the new version, after replacing the G0 to G1, while moving the laser is always switched on independently and does not respond to the Laser Off command is inserted.
If G0 return all works.
There is still a problem, pointing out the command to turn off the M107 for example.
The plugin creates GCode type M107 S0 but the program does not work out.
If I open the file, I delete the command and retype the exact same keyboard after you save the file you are running.
What could be the problem? The discrepancy between the code page?
I need a setting that will only laser ON Horizontal Lines and OFF on all other directions. Is there a way you could guide me to place that in the code? Thank you
I need to invert the Y axis. My text is coming out flipped horizontally like you would see in a mirror.
Hi Bill,
The default home position for the inkscape plugin is the BOTTOM LEFT of the table. I think if you have your home position set on your CNC to the top right this might happen. Maybe?
Hi,
Congratulation for you plugin,
My laser engraver (3dp burner) has the home position in the BOTTOM RIGHT. Can i change the default home position of the j-tech plugin to the BOTTOM LEFT ?
The plugin is open source, so if you want to modify it you only need to change the laser.py file with your modifications. I am not sure exactly what needs to change, so it might require some digging to be able to figure it out.
So I built a horizontal laser code. Works pretty good. Here you go.
https://github.com/warkilt/inkscape-laser
Hi,
is it possible to show where the laser will be engraving. Like a square with 1% Power, that you know where to plase the object exactly?
Maybe with an toolchange command that you have to click resume. (for standalone laser)
I would recommend doing the following process:
1. Do your full power drawing in inkscape, create it as an object and generate the g code file.
2. In the SAME page, make a second object that is a box around the first object. Generate a second g code file that is at 1% power.
3. Either combine the two g code files (put the box one first) or just run the box one first and then the main file.
I’ve been trying to run your extension and there’s a bug in the Directory folder option. If you put a directory name from the user home directory, it claims there is no directory of that name. If you leave it blank, no output gets written and an error message is generated:
This using the latest Ubuntu linux (bionic)….
Traceback (most recent call last):
File “laser.py”, line 3173, in
e.affect()
File “/usr/share/inkscape/extensions/inkex.py”, line 283, in affect
self.effect()
File “laser.py”, line 3170, in effect
self.laser()
File “laser.py”, line 3032, in laser
self.check_dir()
File “laser.py”, line 2554, in check_dir
if self.options.directory[-1] not in [“/”,”\\”]:
IndexError: string index out of range
(bionic)kester@localhost:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
(bionic)kester@localhost:~$ inkscape –version
Inkscape 0.92.3 (2405546, 2018-03-11)
(bionic)kester@localhost:~$
This is why we put our directory as “C:\Gcode\” so there are no problems with syntax. If you are using your “home” directory, you need to specify the actual path on the C:\ drive where it is located. It normally is something like C:\Users\Username\…
I use Inkscape 0.92 to generate gcode of 100×100 mm square, but It generates a 28x28mm square in gcode. Please help me this problem.
You need to download the 0.92 laser plugin for it to be the correct size. If you are using the wrong plugin, then the size will be incorrect.
Something is missing here. I downloaded your drivers for inkscape and there is no way to create laser filled text, only outlines. Even the text grouped with the stars does not get filled. I see other questions here about the same topic that seem to be unanswered. So, does this work, or do I need to write my own driver for filled text. Yes or No would be sufficient.
Regards.
You can accomplish hatch fills in inkscape that you can then engrave with the plugin. Google “hatch fill in inkscape” and you will get a ton of tutorials on how to do this in the program.
Hi, is this compatible whit LaserAxe`s board? (grbl 1.1f firmware)
Yes. Use M04 and ON and M05 as Off commands if you are in laser mode ($32=1). You can also use M03 and your ON if you are not in laser mode.
I like your pluggin! I need it for the m4/m5 command because im using a arduino and coil to push a pen down. but i want to use it for a plotter. Is there any way to do infill paths?
You can do a hatch fill in inkscape. Just google “hatch fill inkscape” and you will come up with a lot of tutorials on how to do this.
Is there a way you can make it go over the same path twice with out it jumping. So let’s say I want to do a a word “HI” but I want it to go over the leter H twice be fot it goes to I. But with the the m3 comand on when it goes around twice.
The only way to do this is to have it do another pass on the whole item. It will do the first pass on everything and then do another pass again on everything. The source is open, so you can change it by editing the laser.py file in a text editor if you want to change anything.
Hello, I have a problem with the orientation points. Any object I design don’t have the same measures in the cnc than inkscape.
I.e.: My design have 210 mm and the plugin generates de gcode for a 60mm piece. I have change the documents properties to Px and Inches, but the problem continues.
If I use the gcodetools extension for cnc engraving the orientation points are correct
I have the problem only with J Tech laser tool
Can you help me?
Thanks
You need to make sure you have the correct inkscape version for your plugin. The two versions available are here: https://jtechphotonics.com/?page_id=1980
If you have the wrong version of the plugin for your inkscape version, it will have a scaling issue.
Hey Jtech, this plugin is awesome!!
My problem is that it creates a 00;00 origin and 100;00 origi , so when I start engraving it will one time start to the left and the other to the right.
How do I fix this?
Thank you guys for your awesome plugin!
The plugin should only have the 0,0 origin in the bottom left of the page. On the preview, it will have a 0,100 location to show the scale of the drawing as a reference, but it should not alter the g code start position. If you have a more detailed explanation of the issue, please send it to [email protected] and we can troubleshoot it.
Hi!
If I use this tutorial (https://jtechphotonics.com/?page_id=3905) for the Stepcraft with PWM control for my laser the laser On and Off commands are again M03 and M05 ?
Also, you are saying that I will have control over the power of the laser using the command: M3 SXXX where XXX is a value between 0 to 100. But in the current tutorial you are specifying that the Laser power is between 0 to 255? Is this correct?
It will be whatever you set your “max duty percent” value is for the maximum. We suggest setting it to 100 for UCCNC. A M3 S100 will then set it to 100% duty cycle and power. If you have mach3, then set your pulley to 100 and you will send M3 S100 for 100% power. Hope this helps!
Hi, guys, I am using inkscape the version 0.92 and the plugin from your site, unfortunately I get scale problems., If I make a box in inkscape 100mmX100mm I get results something like 84mmX84mm or sometimes after exporting even more funny, like 20mmX20mm. Any ideas where the problem is?
Most of the time it is because you are using the wrong plugin for the version of inkscape you have. If you design in inkscape and get an output scale error of about 2.54x, then it is this issue. Make sure you download the correct plugin for your version of inkscape and see if it fixes the problem.
Hi, I use 0.92.2 on Mac os x and ubuntu, none of it works correctly with 0.92 plug in.
I’ve been using Inkscape and the J Tech Laser Plug-in for about a year. I use it on an old lap top using XP. I use Inkscape version 91 and J Tech Laser Tool Plugin V1_10 for inkscape 0.91. It was working fine. I was cuting foam designs and went to make a new design and create a gcode and the plug-in no longer worked. This was the error message.
The called script passed additional data to Inkscape. The script did not return an error message, but the result may be unusable.
Traceback (most recent call last):
File “laser.py”, line 3172, in
e.affect()
File “C:\Program Files\Inkscape\share\extensions\inkex.py”, line 268, in affect
self.effect()
File “laser.py”, line 3169, in effect
self.laser()
File “laser.py”, line 3031, in laser
self.check_dir()
File “laser.py”, line 2553, in check_dir
if self.options.directory[-1] not in [“/”,”\\”]:
IndexError: string index out of range
Any idea? Odd that it worked one moment then didn’t an hour later. I’m not sure what could have changed in that time.
You have an issues with your directory. You need to make sure your directory string in the plugin is written exactly correct. We use “C:\GCode” and make sure we have a directory on the C: drive called “GCode”.
I was having an issue where my the Gcode that this extension produced wasn’t drawing any of the curves, only straight lines and I found the solution. My 3D printer (which I outfitted with a laser for engraving) firmware did not have ARCs enabled (G2 and G3 commands). I flashed it with a customized version of Marlin firmware and enabled arc support. This is done by uncommenting the line “#define ARC_SUPPORT” in the Configuration_adv.h file. I hope this is helpful to anyone who had this issue.
Can you select or change where the laser path starts and ends or is it randomly picked?
It starts where ever you put your laser. It will start and make the zero the bottom left of the laser path.