Analytical expression for the shape of the rounded pyramid. I'm searching for an analytical equation approximating the pyramid with rounded tip. 
In particular, I have a pyramid whose base is an equilateral triangle with side "a", and height "h". The tip of the pyramid is rounded by some radius "r". (The point is to model the shape of the Berkovich indenter).
Could you suggest any (possibly simple) function that could approximate the shape of this pyramid?
 A: Place $a,\,b > 0$, are given the functions $f,\,g : \left[-\frac{\sqrt{3}\,a}{6},\,\frac{\sqrt{3}\,a}{3}\right] \times \left[-\frac{a}{2},\,\frac{a}{2}\right] \to \mathbb{R}$ respectively of laws:
$$
\begin{aligned}
f(x,\,y) := 
& \left(1 + \text{sign}(y)\right)\left(1 + \text{sign}\left(\sqrt{3}\,x+y\right)\right)\left(\sqrt{3}\,x+3\,y\right) + \\
& \left(1 - \text{sign}(y)\right)\left(1 + \text{sign}\left(\sqrt{3}\,x-y\right)\right)\left(\sqrt{3}\,x-3\,y\right) + \\
& \left(1 - \text{sign}\left(\sqrt{3}\,x+y\right)\right)\left(1 - \text{sign}\left(\sqrt{3}\,x-y\right)\right)\left(-2\sqrt{3}\,x\right)
& \end{aligned}\,;
$$
$$g(x,\,y) := b\left(1 - \frac{f(x,\,y)}{4a}\right).$$
Well, the graph of the following set of points:
$$f(x,\,y) = 4a$$
turns out to be the boundary of an equilateral triangle of side $a$, center $O$ and with a vertex on the x-axis:

while the graph of the following function:
$$z = g(x,\,y)$$
turns out to be the lateral surface of a pyramid high $b$ and of basis the previous equilateral triangle:

Then, place $0 \le c < 1$, considering a tip defect $c\,b$ we introduce a sphere characterized by:
$$
r = \frac{c\,b}{\sqrt{1+12\left(\frac{b}{a}\right)^2}-1}\,, 
\; \; \; \; \; \; 
C\left(0,\,0,\,(1-c)b - r\right),
$$
of which emerges from the pyramid trunk a spherical cap characterized by:
$$
b_0 = \frac{c\,b}{\sqrt{1+12\left(\frac{b}{a}\right)^2}}\,, 
\; \; \; \; \; \; 
r_0 = \sqrt{r^2 - (r - b_0)^2}.
$$
We are therefore ready to define the function $h : \left[-\frac{\sqrt{3}\,a}{6},\,\frac{\sqrt{3}\,a}{3}\right] \times \left[-\frac{a}{2},\,\frac{a}{2}\right] \to \mathbb{R}$ of law:
$$
h(x,\,y) := 
\begin{cases}
g(x,\,y) & \text{if} \; g(x,\,y) \le (1-c)b - b_0 \\
(1-c)b - r + \sqrt{r^2 - x^2 - y^2} & \text{if} \; x^2+y^2 \le r_0^2 \\
(1-c)b - b_0 & \text{otherwise}
\end{cases}
$$
and drawing the graph of:
$$z = h(x,\,y)$$
we get a spherical-tip-pyramid as required:

Final considerations
The function $h$ thus defined is not the maximum of simplicity and furthermore its graph does not faithfully describe the penetrator Berkovich, who, at the level of FEM model, from what I know, is modeled by a spherical-tip-cone, which naturally it does not correspond to reality but can be analytically described by an almost trivial function. However, this can still be a basis for developing a better model than the one presented here.
A: Since I was not satisfied with existing formulations, I decided to approximate the pyramid with the rounded cone:

where a describes the slope of the cone's side and delta is the rounding parameter. Inside the square root it is reponsible for roundness, outside for having a tip of the approximated indenter in the origin (0,0,0).
This is a very crude approximation, however I have shown that it led to satisfactory results in my case.
If you ever find this information useful and use it in your publication, please cite:
K. Frydrych, CRYSTAL PLASTICITY FINITE ELEMENT SIMULATIONS OF THE INDENTATION TEST, Computer Methods in Materials Science, 19(2), 41-49, 2019.
https://www.researchgate.net/publication/337768801_CRYSTAL_PLASTICITY_FINITE_ELEMENT_SIMULATIONS_OF_THE_INDENTATION_TEST
