summaryrefslogtreecommitdiff
path: root/graphics/asymptote/examples/parametricsurface.asy
blob: 299ea72eef7aca6dd1977009b348f0b22646b608 (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;

size(200,0);
currentprojection=orthographic(4,0,2);

real R=2;
real a=1.9;

triple f(pair t) {
  return ((R+a*cos(t.y))*cos(t.x),(R+a*cos(t.y))*sin(t.x),a*sin(t.y));
}

pen p=rgb(0.2,0.5,0.7);
surface s=surface(f,(0,0),(2pi,2pi),8,8,Spline);

// surface only
//draw(s,lightgray);

// mesh only
// draw(s,nullpen,meshpen=p);

// surface & mesh
draw(s,lightgray,meshpen=p,render(merge=true));