Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- settings.outformat="pdf";
- settings.render = 5;
- settings.prc = false;
- import graph3;
- import contour;
- size3(8cm);
- currentprojection = orthographic(9,1,4);
- defaultrender = render(merge = true);
- // create torus as surface of rotation
- int umax = 40;
- int vmax = 40;
- surface torus = surface(Circle(c=2Y, r=0.6, normal=X, n=vmax), c=O, axis=Z, n=umax);
- torus.ucyclic(true);
- torus.vcyclic(true);
- pen meshpen = 0.25pt + gray;
- draw(torus, surfacepen=material(diffusepen=white+opacity(0.001), emissivepen=white));
- for (int u = 0; u < umax; ++u)
- draw(torus.uequals(u), p=meshpen);
- for (int v = 0; v < vmax; ++v)
- draw(graph(new triple(real u) {return torus.point(u,v); }, 0, umax, operator ..),
- p=meshpen);
- pair a = (floor(umax/2) + 3, 3);
- label(torus.point(a.x, a.y), L="$\phi$", align=W);// L="",
- pair b = (5, floor(vmax/2));
- //label(torus.point(b.x, b.y), L="",align=2Z + X);// L="",
- path3 abpath(int ucycles, int vcycles) {
- pair bshift = (ucycles*umax, vcycles*vmax);
- triple f(real t) {
- pair uv = (1-t)*a + t*(b+bshift);
- return torus.point(uv.x, uv.y);
- }
- return graph(f, 0, 1, operator ..);
- }
- real linewidth = 0.8pt;
- draw(abpath(0,0), p=linewidth + red);
- //draw(abpath(-1,0), p=linewidth + green);
- draw(abpath(0,1), p=linewidth + red);
- //draw(abpath(0,0), p=linewidth + green);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement