Inkscape.org
Using Inkscape with Cutters/Plotters New Inkscape extension for easy laser cutting with LaserGRBL
  1. #1
    Nikki.Smith Nikki.Smith @Nikki.Smith
    🔥🔥*

    This extension for Inkscape speeds up preparation of laser cutting jobs if you use LaserGRBL (included free with most laser cutters).

    Pick your model of laser and material / thickness from pulldown lists, then export a complex job directly into LaserGRBL with one click. Use different coloured lines for each part of a job. eg, red lines to engrave in a single pass at 3000 mm/min @ 80% power, but blue lines cut in 3 passes at 300 mm/min @ 90% power.

    The emphasis is on it being very easy to use, with the bare minimum of settings.

    What this extension doesn't do:

    • Image / photo engraving
    • Text objects, but works if you use Inkscape's Object > Convert to path on any text first
    • Export for plotters, CNC machines or other G-code devices
    • Give full control over the G-code output, with hundreds of settings
    • Create test patterns with many different speed / power levels

    Download the latest Inkscape and LaserGRBL packages.

    How to install

    To manually install this extension, download and unpack the archive file. Copy the export_lasergrbl folder to the location listed by the Inkscape menu:

      Edit > Preferences > System: User extensions

    For Windows users this will be something like:

      %APPDATA%\inkscape\extensions

    Restart Inkscape and the new extension will be available from the menu:

      Extensions > Export > Export to LaserGRBL

    Using the extension

    The extension uses different coloured lines for each part of a job, naming them: Engrave, Inner Cut & Outer Cut colours. However these are just labels, and your job might actually use them for engraving 3 colours at different depths, or only consist of basic cutting with a single colour. In the animation below the red line & text are engraved first, then the green circles are inner cuts, and finally the blue outer cut releases the finished piece. (Inner cuts are usually done before outer, otherwise the overall piece may move when released and any further cuts would be in the wrong place).

    You can export your entire document, or make a selection of objects / groups. Then open the extension from the menu:

      Extensions > Export > Export to LaserGRBL

    Firstly choose your model of laser from the pulldown, and the material you are using. This is only a shortcut, and you can leave them blank and enter your own numbers for passes / speeds / powers.

    Click on a coloured box to change the colour to one from your Inkscape document, or alternatively you could edit your document to use the default red / mid-green / blue. If you don't need any engraving then don't use that colour, or set it to zero passes. Other colours are not exported, so for example your document could include annotations / notes that aren't sent to the laser cutter.

    Don't assume the default passes / speed / power settings are correct, as there is a lot of variation within even the same model of laser, the exact focal distance, air assist volume, between sheets of the same material and even the humidity (when cutting wood). It is always worth doing a small test cut first and tweaking the settings as required, before starting a long job. When trying a new material or thickness, you can generate test patterns in LaserGRBL to "dial in" the best settings for your particular set up.

    The total distance the laser head will move is shown, with distance per colour. A rough estimate of the time is also shown, so you can see how making more passes or using a slower cutting speed will increase the time taken.

    By default the new G-code file will be saved with the same filename & location as your Inkscape document, but with a .nc extension. You can change this if wanted, before finally clicking on "Export All". If the button is greyed out then there is nothing set to export: check the colours are correct, there is at least one pass set, and that you are exporting all the document (or the selection you intended).

    LaserGRBL should automatically start with the new job open. If it doesn't then set in your operating system. eg, for Windows: right-click on any .nc file, Open with > Choose another app select LaserGRBL and tick "Always use this app to open .nc files". You can also start LaserGRBL yourself, and load the saved G-code file.

    You've already set the number of laser passes for the job, so you don't need to do anything in LaserGRBL except click the connect icon, wait a few seconds, then click play to start cutting.

    Adding new lasers/materials to the pulldowns

    You can add (or edit) the contents of the pulldowns using LaserGRBL's Grbl > Material DB. Scroll to the bottom of the table to add a new entry:

    The extension uses a local copy of the material db file. After making any changes in LaserGRBL, you'll need to copy the file into the extension's own folder. On Windows this might be:

      %APPDATA%\LaserGRBL\UserMaterials.psh  →
      %APPDATA%\inkscape\extensions\export_lasergrbl\UserMaterials.psh

    One helpful feature is the 'Remarks' column, which lets you record notes about using a material. eg, the focal distance for cutting that thickness with your laser, or the fumes need a certain air assist setting. These notes are shown when you choose that material in the Inkscape extension.

    To make the extension pulldowns shorter, you can hide laser models that you don't own by unticking the 'Visible' column.

    Configuration

    The default settings can be altered by editing the export_lasergrbl/export_lasergrbl.ini file with any text editor. You can override the defaults when you run the extension.

    laser = Atomstack A5 PRO
    Name of your laser cutter model, or leave blank. Should be exactly as it appears in the pulldown menu

    material = Acrylic 2.8mm
    Name of the material you use most often, or leave blank. Should be exactly as it appears in the pulldown menu

    colors = #ff0000,#008000,#0000ff
    Up to 3 colours that you use in your Inkscape documents for: engraved, inner cuts & outer cuts. Each colour is a 6-digit hex code, "#rrggbb". You can see the hex code for any colour in your document by right-clicking in this extension's colour-chooser, and select 'Customize'

    maxrate = 6000
    Maximum speed (in mm/min) that your laser head can move at. This is ONLY used for estimating how long the job will take, it doesn't change the speed. For your model of laser you can copy the speed from LaserGRBL's Grbl > Grbl Configuration and scroll down to "$110 X-axis maximum rate"

    darktheme = 0
    Set to 1 if you'd like the extension window to use white text on a dark background. See Inkscape's Edit > Preferences, "Interface > Theming > Use dark theme" checkbox

    Future ideas

    Any feedback, suggestions or bug reports is VERY welcome. Below are some ideas, but I'll wait for feedback before working on any of them:

    1. Do you need to set the origin point for your laser cutter: bottom-left or top-left? Should it be an option in the .ini configuration file?
    2. Should there be an option to load the models / materials database directly from LaserGRBL, instead of the user having to make a copy of the file? So it stays up to date as the user adds new material settings
    3. Are the job time estimates reasonably accurate?
    4. Should it save colours / speed / passes inside the document so next time it is opened it is ready to cut? Or at least save in memory so the user can easily tweak their settings and export again
    5. Should there be a warning message if the document contains text or image objects?
    6. Should it directly support text objects? (without needing to use Object > Convert to path first)
    7. Should there be a warning message if the G-code save file already exists, and will be overwritten?
    8. Does it need inches/metric setting, or does everyone use mm for laser cutting? Does it work if a document is defined in px, inches, etc? (untested!)
    9. Does it work with non-RGB colours, like HSL ? What about different opacities? (untested!)
    10. Should I add an option to optimise the cutting order of the document (for shorter travel between cuts), to speed up the overall job?
  2. #2
    COD COD @COD

    So many users at Facebook and Reddit will be happy with this extension. 

    https://www.reddit.com/r/Laserengraving/

    https://www.facebook.com/groups/128006759392756

     

  3. #3
    Martin Owens Martin Owens @doctormo🌹🧀
    *

    For Inkscape 1.4 and above, extension authors can use the new "<action>" tag in the inx file to request pre-processing of the svg that is sent to the extension. This can include running "object-to-path"

    <inkscape-extension>
      ...
       <action pref="optional_pref_check">doc.all-objects-to-paths</action>
       ...
    </inkscape-extension>

     

  4. #4
    Nikki.Smith Nikki.Smith @Nikki.Smith
    doctormo

    For Inkscape 1.4 and above, extension authors can use the new "<action>" tag in the inx file to request pre-processing of the svg that is sent to the extension. This can include running "object-to-path"

    That sounds great, thanks! I'll definitely be adding that feature to convert text objects once v1.4 is released.

  5. #5
    Tribo_2.0 Tribo_2.0 @Tribo_2.0

    Eu havia experimentado em Laptop e agora experimentei no PC, em ambos acontece o mesmo, fica parado logo no começo na linha M3 S0 e não faz mais nada...

  6. #6
    Nikki.Smith Nikki.Smith @Nikki.Smith
    Tribo_2.0

    Eu havia experimentado em Laptop e agora experimentei no PC, em ambos acontece o mesmo, fica parado logo no começo na linha M3 S0 e não faz mais nada...

    Thanks for trying it! I think the problem is the very long comment (for the complex curve) the extension put in that file, confusing the laser cutter. The next release of my extension will fix this bug. Please can you try this attached version of your file to see if it works?

    Also, would you be interested in contributing a Portuguese translation for the extension? The next release will support multiple languages, and I already have English, Greek, Turkish and Ukrainian. You don't need to be a coder or expert user: it is just a short text file.

  7. #7
    Nikki.Smith Nikki.Smith @Nikki.Smith
    *

    New release v1.10 14/Oct/2024

    To manually install this extension, download and unpack the archive file. Copy the export_lasergrbl folder to the location listed by the Inkscape menu:

    Edit > Preferences > System: User extensions

    Changelog

    • now saves laser settings in the SVG file (<lasergrbl:info />), so already set next time that document is loaded
    • G-code max power was fixed as S1000, but can now be changed with new smax config option (for lasers that require it)
      documented in README
    • localization support in locale folder, with multiple language translations:
      English (US), English (Australian/British/Canadian), French, German, Greek, Italian, Spanish, Turkish, Ukrainian
      fields in window horizontally aligned: looks much better if different font sizes / word lengths
      new translations.html file
    • long remarks for a material now wrap onto multiple lines, avoids pushing window wide
      removes previous remarks if no material chosen
      BUG wasn't showing engrave-only remarks
    • new db config option to load materials database file direct from LaserGRBL (default is copy in extension folder)
      documented in README
    • max travel speed of laser was assumed to be 6000 mm/min, but can now set with new maxrate config option
      documented in README
    • renamed "Laser Model" label (shorter, consistency with LaserGRBL)
    • hides unneccessary distance / time breakdowns if nothing to export
    • now shows friendly error message if Inkscape is too old (need v1.2 or later to run)
    • included version number in window titlebar, top of source file & README
       
    • New "Troubleshooting" section in README
    • added note about Inkscape 'hanging' while extension is open
      added note about "Export" button greyed out
      added note about minimum Inkscape version
    • added tutorial to README for more than 3 colours (in a really complex job)
    • documentation has improved accessibility & responsive design for smaller screens
      new navigation widget to jump around README
      can now click to replay video of using extension
    • removed plaintext README.txt file, redundant with an HTML version
    • added notice of Creative Commons licence, CC BY-ND 4.0
    • added this changelog.html file
       
    • truncates "% path..." debugging in G-code output to 80 chars max
    • BUG very long comments (eg, from complex curves) could halt LaserGRBL job
      BUG comments now start with semi-colon character
    • skips zero-distance move G-code if last point on path == first point on next path (<0.01mm)
    • BUG improved travel distance calculation (was assuming laser returned to origin after each pass)
    • supports cloned objects when calculating distance/time, and for exporting G-code
    • BUG now correctly handles a discontinuous path (with a gap) instead of cutting it all
  8. #8
    Tribo_2.0 Tribo_2.0 @Tribo_2.0

    Olá. Desculpe-me mas só vi hoje seu post pedindo para fazer o teste, não havia recebido nenhum aviso sobre sua postagem... recebi aviso sobre a nova versão que estarei testando nos próximos dias.
    Quanto à tradução para o Português posso fazer sim, com muito prazer, apenas me oriente como.

  9. #9
    Nikki.Smith Nikki.Smith @Nikki.Smith

    @Tribo_2.0 thank you! Once you have the new version, please send me a Direct Message on this site and I'll explain how to add a new translation.

  10. #10
    Tribo_2.0 Tribo_2.0 @Tribo_2.0

    Enviei mensagem... eu acho

  11. #11
    Chris Chris @putt1ck

    Hi

    Thanks for your work on this. I tried adding to my Inkscape (newly installed v1.4 on Linux) and it returns an error when I try to access it:

    Traceback (most recent call last):
      File "/home/chris/.config/inkscape/extensions/export_lasergrbl/export_lasergrbl.py", line 12, in <module>
        import inkex, gi
      File "/usr/share/inkscape/extensions/inkex/__init__.py", line 11, in <module>
        from .extensions import *
      File "/usr/share/inkscape/extensions/inkex/extensions.py", line 34, in <module>
        from .elements import (
      File "/usr/share/inkscape/extensions/inkex/elements/__init__.py", line 10, in <module>
        from ._base import ShapeElement, BaseElement
      File "/usr/share/inkscape/extensions/inkex/elements/_base.py", line 40, in <module>
        from ..styles import Style, Classes, StyleValue
      File "/usr/share/inkscape/extensions/inkex/styles.py", line 31, in <module>
        import tinycss2
    ModuleNotFoundError: No module named 'tinycss2'

    Presumably that's just a resolvable dependency issue, but wary of going down that path without further input.

    NB if there's a more appropriate place to post bug reports/RFEs please let me know.

    Thanks

    Chris

  12. #12
    Nikki.Smith Nikki.Smith @Nikki.Smith
    *

    Thanks for the report Chris. Unfortunately none of those errors seem to be due to my extension, and I've not seen them reported before by any other users. If Inkscape is failing to even import inkex, gi then I'm guessing that something is very wrong with the installation?

    Looks like it might be a bug with the Linux release of Inkscape v1.4 ? and a fix is:

    sudo apt install python3-tinycss2

    https://gitlab.com/inkscape/inkscape/-/issues/5070

  13. #13
    Chris Chris @putt1ck
    🐧

    I'll report the missing dependency to the maintainers of the particular Linux distro (KaOS) 👍

  14. #14
    AlexDesign29 AlexDesign29 @AlexDesign29
    🔧

    Hello,
    It seems to be a nice plugins, but I have a strange problem : all the dimensions are stretched when exported in laserGrbl.

    For exemple : in inkscape I draw a rectangle 50x70 mm when I export it in LaserGrbl I've got a 66x93 mm. Please note that if I save my document and import it in LaserGrbl (without the plugin) every dimensions are ok.

    The proportions are 50/60 -> 0.75 that is 72/96, this is generally a problem from pixels definitions from screen (72 dpi) and print (96dpi) but I can't find where to set it in the plugins.

    Is there a settings for the plugins somewhere to change to avoid this rescaling ?

    Regards Alex.

  15. #15
    ptrbccrn ptrbccrn @ptrbccrn

    Hello, very nice and usefull plugin!!
    A little question: ho i can engrave all the text area and not only the outline? (like the "TRIBO" text above...;)

    Many Thanks
    Bacc

  16. #16
    Nikki.Smith Nikki.Smith @Nikki.Smith

    @AlexDesign29 thanks for trying it! There is definitely a bug with the current release where it doesn't always scale correctly. Can you please send me a copy of your SVG that doesn't work, and I'll check if it is fixed with my latest dev build?

    I'm hoping to get a new public release of the extension out this week.

    Cheers

  17. #17
    AlexDesign29 AlexDesign29 @AlexDesign29

    @Nikki.Smith : Here is the code from a svg file who have a 100 x 50 mm rectangle in inkscape (Vers. 1.3.2) and when exported in laserGrbl (Version 3, 29 June 2007) 134 x 66 mm:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <!-- Created with Inkscape (http://www.inkscape.org/) -->

    <svg
       width="400mm"
       height="400mm"
       viewBox="0 0 538.72053 538.72054"
       version="1.1"
       id="svg5"
       inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
       sodipodi:docname="dessin.svg"
       xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
       xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:svg="http://www.w3.org/2000/svg">
      <sodipodi:namedview
         id="namedview7"
         pagecolor="#ffffff"
         bordercolor="#cccccc"
         borderopacity="1"
         inkscape:showpageshadow="0"
         inkscape:pageopacity="1"
         inkscape:pagecheckerboard="0"
         inkscape:deskcolor="#d1d1d1"
         inkscape:document-units="mm"
         showgrid="false"
         inkscape:zoom="3.1930397"
         inkscape:cx="101.00094"
         inkscape:cy="1354.0389"
         inkscape:window-width="2560"
         inkscape:window-height="1387"
         inkscape:window-x="2552"
         inkscape:window-y="-8"
         inkscape:window-maximized="1"
         inkscape:current-layer="layer1" />
      <defs
         id="defs2" />
      <g
         inkscape:label="Calque 1"
         inkscape:groupmode="layer"
         id="layer1">
        <rect
           style="fill:none;fill-rule:evenodd;stroke:#ff0000;stroke-width:0.356341;stroke-linecap:round;stroke-linejoin:round"
           id="rect1"
           width="134.32379"
           height="66.983727"
           x="0"
           y="471.73679" />
      </g>
    </svg>

  18. #18
    Nikki.Smith Nikki.Smith @Nikki.Smith

    @AlexDesign29 thanks! yes that bug has been fixed, so should be fine with the next release 😅

  19. #19
    Nikki.Smith Nikki.Smith @Nikki.Smith

    @ptrbccrn engraving filled shapes is a new feature in the next release, so should be available soon 🤞

  20. #20
    AlexDesign29 AlexDesign29 @AlexDesign29

    Super cool, I can't wait for the release. Thanks in advance for all your hard work.

  21. #21
    Tribo_2.0 Tribo_2.0 @Tribo_2.0

    @ptrbccrn Until the new version with this new feature is released, you can use the Hatch Fill extension. That's what I used to fill in the TRIBO text.
    https://inkscape.org/pt-br/~Moini/%E2%98%85hatch-fill+1

Inkscape Inkscape.org Inkscape Forum Using Inkscape with Cutters/Plotters New Inkscape extension for easy laser cutting with LaserGRBL