const L = (await eda.pcb_PrimitiveLine.getAll()).filter(o=>o.net==='USB1_DP' && o.layer===1); const V = (await eda.pcb_PrimitiveVia.getAll()).filter(o=>o.net==='USB1_DP'); const L2 = (await eda.pcb_PrimitiveLine.getAll()).filter(o=>o.net==='USB1_DP' && o.layer===2); // segments on layer 2 whose endpoint is near the J17 via const near = L2.filter(o=>Math.hypot(o.startX-613.598,o.startY-297.609)<2 || Math.hypot(o.endX-613.598,o.endY-297.609)<2); return {l1: L.map(o=>[o.startX,o.startY,o.endX,o.endY,o.lineWidth]), vias: V.map(o=>[o.x,o.y,o.holeD,o.diameter]), nearVia: near.map(o=>[o.startX,o.startY,o.endX,o.endY])};