A Superellipsoid or super-egg.
You can control the shape using these values:
r
t
A
B
C
The default values give Piet Hein's superegg. Other interesting cases to try are:
r=2, t=2, ellipsoids
r=1, t=1, octohedra
r=0.7, t=0.7, pointy stars.
Superellipsoids are three dimensional versions of superellipses which in turn are
a cross between a square and a circle. A circle has equation if we generalise that we get the
superellipses . You can play with the 2D version
parametric version (faster)
implicit verson (slower).
The equation for the superellipsoid is
.
To generate the mesh I have started with a mesh on a cube, project them onto a sphere, and find the spherical
coordinates, , , .
Using the polar representation for the superellipse
Where ,
.
This simplifies to
with and .
See this answer at stackoverflow.
Readers comments
Definition of the theta and phi
Yibin Jiang
Mon Nov 19 2018
The definition of theta and phi can be varied according to t and r. Theta is not always defined by atan2(x,y), neither as phi.