In mathematics, the superquadrics or super-quadrics are a family of geometric shapes defined by formulas that resemble those of ellipsoids and other quadrics, except that the squaringoperations are replaced by arbitrary powers. They can be seen as the three-dimensional relatives of the superellipses. The term may refer to the solid object or to its surface, depending on the context. The equations below specify the surface; the solid is specified by replacing the equality signs by less-than-or-equal signs. The superquadrics include many shapes that resemble cubes, octahedra, cylinders, lozenges and spindles, with rounded or sharp corners. Because of their flexibility and relative simplicity, they are popular geometric modeling tools, especially in computer graphics. Some authors, such as Alan Barr, define "superquadrics" as including both the superellipsoids and the supertoroids. However, the supertoroids are not superquadrics as defined above; and, while some superquadrics are superellipsoids, neither family is contained in the other. Comprehensive coverage of geometrical properties of superquadrics and a method of their recovery from range images is covered in a monograph.
Formulas
Implicit equation
The surface of the basic superquadric is given by where r, s, and t are positive real numbers that determine the main features of the superquadric. Namely:
Each exponent can be varied independently to obtain combined shapes. For example, if r=s=2, and t=4, one obtains a solid of revolution which resembles an ellipsoid with round cross-section but flattened ends. This formula is a special case of the superellipsoid's formula if r = s. If any exponent is allowed to be negative, the shape extends to infinity. Such shapes are sometimes called super-hyperboloids. The basic shape above spans from -1 to +1 along each coordinate axis. The general superquadric is the result of scaling this basic shape by different amounts A, B, C along each axis. Its general equation is
The following GNU Octave code generates a mesh approximation of a superquadric: function retval=superquadric n=50; etamax=pi/2; etamin=-pi/2; wmax=pi; wmin=-pi; deta=/n; dw=/n; = meshgrid eta = etamin + * deta; w = wmin + * dw; x = a.* sign.* abs.^epsilon.* sign.* abs.^epsilon; y = a.* sign.* abs.^epsilon.* sign.* abs.^epsilon; z = a.* sign.* abs.^epsilon; mesh; endfunction;