by adom
Let an AI (Claude, ChatGPT, Codex or any agent) run Altium Designer for you: create symbols and footprints, place parts (also from Altium 365), wire and annotate schematics, Update PCB, set the stack-up and rules, route, pour copper, add mounting holes and stitching vias, run ERC and DRC, and make Gerbers, BOMs and STEP. Free in Hydrogen; bring your own AI and Altium licence.
← Commit history
0.2.111: routing_drc and gloss explain pours shorted to holes with no copper (AD24+ hole clearance)
8 files changed
+63−7
CHANGELOG.md+6@@ -1,5 +1,11 @@ # Changelog +## 0.2.111++- **`altium_routing_drc` explains pours shorted to holes with no copper** (`holeClearance`). Since Altium Designer 24 a hole with no copper ring (pad no larger than its hole, no net) no longer gets an implied ring that kept pours away. A board made in an older Altium has a Clearance rule whose Hole row is 0, so after any repour, Altium's own included, the pours run up to such holes and DRC reports shorts. The reply now names the cause and Altium's two fixes: set the Clearance rule's Hole row against copper, or turn off `PCB.Rules.HoleClearance` and restart Altium, then repour.+- `altium_gloss` passes it on in `drc.holeClearance`, so these shorts from the repour are not taken for damage done by the gloss.+- Found on Altium's SODIMM example (made in 2014), whose two 1.8 mm non-plated holes shorted to 12 pours after a repour in Altium 26.11.1, with or without a gloss. Altium's knowledge base describes the change ("Short Circuit errors between polygons and holes in old project").+ ## 0.2.110 - **New verb `altium_gloss`: tidy routing with Altium's own Gloss** (Route > Gloss Selected). Name the nets (`nets`) and it shortens their routes and removes corners within the board's rules, pours the board again, and answers what changed: each net's length, pieces and corners before and after (`nets[]`), and a DRC comparison (`drc.new`, `drc.clean`). `dryRun:true` says what would be glossed and changes nothing.
bridge-rs/src/gloss.rs+3−1@@ -193,10 +193,12 @@ pub fn gloss(args: &Value) -> Value { json!({"success": true, "glossed": true, "tracksSelected": selected, "netsChanged": changed.len(), "nets": changed, "totalLengthMm": [r3(l0), r3(l1)], "protected": protected, "offAngle": skipped, "excluded": exclude, "repoured": repoured, "unconnected": [unconnected.0, unconnected.1],- "drc": {"before": before_drc["errors"], "after": after_drc["errors"], "new": new, "cleared": cleared.len(), "clean": new.is_empty() && !connections_lost},+ "drc": {"before": before_drc["errors"], "after": after_drc["errors"], "new": new, "cleared": cleared.len(), "clean": new.is_empty() && !connections_lost,+ "holeClearance": after_drc.get("holeClearance").cloned().unwrap_or(Value::Null)}, "glossEffort": effort(), "revision": st1["revision"], "saved": false, "durationMs": t0.elapsed().as_millis() as u64, "undo": "Gloss cannot be undone from a script: the board is left unsaved, so reopen it without saving to go back (altium_close_document, then open it again). altium_save keeps the result.", "_hint": if new.is_empty() && !connections_lost { "Glossed: nets[] gives each changed net's length, pieces and corners before and after, and DRC found nothing new. offAngle lists tracks left alone because they are not at a multiple of 45 degrees. The board is unsaved: altium_save keeps it." }+ else if after_drc.get("holeClearance").is_some() { "Glossed. DRC found new violations (drc.new): pours shorted to holes with no copper come from the repour on this board, not from the gloss (drc.holeClearance names the cause and the fix); check the rest. Reopening the board without saving undoes the gloss." } else { "Glossed, but DRC found new violations (drc.new) or connections were lost (unconnected): check them; reopening the board without saving undoes the gloss." }}) }
bridge-rs/src/main.rs+1−1@@ -84,7 +84,7 @@ use tiny_http::{Header, Method, Response, Server}; /// Attached to every failed reply (see the /command handler). const REPORT_ISSUES: &str = "If this looks like an altium-bridge BUG (not a refusal you expected), report it: check for a duplicate with `adom-wiki issue list adom/altium-bridge`, then `adom-wiki issue create adom/altium-bridge --title \"<verb>: <one-line symptom>\" --category bug-report --body \"<what you ran, what you expected, what happened, the VERBATIM response JSON (and errorShot if present), bridgeVersion, the Altium version from altium_status, the OS>\"`. A relay, routing, toast or lifecycle problem belongs on adom/adom-bridge instead. Reports from real machines are how this bridge gets correct: three different Altium builds behaved three different ways in one weekend."; -pub const BRIDGE_VERSION: &str = "0.2.110";+pub const BRIDGE_VERSION: &str = "0.2.111"; fn json_response(status: u16, body: &serde_json::Value) -> Response<std::io::Cursor<Vec<u8>>> { let data = serde_json::to_vec(body).unwrap_or_else(|_| b"{}".to_vec());
bridge-rs/src/routing.rs+48@@ -1110,9 +1110,44 @@ pub fn routing_drc(args: &Value) -> Value { if !batch.is_null() { out["batch"] = json!({"success": batch["success"], "violationCount": batch["violationCount"], "errorCode": batch["errorCode"]}); }+ if pour_pad_shorts(&out["violations"]) > 0 {+ let st = routing_state(&json!({}));+ let major = crate::support::first_install().and_then(|i| i["version"].as_str().and_then(|v| v.split('.').next()).and_then(|m| m.parse::<i64>().ok()));+ if let Some(n) = hole_clearance_note(&out["violations"], &st["pads"], major) { out["holeClearance"] = n; }+ } out } +/// Short circuits between a pour and a pad in a DRC list. Pure.+pub fn pour_pad_shorts(violations: &Value) -> usize {+ violations.as_array().map(|a| a.iter().filter(|v| {+ let objs: Vec<String> = v["objects"].as_array().cloned().unwrap_or_default().iter().filter_map(|o| o.as_str().map(str::to_string)).collect();+ v["rule"].as_str().map(|r| r.starts_with("ShortCircuit")).unwrap_or(false)+ && objs.iter().any(|o| o.starts_with("Polygon Region")) && objs.iter().any(|o| o.starts_with("Pad "))+ }).count()).unwrap_or(0)+}++/// Pours shorted to holes with no copper: since Altium Designer 24 such a hole gets no implied ring, so a board whose+/// Clearance rule leaves the hole row at 0 (any board from an older Altium) pours right up to it and DRC calls it a short+/// (measured on Altium's SODIMM example in AD 26.11.1, 2026-11-25; Altium KB "Short Circuit errors between polygons and+/// holes in old project"). Named when pours short pads and the board has net-less holes at least as wide as their pad.+/// Pure.+pub fn hole_clearance_note(violations: &Value, pads: &Value, altium_major: Option<i64>) -> Option<Value> {+ let n = pour_pad_shorts(violations);+ if n == 0 || altium_major.map(|m| m < 24).unwrap_or(false) { return None; }+ let bare = pads.as_array().map(|a| a.iter().filter(|p| {+ let drill = p["drill"].as_f64().unwrap_or(0.0);+ let size = p["sizeX"].as_f64().unwrap_or(0.0).min(p["sizeY"].as_f64().unwrap_or(0.0));+ p["net"].as_str().map(|s| s.is_empty()).unwrap_or(true) && drill > 0.0 && drill >= size - 1e-6+ }).count()).unwrap_or(0);+ if bare == 0 { return None; }+ Some(json!({"shorts": n, "holesWithoutCopper": bare,+ "cause": "Since Altium Designer 24 a hole with no copper ring gets no implied ring, so pours keep only the Clearance rule's Hole clearance from it. On a board made in an older Altium that is 0: a repour runs the pour up to the hole and DRC reports a short.",+ "fix": ["Per board: in the Clearance rule, set the Hole row's clearance against copper (polygon) to a real gap, then repour.",+ "Per machine: turn off PCB.Rules.HoleClearance (Preferences > System > General > Advanced), restart Altium, then repour."],+ "source": "Altium knowledge base: Short Circuit errors between polygons and holes in old project"}))+}+ /// Outline vertices in the agent's form (`x,y,kind,cx,cy,r,a1,a2`, RAW units) for a rectangle, with /// rounded corners when `r > 0`: each corner is an arc from its vertex to the next, counterclockwise. pub fn rect_outline(x0: f64, y0: f64, w: f64, h: f64, r: f64) -> Vec<String> {@@ -1530,6 +1565,19 @@ mod tests { assert_eq!(rect_outline(0.0, 0.0, 28.0, 20.0, 0.0).len(), 4); } + #[test]+ fn pours_shorted_to_bare_holes_are_explained() {+ let v = json!([{"rule": "ShortCircuit", "objects": ["Polygon Region (98 hole(s)) S5", "Pad Free-(67mm,6mm) on Multi-Layer"]},+ {"rule": "Clearance", "objects": ["Polygon Region (1 hole(s)) TOP", "Track (1mm,2mm)(3mm,2mm) on TOP"]}]);+ let bare = json!([{"net": "", "drill": 1.8, "sizeX": 1.8, "sizeY": 1.8}]);+ let plated = json!([{"net": "", "drill": 1.0, "sizeX": 1.8, "sizeY": 1.8}]);+ let n = hole_clearance_note(&v, &bare, Some(26)).unwrap();+ assert_eq!(n["shorts"], json!(1));+ assert!(hole_clearance_note(&v, &plated, Some(26)).is_none(), "a pad with a copper ring is not this case");+ assert!(hole_clearance_note(&v, &bare, Some(23)).is_none(), "Altium before 24 kept a ring");+ assert!(hole_clearance_note(&json!([]), &bare, Some(26)).is_none());+ }+ #[test] fn the_revision_covers_the_layer_stack() { let d = json!({"tracks": [[0, 0, 1, 1, 10, 1, "N"]]});
package.json+1−1@@ -1,6 +1,6 @@ { "slug": "altium-bridge",- "version": "0.2.110",+ "version": "0.2.111", "type": "app", "description": "Let an AI (Claude, ChatGPT, Codex or any agent) run Altium Designer for you: create symbols and footprints, place parts (also from Altium 365), wire and annotate schematics, Update PCB, set the stack-up and rules, route, pour copper, add mounting holes and stitching vias, run ERC and DRC, and make Gerbers, BOMs and STEP. Free in Hydrogen; bring your own AI and Altium licence.", "tags": [
page.json+2−2@@ -4,7 +4,7 @@ "type": "app", "title": "Altium Bridge: AI for Altium Designer", "brief": "Let an AI (Claude, ChatGPT, Codex or any agent) run Altium Designer for you: create symbols and footprints, place parts (also from Altium 365), wire and annotate schematics, Update PCB, set the stack-up and rules, route, pour copper, add mounting holes and stitching vias, run ERC and DRC, and make Gerbers, BOMs and STEP. Free in Hydrogen; bring your own AI and Altium licence.",- "version": "0.2.110",+ "version": "0.2.111", "hero": { "type": "image", "path": "screenshots/hero.png"@@ -159,4 +159,4 @@ "tools/symbol_modes.py", "uninstall.sh" ]-}+}
src/BRIDGE_VERSION+1−1@@ -1 +1 @@-0.2.110+0.2.111
src/bridge.json+1−1@@ -2,7 +2,7 @@ "manifest_version": 1, "name": "altium", "displayName": "Altium Designer",- "version": "0.2.110",+ "version": "0.2.111", "description": "Drive Altium Designer from Adom: a resident DelphiScript agent (eval + the 1,100-command process launcher), the X2 -R command line, UIA over the VCL shell, dialogs by PID, screenshots of every Altium window, and Altium 365.", "homepage": "https://wiki.adom.inc/adom/altium-bridge", "docs": "https://wiki.adom.inc/adom/altium-bridge",