← Commit history
CHANGELOG.md+7
@@ -2,6 +2,13 @@  ## 0.2.80 (unreleased) +- **`altium_plan_route`: a path for one net between two pads, from the standard's shared planner** (#21, standard 0.9.0,+  adom-eda-checks 0.6.0, vendored as published). An A* search on a grid, over the copper layers you allow (any number,+  inner layers too), with vias between them; every step keeps the board's clearance rule from other nets' copper, pads+  measured by their real outline. It answers `routeNet`, altium_route_net's own arguments, and `apply:true` routes it+  here, guarded by the revision it was planned on. Pours are not obstacles: repour after. 252 verbs; Altium now covers+  233 of the standard's 236.+ - **`generate_body` is the standard's engine writer now** (#20, standard 0.8.1, adom-eda-checks 0.5.1, vendored as   published): this bridge's body3d moved into the engine, so Altium, KiCad and Fusion make the same body. The bridge   writes the STEP file. The reply adds `bodies` (the body's box in the bodies companion's form), `writtenFrom` and
README.md+5−4
@@ -15,7 +15,7 @@ normal session. Ask in plain words and it: - makes the outputs: Gerbers, NC drill, pick and place, BOMs grouped by MPN (JLCPCB, Mouser, DigiKey files),   schematic PDF and STEP, checking that the outline and every copper layer reached the Gerbers -251 commands, tested on Altium Designer 26.11 and Altium Designer Develop. It runs in **Hydrogen**, Adom's free+252 commands, tested on Altium Designer 26.11 and Altium Designer Develop. It runs in **Hydrogen**, Adom's free desktop app, through Adom Bridge. You bring your own AI subscription and your own Altium licence.  ::youtube{id="dFecpcIzdSE" title="An AI designs a 12 V to 5 V buck converter in Altium Designer"}@@ -29,7 +29,7 @@ and the verb prefix `altium_`.  ## What it can do -Tested on Altium Designer 26.11.1 and Altium Designer Develop. 251 verbs; each row names the ones+Tested on Altium Designer 26.11.1 and Altium Designer Develop. 252 verbs; each row names the ones behind it (prefix `altium_`).  | Area | What the AI can do | Verbs |@@ -70,7 +70,7 @@ This bridge is the reference for the [EDA Bridge Standard](https://wiki.adom.inc  Altium Designer is the user's own **host app**. The bridge finds an installed Altium (`%ProgramFiles%\Altium\AD*\X2.EXE`, Designer or Develop), starts it in the background, runs a small-**DelphiScript agent** inside it, and gives the AI 251 `altium_*` verbs.+**DelphiScript agent** inside it, and gives the AI 252 `altium_*` verbs.  - **Page and docs:** https://wiki.adom.inc/adom/altium-bridge - **Bridge SDK:** https://wiki.adom.inc/adom/adom-bridge-sdk@@ -170,7 +170,7 @@ way to read it). A stopped engine is restarted with `altium_agent_recover`.  <!-- verbs:start (tools/readme_verbs.py writes this list) --> -All 251 verbs, by area (prefix `altium_`). `altium_describe` returns the live catalog with every input, output, hint and example.+All 252 verbs, by area (prefix `altium_`). `altium_describe` returns the live catalog with every input, output, hint and example.  ### Running Altium: launch, close, health, dialogs @@ -244,6 +244,7 @@ All 251 verbs, by area (prefix `altium_`). `altium_describe` returns the live ca  - `altium_routing_state`: The WHOLE current board as data, in mm: tracks, arcs, vias, pads (with owner and net), components (ref, x, y, rotation, side), polygon pours, the outline, the unrouted (ratsnest) count, and a revision hash. - `altium_route_net`: Route one net as tracks, segment by segment; a waypoint on another layer drops a via there.+- `altium_plan_route`: Find a path for one net between two pads, clear of other nets' copper by the board's clearance rule, on the copper layers you allow, with vias between them (the standard's shared planner). - `altium_move_parts`: Move, rotate and flip placed components (side top or bottom; flip:true turns a part over); each part is read back to 0.001 mm, the exact rotation and its side. - `altium_export_library_part`: Export one library part into its own small library files: a symbol library with only its symbol, a footprint library with only its footprint, and its 3D model file. - `altium_create_part_project`: Generate a small real project (schematic and board) around one library part, so the part can be shown and tested in every view: schematic, 2D board and 3D board.
SKILL.md+1−1
@@ -34,7 +34,7 @@ Say **altium** to reach this bridge. Every verb returns `success`, a stable `err | Net classes, their widths and clearances; diff pairs | `altium_net_classes`, `altium_diff_pairs`, `altium_set_track_width` (existing copper) (**altium-boards**) | | Check the design | `altium_compile` (ERC), `altium_run_drc`, `altium_routing_drc`, `altium_review_board`, `altium_cross_check`, `altium_read_rules` (rule values) | | Find a part on the sheet or board | `altium_sch_zoom`, `altium_zoom_to` |-| Place, route, pour, silkscreen a board | `altium_move_parts`, `altium_route_net`, `altium_autoroute` (Situs), `altium_place_vias`, `altium_apply_pours`, `altium_apply_silkscreen`, `altium_set_design_rules`, `altium_layer_stack`, `altium_find_space` (free spots near a part; overlap check) (**altium-boards**) |+| Place, route, pour, silkscreen a board | `altium_move_parts`, `altium_route_net`, `altium_plan_route` (a path pad to pad), `altium_autoroute` (Situs), `altium_place_vias`, `altium_apply_pours`, `altium_apply_silkscreen`, `altium_set_design_rules`, `altium_layer_stack`, `altium_find_space` (free spots near a part; overlap check) (**altium-boards**) | | Silkscreen off the pads before fab or a render (Tools > Silkscreen Preparation) | `altium_silkscreen_prep {filePath}` (runs inside `altium_export_manufacturing` by default) (**altium-outputs**) | | Routed net lengths, pair skew, matched-length groups; length, matched, diff-pair and via rules | `altium_net_lengths`, `altium_add_rule {kind: length\|matched\|diffpair\|via}` (**altium-boards**) | | Component classes and rooms; teardrops | `altium_component_classes {name, members, room}`, `altium_teardrops` (**altium-boards**) |
bridge-rs/Cargo.lock+1−1
@@ -10,7 +10,7 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"  [[package]] name = "adom-eda-checks"-version = "0.5.1"+version = "0.6.0" dependencies = [  "roxmltree",  "serde_json",
bridge-rs/src/checks.rs+19
@@ -109,6 +109,25 @@ fn without(args: &Value, keys: &[&str]) -> Value {     a } +/// altium_plan_route {net, from, to, widthMm?, layers?, allowVias?, viaSizeMm?, viaDrillMm?, gridMm?, viaCost?, clearanceMm?,+/// edgeClearanceMm?, maxNodes?, apply?, filePath?}: the engine plans a path between two pads, clear of other nets' copper by the+/// board's clearance rule (#21); apply:true routes it here with route_net, guarded by the revision it was planned on.+pub fn plan_route(args: &Value) -> Value {+    if let Some(e) = open(args) { return e; }+    let st = match board() { Ok(s) => s, Err(e) => return e };+    let rules = crate::agent::call("read_rules", &[], None, Duration::from_secs(60)).get("data").cloned().unwrap_or(Value::Null);+    let mut r = engine("plan_route", &json!({"board": st, "rules": rules, "args": without(args, &["filePath", "apply"])}));+    if args.get("apply").and_then(|b| b.as_bool()) != Some(true) || r["found"] != json!(true) { return r; }+    let mut rn = r["routeNet"].clone();+    rn["expectedRevision"] = r["revision"].clone();+    let a = crate::routing::route_net(&rn);+    r["applied"] = json!({"success": a["success"], "applied": a["applied"], "failed": a["failed"], "results": a["results"], "unconnected": a["unconnected"], "errorCode": a["errorCode"], "error": a["error"]});+    r["revision"] = a["revision"].clone();+    if a["success"] != json!(true) { r["success"] = json!(false); r["errorCode"] = a["errorCode"].clone(); }+    r["_hint"] = json!("Routed as one undo step (altium_undo takes it back). Pours were not obstacles: repour (altium_repour), then altium_routing_drc.");+    r+}+ /// altium_copper_balance {filePath?, resolutionMm?} pub fn copper_balance(args: &Value) -> Value {     if let Some(e) = open(args) { return e; }
bridge-rs/src/verbs.rs+7−1
@@ -22,7 +22,7 @@ pub const KNOWN: &[&str] = &[     "list_nets", "net_connections", "layers", "copper_layers", "read_rules",     "set_layer_visibility", "footprint_primitives", "schematic_data", "layer_stack", "net_classes", "diff_pairs", "board_outline", "set_track_width", "find_space", "selection", "check_orientation", "replicate_layout", "outjob_info", "find_symbol", "part_parameters",     // the live-board lane AI Flow drives-    "routing_state", "route_net", "move_parts", "export_library_part", "create_part_project", "library_views", "render_board_3d", "render_board_layers", "document_info", "close_all_documents", "project_info", "project_create", "project_rename", "project_snapshot", "cross_probe", "read_footprint", "export_odb", "export_ipc2581", "export_ipc356", "export_dxf", "export_gencad", "import_svg", "edit_footprint", "generate_body", "remove_parts", "edit_parts", "align_parts", "set_layer_count", "copy_routing", "check_clearance", "remove_graphics", "place_vias", "board_features", "sch_sheet_symbol", "netlist", "silkscreen_prep", "net_lengths", "teardrops", "component_classes", "read_sheet_file", "fab_check", "panelize", "impedance", "current_capacity", "height_check", "bodies", "copper_balance", "return_path", "silk_designators", "via_fence", "assembly_check", "jlcpcb_order", "schematic_review", "pin_pad_check", "route_pair", "thermal_vias", "board_report", "placement_check", "auto_classes", "length_tune", "remove_items", "ripup_nets", "apply_pours", "pour_state", "remove_pours", "repour", "routing_drc", "build_board", "set_outline", "set_design_rules", "zoom_to", "add_rule", "build_schematic", "export_manufacturing", "select_net", "silk_state", "apply_silkscreen",+    "routing_state", "route_net", "plan_route", "move_parts", "export_library_part", "create_part_project", "library_views", "render_board_3d", "render_board_layers", "document_info", "close_all_documents", "project_info", "project_create", "project_rename", "project_snapshot", "cross_probe", "read_footprint", "export_odb", "export_ipc2581", "export_ipc356", "export_dxf", "export_gencad", "import_svg", "edit_footprint", "generate_body", "remove_parts", "edit_parts", "align_parts", "set_layer_count", "copy_routing", "check_clearance", "remove_graphics", "place_vias", "board_features", "sch_sheet_symbol", "netlist", "silkscreen_prep", "net_lengths", "teardrops", "component_classes", "read_sheet_file", "fab_check", "panelize", "impedance", "current_capacity", "height_check", "bodies", "copper_balance", "return_path", "silk_designators", "via_fence", "assembly_check", "jlcpcb_order", "schematic_review", "pin_pad_check", "route_pair", "thermal_vias", "board_report", "placement_check", "auto_classes", "length_tune", "remove_items", "ripup_nets", "apply_pours", "pour_state", "remove_pours", "repour", "routing_drc", "build_board", "set_outline", "set_design_rules", "zoom_to", "add_rule", "build_schematic", "export_manufacturing", "select_net", "silk_state", "apply_silkscreen",     // surfaces     "show_project", "show_schematic", "show_2d_board", "show_3d_board", "show_library",     "show_symbol", "show_footprint", "show_3d_chip", "list_library", "demo",@@ -412,6 +412,11 @@ fn describe() -> Value {             json!({"revision": "string - the board after the edit", "applied": "int", "failed": "int", "results": "[ok|err:...] per segment/via", "unconnected": "int", "counts": "{tracks, vias, ...}", "state": "the full altium_routing_state after"}), 300,             "Coordinates are mm in Altium's frame, the same as altium_routing_state. There is no clearance check here yet: run your own DRC (AI Flow's gate) or altium_run_drc after.",             &["routing_state", "place_vias", "remove_items", "ripup_nets"], &["Needs the board current.", "A net name must already exist on the board (nets come from the schematic / pads)."], json!({"net": "VOUT", "width": 0.5, "paths": [[{"pad": "L1.2"}, [120.0, 90.0], {"pad": "C6.1"}]]})),+        verb_doc("plan_route", "Find a path for one net between two pads, clear of other nets' copper by the board's clearance rule, on the copper layers you allow, with vias between them (the standard's shared planner). A plan: apply:true routes it.",+            json!({"net": "string (required)", "from": "Ref.Pad (required), e.g. U1.3", "to": "Ref.Pad (required)", "widthMm": "track width, default 0.25", "layers": "[F.Cu, B.Cu, In<n>.Cu] - default F.Cu and B.Cu", "allowVias": "bool, default true", "viaSizeMm": "mm", "viaDrillMm": "mm", "gridMm": "search grid, default 0.5; 0.1 for fine-pitch pads", "clearanceMm": "only raises the board's rule", "edgeClearanceMm": "mm from the outline", "maxNodes": "search bound, default 50000", "apply": "bool, default false - route it with altium_route_net, guarded by the revision it was planned on", "filePath": "the .PcbDoc (opened first; else the current board)"}),+            json!({"found": "bool", "routeNet": "altium_route_net's own arguments {net, layer, width, viaSize, viaDrill, paths}", "lengthMm": "float", "vias": "int", "viaAt": "[[x, y]]", "revision": "string - pass as expectedRevision", "reason": "string - why no path, when found is false", "applied": "{success, applied, failed, unconnected} - with apply", "engine": "string"}), 300,+            "A plan changes nothing: read it, then call again with apply:true, or pass routeNet to altium_route_net yourself. Pours are not obstacles: repour after. The path is orthogonal on the grid: a 0.5 mm pitch part needs gridMm 0.1 to escape its pads. found:false says why (no room at this grid and clearance, or the search bound).",+            &["route_net", "routing_state", "repour", "routing_drc", "route_pair"], &["Pours are ignored: a route through a pour's area cuts it until the repour.", "A coarse grid misses paths between fine-pitch pads: try gridMm 0.1 before giving up."], json!({"net": "N1", "from": "U1.8", "to": "U2.1", "gridMm": 0.25})),         verb_doc("move_parts", "Move, rotate and flip placed components (side top or bottom; flip:true turns a part over); each part is read back to 0.001 mm, the exact rotation and its side. One undo step.",             json!({"parts": "[{ref, x, y, rotation, side?: top|bottom, flip?: bool}] - mm and degrees, Altium's frame; or {ref, dx, dy} to move by an offset; rotation and side kept when left out", "expectedRevision": "string (optional) - the revision you last read; refused with stale_board if the board changed", "boardId": "string (optional) - refused with board_mismatch unless this is the current board", "expectPath": "string (optional)"}),             json!({"revision": "string", "results": "[ok|err:...]", "mismatches": "[{ref, asked, got}] when a part did not land where asked (errorCode readback_mismatch)"}), 300,@@ -2071,6 +2076,7 @@ pub fn dispatch(command: &str, args: &Value, _forwarded: &[(String, String)]) ->         "panelize" => crate::panel::panelize(args),         "impedance" => crate::checks::impedance(args),         "current_capacity" => crate::checks::current_capacity(args),+        "plan_route" => crate::checks::plan_route(args),         "height_check" => crate::bodies::height_check(args),         "bodies" => crate::bodies::bodies(args),         "copper_balance" => crate::checks::copper_balance(args),
bridge-rs/vendor/README.md+1−1
@@ -2,7 +2,7 @@  | Folder | From | Version | |---|---|---|-| `adom-eda-checks/` | adom/eda-bridge-standard `engine/` (the shared checks engine) | standard 0.8.1, engine 0.5.1 |+| `adom-eda-checks/` | adom/eda-bridge-standard `engine/` (the shared checks engine) | standard 0.9.0, engine 0.6.0 | | `pcb-design-rules/records/` | adom/pcb-design-rules `rules/records/` (each fab's published limits, with sources and dates) | head of 2026-10-27 |  The wiki has no git protocol, so these are copied at a version: refresh both from their pages, then run the tests.
bridge-rs/vendor/adom-eda-checks/Cargo.toml+1−1
@@ -1,6 +1,6 @@ [package] name = "adom-eda-checks"-version = "0.5.1"+version = "0.6.0" edition = "2021" description = "The EDA Bridge Standard's checks and board-file writers, computed from the board model JSON: no bridge calls, no tool." license = "MIT"
bridge-rs/vendor/adom-eda-checks/README.md+4−3
@@ -18,6 +18,7 @@ boards the engine gives the same answers the Altium bridge 0.2.76 gives. | `current_capacity` | board, stack? | per net and layer, the narrowest copper against the width the current needs (IPC-2221), and the vias a layer change needs | | `height_check` | bodies, board? | each part's height on its side, parts over `maxTopMm`/`maxBottomMm` or under a lid region (`regions`), body collisions and near misses (`minGapMm`); `noBody` and `complete: false` when a part has no 3D body | | `placement_check` | board, bodies? | courtyard overlaps (pads and bodies, grown by `marginMm`), parts off or over the edge, pads within `edgeMm` of the edge, parts on mounting holes; `stacked` lists plan-view overlaps where one part sits wholly above the other (a part under a raised molecule: pads apart, no bodies meeting in 3D); `bodiesUsed: false` when no bodies were given |+| `plan_route` | board, rules? | a path between two pads of a net (`from`, `to` as Ref.Pad) on any listed copper `layers`, with through vias between them: a bounded orthogonal A* on `gridMm`, keeping `widthMm/2` + the board's clearance from other nets' copper (pads by their real outline), inside the outline, no via in a pad. `routeNet` is route_net's arguments, unchanged; pours are not obstacles (repour after) | | `thermal_vias` | board, rules? | a grid of vias in a part's exposed pad (`ref`, `pad?`), clear of vias already there; `apply` is `place_vias` arguments | | `via_fence` | board, rules? | vias of `viaNet` both sides of the named nets' tracks and/or round the board edge (`edge`), at `pitchMm` or lambda/20 at `freqGHz`, clear of other copper; `apply` is `place_vias` arguments | @@ -25,8 +26,8 @@ The via plans size their vias from `args.size`/`drill`, else the board's via rul or Altium's Routing Via descriptor), else 0.6/0.3, and say which in `planned.via.from`.  The other checks-tier verbs (assembly, pair routing, length tuning,-designators, panels, the board report, schematic review, and the planners estimate_cost, check_clearance, place_decoupling, plan_fanout-and plan_route) come over a module at a time.+designators, panels, the board report, schematic review, and the planners estimate_cost, check_clearance, place_decoupling and plan_fanout)+come over a module at a time.  ## Writers @@ -89,7 +90,7 @@ adom-eda-checks import_svg --svg logo.svg --args '{"at": [10, 10], "widthMm": 20  Replies keep the standard envelope (`success`, `errorCode`, `error`, `_hint`) and name verbs without a prefix (`apply_pours`, `add_rule`, `place_vias`): a bridge adds its own. Every reply also carries `engine`-(`"adom-eda-checks 0.5.1"`), so a bridge reports the engine it runs without writing the version by hand.+(`"adom-eda-checks 0.6.0"`), so a bridge reports the engine it runs without writing the version by hand.  ## Tests 
bridge-rs/vendor/adom-eda-checks/src/lib.rs+3−1
@@ -16,6 +16,7 @@ pub mod geom; pub mod impedance; pub mod input; pub mod placement;+pub mod route; pub mod writers;  /// This engine's version. Every reply carries it as `engine` ("adom-eda-checks 0.3.0"), so a bridge never writes it by hand@@ -23,7 +24,7 @@ pub mod writers; pub const VERSION: &str = env!("CARGO_PKG_VERSION");  /// The checks this build answers, by standard verb name.-pub const CHECKS: &[&str] = &["copper_balance", "current_capacity", "fab_check", "height_check", "impedance", "placement_check", "return_path", "thermal_vias", "via_fence"];+pub const CHECKS: &[&str] = &["copper_balance", "current_capacity", "fab_check", "height_check", "impedance", "placement_check", "plan_route", "return_path", "thermal_vias", "via_fence"];  /// Run one check or writer by its standard name. The reply carries `engine`. pub fn run(check: &str, input: &Value) -> Value {@@ -41,6 +42,7 @@ fn answer(check: &str, input: &Value) -> Value {         "height_check" => bodies::height_check(input),         "impedance" => impedance::impedance(input),         "placement_check" => placement::placement_check(input),+        "plan_route" => route::plan_route(input),         "return_path" => coppermap::return_path(input),         "thermal_vias" => features::thermal_vias(input),         "via_fence" => features::via_fence(input),
bridge-rs/vendor/adom-eda-checks/src/route.rsadded+323
@@ -0,0 +1,323 @@+//! A route between two pads of a net, planned on the board model and answered as route_net's arguments: a bounded+//! orthogonal A* over a grid on any copper layers the caller lists, with through vias between them. Every step keeps+//! `width/2 + clearance` from copper of other nets on its layer (pads by their real outline, tracks, arcs, vias), stays+//! inside the outline by the edge clearance, and no via lands in a pad. From the Fusion bridge's routing_planner.py+//! (fusion-lane, #12), which searched two layers of an EAGLE board; this one reads the standard board model. A plan+//! only: nothing changes until the bridge runs route_net with `routeNet`.+use serde_json::{json, Value};+use std::cmp::Reverse;+use std::collections::{BinaryHeap, HashMap};++type P = (f64, f64);++fn f(v: &Value) -> f64 { v.as_f64().unwrap_or(0.0) }+fn r3(v: f64) -> f64 { (v * 1000.0).round() / 1000.0 }++fn seg_point(p: P, a: P, b: P) -> f64 {+    let (dx, dy) = (b.0 - a.0, b.1 - a.1);+    let l2 = dx * dx + dy * dy;+    let t = if l2 > 0.0 { (((p.0 - a.0) * dx + (p.1 - a.1) * dy) / l2).clamp(0.0, 1.0) } else { 0.0 };+    ((a.0 + t * dx - p.0).powi(2) + (a.1 + t * dy - p.1).powi(2)).sqrt()+}++/// The distance between two segments (0 when they cross).+fn seg_seg(a: P, b: P, c: P, d: P) -> f64 {+    let cross = |p: P, q: P, r: P| (q.0 - p.0) * (r.1 - p.1) - (q.1 - p.1) * (r.0 - p.0);+    if cross(a, b, c) * cross(a, b, d) < 0.0 && cross(c, d, a) * cross(c, d, b) < 0.0 { return 0.0; }+    seg_point(a, c, d).min(seg_point(b, c, d)).min(seg_point(c, a, b)).min(seg_point(d, a, b))+}++fn inside(p: P, ring: &[P]) -> bool {+    let mut c = false;+    for i in 0..ring.len() {+        let (a, b) = (ring[i], ring[(i + 1) % ring.len()]);+        if (a.1 > p.1) != (b.1 > p.1) && p.0 < (b.0 - a.0) * (p.1 - a.1) / (b.1 - a.1) + a.0 { c = !c; }+    }+    c+}++/// Copper as a shape: a capsule (a segment with a half-width: tracks, round pads, vias) or a polygon (rect pads, a+/// custom pad's copperPoints).+#[derive(Clone)]+enum Shape { Cap(P, P, f64), Poly(Vec<P>) }++impl Shape {+    /// Edge-to-edge distance from the segment a..b (its centreline) to this copper.+    fn dist(&self, a: P, b: P) -> f64 {+        match self {+            Shape::Cap(c, d, r) => seg_seg(a, b, *c, *d) - r,+            Shape::Poly(ring) => {+                if inside(a, ring) || inside(b, ring) { return 0.0; }+                (0..ring.len()).map(|i| seg_seg(a, b, ring[i], ring[(i + 1) % ring.len()])).fold(f64::MAX, f64::min)+            }+        }+    }+    fn bounds(&self) -> (f64, f64, f64, f64) {+        match self {+            Shape::Cap(c, d, r) => (c.0.min(d.0) - r, c.1.min(d.1) - r, c.0.max(d.0) + r, c.1.max(d.1) + r),+            Shape::Poly(ring) => ring.iter().fold((f64::MAX, f64::MAX, f64::MIN, f64::MIN), |b, p| (b.0.min(p.0), b.1.min(p.1), b.2.max(p.0), b.3.max(p.1))),+        }+    }+}++/// A pad's copper: copperPoints when the bridge sent them, else its shape turned with it.+fn pad_shape(p: &Value) -> Shape {+    let (x, y, sx, sy, rot) = (f(&p["x"]), f(&p["y"]), f(&p["sizeX"]), f(&p["sizeY"]), f(&p["rotation"]).to_radians());+    let pts: Vec<P> = p["copperPoints"].as_array().cloned().unwrap_or_default().iter().map(|q| (f(&q[0]), f(&q[1]))).collect();+    if pts.len() >= 3 { return Shape::Poly(pts); }+    let (c, s) = (rot.cos(), rot.sin());+    match p["shape"].as_str() {+        Some("round") | Some("circle") => {+            let (l, w) = ((sx - sy).abs() / 2.0, sx.min(sy) / 2.0);+            let (ux, uy) = if sx >= sy { (c * l, s * l) } else { (-s * l, c * l) };+            Shape::Cap((x - ux, y - uy), (x + ux, y + uy), w)+        }+        _ => Shape::Poly([(-sx, -sy), (sx, -sy), (sx, sy), (-sx, sy)].iter().map(|(u, v)| (x + u / 2.0 * c - v / 2.0 * s, y + u / 2.0 * s + v / 2.0 * c)).collect()),+    }+}++/// The copper layers a pad is on: every one for a through-hole pad (`*.Cu` or a drill), else its own.+fn pad_layers(p: &Value, all: &[String]) -> Vec<String> {+    let l = p["layer"].as_str().unwrap_or("");+    if l == "*.Cu" || f(&p["drill"]) > 0.0 { all.to_vec() } else { vec![l.to_string()] }+}++/// plan_route: input {board, rules?, args: {net, from, to, widthMm?, layers?, allowVias?, viaSizeMm?, viaDrillMm?, gridMm?,+/// viaCost?, clearanceMm?, edgeClearanceMm?, maxNodes?}}. `from` and `to` are pads as Ref.Pad.+pub fn plan_route(input: &Value) -> Value {+    let st = match crate::input::board(input) { Ok(b) => b, Err(e) => return e };+    let args = &input["args"];+    let num = |k: &str, d: f64| args.get(k).and_then(|v| v.as_f64()).unwrap_or(d);+    let Some(net) = args["net"].as_str() else { return crate::input::refuse("bad_args", "net is required") };+    if !st["nets"].as_array().map(|a| a.iter().any(|n| n.as_str().map(|s| s.eq_ignore_ascii_case(net)).unwrap_or(false))).unwrap_or(false) {+        return crate::input::refuse("no_such_net", &format!("{net} is not a net on this board"));+    }+    let pads = st["pads"].as_array().cloned().unwrap_or_default();+    let key = |p: &Value| format!("{}.{}", p["ref"].as_str().unwrap_or(""), p["name"].as_str().unwrap_or(""));+    let mut ends = Vec::new();+    for k in ["from", "to"] {+        let Some(want) = args[k].as_str() else { return crate::input::refuse("bad_args", &format!("{k} is a pad as Ref.Pad (U1.3)")) };+        let Some(p) = pads.iter().find(|p| key(p).eq_ignore_ascii_case(want)) else { return crate::input::refuse("no_such_pad", &format!("{want} is not a pad on this board")) };+        if !p["net"].as_str().map(|n| n.eq_ignore_ascii_case(net)).unwrap_or(false) {+            return json!({"success": true, "found": false, "reason": format!("{want} is on {}, not {net}", p["net"].as_str().unwrap_or("no net"))});+        }+        ends.push(p.clone());+    }+    if key(&ends[0]).eq_ignore_ascii_case(&key(&ends[1])) { return crate::input::refuse("bad_args", "from and to are the same pad"); }+    let layers: Vec<String> = args["layers"].as_array().map(|a| a.iter().filter_map(|v| v.as_str().map(String::from)).collect()).unwrap_or_else(|| vec!["F.Cu".into(), "B.Cu".into()]);+    if layers.is_empty() || layers.iter().any(|l| !l.ends_with(".Cu") || l == "*.Cu") { return crate::input::refuse("bad_args", "layers are copper layers by name: [\"F.Cu\", \"In1.Cu\", \"B.Cu\"]"); }+    let width = num("widthMm", 0.25);+    let (via_size, via_drill) = (num("viaSizeMm", 0.6), num("viaDrillMm", 0.3));+    if via_drill >= via_size { return crate::input::refuse("bad_args", "viaDrillMm must be smaller than viaSizeMm"); }+    let grid = num("gridMm", 0.5);+    if !(0.05..=5.0).contains(&grid) { return crate::input::refuse("bad_args", "gridMm is 0.05 to 5"); }+    let allow_vias = args["allowVias"].as_bool().unwrap_or(true) && layers.len() > 1;+    let via_cost = num("viaCost", 5.0);+    let max_nodes = args["maxNodes"].as_u64().unwrap_or(50_000).clamp(1, 500_000) as usize;+    // the board's own clearance decides; a caller's clearanceMm can only raise it+    let rule = crate::fab::min_clearance(&crate::input::rules(input));+    let clearance = num("clearanceMm", 0.0).max(rule.unwrap_or(0.2));+    let edge = num("edgeClearanceMm", 0.3);+    let ring = crate::coppermap::outline_ring(&st);+    if ring.len() < 3 { return crate::input::refuse("no_outline", "the board has no outline"); }++    // copper of other nets, by layer; every pad for the via-in-pad rule. Net-less tracks and arcs are a hatched pour's+    // pieces (Altium lists 8777 of the Bluetooth Sentinel's 9378 tracks with no net) and pours re-pour round new copper,+    // so neither blocks a route: repour after placing it (the reply says so)+    let same = |v: &Value| v["net"].as_str().map(|n| n.eq_ignore_ascii_case(net) || (n.is_empty() && v.get("start").or(v.get("center")).is_some())).unwrap_or(false);+    let mut ob: Vec<(Shape, Vec<String>, (f64, f64, f64, f64))> = Vec::new();+    let mut push = |s: Shape, ls: Vec<String>| { let b = s.bounds(); ob.push((s, ls, b)); };+    for p in pads.iter().filter(|p| !same(p)) { push(pad_shape(p), pad_layers(p, &layers)); }+    for t in st["tracks"].as_array().cloned().unwrap_or_default().iter().filter(|t| !same(t)) {+        push(Shape::Cap((f(&t["start"]["x"]), f(&t["start"]["y"])), (f(&t["end"]["x"]), f(&t["end"]["y"])), f(&t["width"]) / 2.0), vec![t["layer"].as_str().unwrap_or("").to_string()]);+    }+    for a in st["arcs"].as_array().cloned().unwrap_or_default().iter().filter(|a| !same(a)) {+        let (cx, cy, r) = (f(&a["center"]["x"]), f(&a["center"]["y"]), f(&a["radius"]));+        let (a1, mut a2) = (f(&a["startAngle"]), f(&a["endAngle"]));+        if a2 <= a1 { a2 += 360.0; }+        let n = ((a2 - a1) / 10.0).ceil().max(1.0) as usize;+        let p = |deg: f64| (cx + r * deg.to_radians().cos(), cy + r * deg.to_radians().sin());+        for i in 0..n { push(Shape::Cap(p(a1 + (a2 - a1) * i as f64 / n as f64), p(a1 + (a2 - a1) * (i + 1) as f64 / n as f64), f(&a["width"]) / 2.0), vec![a["layer"].as_str().unwrap_or("").to_string()]); }+    }+    for v in st["vias"].as_array().cloned().unwrap_or_default().iter().filter(|v| !same(v)) {+        let c = (f(&v["position"]["x"]), f(&v["position"]["y"]));+        push(Shape::Cap(c, c, f(&v["size"]) / 2.0), layers.clone());+    }+    let all_pads: Vec<Shape> = pads.iter().map(pad_shape).collect();++    // the grid: lines every gridMm over the outline, plus lines through both pad centres+    let (x0, x1) = ring.iter().fold((f64::MAX, f64::MIN), |a, p| (a.0.min(p.0), a.1.max(p.0)));+    let (y0, y1) = ring.iter().fold((f64::MAX, f64::MIN), |a, p| (a.0.min(p.1), a.1.max(p.1)));+    let cells = ((x1 - x0) / grid + 3.0) * ((y1 - y0) / grid + 3.0) * layers.len() as f64;+    if cells > 2_000_000.0 { return crate::input::refuse("search_budget", "the grid has too many cells: use a coarser gridMm"); }+    let axis = |lo: f64, hi: f64, extra: [f64; 2]| -> Vec<f64> {+        let mut v: Vec<f64> = (0..=((hi - lo) / grid).floor() as usize).map(|i| r3(lo + i as f64 * grid)).collect();+        v.extend(extra.iter().map(|e| r3(*e)));+        v.sort_by(|a, b| a.partial_cmp(b).unwrap());+        v.dedup_by(|a, b| (*a - *b).abs() < 1e-9);+        v+    };+    let (sp, gp) = ((f(&ends[0]["x"]), f(&ends[0]["y"])), (f(&ends[1]["x"]), f(&ends[1]["y"])));+    let xs = axis(x0, x1, [sp.0, gp.0]);+    let ys = axis(y0, y1, [sp.1, gp.1]);+    let idx = |v: &[f64], t: f64| v.iter().position(|x| (x - r3(t)).abs() < 1e-9).unwrap();+    let (start, goal) = ((idx(&xs, sp.0), idx(&ys, sp.1)), (idx(&xs, gp.0), idx(&ys, gp.1)));+    let start_layers: Vec<usize> = pad_layers(&ends[0], &layers).iter().filter_map(|l| layers.iter().position(|x| x == l)).collect();+    let goal_layers: Vec<usize> = pad_layers(&ends[1], &layers).iter().filter_map(|l| layers.iter().position(|x| x == l)).collect();+    if start_layers.is_empty() || goal_layers.is_empty() {+        return json!({"success": true, "found": false, "reason": "a pad is on no layer the route may use: add its layer to layers"});+    }+    if !allow_vias && !start_layers.iter().any(|l| goal_layers.contains(l)) {+        return json!({"success": true, "found": false, "reason": "the pads share no layer and allowVias is false"});+    }++    let edge_ok = |a: P, b: P, r: f64| inside(a, &ring) && inside(b, &ring)+        && (0..ring.len()).all(|k| seg_seg(a, b, ring[k], ring[(k + 1) % ring.len()]) >= edge + r - 1e-9);+    let clear_on = |a: P, b: P, r: f64, layer: &str| {+        let (bx0, by0, bx1, by1) = (a.0.min(b.0) - r - clearance, a.1.min(b.1) - r - clearance, a.0.max(b.0) + r + clearance, a.1.max(b.1) + r + clearance);+        ob.iter().filter(|(_, ls, bb)| ls.iter().any(|l| l == layer) && !(bb.2 < bx0 || bb.0 > bx1 || bb.3 < by0 || bb.1 > by1))+            .all(|(s, _, _)| s.dist(a, b) >= r + clearance - 1e-9)+    };+    let mut cache: HashMap<(usize, usize, usize, usize, usize, usize), bool> = HashMap::new();+    let mut step_ok = |u: (usize, usize, usize), v: (usize, usize, usize)| -> bool {+        let k = if u <= v { (u.0, u.1, u.2, v.0, v.1, v.2) } else { (v.0, v.1, v.2, u.0, u.1, u.2) };+        if let Some(b) = cache.get(&k) { return *b; }+        let (a, b) = ((xs[u.0], ys[u.1]), (xs[v.0], ys[v.1]));+        let ok = if u.2 != v.2 {+            // a through via: clear on every layer, inside the outline, in no pad+            let r = via_size / 2.0;+            edge_ok(a, a, r) && layers.iter().all(|l| clear_on(a, a, r, l)) && all_pads.iter().all(|s| s.dist(a, a) >= r + clearance - 1e-9)+        } else {+            edge_ok(a, b, width / 2.0) && clear_on(a, b, width / 2.0, &layers[u.2])+        };+        cache.insert(k, ok);+        ok+    };+    let h = |u: (usize, usize, usize)| (xs[u.0] - gp.0).abs() + (ys[u.1] - gp.1).abs() + if goal_layers.contains(&u.2) { 0.0 } else { via_cost };+    let q = |v: f64| (v * 1e6).round() as i64;+    let mut heap: BinaryHeap<Reverse<(i64, i64, (usize, usize, usize))>> = BinaryHeap::new();+    let mut cost: HashMap<(usize, usize, usize), f64> = HashMap::new();+    let mut parent: HashMap<(usize, usize, usize), (usize, usize, usize)> = HashMap::new();+    for &l in &start_layers { let u = (start.0, start.1, l); cost.insert(u, 0.0); heap.push(Reverse((q(h(u)), 0, u))); }+    let mut seen: std::collections::HashSet<(usize, usize, usize)> = Default::default();+    let mut found = None;+    while let Some(Reverse((_, _, u))) = heap.pop() {+        if !seen.insert(u) { continue; }+        if (u.0, u.1) == goal && goal_layers.contains(&u.2) { found = Some(u); break; }+        if seen.len() >= max_nodes { break; }+        let g = cost[&u];+        let mut nb = Vec::new();+        if u.0 + 1 < xs.len() { nb.push((u.0 + 1, u.1, u.2)); }+        if u.0 > 0 { nb.push((u.0 - 1, u.1, u.2)); }+        if u.1 + 1 < ys.len() { nb.push((u.0, u.1 + 1, u.2)); }+        if u.1 > 0 { nb.push((u.0, u.1 - 1, u.2)); }+        if allow_vias { for l in 0..layers.len() { if l != u.2 { nb.push((u.0, u.1, l)); } } }+        for v in nb {+            if seen.contains(&v) || !step_ok(u, v) { continue; }+            let step = if v.2 != u.2 { via_cost } else { (xs[v.0] - xs[u.0]).abs() + (ys[v.1] - ys[u.1]).abs() };+            let ng = g + step;+            if ng >= cost.get(&v).copied().unwrap_or(f64::MAX) - 1e-9 { continue; }+            cost.insert(v, ng);+            parent.insert(v, u);+            heap.push(Reverse((q(ng + h(v)), q(ng), v)));+        }+    }+    let revision = st["revision"].clone();+    let Some(goal_node) = found else {+        let why = if seen.len() >= max_nodes { "no path within the search limit (maxNodes): try a coarser gridMm or a higher maxNodes" } else { "no legal path on this grid: other copper, the outline or the clearance blocks every way. A fine-pitch pad (0.5 mm pitch) usually needs gridMm 0.1 to escape; more layers give more room" };+        return json!({"success": true, "found": false, "reason": why, "expandedNodes": seen.len(), "revision": revision});+    };+    let mut path = vec![goal_node];+    while let Some(p) = parent.get(path.last().unwrap()) { path.push(*p); }+    path.reverse();+    // keep the corners and the layer changes+    let mut keep = vec![path[0]];+    for w in path.windows(3) {+        let (a, b, c) = (w[0], w[1], w[2]);+        if a.2 == b.2 && b.2 == c.2 && ((a.0 == b.0 && b.0 == c.0) || (a.1 == b.1 && b.1 == c.1)) { continue; }+        keep.push(b);+    }+    if path.len() > 1 { keep.push(*path.last().unwrap()); }+    let mut way = vec![json!({"pad": key(&ends[0])})];+    let mut vias = Vec::new();+    let mut length = 0.0;+    let last = keep.len() - 1;+    for (i, w) in keep.windows(2).enumerate() {+        let (a, b) = (w[0], w[1]);+        let (pa, pb) = ((xs[a.0], ys[a.1]), (xs[b.0], ys[b.1]));+        if a.2 != b.2 { vias.push(json!([pa.0, pa.1])); } else { length += ((pb.0 - pa.0).powi(2) + (pb.1 - pa.1).powi(2)).sqrt(); }+        // every corner and layer change; the goal itself is the closing {pad} waypoint+        if i + 1 < last { way.push(json!({"x": pb.0, "y": pb.1, "layer": layers[b.2]})); }+    }+    way.push(json!({"pad": key(&ends[1])}));+    json!({"success": true, "found": true, "lengthMm": r3(length), "vias": vias.len(), "viaAt": vias,+        "routeNet": {"net": net, "layer": layers[path[0].2], "width": width, "viaSize": via_size, "viaDrill": via_drill, "paths": [way]},+        "planner": {"algorithm": "bounded orthogonal A*", "gridMm": grid, "layers": layers, "clearanceMm": clearance, "edgeClearanceMm": edge, "expandedNodes": seen.len()},+        "revision": revision,+        "_hint": "A plan only: pass routeNet to route_net unchanged (with expectedRevision: revision). A layer change is two waypoints at the same point, where route_net places a via. Pours (and a hatched pour's net-less pieces) are not obstacles: repour after placing the route. The path is orthogonal on the grid: a finer gridMm finds tighter paths and searches longer."})+}++#[cfg(test)]+mod tests {+    use super::*;++    fn board(extra_tracks: Value) -> Value {+        json!({"nets": ["SIG", "GND"], "revision": "r1", "outline": [[0, 0], [20, 0], [20, 10], [0, 10]],+               "outlineEdges": [{"kind": "line", "start": [0.0, 0.0]}, {"kind": "line", "start": [20.0, 0.0]}, {"kind": "line", "start": [20.0, 10.0]}, {"kind": "line", "start": [0.0, 10.0]}],+               "pads": [{"ref": "U1", "name": "1", "x": 2.0, "y": 5.0, "sizeX": 1.0, "sizeY": 1.0, "rotation": 0.0, "shape": "rect", "layer": "F.Cu", "drill": 0.0, "net": "SIG"},+                        {"ref": "J1", "name": "1", "x": 18.0, "y": 5.0, "sizeX": 1.0, "sizeY": 1.0, "rotation": 0.0, "shape": "rect", "layer": "F.Cu", "drill": 0.0, "net": "SIG"},+                        {"ref": "J1", "name": "2", "x": 18.0, "y": 2.0, "sizeX": 1.0, "sizeY": 1.0, "rotation": 0.0, "shape": "rect", "layer": "B.Cu", "drill": 0.0, "net": "SIG"}],+               "tracks": extra_tracks, "arcs": [], "vias": []})+    }++    #[test]+    fn a_clear_board_is_one_straight_track() {+        let r = plan_route(&json!({"board": board(json!([])), "args": {"net": "SIG", "from": "U1.1", "to": "J1.1"}}));+        assert_eq!(r["found"], json!(true), "{r}");+        assert_eq!(r["vias"], 0);+        assert!((r["lengthMm"].as_f64().unwrap() - 16.0).abs() < 1e-9);+        assert_eq!(r["routeNet"]["paths"][0][0], json!({"pad": "U1.1"}));+        assert_eq!(r["routeNet"]["paths"][0].as_array().unwrap().last().unwrap(), &json!({"pad": "J1.1"}));+        assert_eq!(r["routeNet"]["layer"], "F.Cu");+    }++    #[test]+    fn a_wall_on_top_is_crossed_on_the_bottom_or_not_at_all() {+        // a GND track across the whole board on F.Cu+        let wall = json!([{"net": "GND", "layer": "F.Cu", "width": 0.5, "start": {"x": 10.0, "y": 0.0}, "end": {"x": 10.0, "y": 10.0}}]);+        let r = plan_route(&json!({"board": board(wall.clone()), "args": {"net": "SIG", "from": "U1.1", "to": "J1.1"}}));+        assert_eq!(r["found"], json!(true), "{r}");+        assert_eq!(r["vias"], 2, "down to B.Cu and back up: {r}");+        // every point of the path clears the wall on F.Cu+        for w in r["routeNet"]["paths"][0].as_array().unwrap() { if w["layer"] == "F.Cu" { assert!((f(&w["x"]) - 10.0).abs() > 0.25 + 0.2 + 0.125 - 1e-9, "{w}"); } }+        let none = plan_route(&json!({"board": board(wall), "args": {"net": "SIG", "from": "U1.1", "to": "J1.1", "allowVias": false}}));+        assert_eq!(none["found"], json!(false));+    }++    #[test]+    fn pads_on_different_layers_take_a_via_and_errors_are_named() {+        let r = plan_route(&json!({"board": board(json!([])), "args": {"net": "SIG", "from": "U1.1", "to": "J1.2"}}));+        assert_eq!(r["found"], json!(true), "{r}");+        assert_eq!(r["vias"], 1);+        // the via is clear of every pad+        let v = &r["viaAt"][0];+        for (px, py) in [(2.0, 5.0), (18.0, 5.0), (18.0, 2.0)] { assert!(((f(&v[0]) - px).powi(2) + (f(&v[1]) - py).powi(2)).sqrt() > 0.3 + 0.5, "{v}"); }+        assert_eq!(plan_route(&json!({"board": board(json!([])), "args": {"net": "SIG", "from": "U9.1", "to": "J1.1"}}))["errorCode"], "no_such_pad");+        assert_eq!(plan_route(&json!({"board": board(json!([])), "args": {"net": "NOPE", "from": "U1.1", "to": "J1.1"}}))["errorCode"], "no_such_net");+        let mut b = board(json!([]));+        b["pads"][1]["net"] = json!("GND");+        assert_eq!(plan_route(&json!({"board": b, "args": {"net": "SIG", "from": "U1.1", "to": "J1.1"}}))["found"], json!(false));+    }++    #[test]+    fn three_layers_when_asked() {+        // walls on F.Cu and B.Cu: only In1.Cu crosses+        let walls = json!([{"net": "GND", "layer": "F.Cu", "width": 0.5, "start": {"x": 10.0, "y": 0.0}, "end": {"x": 10.0, "y": 10.0}},+                           {"net": "GND", "layer": "B.Cu", "width": 0.5, "start": {"x": 10.0, "y": 0.0}, "end": {"x": 10.0, "y": 10.0}}]);+        let two = plan_route(&json!({"board": board(walls.clone()), "args": {"net": "SIG", "from": "U1.1", "to": "J1.1"}}));+        assert_eq!(two["found"], json!(false));+        let three = plan_route(&json!({"board": board(walls), "args": {"net": "SIG", "from": "U1.1", "to": "J1.1", "layers": ["F.Cu", "In1.Cu", "B.Cu"]}}));+        assert_eq!(three["found"], json!(true), "{three}");+        assert!(three["routeNet"]["paths"][0].as_array().unwrap().iter().any(|w| w["layer"] == "In1.Cu"));+    }+}
dev-skills/altium-bridge-test/run_verb_tests.py+3
@@ -223,6 +223,9 @@ def matrix(w):                                                              holeToHole=0.25, polygonConnect="relief"))     M["add_rule"] = dict(phase=3.5, **ok(kind="clearance", name="Battery", scope1="InNet('N1')", gap=0.3))     M["move_parts"] = dict(phase=3.5, **ok(parts=[{"ref": "U2", "x": 29, "y": 10, "rotation": 0}], expectPath=LB))+    # 0.2.80: the standard's planner (#21) finds N1 across the lane board; a plan changes nothing+    M["plan_route"] = dict(phase=3.5, timeout=300, **ok(net="N1", **{"from": "U1.8", "to": "U2.1"}, gridMm=0.25),+                           check=lambda d: d.get("found") is True and (d.get("routeNet") or {}).get("net") == "N1" and (d.get("lengthMm") or 0) > 10)     M["route_net"] = dict(phase=3.5, **ok(net="N1", width=0.25, paths=[[{"pad": "U1.8"}, {"pad": "U2.1"}]], expectPath=LB))     M["place_vias"] = dict(phase=3.5, **ok(vias=[{"net": "GND", "x": 20, "y": 16, "size": 0.6, "drill": 0.3}], expectPath=LB))     M["select_net"] = dict(phase=3.5, **ok(net="N1", zoom=True))
package.json+5−1
@@ -245,7 +245,11 @@     "edit an altium footprint's pads",     "renumber pads in an altium footprint",     "generate a 3d step body for a soic",-    "make a 3d model from package dimensions"+    "make a 3d model from package dimensions",+    "route a net between two pads in altium",+    "find a path for a trace in altium",+    "plan a route in altium",+    "route one net in altium"   ],   "discovery_pitch": "An AI that runs Altium Designer in the user's own session: libraries, schematics, Update PCB, stack-up, routing, DRC, Gerbers and BOMs.",   "sample_prompts": [
page.json+5−1
@@ -237,7 +237,11 @@     "edit an altium footprint's pads",     "renumber pads in an altium footprint",     "generate a 3d step body for a soic",-    "make a 3d model from package dimensions"+    "make a 3d model from package dimensions",+    "route a net between two pads in altium",+    "find a path for a trace in altium",+    "plan a route in altium",+    "route one net in altium"   ],   "discovery_pitch": "An AI that runs Altium Designer in the user's own session: libraries, schematics, Update PCB, stack-up, routing, DRC, Gerbers and BOMs.",   "metadata": {},
skills/altium-boards/SKILL.md+20−1
@@ -6,7 +6,8 @@ description: >-   readback, 3D heights and clearance, impedance, current capacity, copper balance, return paths, fab limits, panels   with V-score or mouse bites. Use when asked for an altium stack-up, net class, mounting holes, a 50 or 90 ohm trace   width, will a trace carry 3 A, does it fit the enclosure, copper balance, return path, place the designators, a-  via fence, route a differential pair, tune a length, thermal vias, check the placement, or panelize a board.+  via fence, route a differential pair, route one net between two pads, find a path for a net, tune a length, thermal+  vias, check the placement, or panelize a board. ---  Parent skill: **altium-bridge**@@ -176,6 +177,24 @@ altium_read_rules '{}'       # every rule with its descriptor (the values) - `altium_read_rules` now carries each rule's `descriptor`, Altium's own wording with the values, for   example `Clearance Constraint (Gap=6mil) (All),(All)`: what a DRC violation is measured against. +## One net, pad to pad: `altium_plan_route` (0.2.80)++```bash+altium_plan_route '{"net":"N1","from":"U1.8","to":"U2.1","gridMm":0.25}'              # a plan: changes nothing+altium_plan_route '{"net":"N1","from":"U1.8","to":"U2.1","gridMm":0.25,"apply":true}' # route it (one undo step)+```++- The EDA Bridge Standard's shared planner (the same one KiCad and Fusion run): an A* search on a grid over the copper+  `layers` you allow (default F.Cu and B.Cu; inner layers too), with vias between them. Every step keeps the board's+  clearance rule from other nets' copper, pads measured by their real outline, and stays `edgeClearanceMm` inside the+  outline.+- It answers `routeNet`, altium_route_net's own arguments, plus `lengthMm`, `vias` and `revision`. `apply:true` runs+  route_net with it, guarded by that revision: a board edited in between is refused, not overwritten.+- Pours are not obstacles: run `altium_repour` after, then `altium_routing_drc`.+- A 0.5 mm pitch part needs `gridMm` 0.1 to escape its pads; `found:false` says why when there is no path (no room at+  this grid and clearance, or the search bound `maxNodes`).+- Use it for the nets the autorouter leaves, or one net at a time where you want to see each route before the next.+ ## Board setup: stack-up, net classes, pairs, widths (0.2.60)  ```bash
src/bridge.json+2−1
@@ -190,6 +190,7 @@     "altium_review_board",     "altium_ripup_nets",     "altium_route_net",+    "altium_plan_route",     "altium_route_pair",     "altium_routing_drc",     "altium_routing_state",@@ -283,7 +284,7 @@       "launch": 240,       "panelize": 240,       "impedance": 120,-      "current_capacity": 120,+      "current_capacity": 120, "plan_route": 300,       "height_check": 150,       "copper_balance": 240,       "return_path": 240,