seveibar/am3352-dev-board-4layer-dogbone
Defines PCB footprints and pin mappings for a TI AM3352ZCZ100 processor, JST GH connectors, and assembly-part lookup helpers for capacitors, resistors, and headers.
- Version
- 0.1.5
- License
- unset
- Stars
- 0
scripts/render-previews.mjs
import fs from 'node:fs'
import { Resvg } from '@resvg/resvg-js'
import { convertCircuitJsonToPcbSvg } from 'circuit-to-svg'
const circuit=JSON.parse(fs.readFileSync('dist/index/circuit.json','utf8'))
for (const [name,layer,hidePlanes] of [['board-preview',undefined,true],['top-copper','top',false],['bottom-copper','bottom',false]]) {
const data=hidePlanes?circuit.filter(e=>e.type!=='pcb_copper_pour'):circuit
const svg=convertCircuitJsonToPcbSvg(data,{width:1600,height:1400,layer,shouldDrawErrors:true,shouldDrawWarnings:false,shouldDrawRatsNest:false,showSolderPaste:false,includeVersion:false})
fs.writeFileSync(`${name}.svg`,svg)
fs.writeFileSync(`${name}.png`,new Resvg(svg).render().asPng())
}
console.log('Rendered routing overlay, top copper, and bottom copper previews')