有没有更好的方法来制作这个“吃豆人”形状?

有没有更好的方法来制作这个“吃豆人”形状?

我正在尝试制作一个图像,本质上是一个灰色圆圈,里面有一个白色的吃豆人。问题是吃豆人的上下嘴唇之间似乎有一条曲线,我想隐藏它。我的版本如下,是我在 Geogebra 中制作的。

\documentclass[reqno]{amsart}
\usepackage{tikz}
\begin{document}
\definecolor{ffffff}{rgb}{1.0,1.0,1.0}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\draw [line width=0.4pt,fill=black,fill opacity=0.5] (0.0,0.0) circle (2.0cm);
\draw [color=ffffff,fill=ffffff,fill opacity=1.0] (0.0,0.0) circle (1.0cm);
\draw (0.0,3.0)-- (0.0,-3.0);
\draw (-3.0,0.0)-- (3.0,0.0);
\draw [line width=0.4pt] (0.0,-1.0)-- (0.0,0.0);
\draw [line width=0.4pt] (0.0,0.0)-- (1.0,0.0);
\draw [shift={(0,0)},line width=.01pt,fill=black,fill opacity=0.5]  (0,0) --  plot[domain=-1.5707963267948966:0.0,variable=\t]({cos(\t r)},{sin(\t r)}) -- cycle ;
\begin{scriptsize}
\draw [fill=black,shift={(0.0,3.0)}] (0,0) ++(0 pt,2.25pt) -- ++(1.9485571585149868pt,-3.375pt)--++(-3.8971143170299736pt,0 pt) -- ++(1.9485571585149868pt,3.375pt);
\draw [fill=black,shift={(0.0,-3.0)},rotate=180] (0,0) ++(0 pt,2.25pt) -- ++(1.9485571585149868pt,-3.375pt)--++(-3.8971143170299736pt,0 pt) -- ++(1.9485571585149868pt,3.375pt);
\draw [fill=black,shift={(-3.0,0.0)},rotate=90] (0,0) ++(0 pt,2.25pt) -- ++(1.9485571585149868pt,-3.375pt)--++(-3.8971143170299736pt,0 pt) -- ++(1.9485571585149868pt,3.375pt);
\draw [fill=black,shift={(3.0,0.0)},rotate=270] (0,0) ++(0 pt,2.25pt) -- ++(1.9485571585149868pt,-3.375pt)--++(-3.8971143170299736pt,0 pt) -- ++(1.9485571585149868pt,3.375pt);
\end{scriptsize}
\end{tikzpicture}
\end{document}

由此得到上述曲线。

在此处输入图片描述

我认为问题出在

\draw [shift={(0,0)},line width=.01pt,fill=black,fill opacity=0.5]  (0,0) --  plot[domain=-1.5707963267948966:0.0,variable=\t]({cos(\t r)},{sin(\t r)}) -- cycle ;

我曾尝试过诸如opacity=0或之类的方法color=7F7F7F,但最终结果总是黑色或白色。

答案1

这是您的代码的简化版本

\begin{tikzpicture}
  \draw[line width=0.4pt,fill=black,fill opacity=0.5] (0,0) circle (2);
  \fill[white] (0,0) -- (1,0) arc[radius=1,start angle=0,delta angle=270] -- (0,0);
  \draw[<->] (-3,0) -- (3,0);
  \draw[<->] (0,-3) -- (0,3);
\end{tikzpicture}

渲染

箭头与您的示例中的箭头不完全相同,您应该看看arrows.metaTikZ 库。

答案2

为了好玩,以下是一段简短的代码pstricks

\documentclass[svgnames]{standalone}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{pst-plot}
\usepackage{auto-pst-pdf}


\begin{document}

\psset{arrowinset=0, labels = none, ticks=none, fillstyle=solid}
\begin{pspicture}%
    \pscircle[linecolor=SlateGray, fillcolor=LightSlateGrey!75]{2}
    \pswedge[fillcolor=white, linestyle=none]{1}{0}{270}
    \psaxes[arrows=<->, linecolor=SlateGray] (0,0)(-3,-3)(3,3)
\end{pspicture}

\end{document}

在此处输入图片描述

相关内容