mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-23 00:48:26 +02:00
fab/prettygerbv: update for new file names; add option -y for vertical stacking
This commit is contained in:
parent
3256b03294
commit
53d6e1db13
@ -2,8 +2,8 @@
|
|||||||
#
|
#
|
||||||
# prettygerbv - Use gerbv to generate "pretty" views of a PCB
|
# prettygerbv - Use gerbv to generate "pretty" views of a PCB
|
||||||
#
|
#
|
||||||
# Written 2011 by Werner Almesberger
|
# Written 2011, 2013 by Werner Almesberger
|
||||||
# Copyright 2011 Werner Almesberger
|
# Copyright 2011, 2013 Werner Almesberger
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or modify
|
# This program is free software; you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -27,7 +27,7 @@ EDGE2="(cons 'color #(30000 40000 65535))"
|
|||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
cat <<EOF 1>&2
|
cat <<EOF 1>&2
|
||||||
usage: $0 [-d file] project-name view png-file
|
usage: $0 [-y] [-d file] project-name view png-file
|
||||||
|
|
||||||
view "front", "back", "conn", "all"
|
view "front", "back", "conn", "all"
|
||||||
|
|
||||||
@ -56,6 +56,16 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
choose()
|
||||||
|
{
|
||||||
|
if [ -e "$1-$3" ]; then
|
||||||
|
echo "$1-$3"
|
||||||
|
else
|
||||||
|
echo "$1-$2"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
layers_end()
|
layers_end()
|
||||||
{
|
{
|
||||||
echo '(set-render-type! 2)' >>_gvp
|
echo '(set-render-type! 2)' >>_gvp
|
||||||
@ -71,12 +81,12 @@ run_gerbv()
|
|||||||
front()
|
front()
|
||||||
{
|
{
|
||||||
layers_begin 5
|
layers_begin 5
|
||||||
layer $NAME-Front.gtl $COPPER
|
layer `choose $NAME Front.gtl F_Cu.gtl` $COPPER
|
||||||
[ "$drill" ] && layer $drill $DRILL
|
[ "$drill" ] && layer $drill $DRILL
|
||||||
layer $NAME-SoldP_Front.gtp $PASTE
|
layer `choose $NAME SoldP_Front.gtp F_Paste.gtp` $PASTE
|
||||||
layer $NAME-Mask_Front.gts $INV $MASK
|
layer `choose $NAME Mask_Front.gts F_Mask.gts` $INV $MASK
|
||||||
layer $NAME-SilkS_Front.gto $SILK
|
layer `choose $NAME SilkS_Front.gto F_SilkS.gto` $SILK
|
||||||
layer $NAME-PCB_Edges.gbr $EDGE
|
layer `choose $NAME PCB_Edges.gbr Edge_Cuts.gbr` $EDGE
|
||||||
layers_end
|
layers_end
|
||||||
|
|
||||||
run_gerbv "$1"
|
run_gerbv "$1"
|
||||||
@ -86,12 +96,12 @@ front()
|
|||||||
back()
|
back()
|
||||||
{
|
{
|
||||||
layers_begin 5
|
layers_begin 5
|
||||||
layer $NAME-Back.gbl $COPPER
|
layer `choose $NAME Back.gbl B_Cu.gbl` $COPPER
|
||||||
[ "$drill" ] && layer $drill $DRILL
|
[ "$drill" ] && layer $drill $DRILL
|
||||||
layer $NAME-SoldP_Back.gbp $PASTE
|
layer `choose $NAME SoldP_Back.gbp B_Paste.gbp` $PASTE
|
||||||
layer $NAME-Mask_Back.gbs $INV $MASK
|
layer `choose $NAME Mask_Back.gbs B_Mask.gbs` $INV $MASK
|
||||||
layer $NAME-SilkS_Back.gbo $SILK
|
layer `choose $NAME SilkS_Back.gbo B_SilkS.gbo` $SILK
|
||||||
layer $NAME-PCB_Edges.gbr $EDGE
|
layer `choose $NAME PCB_Edges.gbr Edge_Cuts.gbr` $EDGE
|
||||||
layers_end
|
layers_end
|
||||||
|
|
||||||
run_gerbv _tmp.png
|
run_gerbv _tmp.png
|
||||||
@ -103,9 +113,9 @@ back()
|
|||||||
conn()
|
conn()
|
||||||
{
|
{
|
||||||
layers_begin 3
|
layers_begin 3
|
||||||
layer $NAME-Back.gbl $BACK
|
layer `choose $NAME Back.gbl B_Cu.gbl` $BACK
|
||||||
layer $NAME-Front.gtl $FRONT
|
layer `choose $NAME Front.gtl F_Cu.gtl` $FRONT
|
||||||
layer $NAME-PCB_Edges.gbr $EDGE2
|
layer `choose $NAME PCB_Edges.gbr Edge_Cuts.gbr` $EDGE2
|
||||||
layers_end
|
layers_end
|
||||||
|
|
||||||
run_gerbv "$1"
|
run_gerbv "$1"
|
||||||
@ -117,10 +127,16 @@ all()
|
|||||||
front _front.png
|
front _front.png
|
||||||
back _back.png
|
back _back.png
|
||||||
conn _conn.png
|
conn _conn.png
|
||||||
montage -geometry +4+4 _front.png _back.png _conn.png "$1"
|
montage -geometry +4+4 $tile _front.png _back.png _conn.png "$1"
|
||||||
rm -f _front.png _back.png _conn.png
|
rm -f _front.png _back.png _conn.png
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tile=
|
||||||
|
if [ "$1" = -y ]; then
|
||||||
|
tile="-tile 1x3"
|
||||||
|
shift
|
||||||
|
fi
|
||||||
|
|
||||||
drill=
|
drill=
|
||||||
if [ "$1" = -d ]; then
|
if [ "$1" = -d ]; then
|
||||||
drill=$2
|
drill=$2
|
||||||
|
Loading…
Reference in New Issue
Block a user