I'm trying to draw this. I would appreciate it if someone would help me to draw this.
Asked
Active
Viewed 200 times
0
-
You can see here – minhthien_2016 Aug 01 '21 at 04:33
-
1Or here – minhthien_2016 Aug 01 '21 at 07:37
1 Answers
5
I put \Angle as the angle of phi, and I consider two cases \Angle from 0 to 180, and \Angle from 180 to 360.
For example, with \Angle = 70
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{3dtools,calc}%https://github.com/marmotghost/tikz-3dtools
\begin{document}
\foreach \Angle in {70}
{\begin{tikzpicture}[3d/install view={phi=\Angle,theta=70},line cap=round,line join=round,c/.style={circle,fill,inner sep=1pt},
declare function={R=2;h=4;}]
\path[save named path=cyl] pic{3d/frustum={R=R,r=R,h=h}};
\draw[3d/hidden] plot[smooth,domain=180-\Angle+\pgfkeysvalueof{/tikz/3d/phi}:\Angle] ({R*cos(\x)},{R*sin(\x)},{R*sin(\x)});
\draw[3d/visible] plot[smooth,domain=\pgfkeysvalueof{/tikz/3d/phi}:0] ({R*cos(\x)},{R*sin(\x)},{R*sin(\x)});
\draw[3d/hidden] (0:R) -- (180:R);
\end{tikzpicture}}
\end{document}
You can use like that
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{3dtools,calc}%https://github.com/marmotghost/tikz-3dtools
\begin{document}
\foreach \Angle in {5,10,...,175}
{\begin{tikzpicture}[3d/install view={phi=\Angle,theta=70},line cap=round,line join=round,c/.style={circle,fill,inner sep=1pt},
declare function={R=2;h=4;}]
\path[save named path=cyl] pic{3d/frustum={R=R,r=R,h=h}};
\draw[3d/hidden] plot[smooth,domain=180-\Angle+\pgfkeysvalueof{/tikz/3d/phi}:\Angle] ({R*cos(\x)},{R*sin(\x)},{R*sin(\x)});
\draw[3d/visible] plot[smooth,domain=\pgfkeysvalueof{/tikz/3d/phi}:0] ({R*cos(\x)},{R*sin(\x)},{R*sin(\x)});
\draw[3d/hidden] (0:R) -- (180:R);
\end{tikzpicture}}
\end{document}
With \Angle = 300, my code
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{3dtools,calc}%https://github.com/marmotghost/tikz-3dtools
\begin{document}
\foreach \Angle in {300}
{\begin{tikzpicture}[3d/install view={phi=\Angle,theta=70},line cap=round,line join=round,c/.style={circle,fill,inner sep=1pt},
declare function={R=2;h=4;}]
\path[save named path=cyl] pic{3d/frustum={R=R,r=R,h=h}};
\draw[3d/hidden] plot[smooth,domain=0:\Angle-180] ({R*cos(\x)},{R*sin(\x)},{R*sin(\x)});
\draw[3d/visible] plot[smooth,domain=\Angle-180:180] ({R*cos(\x)},{R*sin(\x)},{R*sin(\x)});
\draw[3d/hidden] (0:R) -- (180:R);
\end{tikzpicture}}
\end{document}
Or you can use
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{3dtools,calc}%https://github.com/marmotghost/tikz-3dtools
\begin{document}
\foreach \Angle in {185,190,...,355}
{\begin{tikzpicture}[3d/install view={phi=\Angle,theta=70},line cap=round,line join=round,c/.style={circle,fill,inner sep=1pt},
declare function={R=2;h=4;}]
\path[save named path=cyl] pic{3d/frustum={R=R,r=R,h=h}};
\draw[3d/hidden] plot[smooth,domain=0:\Angle-180] ({R*cos(\x)},{R*sin(\x)},{R*sin(\x)});
\draw[3d/visible] plot[smooth,domain=\Angle-180:180] ({R*cos(\x)},{R*sin(\x)},{R*sin(\x)});
\draw[3d/hidden] (0:R) -- (180:R);
\end{tikzpicture}}
\end{document}
minhthien_2016
- 9,467



