---
title: "Turn a SPICE netlist into a fab-ready 2-layer PCB: assigns real footprints (0805, TO-92, DO-35, DIP-8, headers, LED, radial-cap), auto-places components (connectivity-aware; or use your own placement), routes a 2-layer maze router with vias, and VERIFIES the result with DRC (clearance/crossing checks) and ERC (union-find copper connectivity proven against the netlist). Returns the board, routing stats + honest unrouted-net list, DRC violations, ERC net status, a 'manufacturable' flag (true only when DRC+ERC clean and everything routed), SVG layers (top/bottom copper, silkscreen, drill, assembly), and optional Gerber RS-274X + Excellon drill files. Same netlist you simulate with spice_simulate — design, verify, and lay out an entire board through the tool layer. Supply a 'placement' array for production-quality boards; the auto-router is a first-pass best-of-N-seeds."
method: POST
path: "/api/pcb_layout"
tags: ["pcb"]
---

# Turn a SPICE netlist into a fab-ready 2-layer PCB: assigns real footprints (0805, TO-92, DO-35, DIP-8, headers, LED, radial-cap), auto-places components (connectivity-aware; or use your own placement), routes a 2-layer maze router with vias, and VERIFIES the result with DRC (clearance/crossing checks) and ERC (union-find copper connectivity proven against the netlist). Returns the board, routing stats + honest unrouted-net list, DRC violations, ERC net status, a 'manufacturable' flag (true only when DRC+ERC clean and everything routed), SVG layers (top/bottom copper, silkscreen, drill, assembly), and optional Gerber RS-274X + Excellon drill files. Same netlist you simulate with spice_simulate — design, verify, and lay out an entire board through the tool layer. Supply a 'placement' array for production-quality boards; the auto-router is a first-pass best-of-N-seeds.

`POST /api/pcb_layout`

## Request

- Base URL: `https://calc.engineer`
- URL: `https://calc.engineer/api/pcb_layout`
- Auth: none declared

## Request body

- object
  - `netlist` string, required: SPICE netlist (same format as spice_simulate). Components + nets are extracted; .model/.tran/etc. ignored.
  - `placement` object[]: Optional manual placement; omit for connectivity-aware auto-placement (best of N seeds).
    - `ref` string, required: Component reference (e.g. 'Q1')
    - `x` number, required: X position of component center in mm
    - `y` number, required: Y position in mm
    - `rot` number: Rotation in degrees (0/90/180/270)
  - `board` object: Optional board size in mm; auto-sized if omitted
    - `w` number, required
    - `h` number, required
  - `clearance_mm` number: Minimum copper clearance in mm
  - `trace_width_mm` number: Routing trace width in mm
  - `gnd_pour` boolean: Treat GND as a bottom-layer pour (unions all GND pads for ERC)
  - `gerber` boolean: Also return Gerber RS-274X + Excellon drill files

## Response `200`

Computed result for pcb_layout

- object
  - `result` object, required
    - `board` unknown, required
    - `components` unknown, required
    - `nets` unknown, required
    - `routing` unknown, required
    - `drc` unknown, required
    - `erc` unknown, required
    - `manufacturable` boolean, required
    - `layers_svg` unknown, required
    - `gerber` unknown
    - `warnings` string[], required
  - `tool` string, required
  - `version` string, required
  - `computed_at` string, date-time, required
  - `chain` object, required
    - `feeds` unknown[]
      - unknown
    - `accepts_from` unknown[]
      - unknown

## Other responses

- `400`: Validation error or invalid JSON
- `404`: Tool not found

---

[API](https://skmtc.dev/calc/apis/calc-engineer-api.md) · [All operations](https://skmtc.dev/calc/apis/calc-engineer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/calc/apis/calc-engineer-api/revisions/8830480ec488?raw)
