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/reframe-optics-pcb.py
from pathlib import Path
import base64,json,sys
import numpy as np
import trimesh
root=Path(__file__).resolve().parent.parent
source=root/(sys.argv[1] if len(sys.argv)>1 else 'mechanical/final-folded-pcb.glb')
out=sys.argv[2] if len(sys.argv)>2 else 'upright-pcb'
T=np.array([[-1,0,0,0],[0,0,-1,-47.19159126281738],[0,-1,0,-7.4],[0,0,0,1]])
src=trimesh.load(source,force='scene');scene=trimesh.Scene()
for node in src.graph.nodes_geometry:
M,key=src.graph[node];mesh=src.geometry[key].copy();mesh.apply_transform(T@M)
mesh.merge_vertices(merge_tex=False,merge_norm=False)
scene.add_geometry(mesh,geom_name=node,node_name=node)
data=scene.export(file_type='glb');(root/f'mechanical/{out}.glb').write_bytes(data)
(root/f'mechanical/{out}.ts').write_text('export default "data:model/gltf-binary;base64,'+base64.b64encode(data).decode()+'"\n')
for prefix in ['U14','J3','J4','J7','J8']:
verts=np.vstack([m.vertices for n,m in scene.geometry.items() if n==prefix or n.startswith(prefix+'_')])
print(prefix,verts.min(0).round(5).tolist(),verts.max(0).round(5).tolist())
print('Reframed bounds:',scene.bounds.tolist())