summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/metapost/featpost/example/highmemory/mainmemtest.mp
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/metapost/featpost/example/highmemory/mainmemtest.mp')
-rw-r--r--Master/texmf-dist/doc/metapost/featpost/example/highmemory/mainmemtest.mp54
1 files changed, 54 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/metapost/featpost/example/highmemory/mainmemtest.mp b/Master/texmf-dist/doc/metapost/featpost/example/highmemory/mainmemtest.mp
new file mode 100644
index 00000000000..d4ab2a9e4cf
--- /dev/null
+++ b/Master/texmf-dist/doc/metapost/featpost/example/highmemory/mainmemtest.mp
@@ -0,0 +1,54 @@
+% mainmemtest.mp
+% L. Nobre G.
+% 2003
+
+%input featpost3D;
+
+beginfig(1);
+
+ f := (2,1,1);
+
+ Spread := 500;
+
+ color gridvec, sizevec, currpos, starpos, bordpos;
+ numeric i, j, k, counter, theta, phi, thetamin,
+ thetamax, thetastp, long, base;
+% It works with sizevec := (8,6,1);
+% with (9,6,1) and sharpraytrace it says
+% ! MetaPost capacity exceeded, sorry [main memory size=2199001].
+ sizevec := (7,6,1);
+ gridvec := (0.05,0.1,0.1);
+ thetamin := 55;
+ thetamax := 125;
+ long := 0.08;
+ base := 0.01;
+ thetastp := (thetamax-thetamin)/(X(sizevec)-1);
+ starpos := ( -0.5*X(gridvec)*(X(sizevec)-1) ,
+ -0.5*Y(gridvec)*(Y(sizevec)-1) ,
+ -0.5*Z(gridvec)*(Z(sizevec)-1) );
+ bordpos := starpos - 0.5*gridvec;
+ 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):
+ for j=1 upto Y(sizevec):
+ for k=1 upto Z(sizevec):
+ phi := 90;
+ theta := thetamin+(i-1)*thetastp;
+ currpos := starpos+( (i-1)*X(gridvec) ,
+ (j-1)*Y(gridvec) ,
+ (k-1)*Z(gridvec) );
+ generatedirface( counter, phi, theta, long, base, currpos );
+ counter := incr(counter);
+ endfor;
+ endfor;
+ endfor;
+ NF := decr(counter);
+ sharpraytrace;
+endfig;
+
+end;
+