Using the knots package, I have drawn a (3,7)-torus knot. I would like for the inner region of the diagram to be shaded gray.
A minimal working example for the code follows.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{hobby,knots}
\begin{document}
\begin{tikzpicture}[use Hobby shortcut]
\fill[black!30!white] (90:1) \foreach \k in {1,...,7}{--(90+\k*360/7:1)};
\begin{knot}[
consider self intersections=true,
ignore endpoint intersections = false,
flip crossing/.list={1,7,6,11,10, 13, 15, 2}
]
\strand[very thick] ([closed]90:2) foreach \k in {1,...,7}
{ .. (90-360/7+\k*1080/7:1) .. (90+\k*1080/7:2) } (90:2);
\end{knot}
\end{tikzpicture}
\end{document}
The figure produced by this code follows.
The problem with the figure is that I would like the gray region to fit neatly next to the arcs of the knot diagram that bounds it. There are three issues I would like to fix.
- The knot tikzlibrary works by drawing larger white background lines around the strands that appear on top at a crossing. This is how the effect of an over/under crossing is achieved (I think). I want the shaded region to ignore those larger white lines and meet the actual arcs of the knot diagram.
- I've guessed the crossing coordinates in my \fill command. Is there anyway to compute exactly what those coordinates are?
- The arcs in the inner region are closely approximated by straight line segments. In this case, I could probably get away by filling a path (if question 1 was resolved). However, I do not know how to approach shading some of the regions with curvier boundaries.
Any help is greatly appreciated.