main
John Lauer
Update Board31 digital twin with verified fan state rendering
7359da9
"""Place the incomplete nominal finned heatsink in the established assembly frame."""
from pathlib import Path
import json,hashlib
from step_geometry import load_step
from glb_shape_helpers import add_shape,write_glb
R=Path(__file__).resolve().parents[1];O=R/'mechanical/board31-review';O.mkdir(exist_ok=True)
src=R/'components/680-125220/680-125220-nominal.step';shape=load_step(src)
# Same placement as the existing scaffold-stack interface study; native board
# XY -> Adom MP1 origin, Y-up; PCB top is Z2.8mm in the molecule frame.
shape=shape.translate((138.636,67.118,7.25)).mirror('XZ').translate((-100,100,2.8))
g={'asset':{'version':'2.0','generator':'Adom nominal heatsink display placement'},'scene':0,'scenes':[{'nodes':[0]}],'nodes':[{'name':'Heatsink.680-125220.Incomplete.Nominal','children':[]}],'buffers':[{'byteLength':0}],'accessors':[]};blob=bytearray()
add_shape(g,blob,shape,'Heatsink.680-125220.Finned.Visual',(.10,.11,.12),0,'Nominal finned visual only. Lead relief omitted; fin geometry inferred. No airflow or manufacturing qualification.')
write_glb(O/'heatsink-installed-nominal.glb',g,blob)
b=shape.BoundingBox();report={'source':str(src.relative_to(R)),'sourceSha256':hashlib.sha256(src.read_bytes()).hexdigest(),'boundsMm':[b.xmin,b.ymin,b.zmin,b.xmax,b.ymax,b.zmax],'placementSource':'tools/scaffold_stack/interface.py','boardTopZmm':2.8,'sinkBottomAboveBoardMm':7.25,'assumedContactStack':'Q1 nominal tab6.575mm +0.635mm AlN +2x0.020mm grease','limits':['Visualization replaces clearance box only; conservative clearance studies are retained.','Fin thickness/spacing inferred and lead relief omitted; not manufacturer CAD.','Contact-area, airflow, preload and physical qualification remain open.']};(O/'heatsink-placement.json').write_text(json.dumps(report,indent=2)+'\n');print(json.dumps(report))