TransWikia.com

Crossings in tikz knots package

TeX - LaTeX Asked on May 15, 2021

How can I create a crossing in the picture below? I tried to follow examples in the manual for tikz Knots package.

documentclass[11pt]{amsart}
usepackage{tikz}
usetikzlibrary{knots} 

begin{document}
begin{tikzpicture}[scale=0.75]
begin{knot}[clip width=5, clip radius=8pt, consider self intersections]
  strand[thick] (0,0)
    to[out=up, in=down] (0,1)
    to[out=up, in=left] (0.5,1.5)
    to[out=right, in=up]  (1,1)
    to[out=down, in=right]  (0.5,0.5)
    to[out=left, in=down]  (0,1)
    to[out=up, in=down]  (0,2);
end{knot}
end{tikzpicture}
end{document}

enter image description here

EDIT: I am trying to illustrate the first Reidemeister move. Responding to Andrew’s comment, I modified my code so that the crossing is not at the endpoint of a section and the crossing has tangents in different directions. However, the problem still persists:

begin{knot}[clip width=10, clip radius=15pt, consider self intersections]
  strand[thick] (0,0)
    to[out=up, in=down] (0,0.7) 
    to[out=up, in=left] (0.5,1.5)
    to[out=right, in=up]  (1,1)
    to[out=down, in=right]  (0.5,0.5)
    to[out=left, in=down]  (0,1.3)
    to[out=up, in=down]  (0,2);
end{knot}

enter image description here

One Answer

Finding the intersections in a knot diagram is a lengthy process so the knots library makes a few optimisations, which can be turned off if needed. These are:

  1. By default, it only looks at intersections between separate paths. consider self intersections=true overrides this.
  2. When looking at self intersections then it has to split the path into sections and consider intersections between these sections. Successive sections obviously intersect at their end points, these are considered spurious intersections and would crowd out the wanted ones so by default it ignores intersections that are near an endpoint of a section. What it considers to be "near" is determined by end tolerance=<dimen> (for simplicity, it uses the l^1 norm).
  3. Ignoring endpoint intersections can be disabled altogether by the key ignore endpoint intersections=false.

Here are three solutions. The first adjusts the path so that the intersection is not near an section endpoint (that is, near a specified point on the path). The second uses a smaller adjustment and adjusts end tolerance=<dimen> as well. The third uses the key ignore endpoint intersections=false on the original path.

documentclass{article}

usepackage{tikz}
usetikzlibrary{knots}

title{Untitled}
author{}
date{2020-11-11}
begin{document}
maketitle


begin{tikzpicture}
begin{knot}[clip width=10, clip radius=15pt, consider self intersections]
  strand[thick] (0,0)
    to[out=up, in=down] (0,0.5) 
    to[out=up, in=left] (0.5,1.5)
    to[out=right, in=up]  (1,1)
    to[out=down, in=right]  (0.5,0.5)
    to[out=left, in=down]  (0,1.5)
    to[out=up, in=down]  (0,2);
end{knot}
end{tikzpicture}


begin{tikzpicture}
begin{knot}[clip width=10, clip radius=15pt, consider self intersections, end tolerance=3pt]
  strand[thick] (0,0)
    to[out=up, in=down] (0,0.7) 
    to[out=up, in=left] (0.5,1.5)
    to[out=right, in=up]  (1,1)
    to[out=down, in=right]  (0.5,0.5)
    to[out=left, in=down]  (0,1.3)
    to[out=up, in=down]  (0,2);
end{knot}
end{tikzpicture}

begin{tikzpicture}[scale=0.75]
begin{knot}[clip width=5, clip radius=8pt, consider self intersections, ignore endpoint intersections=false]
  strand[thick] (0,0)
    to[out=up, in=down] (0,1)
    to[out=up, in=left] (0.5,1.5)
    to[out=right, in=up]  (1,1)
    to[out=down, in=right]  (0.5,0.5)
    to[out=left, in=down]  (0,1)
    to[out=up, in=down]  (0,2);
end{knot}
end{tikzpicture}


end{document}

First Reidemeister move

Correct answer by Andrew Stacey on May 15, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP