KiCAD has pretty much been the exclusive EDA tool I use for home projects and have even used it professionally. It took a little bit to learn some of the nuances of KiCAD, but overall, it’s a great EDA tool. There have been a few articles about KiCAD vs Cadsoft’s Eagle CAD and I hope soon to write my own comparison and also reference these other articles:
Regardless, the topic of this posting is how to create irregular board outlines in KiCAD. This is sometimes needed when you are designing a PCB for an enclosure that may have a curved profile, or other unavoidable mechanical features for which one must design.
On with the tutorial… It’s easy enough, in KiCAD, to create straight lines, polygons, circles and 90 degree arcs, but what happens when you need a slightly curved indentation, or outdent (i.e. an arc greater than 0, but less than 90 degrees)? Maybe a parabolic profile or an ellipse? Well if such features are critical to your design, then strictly from within KiCAD, you will find this to be a show-stopper. However, if you’re anything like me, there is a voice in your head that tells you, “No….. There’s got to be a way around this…” And if you have enough persistence, you will probably find a way. And that I have with this particular endeavor.
Once you have created the outline drawing, save the file as a monochrome bitmap image.
Use a text editor (recommend notepad++) and open the .mod file you just created. Note: all of KiCAD’s files (schematic, PCB, CvPCB, Netlist, project) are text-based, which makes manual editing easier if the need arises as in this case.
Find and delete the lines that start with “Li”, “T0”, and “T1”. See this document for what these designations mean if you’re interested.
Find all lines that start with “DP” and change the last numeric value to “28”, which is the layer designation field. In KiCAD layer 28 is reserved as the Board Outline layer.
Save and close the file when finished with these manual edits.
Open KiCAD and start Pcbnew.
Go to “Preferences > Library” and add the library module file which has just been edited and click “OK”.
Go to “Place > Module” and browse for a footprint named “LOGO” and insert it into the layout. If your colors are set as the default, the board outline footprint you just placed should be yellow.
If there is any extra yellow around the board outline where it is not supposed to be as above, you’ll need to go back to step 3 and delete out the first entire section that starts with “DP”. The section consists of the line that starts with “DP” followed by usually several lines starting with “D1”. Then repeat the remaining steps again.
I hope this tutorial will help some individuals that are needing to create an irregular board outline using KiCAD. I wouldn’t consider myself an expert at KiCAD, but would be glad to answer questions via the blog reply, social media links or email if I can. Hopefully with future releases of KiCAD these types of mechanical integration will make their way into the great EDA package that it already is. Thanks for reading.