How to get rid of the almost invisible faint lines in the Olympic rings?

Version, which uses uninterrupted circles (without faint lines), where the gaps are created by clipping. This solution does not use any white background color. The measurements and colors are taken from my answer in Programming Puzzles & Code Golf.

\nofiles % .aux file is not needed
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}

\newcommand*{\xShift}{169.5538bp}
\newcommand*{\yShift}{-71.7013bp}
\newcommand*{\Radius}{71.6821bp}
\newcommand*{\WhiteLineWidth}{3.762bp}
\newcommand*{\ColorLineWidth}{12.9041bp}

\definecolor{color@A}{cmyk}{1, .25, 0, 0}    % blue
\definecolor{color@B}{cmyk}{0, .342, .91, 0} % yellow
\definecolor{color@C}{cmyk}{0, 0, 0, 1}      % black
\definecolor{color@D}{cmyk}{1, 0, .91, .06}  % green
\definecolor{color@E}{cmyk}{0, .94, .65, 0}  % red

% Radii
\pgfmathsetlengthmacro{\InnerColorRadius}{\Radius - \ColorLineWidth/2}
\pgfmathsetlengthmacro{\OuterColorRadius}{\Radius + \ColorLineWidth/2}
\pgfmathsetlengthmacro{\InnerWhiteRadius}{\InnerColorRadius - \WhiteLineWidth}
\pgfmathsetlengthmacro{\OuterWhiteRadius}{\OuterColorRadius + \WhiteLineWidth}

% Positions of circle centers
\newcommand{\xA}{0pt}
\newcommand{\yA}{0pt}
\pgfmathsetlengthmacro{\xC}{\xA + \xShift}
\let\yC\yA
\pgfmathsetlengthmacro{\xE}{\xC + \xShift}
\let\yE\yC
\pgfmathsetlengthmacro{\xB}{(\xA + \xC)/2}
\pgfmathsetlengthmacro{\yB}{\xA + \yShift}
\pgfmathsetlengthmacro{\xD}{(\xC + \xE)/2}
\let\yD\yB

% Bounding Box
\pgfmathsetlengthmacro\llxBB{\xA - \OuterColorRadius}
\pgfmathsetlengthmacro\llyBB{\yB - \OuterColorRadius}
\pgfmathsetlengthmacro\urxBB{\xE + \OuterColorRadius}
\pgfmathsetlengthmacro\uryBB{\yE + \OuterColorRadius}

% Clipping box (a little larger as bounding box)
\pgfmathsetlengthmacro\llxClip{\llxBB - 1pt}
\pgfmathsetlengthmacro\llyClip{\llyBB - 1pt}
\pgfmathsetlengthmacro\urxClip{\urxBB + 1pt}
\pgfmathsetlengthmacro\uryClip{\uryBB + 1pt}

\begin{document}
  \begin{tikzpicture}[
    line width=\ColorLineWidth,
    radius=\Radius,
  ]
    \def\ClipBoxArea{%
      (\llxClip, \llyClip) rectangle (\urxClip, \uryClip)
    }
    \def\Gap(#1,#2)(#3:#4){%
      ($(#1,#2) + (#3:\OuterWhiteRadius)$)
      arc(#3:#4:\OuterWhiteRadius) --
      ($(#1,#2) + (#4:\InnerWhiteRadius)$)
      arc(#4:#3:\InnerWhiteRadius) --
      cycle
    }
    % Upper rings
    \begin{scope}[even odd rule]
      \clip
        \ClipBoxArea
        % Gap by yellow ring in blue ring
        \Gap(\xB,\yB)(225:135)
        % Gap by yellow ring in black ring
        \Gap(\xB, \yB)(90:45)
        % Gap by green ring in black ring
        \Gap(\xD, \yD)(225:135)
        % Gap by green ring in red ring
        \Gap(\xD, \yD)(90:45)
      ;
      \draw[color@A] (\xA, \yA) circle;
      \draw[color@C] (\xC, \yC) circle;
      \draw[color@E] (\xE, \yE) circle;
    \end{scope}
    % Lower rings
    \begin{scope}[even odd rule]
      \clip
        \ClipBoxArea
        % Gap by blue ring in yellow ring
        \Gap(\xA, \yA)(45:-45)
        % Gap by black ring in yellow ring
        \Gap(\xC, \yC)(225:270)
        % Gap by black ring in green ring
        \Gap(\xC, \yC)(45:-45)
        % Gap by red ring in green ring
        \Gap(\xE, \yE)(225:270)
      ;
      \draw[color@B] (\xB, \yB) circle;
      \draw[color@D] (\xD, \yD) circle;
    \end{scope}
    \useasboundingbox (\llxBB, \llyBB) rectangle (\urxBB, \uryBB);
  \end{tikzpicture}
\end{document}

Result


This seems like a perfect problem to use the tikz library knots on! The current solution is improved from the original, which had some minor "clipping issues" (for more info, see here). I consider this solution quite elegant because the code is very simple, clear and short.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{knots}
\begin{document} 
\begin{tikzpicture}
\definecolor{blue1}{RGB}{0,129,188}
\definecolor{yellow1}{RGB}{252,177,49}
\definecolor{black1}{RGB}{35,34,35}
\definecolor{green1}{RGB}{0,157,87}
\definecolor{red1}{RGB}{238,50,78}
\begin{knot}[clip width=1.4,clip radius=0.3cm]
    \strand[line width=0.25cm,red1] (3,0) circle(1.25cm);
    \strand[line width=0.25cm,green1] (1.5,-1.375) circle(1.25cm);
    \strand[line width=0.25cm,black1] (0,0) circle(1.25cm);
    \strand[line width=0.25cm,yellow1] (-1.5,-1.375) circle(1.25cm);
    \strand[line width=0.25cm,blue1] (-3,0) circle(1.25cm);
    \flipcrossings{2,4,6,8}
\end{knot}
\end{tikzpicture}
\end{document}

The result is:

enter image description here


A PSTricks solution with the latest pstricks-add http://comedy.dante.de/~herbert/texnik/tex/generic/pstricks-add/pstricks-add.tex Available in a couple of days on CTAN: Run with xelatex:

\documentclass{article}
\usepackage{pstricks-add}
\pagestyle{empty}
\begin{document}

\begin{pspicture}(-4.5,-3)(4.5,1.5)
\psOlympicRings(0,0)
\psOlympicRings[psscale=0.2](1.5,-1.5)
\psOlympicRings[psscale=0.2](-1.5,-1.5)
\end{pspicture}

\end{document}

enter image description here

Tags:

Tikz Pic