mohan-bee/tscircuit-robot-vacuum

A tscircuit package created by mohan-bee.

Version
1.0.0
License
unset
Stars
0

capability-audit/render-routing.ts

PCBPCB preview for capability-audit/render-routing.ts
SchematicSchematic preview for capability-audit/render-routing.ts
import fs from "node:fs/promises"
import { convertCircuitJsonToPcbSvg } from "circuit-to-svg"
import { Resvg } from "@resvg/resvg-js"
const records = JSON.parse(await fs.readFile("capability-audit/routing-forced.circuit.json", "utf8"))
const svg = convertCircuitJsonToPcbSvg(records, { width: 1600, height: 1300, showCourtyards: true, shouldDrawRatsNest: false })
await fs.mkdir("dist", { recursive: true })
await fs.writeFile("dist/routing-experiment.svg", svg)
await fs.writeFile("dist/routing-experiment.png", new Resvg(svg).render().asPng())
console.log("Rendered native tscircuit routed experiment PCB")