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
components/PcbMounts.tsx
import React from 'react'
import {assembly} from 'tscircuit'
import enclosure from '../mechanical/case-body'
import bezel from '../mechanical/case-bezel'
import bondline from '../mechanical/bezel-bondline'
import cradle from '../mechanical/pcb-cradle'
import leftRetainer from '../mechanical/retainer-front-left'
import rightRetainer from '../mechanical/retainer-front-right'
import screw from '../mechanical/m1-6x6-iso7046'
import hardware from '../mechanical/mount-hardware.json'
type Pose={positionOffset?:{x:number;y:number;z:number};rotationOffset?:{x:number;y:number;z:number}}
const origin={modelOriginPosition:{x:0,y:0,z:0}}
/** Actual printable case/post union and separate purchased fasteners. */
export function PcbMounts({pose={},bezelFitted=true,transparentShell=false}:{pose?:Pose;bezelFitted?:boolean;transparentShell?:boolean}){
const rotated=(x:number,y:number,z:number)=>{
// The native enclosure-fit view uses only a 180-degree rotation about X.
const rotation=pose.rotationOffset
if(rotation&&(rotation.x!==180||rotation.y!==0||rotation.z!==0))throw Error('Unsupported mount frame')
const p=pose.positionOffset??{x:0,y:0,z:0}
return {x:p.x+x,y:p.y+(rotation?-y:y),z:p.z+(rotation?-z:z)}
}
return <>
<assembly.printedpart name="ENCLOSURE_WITH_INTEGRATED_PCB_POSTS" displayName="Printed case with four integral PCB posts" cadModel={{glbUrl:enclosure,...origin,...pose,showAsTranslucentModel:transparentShell}}/>
{bezelFitted&&<assembly.printedpart name="REMOVABLE_TOP_BEZEL" displayName="Fit top bezel after PCB screws; preserve original exterior" cadModel={{glbUrl:bezel,...origin,...pose,showAsTranslucentModel:transparentShell}}/>}
{bezelFitted&&<assembly.part name="BEZEL_ADHESIVE_BONDLINE_RESERVATION" displayName="0.1mm bezel bondline; qualify adhesive for printed material" cadModel={{glbUrl:bondline,...origin,...pose}}/>}
<assembly.printedpart name="REMOVABLE_PCB_MOUNTING_CRADLE" displayName="Printed PCB cradle with rear retaining roofs" cadModel={{glbUrl:cradle,...origin,...pose}}/>
<assembly.printedpart name="FRONT_LEFT_PCB_RETAINER" displayName="Printed left front retaining arm" cadModel={{glbUrl:leftRetainer,...origin,...pose}}/>
<assembly.printedpart name="FRONT_RIGHT_PCB_RETAINER" displayName="Printed right front retaining arm" cadModel={{glbUrl:rightRetainer,...origin,...pose}}/>
{hardware.mounts.map(m=><assembly.part key={m.name} name={m.name} displayName="Purchased ISO7046 M1.6 × 6, Phillips PH0" cadModel={{glbUrl:screw,...origin,positionOffset:rotated(m.x,m.y,hardware.headTopZMM),rotationOffset:pose.rotationOffset}}/>)}
</>
}