Debian Codegraph @

texmf-dist/source/metafont/roex/roexsamp/roes-01.mf

raw
1 %%%%
2 %%%% This file belongs to the ROEX package.
3 %%%%
4 %%% draw write_preamble write_postamble find_BB set_BB fill_C draw_C
5 %%% draw fix_fill_cmyk fix_draw_cmyk
6 % ROES-01.MF, ``SUN'':
7 % An example making use of both expanding stroke and removing overlaps.
8 % ---
9 input mftoeps; eps_mode_setup; input roex;
10 tracingexpanding:=1; tracingremoving:=1;
11 % ---
12 beginchar("0",in#,in#,0);
13 path Q,R[\\]; R.num:=0;
14 M:=12; % number of half-periods of a sine wave
15 N:=11; % number of gaps
16 H:=h/(2N); W=1.2w;
17 Q:=reverse for i:=0 upto M: if i>0: .. fi
18 ((i/M)[1/2(w-W),w-1/2(w-W)],1/2sind(90(i mod 4))*H)
19 endfor;
20 %
21 expand_stroke(Q)(1/2H)R; Q:=reverse R1; R.num:=0;
22 if proofing>0:
23 for j:=0 upto length(Q)-1: makelabel("Q" & decimal(j),point j of Q); endfor
24 fix_line_width 1; draw_C Q;
25 fi
26 for i:=1 upto N: R[incr R.num]:=Q shifted (0,(2i-1)*H); endfor
27 R[incr R.num]:=fullcircle scaled w shifted (.5w,.5h);
28 %
29 remove_overlap(make_list(1,R.num) R)() R;
30 find_BB make_list(1,R.num) R;
31 write_preamble jobname;
32 for i:=1 upto R.num:
33 fix_fill_cmyk 0,((i-1)/(R.num-1))[1,0],1,0; fill_C R[i];
34 endfor;
35 write_postamble;
36 endchar;
37 end.
38 %%\end