Devesh36/key-finder

A compact BLE key finder for keys, bags and remotes: replaceable CR2032, piezo alert, status LED and pair button in a 38 mm black keyring enclosure. Includes routed PCB, enclosed/exploded assembly and BOM. Firmware/app and physical qualification remain separate.

Version
0.1.2
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())
}
const svg=convertCircuitJsonToSchematicSvg(circuit)
writeFileSync('dist/index/schematic.svg',svg)
writeFileSync('dist/index/schematic.png',new Resvg(svg,{fitTo:{mode:'width',value:2400}}).render().asPng())