KochanekSpline

KochanekSpline#

KochanekSpline(
points: VectorLikeFloat | MatrixLikeFloat,
*,
tension: VectorLikeFloat | None = None,
bias: VectorLikeFloat | None = None,
continuity: VectorLikeFloat | None = None,
n_points: int | None = None,
) → PolyData[source]#

Create a Kochanek spline from points.

Parameters:
pointsVectorLikeFloat | MatrixLikeFloat

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

tensionVectorLikeFloat, default: [0.0, 0.0, 0.0]

Changes the length of the tangent vector.

biasVectorLikeFloat, default: [0.0, 0.0, 0.0]

Primarily changes the direction of the tangent vector.

continuityVectorLikeFloat, default: [0.0, 0.0, 0.0]

Changes the sharpness in change between tangents.

n_pointsint, optional

Number of points on the spline. Defaults to points.shape[0].

Returns:
pyvista.PolyData

Kochanek spline.

Examples#

Download Python source code | Download Jupyter notebook

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-b2d7467dbbe8ee09_00_00.png

See Also#

pyvista.PolyDataFilters.dash_lines

Split the line cells into dashes.

pyvista.PolyDataFilters.tube

Generate a tube around each line.

pyvista.Actor.line_style

Dash the lines while rendering them.