Laser cutting tips and tricks (SVG -> DXF)

1,235 views
Skip to first unread message

Dave Ingram

unread,
Dec 22, 2011, 9:30:42 AM12/22/11
to london-h...@googlegroups.com
Hey all,

So, we know that Inkscape has problems exporting to DXF for the laser cutter. Stuff often ends up scattered all over the place, and it's not always possible to reassemble it.

But fear not - there is a solution! Simply export from Inkscape to EPS and then use pstoedit to handle the DXF conversion. The command you'll need:

pstoedit -dt -f dxf:-polyaslines layz0r.eps layz0r.dxf

The laser cutter software definitely handles the resulting DXF beautifully. I know; I've just done a cut using exactly this method.

For commandline fans, this can also be accomplished by doing:

inkscape -E layz0r.eps layz0r.svg && pstoedit -dt -f dxf:-polyaslines layz0r.eps layz0r.dxf

or:

inkscape -E /dev/stdout layz0r.svg | pstoedit -dt -f dxf:-polyaslines - layz0r.dxf

Note that you must use /dev/stdout, as Inkscape doesn't accept "-" to mean standard output.

Final thought: this method is not without its quirks. The imported DXF will be scaled to be tiny (something like 1/10 of its Inkscape size), and will end up positioned a long way off the left and bottom of the on-screen laser bed. The size *might* be fixable by using:

pstoedit -dt -f 'dxf:-polyaslines -mm' layz0r.eps layz0r.dxf

but I haven't tested this. There are also arguments for rotating, translating, and scaling the output of pstoedit, but those need further experimentation.

Bonus tip: if you colour the shapes before exporting to EPS, then they will keep their colour through the conversion process. This makes it easier to assign different actions/powers/speeds in the laser cutter software, as you don't have to rely on its line-selection methods.

Things that might be possible and need further testing: using dxf_s as the output filter instead of dxf, to allow proper spline curves to be output.

This has been a public service announcement from DMI.


D

tom

unread,
Dec 22, 2011, 12:47:08 PM12/22/11
to London Hackspace
this is odd as i've never had a problem with inkscape->dxf exports on
linux, windows or os x..


another handy tip is this:
http://code.google.com/p/sketchup-svg-outline-plugin/

sketchup is crap at curved surfaces, which makes it perfect for
designing laser-cut objects:)


On Dec 22, 2:30 pm, Dave Ingram <d...@dmi.me.uk> wrote:
> Hey all,
>
> So, we know that Inkscape has problems exporting to DXF for the laser
> cutter. Stuff often ends up scattered all over the place, and it's not
> always possible to reassemble it.
>
> But fear not - there is a solution! Simply export from Inkscape to EPS
> and then use pstoedit <http://www.pstoedit.net/> to handle the DXF

Dave Ingram

unread,
Dec 22, 2011, 12:58:45 PM12/22/11
to london-h...@googlegroups.com
On 22/12/11 17:47, tom wrote:
> this is odd as i've never had a problem with inkscape->dxf exports on
> linux, windows or os x..
It depends on how complex the drawing is, and what exactly you've done
to it. It seems to dislike transformations on paths and object cloning.
I can show you an example file if you're interested to see what happens :-)


D

>
> On Dec 22, 2:30 pm, Dave Ingram<d...@dmi.me.uk> wrote:
>> Hey all,
>>
>> So, we know that Inkscape has problems exporting to DXF for the laser
>> cutter. Stuff often ends up scattered all over the place, and it's not
>> always possible to reassemble it.
>>
>> But fear not - there is a solution! Simply export from Inkscape to EPS
>> and then use pstoedit<http://www.pstoedit.net/> to handle the DXF
>> conversion. The command you'll need:
>>
>> pstoedit -dt -f dxf:-polyaslines layz0r.eps layz0r.dxf
>>
>> The laser cutter software definitely handles the resulting DXF
>> beautifully. I know; I've just done a cut using exactly this method.
>>
>> For commandline fans, this can also be accomplished by doing:
>>

>> inkscape -E layz0r.eps layz0r.svg&& pstoedit -dt -f dxf:-polyaslines

Will Pearson

unread,
Dec 22, 2011, 7:06:56 PM12/22/11
to London Hackspace
How does it do with multi colour stuff for different layers? I wrote a
guide for getting inkscape to work nicely with text and stuff.

http://wiki.london.hackspace.org.uk/view/Guides/InkscapeForLaserCutting

Which mainly works. Might be worth adding in your method as an
alternative method

Will

tom

unread,
Dec 23, 2011, 4:49:04 AM12/23/11
to London Hackspace
aah generally I "select all -> object to path" anyway, seems to clear
most problems with exporting :)

I did notice that circle objects exported to DXF tend to crash the
laser cutter software, if you convert them to paths first it seems
happier

Dave Ingram

unread,
Dec 23, 2011, 6:29:13 AM12/23/11
to london-h...@googlegroups.com
On 23/12/11 00:06, Will Pearson wrote:
> How does it do with multi colour stuff for different layers? I wrote a
> guide for getting inkscape to work nicely with text and stuff.
Yeah, it works well. As I mentioned in the original post, colours
persist through the conversion process.

> http://wiki.london.hackspace.org.uk/view/Guides/InkscapeForLaserCutting
>
> Which mainly works. Might be worth adding in your method as an
> alternative method

See the "alternative method" heading on that very page ;-) Which I
actually added at the end of October, but haven't tested until now.


D

Dave Ingram

unread,
Dec 23, 2011, 6:33:51 AM12/23/11
to london-h...@googlegroups.com
On 23/12/11 09:49, tom wrote:
> aah generally I "select all -> object to path" anyway, seems to clear
> most problems with exporting :)
Yeah, I tend to draw in paths to begin with, so that doesn't do anything :-)

> I did notice that circle objects exported to DXF tend to crash the
> laser cutter software, if you convert them to paths first it seems
> happier

That's entirely possible, yeah.

One day, I will help the Great Laser Cutter Software Reverse Engineering
Effort, and it will accept a range of useful filetypes.


D

Reply all
Reply to author
Forward
0 new messages