summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/featpost/example/CAT.mp
blob: 2afe9da095dd271193a0a995ce03c3c8c4d17571 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
beginfig(1);
	path pat[];
	numeric i, a, sidel;
	sidel = 2cm;
	pickup pencircle scaled 3pt;
	pair pa, pb, pc, pd;
	for i=4 upto 10:
		a := 360/i;
		pa := origin+(i-4)*right*1.5*sidel;
		pb := pa+right*sidel;
		pd := pa+dir(a)*sidel;
		pc := pb+dir(a)*sidel;
		pat[i] = pa--pb--pc--pd--cycle;
	endfor;
	z0 = (0,2.5*sidel);
	z1 = z0+2*right*sidel;
	z2 = z0+2*dir(60)*sidel;
	pat0 = z0--z1--z2--cycle;
	z3 = z1+1.5*right*sidel;
	z4 = z3+right*sidel;
	z5 = z4+dir(60)*sidel;
	z6 = z5+dir(120)*sidel;
	z8 = z3+dir(120)*sidel;
	z7 = z8+dir(60)*sidel;
	pat1 = z3--z4--z5--z6--z7--z8--cycle;
	z9 = z4+1.5*right*sidel;
	z10= z9+right*sidel;
	z11= z10+dir(60)*sidel;
	z12= z11+dir(120)*sidel;
	z14= z9+dir(60)*sidel;
	z13= z14+dir(120)*sidel;
	pat2 = z9--z10--z11--z12--z13--z14--cycle;
	z15= z10+1.5*right*sidel;
	z16= z15+right*sidel;
	z17= z16+dir(60)*sidel;
	z18= z15+2*dir(60)*sidel;
	pat3 = z15--z16--z17--z18--cycle;
	background := 0.85white;
	for i = 0 upto 10:
		unfill pat[i];
		draw pat[i];
	endfor;
endfig;

end.