2011-12-15 23:18:17 +02:00
|
|
|
#!/bin/sh
|
|
|
|
PATH=$PATH:/home/qi/cae-tools/cameo
|
|
|
|
PATH=$PATH:/home/qi/cae-tools/gp2rml
|
|
|
|
|
|
|
|
#
|
|
|
|
# Parameters:
|
|
|
|
#
|
|
|
|
# X0, Y0 lower left corner of raw board, default: 0mm 0mm
|
|
|
|
# Z0 position at which tool tip touches the piece's surface
|
|
|
|
# X, Y position in array, default: 0 0
|
|
|
|
# XN, YN number of boards in X/Y direction, default: 1 1
|
|
|
|
# MILL diameter of mill, default: 35mil
|
|
|
|
# BOARD_Z board tickness, default: 0.8 mm
|
|
|
|
# CLEARANCE tool clearance above PCB surface, default: 2mm
|
|
|
|
#
|
|
|
|
|
2011-12-16 10:09:43 +02:00
|
|
|
NAME=$1
|
|
|
|
shift
|
|
|
|
|
2011-12-15 23:18:17 +02:00
|
|
|
while [ "$1" ]; do
|
|
|
|
eval "$1"
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
: ${X0:=0} ${Y0:=0} ${Z0:=0}
|
|
|
|
: ${X:=0} ${Y:=0}
|
|
|
|
: ${XN:=1} ${YN:=1}
|
|
|
|
: ${MILL:=35mil}
|
|
|
|
: ${BOARD_Z:=0.8mm}
|
|
|
|
: ${CLEARANCE:=2mm}
|
|
|
|
|
|
|
|
write=write
|
|
|
|
yi=0
|
|
|
|
while [ $yi -lt $YN ]; do
|
|
|
|
xi=0
|
|
|
|
while [ $xi -lt $XN ]; do
|
|
|
|
|
|
|
|
cat <<EOF >_job
|
|
|
|
mm
|
2011-12-16 10:09:43 +02:00
|
|
|
gnuplot $MILL $NAME.gp
|
2011-12-15 23:18:17 +02:00
|
|
|
|
|
|
|
align 1 $X0 $Y0 # align relative to board corner
|
|
|
|
translate 4mm 4mm # move to PCB zone assigned to project
|
|
|
|
array +3mm +3mm `expr $X + $xi` `expr $Y + $yi`
|
|
|
|
z 0 $Z0 # board surface (tool fully retracted)
|
|
|
|
z -$BOARD_Z # board thickness
|
|
|
|
|
|
|
|
offset
|
2011-12-16 10:09:43 +02:00
|
|
|
write _$NAME.gp
|
2011-12-15 23:18:17 +02:00
|
|
|
EOF
|
|
|
|
|
|
|
|
cameo _job || exit
|
|
|
|
rm -f _job
|
|
|
|
|
|
|
|
write=append
|
|
|
|
xi=`expr $xi + 1`
|
|
|
|
done
|
|
|
|
yi=`expr $yi + 1`
|
|
|
|
done
|
|
|
|
|
2012-01-18 21:36:56 +02:00
|
|
|
gp2rml $CLEARANCE 5 5 _$NAME.gp >$NAME.rml || exit
|