main
John Lauer Preserve board29, component assets and scaffold-fit correction candidate with reviewed footage c54169e
import json
from pathlib import Path
P=Path(__file__).resolve().parents[1];d=json.loads((P/'design/netlist.json').read_text());w={}
anchors={'Q1':(130,82,180),'RSH1':(138,85,0),'D1':(114,91,0),'F1':(108,91,0),'U1':(143,47,0),'U2':(118,66,0),'U3':(129,87,0),'U4':(141,77,0),'U5':(145,89,0),'U6':(129,45,0),'U7':(111,49,0),'U8':(128,52,0),'U9':(148,65,0),'U10':(151,50,0),'J8':(158,43,270),'L1':(144,96,0),'D4':(153,93,0),'J9':(154,75,90),'J10':(104,73,90),'J11':(155,59,0),'Q2':(124,85,0),'Q3':(121,82,0),'Q4':(118,77,0)}
for r,(x,y,rot) in anchors.items():w[r]={'x':x,'y':y,'rot':[rot],'radius':2,'gap':0.35}
blocks={'power':(133,82),'servo':(118,71),'telemetry':(144,82),'protection':(112,57),'auxiliary':(150,87),'digital':(143,58),'control':(132,58),'probe':(104,80)}
count={}
for c in d['components']:
 r=c['ref']
 if 'fixed'in c or r in w:continue
 b=c['block'];x,y=blocks[b];n=count.get(b,0);count[b]=n+1
 w[r]={'x':x+(n%4)*2.8,'y':y+(n//4)*2.6,'rot':[0,90,180,270],'radius':5,'gap':0.25}
# Decoupling follows the actual IC rather than the schematic's generic control block.
for r,xy in {'C11':(139,43),'C12':(115,63),'C13':(130,89),'C14':(140,74),'C15':(144,89),'C16':(127,43),'C17':(112,44),'C18':(126,50),'C10':(115,66),'C2':(129,84),'R11':(133,86),'R7':(129,83)}.items():w[r].update(x=xy[0],y=xy[1],radius=3)
(P/'design/placement-wish.json').write_text(json.dumps([dict(ref=r,**w[r]) for r in ['Q1','J8','L1']+ [r for r in w if r not in ['Q1','J8','L1']]],indent=2))