pyvista.ParametricSuperEllipsoid#
- ParametricSuperEllipsoid(
- xradius: float | None = None,
- yradius: float | None = None,
- zradius: float | None = None,
- n1: float | None = None,
- n2: float | None = 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:
- xradius
float
, default: 1 The scaling factor for the x-axis.
- yradius
float
, default: 1 The scaling factor for the y-axis.
- zradius
float
, default: 1 The scaling factor for the z-axis.
- n1
float
, default: 1 The “squareness” parameter in the z-axis.
- n2
float
, default: 1 The “squareness” parameter in the x-y plane.
- **kwargs
dict
,optional
See
surface_from_para()
for additional keyword arguments.
- xradius
- 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)
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')