我需要使用 tikz 绘制一个新月符号(用于印度音乐符号)。我几乎完成了绘制,但输出出现了问题。结果如下
代码如下
\begin{tikzpicture}[squarednode/.style={rectangle, minimum size=5mm}, node distance=2mm]
\node[squarednode] (1) {1};
\node[squarednode] [right=of 1] (2) {2};
\node[squarednode] [right=of 2] (3) {3};
\draw [fill=black, draw=black] (1.south) to [out=315,in=225] (3.south);
\draw [fill=white, draw=white] (1.south) to [out=325,in=215] (3.south);
\end{tikzpicture}
一切工作正常,但从图像的开始到结束有一条水平的细黑线,这是不需要的。
提前致谢!
答案1
您需要绘制一条封闭的路径,而不是将一条路径与另一条路径重叠。这样,伪影就不会出现。您可以这样做:
\documentclass[tikz, border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}
\coordinate (1) at (0,0);
\coordinate (3) at (2,0);
%\draw [fill=black, draw=black] (1.south) to [out=315,in=225] (3.south);
%\draw [fill=white, draw=white] (1.south) to [out=325,in=215] (3.south);
\draw [fill=black, draw=black] (1.south) to [out=315,in=225] (3.south)
to [out=215,in=325] cycle;
\end{tikzpicture}
\end{document}