mohan-bee/rc-link-breakaway-panel
A four-layer RC link panel combining an STM32/E28 2.4‑GHz transmitter with USB-RP2040 socket and an STM32/E28 receiver providing six buffered PWM servo outputs, regulated 3.3‑V power, headers, controls, and protection/decoupling.
- Version
- 0.1.5
- License
- unset
- Stars
- 0
tools/render-schematic-sheets.mjs
import { readFileSync, writeFileSync, mkdirSync } from "node:fs";
import { convertCircuitJsonToSchematicSvg } from "circuit-to-svg";
import { Resvg } from "@resvg/resvg-js";
const circuit = JSON.parse(readFileSync("dist/index/circuit.json", "utf8"));
const directory = "dist/schematic-sheets";
mkdirSync(directory, { recursive: true });
for (const sheet of circuit.filter((item) => item.type === "schematic_sheet")) {
const contents = circuit.filter((item) => item.type !== "schematic_sheet" &&
(!item.type.startsWith("schematic_") || item.schematic_sheet_id === sheet.schematic_sheet_id));
const svg = convertCircuitJsonToSchematicSvg(contents, { width: 1800, height: 1100, includeVersion: false });
writeFileSync(`${directory}/${sheet.name}.svg`, svg);
writeFileSync(`${directory}/${sheet.name}.png`, new Resvg(svg).render().asPng());
}