ShiboSoftwareDev/captivate-fr2676
This circuit implements an MSP430FR2676 microcontroller-based development module with integrated power regulation, user interface components, programming interfaces, and sensor/boosterpack headers for embedded system prototyping.
- Version
- 1.0.0
- License
- unset
- Stars
- 0
render-artifacts.ts
PCB
import { readFileSync, writeFileSync } from "node:fs"
import { Resvg } from "@resvg/resvg-js"
import {
convertCircuitJsonToAssemblySvg,
convertCircuitJsonToPcbSvg,
convertCircuitJsonToStackedSchematicSheetsSvg,
} from "circuit-to-svg"
const circuitJson = JSON.parse(readFileSync("dist/index/circuit.json", "utf8"))
writeFileSync("dist/pcb.svg", convertCircuitJsonToPcbSvg(circuitJson))
writeFileSync("dist/assembly.svg", convertCircuitJsonToAssemblySvg(circuitJson))
writeFileSync(
"dist/schematic-stacked.svg",
convertCircuitJsonToStackedSchematicSheetsSvg(circuitJson),
)
for (const artifact of ["pcb", "assembly", "schematic-stacked"]) {
const png = new Resvg(readFileSync(`dist/${artifact}.svg`), {
fitTo: { mode: "width", value: 2400 },
background: "white",
})
.render()
.asPng()
writeFileSync(`dist/${artifact}.png`, png)
}