I want to draw a cube with TikZ. But when I make the edge thicker, the cube turns out to be:

and here is the code:
\begin{tikzpicture}
\draw[black,line width=2pt] (0,2,0) -- (2,2,0) -- (2,2,2) -- (0,2,2) -- (0,2,0) --cycle;
\draw[black,line width=2pt] (0,2,2) -- (2,2,2) -- (2,0,2) -- (0,0,2) -- (0,2,2) --cycle;
\draw[black,line width=2pt] (2,2,2) -- (2,2,0) -- (2,0,0) -- (2,0,2) -- (2,2,2) --cycle;
\end{tikzpicture}
Is there any easy way to clip the “rag", or is there any other way to draw a cube?


[line join=round]after\begin{tikzpicture}and fix the problem – piper39 Jan 02 '23 at 09:14