summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/metafont/mftoeps/m2esamp/sample4.mf
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/metafont/mftoeps/m2esamp/sample4.mf')
-rw-r--r--Master/texmf-dist/source/metafont/mftoeps/m2esamp/sample4.mf45
1 files changed, 45 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/metafont/mftoeps/m2esamp/sample4.mf b/Master/texmf-dist/source/metafont/mftoeps/m2esamp/sample4.mf
new file mode 100644
index 00000000000..37acefb4d05
--- /dev/null
+++ b/Master/texmf-dist/source/metafont/mftoeps/m2esamp/sample4.mf
@@ -0,0 +1,45 @@
+%%%%
+%%%% This file belongs to the MFTOEPS package.
+%%%%
+% ---
+% SAMPLE4.MF
+% ---
+input mftoeps;
+input polygons;
+eps_mode_setup;
+% ---
+def write_paths(expr name) =
+ find_BB elem_path1;
+ write_preamble name;
+ for i:=1 upto objects:
+ coeff:=
+ if objects=1: 0 else: .5(1-cosd(((i-1)/(objects-1))[alpha1,alpha2])) fi;
+ fix_fill_cmyk forsuffixes $:=cyan, magenta, yellow: coeff[$1,$2], endfor
+ coeff[black1,black2];
+ fill_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:=100; transitions:=.5; % regular 2
+ sca1:=w; sca2:=.05w;
+ rot1:=0; rot2:=(ch/ch_max)[0,-360];
+ alpha1:=0; alpha2:=transitions*360;
+ cyan1:=0; magenta1:=0; yellow1:=0; black1:=0.05;
+ cyan2:=0; magenta2:=0; yellow2:=0; black2:=0.9;
+ for i:=1 upto objects:
+ coeff:=if objects=1: 0 else: (i-1)/(objects-1) fi;
+ elem_path[i]:= flex_polygon(6,(coeff**.1)[-30,0],(coeff**.1)[30,0])
+ scaled (coeff[sca1,sca2])
+ rotated (coeff[rot1,rot2]+30) shifted (.5w,.5h);
+ endfor
+ write_paths(jobname & char(ASCII("a")+ch));
+ endchar;
+endfor
+% ---
+end.