Happy new year! And to celebrate, here’s a plugin for Inkscape that converts SVG documents into KiCAD footprints.

Quick recipe: Copy the files kicad_footprint.py kicad_footprint.ink and kicad_footprint_output.py into Inkscape’s share/extensions/ directory.

The capabilities are pretty crude but the initial results are promising. Here is the SVG document (100mm by 100mm) on Inkscape:

SVG sample

And here it is exported into KiCAD (grid is 10mm)

KiCAD sample

Interface is simple, many features are missing but works fine for quick SVG exports into KiCAD. Extension also registers a “Save As…” file format that will export the drawing using all the default options.

KiCAD sample

As usual, source is available on my source repository.

Limitations

The KiCAD footprint format has a limitation in so far it cannot “punch holes” on polygons. That means that a “ring” shape will be rendered improperly. To work around this issue, any shape with holes in it must be split into multiple shapes with no holes inside of them. While a future revision might do the splitting automatically (unlikely) this isn’t very hard to do.

Here is a shape with a “hole” in it; A ring.

Ring shape

And this is the incorrect result of trying to export it to KiCAD without splitting it:

Bad footprint

To address this issue, we will split the ring into two halves, so we draw a a line over it:

Bad footprint

Select both paths:

Select paths

Apply the “Division” operation:

Divide paths

At this point, the ring is split in halves, if we temporarily separate them they will look like this:

Halves

If we then save as KiCAD footprint, we can test the result is now correct.

Good footprint