summaryrefslogtreecommitdiff
path: root/info/examples/lgc2/4-1-4.mp
blob: 6e84a7dbd843ea0f6e37096ff9f1dfa8656407ea (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
25
26
% --- start of displayed preamble in the book ---
vardef hiddenpath(expr under,over)=
  save p,q;
  picture p,q;
  p=image(draw under);clip p to over;
  undraw p;
  q=image(draw under dashed evenly);
  clip q to over;
  draw q;
enddef;
% --- end of displayed preamble in the book ---
defaultfont:="ptmr8r";
warningcheck:=0;
beginfig(1)
path p[];
p1=fullcircle scaled 3cm;
p2=fullcircle scaled 2cm shifted (2cm,0);
p3=fullcircle scaled 4cm shifted (1.5cm,2cm);
draw p1; % we draw the three circles totally
draw p2;
draw p3;
hiddenpath(p1,p2); % p1 hidden by p2
hiddenpath(p1,p3); % p1           p3
hiddenpath(p3,p2); % p3           p2
endfig;
end;