Root/atben/cam/mkmk

1#!/bin/sh -e
2PATH=$PATH:/home/qi/cae-tools/cameo
3PATH=$PATH:/home/moko/svn.openmoko.org/developers/werner/cncmap/gp2rml
4
5NAME=atben
6X0=8.6mm
7Y0=7.1mm
8X=0
9Y=0
10
11cameo <<EOF
12mm
13
14gerber 35mil ../$NAME-PCB_Edges.gbr
15align 1 $X0 $Y0 # align relative to board corner
16translate 4mm 4mm # move to PCB zone assigned to project
17#translate 40mm 0mm # skip over previous boards
18array +19mm +2.5mm $X $Y
19
20z 0 -58.9mm # board surface (tool fully retracted)
21z 1.5mm # slack for extending the tool
22z -0.8mm # board thickness
23z -0.5mm # tool extra depth
24clear
25
26# ---- 1st board ----
27
28excellon ../$NAME.drl
29drill 7mil 15mil # 12.5-13.5 mil drill
30optimize
31write drill.gp
32
33remainder
34mill 20mil 0.01mm # 35 mil endmill; pretend it is a little smaller,
35            # to compensate for tool/board deflections
36write mill.gp
37
38remainder
39empty
40
41gerber 20mil ../$NAME-PCB_Edges.gbr # 35 mil endmill, 15 mil deflection
42offset
43append mill.gp
44
45clear
46
47# ---- 2nd board ----
48
49reset
50
51gerber 35mil ../$NAME-PCB_Edges.gbr
52rotate 180
53
54align 1 $X0 $Y0 # align relative to board corner
55translate 4mm 4mm # move to PCB zone assigned to project
56#translate 40mm 0mm # skip over previous boards
57translate 15mm 0mm
58array +19mm +2.5mm $X $Y
59
60clear
61
62excellon ../$NAME.drl
63drill 7mil 15mil # 12.5-13.5 mil drill
64optimize
65append drill.gp
66
67remainder
68mill 20mil 0.01mm # 35 mil endmill; pretend it is a little smaller,
69            # to compensate for tool/board deflections
70append mill.gp
71
72remainder
73empty
74
75gerber 20mil ../$NAME-PCB_Edges.gbr # 35 mil endmill, 15 mil deflection
76offset
77append mill.gp
78EOF
79
80
81gp2rml 2 0.5 0.5 mill.gp >mill.rml
82gp2rml 2 0.1 0.5 drill.gp >drill.rml
83
84
85cat <<EOF >Makefile.mkmk
86SPOOL=/home/moko/svn.openmoko.org/developers/werner/cncmap/spool/spool
87CNGT=/home/qi/cae-tools/cngt/cngt
88
89.PHONY: mill drill cng plot dplot
90
91mill:
92        PORT=/dev/ttyUSB0 \$(SPOOL) mill.rml
93
94drill:
95        PORT=/dev/ttyUSB0 \$(SPOOL) drill.rml
96
97cng:
98        \$(CNGT) -57.4 20 mill.gp
99
100plot:
101        echo 'plot "drill.gp" with points, "mill.gp" with lines' | \\
102          gnuplot -persist
103
104dplot:
105        echo 'plot "< sed /^\$\$/d drill.gp" with linespoints' | \\
106          gnuplot -persist
107
108clean::
109        rm -f mill.gp mill.rml drill.gp drill.rml
110EOF
111

Archive Download this file

Branches:
buffer-frames
master



interactive