const L = (await eda.pcb_PrimitiveLine.getAll()).filter(o=>o.net==='USB1_DP'); const V = (await eda.pcb_PrimitiveVia.getAll()).filter(o=>o.net==='USB1_DP'); let xs=[], ys=[], w=new Set(), lay={}; let tot=0; for (const o of L){ xs.push(o.startX,o.endX); ys.push(o.startY,o.endY); w.add(o.lineWidth); lay[o.layer]=(lay[o.layer]||0)+1; tot += Math.hypot(o.endX-o.startX, o.endY-o.startY); } return {n:L.length, bbox:[Math.min(...xs),Math.min(...ys),Math.max(...xs),Math.max(...ys)], widths:[...w], layers:lay, lenMil: Math.round(tot), lenMM: Math.round(tot/39.3701), vias: V.map(v=>[v.x,v.y]), first: L.slice(0,3).map(o=>[o.startX,o.startY,o.endX,o.endY,o.layer])};