summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/metafont/mftoeps/m2esamp/sample5.mf
blob: c7e0c7742b39a24767f3fa5674d950b92c95736d (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
%%%%
%%%% This file belongs to the MFTOEPS package.
%%%%
% ---
% SAMPLE5.MF
% ---
input mftoeps;
input polygons;
eps_mode_setup;
% ---
def soft_polygon (expr n,a) = flex_polygon(n,a-180/n,a+180/n) enddef;
% ---
def write_paths(expr name) =
 find_BB for i:=1 upto objects: elem_path[i], endfor elem_path[objects];
 write_preamble name;
 fix_line_width .2pt; for i:=1 upto objects: draw_C elem_path[i]; endfor;
 write_postamble;
enddef;
% ---
ch_max:=3;
% ---
for ch:=0 upto ch_max:
 beginchar(char(ASCII("a")+ch), 1in#, 1in#, 0);
  path elem_path[\\];
  objects:=17;
  sca1:=.85w; sca2:=.02w;
  rot1:=0; rot2:=(ch/ch_max)[5,120];
  skew1:=(ch/ch_max)[60,30]; skew2:=0;
  for i:=1 upto objects:
   coeff:=if objects=1: 0 else: (i-1)/(objects-1) fi;
   elem_path[i]:= soft_polygon(7,coeff[skew1,skew2])
    scaled (coeff[sca1,sca2]) rotated (coeff[rot1,rot2]+30) shifted (.5w,.5h);
  endfor
  write_paths(jobname & char(ASCII("a")+ch));
 endchar;
endfor
% ---
end.