Skip to content

buganini/KiKit-UI

Repository files navigation

Interactive GUI for KiKit Panelization

Logo

This project is mainly built on top of KiKit, Shapely and PUI.

Tested with KiCad 7.0.10/8.0 and KiKit 1.6.0 (requires unreleased e19408a1ae5e979115fc572deb480a768e291e6b for arbitrary rotation)

Features

  • Interactive arrangement, what you see is what you get
  • Freeform arrangement, not limited to M×N configuration
  • Multiple different PCB panelization
  • Auto/Manual tab creation
  • Auto V-cut/mousebites selection
  • Enable hole creation in panel substrate for extruded parts
  • Does not require coding skill

Installation

Make sure your python can import pcbnew

> python3 -c "import pcbnew; print(pcbnew._pcbnew)"
<module '_pcbnew' from '/usr/lib/python3/dist-packages/_pcbnew.so'>

On macOS, I have to use the python interpreter bundled with KiCAD

PYTHON=/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/Current/bin/python3

Create a virtual environment and install dependencies

${PYTHON} -m venv --system-site-packages env
./env/bin/pip3 install -r requirements.txt

Run

./env/bin/python3 kikit-ui.py

Usage

# Just open it
./env/bin/python3 kikit-ui.py

# Start with PCB files
./env/bin/python3 kikit-ui.py a.kicad_pcb b.kicad_pcb...

# Load file
./env/bin/python3 kikit-ui.py a.kikit_pnl

# Headless export
./env/bin/python3 kikit-ui.py a.kikit_pnl out.kicad_pcb

First PCBA (Mousebites)

First PCBA

Global Aligment

Global Alignment

Per-PCB Aligment

Per-PCB Alignment

Substrate Hole

Substrate Hole

Tight Frame + Auto Tab + V-Cuts or Mousebites

UI

Output

Output

3D Output

3D Output

Tight Frame + Auto Tab + V-Cuts and Mousebites

UI

Loose Frame + Auto Tab + Mousebites

UI

3D Output

3D Output

Auto Tab

Tab position candidates are determined by the PCB edge and max_tab_spacing, prioritized by divided edge length (smaller first), and skipped if there is a nearby candidate (distance < max_tab_spacing/3) with higher priority.

In the image below with debug mode on, small red dots are tab position candidates, larger red circles are selected candidates, and the two rectangles represent the two half-bridge tabs. Auto Tab

Manual Tab

Manual Tab