route_plan
Automatically routes PCB tracks and vias offline using A* pathfinding. Specify net names and routing rules to generate a complete, validated board plan.
Instructions
Route the board offline (grid A*) and return placeable ops.
Pure Python -- no Altium round-trip unless fetch_geometry
is set. Output tracks are {x1, y1, x2, y2, width, layer, net_name} (the pcb_place_tracks item shape) and vias
are {x, y, net, size, hole_size} (the pcb_place_via
params), integer mils, so the result applies verbatim. Per-net
failure is honest data (status failed), not a tool error.
Live sequence: fetch geometry -> this tool ->
pcb_place_tracks / pcb_place_via -> pcb_run_drc ->
route_plan_repairs -> apply -> repeat.
Args:
geometry: Gen_GetPcbGeometry payload (bbox / outline /
pads / tracks / vias, all mils). Pads and copper of
nets NOT being routed stay in the obstacle map.
rules: Routing rules, all mils -- clearance_mils,
track_width_mils (int, or per-class dict with
"default"), via_size_mils, via_drill_mils,
layers (default TopLayer + BottomLayer). None
uses defaults.
nets: Route only these net names; everything else stays a
static obstacle. Unknown names are reported in
unknown_nets. None routes every netted pad
group.
net_classes: Net name -> class (power / ground /
differential / ...). Sets routing order and the
per-class track width. Unlisted nets are signal.
grid_pitch_mils: Routing grid pitch in mils (default 25).
bend_penalty: A* corner cost in grid-pitch units.
via_cost: A* layer-change cost in grid-pitch units.
max_expansions: Per-connection A* budget so a walled-in
net fails fast.
fetch_geometry: When True and geometry is None, pull
the live board over the bridge.
Returns:
{"ok": True, "summary": {nets_total, routed, failed, skipped, completion, track_count, via_count, total_length_mils}, "order": [...], "nets": {net: {status, class, width, tracks, vias, ...}}, "tracks": [...], "vias": [...], "validation": {...}}; with a
nets filter also requested_nets / unknown_nets.
{"ok": False, "reason": ...} on malformed input.
``geometry`` says which board state was planned against:
``source`` is ``live`` when this call read the board and
``caller`` when you supplied the dict, plus the ``bbox`` and
``counts`` from that payload. A ``caller`` plan is only as
current as the snapshot behind it, and this tool cannot date
it: after placing anything, re-read before re-planning or
the next plan routes through copper it cannot see.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nets | No | ||
| rules | No | ||
| geometry | No | ||
| via_cost | No | ||
| net_classes | No | ||
| bend_penalty | No | ||
| fetch_geometry | No | ||
| max_expansions | No | ||
| grid_pitch_mils | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||