main
John Lauer Verify top-access cooler mount and reconcile current BOM with internal inventory pricing ae78bc0
"""Local manufacturer fin check for the candidate top-entry retention path."""
from pathlib import Path
import json,hashlib
import cadquery as cq
from step_geometry import load_step
R=Path(__file__).resolve().parents[1];O=R/'mechanical/passive-assembly-study'
p=O/'vendor-125319-3inch-local-only.step';sink=load_step(p)
review=json.loads((O/'carrier-top-access-review.json').read_text());rows=[];machined=sink
for x,y in review['retentionHolesXYmm']:
 # Full head-diameter sweep above the catalog base, without altering vendor fins.
 # Small epsilon avoids coincident-face boolean ambiguity at the base plane.
 approach=cq.Solid.makeCylinder(2.75,90,cq.Vector(x,y,14.362001))
 v=sink.intersect(approach).Volume()
 # Explicit proposed machining, never treat stock-fin interference as a pass.
 bore=cq.Solid.makeCylinder(1.6,8,cq.Vector(x,y,7.0))
 before=machined.Volume();machined=machined.cut(bore)
 rows.append({'xyMm':[x,y],'headAndToolRadiusMm':2.75,'approachStartZmm':14.362001,'stockVendorFinOverlapMm3':v,'proposedBaseHoleDiameterMm':3.2,'removedVolumeMm3':before-machined.Volume(),'afterProposedMachiningOverlapMm3':machined.intersect(approach).Volume()})
 print(rows[-1],flush=True)
assert machined.isValid();cq.exporters.export(machined,str(O/'vendor-125319-machined-local-only.step'))
d={'status':'proposed-machining-study-not-stock-fit-or-fabrication-release','vendorCutSha256':hashlib.sha256(p.read_bytes()).hexdigest(),'carrierReviewSha256':hashlib.sha256((O/'carrier-top-access-review.json').read_bytes()).hexdigest(),'rows':rows,'validMachinedSolid':machined.isValid(),'removedTotalVolumeMm3':sink.Volume()-machined.Volume(),'limitations':['Exact nominal CAD intersections only; no tolerance, driver handle, machining fixture or physical service qualification.','Three clearance bores are explicitly proposed. Centered head/tool sweeps already clear unmodified stock fins; no fin-root relief is required by this nominal check. Source file is never modified.','The head-diameter sweep assumes a straight driver whose envelope fits within5.5mm; actual tool must be selected.','Local vendor CAD derivative is not redistributed.','Machining effort, burrs, dimensional tolerances, cost and effect on cooling are not qualified.']}
(O/'top-access-fin-review.json').write_text(json.dumps(d,indent=2)+'\n')