const NETS = ['+5V','+3V3','+3V3_HUB']; const out = {}; for (const n of NETS) out[n] = []; const comps = {}; for (const c of await eda.pcb_PrimitiveComponent.getAll()) comps[c.getState_PrimitiveId()] = c.getState_Designator(); for (const p of await eda.pcb_PrimitivePad.getAll()) { const n = p.getState_Net(); if (!NETS.includes(n)) continue; let des='?'; try { const pid=p.getState_ParentComponentPrimitiveId(); if(pid) des = comps[pid]||'?'; } catch(e){} out[n].push([des, p.getState_PadNumber(), Math.round(p.getState_X()/39.3701*100)/100, Math.round(p.getState_Y()/39.3701*100)/100]); } const sum = {}; for (const n of NETS) { const a = out[n]; const xs=a.map(v=>v[2]), ys=a.map(v=>v[3]); sum[n] = {n:a.length, x:[Math.min(...xs),Math.max(...xs)], y:[Math.min(...ys),Math.max(...ys)]}; } return {sum, pads: out};