Here is an example of using the knots library as per Gonzalo Medina's suggestion:

If you comment out the draft mode=crossings you can see how the crossings are numbered, and then you use flip crossing=<num> to toggle each of the intersections.
Procedure:
For the other drawing it is just a matter of first \drawing the lines (which is independent of using the knots library. Then
- Move the code into the
knot environment,
- Change the
\draw to a \strand,
- Add the option
draft mode=crossings to get the crossings numbered,
- Use
flip crossing as desired to get the crossing at the appropriate "level", and
- Remove the
draft mode=crossings.
Note that I used a circle shape but any arbitrary shape should work.
Code:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{knots}
\begin{document}
\centering
\begin{tikzpicture}
\begin{knot}[
%draft mode=crossings ,
clip width=3,
flip crossing=1,
flip crossing=2,
]
\strand [ultra thick, red ] (0,0) circle (1.0cm);
\strand [ultra thick, black] (1,0) circle (1.0cm);
\end{knot}
\end{tikzpicture}
\hspace*{0.5cm}
\begin{tikzpicture}
\begin{knot}[
%draft mode=crossings ,
clip width=3,
flip crossing={2},
]
\strand [ultra thick, red ] (0,0) circle (1.0cm);
\strand [ultra thick, black] (1,0) circle (1.0cm);
\end{knot}
\end{tikzpicture}
\begin{tikzpicture}
\begin{knot}[
%draft mode=crossings ,
clip width=4,
]
\strand [ultra thick, blue ] (0,0) circle (1.0cm);
\strand [ultra thick, red ] (1,0) circle (1.0cm);
\strand [ultra thick, green] (0.5,1) circle (1.0cm);
\flipcrossings{1, 2, 5, 6}
\end{knot}
\end{tikzpicture}
\end{document}
knotslibrary for TikZ. – Gonzalo Medina Mar 26 '14 at 01:31