Here are some preliminary .xslt files and a bash script that converts an SVG
to a PCB element list. I use xsltproc as my transforming engine, but any
xslt tool should work.
The bash script takes an input file and runs it through two xsl stylesheets. The first sheet attempts to put the SVG into a form containing just the content type <lines>. The second xslt converts the <lines> to a PCB element list.
The xslt's process the supplied example .svg. The output appears to be correct, .... but the general case of converting a generic svg isn't there yet. Please feel free to help get it to work for the more general case.
To work with, download all the files below into the same directory. Then
run the script. The resulting output is suitable for "file->load element data
to past buffer" in PCB
svg2svg_lines.xsl, takes an svg containing paths and converts to lines
svgpath2lines.xsl, helper function for above stylesheet lines
xsltmatrixtransform.xsl, scales, rotates, and offsets as per the svg matrix spec.
svg_lines2pcb.xsl, takes an svg containing just lines to PCB format
convert.sh, script to process above xslt's
grb.svg is an example svg created with
It is a board outline 0.850 wide by 3.116 long. There are two 45 degree miters on the left hand side and cutouts on the right hand side (see image below)
svg2footprint.xsl, takes a specialized svg and converts it to a PCB footprint
Copyright 2011, all rights reserved unless specified otherwise.
gedasymbols.org is maintained by DJ Delorie