krishnax12/watchy-eink-smartwatch

Unfinished prototype (not production-ready): 4 native DRC errors, 2 display-flex intersections, and missing antenna radiator copper remain

Version
1.2.7
License
MIT
Stars
1

scripts/render-schematic.ts

import type { AnyCircuitElement } from "circuit-json";
import { convertCircuitJsonToStackedSchematicSheetsSvg } from "circuit-to-svg";
import { Resvg } from "@resvg/resvg-js";

const circuit: AnyCircuitElement[] = await Bun.file(
	process.argv[2] ?? "dist/index/circuit.json",
).json();
const outputPrefix = process.argv[3] ?? "dist/index/schematic-sheets";
const svg = convertCircuitJsonToStackedSchematicSheetsSvg(circuit, {
	width: 1600,
});
await Bun.write(`${outputPrefix}.svg`, svg);
await Bun.write(`${outputPrefix}.png`, new Resvg(svg).render().asPng());