I got tired of firing up Inkscape to convert DXF to SVG, so I figured out how to do it from the command line. The obvious method of using the inkscape command line script doesn’t work because DXF input is an extension and it can’t find your files for some reason.
You need to run the python input extension directly. First, you must get the lxml library installed. You can use easy_install as outlined in that link, but I prefer pip. Unfortunately, then you need pip installed. I prefer to use the python from Homebrew (install homebrew, then “brew install python”), in which case you will be using “python2” and “pip2” below, and omitting “sudo”.
above the import line at the top of the file, and searching for "<svg " and adding
However, I just discovered a bug in the Inkscape DXF import where certain 180 degree arcs will become flipped around. I looked for alternative conversion methods, and everything was either too arcane to bother with or had the same issue, until I came across this one: https://cloudconvert.com/dxf-to-svg
It works, is easy, and will give you a certain number of free conversions per day (25 maximum).
Yeah, I’m going to have to say, don’t use this. Not because of zero-byte files, which I never ran into, but because it turns out the SVG you get from running that file is missing a bunch of stuff which running it from within Inkscape fills in. So uploading the results to Glowforge occasionally results in a stuck processing dialog.
I’ve found that it is best to do some manual processing on DXF to SVG converted files, in any case. Like, all the path segments come in as individual paths, so I like to select everything that should be cut in a single operation and combine them, so you don’t get strange cutting behavior where it jumps around and cuts things out of order.
Anyone else notice the double cut from a Fusion 360 sketch saved as a DXF, and converted into an SVG via Inkscape ?
Turns out that Fusion 360 by default will add in a second layer with a duplicate path in the DXF which gets passed through to the process to the SVG. And the GF dutifully does what it was told and cuts the line twice (one for each path).
(Note: it could be my 360 workflow, creating a sketch that is a projection of a body)
Thanks for this scripting idea…hopefully I can get something similar working in Linux.
I’ve been happily cutting SVG files from Inkscape, but this morning I went to use OpenSCAD to generate a more “functional” / “dimensional” file and was very surprised to find that DXF was not natively supported by the Glowforge import pipeline.
I found a thread from November of last year that said “The DXF format is going to be delayed, but is in the hopper for future development.”
Sure, I can import/export from Inkscape manually to make an SVG, but this is a pain, especially when cutting multiple trials with very small changes to get an exact fit. I hope they get DXF support integrated soon.