Debian Codegraph @

texmf-dist/doc/metapost/featpost/example/spherample.mp

raw
1 % spherample.mp
2 % L. Nobre G.
3 % 2002
4
5 input featpost3Dplus2D;
6
7 SphericalDistortion := true;
8
9 beginfig(1);
10 color orig, axxc, ayyc, azzc;
11 color nalfa, gammacnt, vertex;
12 numeric altura, grids, radius, xxsize, aux,
13 yysize, zzsize, i, numc, slope;
14 path sfear;
15
16 f := (5,4,2);
17 Spread := 120;
18 ShiftV := (200,200);
19 altura = 1;
20 radius = 0.3;
21 grids = 1;
22 numc = 9;
23 slope = 3;
24
25 for i=1 upto numc:
26 aux := (i-1-0.5*(numc-1))*grids;
27 gammacnt := (0,aux,0);
28 vertex := (aux/slope,aux,altura);
29 nalfa := vertex - gammacnt;
30 sfear := rigorousfearpath(gammacnt,radius);
31 unfill sfear;
32 draw sfear;
33 draw spatialhalfcircle(gammacnt,nalfa,radius,true);
34 endfor;
35 xxsize = radius;
36 yysize = 0.5*(numc-1)*grids;
37 zzsize = altura;
38 orig = (0,0,0);
39 axxc = (xxsize,0,0);
40 ayyc = (0,yysize,0);
41 azzc = (0,0,zzsize);
42 % drawarrow rp(orig)..rp(axxc);
43 % drawarrow rp(orig)..rp(ayyc);
44 % drawarrow rp(orig)..rp(azzc);
45 endfig;
46
47 end;
48
49