Debian Codegraph @

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

raw
1 % twistroundbiax.mp
2 % L. Nobre G.
3 % 2002
4
5 input featpost3Dplus2D;
6
7
8
9 beginfig(1);
10
11 f := (2,1,1);
12
13 Spread := 250;
14
15 color gridvec, sizevec, currpos, starpos, bordpos;
16 numeric i, j, k, counter, theta, phi, gamma, thetamin, innercircle,
17 thetamax, thetastp, long, base, radius, polar, larg;
18 sizevec := (4,36,1);
19 gridvec := (0.143,0.1,0.1);
20 thetamin := 90;
21 thetamax := 150;
22 long := 0.08;
23 larg := 0.02;
24 base := 0.2;
25 gamma := -30;
26 innercircle := 0.5;
27 thetastp := (thetamax-thetamin)/(X(sizevec)-1);
28 starpos := ( -X(gridvec)*X(sizevec) ,
29 -X(gridvec)*X(sizevec) ,
30 0 );
31 bordpos := starpos;
32 npf1 := 4;
33 F1p1 := bordpos;
34 F1p2 := (X(bordpos),-Y(bordpos), Z(bordpos));
35 F1p3 := (-X(bordpos),-Y(bordpos), Z(bordpos));
36 F1p4 := (-X(bordpos),Y(bordpos), Z(bordpos));
37 NF := 1;
38 draw facepath(1);
39 counter := 0;
40 for i=1 upto X(sizevec):
41 radius := (i-innercircle)*X(gridvec);
42 polar := i*floor(Y(sizevec)/X(sizevec));
43 for j=1 upto polar:
44 for k=1 upto Z(sizevec):
45 phi := 360*(j-1)/polar;
46 theta := thetamin+(i-innercircle)*thetastp;
47 currpos := radius*(cosd(phi-90),sind(phi-90),0)
48 +(k-1)*(0,0,Z(gridvec));
49 counter := incr(counter);
50 % generateonebiax( counter, phi, theta, long,
51 % gamma, larg, currpos );
52 generatedirline( counter, phi, theta, long, currpos );
53 endfor;
54 endfor;
55 endfor;
56 NL := counter;
57 director_invisible( true, base, false );
58 endfig;
59
60 end;
61
62