What’s this all about?
Laser engraving is an incredibly versatile technique that allows you to etch intricate designs and patterns onto various materials. The awesome thing is that Laser Engravers have really become popular over the last few years which has resulted in a huge increase in the options of complete systems and parts. Gone are the days of buying a bare diode and mounting in a housing whilst trying to align your optics! It’s now easier than ever to pick up a high power laser diode assembly. Most of these come with a suitable driver and simply work of a 5V TTL/PWM signal, making it easy to strap it to your 3D-Printer or CNC.
However, in this post, I’m going to assume you have a CNC machine with a laser waiting to play with! I want to share one of the quickest and neatest ways I have found to generate Laser gcode with Inkscape and J Tech Photonics. Inkscape is a powerful FREE vector graphics editor and, used in conjunction with FREE J Tech Photonics add-on, we can generate G-code suitable for laser engraving on a CNC machine. Let’s take a look!
1. Installing and Configuring J Tech Photonics Add-On:
The first step is to install the J Tech Photonics add-on, which enhances Inkscape’s capabilities specifically for laser engraving. Visit the J Tech Photonics website (www.jtechphotonics.com) to download and install the add-on. Once installed, configure the settings according to your CNC machine and laser engraving requirements.
Make sure you install the correct version of the add-on for your version of Inkscape. For Inkscape versions <1.0, you want to install the legacy add-on. For Inkscape versions 1.0 and above, you want to install the version 2.0 or above add-on. At the time of writing, I am using Inkscape 1.2.1 and J-Tech Laser add-on 2.5.1 which work well together. As per issue #76 on the GitHub page, don’t forget to copy across the contents of the “Laser” folder which includes the required “svg_t0_gcode” files.
Not sure how to install an add on into Inkscape? Check out this post. And a huge Thank You to JTechPhotonics for releasing this add-on!
2. Creating Your Design in Inkscape:
Launch Inkscape and create a new document. Set your document display units to mm or in under the File > Document Properties menu. Then set Scale to 1 and Viewbox > X, Viewbox > Y to 0 (these are usually the defaults).
Begin designing your artwork using Inkscape’s comprehensive set of drawing tools and features. Keep in mind that laser engraving works best with vector-based designs, so use paths and shapes rather than images. A useful tip here is to set your stroke width to be the approximate width of your laser (0.5mm in my case) and no fill colour as this allows you to see what your design will look like more clearly.
Tip: the ‘Trace Bitmap’ tool is a fantastic way to convert images into vectors.
Experiment with different design elements, such as text, shapes, and intricate patterns, to achieve the desired effect. Inkscape provides tools for manipulating paths and shapes, for example, the “Hatch Fill” extension.
The Hatch Fill extension is particularly useful for laser engraving can be accessed through the menus Extensions > Generate from Path > Hatch Fill. This extension is a great way to fill your shape with vector lines which enables your laser to effectively fill in the shape.
3. Preparing the Design for Laser Engraving:
Once your design is complete, it’s important to prepare it for laser engraving. Follow these steps to optimize your design:
- Convert Text to Paths: To avoid any text issues, select any text elements in your design and convert them to paths. Go to “Path” > “Object to Path” or use the shortcut Shift+Ctrl+C.
- Remove Overlapping Paths: Overlapping paths can cause confusion during the engraving process. Select any overlapping paths and use the “Path” > “Combine” command or the shortcut Ctrl+K to merge them into a single path. You can also use the various other options under the “Path” menu to combine vectors in the exact way you want.
- Specify Engraving Parameters: With the J Tech Photonics add-on, you can define different engraving parameters for various elements of your design. Access the J Tech Photonics Menu: From the menu bar, navigate to “Extensions” > “Generate Laser G-code” > “J Tech Photonics Laser Tool.”
4. Generating G-code for Laser Engraving:
Once your design is prepared, it’s time to generate the G-code that will instruct the CNC machine on how to perform the laser engraving. Follow these steps:
- Select Your Design: Use the selection tool in Inkscape to select the entire design you want to engrave.
- Access the J Tech Photonics Menu: From the menu bar, navigate to “Extensions” > “Generate Laser G-code” > “J Tech Photonics Laser Tool.”
- Configure Engraving Settings: In the J Tech Photonics Laser Tool dialog box, specify the laser power, feed rate, and other parameters that match your engraving requirements. One setting that I really like here is the “Passes” option: this option repeats the cut/engrave operation whilst decreasing the ZHeight. It is a great option to help cut through some of those thicker materials.
- Generate G-code: Click on the “Generate G-code” button, and Inkscape will process your design and generate the corresponding G-code file.
5. Sending the G-code to Your CNC Machine:
Once you have the G-code file, transfer it to your CNC machine. Use your preferred method, such as USB or network transfer, to send the code over to your machine.
REMEMBER: LASERS ARE DANGEROUS! ALSO DOUBLE CHECK THE GCODE BEFORE LEAVING IT UNATTENDED…KEEP YOUR HAND NEAR THE STOP BUTTON ON THE FIRST RUN!
If for whatever reason the addon spits out GCode that needs some modification for your machine, you can open the file in any text editor to make simple adjustments. Just a simple ‘Find and Replace’ can often solve your issue. For anything more complex (or for a more permanent solution) you could modify the addon to suit your needs.
Final Thoughts
Hopefully this help someone (or myself in the future!) on how to generate Laser GCode with Inkscape and J Tech Photonics. Now I’ll leave you with a few photos of some projects – all generated through Inkscape and the J Tech Photonics add-on.