ShiboSoftwareDev/lp-msp430fr2476
This design implements a microcontroller-based development board featuring an MSP430FR2476 target MCU with associated power regulation, USB host interface with ESD protection, multiple headers for peripherals and BoosterPacks, and integrated status LEDs and sensors.
- 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)
}