gokul/flex-led-wristband

A flexible, rechargeable touch wristband PCB with MCP73831 Li-ion charging, switched 3.0 V regulation, ATtiny402 control, TTP223 capacitive touch sensing, and six charlieplexed red LEDs plus power/charge indicators.

Version
0.0.3
License
unset
Stars
0

scripts/render.ts

import { convertCircuitJsonToPcbSvg } from "circuit-to-svg"
import { readFileSync, writeFileSync, existsSync } from "node:fs"
import { Resvg } from "@resvg/resvg-js"
writeFileSync("dist/index/pcb-bottom.svg",convertCircuitJsonToPcbSvg(JSON.parse(readFileSync("dist/index/circuit.json","utf8")),{layer:"bottom",width:1800,height:800}))
for (const file of ["dist/index/pcb", "dist/index/pcb-bottom", "dist/index/schematic", "dist/gerber-top", "dist/gerber-bottom", "dist/assembly"]) {
  if (!existsSync(`${file}.svg`)) continue
  const renderer = new Resvg(readFileSync(`${file}.svg`), { fitTo: { mode: "width", value: file.endsWith("schematic") ? 2400 : 1800 } })
  writeFileSync(`${file}.png`, renderer.render().asPng())
}