ParametricSuperEllipsoid

ParametricSuperEllipsoid(xradius=None, yradius=None, zradius=None, n1=None, n2=None, **kwargs)

Generate a superellipsoid.

ParametricSuperEllipsoid generates a superellipsoid. A superellipsoid is a versatile primitive that is controlled by two parameters n1 and n2. As special cases it can represent a sphere, square box, and closed cylindrical can.

Parameters
xradiusfloat, optional

The scaling factor for the x-axis. Default is 1.

yradiusfloat, optional

The scaling factor for the y-axis. Default is 1.

zradiusfloat, optional

The scaling factor for the z-axis. Default is 1.

n1float, optional

The “squareness” parameter in the z axis. Default is 1.

n2float, optional

The “squareness” parameter in the x-y plane. Default is 1.

**kwargsdict, optional

See surface_from_para() for additional keyword arguments.

Returns
pyvista.PolyData

ParametricSuperEllipsoid surface.

See also

pyvista.ParametricSuperToroid

Toroidal equivalent of ParametricSuperEllipsoid.

pyvista.Superquadric

Geometric object with additional parameters.

Examples

Create a ParametricSuperEllipsoid surface that looks like a box with smooth edges.

>>> import pyvista
>>> mesh = pyvista.ParametricSuperEllipsoid(n1=0.02, n2=0.02)
>>> mesh.plot(color='w', smooth_shading=True)
../../../_images/pyvista-ParametricSuperEllipsoid-1_00_00.png

Create one that looks like a spinning top.

>>> mesh = pyvista.ParametricSuperEllipsoid(n1=4, n2=0.5)
>>> mesh.plot(color='w', smooth_shading=True, cpos='xz')
../../../_images/pyvista-ParametricSuperEllipsoid-1_01_00.png