add tag
Anonymous 1123
I am trying to draw Fig. 4, page 14 of [this book](https://drive.google.com/file/d/1mshrF5W2eTgW5Wp6o_cc5sLmaxVlqCO3/view)

![image.gif](/image?hash=1e31bae68192eea4d81a2e14e779aac16dc80a7374c467defb2f55a362c9fe0b)

Or the figure 7

![ScreenHunter 245.png](/image?hash=186f3ceaf03c9881f531518696a279e4f76793c4592234ab3db0be8459b12518)

I tried
```
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{calc,3dtools}% https://github.com/marmotghost/tikz-3dtools
\begin{document}
	\foreach \xslant in {0.5}
	{\begin{tikzpicture}[3d/install view={phi=-20,theta=70},line join = round, line cap = round,
			declare function={R=2;v=8;% base radius and height of the cone 
				r=R/2;% radius of the small circle
				h=(R-r)*v/R;%  height of the base of the upper circle
			}] 
			\path[xslant=\xslant] pic[xslant=\xslant](Cone1) {3d/cone={r=R,h=v}} (0,0,h)
			(0,0,h) coordinate (B2); %marmot added
			\path (B2) pic[xslant=\xslant]{3d/cone={r=r,h/.evaluated=v-h}};  
	\end{tikzpicture}} 
\end{document}
```
![ScreenHunter 244.png](/image?hash=44823f171198bc5d3eb9ff62fb2d94b04dfb1b9bc0cbba8205a016dd1255182d)

I cannot draw remain part of the figure. How can I draw it?
Top Answer
user 3.14159
You can use the [conical sections](https://topanswers.xyz/tex?q=1546#a1803) along with `xslant`.
```
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{calc,3dtools}% https://github.com/marmotghost/tikz-3dtools
\makeatletter
\tikzset{pics/3d/intersection of cone with plane/.style={code={
   \def\pv##1{\pgfkeysvalueof{/tikz/3d/intersection of cone with plane/##1}}		
   \tikzset{declare function={%	
    iconeplaneradius(\x,\y,\z)=\z/(1+\y*cos(\x));% https://tex.stackexchange.com/a/457458
	iconeplaneh(\x)=\pv{h}*(\pv{r}-\x)/\pv{r};
   },
    3d/intersection of cone with plane/.cd,#1,
   	e/.evaluated={cos(90+\pv{alpha})/cos(\pv{beta})},
	s/.evaluated={(1+\pv{e})*\pv{r}*(\pv{h}-\pv{Iz})/(\pv{h}*sin(90+\pv{alpha}))},
	beta/.evaluated={atan2(\pv{r},\pv{h})}}
   \pgfmathtruncatemacro{\itest}{(\pv{e}<0.1?0:1)}	
   \ifnum\itest=0\relax
    \pgfmathsetmacro{\tcrit}{180}
   \else
    \pgfmathsetmacro{\tmp}{(\pv{s}-\pv{r})/(\pv{r}*\pv{e})}
	\pgfmathtruncatemacro{\itest}{(abs(\tmp)<1?1:0)}	
	\ifnum\itest=1
	 \pgfmathsetmacro{\tcrit}{abs(acos(\tmp))}
	 %\typeout{tcrit=\tcrit}
	\else
     \pgfmathsetmacro{\tcrit}{180}
	\fi
   \fi
   % warning: this may only work for psi=0 
   \pgfmathsetmacro{\myphi}{atan2(\pgf@yx,\pgf@xx)}
   \pgfmathsetmacro{\sdtip}{screendepth(0,0,\pv{h})}
   \pgfmathsetmacro{\aspectangle}{atan2(\sdtip,sqrt(\pv{h}*\pv{h}-\sdtip*\sdtip))}
   \pgfmathsetmacro{\alphacrit}{acos(tan(\aspectangle)*\pv{r}/\pv{h})}
   \pgfmathsetmacro{\tvis}{90-\alphacrit+\myphi+\pv{gamma}} 
   %\typeout{alpha_crit=\alphacrit, phi=\myphi, t_vis=\tvis}
   \path[pic actions] plot[variable=\t,domain=-\tcrit:\tcrit,samples=101,smooth]
     ({iconeplaneradius(\t,\pv{e},\pv{s})*cos(\t-\pv{gamma})},
  	{iconeplaneradius(\t,\pv{e},\pv{s}))*sin(\t-\pv{gamma})},
	{iconeplaneh(iconeplaneradius(\t,\pv{e},\pv{s}))});
   \pgfmathtruncatemacro{\isamples}{50*abs(\tcrit-\tvis)/abs(\tcrit)+1}	
   \draw[3d/hidden] plot[variable=\t,domain=\tcrit:\tvis,samples=\isamples,smooth]
     ({iconeplaneradius(\t,\pv{e},\pv{s})*cos(\t-\pv{gamma})},
  	{iconeplaneradius(\t,\pv{e},\pv{s}))*sin(\t-\pv{gamma})},
	{iconeplaneh(iconeplaneradius(\t,\pv{e},\pv{s}))});	
   \pgfmathtruncatemacro{\isamples}{50*abs(\tcrit+\tvis)/abs(\tcrit)+1}	
   \draw[3d/visible] plot[variable=\t,domain=-\tcrit:\tvis,samples=\isamples,smooth]
     ({iconeplaneradius(\t,\pv{e},\pv{s})*cos(\t-\pv{gamma})},
  	{iconeplaneradius(\t,\pv{e},\pv{s}))*sin(\t-\pv{gamma})},
	{iconeplaneh(iconeplaneradius(\t,\pv{e},\pv{s}))});	
}},/tikz/3d/intersection of cone with plane/.cd,
		h/.initial=5,% height of the cone
		r/.initial=3,% radius of the base
  		gamma/.initial=0,% angle of intersection
		Iz/.initial=3,% z coordinate of the intersection
		alpha/.initial=0,% slope of the plane
		beta/.initial=0,% will be computed
		e/.initial=1,
		s/.initial=1}
\makeatother		
\begin{document}
\foreach \xslant in {0.5}
{\begin{tikzpicture}
 \begin{scope}[3d/install view={phi=30,theta=70},
 	declare function={R=2;% radius of the base of the cone
	H=8;% height of the cone
	r=R/2;% radius of the small circle
	h=(R-r)*H/R;%  height of the base of the upper circle
	},xslant=\xslant]
  \path 
   (0,0,0) coordinate (O) % center of base of the cone (fixed)
   (0,0,H) coordinate (T); % tip of the cone
%   
  \path (O) pic[transform shape]{3d/cone={r=R,h=H}};
% 
  \begin{scope}[3d/intersection of cone with plane/.cd,r=R,h=H,gamma=-20,
  	/tikz/fill opacity=0.3]
  \path pic[transform shape]{3d/intersection of cone with plane={%
  	Iz=2,alpha=10}};
  \path pic[transform shape]{3d/intersection of cone with plane={%
  	Iz=3.75,alpha=5}};
  \end{scope}
 \end{scope}
\end{tikzpicture}}
\end{document}
```

![Screen Shot 2021-06-20 at 10.34.57 PM.png](/image?hash=dbeeb1faaadcd5f43225255a87dde493f1e03920656b0c8b59853e384d338688)

This room is for discussion about this question.

Once logged in you can direct comments to any contributor here.

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.