summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/featpost/example/repeated/twistnlc.mp
blob: b3611cfbb1471dbc0ca871c63da168f2b0d9ba51 (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
% explvis2
% L. Nobre G. 
% 1999

%input featpost3Dplus2D;

beginfig(1);

    f := (2,1,1);

    Spread := 250;

    color gridvec, sizevec, currpos, starpos, bordpos;
    numeric i, j, k, counter, theta, phi, thetamin, 
            thetamax, thetastp, long, base, radius, polar;
    sizevec := (4,36,1);
    gridvec := (0.14,0.1,0.3);
    thetamin := 90;
    thetamax := 150;
    long := 0.08;
    base := 0.02;
    thetastp := (thetamax-thetamin)/(X(sizevec)-1);
    starpos := ( -X(gridvec)*X(sizevec) ,
                 -X(gridvec)*X(sizevec) ,
                 0 );
    bordpos := starpos;
    npf1 := 4;
    F1p1 := bordpos;
    F1p2 := (X(bordpos),-Y(bordpos), Z(bordpos));
    F1p3 := (-X(bordpos),-Y(bordpos), Z(bordpos));
    F1p4 := (-X(bordpos),Y(bordpos), Z(bordpos));
    counter := 2;
    for i=1 upto X(sizevec):
        radius := (i-1)*X(gridvec);
        polar := i*floor(Y(sizevec)/X(sizevec));
        for j=1 upto polar:
            for k=1 upto Z(sizevec):
                phi := 360*(j-1)/polar;
                theta := thetamin+(i-1)*thetastp;
                currpos := radius*(cosd(phi-90),sind(phi-90),0)
                           +(k-1)*(0,0,Z(gridvec));
                generatedirface( counter, phi, theta, long, base, currpos );
                counter := incr(counter);
            endfor;
        endfor;
    endfor;
    NF := decr(counter);
    draw_all_test(false);
%    sharpraytrace;
endfig;

end;