summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/featpost/example/standard/unperfection.mp
blob: 0e95bc05451517d6aff6b20de47132353907c869 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
% unperfection.mp
% L. Nobre G.
% 2003

%input featpost3Dplus2D;

Spread := 70;
f := (10,4,5);

beginfig(1);
	numeric i, len, polelen;
	numeric fws, NumLines, linex, inray, outay, axray;
	numeric wang, poleray;
	path aro[], oneline;
	color axe, pole, polec, aroc; 	
	picture floorwall;
	len := 0.6;
	wang := 60;
	axe := (0,cosd(90-wang),sind(90-wang));
	pole := (0,1,0);
	fws := 4;
	polelen := 0.8*fws;
	outay := 0.45*fws;
	inray := 0.7*outay;
	poleray := 0.07*inray;
	NumLines := 30;
	for i=0 upto NumLines:
	    linex := fws*(i/NumLines-0.5);
	    oneline := rp((linex,0.5*fws,-0.5*fws))
                     --rp((linex,-0.5*fws,-0.5*fws))
                     --rp((linex,-0.5*fws,0.5*fws));
	    draw oneline withcolor (0.7*background);
	endfor;
	aroc := outay*(0,cosd(wang),sind(wang))-0.5*(0,fws,fws);
	polec := (0,(outay-inray)*cosd(wang)-fws/2,
                    (outay+inray)*sind(wang)-poleray-fws/2);
	aro1 := goodcirclepath( aroc, axe, inray );
	aro2 := goodcirclepath( aroc+len*axe, axe, inray );
	aro3 := buildcycle( aro1, aro2 );
	floorwall := currentpicture;
	clip floorwall to aro3;
	aro4 := spatialhalfcircle( aroc+len*axe, axe, inray, false );
	aro5 := spatialhalfcircle( aroc+len*axe, axe, outay, false );
	aro6 := reverse aro5;
	aro7 := aro4--aro6--cycle;
	fill aro7 withcolor (0.6*background);
	rigorousdisc( 0, true, aroc, inray, axe*len );
	draw floorwall;
	draw aro3;
	rigorousdisc( 0, true, polec, poleray, pole*polelen );
	aro8 := spatialhalfcircle( aroc+len*axe, axe, inray, true );
	aro9 := spatialhalfcircle( aroc+len*axe, axe, outay, true );
	aro10 := reverse aro9;
	aro11 := aro8--aro10--cycle;
	fill aro11 withcolor (0.6*background);
	rigorousdisc( 0, false, aroc, outay, axe*len );
endfig;

end.