diff --git a/cameo/templates/mkmk-simple b/cameo/templates/mkmk-simple new file mode 100644 index 0000000..1d8a2c8 --- /dev/null +++ b/cameo/templates/mkmk-simple @@ -0,0 +1,111 @@ +#!/bin/sh +PATH=$PATH:/home/qi/cae-tools/cameo +PATH=$PATH:/home/moko/svn.openmoko.org/developers/werner/cncmap/gp2rml + +# +# Parameters: +# +# NAME KiCad project name, required +# X0, Y0 lower left corner of raw board, default: 0mm 0mm +# X, Y position in array, default: 0 0 +# XN, YN number of boards in X/Y direction, default: 1 1 +# ROT board rotation, default: 0 degrees +# DRILL drill diameter range, default: 13mil,14mil +# MILL_IN diameter of mill for work inside the board, default: 35mil +# MILL_OUT diameter of mill for board edge, default: 35mil +# + +while [ "$1" ]; do + eval "$1" + shift +done + +if ! [ "$NAME" ]; then + echo "NAME is required" 1>&2 + exit 1 +fi +: ${X0:=0} ${Y0:=0} +: ${X:=0} ${Y:=0} +: ${XN:=1} ${YN:=1} +: ${DRILL:="13mil 14mil"} +: ${MILL_IN:=35mil} +: ${MILL_OUT:=35mil} + +rot= +if [ "$ROT" ]; then + rot="rotate $ROT" +fi + +write=write +yi=0 +while [ $yi -lt $YN ]; do + xi=0 + while [ $xi -lt $XN ]; do + + cameo <mill.rml +gp2rml 2 0.1 0.5 drill.gp >drill.rml + + +cat <Makefile.mkmk +SPOOL=/home/moko/svn.openmoko.org/developers/werner/cncmap/spool/spool +CNGT=/home/qi/cae-tools/cngt/cngt + +.PHONY: mill drill cng plot dplot + +mill: + PORT=/dev/ttyUSB0 \$(SPOOL) mill.rml + +drill: + PORT=/dev/ttyUSB0 \$(SPOOL) drill.rml + +cng: + \$(CNGT) -57.4 20 mill.gp + +plot: + echo 'plot "drill.gp" with points, "mill.gp" with lines' | \\ + gnuplot -persist + +dplot: + echo 'plot "< sed /^\$\$/d drill.gp" with linespoints' | \\ + gnuplot -persist + +clean:: + rm -f mill.gp mill.rml drill.gp drill.rml +EOF