parametric SVG to DXF for laser cutting labels

laser cut label

I’ve got a working pipeline that allows me to computer generate files for our new laser cutter at Bristol Hackspace! It works like this:

  • generate SVG with pysvg (all my examples use an older version). Ensure the page and viewbox are setup correctly to use millimeters:
    1
    <svg xmlns="http://www.w3.org/2000/svg" height="33.000000mm" width="85.000000mm" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 85 33" >

    See here for a code example.

  • on the command line, use inkscape to generate an encapsulated postscript file (eps): inkscape -E file.svg file.eps
  • use pstoedit to convert from eps to dxf, including turning text to lines, and keeping the scale correct. I’ve experienced segfaults with pstoedit, but it seems on modern versions (>11) of ubuntu this isn’t a problem any longer.

So, I’ve written a label generating program that makes use of the above, and I’m hoping to link it to an online inventory spreadsheet. I’ve also shared it on thingiverse.

Leave a Reply

Your email address will not be published. Required fields are marked *