abse/smartwatch-flex-top-only
Three-panel flex smartwatch with two parallel R3.9 bends, all components flat-top, low-profile JST connector harnesses, split heartbeat optical windows and screw-retained PCB mounting. Modeled 39 × 50.5 × 14.5mm prototype; 100% routing, zero native DRC and shorts. Hardware qualification pending.
- Version
- 0.2.20
- License
- unset
- Stars
- 0
scripts/export-mount-fit-sample.py
"""Crop real mounting solids into a small, separately printed fit-test set."""
from pathlib import Path
import hashlib, json
import trimesh
from mount_mesh_utils import printable_mesh
root = Path(__file__).resolve().parent.parent
def box(bounds):
lo, hi = bounds
return trimesh.creation.box(
extents=[b-a for a,b in zip(lo,hi)],
transform=trimesh.transformations.translation_matrix([(a+b)/2 for a,b in zip(lo,hi)]))
region = box([[14.8,-22.7,-10], [18.7,-15.4,2.1]])
outputs = []
for source, target in [
('mounted-enclosure.stl','mount-fit-case-post.stl'),
('pcb-mounting-cradle.stl','mount-fit-cradle-corner.stl'),
('retainer-front-right.stl','mount-fit-retainer.stl'),
]:
mesh = trimesh.load(root/'mechanical'/source)
mesh.merge_vertices(merge_tex=True,merge_norm=True)
cropped = trimesh.boolean.intersection([mesh,region],engine='manifold')
assert cropped.is_volume and cropped.body_count == 1, target
# Common translation preserves assembled alignment; slicers may place each
# part on their bed separately. These are samples, never assembly assets.
cropped.apply_translation([-16.5,20.5,9.42])
path = 'mechanical/'+target
cropped=printable_mesh(cropped)
cropped.export(root/path)
emitted=trimesh.load(root/path);assert emitted.is_volume and emitted.body_count==1,target
outputs.append({'file':path,'watertight':True,'solidCount':1,
'sha256':hashlib.sha256((root/path).read_bytes()).hexdigest()})
report = {'status':'PASS','version':'0.2.10','files':outputs,
'sourceRegionMM':[[14.8,-22.7,-10],[18.7,-15.4,2.1]],
'assemblyTranslationMM':[-16.5,20.5,9.42],
'instructions':'Print separately. Finish the 1.3mm pilot and tap M1.6 x 0.35; finish the 1.9mm clearance bore and countersink. Use a purchased M1.6 x 6 countersunk screw. Check fit with an actual 0.65mm PCB/stiffener sample; do not substitute a printed gauge for measured PCB thickness. Reject cracking, stripped threads, rocking or excessive force.',
'qualification':'Geometry-derived test coupon; printing, thread strength and fit have not been physically tested.'}
(root/'reports/mount-fit-sample.json').write_text(json.dumps(report,indent=2)+'\n')
print(json.dumps(report,indent=2))