pyvista.KochanekSpline#

KochanekSpline(points, tension=None, bias=None, continuity=None, n_points=None)[source]#

Create a Kochanek spline from points.

Parameters:
pointsarray_like[float]

Array of points to build a Kochanek spline out of. Array must be 3D and directionally ordered.

tensionsequence[float], default: [0.0, 0.0, 0.0]

Changes the length of the tangent vector.

biassequence[float], default: [0.0, 0.0, 0.0]

Primarily changes the direction of the tangent vector.

continuitysequence[float], default: [0.0, 0.0, 0.0]

Changes the sharpness in change between tangents.

n_pointsint, default: points.shape[0]

Number of points on the spline.

Returns:
pyvista.PolyData

Kochanek spline.

Examples

Construct a Kochanek spline.

>>> import numpy as np
>>> import pyvista as pv
>>> theta = np.linspace(-4 * np.pi, 4 * np.pi, 100)
>>> z = np.linspace(-2, 2, 100)
>>> r = z**2 + 1
>>> x = r * np.sin(theta)
>>> y = r * np.cos(theta)
>>> points = np.column_stack((x, y, z))
>>> kochanek_spline = pv.KochanekSpline(points, n_points=6)
>>> kochanek_spline.plot(line_width=4, color="k")
../../../_images/pyvista-KochanekSpline-1_00_00.png

See Create a Kochanek Spline for an additional example.