add tag
Anonymous 1123
I see this figure

![ScreenHunter 1172.png](/image?hash=79689b827a60f0179115178c006492eafe4df9e11dde41655f4e194a5c3b11ac)

This is not my code
```
\documentclass[12pt,tikz,border=3.14mm]{standalone}
\usepackage{amsmath}
\usetikzlibrary{arrows, calc}
\begin{document}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
			\path (1,0) coordinate (A) (3,3) coordinate (B) (0,2) coordinate (C) (3,1.5) coordinate (D) ;
			\draw[black] (A) to [out=30,in=-90] (B);
			\draw[black] (B) to [out=90,in=45] (C);
			\draw[black] (A) to [out=0,in=-90] (D);
			\draw[black, dashed] (D) to [out=90,in=15] (C);
			\draw (B)--(D) (A)--(C);
			\foreach \x/\g in
			{A/-150, C/135}\fill[black]
			(\x) circle (1pt)
			($(\x)+(\g:3mm)$)node{$\x$};
		\end{tikzpicture}
		\end{document}
```
How to draw this with `tikz-3dplot` or `3dtools`?
Top Answer
marmot
There are two tests one might want to make:
1. the vertical line is on the left or on the right (`\itest` in the code below), and
2. the normal of the upper plane points into or out of the screen (`\jtest`).
Then one can draw the hidden and visible stretches accordingly.
```
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{3dtools}%https://github.com/marmotghost/tikz-3dtools
\begin{document}
\foreach \Angle in {5,15,...,355}
{\begin{tikzpicture}[3d/install view={phi=\Angle,theta=70},line cap=round,line join=round,
	 declare function={R=2;},same bounding box=A]	 
  \pgfmathtruncatemacro{\itest}{screendepth(1,0,0)<0?0:1}	
  \pgfmathtruncatemacro{\jtest}{screendepth(0,-1,1)<0?0:1}	
  \begin{scope}[canvas is xy plane at z=0]
   \ifnum\itest=0
 	\draw[3d/hidden] (0:R)
		arc[start angle=0,end angle=-180+\pgfkeysvalueof{/tikz/3d/phi},radius=R];
 	\draw  (180+\pgfkeysvalueof{/tikz/3d/phi}:R) coordinate (B) 
		arc[start angle=-180+\pgfkeysvalueof{/tikz/3d/phi},end angle=180,radius=R];
   \else
	\draw[3d/hidden] (\pgfkeysvalueof{/tikz/3d/phi}:R) coordinate (B) 
	arc[start angle=\pgfkeysvalueof{/tikz/3d/phi},end angle=180,radius=R];
	\draw  (R,0)arc[start angle=0,end angle=\pgfkeysvalueof{/tikz/3d/phi},radius=R];
   \fi 
  \end{scope}
  \ifnum\jtest=0
   \ifnum\itest=0
	\draw[3d/hidden]
      plot[smooth,domain=-180+\pgfkeysvalueof{/tikz/3d/phi}:0] ({R*cos(\x)},{R*sin(\x)},{R*sin(\x)})
	  -- ({-R},0,0);
	\draw 
      plot[smooth,domain=180:-180+\pgfkeysvalueof{/tikz/3d/phi}] ({R*cos(\x)},{R*sin(\x)},{R*sin(\x)})
	  -- (B);
   \else
	\draw[3d/hidden]
      plot[smooth,domain=\pgfkeysvalueof{/tikz/3d/phi}:180] ({R*cos(\x)},{R*sin(\x)},{R*sin(\x)})
	  -- ({R},0,0);
	\draw 
      plot[smooth,domain=0:\pgfkeysvalueof{/tikz/3d/phi}] ({R*cos(\x)},{R*sin(\x)},{R*sin(\x)})
	  -- (B);
   \fi	 
  \else
   \draw 
      plot[smooth,domain=0:180] ({R*cos(\x)},{R*sin(\x)},{R*sin(\x)})
	  -- cycle;
   \draw ({(\itest==0?-1:1)*R*cos(\pgfkeysvalueof{/tikz/3d/phi})},
  	  {(\itest==0?-1:1)*R*sin(\pgfkeysvalueof{/tikz/3d/phi})},
		  {(\itest==0?-1:1)*R*sin(\pgfkeysvalueof{/tikz/3d/phi})})
		 -- (B);
  \fi
 \end{tikzpicture}}
\end{document}
```
![ani.gif](/image?hash=d44f93fdb5cea8145a3ee8256bf3e769bf469ff36416f568b883ea644065e8fb)

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.