7

I am trying to draw the Reeb foliation. So far I have the code and image below. The problem is that one surface is very slightly bulging out through the one in front of it (through the very front surface). They should be nested each one entirely inside the previous, like curved flower pots.

settings.outformat="pdf";
settings.prc=false;
settings.render=4;


import graph;
import graph3;
import three;

size(12cm,0);

real rcutoff=.8;
real rinner=1;
real router=2;


currentprojection=orthographic(1,-2,1);
currentlight=(1,-1,0.5);

real f(pair z) {return 1/(1-abs(z)^2);}

// We change variables so that the unit cylinder x^2+y^2<1 gets mapped to the torus.
triple changevariables(triple X)
{ 
    return (
        (router+rinner*X.x)*cos(X.z),
        (router+rinner*X.x)*sin(X.z),
        rinner*X.y
    );
}


// g returns the location of a point on a ``paraboloid'' inside the unit cylinder with given angle and radius above the unit disk in the (x,y) plane.
triple g(pair p){
    real x=p.x*cos(p.y), y=p.x*sin(p.y);
    return (x,y,f((x,y)));
}


triple h(pair p){
    return changevariables(g(p));
}

real anglestep=10;

for (int z = 0; z <= 20; ++z) {
    draw(
         rotate(-anglestep*z,Z)*surface(
            h,
            (0,0),
            (rcutoff,2*pi),Spline
        ),lightgray+opacity(1)
    );
//  real zz=f((rcutoff,0));
//  triple cent=changevariables((0,0,zz));
//  draw(
//      rotate(-anglestep,Z)*
//      circle(c=cent, r=rcutoff,normal=(-router*sin(zz),router*cos(zz),0)),
//      white
//  );
}

enter image description here

Perhaps the problem is even clearer if I only draw the final two surfaces, in different colours:

enter image description here

1
  • Thank you for adding the second image. I had no idea what you were asking about when I looked at this earlier ;).
    – cfr
    Commented Dec 23, 2014 at 19:50

1 Answer 1

5

It is only due to the numerical approximation of your surface with the Bézier patches. By default you have 10 meshes (or 10x10). Depending on your PC you can increase independently the number of meshes with respect to the two variables. Here I tested the last two final surfaces with

draw(
     rotate(-anglestep*z,Z)*surface(
                                    h,
                                    (0,0),
                                    (rcutoff,2*pi),nu=16,nv=10,Spline
                                    ),lightgreen+opacity(1)
     );

and it seems to be ok.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .