OpenSCAD User Manual/Other 2D formats
The pstoedit program can convert between various vector graphics formats. OpenSCAD needs the
-polyaslines option passed to the dxf output plugin to understand the file. The
-dt options instructs pstoedit to render texts, which is usually what you want if you include text. (If the rendered text's resolution in terms of polygon count is too low, the easiest solution is to scape up the eps before converting; if you know a more elegant solution, please add it to the example.)
pstoedit -dt -f dxf:-polyaslines infile.eps outfile.dxf
pstoedit does not understand SVG, but EPS can be converted from an SVG. inkscape, an SVG editor, can be used for conversion.
inkscape -E intermediate.eps infile.svg pstoedit -dt -f dxf:-polyaslines intermediate.eps outfile.dxf
The conversion can be automated using the make system; put the following lines in your
all: my_first_file.dxf my_second_file.dxf another_file.dxf %.eps: %.svg inkscape -E $@ $< %.dxf: %.eps pstoedit -dt -f dxf:-polyaslines $< $@
The first line specifies which dxf files are to be generated when
make is called in the current directory. The second paragraph specifies how to convert a file ending in .svg to a file ending in .eps, and the third from .eps to .dxf.