I would like to know where I can find a reliable tool/library for conversion of svg to dxf. In between formats are also allowed as long as the dxf output is an exact replica of the svg. So that means conversion of the paths (and in particular bezier curves and arcs). I've looked at the svg2dxf export in inkscape but that's cutting corners (literally as that it draws straight lines between some curved endpoints). A library should be preferable in java, perl or python as I'm most familiar with these languages. I also would be willing to spend a small amount for a commercial product. I've done some googling but strange enough the majority of entries are over 5 years old. I'm also interested in a more readable specification of the dxf as the one published on the autocad website is not very verbose.
kind regards, jeroen.
There is Stani's DXF library and batik you could join this two together.
I have written my own pre-svg builder "iPath" in javascript basically to replace the d-attribute of svg's path elementent. It allows for a more verbose creation of paths:
var freeForm = new iPath().line(20,30).bezier(20,20, 40,40, 50,50).line(30,30);
You can use it in an svg element like:
<path class="clazzz" d="#{freeForm.dPath(3)}"/>
With the aid of Stani's library mentioned in previous answer and Manfred's Moitzi's dxfwrite I implemented a dxf exporter for iPath. Use it like:
freeForm.dxf()
more examples (still working on documentation) on iScriptDesign and experiments with animation on stretchsketch
Try Inkscape; open the svg then use "save a copy" to save as a dxf file.
来源:https://stackoverflow.com/questions/3837777/svg-2-dxf-conversion