main
John Lauer
Document silkscreen export warning isolation and prepare narrated results review
46fcaab
"""Read-only CAD validity audit. Valid solids do not prove export completeness."""
from pathlib import Path
import hashlib,json,time
from step_geometry import load_step
R=Path(__file__).resolve().parents[1]
p=R/'mechanical/board32-review/board32-mechanical.step'
started=time.monotonic();shape=load_step(p);solids=shape.Solids();bad=[]
for i,s in enumerate(solids):
if not s.isValid():
b=s.BoundingBox();bad.append({'solidIndex':i,'bounds':[b.xmin,b.ymin,b.zmin,b.xmax,b.ymax,b.zmax]})
report={'stepSha256':hashlib.sha256(p.read_bytes()).hexdigest(),'solidCount':len(solids),'invalidSolids':bad,'durationSeconds':time.monotonic()-started,'scope':'Imported BREP solid validity only; missing export geometry, native wire warnings and tolerance fidelity remain separate. No acceptance gate changed.'}
(R/'mechanical/board32-review/solid-validity.json').write_text(json.dumps(report,indent=2)+'\n');print(json.dumps(report))