Debian Codegraph @

texmf-dist/fonts/source/public/circ/cioptic.mf

raw
1 %%
2 %% This is file `cioptic.mf',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% circ.dtx (with options: `optic')
8 %% CIRC is a LaTeX package to typeset circuit and optics diagrams.
9 %% Copyright (C) 1997,1998,2003 Sebastian Tannert and Andreas Tille
10 %%
11 %% This program is free software; you can redistribute it and/or modify
12 %% it under the terms of the GNU General Public License as published by
13 %% the Free Software Foundation; either version 2 of the License, or
14 %% (at your option) any later version.
15 %%
16 %% This program is distributed in the hope that it will be useful,
17 %% but WITHOUT ANY WARRANTY; without even the implied warranty of
18 %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 %% GNU General Public License for more details.
20 %%
21 %% You should have received a copy of the GNU General Public License
22 %% along with this program; if not, write to the Free Software
23 %% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 %%
25 %% For error reports concerning UNCHANGED versions of this file no
26 %% more than one year old, see CIRC.DVI after installation.
27 %% If installation fails search thru this file for 'bug'.
28 input csym;
29
30 string optionname; optionname="optics";
31
32 font_identifier="cioptic";
33
34 input defcirc;
35
36 hsoa:=.128CIu;
37
38 slens_ht# := 2CIu#;
39 slens_lt# := 2CIu#;
40 slens_phi := 60;
41 slens_spc := .55CIu;
42 define_pixels(slens_lt,slens_ht);
43
44 blens_ht# := 2CIu#;
45 blens_lt# := 2CIu#;
46 blens_phi := 45;
47 blens_spc := .88CIu;
48 define_pixels(blens_lt,blens_ht);
49
50 sklens_ht# := 2CIu#;
51 sklens_lt# := 2CIu#;
52 sklens_phi := 60;
53 sklens_spc := .58CIu;
54 sklens_bt := 1CIu; % Breite Bottom und Top
55 define_pixels(sklens_lt,sklens_ht);
56
57 mir_ht# := 2CIu#;
58 mir_lt# := 2CIu#;
59 mir_wd := .5CIu; % Schraffurl"ange
60 define_pixels(mir_ht,mir_lt);
61
62 omb_wd# := 3CIu#;
63 omb_ht# := 2CIu#;
64 lab_wd# := 4CIu#;
65 lab_ht# := 2CIu#;
66 define_pixels(omb_wd,omb_ht,lab_wd,lab_ht);
67
68 pol_ht# := 2CIu#;
69 pol_lt# := 2CIu#;
70 pol_spc := .2CIu;
71 define_pixels(pol_ht,pol_lt);
72
73 pin_ht# := 2CIu#;
74 pin_lt# := 2CIu#;
75 pin_spx := .16CIu;
76 pin_spy := .08CIu;
77 pin_spz := .5CIu;
78 define_pixels(pin_ht,pin_lt);
79
80 cam_ht# := 2CIu#;
81 cam_lt# := 3CIu#;
82 cam_spx := 2CIu;
83 cam_spy := 1CIu;
84 define_pixels(cam_ht,cam_lt);
85
86 scr_ht# := 4CIu#;
87 scr_lt# := 2CIu#;
88 scr_spx := 1CIu;
89 scr_spy := 1CIu;
90 define_pixels(scr_ht,scr_lt);
91
92 def rectangle(expr width, height, xs, ys) =
93 draw (xs,.5height+ys)--(width+xs,.5height+ys)--(width+xs,-.5height+ys)--
94 (xs,-.5height+ys)--cycle;
95 enddef;
96
97 def small_lens =
98 pickup pensquare scaled normalline;
99 numeric pl;
100 pl:=.5(slens_lt-slens_spc);
101 z0=(.5slens_lt,-.5slens_ht);
102 z1=(.5slens_lt,.5slens_ht);
103 z2=(.5CIu,0); z3=z2+(hsoa,0);
104 z4=(slens_lt-.5CIu,0); z5=z4-(hsoa,0);
105 draw z0{dir slens_phi}..z1;
106 draw z0{dir (180-slens_phi)}..z1;
107 opticalaxis(normalline)(0);
108 opticalaxis(normalline)(1CIu);
109 enddef;
110
111 def half_small_lens =
112 pickup pensquare scaled normalline;
113 numeric pl;
114 pl:=.5(slens_lt-slens_spc);
115 z0=(.5slens_lt,-.5slens_ht);
116 z1=(.5slens_lt,.5slens_ht);
117 z4=(slens_lt-.5CIu,0); z5=z4-(hsoa,0);
118 draw z0{dir slens_phi}..z1;
119 draw z1--z0;
120 opticalaxis(normalline)(0);
121 opticalaxis(normalline)(1CIu);
122 enddef;
123
124 def bold_lens =
125 pickup pensquare scaled normalline;
126 numeric pl;
127 pl:=.5(blens_lt-blens_spc);
128 z0=(.5blens_lt,-.5blens_ht);
129 z1=(.5blens_lt,.5blens_ht);
130 draw z0{dir blens_phi}..z1;
131 draw z0{dir (180-blens_phi)}..z1;
132 opticalaxis(normalline)(0);
133 opticalaxis(normalline)(1CIu);
134 enddef;
135
136 def half_bold_lens =
137 pickup pensquare scaled normalline;
138 numeric pl;
139 pl:=.5(blens_lt-blens_spc);
140 z0=(.5blens_lt,-.5blens_ht);
141 z1=(.5blens_lt,.5blens_ht);
142 draw z0{dir blens_phi}..z1;
143 draw z1--z0;
144 opticalaxis(normalline)(0);
145 opticalaxis(normalline)(1CIu);
146 enddef;
147
148 def small_konkav_lens =
149 pickup pensquare scaled normalline;
150 numeric pl, ql;
151 pl:=.5(sklens_lt-sklens_spc);
152 ql:=.5(sklens_lt-sklens_bt);
153 z0=(ql,-.5sklens_ht);
154 z1=(sklens_lt-ql,-.5sklens_ht);
155 z2=(ql,.5sklens_ht);
156 z3=(sklens_lt-ql,.5sklens_ht);
157 z4=(.5CIu,0); z5=z4+(hsoa,0);
158 z6=(sklens_lt-.5CIu,0); z7=z6-(hsoa,0);
159 draw z0{dir sklens_phi}..z2--z3{dir (180+sklens_phi)}..z1--z0;
160 draw z4--z5; draw z6--z7;
161 opticalaxis(normalline)(0);
162 opticalaxis(normalline)(1CIu);
163 enddef;
164
165 def half_small_konkav_lens =
166 pickup pensquare scaled normalline;
167 numeric pl, ql;
168 pl:=.5(sklens_lt-sklens_spc);
169 ql:=.5(sklens_lt+sklens_bt);
170 z0=(.5sklens_lt,-.5sklens_ht);
171 z1=(ql,-.5sklens_ht);
172 z2=(.5sklens_lt,.5sklens_ht);
173 z3=(ql,.5sklens_ht);
174 draw z0--z2--z3{dir (180+sklens_phi)}..z1--z0;
175 opticalaxis(normalline)(0);
176 opticalaxis(normalline)(1CIu);
177 enddef;
178
179 def mirror =
180 pickup pensquare scaled normalline;
181 opticalaxis(normalline)(0);
182 opticalaxisdown(normalline)(.5mir_lt,0);
183 halfmirror;
184 pickup pensquare scaled thinline;
185 for i=.125 step .125 until .875:
186 draw (i*mir_lt,(.5-i)*mir_ht)--(mir_wd+i*mir_lt,mir_wd+(.5-i)*mir_ht);
187 endfor
188 enddef;
189
190 def halfmirror =
191 pickup pensquare scaled thickline;
192 draw (.5mir_wd,.5(mir_ht-mir_wd))--(mir_lt-.5mir_wd,.5(mir_wd-mir_ht));
193 enddef;
194
195 def halfmirrorline =
196 pickup pensquare scaled normalline;
197 opticalaxis(normalline)(0);
198 opticalaxisdown(normalline)(.5mir_lt,.5mir_ht);
199 opticalaxisdown(normalline)(.5mir_lt,0);
200 enddef;
201
202 def polarizer =
203 pickup pensquare scaled thinline;
204 numeric pl;
205 pl:=.5(pol_lt-pol_spc);
206 z0=(pl,.5pol_ht);
207 z1=z0+(0,-pol_ht);
208 z2=z1+(pol_spc,0);
209 z3=z0+(pol_spc,0);
210 draw z0--z1--z2--z3--cycle;
211 % optical axis
212 opticalaxis(normalline)(0);
213 opticalaxis(normalline)(1CIu);
214 enddef;
215
216 def pinhole =
217 pickup pensquare scaled thinline;
218 numeric pl;
219 pl:=.5(pin_lt-pin_spx);
220 fill (.5pin_lt,.5pin_spy)--(pl,.5pin_spz)--(pl,.5pin_ht)--
221 (pl+pin_spx,.5pin_ht)--(pl+pin_spx,.5pin_spz)--cycle;
222 fill (.5pin_lt,-.5pin_spy)--(pl,-.5pin_spz)--(pl,-.5pin_ht)--
223 (pl+pin_spx,-.5pin_ht)--(pl+pin_spx,-.5pin_spz)--cycle;
224 % optical axis
225 opticalaxis(normalline)(0);
226 opticalaxis(normalline)(1CIu);
227 enddef;
228
229 def screenleft (expr gray) =
230 pickup pensquare scaled normalline;
231 path a, b;
232 numeric pl;
233 pl:=.5(scr_lt-scr_spx);
234 z0=(pl,.5scr_ht);
235 z1=(pl+scr_spx,scr_spy);
236 z2=(pl+scr_spx,-.5scr_ht);
237 z3=(pl,-scr_spy);
238 draw z0--z1--z2--z3--cycle;
239 a:=z0--z1;
240 b:=z2--z3;
241 vshade(b, a, gray, unitsquare);
242 enddef;
243
244 def screenright (expr gray) =
245 pickup pensquare scaled normalline;
246 path a, b;
247 numeric pl;
248 pl:=.5(scr_lt-scr_spx);
249 z0=(pl,-.5scr_ht);
250 z1=(pl,scr_spy);
251 z2=(pl+scr_spx,.5scr_ht);
252 z3=(pl+scr_spx,-scr_spy);
253 draw z0--z1--z2--z3--cycle;
254 a:=z1--z2;
255 b:=z3--z0;
256 vshade(b, a, gray, unitsquare);
257 enddef;
258
259 def opticalaxis(expr linethickness)(expr offset) =
260 pickup pensquare scaled linethickness;
261 draw (offset,0)--(offset+hsoa,0);
262 draw (offset+3hsoa,0)--(offset+5hsoa,0);
263 draw (offset+7hsoa,0)--(offset+1CIu,0);
264 enddef;
265
266 def halfopticalaxis(expr linethickness)(expr offset) =
267 pickup pensquare scaled linethickness;
268 draw (offset,0)--(offset+hsoa,0);
269 draw (offset+3hsoa,0)--(offset+.5CIu,0);
270 enddef;
271
272 def opticalaxisdown(expr linethickness)(expr xoffset, yoffset) =
273 pickup pensquare scaled linethickness;
274 draw (xoffset,yoffset)--(xoffset,yoffset-hsoa);
275 draw (xoffset,yoffset-3hsoa)--(xoffset,yoffset-5hsoa);
276 draw (xoffset,yoffset-7hsoa)--(xoffset,yoffset-1CIu);
277 enddef;
278
279 def halfopticalaxisdown(expr linethickness)(expr xoffset, yoffset) =
280 pickup pensquare scaled linethickness;
281 draw (xoffset,yoffset)--(xoffset,yoffset-hsoa);
282 draw (xoffset,yoffset-3hsoa)--(xoffset,yoffset-.5CIu);
283 enddef;
284
285 def camera =
286 pickup pensquare scaled thickline;
287 numeric pl;
288 pl:=cam_lt-cam_spx;
289 draw (pl,.25cam_spy)--(0,.5cam_spy)--(0,-.5cam_spy)--(pl,-.25cam_spy);
290 draw (pl,.5cam_ht)--(pl,-.5cam_ht)--(cam_lt,-.5cam_ht)--(cam_lt,.5cam_ht)--cycle;
291 enddef;
292
293 "SmalCIuns";
294 twochars(0)(small_lens)(.5slens_ht#,slens_lt#,.5slens_ht#);
295
296 "HalfSmalCIuns";
297 fourchars(2)(half_small_lens)((slens_lt,0))(.5slens_ht#,slens_lt#,.5slens_ht#);
298
299 "BoldLens";
300 twochars(6)(bold_lens)(.5blens_ht#,blens_lt#,.5blens_ht#);
301
302 "HalfBoldLens";
303 fourchars(8)(half_bold_lens)((blens_lt,0))(.5blens_ht#,blens_lt#,.5blens_ht#);
304
305 "SmallKonkavLens";
306 twochars(12)(small_konkav_lens)(.5sklens_ht#,sklens_lt#,.5sklens_ht#);
307
308 "HalfSmallKonkavLens";
309 fourchars(14)(half_small_konkav_lens)((sklens_lt,0))(.5sklens_ht#,sklens_lt#,.5sklens_ht#);
310
311 "Mirror";
312 eightchars(85)(mirror)(.5mir_lt#,.5mir_ht#,.5mir_ht#,.5mir_lt#);
313
314 "BeamSplitter";
315 eightchars(36)(halfmirror;halfmirrorline)(.5mir_lt#,.5mir_ht#,.5mir_ht#,.5mir_lt#);
316
317 "Polarizer";
318 twochars(44)(polarizer)(.5pol_ht#,pol_lt#,.5pol_ht#);
319
320 "Pinhole";
321 twochars(46)(pinhole)(.5pin_ht#,pin_lt#,.5pin_ht#);
322
323 "Camera";
324 fourchars(66)(camera)((cam_lt,0))(.5cam_ht#,cam_lt#,.5cam_ht#);
325
326 "ScreenLeft";
327 twochars(72)(screenleft(2);opticalaxis(normalline)(0))(.5scr_ht#,scr_lt#,.5scr_ht#);
328
329 "ScreenRight";
330 twochars(74)(screenright(2);opticalaxis(normalline)(1CIu))(.5scr_ht#,scr_lt#,.5scr_ht#);
331
332 "ScreenLeftBehind";
333 twochars(76)(screenleft(2);halfopticalaxis(normalline)(1.5CIu))(.5scr_ht#,scr_lt#,.5scr_ht#);
334
335 "ScreenRightBehind";
336 twochars(78)(screenright(2);halfopticalaxis(normalline)(0))(.5scr_ht#,scr_lt#,.5scr_ht#);
337
338 "VScreenLeft";
339 twochars(80)(screenleft(4);opticalaxis(normalline)(0);halfopticalaxis(normalline)(1.5CIu))(.5scr_ht#,scr_lt#,.5scr_ht#);
340
341 "VScreenRight";
342 twochars(82)(screenright(4);opticalaxis(normalline)(1CIu);halfopticalaxis(normalline)(0))(.5scr_ht#,scr_lt#,.5scr_ht#);
343
344 "horizontal dashed half line to the right";
345 beginchar(128,.5CIu#,0pt,0pt);
346 halfopticalaxis(normalline)(0);
347 endchar;
348
349 "horizontal dashed long line to the right";
350 beginchar(129,1CIu#,0pt,0pt);
351 opticalaxis(normalline)(0);
352 endchar;
353
354 "horizontal dashed half line to the left";
355 beginchar(130,.5CIu#,0pt,0pt);
356 halfopticalaxis(normalline)(-.5CIu);
357 endchar;
358
359 "horizontal dashed half line up";
360 beginchar(131,0pt,.5CIu#,0pt);
361 halfopticalaxisdown(normalline)(0,.5CIu);
362 endchar;
363
364 "horizontal dashed long line up";
365 beginchar(132,0pt,1CIu#,0pt);
366 opticalaxisdown(normalline)(0,1CIu);
367 endchar;
368
369 "horizontal dashed half line down";
370 beginchar(133,0pt,0pt,.5CIu#);
371 halfopticalaxisdown(normalline)(0,0);
372 endchar;
373
374 "bold horizontal dashed half line to the right";
375 beginchar(136,.5CIu#,0pt,0pt);
376 halfopticalaxis(2normalline)(0);
377 endchar;
378
379 "bold horizontal dashed long line to the right";
380 beginchar(137,1CIu#,0pt,0pt);
381 opticalaxis(2normalline)(0);
382 endchar;
383
384 "bold horizontal dashed half line to the left";
385 beginchar(138,.5CIu#,0pt,0pt);
386 halfopticalaxis(2normalline)(-.5CIu);
387 endchar;
388
389 "bold horizontal dashed half line up";
390 beginchar(139,0pt,.5CIu#,0pt);
391 halfopticalaxisdown(2normalline)(0,.5CIu);
392 endchar;
393
394 "bold horizontal dashed long line up";
395 beginchar(140,0pt,1CIu#,0pt);
396 opticalaxisdown(2normalline)(0,1CIu);
397 endchar;
398
399 "bold horizontal dashed half line down";
400 beginchar(141,0pt,0pt,.5CIu#);
401 halfopticalaxisdown(2normalline)(0,0);
402 endchar;
403
404 if unknown cmbase: input cmbase fi
405
406 tracingstats:=1;
407 picture r[];
408
409 def put_text(expr ts,xstart,ystart,rot,justification) =
410 begingroup
411 text_width:=0;text_height:=0;
412 for ind:=0 step 1 until length(ts)-1:
413 dec_num:=ASCII substring (ind,ind+1) of ts;
414 if unknown r[dec_num]: dec_num:=32; fi
415 if dec_num=32:
416 text_width:=text_width+wd[65];
417 text_height:=max(text_height,ht[65]+dp[65]);
418 elseif dec_num>=0:
419 text_width:=text_width+wd[dec_num];
420 text_height:=max(text_height,ht[dec_num]+dp[dec_num]);
421 fi
422 endfor
423 if rot=90:
424 if justification=1: ynext:=ystart;
425 elseif justification=2: ynext:=round(ystart-text_width/2);
426 else: ynext:=round(ystart-text_width);
427 fi
428 xnext:=xstart+text_height/2;
429 else:
430 if justification=1: xnext:=xstart;
431 elseif justification=2: xnext:=round(xstart-text_width/2);
432 else: xnext:=round(xstart-text_width);
433 fi
434 ynext:=ystart-text_height/2;
435 fi
436 for ind:=0 step 1 until length(ts)-1:
437 dec_num:=ASCII substring (ind,ind+1) of ts;
438 if unknown r[dec_num]: dec_num:=32; fi
439 if dec_num=32:
440 xnext:=xnext+wd[65]*cosd rot;
441 ynext:=ynext+wd[65]*sind rot;
442 elseif dec_num>=0:
443 currentpicture:=currentpicture+r[dec_num] shifted(xnext,ynext)
444 rotatedaround ((xnext,ynext),rot);
445 xnext:=xnext+wd[dec_num]*cosd rot;
446 ynext:=ynext+wd[dec_num]*sind rot;
447 fi
448 endfor
449 endgroup
450 enddef;
451
452 def endchar =
453 r[charcode]:=currentpicture;
454 wd[charcode]:=w;ht[charcode]:=h;dp[charcode]:=d;
455 endgroup;
456 enddef;
457 let endchar_ = endchar;
458 let generate = relax;
459 let roman = relax;
460 input cmss10.mf
461 if ligs>1: font_coding_scheme:="TeX text";
462 else: font_coding_scheme:=
463 if ligs=0: "TeX typewriter text"
464 else: "TeX text without f-ligatures" fi;
465 fi
466 font_setup;
467 input romanu.mf %Roman uppercase.
468 input romanl.mf %Roman lowerrcase.
469
470 def endchar =
471 % Next line should probably be removed if CM base is used
472 %Include the next two lines if you want to
473 %rotate the picture 90 deg.(Portrait to Landscape)
474 %currentpicture:=currentpicture rotated 90 shifted (h,0);
475 %tmp:=charht; charht:=charwd; charwd:=tmp;
476 scantokens extra_endchar;
477 if proofing>0: makebox(proofrule); fi
478 chardx:=w;
479 shipit;
480 if displaying>0: makebox(screenrule); showit; fi
481 endgroup
482 enddef;
483 let endchar_ = saveendchar;
484 let generate = input;
485 let roman = roman;
486 def t_ = transformed currenttransform enddef;
487
488 "Laser Box horizontal";
489 beginchar(160,lab_wd#,.5lab_ht#,.5lab_ht#);
490 pickup pensquare scaled thickline;
491 rectangle(lab_wd,lab_ht,0,0);
492 pickup pencircle scaled normalline;
493 put_text("Laser",.5lab_wd,0,0,2);
494 endchar;
495
496 "Laser Box vertical";
497 beginchar(161,.5lab_ht#,lab_wd#,.5lab_ht#);
498 pickup pensquare scaled thickline;
499 rectangle(lab_ht,lab_wd,-.5lab_ht,.5lab_wd);
500 pickup pencircle scaled normalline;
501 put_text("Laser",0,.5lab_wd,90,2);
502 endchar;
503
504 "Photometer Box horizontal";
505 beginchar(162,omb_wd#,.5omb_ht#,.5omb_ht#);
506 pickup pensquare scaled thickline;
507 rectangle(omb_wd,omb_ht,0,0);
508 pickup pencircle scaled normalline;
509 put_text("PM",.5omb_wd,0,0,2);
510 endchar;
511
512 "Photometer Box vertical";
513 beginchar(163,.5omb_ht#,omb_wd#,.5omb_ht#);
514 pickup pensquare scaled thickline;
515 rectangle(omb_ht,omb_wd,-.5omb_ht,.5omb_wd);
516 pickup pencircle scaled normalline;
517 put_text("PM",0,.5omb_wd,90,2);
518 endchar;
519
520 "Optical Modulator Box horizontal";
521 beginchar(164,omb_wd#,.5omb_ht#,.5omb_ht#);
522 pickup pensquare scaled thickline;
523 rectangle(omb_wd,omb_ht,0,0);
524 pickup pensquare scaled normalline;
525 put_text("OM",.5omb_wd,0,0,2);
526 endchar;
527
528 "Optical Modulator Box vertical";
529 beginchar(165,omb_ht#,.5omb_wd#,.5omb_wd#);
530 pickup pensquare scaled thickline;
531 rectangle(omb_ht,omb_wd,0,0); %-.5omb_ht,.5omb_wd);
532 pickup pensquare scaled normalline;
533 put_text("OM",.5omb_ht,0,90,2);
534 endchar;
535
536 end;
537 %%
538 %%
539 %% End of file `cioptic.mf'.