I have used the sample code from latexdraw that draws a torus. I am trying to draw a filled circle and a dashed circle where they should be wrap around the torus instead of being drawn uniformly at z=0. I am looking for a TikZ solution. The closest I have seen is this solution but it is too difficult for me to decipher. Any help would be appreciated!
\documentclass[margin=4pt]{standalone}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{tikz-3dplot}
\usepgfplotslibrary{colormaps}
\pgfplotsset{
compat=newest,
colormap={manifoldmap}{color=(lightgray) color=(white) color=(lightgray)}
}
\begin{document}
\begin{tikzpicture}
\def\R{2.75} % Major radius (distance from torus centre to tube centre)
\def\offset{0.5} % Radial displacement from the torus centre circle
\def\thetaB{2.5} % Angular position (in radians) for highlighted point
\begin{axis}[
width=12cm,
axis equal image,
hide axis,
z buffer=sort,
view={125}{35},
clip=false
]
% Parametric torus equations:
% x = (R + cos(x)) cos(y)
% y = (R + cos(x)) sin(y)
% z = sin(x)
\addplot3[
surf,
shader = faceted interp,
samples = 30,
samples y = 40,
domain = 0:2*pi,
domain y = 0:2*pi,
colormap name = manifoldmap,
thin,
opacity=0.75
]
(
{(\R + cos(deg(x))) * cos(deg(y))},
{(\R + cos(deg(x))) * sin(deg(y))},
{sin(deg(x))}
);
\begin{scope}[canvas is xy plane at z=0, transform shape]
\coordinate (p) at
({(\R + \offset) * cos(deg(\thetaB))},
{(\R + \offset) * sin(deg(\thetaB))});
\draw[fill=red, draw=none] (p) circle (4pt);
\draw[blue, dashed, thick] (p) circle (16pt);
\end{scope}
\end{axis}
\end{tikzpicture}
\end{document}
