pcb_layout_audit
Audit a PCB layout against exit gates for placement, connectivity, clearance DRC, corners, return vias, and plane islands, returning pass/fail counts and itemised findings with coordinates.
Instructions
Measure a board for the layout stages' exit gates. Changes nothing.
Reads the focused board exactly, the way pcb_autoroute does
(pcb.get_layout_model), or a saved LayoutBoard JSON, and runs the
in-house checks over it. Every check returns counts and itemised
findings with coordinates in mils:
placement_audit: overlapping bodies on one side, pads of different nets closer than the clearance rule, parts on keepouts or mounting holes, parts off the board.connectivity_summary: nets routed / partly routed / not started, and every unreached pad.drc: the exact clearance check.corner_audit: track junctions bending sharper than 45 degrees.return_via_audit: signal vias with no ground or plane via withinmax_distance_mils.plane_region_audit: pour and plane copper broken into islands.
Log the result as data on the stage_result
(design_session_log); design_next_action checks the numbers
against the stage's gate.
Args:
checks: names from the list above; None runs them all.
expect_file: full path of the focused board, for a live read.
The read refuses on the first reply if another board is
focused.
board_json_path: a saved LayoutBoard (.json or .json.gz) to audit
offline instead; nothing is read from the editor.
nets: the signal nets return_via_audit checks. None checks
differential-pair and high-speed-class nets, or every signal
via when the board names neither.
max_distance_mils: how near a return via must be (centre to
centre). Default 40.
limit: findings listed per kind; counts are never cut.
Returns:
{"board", "pass", "summary": {check: {pass, counts...}}, "checks": {check: full result}, "source": "live"|"file"}, or
{"error": ...}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nets | No | ||
| limit | No | ||
| checks | No | ||
| expect_file | No | ||
| board_json_path | No | ||
| max_distance_mils | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||