# Two methods of specifying a closed path: by repeating the starting coordinate at the end vs. by using cycle

The TikZ & PGF manual for version 3.0.1a gives the following example (p. 37) to demonstrate the difference between closing a path by repeating the starting coordinate at the end vs. closing it with cycle:

Why does the first method produce a chipped triangle?

• Because the “segment” ends with a cut perpendicular to the length. Try and \draw (0,0)--(1,0); with line width of 5pt. This is adjusted at connections, in the case without --cycle there is no connection. Commented Jun 16, 2017 at 16:41

Evidently because the path is not closed ;-)

Consider the following graph:

\begin{tikzpicture}[line width=5pt]
% create the node
\draw (0,0) -- (1,0)  (1,0) -- (1,1) (1,1) -- (0,0);
\begin{scope}[xshift=2cm]
\draw (0,0) -- (1,0) -- (1,1) -- (0,0);
\end{scope}
\begin{scope}[xshift=4cm]
\draw (0,0) -- (1,0) -- (1,1) -- cycle;
\end{scope}
\end{tikzpicture}


The first one is made up from individual lines. Each line overlaps with the next one but they are not connected. Hence you see the "insets". In the second case, all paths are connected from start to finish. However, the path is not closed, so in the last edge you see the overlap. In the last graph, we have a closed path.

Tikz does not close paths automatically, this would be confusing behaviour in many cases. For the purposes of filling a path, the path is closed internally. When you draw and fill the path, you will see that:

\begin{tikzpicture}[line width=5pt]
\draw[fill=red] (0,0) -- (1,0) -- (1,1);
\end{tikzpicture}


Hence if you want to have your path closed, you need to use --cycle.