[Tex/LaTex] Draw reversed path in TikZ

pathstikz-pgf

Is there a way to draw a TikZ path reversed?

I am trying to create some code that generates tessellating figures (to be used in How do we Draw a Bird in LaTeX).

Here is what I got:

\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\def\x{2}
\def\y{4}
\def\mypath{(0,0) -- (1,1) -- (\x,0) -- (\x,\y)}
\draw \mypath;
\draw[shift={(\x,\y)}, rotate=180, blue] \mypath;
\end{tikzpicture}
\end{document}

It generates this:
wrong
But what I wanted is this:ok. So it is obviously not correct to rotate the path. I need to break it into two an draw it reversed.

Best Answer

It's not possible with the definition of \mypath

enter image description here

\documentclass{minimal}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
  \def\x{2}
  \def\y{4}
  \def\mypath{(0,0) -- (1,1) -- (\x,0) -- (\x,\y)}
  \draw[red] \mypath;
\end{tikzpicture}
\hspace{1cm}
\begin{tikzpicture}
  \def\x{2}
  \def\y{4}
  \def\mypath{(0,0) -- (1,1) -- (\x,0) -- (\x,\y)}
  \draw[rotate=180, blue] \mypath;
\end{tikzpicture}
\end{document}

There is no shift possible to complete correctly your shape

but with

\documentclass{minimal}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
  \def\x{2}
  \def\y{4}
  \def\mypath{((1,1) -- (\x,0) -- (\x,\y)--++(-1,1)}
  \draw[red] \mypath;
  \draw[blue,x=-0.5*\x cm,xshift=\x cm]  \mypath; 
\end{tikzpicture}

\end{document}  

enter image description here