About Gingerbread

Gingerbread is a tool that helps convert artistic printed circuit board (PCB) designs from vector art programs such as Affinity Designer or Adobe Illustrator into KiCAD files.

Gingerbread is useful for creating things such as #badgelife boards and faceplates / front panels, like this one:

Gingerbread is open source and is hosted at github.com/wntrblm/gingerbread. Copyright and acknowledgements are at the bottom of this page.

Using Gingerbread

At the moment, Gingerbread is intended to work with SVGs created in Affinity Designer. You'll need to make sure your design matches what Gingerbread expects.

Page settings

First, it's highly recommended to change your page settings to use millimeters and 2540 DPI, as shown here:

You might be wondering why that specific DPI? Well, 2540 DPI happens to be 1000 dots per mm, which helpfully avoids rounding issues when exporting the design from Affinity and when converting the outline and drills. You can use other DPIs by changing the DPI setting in Gingerbread once your design is loaded.

Creating an outline

The outline should be drawn on a layer named Edge.Cuts in Affinity. Gingerbread handles this layer in a specific way to make sure that there is a 1-to-1 match between the size and units in Affinity and KiCAD. This approach can't handle as many complex edge cases as the rasterization approach used by the graphic layers, but as long as your paths have been converted to curves it should handle them well. The outline layer can contain multiple curves, with inside curves getting converted to "cut-outs".

Graphics layers

Non-transparent areas on layers named F.SilkS, B.SilkS, F.Cu, and B.Cu in Affinity are converted to their respective layers in KiCAD. Note that F.Mask and B.Mask are "inverted" like they are in KiCAD, meaning that non-transparent areas indicate where to remove the soldermask- the preview in Gingerbread will shows the mask layers as they would appear on the printed board.

Gingerbread converts these layers by rasterizing all the items on each layer to black and white, re-tracing the raster image to polygons, and placing the resulting polygons into KiCAD. While this might seem odd, it works extremely well for a variety of SVGs.

Drills

Items on the layer named Drills in Affinity are also handled in a specific way. Gingerbread walks through all of the shapes in that layer and converts only circles into corresponding non-plated through hole drills in KiCAD. Just as with the board outline, this is done to preserve position and size between Affinity and KiCAD.

Exporting your design

When exporting you design to an SVG for Gingerbread, click the More button and setup the export parameters as shown below so that "Rasterize" is set to "Nothing", "Export text as curves" is checked, and "Flatten transforms" is checked.

You can save this as a preset to avoid having to change these every time you export.

Converting your design

Once the SVG is exported, drag and drop it onto the Gingerbread web page. Once loaded, you should see a preview of your design. Use the options in the right pane to configure the KiCAD output and validate the preview. Once you're ready, click the "Convert" button and your design will be copied to your clipboard, ready to paste directly into KiCAD's PCBNew.

Copyright and acknowledgements

Gingerbread is (c) 2022 by Winterbloom LLC & Alethea Katherine Flowers

Gingerbread is available under the MIT License:

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. This notice must be included in any distributions of this project or derivative works.

This project makes use of other works. These works and their respective license and terms are:

  • Clipper2 by Angus Johnson, licensed under the Boost Software License, Version 1.0.
  • Potrace by Peter Selinger, licensed under the GNU General Publice License, Version 2.
  • stb_image by Sean Barrett, licensed under the MIT License.
  • Alpine.js by Caleb Porzio and contributors, licensed under the MIT License.
  • path-data-polyfill by JarosÅ‚aw Foksa, licensed under the MIT License.
  • Bulma by Jeremy Thomas, licensed under the MIT License.
  • Material Symbols by Google, licensed under the Apache License, Version 2.0.
  • Overpass by Red Hat Inc., Delve Fonts LLC, licensed under the Open Font License.
  • Nunito by Vernon Adams, Manvel Shmavonyan, licensed under the Open Font License.
  • Bellota by Kemie Guaida, licensed under the Open Font License.