Debian Codegraph @

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

raw
1 % explvis2
2 % L. Nobre G.
3 % 1999
4
5 input featpost3Dplus2D;
6
7 beginfig(1);
8
9 f := (2,1,1);
10
11 Spread := 250;
12
13 color gridvec, sizevec, currpos, starpos, bordpos;
14 numeric i, j, k, counter, theta, phi, thetamin,
15 thetamax, thetastp, long, base, radius, polar;
16 sizevec := (4,36,1);
17 gridvec := (0.14,0.1,0.3);
18 thetamin := 90;
19 thetamax := 150;
20 long := 0.08;
21 base := 0.02;
22 thetastp := (thetamax-thetamin)/(X(sizevec)-1);
23 starpos := ( -X(gridvec)*X(sizevec) ,
24 -X(gridvec)*X(sizevec) ,
25 0 );
26 bordpos := starpos;
27 npf1 := 4;
28 F1p1 := bordpos;
29 F1p2 := (X(bordpos),-Y(bordpos), Z(bordpos));
30 F1p3 := (-X(bordpos),-Y(bordpos), Z(bordpos));
31 F1p4 := (-X(bordpos),Y(bordpos), Z(bordpos));
32 counter := 2;
33 for i=1 upto X(sizevec):
34 radius := (i-1)*X(gridvec);
35 polar := i*floor(Y(sizevec)/X(sizevec));
36 for j=1 upto polar:
37 for k=1 upto Z(sizevec):
38 phi := 360*(j-1)/polar;
39 theta := thetamin+(i-1)*thetastp;
40 currpos := radius*(cosd(phi-90),sind(phi-90),0)
41 +(k-1)*(0,0,Z(gridvec));
42 generatedirface( counter, phi, theta, long, base, currpos );
43 counter := incr(counter);
44 endfor;
45 endfor;
46 endfor;
47 NF := decr(counter);
48 draw_all_test(false);
49 % sharpraytrace;
50 endfig;
51
52 end;
53
54