| 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 roex_default |
| 6 |
% RO-04.MF, ``EOFILL'': |
| 7 |
% Removing overlaps performed in two stages: first stage removes overlaps |
| 8 |
% using even-odd filling rule, the second stage restores default meanings |
| 9 |
% of |good_colors| and |touch_path| and performs ``traditional'' removing |
| 10 |
% overlaps on the result of stage 1 and a positively oriented rectangle. |
| 11 |
% --- |
| 12 |
input mftoeps; eps_mode_setup; input roex; tracingremoving:=1; |
| 13 |
% --- |
| 14 |
beginchar("0",in#,in#,0); |
| 15 |
path A,B,C,D,E,F; |
| 16 |
A=fullcircle scaled 1w shifted (1/2w,1/2h); |
| 17 |
B=fullcircle scaled 4/5w shifted (1/2w,1/2h); |
| 18 |
C=fullcircle scaled 3/5w shifted (1/2w,1/2h); |
| 19 |
D=fullcircle scaled 2/5w shifted (1/2w,1/2h); |
| 20 |
E=unitsquare xscaled 1/5w yscaled 9/10h shifted (2/5w,1/20h); |
| 21 |
F=unitsquare xscaled 7/5w yscaled 1/5h shifted (-1/5w,2/5h); |
| 22 |
% |
| 23 |
% STAGE 1: remove overlaps for |A|, |B|, |C|, |D| and |E| using |
| 24 |
% the `eofill' rule (the re-definition of |touch_path| is superfluous here, |
| 25 |
% but recommended in a general case): |
| 26 |
vardef good_colors(expr i,o) = odd(i) and odd(o+1) enddef; |
| 27 |
vardef touch_path(expr p) = pos_turn(p) enddef; |
| 28 |
remove_overlap (A,B,C,D,E) () R; |
| 29 |
% STAGE 2: remove overlaps for |F| and the paths resulting from the stage 1: |
| 30 |
roex_default good_colors, touch_path; |
| 31 |
remove_overlap (F,make_list(1,R.num) R) () R; |
| 32 |
% |
| 33 |
find_BB make_list(1,R.num) R; |
| 34 |
write_preamble jobname; |
| 35 |
fix_fill_cmyk 0,0,0,1/10; |
| 36 |
fill_C make_list(1,R.num) R; |
| 37 |
for i:=1 upto R.num: |
| 38 |
fix_draw_cmyk if check_turn(R[i])>0: 0,1,1,0 else: 1,1,0,0 fi; |
| 39 |
draw_C R[i]; |
| 40 |
if proofing>0: |
| 41 |
for j:=0 upto length(R[i])-1: |
| 42 |
makelabel(decimal(j) & "/" & decimal(i),point j of R[i]); |
| 43 |
endfor |
| 44 |
fi |
| 45 |
endfor; |
| 46 |
write_postamble; |
| 47 |
endchar; |
| 48 |
end. |
| 49 |
%%\end |