summaryrefslogtreecommitdiff
path: root/graphics/asymptote/examples/filesurface.asy
blob: f51b0cd3e63430102c0a5f9f9eb4096eae518d19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import graph3;
import palette;

size3(200,IgnoreAspect);

currentprojection=perspective(dir(68,225));

file in=input("filesurface.dat").line();
real[] x=in;
real[] y=in;
real[][] z=in;

surface s=surface(z,x,y);
real[] level=uniform(min(z)*(1-sqrtEpsilon),max(z)*(1+sqrtEpsilon),256);

s.colors(palette(s.map(new real(triple v) {return find(level >= v.z);}),
                 Rainbow()));

draw(s,meshpen=thick(),render(tessellate=true));

xaxis3("$x$",Bounds,InTicks);
yaxis3("$y$",Bounds,InTicks(Step=1,step=0.1));
zaxis3("$z$",Bounds,InTicks);