I am trying to draw a picture using Mathematica of three loops linking together in 3D as follows.
Module[{r = 0.03, col1, col2, col3}, {col1, col2, col3} =
ColorData["HTML"] /@ {"Firebrick", "ForestGreen", "RoyalBlue"};
Graphics3D[{{{{col2,
Rotate[#, π/12, {0, 0, 1}, {0, 0, 0}]}, {col3,
Rotate[#, -π/12, {0, 0, 1}, {0, 0, 0}]}} &@
Translate[
Tube[Table[
0.5 {Cos[θ], 0, Sin[θ]}, {θ, 0,
2 π, π/24}], r], {1, 0, 0}]}, {col1,
Tube[Table[{Cos[θ], Sin[θ], 0}, {θ, 0,
2 π, π/24}], r]}},
ViewPoint -> {5, 0, 2}, Boxed -> False, Lighting -> "Neutral"]]
I used Graphics3D and Tube to draw the above picture. But I found that it is not easy to see which line is in front of which.
So then I use Graphics and Circle to draw the following 2D picture, in which the overlapping relation is represented by a small gap of the underlying line at the intersection.
Module[{col1, col2, col3},
{col1, col2, col3} =
ColorData["HTML"] /@ {"Firebrick", "ForestGreen", "RoyalBlue"};
Graphics[{{col1, Circle[{0, 0}, {2, 1}]},
Translate[{{White, Disk[{-0.47, -0.08}, 0.15]}, col2,
Circle[{0, 0}, {0.5, 1}, {0.07 π, 1.97 π}]}, {0.6, -0.9}],
Translate[{{White, Disk[{-0.47, 0.12}, 0.15]}, col3,
Circle[{0, 0}, {0.5, 1}, {0.02 π,
1.92 π}]}, {-0.8, -0.9}]}]]
I think the 2D picture is nicer and can be saved as the vectorized image with a much smaller size compared to the 3D version. However I need to explicitly tell Mathematica where and how to break the lines.
My question is: is there a method to have Mathematica automatically draw links or knots in the 2D style with the underlying lines broken at the intersections.
ParametricPlot3D[]
reference.wolfram.com/mathematica/ref/ParametricPlot3D.html use the third example and reduce the tube radius. $\endgroup$