Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Using the knots library for tikz, I get very thin outlines of the circumferences of the clipping circles. How do I make them disappear? Here is a MWE:

\documentclass{minimal}
\usepackage{tikz}
\usetikzlibrary{knots}

\newcommand*\anglei{68}
\newcommand*\radiusi{3.25}

\newcommand*\angleii{37}
\newcommand*\radiusii{5}

\begin{document}
\begin{tikzpicture}
  \begin{knot}%
  [%
    draft mode=off,%
    flip crossing/.list={4,5,8,9},%
    clip width=0,%
    clip radius=15pt,%
    line width=1pt,%
    background color=white,%
    only when rendering/.style={%
        draw=black,%
        double distance=12pt,%
    }%
  ]%
    \strand[double=red] (0,1) arc[start angle=270,delta angle=\anglei,radius=\radiusi] (3,3)
      arc[start angle={90+\anglei},delta angle=-\anglei,radius=\radiusi] (6,5);
    \strand[double=orange] (1,6) arc[start angle=180,delta angle=\anglei,radius=\radiusi] (3,3)
      arc[start angle=\anglei,delta angle=-\anglei,radius=\radiusi] (5,0);
    \strand[double=yellow] (0,5) arc[start angle=90,delta angle=-\angleii,radius=\radiusii] (3,4)
      arc[start angle={270-\angleii},delta angle=\angleii,radius=\radiusii] (6,3);
    \strand[double=green] (0,3) arc[start angle=90,delta angle=-\angleii,radius=\radiusii] (3,2)
      arc[start angle={270-\angleii},delta angle=\angleii,radius=\radiusii] (6,1);
    \strand[double=blue] (3,6) arc[start angle=0,delta angle=-\angleii,radius=\radiusii] (2,3)
      arc[start angle={180-\angleii},delta angle=\angleii,radius=\radiusii] (1,0);
    \strand[double=violet] (5,6) arc[start angle=0,delta angle=-\angleii,radius=\radiusii] (4,3)
      arc[start angle={180-\angleii},delta angle=\angleii,radius=\radiusii] (3,0);
  \end{knot}%
\end{tikzpicture}
\end{document}

Note the arcs of the clipping circles at each crossing.

share|improve this question
    
I don't see them with SumatraPDF, but I do with Acrobat and Chrome. These are likely minor viewer artifacts; in other words, nothing to worry about. –  Paul Gessler Jul 7 at 21:31
1  
Welcome to TeX.SX. A small hint: Usage of class minimal is discouraged, please see tex.stackexchange.com/questions/42114/… –  Christian Hupfer Jul 7 at 21:53

1 Answer 1

The problem is due to anti-aliasing when viewing the PDF.

There is an interaction between how one draws this particular style of knot and how the knots package flips intersections. The flipping is achieved by redrawing the upper strand but clipped to a small circle about the intersection point. The doubling effect is achieved by drawing the same line twice with different line thicknesses. So when redrawing the upper strand, it is drawn twice but clipped to the circle. However, when anti-aliasing is turned on then this clipping is not sharp but slightly blurred. This means that at the edge, the new part is made slightly transparent and blended with what is already there. Thus when the upper path is drawn, near the edge it is blurred and blended with the lower path. The blending causes the artefacts that you see.

Anti-aliasing is only used when viewing a PDF. It is not used when the PDF is printed. Therefore, these artefacts will go away when the PDF is printed.

Nevertheless, they are a bit annoying. There's an update to the knots library which is available at the TeX-SX Launchpad Page which is designed to get round this problem (tex spath3.dtx to generate the library). It's not quite perfect (partly due to the variation in the desired size of the clipping circles in your diagram), but it does get rid of the crop circles.

Knots with no crops

\documentclass{article}
%\url{http://tex.stackexchange.com/q/188447/86}
\usepackage{tikz}
\usetikzlibrary{knots}

\newcommand*\anglei{68}
\newcommand*\radiusi{3.25}

\newcommand*\angleii{37}
\newcommand*\radiusii{5}

\tikzset{
  basic strand/.style={
    line width=1pt,
    draw=red,
    double distance=12pt,
  },
  crossing strand/.style={
    line width=1pt,
    double distance=12pt,
    only when rendering/.style={%
      draw=\pgfinnerstrokecolor,%
      line width=12pt,
      double=none,
    }
  }
}

\begin{document}
\begin{tikzpicture}
  \begin{knot}%
  [%
    draft mode=off,%
    flip crossing/.list={4,5,8,9},%
    clip width=1,%
    clip radius=16pt,%
    line width=1pt,%
    background colour=red,%
    only when rendering/.style={%
      basic strand
    },%
    every intersection/.style={
      crossing strand
    },
  ]%
    \strand[double=red] (0,1) arc[start angle=270,delta angle=\anglei,radius=\radiusi] (3,3)
      arc[start angle={90+\anglei},delta angle=-\anglei,radius=\radiusi] (6,5);
    \strand[double=orange] (1,6) arc[start angle=180,delta angle=\anglei,radius=\radiusi] (3,3)
      arc[start angle=\anglei,delta angle=-\anglei,radius=\radiusi] (5,0);
    \strand[double=yellow] (0,5) arc[start angle=90,delta angle=-\angleii,radius=\radiusii] (3,4)
      arc[start angle={270-\angleii},delta angle=\angleii,radius=\radiusii] (6,3);
    \strand[double=green] (0,3) arc[start angle=90,delta angle=-\angleii,radius=\radiusii] (3,2)
      arc[start angle={270-\angleii},delta angle=\angleii,radius=\radiusii] (6,1);
    \strand[double=blue] (3,6) arc[start angle=0,delta angle=-\angleii,radius=\radiusii] (2,3)
      arc[start angle={180-\angleii},delta angle=\angleii,radius=\radiusii] (1,0);
    \strand[double=violet] (5,6) arc[start angle=0,delta angle=-\angleii,radius=\radiusii] (4,3)
      arc[start angle={180-\angleii},delta angle=\angleii,radius=\radiusii] (3,0);
  \end{knot}%
\end{tikzpicture}
\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.