summaryrefslogtreecommitdiff
path: root/info/examples/lgc2/4-1-11.mp
blob: d952ca57fe52f81a8054d22999598b30b8f26e5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
% --- 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;