pyvista.ParametricSuperToroid

pyvista.ParametricSuperToroid#

ParametricSuperToroid(
ringradius: float | None = None,
crosssectionradius: float | None = None,
xradius: float | None = None,
yradius: float | None = None,
zradius: float | None = None,
n1: float | None = None,
n2: float | None = None,
**kwargs,
) PolyData[source]#

Generate a supertoroid.

ParametricSuperToroid generates a supertoroid. Essentially a supertoroid is a torus with the sine and cosine terms raised to a power. A supertoroid is a versatile primitive that is controlled by four parameters r0, r1, n1 and n2. r0, r1 determine the type of torus whilst the value of n1 determines the shape of the torus ring and n2 determines the shape of the cross section of the ring. It is the different values of these powers which give rise to a family of 3D shapes that are all basically toroidal in shape.

Parameters:
ringradiusfloat, default: 1

The radius from the center to the middle of the ring of the supertoroid.

crosssectionradiusfloat, default: 0.5

The radius of the cross section of ring of the supertoroid.

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 shape of the torus ring.

n2float, default: 1

The shape of the cross section of the ring.

**kwargsdict, optional

See surface_from_para() for additional keyword arguments.

Returns:
pyvista.PolyData

ParametricSuperToroid surface.

See also

pyvista.ParametricSuperEllipsoid

Ellipsoidal equivalent of ParametricSuperToroid.

pyvista.Superquadric

Geometric object with additional parameters.

Examples

Create a ParametricSuperToroid mesh.

>>> import pyvista as pv
>>> mesh = pv.ParametricSuperToroid(n1=2, n2=0.3)
>>> mesh.plot(color='w', smooth_shading=True)
../../../_images/pyvista-ParametricSuperToroid-1_00_00.png