| 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 |
% RO-05.MF, ``GERBERA'': |
| 7 |
% Non-standard application of removing overlaps; areas covered a specified |
| 8 |
% number of times are collected separately using the macro |recombine_edges| |
| 9 |
% (performing the last step of removing overlaps), and each area is painted |
| 10 |
% with a different colour, yielding a gerbera-like form. |
| 11 |
% --- |
| 12 |
input mftoeps; eps_mode_setup; input roex; tracingremoving:=1; |
| 13 |
% --- |
| 14 |
beginchar("0",in#,in#,0); |
| 15 |
path R[\\],V[\\][\\]; |
| 16 |
N:=9; |
| 17 |
R.num:=0; |
| 18 |
R[incr R.num]=fullcircle xscaled 1/5w yscaled h shifted (1/2w,1/2h); |
| 19 |
for i:=1 upto N-1: |
| 20 |
R[incr R.num]=R[R.num-1] rotatedaround((0.5w,.5h), 180/N); |
| 21 |
endfor |
| 22 |
% |
| 23 |
remove_overlap (make_list(1,R.num)R)() R; % dummy result |
| 24 |
col.min:=infinity; col.max:=-infinity; |
| 25 |
for i:=-EDGE_.num upto EDGE_.num : if i<>0: |
| 26 |
col.min:=min(EDGE_.col[i],col.min); |
| 27 |
col.max:=max(EDGE_.col[i],col.max); |
| 28 |
fi endfor; |
| 29 |
col.min:=max(1,col.min); |
| 30 |
for k:=col.min upto col.max: |
| 31 |
vardef good_colors(expr i,j) = (i=k) enddef; |
| 32 |
message "recombine_edges: color=" & decimal(k); recombine_edges(V[k]); |
| 33 |
endfor; |
| 34 |
set_BB 0,0,w,h; write_preamble jobname; |
| 35 |
for k:=col.min upto col.max: |
| 36 |
if V[k]num>0: |
| 37 |
fix_fill_cmyk 0,3/4((((k-col.min)/(col.max-col.min))**1/2)[1,0]),1,0; |
| 38 |
fill_C make_list(1,V[k]num)V[k]; |
| 39 |
fi |
| 40 |
endfor |
| 41 |
write_postamble; |
| 42 |
endchar; |
| 43 |
end. |
| 44 |
%%\end |
| 45 |
|