Inkscape.org
Beginners' Questions How convert svg to dxf from command line properly?
  1. #1
    tolyan tolyan @tolyan

    For converrting svg to dxf I use svgToDxf.sh (see in attachment) My source svg and result dxf screenshot also in attachment.  Π•he problem is that the smooth curves turned into a set of straight lines. 

    How I can resolve this issue?

    Vasya
    Lin Bad
  2. #2
    Maren Hachmann Maren Hachmann @Moiniβš–

    The first thing to find out would be: Does the dxf file format in the version that Inkscape knows have support for anything but straight lines?

  3. #3
    tolyan tolyan @tolyan

    The first line of result dxf is:

    %!PS-Adobe-3.0 EPSF-3.0

    How convert to dxf with curves? Also I found second way. In console:

    inkscape -f vasya.svg -E vasya-ink.dxf

    in this case vasya-ink.dxf looking good in adobe illustrator, but inkscape can't open it

    Vasya Ink
  4. #4
    Tyler Durden Tyler Durden @TylerDurdenβš–
    *

    "Vasya Ink" is not a dxf. It is an EPS file.

     

    And FWIW, Inkscape can via GUI output DXF with arcs, splines, polylines, circles, etc.

     

    Autodesk Fusion 360 (Startup License) 2019 08 24 08 48 38
  5. #5
    Maren Hachmann Maren Hachmann @Moiniβš–

    Yep, consulting the man page I see:

     -E, --export-eps=FILENAME

     

  6. #6
    tolyan tolyan @tolyan

    Ohh... 

    in man inkscape output i see nothing about export to dxf. 

    I need convert svg to dxf on linux server without GUI

    How I can resolve my problem?

  7. #7
    tolyan tolyan @tolyan

    I found solution. in shell script I change line

    pstoedit -dt -f 'dxf:-polyaslines -mm' "${epsfile}" "${dxffile}" >/dev/null 2>&1

    to

    pstoedit -dt -f 'dxf_s:-splineasbezier -mm' "${epsfile}" "${dxffile}" >/dev/null 2>&1

    I hope this help someone

     

  8. #8
    Martin Owens Martin Owens @doctormoπŸŒΉβš–πŸ§€

    It's possible to use the inkscape extensions (python) without inkscape being installed. So converting svg to dxf should be possible by running these extensions alone.

    https://gitlab.com/inkscape/extensions/blob/master/dxf12_outlines.py

  9. #9
    brynn brynn @brynn

    In this case, the question was how to use the commandline to convert the format.

    Inkscape can convert it from the interface as well.Β  So conversion website is not needed.

  10. #10
    Moult Moult @Moult

    I've managed to follow the instructions in this thread to do SVG->EPS, and then EPS->DXF. However, in the process, fonts are not translated to text entities in DXF, and any hatching (patterns) in SVG + CSS are lost in the conversion.

    Β 

    Does anybody know how to retain this information during the conversion? Or an alternative workflow?

Inkscape Inkscape.org Inkscape Forum Beginners' Questions How convert svg to dxf from command line properly?