← Commit history

standard 0.4.5, engine 0.1.4: current_capacity lists each pour layer once in poursOn (kicad-lane #15)

Colby Knox ·48925b7965 ·14d ago ·parent 5379d06
7 files changed +11−7
README.md+2
@@ -155,6 +155,8 @@ Decisions so far (proposals from the KiCad and Fusion bridges, 2026-10-27; issue  ## Status +Version 0.4.5: the engine (0.1.4) lists each layer once in `current_capacity`'s `poursOn` (kicad-lane #15); KiCad now+answers four checks from the engine too. Version 0.4.4: the engine (0.1.3) counts only copper-to-copper clearance rules: a rule naming the edge, mask, silk, holes, a keepout or the same net is skipped (fusion-lane #13). Version 0.4.3: the engine (0.1.2) reads a clearance rule written as a `value` with its unit (`0.1mm`, Fusion's form) and
engine/Cargo.lock+1−1
@@ -4,7 +4,7 @@ version = 4  [[package]] name = "adom-eda-checks"-version = "0.1.3"+version = "0.1.4" dependencies = [  "serde_json", ]
engine/Cargo.toml+1−1
@@ -1,6 +1,6 @@ [package] name = "adom-eda-checks"-version = "0.1.3"+version = "0.1.4" edition = "2021" description = "The EDA Bridge Standard's checks, computed from the board model JSON: no bridge calls, no tool." license = "MIT"
engine/src/current.rs+4−2
@@ -69,7 +69,9 @@ pub fn check(state: &Value, copper_um: &[f64], nets: &Map<String, Value>, rise:             let each = via_amps(smallest, plating_um, rise);             json!({"count": net_vias.len(), "smallestDrillMm": r3(smallest), "ampsEach": r2(each), "neededPerLayerChange": (amps / each).ceil() as i64})         };-        let pours: Vec<Value> = polys.iter().filter(|p| same(&p["net"])).map(|p| p["layer"].clone()).collect();+        // each layer once, however many pours of the net it holds (#15)+        let mut pours: Vec<Value> = Vec::new();+        for l in polys.iter().filter(|p| same(&p["net"])).map(|p| p["layer"].clone()) { if !pours.contains(&l) { pours.push(l); } }         json!({"net": net, "amps": amps, "layers": layers, "shortOn": short, "ok": short.is_empty(), "vias": via, "poursOn": pours})     }).collect() }@@ -118,7 +120,7 @@ mod tests {     #[test]     fn check_finds_the_narrow_layer() {         let st = json!({"tracks": [{"net": "VIN", "layer": "F.Cu", "width": 1.5, "start": {"x": 0.0, "y": 0.0}}, {"net": "VIN", "layer": "B.Cu", "width": 0.3, "start": {"x": 4.0, "y": 1.0}}],-                        "vias": [{"net": "VIN", "drill": 0.3}, {"net": "VIN", "drill": 0.4}], "polygons": [{"net": "VIN", "layer": "B.Cu"}]});+                        "vias": [{"net": "VIN", "drill": 0.3}, {"net": "VIN", "drill": 0.4}], "polygons": [{"net": "VIN", "layer": "B.Cu"}, {"net": "VIN", "layer": "B.Cu"}]});         let nets = json!({"VIN": 3.0}).as_object().unwrap().clone();         let r = &check(&st, &[35.0, 35.0], &nets, 10.0, 25.0)[0];         assert_eq!(r["shortOn"], json!(["B.Cu"]));
package.json+1−1
@@ -1,6 +1,6 @@ {   "slug": "eda-bridge-standard",-  "version": "0.4.4",+  "version": "0.4.5",   "type": "skill",   "title": "EDA Bridge Standard: one way for an AI to drive every PCB tool",   "description": "The standard every Adom EDA bridge follows so one AI can drive Altium, KiCad, Fusion 360 and any future PCB tool the same way: shared verb names in tiers, the board model JSON, reply and refusal conventions, and a coverage table of each bridge against the Altium reference.",
verbs/coverage.json+1−1
@@ -1,5 +1,5 @@ {- "standard": "0.4.4",+ "standard": "0.4.5",  "reference": {   "bridge": "altium",   "version": "0.2.76"
verbs/standard.json+1−1
@@ -1,5 +1,5 @@ {- "standard": "0.4.4",+ "standard": "0.4.5",  "reference": {   "bridge": "altium",   "version": "0.2.76"