使用 Latex 绘制篮球

使用 Latex 绘制篮球

你能帮我用 latex 画一个篮球吗?我试过这个版本,但似乎不起作用。

\documentclass{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
    \shad[ball color=orange] (0,0) circle [radius=2cm];
    
    % Lines on the basketball
    \draw [line width=0.5mm, white] (0,0) circle [radius=2cm]; % Outer circle
    \draw [line width=0.5mm, white] (0, -2) -- (0, 2); % Vertical line
    \draw [line width=0.5mm, white] (-2, 0) -- (2, 0); % Horizontal line
    
    % Curved lines
    \draw [line width=0.5mm, white] plot [smooth, tension=1] coordinates { (-1.8,0.5) (-1,1.8) (0,2) (1,1.8) (1.8,0.5)};
    \draw [line width=0.5mm, white] plot [smooth, tension=1] coordinates { (-1.8,-0.5) (-1,-1.8) (0,-2) (1,-1.8) (1.8,-0.5)};
\end{tikzpicture}
\end{document}

任何帮助都将不胜感激。

答案1

此行的正确语法是:

\shade[ball color=orange] (0,0) circle [radius=2cm];

现在就可以工作了

相关内容