summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/asymptote/examples/spiral3.asy
blob: 727ca3f6d3a8984d44c304ef9614715d71d48c65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import graph3;
import palette;
 
size3(10cm);
 
currentprojection=orthographic(5,4,2);
viewportmargin=(2cm,0);

real r(real t) {return 3exp(-0.1*t);}
real x(real t) {return r(t)*cos(t);}
real y(real t) {return r(t)*sin(t);}
real z(real t) {return t;}

path3 p=graph(x,y,z,0,6*pi,50,operator ..);

tube T=tube(p,2);
surface s=T.s;
s.colors(palette(s.map(zpart),BWRainbow()));
draw(s,render(merge=true));
draw(T.center,thin());