$ show yaqwsx/KiKit
KiKit is a Python CLI tool, library, and KiCAD plugin for automating PCB panelization and fabrication output. It takes KiCAD board files (S-expression format) and produces panelized PCBs with v-cuts, mouse bites, tooling holes, fiducials, and frames. It also exports manufacturing files (Gerbers, drill, assembly data) tailored to popular fab houses (JLCPCB, PCBWay, OSH Park), generates 3D-printable solder paste stencils, performs DRC checks, and creates presentation pages for boards. The architecture is modular: core geometric operations use Shapely, interval algebra, and a custom S-expression parser; an extensible plugin system allows custom layout, tab, and cut strategies. The tool integrates deeply with KiCADβs pcbnew API and supports multiple KiCAD versions (6β9) through version-specific adapters. While primarily a production tool for hardware engineers, its clean separation of parsing, geometry, and CLI makes several components reusable in other PCB-adjacent projects.
The LLM identified 3 files worth highlighting for reuse:
A hand-written S-expression parser that preserves whitespace, comments, and formatting of KiCAD board files. Unlike generic parsers, it returns a parse tree that can be modified and serialized back without losing original layout. This is critical for round-tripping PCB files without corrupting user data. The standalone design makes it reusable for any S-expression based format (e.g., other EDA tools).
A generic library for 1D interval manipulation: union, intersection, difference, complement, and neighbor queries on sorted interval lists. It also implements an algorithm to find optimal separation lines between bounding boxes by analyzing interval gaps. The implementation is clean, testable, and independent of KiCAD, making it reusable for any problem involving interval arithmetic or layout optimization.
A sophisticated geometry engine built on Shapely that reconstructs PCB outlines from KiCAD edge cuts, creates tabs with fillets and chamfers, computes partition lines between boards, and serializes outlines back to KiCAD format. It handles edge cases like small features, arc reconstruction, and debug visualization. While tightly coupled to KiCADβs polygon representation, the core tab creation and fillet algorithms are reusable for any polygonal board panelization task.