pyvista.ParametricSuperEllipsoid#

ParametricSuperEllipsoid(xradius=None, yradius=None, zradius=None, n1=None, n2=None, **kwargs)[source]#

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, default: 1

The scaling factor for the x-axis.

yradiusfloat, default: 1

The scaling factor for the y-axis.

zradiusfloat, default: 1

The scaling factor for the z-axis.

n1float, default: 1

The “squareness” parameter in the z axis.

n2float, default: 1

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

**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 as pv
>>> mesh = pv.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 = pv.ParametricSuperEllipsoid(n1=4, n2=0.5)
>>> mesh.plot(color='w', smooth_shading=True, cpos='xz')
../../../_images/pyvista-ParametricSuperEllipsoid-1_01_00.png