summaryrefslogtreecommitdiff
path: root/trunk/users/adrian/Experimental-electronics/reprap-extruder-controller-extruder-controller-experimental/ps/BottomCream.ps
blob: 516abe6dd09325b0ed63dae5304f5a21b3cdbada (plain)
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
%!PS-Adobe-3.0 EPSF-3.0
%%Title: EAGLE Drawing /home/hoeken/Desktop/reprap/trunk/reprap/electronics/Arduino-Sanguino/extruder-controller/extruder-controller.brd
%%Creator: EAGLE
%%Pages: 1
%%BoundingBox: 0 0 576 810
%%EndComments

% Coordinate transfer:

/EU { 254 div 0.072 mul } def
/inch { 72 mul } def

% Linestyle:

1 setlinecap
1 setlinejoin

% Drawing functions:

/l {  % draw a line
   /lw exch def
   /y2 exch def
   /x2 exch def
   /y1 exch def
   /x1 exch def
   newpath
   x1 EU y1 EU moveto
   x2 EU y2 EU lineto
   lw EU setlinewidth
   stroke
   } def

/h {  % draw a hole
   /d  exch def
   /y  exch def
   /x  exch def
   d 0 gt {
     newpath
     x EU y EU d 2 div EU 0 360 arc
     currentgray dup
     1 exch sub setgray
     fill
     setgray
     } if
   } def

/b {  % draw a bar
   /an exch def
   /y2 exch def
   /x2 exch def
   /y1 exch def
   /x1 exch def
   /w2 x2 x1 sub 2 div EU def
   /h2 y2 y1 sub 2 div EU def
   gsave
   x1 x2 add 2 div EU y1 y2 add 2 div EU translate
   an rotate
   newpath
   w2     h2     moveto
   w2 neg h2     lineto
   w2 neg h2 neg lineto
   w2     h2 neg lineto
   closepath
   fill
   grestore
   } def

/c {  % draw a circle
   /lw exch def
   /rd exch def
   /y  exch def
   /x  exch def
   newpath
   lw EU setlinewidth
   x EU y EU rd EU 0 360 arc
   stroke
   } def

/a {  % draw an arc
   /lc exch def
   /ae exch def
   /as exch def
   /lw exch def
   /rd exch def
   /y  exch def
   /x  exch def
   lw rd 2 mul gt {
     /rd rd lw 2 div add 2 div def
     /lw rd 2 mul def
     } if
   currentlinecap currentlinejoin
   lc setlinecap 0 setlinejoin
   newpath
   lw EU setlinewidth
   x EU y EU rd EU as ae arc
   stroke
   setlinejoin setlinecap
   } def

/p {  % draw a pie
   /d exch def
   /y exch def
   /x exch def
   newpath
   x EU y EU d 2 div EU 0 360 arc
   fill
   } def

/edge { 0.20710678119 mul } def

/o {  % draw an octagon
   /an exch def
   /dy exch def
   /dx exch def
   /y  exch def
   /x  exch def
   gsave
   x EU y EU translate
   an dx dy lt { 90 add /dx dy /dy dx def def } if rotate
   newpath
      0 dx 2 div sub EU                    0 dy edge  add EU moveto
      0 dx dy sub 2 div sub dy edge sub EU 0 dy 2 div add EU lineto
      0 dx dy sub 2 div add dy edge add EU 0 dy 2 div add EU lineto
      0 dx 2 div add EU                    0 dy edge  add EU lineto
      0 dx 2 div add EU                    0 dy edge  sub EU lineto
      0 dx dy sub 2 div add dy edge add EU 0 dy 2 div sub EU lineto
      0 dx dy sub 2 div sub dy edge sub EU 0 dy 2 div sub EU lineto
      0 dx 2 div sub EU                    0 dy edge  sub EU lineto
   closepath
   fill
   grestore
   } def

% the real drawing size:

/MinDrawX      0 EU def
/MinDrawY      0 EU def
/MaxDrawX 1017088 EU def
/MaxDrawY 922880 EU def

% the usable page size:

/LeftMargin 0.25 inch def  % change these if drawing gets clipped!
/BotMargin  0.25 inch def
/PageWidth   7.7500 inch def
/PageHeight 11.0000 inch def

% are we going to rotate?:

/RotateDrawing 0 0 ne def

% Media size functions:

/AbortMessage {  % Show a message in a box and stop printing
   /h 100 def
   /Courier findfont 12 scalefont setfont
   mediawidth pagemargin sub h 1 setpage
   newpath
   0 0 moveto
   0 h rlineto
   mediawidth pagemargin sub 0 rlineto
   0 h neg rlineto
   closepath
   5 setlinewidth
   stroke
   newpath 50 60 moveto (ERROR: Jobsize exceeds physical printing area!) show
   newpath 50 40 moveto (       Job has been aborted!) show
   showpage
   stop
   } def

/SelectPage {  % Select the page identified by Row and Column
   /Column exch def
   /Row    exch def

   % the actually exposed area (if the machine knows these parameters!):

   /DrawX MaxDrawX MinDrawX sub def
   /DrawY MaxDrawY MinDrawY sub def
   statusdict /setpage known
   statusdict /mediawidth known and
   statusdict /medialength known and
   statusdict /pagemargin known and {
      % this is for machines that can tell the media size:
      statusdict begin
         /MediaW mediawidth pagemargin sub def
         DrawX DrawY ge {
            DrawX MediaW le DrawY medialength le and {
               MediaW DrawY 1 setpage
               MediaW DrawX sub 2 div 0 translate
               }{
            DrawY MediaW le DrawX medialength le and {
               MediaW DrawX 0 setpage
               0 MediaW DrawY sub 2 div translate
               }{
               AbortMessage
               } ifelse
               } ifelse
            }{
            DrawY MediaW le DrawX medialength le and {
               MediaW DrawX 0 setpage
               0 MediaW DrawY sub 2 div translate
               }{
            DrawX MediaW le DrawY medialength le and {
               MediaW DrawY 1 setpage
               MediaW DrawX sub 2 div 0 translate
               }{
               AbortMessage
               } ifelse
               } ifelse
            } ifelse
         end
      }{
      % this is for machines that can NOT tell the media size:
      % (Ghostscript doesn't like this!)
      /Product product length string def
      /i 0 def
      product { dup 97 lt { 32 add } if Product exch i exch put /i i 1 add def } forall 
      Product (ghostscript) search dup /IsGhostscript exch def
      { pop pop } if
      pop
      IsGhostscript not {
         statusdict /setpage known {
            statusdict begin
               RotateDrawing {
                  LeftMargin PageHeight add BotMargin DrawY add
                  }{
                  BotMargin DrawY add LeftMargin DrawX add 
                  } ifelse
               0 setpage
               end
            } if
         } if
      % set clipping boundary:
      newpath
      LeftMargin BotMargin moveto
      0 PageHeight rlineto
      PageWidth  0 rlineto
      0 PageHeight neg rlineto
      closepath
      clip
      % set the origin:
      LeftMargin BotMargin translate
      RotateDrawing {
         0 PageHeight translate
         -90 rotate
         PageHeight Column mul neg PageWidth Row mul neg translate
         }{
         PageWidth Column mul neg PageHeight Row mul neg translate
         } ifelse
      } ifelse
   % move the lower left corner of the drawing to the origin:
   MinDrawX neg MinDrawY neg translate
   
   % Linestyle:
   
   1 setlinecap
   1 setlinejoin
   
   } def

% TheDrawing

gsave 0 0 SelectPage
73830 66938 15000 0 c
71290 787028 15000 0 c
962830 65668 15000 0 c
961560 789568 15000 0 c
645330 822588 16256 0 c
531030 822588 16256 0 c
showpage grestore