Here's my knot:
I started by drawing the red+blue strand, which went quite well with a Hobby curve.
\usepackage{tikz}
\usetikzlibrary{knots, hobby, shapes.geometric}
\begin{document}
\tikzset{
knot diagram/every strand/.append style={
ultra thick,
red
}}
\begin{tikzpicture}[use Hobby shortcut]
\begin{knot}[scale=2,
consider self intersections=true,%ignore endpoint
% intersections=false,
end tolerance=0.05mm,
draft mode=crossings,
flip crossing/.list={1,3},
clip width=8,
clip radius=8pt,
only when rendering/.style={
}
]
\strand ([closed]2,0) .. (3, 0) .. (4, 2) .. (1.5, 0) .. (1.8, -0.4)
.. (2.2, -0.4) .. (2.4, 0.4) .. (0, 2) .. (1, 0);
\end{knot}
\end{tikzpicture}
\end{document}
Then I added in the green link as a circle:
\usepackage{tikz}
\usetikzlibrary{knots, hobby, shapes.geometric}
\begin{document}
\tikzset{
knot diagram/every strand/.append style={
ultra thick,
red
}}
\begin{tikzpicture}[use Hobby shortcut]
\begin{knot}[scale=2,
consider self intersections=true,%ignore endpoint
% intersections=false,
end tolerance=0.05mm,
draft mode=crossings,
flip crossing/.list={1,3},
clip width=8,
clip radius=8pt,
only when rendering/.style={
}
]
\strand ([closed]2,0) .. (3, 0) .. (4, 2) .. (1.5, 0) .. (1.8, -0.4)
.. (2.2, -0.4) .. (2.4, 0.4) .. (0, 2) .. (1, 0);
\strand[green] (2, -0.5) circle[radius=2cm];
\end{knot}
\end{tikzpicture}
\end{document}
The crossing numbers have changed of course, but that's not a problem -- I can flip them. The problem is the crossing marked as '2': it's in the wrong place. If I try and flip it, the situation gets worse (zoom from image):
I eventually succeeded in drawing this knot by using a second Hobby curve for the green strand(*). I have drawn my knot -- I'm not looking for further advice on how to do this particular example. But I'm keen to get a better grasp on the knots library and I'd like to understand why the attempt using a circle behaves that way -- does anyone know? I tried making my circle bigger and smaller and shifting it a bit left and right, all to no avail... I don't know if there's something in the knots options that I was missing? Other than where the start point of a circle might lie, it's essentially symmetric with the crossing marked 7, which is handled correctly... so perhaps there's something to do with the circle starts?
(*) The working code, for completeness:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{knots, hobby, shapes.geometric}
\begin{document}
\tikzset{
knot diagram/every strand/.append style={
ultra thick,
red
}}
\begin{tikzpicture}[use Hobby shortcut]
\begin{knot}[scale=2,
consider self intersections=true,%ignore endpoint
% intersections=false,
end tolerance=0.05mm,
draft mode=crossings,
flip crossing/.list={1,4, 5,6 },
clip width=8,
clip radius=8pt,
only when rendering/.style={
}
]
\strand ([closed]2,0) .. (3, 0) .. (4, 2) .. (1.5, 0) .. (1.8, -0.4)
.. (2.2, -0.4) .. (2.4, 0.4) .. (0, 2) .. (1, 0);
\strand[green] ([closed]2, -1) .. (3.5, 0) .. (2, 1) .. (0.5, 0);
\end{knot}
\end{tikzpicture}
\end{document}




consider self intersections=truethat triggers it, and I think that most uses of circles withknotsare actually links so they don't look at self intersections. – Andrew Stacey Jan 30 '24 at 18:25consider self intersections=no splitsdoes not trigger the bug. – Andrew Stacey Jan 31 '24 at 22:27