-
Notifications
You must be signed in to change notification settings - Fork 0
/
kbd-18.5.ps
123 lines (102 loc) · 3.36 KB
/
kbd-18.5.ps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
%!PS-Adobe-2.0
%%Creator: O'Reilly 2.1
%%CreationDate: 12/12/94 14/12/40
%%End Comments
/mm {2.83464 mul} def
/toMM {2.83464 div} def
% desired layout characteristics; vert must be at least the longer dimension of the switches
% horiz must be at least the shorter dimension. The Matias quiet linear switches are
% 17.5 x 12 mm. We use 18.5mm vertical separation due to slight inaccuracies in hole punching
% which can make it difficult to install the switches tightly butted up to one another.
/horizMM 20.5 def
/vertMM 18.5 def
/pinoffset 0.5 mm def % the distance of the pins from the vertical line equidistant from them
/pinspacing 2.5 mm def % half distance between the pins; assume that the pins are centered in vert space taken up by the switch
/vert vertMM mm def
/horiz horizMM mm def
% desired visual characteristics
/holeradius 0.5 mm def
/linewidth 0.1 mm def
/bottomMargin 6 mm def
/topMargin 9.5 mm def
% define the position of the bottom left corner
% note: the x,y reference frame for drawing is rotated 90 deg. from
% the actual keyboard
/xoffset 25 mm def
/yoffset 20 mm def
linewidth setlinewidth
% some names that make better sense for drawing in the x,y frame of reference
/xspacing vert def
/yspacing horiz def
% draw a circle at currentpoint and leave currentpoint where it was
/hole {
currentpoint currentpoint holeradius 0 360 arc closepath stroke moveto
} def
% with currentpoint at the beginning of one of the lines where 3 switches will be
% placed, draw the switch pin holes
/drawHoles {
xspacing 2 div pinspacing sub pinoffset neg rmoveto hole
xspacing 0 mm rmoveto hole
xspacing 0 mm rmoveto hole
xspacing 2 mul neg pinspacing 2 mul add pinoffset 2 mul rmoveto hole
xspacing 0 mm rmoveto hole
xspacing 0 mm rmoveto hole
} def
/starty { yspacing mul yoffset add } def
/linelen xspacing 3 mul def
/xlineat {
2 dict begin
/y exch def
/x exch def
x y moveto linelen 0 mm rlineto stroke
x y moveto drawHoles
end
} def
/xlineatnoholes {
moveto linelen 0 mm rlineto stroke
} def
xoffset 0 starty xlineat
xoffset 1 starty xlineat
xoffset 2 starty xlineat
xoffset 3 starty xlineat
xoffset 4 starty xlineat
xoffset 5 starty xlineat
xoffset 6 starty xlineatnoholes
xoffset 7 starty xlineat
xoffset 8 starty xlineat
xoffset 9 starty xlineat
xoffset 10 starty xlineat
xoffset 11 starty xlineat
xoffset 12 starty xlineat
/startx { xspacing mul xoffset add } def
/lineht yspacing 12 mul def
% the bottom cut line
xoffset bottomMargin sub yoffset moveto 0 mm lineht rlineto stroke
% lines for the grid
0 startx yoffset moveto 0 mm lineht rlineto stroke
1 startx yoffset moveto 0 mm lineht rlineto stroke
2 startx yoffset moveto 0 mm lineht rlineto stroke
3 startx yoffset moveto 0 mm lineht rlineto stroke
% the top cut line
3 startx topMargin add yoffset moveto 0 mm lineht rlineto stroke
% a bit of information about the drawing
/Courier findfont 12 scalefont setfont
120 mm 140 mm moveto
(NOTE: No holes are punched) show
120 mm 135 mm moveto
(on the center line) show
120 mm 100 mm moveto
(TPOEPL board layout template) show
120 mm 95 mm moveto
(Board size: 280mm x ) show
vert 3 mul topMargin add bottomMargin add toMM 6 string cvs show
(mm) show
120 mm 90 mm moveto
(Vertical switch spacing: ) show
vertMM 5 string cvs show
(mm) show
120 mm 85 mm moveto
(Horizontal switch spacing: ) show
horizMM 5 string cvs show
(mm) show
showpage