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.16
- License
- unset
- Stars
- 0
scripts/render-schematic.tsx
import { Circuit } from "tscircuit";
import { convertCircuitJsonToStackedSchematicSheetsSvg, convertCircuitJsonToSchematicSvg } from "circuit-to-svg";
import { mkdirSync, writeFileSync } from "node:fs";
import Board from "../index.circuit";
const circuit = new Circuit({ platform: { pcbDisabled: true } });
circuit.add(<Board routingDisabled />);
await circuit.renderUntilSettled();
const json = circuit.getCircuitJson();
mkdirSync("dist/schematic", { recursive: true });
writeFileSync("dist/schematic/circuit.json", JSON.stringify(json, null, 2));
writeFileSync("dist/schematic/schematic.svg", convertCircuitJsonToStackedSchematicSheetsSvg(json, { width: 1400 }));
for (const sheet of json.filter((element) => element.type === "schematic_sheet")) {
writeFileSync(`dist/schematic/${sheet.name}.svg`, convertCircuitJsonToSchematicSvg(json, {
schematicSheetId: sheet.schematic_sheet_id,
width: 1600,
height: 1100,
}));
}
console.log(json.filter(e => e.type.endsWith("_error") || e.type === "schematic_element_outside_sheet_warning"));