diff options
Diffstat (limited to 'Master/texmf-dist/source/metafont/mftoeps/m2esamp/stereo.mf')
-rw-r--r-- | Master/texmf-dist/source/metafont/mftoeps/m2esamp/stereo.mf | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/metafont/mftoeps/m2esamp/stereo.mf b/Master/texmf-dist/source/metafont/mftoeps/m2esamp/stereo.mf new file mode 100644 index 00000000000..c3e85ec53fe --- /dev/null +++ b/Master/texmf-dist/source/metafont/mftoeps/m2esamp/stereo.mf @@ -0,0 +1,53 @@ +%%%% +%%%% This file belongs to the MFTOEPS package. +%%%% +% --- +% STEREO.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; + for i:=1 upto objects: + coeff:= + if objects=1: 0 else: .5(1-cosd(((i-1)/(objects-1))[alpha1,alpha2])) fi; + coeff:=if coeff>.5: 1 else: 0 fi; + fix_fill_cmyk forsuffixes $:=cyan, magenta, yellow: coeff[$1,$2], endfor + coeff[black1,black2]; + fill_C elem_path[i]; + endfor; + write_postamble; +enddef; +% --- +for ch:=0,1: + beginchar("0",117pt#, 117pt#, 0); + path elem_path[\\]; + objects:=100; transitions:=7; + pair cent[\\]; + sca1:=.5w; sca2:=.01w; + skew1:=60; skew2:=0; + alpha1:=0; alpha2:=transitions*360; + cshift0:=-.02w; cshift1:=-cshift0; + cent1:=(.5w,.5h); + rot1:=0; rot2:=rot1+60; + cent2:=(.5w+cshift[ch],.49h); + cyan1:=0; magenta1:=0; yellow1:=0; black1:=1; + cyan2:=0; magenta2:=0; yellow2:=0; black2:=0; + for i:=1 upto objects: + if objects=1: coeff:=0; else: coeff:=(i-1)/(objects-1); fi + elem_path[i]:= soft_polygon(4,coeff[skew1,skew2]) + scaled (coeff[sca1,sca2]) + rotated (coeff[rot1,rot2]+30) + shifted (coeff[cent1,cent2]); + endfor + write_paths(jobname & decimal(ch)); +endchar; + +endfor + +end. |