Skip to content

Instantly share code, notes, and snippets.

@sleemanj
Last active December 18, 2017 04:24
Show Gist options
  • Save sleemanj/c0db735afe029c3a478b to your computer and use it in GitHub Desktop.
Save sleemanj/c0db735afe029c3a478b to your computer and use it in GitHub Desktop.
Create image from gerbers with gerbv
#!/bin/bash
HOLES="$1"
SILK="$2"
MASK="$3"
COPPER="$4"
# We need to "invert" the mask, this is dirty but seems to work, further testing required on larger sample set :)
echo "%IPNEG*%" > /tmp/newMask.gbr
cat "$MASK" | sed -r 's/%IP(POS|NEG)\*%//' >>/tmp/newMask.gbr
gerbv -a --border=10 --background="#E0D5B3" --dpi=1200 -o /tmp/dirtyoutput.png -xpng \
--foreground="#FFFFFFFF" "$HOLES" \
--foreground="#FFFFFFFF" "$SILK" \
--foreground="#FF000099" /tmp/newMask.gbr \
--foreground="#FF9D00FF" "$COPPER"
echo "Output is in /tmp/dirtyoutput.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment