main
John Lauer
Publish input-bound R11 prototype bundle and completed CLI clearance review
7007e93
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
"""User-authorized prototype geometry. No manufacturer or hardware qualification implied."""
from pathlib import Path
import json,shutil,hashlib
import cadquery as cq
from glb_shape_helpers import read_glb,write_glb,add_shape
R=Path(__file__).resolve().parents[1];D=R/'revisions/compact-r11';O=D/'assumed-assembly';O.mkdir(exist_ok=True)
g,b=read_glb(D/'kicad/sidefan-v5-molecule.plain.glb');root=len(g['nodes']);g['nodes'].append({'name':'ASSUMED prototype cooling assembly','children':[]});g['scenes'][g.get('scene',0)]['nodes'].append(root);parts=[];assembly=cq.Assembly()
def box(x,y,z,a,c,d):return cq.Workplane('XY').box(a,c,d,centered=False).translate((x,y,z)).val()
def add(name,s,color,assumption):
if name in ['Duct_roof','Fan_upper_transition']:
for ny in [27.5,60.5]:s=s.cut(box(61.3,ny-2.95,46.55,3.4,5.9,5.9))
if name=='Fan_lower_transition':
s=s.cut(cq.Solid.makeCylinder(4.2,5.2,cq.Vector(61,66.5,8.845)))
s=s.cut(box(63.8,36.3,8.645,8,4.4,.455))
if name=='Carrier_ear_support_rear':s=s.cut(box(64.47,52.8,4.645,7.73,4.87,.46)) # USB shell plus0.2mm clearance
if name=='Duct_capture_lip_62':s=s.cut(box(56.8,61.8,7.145,4,4,2))
if name=='Fan_mount_flange':s=s.cut(cq.Solid.makeCylinder(2.95,2.4,cq.Vector(61,66.5,11.645)))
if name.startswith(('ATS_sink','Sink_ear','Fan_swept','Duct_','Fan_lower','Fan_upper','Fan_mount','Fan_screw','Fan_nut')):s=s.translate((0,-7,0))
assert s.isValid(),name
assembly.add(s,name=name,color=cq.Color(*color));bb=s.BoundingBox();parts.append({'name':name,'boundsMm':[bb.xmin,bb.ymin,bb.zmin,bb.xmax,bb.ymax,bb.zmax],'volumeMm3':s.Volume(),'assumption':assumption});add_shape(g,b,s.translate((-4,-4,4.005)),name,color,root,assumption)
# Q1 tab 8.170 mm; .635 mm ceramic plus .040 mm combined contact layers.
add('AlN_interface_assumed',box(25.46,24.66,8.190,12,18,.635).cut(cq.Solid.makeCylinder(1.7,2,cq.Vector(31.46,38.66,8))),(.85,.87,.91),'12x18x0.635 mm AlN, 170 W/mK assumed; two grease layers total40um. Exact part not selected.')
sink=box(18.5,24,8.845,40,40,3)
for i in range(10):sink=sink.fuse(box(18.5,24.5+4*i,11.845,40,1,32))
sink=sink.cut(cq.Solid.makeCylinder(1.25,2,cq.Vector(31.46,45.66,8.845)))
# Manufacturer specifies diagonal mounting centers45x45; ear profile assumed radius4.
for ex,ey in [(16,21.5),(61,66.5)]:
ear=cq.Solid.makeCylinder(4,3,cq.Vector(ex,ey,8.845)).cut(cq.Solid.makeCylinder(1.6,3,cq.Vector(ex,ey,8.845)))
add(f'Sink_ear_envelope_{ex}_{ey}',ear,(.52,.6,.67),'45x45mm catalog mounting centers; assumed8mm ear diameter and3mm thickness. Outer profile and clocking unverified.')
add('ATS_sink_assumed_detail',sink,(.52,.6,.67),'Outer40x40x35mm catalog; assumed3mm base, ten1mm fins,4mm pitch; blind M3 pilot2mm for study, not machining instruction.')
# The full fan swept volume remains conservative for probe clearance.
add('Fan_swept_envelope',box(66,24,13,10.6,40,40),(.12,.42,.40),'CFM-4010-03-22 outer envelope; rotor interior not resolved in this clearance model.')
for y in [22.5,64]:
wall=box(20.5,y,8.845,44,1.5,35)
for ex,ey in [(16,21.5),(61,66.5)]:wall=wall.cut(cq.Solid.makeCylinder(4.2,5.2,cq.Vector(ex,ey,8.845)))
wall=wall.cut(cq.Solid.makeCylinder(1.1,5,cq.Vector(62.5,y-1,30),cq.Vector(0,1,0)))
add('Duct_wall_'+str(y),wall,(.18,.25,.33),'1.5mm side walls prevent lateral bypass; polymer selection and retention pending.')
add('Duct_roof',box(20.5,22.5,43.845,44,43,1.5),(.18,.25,.33),'1.5mm roof; outlet at X20.5 open. Fan square mismatch requires transition.')
add('Fan_lower_transition',box(60.5,24,8.845,4,40,4.155).cut(cq.Solid.makeCylinder(4.2,3.2,cq.Vector(61,66.5,8.845))),(.18,.25,.33),'Lower fan bypass seal; assumed1mm transition depth.')
add('Fan_upper_transition',box(60.5,24,45.345,4,40,7.655),(.18,.25,.33),'Upper fan bypass seal; fan hub pressure distribution unmodeled.')
# Fastener at Q1 tab extension, isolated shoulder washer separates drain tab.
add('Q1_screw_envelope',cq.Solid.makeCylinder(2.75,2,cq.Vector(31.46,38.66,3.6)).fuse(cq.Solid.makeCylinder(1.5,5.3,cq.Vector(31.46,38.66,5.6))),(.55,.55,.58),'M3 head and shank envelope; exact engagement and clamp force unverified.')
add('Q1_shoulder_washer',cq.Solid.makeCylinder(3.1,1.3,cq.Vector(31.46,38.66,5.6)).cut(cq.Solid.makeCylinder(1.55,1.3,cq.Vector(31.46,38.66,5.6))),(.8,.72,.5),'Electrical isolation washer; exact dielectric material and dimensions are assumptions.')
add('Case_sensor_and_retainer',box(37.7,28,6.4,3,5,2),(.9,.45,.18),'Near-case sensor pocket; attachment and lag require measurement, not a calibrated reading.')
# Carrier transfers mass to large-pin corner attachment zones, not Q1 leads.
for y in [1,65]:
rail=box(-4,y,-3.4,80,6,3.2)
for cx in [4,68]:rail=rail.fuse(cq.Solid.makeCylinder(5,3.2,cq.Vector(cx,y+3,-3.4)))
for x,bolt_x in [(4,-1.5),(68,73.5)]:
rail=rail.cut(cq.Solid.makeCylinder(2.85,5,cq.Vector(x,y+3,-4)))
rail=rail.cut(box(-4 if x==4 else 68,y+2.7,-3.5,8,.6,3.5))
rail=rail.cut(cq.Solid.makeCylinder(.9,7,cq.Vector(bolt_x,y-.5,-1.8),cq.Vector(0,1,0)))
rail=rail.cut(box(bolt_x-1.7,y-1.4,-3.5,3.4,1.5,3.4))
bolt=cq.Solid.makeCylinder(.8,8,cq.Vector(bolt_x,y-1,-1.8),cq.Vector(0,1,0)).fuse(cq.Solid.makeCylinder(1.5,1.2,cq.Vector(bolt_x,y+6,-1.8),cq.Vector(0,1,0)))
add(f'Carrier_clamp_bolt_{x}_{y}',bolt,(.5,.5,.52),'M1.6 split-collar bolt envelope; clamp torque and fatigue are prototype assumptions.')
add(f'Carrier_clamp_nut_{x}_{y}',box(bolt_x-1.6,y-1.3,-3.4,3.2,1.3,3.2),(.5,.5,.52),'M1.6 captive nut envelope; verify actual nut and pin diameter before printing.')
add('Carrier_crossrail_'+str(y),rail,(.25,.31,.38),'Under-board split-collar rail,3.2mm thick,10mm outer collar diameter,5.7mm assumed bore:2.15mm nominal radial wall outside slit.0.2mm board gap; grip and tolerances unverified.')
spine=box(-4,1,-3.4,4,70,10.4)
for y in [1,65]:
spine=spine.cut(cq.Solid.makeCylinder(1.7,10,cq.Vector(-1.5,y-1.5,-1.8),cq.Vector(0,1,0)))
spine=spine.cut(box(-3.2,y-1.4,-3.5,3.4,1.5,3.4))
spine=max(spine.Solids(),key=lambda solid:solid.Volume())
add('Carrier_spine',spine,(.25,.31,.38),'External side spine transfers shelf loads to under-board rails; adds4mm to assembly width.')
for y in [54,60]:add('Carrier_sink_support_'+str(y),box(-4,y,4.845,27.5,5,4),(.25,.31,.38),'Shelf supports sink mass independently of leads; tolerance adjustment and retaining clip pending.')
right_spine=box(74,1,-3.4,2,70,10.4)
for y in [1,65]:
right_spine=right_spine.cut(cq.Solid.makeCylinder(1.7,10,cq.Vector(73.5,y-1.5,-1.8),cq.Vector(0,1,0)))
right_spine=right_spine.cut(box(71.8,y-1.4,-3.5,3.4,1.5,3.4))
right_spine=right_spine.cut(cq.Solid.makeCylinder(.85,4,cq.Vector(73,12,6.8),cq.Vector(1,0,0))) # sensor-wire groove,0.2mm nominal radial clearance
right_spine=max(right_spine.Solids(),key=lambda solid:solid.Volume())
add('Carrier_right_spine',right_spine,(.25,.31,.38),'External right spine supports front sink ear; same80mm carrier width.')
for name,shape,hx,hy in [('front',box(12,11,4.845,8,7,4).fuse(box(20,14.5,4.845,4,39.5,4)),16,14.5),('rear',box(57,53,4.845,19,10,4),61,59.5)]:
shape=shape.cut(cq.Solid.makeCylinder(1.25,4,cq.Vector(hx,hy,4.845)))
add('Carrier_ear_support_'+name,shape,(.25,.31,.38),'Assumed ear support and threaded pilot; insert choice, clamp force and material unqualified.')
screw=cq.Solid.makeCylinder(1.5,7,cq.Vector(hx,hy,4.845)).fuse(cq.Solid.makeCylinder(2.75,2,cq.Vector(hx,hy,11.845)))
add('Sink_retainer_'+name,screw,(.55,.55,.58),'M3 retention envelope; positive sink hold-down independent of Q1 leads. Thread/material qualification pending.')
# Assumed stamped 1.5 mm fan flange, independent of PCB leads.
flange=box(64.5,24,13,1.5,40,40).cut(cq.Solid.makeCylinder(18,2,cq.Vector(64.4,44,33),cq.Vector(1,0,0)))
for y in [27.5,60.5]:
for z in [16.5,49.5]:
flange=flange.cut(cq.Solid.makeCylinder(1.6,2,cq.Vector(64.4,y,z),cq.Vector(1,0,0)))
screw=cq.Solid.makeCylinder(1.5,15.1,cq.Vector(61.5,y,z),cq.Vector(1,0,0)).fuse(cq.Solid.makeCylinder(2.75,2,cq.Vector(76.6,y,z),cq.Vector(1,0,0)))
add(f'Fan_nut_{y}_{z}',box(61.5,y-2.75,z-2.75,3,5.5,5.5).cut(cq.Solid.makeCylinder(1.25,3,cq.Vector(61.5,y,z),cq.Vector(1,0,0))),(.55,.55,.58),'Assumed M3 captive nut3mm thickness; exact hardware and torque unqualified.')
add(f'Fan_screw_{y}_{z}',screw,(.55,.55,.58),'M3 fastener envelope; actual fan hole and retention method assumed. Head extends to X74.6mm.')
for y in [21,65.5]:
tab=box(60.5,y,13,5.5,1.5,40).fuse(box(64.5,22.5 if y==21 else 64,13,1.5,1.5,40))
tab=tab.cut(cq.Solid.makeCylinder(1.1,5,cq.Vector(62.5,y-1,30),cq.Vector(0,1,0)))
flange=flange.fuse(tab)
sy=21 if y==21 else 62
bolt=cq.Solid.makeCylinder(1,5,cq.Vector(62.5,sy,30),cq.Vector(0,1,0)).fuse(cq.Solid.makeCylinder(1.8,2,cq.Vector(62.5,19 if y==21 else 67,30),cq.Vector(0,1,0)))
add('Duct_flange_bolt_'+str(y),bolt,(.55,.55,.58),'M2 flange-to-duct bolt envelope; nuts and torque require exact hardware verification.')
nut=box(60.8,24 if y==21 else 62,28.3,3.4,2,3.4).cut(cq.Solid.makeCylinder(.85,2,cq.Vector(62.5,24 if y==21 else 62,30),cq.Vector(0,1,0)))
add('Duct_flange_nut_'+str(y),nut,(.55,.55,.58),'M2 nut simplified pilot; modeled positive flange retention.')
for y in [24,62]:add('Duct_capture_lip_'+str(y),box(40,y,7.345,20,2,1.3).fuse(box(40,22.5 if y==24 else 64,7.345,20,1.5,1.5)),(.18,.25,.33),'Sliding capture lip below sink base with0.2mm nominal gap; hot fit and material creep unverified.')
add('Fan_mount_flange',flange,(.5,.55,.6),'1.5mm aluminum flange,36mm circular opening,33mm mounting centers; no airflow proof.')
def cable(name,points):
for i,(a,c) in enumerate(zip(points,points[1:])):
v=cq.Vector(*c)-cq.Vector(*a);shape=cq.Solid.makeCylinder(.65,v.Length,cq.Vector(*a),v.normalized())
add(name+'_'+str(i),shape,(.6,.32,.16),'1.3mm wire clearance reservation; route vertices require bend-radius relief and strain relief in physical assembly.')
for i in range(4):
x=67.5+i*1.6;tx=65+i*1.6;wy=16
cable('Fan_harness_'+str(i),[(x,17,33),(x,wy,33),(x,wy,7.4),(tx,30,7.4)])
add('Fan_mating_plug_envelope',box(64,29.5,5.9,7.5,4,3),(.8,.8,.75),'Assumed GHR-04V-S mating envelope at J9; exact latch/insertion sweep not qualified.')
for i in range(2):
x=61.3+i*1.6;outer=77.5+i*1.6;y=25.5+i*3;front=12+i*2;rear=73+i*1.6;z=6.8+i*1.4
cable('Sensor_harness_'+str(i),[(39,29+i*2,7),(41,y,z),(x,y,z),(x,front,z),(outer,front,z),(outer,rear,z),(14,rear,z),(13.25,66.95+i*1.4,z)])
add('Sensor_mating_plug_envelope',box(10,65,5.9,6.5,4,3),(.8,.8,.75),'Assumed J10 mating plug envelope; actual latch and insertion sweep unqualified.')
out=O/'prototype-assembly.plain.glb';write_glb(out,g,b);assembly.save(str(O/'cooling-study.step'))
meta=D/'kicad/sidefan-v5-molecule_footprint.json';shutil.copy2(meta,O/'prototype-assembly_footprint.json')
(O/'assumptions.json').write_text(json.dumps({'status':'User-authorized assumption-based geometry study; not fabrication release','boardSha256':hashlib.sha256((D/'kicad/compact-sidefan-v5-native.kicad_pcb').read_bytes()).hexdigest(),'nativeToGlbMm':[-4,-4,4.005],'parts':parts,'open':['split-collar grip, pin diameter and clamp torque','fan fastener retention','connector insertion and strain relief','wire bend radii','interface contact/pressure','sink exact details']},indent=2)+'\n')
p=D/'probing-assumed-assembly/probing-flow';shutil.copytree(D/'probing-sidefan-v5-reservations/probing-flow',p,dirs_exist_ok=True)
s=json.loads((p/'state.json').read_text());s['probing']['glb']=str(O/'prototype-assembly.glb');s['reviewScope']='Assumed detailed assembly study; all explicit assumptions preserved';(p/'state.json').write_text(json.dumps(s,indent=2)+'\n')
wc=json.loads((p/'workcell.json').read_text());wc['gantry']['safe_z_mm']=27;wc['gantry']['assumed']=[x for x in wc['gantry']['assumed'] if not x.startswith('safe_z_mm:')];wc['gantry']['assumed'].append('safe_z_mm:27mm assumed travel height for retained cooler/harness; unchanged tether length and full replay required');(p/'workcell.json').write_text(json.dumps(wc,indent=2)+'\n')
# Preserve the reviewed fixture and test intent when regenerating geometry.
for custom,target in [('probe-plan.json','plan.json'),('probe-layout.json','layout.json')]:
if (O/custom).exists():shutil.copy2(O/custom,p/target)
for n in ['access','stack','sequence','collide','margins','coverage']:
(p/(n+'.json')).unlink(missing_ok=True);(p/(n+'.ok')).unlink(missing_ok=True)
print(out)