abse/museair-usb

USB-C–powered ESP32-C3 controller board with AP63203 buck conversion, AP2112K 3.3V regulation, I²C SEN62 sensor interface, status LED, buttons, UART/I²C headers, and extensive decoupling.

Version
0.5.7
License
unset
Stars
0

scripts/apply-lightpipe-routing.mjs

// Local detour around the two Bivar mounting-pin drills. Preserve terminals,
// layer transitions, widths and the rest of the reviewed speaker routing.
export function repairLightPipeRouting(records){
 if(!records.some(x=>x.type==='pcb_hole'&&Math.hypot(x.x-20.532,x.y-12.2728)<1e-6))return []
 const repairs=[]
 for(const [id,xx,turnY,endX,endY] of [['source_net_35_0',19.2,13.8,21.5,14.8],['source_net_34_0',19.6,13.5,21.9,14.5]]){
  const t=records.find(x=>x.type==='pcb_trace'&&x.pcb_trace_id===id)
  if(!t||t.route[3]?.layer!=='bottom'||t.route[4]?.layer!=='bottom'||Math.abs(t.route[4].x-(id==='source_net_35_0'?21.5:21.9))>1e-6)throw Error('Speaker routing changed; review light-pipe detour')
  const p={route_type:'wire',width:.2,layer:'bottom'}
  t.route.splice(4,0,{...p,x:xx,y:10},{...p,x:xx,y:turnY},{...p,x:endX,y:endY});repairs.push({trace:id,repair:'Bottom-layer detour clear of light-pipe NPTH; terminals and width preserved'})
 }
 return repairs
}