I'm drawing a 3d cube in tikz.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[line width=1mm]
\draw (0,0) rectangle (5,5);
\draw[fill=gray!40] (5,5)--(6,4)--(6,-1)--(5,0)--cycle;
\end{tikzpicture}
\end{document}
I'm drawing a 3d cube in tikz.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[line width=1mm]
\draw (0,0) rectangle (5,5);
\draw[fill=gray!40] (5,5)--(6,4)--(6,-1)--(5,0)--cycle;
\end{tikzpicture}
\end{document}
I would draw the fill first, then the outer most cycle and lastly the diagonal lines with line cap=round or line cap=butt. Like this:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[line width=1mm]
\fill[gray!40] (5,5)--(6,4)--(6,-1)--(5,0)--cycle;
\draw (0,0) -- (0,5) -- (5,5) -- (6,4) -- (6,-1) -- (5,0) -- cycle (5,5) -- (5,0);
\end{tikzpicture}
\end{document}
You can draw all the lines first with different colors, to check if everything looks ok. -Also see What is the easiest way to draw a 3D cube with TikZ?
line cap=round. See also https://tex.stackexchange.com/a/12024/8650 . – hpekristiansen Jul 06 '20 at 16:52