I was trying to draw a 2-torus (a doughnut) using TikZ
, based on the answer to my previous question Moebius Strip using Tikz, and got the following
The result is impressive! However, the vertical circle does not look as surrounding the torus.
Q:
How could I give the right perspective of 3D?
MWE
WARNING: main tex-memory of my computer has been enhanced to compite this code
\documentclass{report}
\usepackage{amsmath,units}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
hide axis,
view={60}{60}
]
\addplot3 [
surf, shader=interp,
point meta=x,
colormap/greenyellow,
samples=40,
samples y=40,
z buffer=sort,
domain=0:360,
y domain=0:360
] (
{(3.5 + 0.5*cos(y))*cos(x)},
{(3.5 + 0.5*cos(y))*sin(x)},
{0.5*sin(y)});
\addplot3 [
samples=40,
domain=0:360,
thick
] (
{(3.5 + 0.5*cos(80))*cos(x)},
{(3.5 + 0.5*cos(80))*sin(x)},
{0.5*sin(80)});
\addplot3 [
samples=40,
domain=0:360,
thick
] (
{3.5 + 0.5*cos(x)},
{0},
{0.5*sin(x)});
\end{axis}
\end{tikzpicture}
\end{document}
sketch
and it's not explained how to use thesketch
command. The other use postscript... which are not usable for my purposes. However, I thank your concern.close
link underneath the question (I think you might not have enough reputation to see it, though). However, I don't think this is a duplicate, since the answers to your first link don't show how to draw a circle around the torus (Dox has the torus part in his question, he was specifically asking about the circle), and the second link is concerned with a much more complicated drawing that requires a different approach.