Date:2011-12-15 22:18:17 (8 years 10 months ago)
Author:Werner Almesberger
Commit:f1af1b81816739444a4bb1cce346d11037961b9c
Message:m1/case/: front panel modified for M1pre-rc4 (with raised USB)

Files: m1/case/Makefile (1 diff)
m1/case/case.fpd (1 diff)
m1/case/doit (1 diff)

Change Details

m1/case/Makefile
1SPOOL=/home/moko/svn.openmoko.org/developers/werner/cncmap/spool/spool
2
3BOARD=X0=5.0mm Y0=0.0mm Z0=-56.0mm BOARD_Z=4mm
4
5.PHONY: all mill clean
6
7all: mill.rml
8
9case.gp: case.fpd
10        fped -g $<
11
12mill.rml: case.gp
13        ./doit $(BOARD) CLEARANCE=5mm || { rm -f $@; exit 1; }
14
15mill: mill.rml
16        PORT=/dev/ttyUSB0 $(SPOOL) mill.rml
17
18clean:
19        rm -f case.gp mill.gp mill.rml
m1/case/case.fpd
1/* MACHINE-GENERATED ! */
2
3frame short {
4    __0: vec @(Iox, 0mm)
5    line @ . w
6    __1: vec .(Lox, 0mm)
7    __2: vec .(Iix, 0mm)
8    line __1 . w
9    __3: vec __0(0mm, -Ly)
10    line __0 . w
11    __4: vec __1(0mm, -Ly)
12    line __3 . w
13    line . __1 w
14    __5: vec __2(Lix, 0mm)
15    __6: vec __2(0mm, -Ly)
16    line __2 . w
17    __7: vec __5(0mm, -Ly)
18    line __6 . w
19    line . __5 w
20    __8: vec __5(Iix, 0mm)
21    line __5 . w
22    __9: vec .(Lox, 0mm)
23    __10: vec .(Iox, 0mm)
24    line __9 . w
25    __11: vec __8(0mm, -Ly)
26    line __8 . w
27    __12: vec __9(0mm, -Ly)
28    line . __11 w
29    line __9 . w
30    __13: vec @(0mm, H)
31    line . @ w
32    __14: vec .(Iox, 0mm)
33    line __13 . w
34    __15: vec .(Lox, 0mm)
35    __16: vec .(Iix, 0mm)
36    line __15 . w
37    __17: vec .(Lix, 0mm)
38    __18: vec .(Iix, 0mm)
39    line __17 . w
40    __19: vec .(Lox, 0mm)
41    __20: vec .(Iox, 0mm)
42    line __19 . w
43    line . __10 w
44    __21: vec __14(0mm, Ly)
45    line . __14 w
46    __22: vec __15(0mm, Ly)
47    line __21 . w
48    line . __15 w
49    __23: vec __16(0mm, Ly)
50    line . __16 w
51    __24: vec __17(0mm, Ly)
52    line __23 . w
53    line . __17 w
54    __25: vec __18(0mm, Ly)
55    line . __18 w
56    __26: vec __19(0mm, Ly)
57    line . __25 w
58    line . __19 w
59}
60
61frame usb {
62    set Wusb = 8.5mm
63
64    set Husb = 15.5mm
65
66    __0: vec @(-Wusb, Husb)
67    rect . @ w
68}
69
70frame but {
71    set Rbut = 4mm+0.1mm
72
73    __0: vec @(0mm, Rbut)
74    circ @ . w
75}
76
77frame front {
78    table
79        { Ibutx, Ibuty, Dbut }
80        { 54.5mm, 10.5mm, 14mm }
81
82    table
83        { Iusbx, Iusby, Dusb }
84        { 18.5mm, 6.5mm+1.3mm, 12.5mm }
85
86    __0: vec @(Ibutx, Ibuty)
87    frame but .
88    __1: vec .(Dbut, 0mm)
89    frame but .
90    __2: vec .(Dbut, 0mm)
91    frame but .
92    __3: vec @(Ws, 0mm)
93    __4: vec .(-Iusbx, Iusby)
94    frame usb .
95    __5: vec .(-Dusb, 0mm)
96    frame usb .
97    frame short @
98}
99
100package "M1"
101unit mm
102
103table
104    { Iox, Lox, Ly, Iix, Lix }
105    { 10mm, 12mm, 3mm, 33mm, 21mm }
106
107set w = 0.1mm
108
109table
110    { H, Ws }
111    { 36.5mm, 2*(Iox+Lox+Iix)+Lix }
112
113frame front @
m1/case/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# Z0 position at which tool tip touches the piece's surface
10# X, Y position in array, default: 0 0
11# XN, YN number of boards in X/Y direction, default: 1 1
12# MILL diameter of mill, default: 35mil
13# BOARD_Z board tickness, default: 0.8 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} ${Z0:=0}
23: ${X:=0} ${Y:=0}
24: ${XN:=1} ${YN:=1}
25: ${MILL:=35mil}
26: ${BOARD_Z:=0.8mm}
27: ${CLEARANCE:=2mm}
28
29write=write
30yi=0
31while [ $yi -lt $YN ]; do
32    xi=0
33    while [ $xi -lt $XN ]; do
34
35    cat <<EOF >_job
36mm
37gnuplot $MILL case.gp
38
39align 1 $X0 $Y0 # align relative to board corner
40translate 4mm 4mm # move to PCB zone assigned to project
41array +3mm +3mm `expr $X + $xi` `expr $Y + $yi`
42z 0 $Z0 # board surface (tool fully retracted)
43z -$BOARD_Z # board thickness
44
45write merged.gp
46offset
47write mill.gp
48EOF
49
50    cameo _job || exit
51    rm -f _job
52
53    write=append
54    xi=`expr $xi + 1`
55    done
56    yi=`expr $yi + 1`
57done
58
59gp2rml $CLEARANCE 10 10 mill.gp >mill.rml || exit

Archive Download the corresponding diff file

Branches:
master



interactive