I am making notes on the subject and I have to make too many figures of the following kind. How do I do this?Mani


An alternative tool is Metapost with lualatex and the luamplib package.

enter image description here

Here's a routine to draw manifolds as general randomised ellipses. Drawing labels, arrows, and boxes, etc is covered in the manuals and tutorials linked above. As a bonus I've added the torus hole too.

vardef manifold(expr a,b,rho) = 
    (for t=0 upto 7: 
       right scaled (a+rho*normaldeviate) rotated 45t .. 
     endfor cycle) yscaled (b/a)

path M, N, torus_edge_lower, torus_edge_upper, torus_hole;

M = manifold(90,60,10);  
N = manifold(80,80,3) shifted 240 right rotated 10;

torus_edge_lower = quartercircle scaled 80 rotated 225 shifted center M shifted (-25,15);
torus_edge_upper = point 1/3 of torus_edge_lower 
              {direction 1/3 of torus_edge_lower rotated 80} 
                .. point 5/3 of torus_edge_lower;
torus_hole = buildcycle(torus_edge_lower,torus_edge_upper);

fill M withcolor .9[blue,white];
unfill torus_hole;
draw M; 
draw torus_edge_lower; 
draw torus_edge_upper;
label(btex $M$ etex, point 7 of M shifted (-6,16));

fill N withcolor .9[green,white];
draw N;
label(btex $N$ etex, point 7 of N shifted (-6,16));

To draw a manifold you can use plot coordinates with smooth option, and you can play with the tension parameter. Or you can use the hobby package.

To draw a hole you can use the arc command.

Here is a starting example :

    \draw[smooth cycle,tension=.7] plot coordinates{(-1,0) (0.5,2) (2,2) (4,3) (4.5,0)};
    \coordinate (A) at (1,1);
    \draw (A) arc(140:40:1) (A) arc(-140:-20:1) (A) arc(-140:-160:1);

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.