Skip to the content
2 layers24.6 × 8.1 mmDemomatrix, the printed circuit board in 3D

KiCAD EDA automatic component placement tool

Size
24.6 × 8.1 mm
Copper layers
2
Thickness
1.6 mm
Parts
1,592
Nets
3,312
Pads
8,700
Tracks, vias
43,376, 1,332
Pours
1
Routed
Yes
KiCad
KiCad 0.12.4 (file 20241229)
Created
11 Jan 2026
Updated
19 Jan 2026

Overview

Demomatrix is an open-source printed circuit board by glovepost, from the glovepost/atoplace repository on GitHub, published under the MIT licence. It is a 2-layer board of 24.6 × 8.1 mm with 1,592 parts on 3,312 nets, routed with 43,376 tracks and 1,332 vias.

Its parts include 788 diodes, 470 capacitors, 255 ICs, 70 resistors and 4 switches.

README

README.md

atoplace [blocked]


License Python Version Status KiCad Support KiCad 9 Live IPC

The AI Pair Designer for Professional PCB Layout

atoplace is an intelligent orchestration layer for PCB design that bridges the gap between schematic and physical layout. It automates the tedious 80% of design—placement optimization and DFM validation—while strictly adhering to "Manhattan" aesthetics and Signal Integrity (SI) best practices.

Designed to work seamlessly with atopile and KiCad.

atoplace placement visualization

🚀 Why atoplace?

PCB layout automation has historically been "black box" and "messy"—producing organic, unreadable layouts that professional engineers reject. atoplace takes a different approach:

  • Human-Grade Aesthetics: We don't just minimize wirelength. We enforce grids, alignment, and orthogonal routing so the result looks like you designed it.
  • Physics-First: We model high-degree nets (GND/VCC) correctly to prevent component collapse, and prioritize critical signals (USB, RF) before general routing.
  • Transparent & Interactive: No lock-in. The source of truth is always your .kicad_pcb file. You can take over manually at any second.

✨ Key Features

  • 🧩 Manhattan Legalizer: Transforms "organic" force-directed placements into professional, grid-snapped, and row-aligned layouts using PCA axis detection and Abacus-style overlap resolution.
  • 🧠 Intelligent Placement: Force-directed annealing engine with a Star Model for stable high-degree net (GND/VCC) handling and adaptive damping for oscillation control.
  • 🚀 A Routing*: High-performance, deterministic geometric router using a Greedy Multiplier ($w=2-3$) and Spatial Hash Indexing for O(~1) collision detection.
  • 🔍 Confidence Scoring: Automated assessment of your board's routability, signal integrity risks, and DFM compliance.
  • 💬 Natural Language Control: "Move the USB connector to the left edge", "Align these capacitors", "Keep the crystal near the MCU".
  • 🔌 Atopile Native: First-class support for atopile projects with ato-lock.yaml parsing, module-aware grouping, and atoplace.lock sidecar persistence to preserve placements across rebuilds.
  • 📊 Interactive Visualization: Unified SVG delta viewer with real-time playback, layer toggles, grid customization, force vector display, routing trace visualization, and A* debug mode for step-by-step algorithm analysis.

🛠️ Installation

bash
pip install atoplace

Requirements

  • Python 3.10+
  • KiCad 8.0+ (atoplace uses the pcbnew Python API)

Pro Tip: atoplace works best when run using the Python interpreter bundled with KiCad:

macOS:

bash
/Applications/KiCad/KiCad.app/Contents/Frameworks/Python.framework/Versions/Current/bin/python3 -m pip install atoplace

Windows:

powershell
"C:\Program Files\KiCad\8.0\bin\python.exe" -m pip install atoplace

⚡ Quick Start

1. Optimize Placement

Automatically place components with "Manhattan" legalization:

bash
atoplace place board.kicad_pcb --grid 0.5 --constraints "USB on left edge"

2. Route the Board

Route all nets using the internal A* geometric planner:

bash
atoplace route board.kicad_pcb --visualize

3. Validate Layout

Check your board against DFM rules (JLCPCB, OSH Park, etc.):

bash
atoplace validate board.kicad_pcb --dfm jlcpcb_standard

4. Interactive Mode

Refine your design using natural language:

bash
atoplace interactive board.kicad_pcb
# > "Rotate U1 45 degrees"
# > "Move C1 closer to U1"
# > "Save"

5. MCP Server (LLM Integration)

Expose atoplace tools to AI agents via the Model Context Protocol:

bash
atoplace mcp --launch

See MCP Server section below for details.

🗺️ Roadmap

  • Milestone A (Q1 2026): Solid Foundation ✅
    • Manhattan Legalizer (Grid snapping & PCA Alignment).
    • Physics Engine scaling (Star Model & Adaptive Damping).
    • Atopile ato-lock.yaml and module hierarchy integration.
  • Milestone B (Q1-Q2 2026): Routing & Persistence ✅
    • A Geometric Planner* (Greedy Multiplier & Spatial Indexing).
    • MCP Server with 40+ tools for LLM agent integration.
    • Live KiCad IPC via kipy for real-time component manipulation (KiCad 9+).
    • atoplace.lock Sidecar Persistence for atopile projects.
    • Unified Visualization (SVG delta viewer with routing support).
    • BGA/QFN Fanout Generator (dogbone & via-in-pad strategies).
    • Pin Swap Optimization (bipartite matching for crossing reduction).
  • Milestone C (Q2 2026): Professional Agent 🚧
    • Differential Pair Detection (auto-detect from net names).
    • Differential Pair Coupled Routing.
    • Deep Signal Integrity Analysis (Crosstalk/Impedance).
    • Automated Manufacturing Outputs (Gerbers/BOM/PNP).
    • Multi-board design support.

📂 Architecture

text
atoplace/
├── board/          # Board abstraction & KiCad/Atopile adapters
│   ├── abstraction.py      # Board, Component, Net, Pad data models
│   ├── kicad_adapter.py    # KiCad pcbnew integration
│   ├── lock_file.py        # atoplace.lock sidecar persistence
│   └── atopile_adapter.py  # Atopile project loader
├── placement/      # Force-directed physics & Manhattan Legalizer
│   ├── force_directed.py   # Physics Engine (Star Model, adaptive damping)
│   ├── legalizer.py        # Manhattan Pipeline with PCA alignment
│   ├── module_detector.py  # Functional module hierarchy analysis
│   ├── constraints.py      # Placement constraints (Proximity, Edge, Zone, etc.)
│   └── visualizer.py       # SVG delta visualization with frame capture
├── routing/        # A* Geometric Router
│   ├── astar_router.py     # Core A* with Greedy Multiplier (w=2-3)
│   ├── manager.py          # Multi-phase routing pipeline
│   ├── spatial_index.py    # O(~1) collision detection via spatial hashing
│   ├── obstacle_map.py     # Obstacle generation from board
│   ├── diff_pairs.py       # Differential pair detection
│   ├── visualizer.py       # Routing visualization with A* debug
│   └── fanout/             # BGA/QFN escape routing
├── visualization/  # Unified visualization system
│   └── assets/             # External JS/CSS for HTML viewer
│       ├── svg-delta-viewer.js  # Interactive SVG playback engine
│       └── styles.css      # KiCad-inspired dark theme

🤖 MCP Server

atoplace includes a Model Context Protocol (MCP) server that exposes 40+ PCB design tools to LLM agents like Claude. This enables conversational PCB layout design with support for placement, routing, fanout generation, and design validation.

Quick Start

Just run:

bash
python -m atoplace.mcp.launcher

That's it! The launcher:

  • Auto-detects KiCad Python on macOS, Linux, and Windows
  • Starts the KiCad bridge (for pcbnew access)
  • Starts the MCP server (exposes tools to LLM)
  • Manages lifecycle and clean shutdown

Claude Code / Claude Desktop Configuration

Add to your MCP config:

json
{
  "mcpServers": {
    "atoplace": {
      "command": "python",
      "args": ["-m", "atoplace.mcp.launcher"]
    }
  }
}

Note: Replace python with the path to your atoplace virtualenv Python if needed.

🔴 Live KiCad IPC Mode (KiCad 9+)

New! With KiCad 9+, atoplace can manipulate components in real-time without save/reload cycles. Changes appear instantly in your KiCad viewport!

Requirements:

  • KiCad 9.0 or later (with IPC API enabled)
  • kicad-python package: pip install kicad-python

Setup:

bash
# Install the kipy optional dependency
pip install atoplace[kipy]

# Or install directly
pip install kicad-python

Usage:

  1. Open your .kicad_pcb in KiCad 9+ PCB Editor
  2. Start the MCP server with the kipy backend:
    bash
    ATOPLACE_BACKEND=kipy python -m atoplace.mcp.launcher
  3. Components move instantly as you interact with the LLM!

How it works: The kipy backend connects directly to KiCad's IPC socket and uses the official API to update component positions in real-time. Native undo/redo (Cmd/Ctrl+Z) works seamlessly.

Architecture

mermaid
flowchart LR
    subgraph MCP["MCP Server (Python 3.10+)"]
        direction TB
        FastMCP[FastMCP]
        Tools[26 Layout Tools]
        Context[Context Generators]
    end

    subgraph KiPy["KiPy Backend (KiCad 9+)"]
        direction TB
        IPC[KiCad IPC API]
        LiveEdit[Real-time Updates]
        NativeUndo[Native Undo/Redo]
    end

    subgraph Bridge["KiCad Bridge (KiCad 8.x)"]
        direction TB
        pcbnew[pcbnew API]
        BoardIO[Board I/O]
        UndoRedo[Undo/Redo]
    end

    MCP <-->|"KiCad IPC\nSocket"| KiPy
    MCP <-->|"Unix Socket\nJSON-RPC"| Bridge

Backend Modes:

ModeKiCad VersionReal-timeHow it worksStatus
kipy9.0+✅ YesDirect IPC API connectionDefault
ipc8.0+❌ NoFile-based bridge processFallback
direct8.0+❌ NoDirect file manipulationFallback

Note: KIPY mode is the primary backend for bleeding-edge development. It provides instant visual feedback in KiCad's viewport and native undo/redo integration. The server automatically falls back to IPC or direct mode if KIPY is unavailable.

Available Tools (40+ total)

CategoryTools
Board Managementload_board, save_board, undo, redo
Placement Actionsmove_absolute, move_relative, rotate, place_next_to, align_components, distribute_evenly, stack_components, arrange_pattern, cluster_around, lock_components
Discoveryfind_components, get_board_summary, get_unplaced_components
Routingroute_board, route_net, detect_diff_pairs, get_routing_preview, analyze_pin_swaps, optimize_pin_swaps, export_pin_constraints
BGA/Fanoutdetect_bga_components, fanout_component, fanout_all_bgas, get_fanout_preview
Contextinspect_region, get_semantic_grid, get_module_map
Validationcheck_overlaps, validate_placement, run_drc, get_crossing_analysis
Optimizationoptimize_placement, detect_modules, parse_constraint, get_atopile_context

Environment Variables (Optional)

VariableDescriptionDefault
ATOPLACE_BACKENDBackend mode: kipy, ipc, or directkipy (with fallback)
ATOPLACE_USE_KIPYEnable kipy mode (1 or true)Deprecated - use ATOPLACE_BACKEND
KICAD_PYTHONOverride KiCad Python pathAuto-detected
ATOPLACE_LOGLog file location/tmp/atoplace.log

Default behavior: The server attempts KIPY first, then falls back to IPC, then direct mode. For bleeding-edge KiCad 9+ users, no configuration is needed - KIPY mode activates automatically when KiCad is running with IPC enabled.

Example LLM Conversation

text
User: Load the board at examples/dogtracker/layouts/default/default.kicad_pcb

Claude: [Calls load_board tool]
Board loaded successfully:
- 37 components
- 72 nets

User: Find all the capacitors and align them horizontally

Claude: [Calls find_components with query="C", filter_by="ref"]
Found 12 capacitors: C1, C2, C3...

[Calls align_components with refs=["C1","C2",...], axis="y"]
Aligned 12 capacitors along the Y axis.

User: Check if there are any overlaps

Claude: [Calls check_overlaps]
No overlapping components detected. The placement is valid.

User: Save the board

Claude: [Calls save_board]
Board saved to: examples/dogtracker/layouts/default/default.placed.kicad_pcb

🔒 Atopile Lock File Persistence

When working with atopile projects, placement positions can be lost when ato build regenerates the KiCad board. The atoplace.lock sidecar file solves this by persisting component positions between builds.

How it works

After placement, atoplace automatically saves positions to a lock file next to the board:

text
my-project/
├── elec/
│   └── layout/
│       └── default/
│           ├── default.kicad_pcb
│           └── default.atoplace.lock  ← Saved positions
└── ato.yaml

Lock File Format

yaml
version: 1
created: 2026-01-14T10:30:00
build: default
components:
  U1:
    x: 125.5
    y: 80.0
    rotation: 0.0
    locked: true    # User-approved position
    module: mcu
  C1:
    x: 130.0
    y: 85.5
    locked: false   # Auto-placed, can be re-optimized

CLI Options

FlagDescription
--use-lockApply saved positions before placement
--only-lockedOnly restore locked: true positions
--save-lock/--no-save-lockAuto-save after placement (default: on)
--lock-allMark all positions as user-approved

Workflow Example

bash
# First placement - automatically saves lock file
atoplace place my-project/ --use-ato-modules

# After `ato build` regenerates board - restore positions
atoplace place my-project/ --use-lock

# Only restore approved positions, re-optimize others
atoplace place my-project/ --use-lock --only-locked

# Approve all current positions
atoplace place my-project/ --lock-all

Merge Logic

The lock file uses Lock > Physics priority:

  1. locked: true positions always preserved (user-approved)
  2. locked: false positions used as initial hints, can be re-optimized
  3. New components (not in lock file) placed by physics engine

📄 License

MIT License - see LICENSE for details.

🙏 Acknowledgments

  • atopile: The declarative language that makes code-driven hardware possible.
  • KiCad: The open-source EDA standard we build upon.
  • kicad-python: Official Python bindings for KiCad's IPC API.
  • Freerouting: The open-source autorouting engine.

Parts

1,592
QtyValueFootprintReferences
784HONGLITRONIC_HL_5050RGBW_S1_A27:LED-SMD_8P-L5.0-W5.0-P1.20_HL-5050RGBW-S1-A27LED1, LED10, LED11, LED100, LED101, LED102, LED103, LED104, LED105, LED106, LED107, LED108, LED109, LED110, LED111, LED112 +768
39210µF ±10% 25V X5RSamsung_Electro_Mechanics_CL21A106KAYNNNE:C0805C1, C10, C11, C100, C101, C102, C103, C104, C105, C106, C107, C109, C110, C111, C112, C113 +376
196ATOPILE_PIXEL15:pixel15U10, U100, U102, U103, U104, U105, U107, U108, U109, U110, U112, U113, U114, U115, U117, U118 +180
69100nF ±10% 16V X7RSamsung_Electro_Mechanics_CL05B104KO5NNNC:C0402C18, C108, C117, C126, C135, C144, C153, C162, C171, C180, C189, C198, C207, C216, C225, C234 +53
49MBI_MBI5043GP_A:SSOP-24_L8.8-W4.0-P0.64-LS6.2-BLU1, U11, U16, U101, U106, U111, U116, U121, U126, U131, U136, U141, U146, U151, U156, U161 +33
49309Ω ±1% 62.5mWVO_SCR0402F309R:R0402R1, R2, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R20, R21, R22, R23 +33
91kΩ ±1% 62.5mWUNI_ROYAL_0402WGF1001TCE:R0402R50, R51, R52, R53, R54, R55, R56, R57, R63
710kΩ ±1% 62.5mWUNI_ROYAL_0402WGF1002TCE:R0402R58, R60, R61, R62, R64, R65, R68
5Diodes_Incorporated_74LVC1T45DW_7:SC-70-6_L2.2-W1.3-P0.65-LS2.1-BRU246, U249, U250, U254, U255
4ALPSALPINE_SKRPACE010:KEY-SMD_4P-L4.2-W3.2-P2.20-LS4.6SW1, SW2, SW3, SW4
41µF ±10% 25V X5RSamsung_Electro_Mechanics_CL05A105KA5NQNC:C0402C448, C449, C450, C465
32.2µF ±20% 6.3V X5RSamsung_Electro_Mechanics_CL05A225MQ5NSNC:C0402C451, C456, C463
2HCTL_PM254_2_04_W_8_5:HDR-TH_8P-P2.54-H-F-R2-C4-W8.5U247, U248
215pF ±5% 50V C0GFH_0402CG150J500NT:C0402C454, C455
227Ω ±1% 62.5mWYAGEO_RC0402FR_0727RL:R0402R66, R67
25.1kΩ ±1% 62.5mWUNI_ROYAL_0402WGF5101TCE:R0402R69, R70
1BHFUSE_BSMD0805_050_15V:F0805F1
1AMASS_XT30PW_M30_G_Y:CONN-TH_XT30PW-MCN1
1SHOU_HAN_TYPE_C_16PIN_2MD_073:USB-C-SMD_TYPE-C-6PIN-2MD-073USB1
1STMicroelectronics_USBLC6_2SC6:SOT-23-6_L2.9-W1.6-P0.95-LS2.8-BLD1
1Hubei_KENTO_Elec_Blue_light_0603:LED0603-RDLED786
1Hubei_KENTO_Elec_KT_0603R:LED0603-RDLED787
1Winbond_Elec_W25Q128JVSIQ:SOIC-8_L5.3-W5.3-P1.27-LS8.0-BLU253
1Raspberry_Pi_RP2040:LQFN-56_L7.0-W7.0-P0.4-EPU252
1Hubei_KENTO_Elec_KT_0603G:LED0603-RDLED785
1Yangxing_Tech_X322512MSB4SI:CRYSTAL-SMD_4P-L3.2-W2.5-BLX1
1atopile_Logo_8x8mm:atopile_Logo_8x8mmLOGO1
1STMicroelectronics_LDK220M_R:SOT-23-5_L3.0-W1.7-P0.95-LS2.8-BLU251
118kΩ ±1% 62.5mWYAGEO_RC0402FR_0718KL:R0402R59

More from glovepost/atoplace

12
  • 2 layersDemo matrix2, the printed circuit board in 3D

    Demo matrix2

    glovepost/atoplace

    KiCAD EDA automatic component placement tool

    496 parts2MIT
  • 4 layers59.3 × 39 mmBadge, the printed circuit board in 3D

    Badge

    glovepost/atoplace

    KiCAD EDA automatic component placement tool

    246 parts2MIT
  • 4 layersGrid100x100, the printed circuit board in 3D

    Grid100x100

    glovepost/atoplace

    KiCAD EDA automatic component placement tool

    200 parts2MIT
  • 4 layers45 × 167 mmNonos, the printed circuit board in 3D

    Nonos

    glovepost/atoplace

    KiCAD EDA automatic component placement tool

    141 parts2MIT
  • 4 layers108 × 115.9 mmHat, the printed circuit board in 3D

    Hat

    glovepost/atoplace

    KiCAD EDA automatic component placement tool

    83 parts2MIT
  • 2 layers42 × 27 mmLayouts, the printed circuit board in 3D

    Layouts

    glovepost/atoplace

    KiCAD EDA automatic component placement tool

    66 parts2MIT
  • 2 layersCluster2x2, the printed circuit board in 3D

    Cluster2x2

    glovepost/atoplace

    KiCAD EDA automatic component placement tool

    31 parts2MIT
  • 2 layersStrip10, the printed circuit board in 3D

    Strip10

    glovepost/atoplace

    KiCAD EDA automatic component placement tool

    20 parts2MIT
  • 2 layersUsage, the printed circuit board in 3D

    Usage

    glovepost/atoplace

    KiCAD EDA automatic component placement tool

    19 parts2MIT
  • 2 layers34.2 × 26.8 mmEsp32 minimal, the printed circuit board in 3D

    Esp32 minimal

    glovepost/atoplace

    KiCAD EDA automatic component placement tool

    19 parts2MIT
  • 2 layersRow2, the printed circuit board in 3D

    Row2

    glovepost/atoplace

    KiCAD EDA automatic component placement tool

    10 parts2MIT
  • 2 layersPixel15hl5050, the printed circuit board in 3D

    Pixel15hl5050

    glovepost/atoplace

    KiCAD EDA automatic component placement tool

    5 parts2MIT

Similar boards

  • 2 layers398.2 × 398.2 mmLargeWordClock LargeKickstarter, the printed circuit board in 3D

    LargeWordClock LargeKickstarter

    PCBench/PCBench

    resolution = [0.5, 0.5] pcbfolder = '../PCBs/' pcbnames = ["1Bitsy1bitsy"] iters = 30 env = PCBRoutingEnv(resolution=resolution, pcbfolder=pcbfolder, pcbnames=pcbnames) obs, info = env.reset() for in range(iters): act =…

    1,591 parts21MIT
  • 2 layers199.6 × 174.4 mmMQ Breakout, the printed circuit board in 3D

    MQ Breakout

    SolderedElectronics/CO-sensor-MQ7-breakout-with-easyC-hardware-design

    Hardware design, BOM, gerbers and 3D files for CO-sensor-MQ7-breakout-with-easyC designed by Soldered Electronics.

    1,570 parts1
  • 2 layers177.4 × 202.8 mmMQ Breakout, the printed circuit board in 3D

    MQ Breakout

    SolderedElectronics/Air-quality-sensor-MQ135-breakout-hardware-design

    Hardware design, BOM, gerbers and 3D files for Air-quality-sensor-MQ135-breakout designed by Soldered Electronics.

    1,564 parts7
  • 2 layers149.9 × 266.7 mmFetsAndCrosses, the printed circuit board in 3D

    FetsAndCrosses

    schilkp/Fets_and_Crosses

    An implementation of the classic Tic-Tac-Toe / Knots and Crosses game built with 2458 transistors.

    1,638 parts5MIT
  • 2 layers243.8 × 243.8 mmP5S533-TVM ISA R101G, the printed circuit board in 3D

    P5S533-TVM ISA R101G

    DartFrogTek/PCIe-PCI-ISA

    Potential PCIe-to-PCI-to-ISA pathway.

    1,541 parts21MIT
  • 2 layers93.2 × 99.1 mmPanelized, the printed circuit board in 3D

    Panelized

    unicab369/ESP-MESS

    I am building a Wireless Bridge System that can manage multiple devices using a variety of wireless technologies.

    1,643 parts
  • 2 layers44.8 × 51 mmBlank plank rev0b, the printed circuit board in 3D

    Blank plank rev0b

    DangerousPrototypes/BusPirate5-hardware

    Bus Pirate Hardware and accessories for v5 and higher

    1,657 parts125MIT

Questions

How big is the Demomatrix PCB?

It measures 24.6 × 8.1 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Demomatrix use?

1,592 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Demomatrix KiCad files?

From the glovepost/atoplace repository on GitHub, at the commit this page was made from: the board is examples/hyperion/elec/layout/demomatrix/demomatrix.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Demomatrix design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).