muse/book-reading-clip-lamp

A 60‑mm ESP32‑S3 lamp-head PCB combining USB‑C battery charging/power regulation, OV5640 autofocus camera interfacing, I²S microphone and differential speaker audio, six‑LED boost-driven reading light, buttons, status indicators, and battery monitoring.

Version
0.2.5
License
unset
Stars
0

capture-routing.cjs

SchematicSchematic preview for capture-routing.cjs
const fs=require('node:fs');
const path=require('node:path');
const dir=path.join(__dirname,'dist','autorouter-debug');
const files=[['phase-0.input.simple-route.json','saved-routing-input.json'],['phase-0.output.traces.json','saved-routing-traces.json'],['board.meta.json','saved-routing-provenance.json']];
for(const [from] of files) JSON.parse(fs.readFileSync(path.join(dir,from),'utf8'));
for(const [from,to] of files) fs.copyFileSync(path.join(dir,from),path.join(__dirname,to));
const circuit=JSON.parse(fs.readFileSync(path.join(__dirname,'dist','reroute','circuit.json'),'utf8'));
const holes=circuit.filter(e=>e.type==='pcb_hole').map(h=>{
 if(h.hole_shape!=='circle') throw new Error('Extend hole capture for non-circular drills before replay');
 return {obstacleId:h.pcb_hole_id,x:h.x,y:h.y,width:h.hole_diameter,height:h.hole_diameter};
});
fs.writeFileSync(path.join(__dirname,'saved-routing-holes.json'),JSON.stringify(holes,null,2)+'\n');
fs.writeFileSync(path.join(__dirname,'routing-corrections.json'),'[]\n');
fs.writeFileSync(path.join(__dirname,'routing-replacements.json'),'[]\n');
const provenance=JSON.parse(fs.readFileSync(path.join(__dirname,'saved-routing-provenance.json'),'utf8'));
provenance.routingProfile={source:'fresh-routing.ts',pipeline:'AutoroutingPipelineSolver9_PreloadedTraceGraph',simplification:[],iterations:0,description:'Omit optional trace/via simplification; retain normal topology, routing, repair, trace-width and core validation phases'};
fs.writeFileSync(path.join(__dirname,'saved-routing-provenance.json'),JSON.stringify(provenance,null,2)+'\n');
console.log('Captured routing source and reset old via corrections and route replacements. Inspect routes, fix every reported error/short, then rebuild and run checks. This command does not approve fabrication.');