Workflow
Torturing KiCad with Maps
Or maybe KiCad is torturing me? Getting a map onto a silkscreen is hard!
What's the challenge?
The defining feature of CharlieBoard is the map, a highly intricate graphic printed directly on the front of a huge Printed Circuit Board (PCB). For context, the 8-by-10-inch Orange Line PCB has almost 1,000 feet of paths representing the streets of Boston. This map is a Scalable Vector Graphic (SVG) and uses over half a million points to define its shape. Making the map itself was manageable, but getting it onto a silkscreen, the graphic layer of the PCB, was a challenge.
Designing silkscreen maps meant working with three tools: QGIS for mapmaking, Illustrator (or Inkscape) for preparation, and KiCad for layout. Each step had its quirks that took some time to understand.
Making maps in QGIS
When I first had the idea of using a real map on CharlieBoard, I didn't know where to start. I looked at dozens of maps of Boston, but they were either hard to work with, missing important details, or too expensive to purchase. During this process, I came across MassGIS, the state of Massachusetts' geographic information repository.
The more I learned about Geographic Information Systems (GIS), the more I wanted to build my own maps. MassGIS had all the data I needed, so I just had to learn how to work with GIS layers.
This is where QGIS came in. QGIS is a free, open-source GIS tool with a large and helpful community. It is a powerful tool for making maps, and I highly recommend checking it out.
After a handful of YouTube tutorials and GIS Stack Exchange threads, I was ready to tackle the mapmaking process. I loaded a few layers from MassGIS and was instantly greeted by the beachball of doom.
The immense amount of lag I experienced when working with QGIS was related to two factors: the sheer amount of data I was working with, and the old hardware I was using. I started this project on a 2010 base-model MacBook Air which folded under the weight of the project. I managed to get the map together by loading layers individually and clipping them to reduce complexity. I also found that formatting the layers and hiding them before importing the next layer helped a lot.
Once I had the data layers formatted, I set up a Map Layout in QGIS and exported it as an SVG. A Layout is a separate canvas where you place, format, and fine-tune your map. In my maps, I included a border around the map, a scale bar, and a North arrow. These are not entirely necessary, but I found them helpful, and they added a bit of polish to the map.
From QGIS to Illustrator
After creating the map, I needed to prepare it for KiCad. When KiCad renders SVGs, it only renders filled shapes in a single color, meaning that layering and strokes cannot be used to style the map. Converting the QGIS map into a flat, one-layer graphic was surprisingly complex.
The first step was to regroup all of the layers. When exported from QGIS, the map was a single layer inside a giant clipping mask. I used the "Select → Select Same Appearance" tool to quickly merge related items into new groups. These were useful for locking features while working on different parts of the map.
With organized layers in place, the real work began. The process involved converting strokes to fills, cutting stacked layers using the Divide tool, and cleaning up the results. This was painfully tedious and prone to mistakes, so keeping backups of the map was a must. For detailed instructions, check out the guide on GitHub. Here is an example of the map after conversion:
Importing the map into KiCad
With the map ready, it was time to find out how KiCad felt about it.
In a new project, I opened up the PCB designer, imported the map, and waited. From working on the map in Illustrator, I knew that it might take a minute or two to load. After five minutes, I was concerned. After ten, I knew it was never going to load.
Following this, I did some research about graphics in KiCad and found that KiCad really doesn't like compound paths. Compound paths are shapes built from multiple overlapping subpaths, often used to 'punch holes' in complex shapes (for example, the letters A and B are both classic compound paths in typography).
At this point, several large features of the map had been collapsed into a single compound path, and KiCad wasn't happy about it. Luckily, one of my backups predated the collapse, and I was able to redo the final processing steps to avoid this issue.
With the improved map, I had one more trick to try. Instead of loading the entire map, I broke it down into feature groups. By importing a few features at a time, I could place the electronics on the station markers before importing the rest of the map. Additionally, since each group is only a fraction of the size of the full map, it was much less likely to crash KiCad.
This combination of reducing compound paths and loading the map in groups is what finally worked. Above you can see the station markers and map borders which I imported as the first group. After placing all of the electronics and their connections, importing the rest of the map was simple.
With the PCB finalized, I can say we are both finally done torturing each other. Having the board manufactured is simple using companies like JLCPCB. If you want to order your own CharlieBoard, follow the guide above or check out the Shop, there might be a few left!
This process is one of the many unexpected challenges in making CharlieBoard, but learning how to make maps, design in Illustrator, and work with KiCad has been a rewarding experience. If you are interested in making your own PCB art, I hope this post has been helpful!