Anonymous 1123
I see [here](https://tex.stackexchange.com/questions/493656/how-can-i-calculate-using-newcommand-parameters/493660#493660) and tried
```
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{calc,3dtools}% https://github.com/marmotghost/tikz-3dtools
\begin{document}
\begin{tikzpicture}[3d/install view={phi=110,theta=70},line join = round, line cap = round,
declare function={R=2;v=R;% base radius and height of the cone
r=R/3;% radius of the small circle
h=(R-r)*v/R;% height of the base of the upper circle
}]
\path pic{3d/cone={r=R,h=v}} (0,0,h) pic{3d/cone={r=r,h/.evaluated=v-h}};
\end{tikzpicture}
\end{document}
```
![ScreenHunter 76.png](/image?hash=50b5aa6cb844f91e6e26d21be4e224c50c1e36fc11a3f2bd4cca0ec1b49871e3)
How to creat a macros to make a frustum knowing frustum height, cone height, base radius?
Top Answer
user 3.14159
It is not very difficult to make this a macro.
```
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{calc,3dtools}% https://github.com/marmotghost/tikz-3dtools
\newcommand{\Frustum}[4][]{%
\begin{tikzpicture}[3d/install view={phi=0,theta=70},
line join = round, line cap = round,#1]
\path pic{3d/cone={r/.evaluated=#4,h/.evaluated={#2+#3}}} (0,0,#2)
pic{3d/cone={r/.evaluated={#4*#3/(#2+#3)},h/.evaluated=#3}};
\end{tikzpicture}}
\begin{document}
\Frustum{6}{3}{4}
\end{document}
\begin{document}
\Frustum{6}{3}{4} % frustum height, cone height, base radius
\end{document}
```
![Screen Shot 2021-04-03 at 9.52.11 PM.png](/image?hash=cd0dde51c2c107c7a55f23154884925aca409850726595fa698fa128d8c03c99)
However, this example also shows why often pgf keys are more convenient. Here we need to remember which argument represents which distance. It is arguably much more convenient to use keys like `R=<radius>` etc.