AnasSarkiz/muse-voice-remote

Muse Voice Remote — bare ESP32-S3R8, 155 TOP JLCPCB parts with real supplier CAD, native 3D assembly and GLB exports. Revised 17 mm case allocation; 0.30 mm via drill /0.45 mm pad. Checked prototype PCB; mechanical, RF and MUSE qualification pending.

Version
1.3.2
License
unset
Stars
0

scripts/try-one-net.py

#!/usr/bin/env python3
"""Diagnose and retain one native branch only after independent connectivity improves."""
import pathlib,sys,json,collections,os,re
helper=pathlib.Path(__file__).with_name('finish-unrouted.py');api={'__file__':str(helper)};exec(helper.read_text().split('\n# A FreeRouting pattern')[0],api)
net=sys.argv[1];path=api['path'];before=path.read_bytes();old=api['check']();b=api['pcbnew'].LoadBoard(str(path));fs=list(b.GetFootprints());items={i.m_Uuid.AsString():i for i in list(b.GetTracks())+[p for f in fs for p in f.Pads()]}
pair=next(r for r in old['unconnected_items'] if items[r['items'][0]['uuid']].GetNetname()==net);a,z=[items[x['uuid']] for x in pair['items']]
api['step']=.125
result=api['route'](b,a,z);api['pcbnew'].SaveBoard(str(path),b);after=api['check']()
def counts(r):return dict(collections.Counter(re.search(r'\[([^]]+)\]',p['items'][0]['description']).group(1) for p in r['unconnected_items']))
print('Before:',counts(old),'After:',counts(after),flush=True)
(api['root']/f'dist/branch-trial-{net}.json').write_text(json.dumps(after,indent=2)+'\n')
if len(after['unconnected_items'])>=len(old['unconnected_items']) or any(v['type'] not in ['via_dangling','track_dangling'] for v in after['violations']):path.write_bytes(before);print('Restored previous board',flush=True);os._exit(1)
print('Accepted',net,result,flush=True);os._exit(0)