AnasSarkiz/pedometer
A four-layer Bluetooth pedometer PCB built around a bare TI CC2340R5 MCU, 48 MHz/32.768 kHz clocks, 2.4 GHz antenna matching network, battery charger/fuel gauge, accelerometer, regulator, USB‑C, OLED/SWD connectors, and supporting passives/protection.
- Version
- 1.1.3
- License
- unset
- Stars
- 0
scripts/render-schematics.ts
import fs from "node:fs";
import { convertCircuitJsonToSchematicSvg } from "circuit-to-svg";
import { Resvg } from "@resvg/resvg-js";
const c=JSON.parse(fs.readFileSync("dist/index/circuit.json","utf8"));
fs.mkdirSync("review",{recursive:true});
for(const sheet of c.filter((x:any)=>x.type==="schematic_sheet")){
const file=`review/schematic-${sheet.sheet_index+1}-${sheet.name}`;
const svg=convertCircuitJsonToSchematicSvg(c,{schematicSheetId:sheet.schematic_sheet_id,width:1800,height:1273});
fs.writeFileSync(file+".svg",svg);
fs.writeFileSync(file+".png",new Resvg(svg).render().asPng());
console.log(file);
}