答案1
另一种工具是元帖子与lualatex
和luamplib包裹。
这是将流形绘制为一般随机椭圆的例程。上面链接的手册和教程介绍了如何绘制标签、箭头和方框等。作为奖励,我还添加了圆环孔。
\RequirePackage{luatex85}
\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
vardef manifold(expr a,b,rho) =
(for t=0 upto 7:
right scaled (a+rho*normaldeviate) rotated 45t ..
endfor cycle) yscaled (b/a)
enddef;
randomseed:=1855.10574;
beginfig(1);
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));
endfig;
\end{mplibcode}
\end{document}
答案2
要绘制流形,您可以使用plot coordinates
选项smooth
,也可以使用参数tension
。或者您可以使用爱好包裹。
要绘制一个洞,您可以使用arc
命令。
这是一个起始示例:
\documentclass[tikz,border=7mm]{standalone}
\begin{document}
\begin{tikzpicture}
\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);
\end{tikzpicture}
\end{document}