答案1
答案2
如何使用 MetaPost 来实现这一点,对此感兴趣的人可能会感兴趣。clip <picture> to <path>
原始命令是这里的关键。
\documentclass{article}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
path circle; circle = fullcircle scaled 6cm; u = cm; N := 4;
picture grid;
beginfig(1);
grid = image(%
for i = -N upto N:
draw ((i, -N) -- (i, N)) scaled u;
endfor;
for j = -N upto N:
draw ((-N, j) -- (N, j)) scaled u;
endfor;);
clip grid to circle; draw grid; draw circle;
endfig;
\end{mplibcode}
\end{document}