imrishabh18/rp2040-motor-controller
This circuit module provides a microcontroller-based NEMA17 stepper motor driver with integrated USB-C Power Delivery, temperature sensing, and safety interlocks.
- Version
- 1.0.14
- License
- unset
- Stars
- 0
scripts/render-pcb.ts
import { readFileSync, writeFileSync } from "node:fs";
import { convertCircuitJsonToPcbSvg } from "circuit-to-svg";
import { Resvg } from "@resvg/resvg-js";
const json = JSON.parse(readFileSync("dist/index/circuit.json", "utf8"));
for (const layer of ["top", "bottom"] as const) {
const svg = convertCircuitJsonToPcbSvg(json, {
layer, width: 1400, matchBoardAspectRatio: true,
shouldDrawErrors: true, showErrorsInTextOverlay: true,
});
writeFileSync(`dist/index/pcb-${layer}.svg`, svg);
writeFileSync(`dist/index/pcb-${layer}.png`, new Resvg(svg).render().asPng());
}