svg to dxf

Post questions on how to use or achieve an effect in Inkscape.
pfeuh
Posts: 13
Joined: Fri Jun 21, 2019 2:51 pm

svg to dxf

Postby pfeuh » Fri Jul 05, 2019 12:55 am

Hello,

As continuation of this topic, I can now laser cut with scripted python files, but there is another problem. The chinese laser cut machine we use understand only dxf files. So I did one, with Inkscape option Files/Save and then changing filetype to AutoCAD DXF R14, it is the only dxf format that I found in Inkscape.

There is of course a generated .dxf file, I could cut rectangle, but some things are missing, I've noticed theses:

Scale is lost.
Rounded rectangles are no more rounded.
Circles are missing.
Text is missing.

A friend told me that it is a question of path, I should convert the rectangles/circles/texts in path, I'm not aware about that. Perhaps I am wrong, It's surely a newbee error of mine, but I haven't found anything concerning that. Anyway, the two files are in attachment, .svg and .dxf.

test.zip
(2.85 KiB) Downloaded 65 times


Regards,

Pfeuh

Trygon
Posts: 8
Joined: Tue Jul 02, 2019 4:46 pm

Re: svg to dxf

Postby Trygon » Fri Jul 05, 2019 1:46 am

I have used Inkscape to generate dxf files for import into RDWorks, the software used to drive our Chinese laser cutter.

I have not had a problem with the scale being lost. This may help, set
File -> Document Properties -> Page (tab) - Display units = mm
and then,
File -> Save as - Save file type = *.dxf
in the "Desktop Cutting Plotter" pop up window set, Base unit = mm

You are correct that Objects must generally be converted to paths before saving as a dxf file. Select each object (or all) and then convert with Path -> Object to path

I hope this helps.

pfeuh
Posts: 13
Joined: Fri Jun 21, 2019 2:51 pm

Re: svg to dxf

Postby pfeuh » Fri Jul 05, 2019 3:52 am

Thank you for this answer. It helps a lot. I have done these jobs:

install the last inscape 9.2
load the file test.svg
change all objects to path
Change current unit to mm
save the file as test.dxf

Open file selector with new file
select file test.dxf
selected "Scaling -> read from file
load the file

It works much better, I have now all missing parts, circles, rounded rectangles and texts. But...

The new sketch is really too small, not scaled at all
the stroke_width is too big
Texts are not filled, just stroked.

This was the case of a new file. If I import the file test.dxf in the already open test.svg, scale is good but I have still the problems of stroke_width and not filled text.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: svg to dxf

Postby Moini » Fri Jul 05, 2019 4:20 am

Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

pfeuh
Posts: 13
Joined: Fri Jun 21, 2019 2:51 pm

Re: svg to dxf

Postby pfeuh » Fri Jul 05, 2019 4:03 pm

Shame on me! I didn't noticed this in the FAQ! Anyway, my problem seems to be the same, but this tip doesn't fix the issue.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: svg to dxf

Postby Moini » Fri Jul 05, 2019 9:53 pm

Have you tried using a different template for your drawing?
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

pfeuh
Posts: 13
Joined: Fri Jun 21, 2019 2:51 pm

Re: svg to dxf

Postby pfeuh » Fri Jul 05, 2019 9:58 pm

I don't know wath template you are talking about. I script with svgwrite, it makes me a svg file, then I open it with inkscape to generate a dfx file.

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: svg to dxf

Postby Moini » Sat Jul 06, 2019 7:57 am

Ah. Can you share the head part of an svgwrite svg file and of one that has been opened with Inkscape? I think you might just need to add some unit identifiers to fix this.
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

Moini
Posts: 3381
Joined: Mon Oct 05, 2015 10:44 am

Re: svg to dxf

Postby Moini » Sat Jul 06, 2019 7:57 am

(full files are fine, too)
Something doesn't work? - Keeping an eye on the status bar can save you a lot of time!

Inkscape FAQ - Learning Resources - Website with tutorials (German and English)

Trygon
Posts: 8
Joined: Tue Jul 02, 2019 4:46 pm

Re: svg to dxf

Postby Trygon » Sat Jul 06, 2019 4:15 pm

With regard to "filled text" and based on my use of RDWorks (the software that generates the driver files for our laser cutter):

Text is generally engraved onto the surface of a piece of material using a sequence of parallel very shallow cuts. These shallow cuts are created by running the laser at very low power and moving it very quickly over the material (high power and slow would cut through the material), in our case this equates to 500mm/s and 10% power for acrylic sheet.

The text is exported as (saved as) an outline path from Inkscape in a dxf file:

Image

In RDWorks the imported text outline path from the dxf file is placed on a layer that is set as "scan" (=engrave). RDWorks automatically generates the required scan paths for the laser head:

Image

Thus the text only becomes "filled" once the job is run on the laser cutter.

pfeuh
Posts: 13
Joined: Fri Jun 21, 2019 2:51 pm

Re: svg to dxf

Postby pfeuh » Sat Jul 06, 2019 8:13 pm

Hello, thank you very much for your answers, much appreciated! I'm not at home at the moment. Back in a while! ;)

pfeuh
Posts: 13
Joined: Fri Jun 21, 2019 2:51 pm

Re: svg to dxf

Postby pfeuh » Sun Jul 07, 2019 5:18 pm

Bas post. I haven't find how to delete it. :?
Last edited by pfeuh on Sun Jul 07, 2019 5:34 pm, edited 2 times in total.

pfeuh
Posts: 13
Joined: Fri Jun 21, 2019 2:51 pm

Re: svg to dxf

Postby pfeuh » Sun Jul 07, 2019 5:30 pm

Hello,

The .svg file generated in python is here:

test.svg
(10.73 KiB) Downloaded 86 times


The .dxf generated from this .svg file is here:

test.zip
(36.41 KiB) Downloaded 82 times


Thanks for informatrion about engraving text on laser cutter.


Return to “Help with using Inkscape”