% --- start of displayed preamble in the book ---
input hatching;
vardef star(expr n) =
for i_:=0 upto 2n-1:
if odd i_: 1/2 fi (right rotated (180*(i_/n))) --
endfor cycle
enddef;
% --- end of displayed preamble in the book ---
% graphic converted to gray in book using 'color2gray'
defaultfont:="ptmr8r";
warningcheck:=0;
beginfig(1)
interim hatch_match:=0;
path p;
p:=star(10) xscaled 30mm
yscaled 20mm
rotated 20;
hatchfill p withcolor (0,1,.5);
draw image(hatchfill p
withcolor (45,3bp,-.5bp)
withcolor (-45,3bp,-.5bp);
) withcolor red dashed evenly;
endfig;
end;