| 1 |
%%%% |
| 2 |
%%%% This file belongs to the ROEX package. |
| 3 |
%%%% |
| 4 |
%%% draw write_preamble write_postamble find_BB set_BB fill_C clip_C |
| 5 |
%%% draw fix_fill_cmyk fix_draw_cmyk |
| 6 |
% ROES-03.MF, ``OLYMPIC CIRCLES'': |
| 7 |
% Yet another example making use of both expanding stroke and removing |
| 8 |
% overlaps; it also demonstrates repositioning of the picture in such |
| 9 |
% a way that the lower left corner of the bounding box coincides with |
| 10 |
% the origin of coordinate system. |
| 11 |
input mftoeps; eps_mode_setup; input roex; |
| 12 |
tracingremoving:=1; tracingexpanding:=1; |
| 13 |
% --- |
| 14 |
beginchar("0",in#,in#,0); % temporary values |
| 15 |
path A[]; |
| 16 |
for i:=1,2,3,4,5: |
| 17 |
A[i]:=fullcircle scaled w shifted |
| 18 |
(floor(i/4)*(1/2sqrt(3)*w,0)+1/2w*(up rotated (120i+60))); |
| 19 |
endfor |
| 20 |
expand_stroke (A1,A2,A3,A4,A5) (.5mm) R; |
| 21 |
remove_overlap (make_list(1,R.num)R) () R; |
| 22 |
% setting of intermediate colors: |
| 23 |
k:=0; % the number of intermediate colors |
| 24 |
C[incr k]=0; M[k]=1; Y[k]=1; K[k]:=0; |
| 25 |
C[incr k]=0; M[k]=0; Y[k]=1; K[k]:=0; |
| 26 |
C[incr k]=0.25; M[k]=0; Y[k]=0.75; K[k]:=0; |
| 27 |
C[incr k]=1; M[k]=0.5; Y[k]=0; K[k]:=0; |
| 28 |
C[incr k]=0.3; M[k]=1; Y[k]=0; K[k]:=0; |
| 29 |
l:=30; % the number of interpolation steps |
| 30 |
m=l*(k-1); % the number of strips |
| 31 |
find_BB make_list(1,R.num)R; |
| 32 |
% repositioning of the picture: |
| 33 |
for i:=1 upto R.num: R[i]:=R[i] shifted -llxy; endfor |
| 34 |
m*w'=xh_crd:=xh_crd-xl_crd; xl_crd:=0; |
| 35 |
h'=yh_crd:=yh_crd-yl_crd; yl_crd:=0; |
| 36 |
% exporting: |
| 37 |
write_preamble jobname; |
| 38 |
clip_C make_list(1,R.num)R; |
| 39 |
n:=0; |
| 40 |
for i:=1 upto k-1: for j:=0 upto l-1: |
| 41 |
n:=n+1; |
| 42 |
fix_fill_cmyk |
| 43 |
forsuffixes $=C,M,Y,K: (j/(l-1))[$[i],$[i+1]] if str$ <> "K": , fi endfor; |
| 44 |
fill_C unitsquare xscaled 11/10w' yscaled h' shifted ((n-1)*w'-1/20w',0); |
| 45 |
endfor endfor |
| 46 |
write_postamble; |
| 47 |
endchar; |
| 48 |
end. |
| 49 |
%%\end |