Skip to content

Instantly share code, notes, and snippets.

@loopj
Created December 18, 2023 20:17
Show Gist options
  • Save loopj/8882b6b95265988cd1b6156baa3eba97 to your computer and use it in GitHub Desktop.
Save loopj/8882b6b95265988cd1b6156baa3eba97 to your computer and use it in GitHub Desktop.
Generate PCB renders (SVG and PNG) from KiCad
#!/usr/bin/env bash
mkdir -p temp
cd temp
# Export gerbers
kicad-cli pcb export gerbers ../pcbname.kicad_pcb -l F.Cu,B.Cu,F.Paste,B.Paste,F.SilkS,B.SilkS,F.Mask,B.Mask,Edge.Cuts
# Generate SVGs
tracespace -L *.*
# Generate PNGs
for file in *.svg; do
inkscape --export-type=png --export-dpi=600 --export-filename="${file%.svg}.png" "$file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment