Root/labsw/mech/doit

1#!/bin/sh
2PATH=$PATH:/home/qi/cae-tools/cameo
3PATH=$PATH:/home/qi/cae-tools/gp2rml
4
5#
6# Parameters:
7#
8# X0, Y0 lower left corner of raw board, default: 0mm 0mm
9# X, Y position in array, default: 0 0
10# XN, YN number of boards in X/Y direction, default: 1 1
11# MILL diameter of mill, default: 35mil
12# BOARD_Z board tickness, default: 0.8 mm
13# ENGRAVE_Z engraving depth, default: 0.2 mm
14# CLEARANCE tool clearance above PCB surface, default: 2mm
15#
16
17while [ "$1" ]; do
18    eval "$1"
19    shift
20done
21
22: ${X0:=0} ${Y0:=0}
23: ${X:=0} ${Y:=0}
24: ${XN:=1} ${YN:=1}
25: ${MILL:=35mil}
26: ${BOARD_Z:=0.8mm}
27: ${ENGRAVE_Z:=0.2mm}
28: ${CLEARANCE:=2mm}
29
30write=write
31yi=0
32while [ $yi -lt $YN ]; do
33    xi=0
34    while [ $xi -lt $XN ]; do
35
36    cat <<EOF >_job
37mm
38gnuplot $MILL front.gp
39
40align 1 $X0 $Y0 # align relative to board corner
41translate 4mm 4mm # move to PCB zone assigned to project
42array +3mm +3mm `expr $X + $xi` `expr $Y + $yi`
43z 0 -57.4mm # board surface (tool fully retracted)
44z $ENGRAVE_Z # correct for reference level picked by gp2rml
45clear
46
47z -$ENGRAVE_Z # engraving depth
48gnuplot $MILL logo.gp
49mill any $MILL 0.01mm
50$write mill.gp
51clear
52z $ENGRAVE_Z
53
54z -$BOARD_Z # board thickness
55z -0.5mm # tool extra depth
56gnuplot $MILL front.gp
57offset
58append mill.gp
59EOF
60
61    cameo _job || exit
62    rm -f _job
63
64    write=append
65    xi=`expr $xi + 1`
66    done
67    yi=`expr $yi + 1`
68done
69
70gp2rml $CLEARANCE 0.5 0.5 mill.gp >mill.rml || exit
71

Archive Download this file

Branches:
master



interactive