main
John Lauer Document released fan assets, live board pin mapping and remaining cooling checks 0dc7a50
"""Conservative nominal mount screen; no board edits or fabrication release."""
from pathlib import Path
import json,math,hashlib
import sexp
P=Path(__file__).resolve().parents[1];a=json.loads((P/'mechanical/cooling-body-audit.json').read_text());board=P/'kicad/adom-custom-electronic-load.kicad_pcb';assert hashlib.sha256(board.read_bytes()).hexdigest()==a['boardSha256']
# 50 mm sink, mounting holes 43 mm apart; top-left corner revised away from USB/Q4.
sink=[110,31.5,160,81.5];holes=[(113.5,35),(156.5,35),(113.5,78),(156.5,78)];hardware_radius=3.0
rows=[]
for x,y in holes:
 nearby=[]
 for r in a['rows']:
  b=r.get('boundsMm')
  if not b or b[5]<0:continue
  distance=math.hypot(max(b[0]-x,0,x-b[3]),max(b[1]-y,0,y-b[4]))
  if distance<5:nearby.append({'ref':r['ref'],'bodyDistanceMm':distance,'radialClearanceMm':distance-hardware_radius})
 rows.append({'x':x,'y':y,'nearbyBodies':nearby})
b=sexp.parse(board.read_text());probe=[]
for f in sexp.find(b,'footprint'):
 props={v[1]:v[2]for v in sexp.find(f,'property')};ref=props['Reference']
 if not ref.startswith('TP'):continue
 x,y=map(float,sexp.first(f,'at')[1:3]);dist=math.hypot(max(sink[0]-x,0,x-sink[2]),max(sink[1]-y,0,y-sink[3]));probe.append({'ref':ref,'x':x,'y':y,'distanceToSinkMm':dist,'conflictAt2mm':dist<2})
result={'boardSha256':a['boardSha256'],'status':'nominal-envelope-candidate-only','sinkXY':sink,'holePitchMm':43,'holeCenters':rows,'assumedHardwareRadiusMm':hardware_radius,'bodyConflicts':[{'hole':[r['x'],r['y']],**n}for r in rows for n in r['nearbyBodies']if n['radialClearanceMm']<0],'probeChecks':probe,'probeConflicts':[r['ref']for r in probe if r['conflictAt2mm']],'limitations':['Mount holes are NOT on PCB','Hardware type, insulation, spring preload and head diameter not selected','Copper routing/zone clearance around new holes not checked','Fan plenum, guard, wires, mating plugs and clamp tooling not included','TIM material/contact resistance and exact MOSFET tab contact unresolved']};(P/'mechanical/cooling-mount-screen.json').write_text(json.dumps(result,indent=2)+'\n');print(json.dumps({k:v for k,v in result.items()if k not in ['probeChecks','holeCenters']},indent=2))