Debian Codegraph @

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

raw
1 % nemuniax.mp
2 % L. Nobre G.
3 % 2003
4
5 input featpost3Dplus2D;
6
7 beginfig(1);
8 f := 2*(5,3,4);
9 Spread := 70;
10
11 numeric hstep, hmax, hsdev, basestep, basemax, basesdev;
12 numeric i, j, k, angsdev, cylength, cyradius, basen, hn;
13 numeric vcx, vcy, vcz, hcurr, xcurr, ycurr, hbase, aone;
14 numeric atwo, zcurr, counter;
15 color lenvec, currpos;
16
17 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Nu
18 cylength := 0.6;
19 cyradius := 0.1;
20 basen := 12;
21 hn := 5;
22 basestep := cyradius*3.1;
23 hstep := cylength*1.5;
24 basesdev := cyradius*0.1;
25 hsdev := hstep*0.2;
26 hbase := -0.8;
27 angsdev := 12;
28
29 basemax := basen*basestep;
30 hmax := hn*hstep;
31 counter := 0;
32 for i=1 upto basen:
33 for j=1 upto basen:
34 hcurr := hbase;
35 forever:
36 exitunless hcurr < hmax+hbase;
37 hcurr := hcurr + hstep;
38 zcurr := hcurr + hsdev*normaldeviate;
39 xcurr := i*basestep + basesdev*normaldeviate;
40 ycurr := j*basestep + basesdev*normaldeviate;
41 aone := uniformdeviate( 360 );
42 atwo := angsdev*normaldeviate;
43 vcz := cosd( atwo );
44 vcy := sind( atwo )*sind( aone );
45 vcx := sind( atwo )*cosd( aone );
46 currpos := ( xcurr, ycurr, zcurr );
47 lenvec := cylength*( vcx, vcy, vcz );
48 % rigorousdisc( 0, true, currpos-0.5*lenvec, cyradius, lenvec);
49 counter := incr( counter );
50 generatedirline( counter, aone, 90-atwo, cylength, currpos );
51 % generateonebiax( counter, aone, 90-atwo, cylength,
52 % -60, 0.25*cylength, currpos );
53 endfor;
54 endfor;
55 endfor;
56 NL := counter;
57 director_invisible( true, 5, false );
58 % director_invisible( false, 5, true );
59 endfig;
60
61 end;