What problem does it solve?
Manually creating PCB layouts, configuring stackups, and defining design rules is a meticulous and time-consuming process. This Skill automates the generation of a complete PCB layout file using KiCad's Python pcbnew API, configuring stackup, design rules, initial component placement, and pre-routing based on a design specification, saving significant design time and ensuring consistency.
Core Features & Use Cases
- Automated Board Setup: Configures board dimensions, layer count, and stackup based on manufacturer presets (e.g., JLCPCB 4-layer).
- Dynamic Design Rules: Defines net classes, trace widths, via sizes, and differential pair settings programmatically.
- Heuristic Placement & Pre-routing: Performs initial component placement and pre-routes critical nets (power, clocks) to optimize for downstream routing.
- Use Case: Rapidly generate initial PCB layouts for new designs, ensure consistent design rules across multiple projects, or automate the setup phase for complex board designs.
Quick Start
Example: Setting up a KiCad board with JLC 4-layer stackup
import pcbnew
def setup_board():
board = pcbnew.BOARD();
board.SetBoardThickness(pcbnew.FromMM(1.6));
board.SetCopperLayerCount(4);
# ... call setup_jlc_4layer_stackup(board, preset) ...
drc = board.GetDesignSettings();
drc.SetMinClearance(pcbnew.FromMM(0.15));
return board