Ticket #12105: torus12-svg.asy

File torus12-svg.asy, 597 bytes (added by ken@…, 5 years ago)

Example asy file which worked with asy from the texlive binary

Line 
1// from http://math.uchicago.edu/~cstaats/Notes_and_papers_files/asymptote_tutorial.pdf
2settings.outformat = "svg";
3settings.prc = false;
4settings.render=12;
5
6size(300.0pt,0);
7import graph3;
8currentprojection = perspective(30*dir(75,0));
9real r1=5, r0=1;
10int nu = 36, nv = 36;
11path3 crossSection = Circle(r=r0, c=(r1,0,0), normal=Y, n= nu);
12pen colorFunction(int u, real theta) {
13 real z = sin(u/nu * 2pi);
14 real t = (z + 1) / 2;
15 return t*red + (1-t)*lightblue;
16}
17
18surface torus = surface(crossSection, c=(0,0,0), axis=Z, n=nv,
19 angle1=90, angle2=410, color=colorFunction);
20draw(torus);