Debian Codegraph @

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

raw
1 % mainmemtest.mp
2 % L. Nobre G.
3 % 2007
4
5 input featpost3Dplus2D;
6
7 beginfig(1);
8
9 f := (2,1,1);
10
11 Spread := 500;
12
13 color gridvec, sizevec, currpos, starpos, bordpos;
14 numeric i, j, k, counter, theta, phi, thetamin,
15 thetamax, thetastp, long, base;
16 % It should work with sizevec := (8,6,1);
17 % with (9,6,1) and sharpraytrace it says
18 % ! MetaPost capacity exceeded, sorry [main memory size=2199001].
19 % sizevec := (7,6,1);
20 % This has been degrading all along the growth of FeatPost.
21 % Now the message is
22 % ! MetaPost capacity exceeded, sorry [independent variables=33554431].
23 % sizevec := (6,6,1);
24 sizevec := (4,4,1);
25 gridvec := (0.05,0.1,0.1);
26 thetamin := 55;
27 thetamax := 125;
28 long := 0.08;
29 base := 0.01;
30 thetastp := (thetamax-thetamin)/(X(sizevec)-1);
31 starpos := ( -0.5*X(gridvec)*(X(sizevec)-1) ,
32 -0.5*Y(gridvec)*(Y(sizevec)-1) ,
33 -0.5*Z(gridvec)*(Z(sizevec)-1) );
34 bordpos := starpos - 0.5*gridvec;
35 npf1 := 4;
36 F1p1 := bordpos;
37 F1p2 := (X(bordpos),-Y(bordpos), Z(bordpos));
38 F1p3 := (-X(bordpos),-Y(bordpos), Z(bordpos));
39 F1p4 := (-X(bordpos),Y(bordpos), Z(bordpos));
40 counter := 2;
41 for i=1 upto X(sizevec):
42 for j=1 upto Y(sizevec):
43 for k=1 upto Z(sizevec):
44 phi := 90;
45 theta := thetamin+(i-1)*thetastp;
46 currpos := starpos+( (i-1)*X(gridvec) ,
47 (j-1)*Y(gridvec) ,
48 (k-1)*Z(gridvec) );
49 generatedirface( counter, phi, theta, long, base, currpos );
50 counter := incr(counter);
51 endfor;
52 endfor;
53 endfor;
54 NF := decr(counter);
55 sharpraytrace;
56 endfig;
57
58 end;
59