Skip to main content

PCB review built exclusively for AI agents: a .kicad_pcb in, exact connectivity/clearance/current findings out.

Project description

pcbsight

PCB review built exclusively for AI agents. A .kicad_pcb in; exact connectivity, clearance, current and pair findings out, with coordinates.

A layout is judged by eyeballing the copper. But an open net is a union-find question over copper that actually touches, a clearance is a segment-to-segment distance minus the widths, current capacity is IPC-2221 arithmetic at the net's narrowest point, and differential-pair skew is a subtraction. None of it needs eyes.

pip install "git+https://github.com/VortexJer/AISight#subdirectory=pcbsight"

pcbsight inspect board.kicad_pcb --clearance 0.15
# -> [FAIL] net 'GND' is 2 separate island(s) - unconnected pad(s): J1.2
# -> [FAIL] track-track: '+5V' to 'SIG' at 0.08 mm (required 0.15)
#           where: F.Cu near (28.75, 16.37)
# -> current: '+5V' min width 0.2 mm -> 0.746 A at dT=10 C (external)
# -> pair: USB_P / USB_N - skew 3.0 mm (~19.8 ps on FR4)
# -> out/board.png   (copper as drawn, findings circled in red)

pcbsight impedance 0.3 0.2      # ~51 ohm microstrip (IPC-2141 estimate)

Exit codes: 0 ok, 1 bad input, 2 a FAIL-level finding. Deterministic.

What it measures

connectivity union-find over copper that geometrically touches (tracks by width, vias across layers, pads by extent): islands per net, the unconnected pads named
clearance exact segment distances minus copper widths, per layer, different nets only; FAIL below 50 % of the rule (etch-short territory), warn above
current IPC-2221 external/internal curve at the net's narrowest track, with copper weight and dT stated
diff pairs found by net name (_P/_N, +/-, deduped); width match and length skew in mm and ~ps
impedance IPC-2141 microstrip estimate, labelled an estimate

Footprint pads are composed through the footprint's placement — rotation included, because a pad's (at ...) is local and skipping the rotation silently misplaces every pad of every rotated footprint (test_rotated_footprint_pads_are_composed).

Proof it works: known ground truth

examples/01-board is a small 2-layer board generated twice: clean, and with four defects injected at exact magnitudes.

injected measured
GND bottom trace stops 18.5 mm short of J1 [FAIL] net 'GND' is 2 separate island(s) ... unconnected pad(s): J1.2
SIG routed 0.08 mm from +5V clearance 0.08 mm (exact), coordinates given
+5V necked to 0.2 mm min width 0.2 mm -> 0.746 A (the 1.0 mm run: 2.39 A, on the published IPC curve)
USB pair: one side +3 mm detour, width 0.25 vs 0.3 skew 3.0 mm (~19.8 ps), width_matched: false

The clean board reports OK, exit 0, zero findings — asserted in the tests, both directions.

the broken board: the neck in the top trace, the blue GND run stopping short, the 0.08 mm findings circled

The complex example: a 4-motor rover controller

examples/02-rover is the full thing — MCU, IMU, four motor connectors, battery, USB-C, LED, decoupling: 14 nets, 13 components, built blind (netlist only, no sight of the copper) against the same board taken to zero findings by a real 2-layer maze router.

routed blind (12 of 14 nets open, 26 clearance violations, findings circled) vs the clean 2-layer route — same components, same nets

pcbsight diff rover_blind.kicad_pcb rover_clean.kicad_pcb
  tracks: 12 -> 113   vias: 0 -> 27
  net 'GND': 6 island(s) -> 1 ... every motor pair reached
  clearance findings: 26 -> 0

The intro example: before / after in miniature

The repair of the broken board, told entirely by diff — no re-inspection choreography, one command against both files:

pcbsight diff board_broken.kicad_pcb board_clean.kicad_pcb
  net 'GND': 2 island(s) -> 1
  clearance findings: 2 -> 0
  current '+5V': 0.745 A -> 2.392 A (min width 0.2 -> 1.0 mm)
  pair USB_P / USB_N: skew 3.0 -> 0.0 mm
  GONE [net-open]        net 'GND' is 2 separate island(s) ... unconnected pad(s): J1.2
  GONE [clearance]       track-track: '+5V' to 'SIG' at 0.08 mm (required 0.2)
  GONE [diff-pair-skew]  pair USB_P / USB_N is skewed 3.0 mm (~19.8 ps on FR4)
  GONE [diff-pair-width] pair USB_P / USB_N mixes widths [0.25, 0.3] mm

before: the GND run (blue) stops short, the neck in the +5V trace, the 0.08 mm findings circled · after: routed, clean, matched

Two of its own defects the example caught

  1. The first "clean" board routed +5V straight through the GND and SIG pads — pcbsight flagged its own reference at 0.0 mm clearance. The example was wrong; the check was not. It stays in the generator as a comment.
  2. USB_P/USB_N matched two suffix rules (_P/_N and P/N) and was reported twice. Pairs are now deduped by the net pair, and the test asserts exactly one.

Honest limitations

  • Zones/pours are not read: a net routed only through a copper pour will read as open here. Where pours carry nets, confirm in KiCad's own DRC — this tool complements it, it does not replace it.
  • Current numbers assume a lone trace in still air (that is what IPC-2221 tabulates); planes and vias change the real number.
  • The impedance estimate is IPC-2141 (~10 %); controlled impedance needs the fab's field-solved stackup.
  • Arcs, curved traces, keepouts and mask/paste layers are not parsed.

Siblings, same philosophy: solidsight (geometry — export the board outline there to check the enclosure fit), animationsight, texturesight, shadersight.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pcbsight-0.5.1.tar.gz (29.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pcbsight-0.5.1-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file pcbsight-0.5.1.tar.gz.

File metadata

  • Download URL: pcbsight-0.5.1.tar.gz
  • Upload date:
  • Size: 29.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pcbsight-0.5.1.tar.gz
Algorithm Hash digest
SHA256 6d3cf4ee44b38ee60df9ec7320aa6a148aeed26f78abb7ef9ced36507dc2fc47
MD5 55b2b4cab94339c0c476ae2c498d9fef
BLAKE2b-256 0c39272cde68c63d5a9c7fb213627cdf1adcbb49c5bc5559fc31e3e286f22e2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pcbsight-0.5.1.tar.gz:

Publisher: release.yml on VortexJer/AISight

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pcbsight-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: pcbsight-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pcbsight-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8c592e46fec79743e1e8349c21cb42fc3fff6dbf7d0a4e6867862136f568a61a
MD5 9aedd41fda089834049ff502353f8f99
BLAKE2b-256 68244572e8ec9046c6c1e9a9745d7503f44f4398b2fb90e2f2e8876c19ee0dfe

See more details on using hashes here.

Provenance

The following attestation bundles were made for pcbsight-0.5.1-py3-none-any.whl:

Publisher: release.yml on VortexJer/AISight

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page