Skip to the content
PCBKitNew board
2 layers42.5 × 25 mmBad origin, the printed circuit board in 3D

a tiny little CLI that helps you make all the files needed to manufacture PCBs at home

Size
42.5 × 25 mm
Copper layers
2
Thickness
1.6 mm
Parts
19
Nets
20
Pads
130
Tracks, vias
189, 0
Pours
1
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
20 Jun 2026
Updated
5 Jul 2026

Overview

Bad origin is an open-source printed circuit board by brunostjohn, from the brunostjohn/flatmaxxing repository on GitHub, published under the WTFPL licence. It is a 2-layer board of 42.5 × 25 mm with 19 parts on 20 nets, routed with 189 tracks and 0 vias.

It is built around the ATMEGA32U4-AU and ATMEGA32U4-MU. Its parts include 6 capacitors, 2 resistors and 2 ICs. It belongs with the AVR (ATmega, ATtiny) boards of this library.

Main components

2

README

README.md

flatmaxx

Turn a KiCad PCB into a complete CNC, laser, and electroplating job set with one command.

Runtime: Bun Effect v4 TypeScript Native: Rust Platform: macOS Build: single binary

flatmaxx takes a finished KiCad board and drives your entire home-fab bench for you: it generates Gerbers and drill files, plans isolation milling and non-copper-clearing G-code with FlatCAM, sorts every hole into the bit you actually own, prints solder-mask negatives and cuts solder-paste stencils on the xTool machines, drills plated/non-plated holes and cuts the board outline on a Makera CNC, and even works out the electroplating bath recipe. All of it runs from a single command behind a live terminal UI.

[!NOTE] This tool is built around one specific bench: a Makera Carvera (Air) CNC, xTool M1 Ultra / F1 Ultra lasers, and a DIY copper electroplating setup. It's shared as-is. Nothing stops you using it, but you'll want to retune the config to your own hardware, tools, and chemistry before trusting the output to a machine.

Contents

⚠️ No support: use entirely at your own risk

[!CAUTION] This project is provided strictly AS IS, with NO SUPPORT of any kind.

  • No tech support. Issues opened to ask for help, setup assistance, or troubleshooting will not be answered and may be closed without comment.
  • No bug guarantees. Even legitimate bug reports may never get a response or a fix. Don't assume one is coming.
  • No warranty. Nothing here is promised to work, to keep working, or to be safe for your hardware, your materials, or you. You run it at your own risk.

This is a hobby project I share for free in my spare time. I have a full-time job and a life, and I'm not interested in spending my free time doing unpaid tech support; I don't want my hobby to become my job. If that's a problem for you, don't use this.

Pull requests with fixes are welcome, but I make no commitment to review, respond to, or merge them.

Installation

flatmaxx ships as a single, codesigned macOS arm64 (Apple Silicon) binary. Pick whichever install path you prefer.

Homebrew

sh
brew tap brunostjohn/flatmaxxing https://github.com/brunostjohn/flatmaxxing
brew trust flatmaxx
brew install flatmaxx

Upgrade later with brew upgrade flatmaxx.

Install script

Downloads the latest release into ~/.local/bin, checksum-verified, using only standard macOS tools:

sh
curl -fsSL https://raw.githubusercontent.com/brunostjohn/flatmaxxing/main/scripts/install.sh | sh

If ~/.local/bin isn't on your PATH, the script prints the exact line to add. Pin a version with FLATMAXX_VERSION=1.2.3, or change the target with FLATMAXX_INSTALL_DIR=.... Installed this way, flatmaxx update upgrades in place (see Updating).

From source

flatmaxx builds with Bun, the only thing you need.

sh
git clone https://github.com/brunostjohn/flatmaxxing flatmaxx
cd flatmaxx
bun install
bun run build:native   # compile the native macOS accessibility module

Run it straight from source:

sh
bun src/index.ts <kicad-project>

Or build the standalone, codesigned binary at dist/flatmaxx:

sh
bun run build
./dist/flatmaxx <kicad-project>

Updating

If you installed via the script (or any binary in a writable location), upgrade in place:

sh
flatmaxx update           # check for and install the latest release, with a progress bar
flatmaxx update --check   # only report whether a newer release exists

Homebrew installs are managed by brew; run brew upgrade flatmaxx instead.

Features

  • One command, full pipeline: flatmaxx <project> runs every stage from board validation to machine-ready files.
  • Isolation + non-copper clearing: FlatCAM-driven V-bit isolation routing and pocket clearing, exported as Carvera G-code per side.
  • Drill categorization: parses the Excellon output, matches every hole to a bit you actually own, and warns on holes too small to machine.
  • Solder mask & paste stencil: automates xTool Studio over the Chrome DevTools Protocol to import geometry and set power, speed, and passes per device.
  • Drilling & edge cut: automates MakeraCAM via macOS Accessibility to drill plated/non-plated holes and cut the board outline with retaining tabs.
  • Electroplating report: computes bath dimensions, current density, timing, and chemistry from your board bounds and recipe.
  • Design rule checks: isolation feasibility (DRC) and drill machinability gates that can warn or hard-fail before any machine moves.
  • Inline board preview: renders the board image right in your terminal (kitty / iTerm2 / sixel).
  • Composable TOML config: project + user config with extends inheritance, deep merge, and per-run CLI overrides.

How it works

flatmaxx runs an ordered pipeline. Each stage feeds the next; you can disable the ones you don't need from config. If you don't have a Mac, or you want to know what each machine actually does to the board, HOW_THIS_WORKS.md walks the whole physical process with real parameters so you can replicate it with your own tools.

#StageConsumesProducesDriven via
1Preflightconfigsoftware & permission checkdoctor checks
2Validate board.kicad_pcbmanufacturability reportkicadts
3KiCad outputs.kicad_pcbGerbers, drills, SVG, PNG + inline previewkicad-cli
4Categorize drillsExcellonper-bit drill filesExcellon parser
5Isolation DRCGerbersclearance violationsFlatCAM (headless)
6CNC jobsGerbersisolation + NCC G-code (Carvera)FlatCAM (headless)
7Alignment drills.kicad_pcbregistration holesExcellon
8Edge-cut DXFs.kicad_pcb*-PTH_EdgeCuts.dxf, *-Final_EdgeCuts.dxfDXF generator
9Electroplating reportboard bounds + recipebath dimensions & timing—
10xTool projectsmask SVG + stencil DXFsolder mask + paste stencil jobsxTool Studio (CDP)
11Plated holesPTH DXF + drillsdrilling + plating outline G-codeMakeraCAM (AX)
12Final cutFinal DXF + drillsnon-plated drilling + edge contourMakeraCAM (AX)

Prerequisites

[!IMPORTANT] macOS only. The laser and CNC stages rely on native macOS Accessibility automation and AppleScript, so flatmaxx does not run on Linux or Windows.

External software (only the stages you enable need their tools):

ToolNeeded forDefault location
KiCad (with kicad-cli)always (board parsing & exports)/Applications/KiCad/KiCad.app/Contents/MacOS/kicad-cli
FlatCAMisolation DRC + CNC G-codeflatcam (on PATH)
xTool Studiosolder mask + paste stencil/Applications/xTool Studio.app
MakeraCAMdrilling + edge cut/Applications/MakeraCAM.app

The xTool and MakeraCAM stages also require macOS Accessibility permission (System Settings → Privacy & Security → Accessibility) and a Chrome DevTools port open for xTool Studio (127.0.0.1:9333 by default).

[!TIP] Run flatmaxx doctor <project> before your first real build. It checks every required executable, app, and permission for your enabled stages and tells you exactly what's missing, without touching a machine.

Usage

Initialize a config in your KiCad project, then build:

sh
flatmaxx init                 # create flatmaxxing.toml for the current project
flatmaxx ~/projects/myboard   # run the full pipeline

Commands

CommandWhat it does
flatmaxx <project>Creates CNC files from a KiCad project (same as build).
flatmaxx build <project>Explicit form of the root command.
flatmaxx initCreates a flatmaxxing.toml config for the current project.
flatmaxx configOpens an interactive editor for project config overrides.
flatmaxx config --userEdits the shared ~/flatmaxxing.user.toml.
flatmaxx skills install [--global]Installs the flatmaxxing agent skill into the project (or for the current user with --global).
flatmaxx doctor <project>Checks required software and permissions; generates nothing.
flatmaxx validate <project> --fixRuns validation only, without launching FlatCAM, xTool Studio, or MakeraCAM.
flatmaxx clean <project> [--dry-run]Removes (or lists) generated output folders.
flatmaxx update [--check]Updates flatmaxx in place to the latest GitHub release (script / binary installs; use brew upgrade for Homebrew).

Examples

sh
# Use an explicit config file
flatmaxx build . --config flatmaxxing.toml

# Override any config value for a single run
flatmaxx build . --set cnc.isolation.feedRate=150

# Point at a custom kicad-cli executable
flatmaxx ~/projects/myboard -k /opt/kicad/kicad-cli

# Check the board and config without launching any apps
flatmaxx validate . --fix

# See what clean would delete, without deleting it
flatmaxx clean . --dry-run

Configuration

flatmaxx reads a flatmaxxing.toml in the project, layered over a shared ~/flatmaxxing.user.toml. Configs can pull in others via extends, are deep-merged (later wins), and any value can be overridden per run with --set path=value / --unset path.

Rather than hand-writing the whole file, run flatmaxx init to scaffold one, then flatmaxx config for an interactive editor. Every option, with its default value and allowed values, is documented in flatmaxxing.example.toml. A representative slice covering your real tooling and isolation parameters:

toml
extends = ["~/flatmaxxing.user.toml"]

[board]
file = "myboard.kicad_pcb"   # auto-detected if omitted

[cnc]
availableDrills = [
  { diameter = 0.4 }, { diameter = 0.5 }, { diameter = 0.7 },
  { diameter = 0.8 }, { diameter = 1.0 }, { diameter = 1.2 },
]
availableMills = [
  { diameter = 0.7 }, { diameter = 1.0 }, { diameter = 1.5 },
]

[cnc.isolation]
feedRate = 120
spindleSpeed = 15000
zCutDepth = 0.05
tool = { type = "vbit", diameter = 0.14, angle = 60 }
passes = 3
overlap = 60
Top-level config sections

dependencies (tool paths) · paths (output folders) · board · alignmentDrills · electroplating (container + recipe) · solderMask · stencil · drills · place · cnc (isolation, nonCopperClearing, clearance, backside, drilling, availableDrills, availableMills) · xtool · makeracam · validation (ranges + feasibility gates).

Output layout

A full run writes machine-ready files into your project (folders are configurable under [paths]):

text
myboard/
├── gerbers/    # KiCad Gerber + edge-cut DXF exports
├── drills/     # categorized Excellon drill files (one per bit)
├── gcodes/     # isolation + non-copper-clearing G-code (Carvera)
├── dxf/        # board outline DXFs
├── png/        # rendered board & mask images
├── svg/        # vector solder-mask art
├── xtool/      # xTool Studio projects (solder mask + stencil)
└── cnc/        # MakeraCAM projects + exported drilling/contour G-code

The electroplating bath report (dimensions, current density, timing, chemistry) is generated alongside.

Terminal experience

flatmaxx runs on an Ink UI: a live, hierarchical task list shows every stage and substep with spinners, progress bars, and inline error detail. When your terminal supports it (kitty, iTerm2, or sixel), the rendered board image is drawn directly in the scrollback so you can eyeball the layout before any machine moves.

Development

sh
bun run dev         # build native + run against the bundled testdir/ project
bun test            # run the test suite
bun run typecheck   # type-check with tsgo
bun run format      # format with Biome

The codebase is built on Effect v4 and follows the conventions in CLAUDE.md; the native macOS accessibility bindings live in the Rust workspace under native/.

Parts

19
QtyValueFootprintReferences
40.1uFCapacitor_SMD:C_0805_2012MetricC3, C4, C5, C6
3FiducialFiducial:Fiducial_1mm_Mask2mmFID1, FID2, FID3
210kResistor_SMD:R_0805_2012MetricR1, R3
21uFCapacitor_SMD:C_0805_2012MetricC1, C2
13V3TestPoint:TestPoint_Pad_3.0x3.0mmTP2
1ATmega32U4-APackage_QFP:TQFP-44_10x10mm_P0.8mmU1
1ATmega32U4-MPackage_DFN_QFN:QFN-44-1EP_7x7mm_P0.5mm_EP5.2x5.2mmU2
1GNDTestPoint:TestPoint_Pad_3.0x3.0mmTP3
1MISOTestPoint:TestPoint_Pad_3.0x3.0mmTP4
1MOSITestPoint:TestPoint_Pad_3.0x3.0mmTP5
1RESETTestPoint:TestPoint_Pad_3.0x3.0mmTP1
1SCKTestPoint:TestPoint_Pad_3.0x3.0mmTP6

Questions

How big is the Bad origin PCB?

It measures 42.5 × 25 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Bad origin use?

19 parts, built around the ATMEGA32U4-AU and ATMEGA32U4-MU. 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 Bad origin KiCad files?

From the brunostjohn/flatmaxxing repository on GitHub, at the commit this page was made from: the board is testdir/bad_origin.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Bad origin design in my own project?

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

More from brunostjohn/flatmaxxing

1
  • 2 layers41.6 × 43.6 mmNew and improved zefir btn, the printed circuit board in 3D

    New and improved zefir btn

    brunostjohn/flatmaxxing

    a tiny little CLI that helps you make all the files needed to manufacture PCBs at home

    56 parts2WTFPL

Similar boards

  • 4 layers17.8 × 33 mmKeyboard, the printed circuit board in 3D

    Keyboard

    MelindaBirkenstock/melmicro

    This is a drop-in pro micro replacement for any board that accepts a pro micro. The name is a misonmer as the "melmicro" is actually usb-c. # MelMicro supports both qfn and qfp mcus, i'm not liable for anything.

    20 parts7MIT
  • 2 layers247.6 × 108.3 mmGrouch, the printed circuit board in 3D

    Grouch

    masonzack/Terminal

    111 parts2GPL-3.0
  • 2 layers242.4 × 75.7 mmM3n3van, the printed circuit board in 3D

    M3n3van

    matthewdias/m3n3van

    A minivan case compatible PCB with 2x3u split space

    123 parts20MIT
  • 2 layers234.9 × 77.8 mmAlasofia semi semi, the printed circuit board in 3D

    Alasofia semi semi

    oomlout/oomlout_oomp_project_bot_v_2

    118 parts
  • 2 layers87.8 × 59.8 mmFreeDeck SMD 2020-02, the printed circuit board in 3D

    FreeDeck SMD 2020-02

    FreeYourStream/freedeck-hardware

    all the stuff you need to build your own FreeDeck

    37 parts772
  • 2 layers54 × 15 mmXyp gpib, the printed circuit board in 3D

    Xyp gpib

    xyphro/UsbGpib

    Versatile, cheap and portable USB to GPIB converter (USBTMC class based)

    25 parts690MIT
  • 4 layers40.6 × 17.8 mmPD Micro, the printed circuit board in 3D

    PD Micro

    ryan-ma/PD_Micro

    USB-C PD3.0 PPS on ATMega32U4 Arduino board

    61 parts439MIT
  • 2 layers37.3 × 14.7 mmFairberryMainboard, the printed circuit board in 3D

    FairberryMainboard

    Dakkaron/Fairberry

    The goal of this project is to add a BlackBerry Q10 keyboard to non-BlackBerry phones. While this can easily be adapted to suit any other phone with an USB port at the bottom, I will focus on releasing files for the…

    15 parts365