Fewer vias, net by net
polish_viasAfter route_board and prune_vias: rip one net at a time, most vias first, route it alone around everything else at a high via price, and keep the new copper only when KiCad counts fewer vias with no new open item or DRC error (a reroute that cuts a pour into islands first gets one via per island, bridge_islands). Run run_drc and get_score afterwards; a second pass sometimes finds more.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| nets | No | Net names; * and ? wildcards, e.g. ["USB_D*", "+3V3"]. | |
| pairs | No | Rip and reroute a differential pair (_H/_L, _P/_N, +/-) together (default true: a leg rerouted alone comes back at its own length; a step that degrades a pair is never kept). | |
| pours | No | Also polish the poured nets (default false): the pour and its stitch vias stay, the net is routed as a track tree on top, then its redundant stitch vias are pruned. A lottery: the tree that did this by accident (PCBGolf +3V3 53 -> 32) did not repeat in 2 deliberate tries. | |
| router | No | ||
| wait_s | No | Seconds to wait for the job (default 55). A job still running comes back with status "running": follow it with get_board_job. | |
| workers | No | prune workers for a poured net (default 4). | |
| max_nets | No | Nets to try, most vias first (default 40). | |
| min_vias | No | Only nets with at least this many vias (default 2). | |
| via_cost | No | Via price for the lone reroute (default 60). | |
| design_id | Yes | The design id returned by import_kicad_project or list_designs. | |
| ml_options | No | ||
| time_budget_s | No | Router budget per net (default 120). | |
| bridge_islands | No | ||
| total_budget_s | No | Stop starting nets after this (default 1800). |