Devesh36/orbit-turntable
ORBIT is a USB-C-powered display turntable for photographing jewellery, models and small products. Four-layer ESP32-C3 / ULN2003 PCB, geared stepper, OLED, push encoder, home switch and buzzer, with an enclosed and exploded assembly. Hardware prototype; firmware and physical qualification remain separate.
- Version
- 0.1.1
- License
- unset
- Stars
- 0
scripts/preview.ts
import {readFileSync,writeFileSync} from 'node:fs'
import {convertCircuitJsonToPcbSvg,convertCircuitJsonToSchematicSvg} from 'circuit-to-svg'
import {Resvg} from '@resvg/resvg-js'
const circuit=JSON.parse(readFileSync('dist/index/circuit.json','utf8'))
for(const layer of ['top','bottom','inner1','inner2'] as const){
const svg=convertCircuitJsonToPcbSvg(circuit,{layer,width:1400,height:1400})
writeFileSync(`dist/index/pcb-${layer}.svg`,svg)
writeFileSync(`dist/index/pcb-${layer}.png`,new Resvg(svg).render().asPng())
}
for(const [index,name] of ['power','mcu','motor','display','controls'].entries()){
const svg=convertCircuitJsonToSchematicSvg(circuit,{schematicSheetIndex:index})
const png=new Resvg(svg,{fitTo:{mode:'width',value:2400}}).render().asPng()
writeFileSync(`dist/index/schematic-${name}.svg`,svg)
writeFileSync(`dist/index/schematic-${name}.png`,png)
if(index===0){writeFileSync('dist/index/schematic.svg',svg);writeFileSync('dist/index/schematic.png',png)}
}
