KochanekSpline#
- KochanekSpline(
- points: VectorLikeFloat | MatrixLikeFloat,
- *,
- tension: VectorLikeFloat | None = None,
- bias: VectorLikeFloat | None = None,
- continuity: VectorLikeFloat | None = None,
- n_points: int | None = None,
Create a Kochanek spline from points.
- Parameters:
- points
VectorLikeFloat|MatrixLikeFloat Array of points to build a Kochanek spline out of. Array must be 3D and directionally ordered.
- tension
VectorLikeFloat, default: [0.0, 0.0, 0.0] Changes the length of the tangent vector.
- bias
VectorLikeFloat, default: [0.0, 0.0, 0.0] Primarily changes the direction of the tangent vector.
- continuity
VectorLikeFloat, default: [0.0, 0.0, 0.0] Changes the sharpness in change between tangents.
- n_points
int, optional Number of points on the spline. Defaults to
points.shape[0].
- points
- Returns:
pyvista.PolyDataKochanek 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')
See Also#
pyvista.PolyDataFilters.dash_linesSplit the line cells into dashes.
pyvista.PolyDataFilters.tubeGenerate a tube around each line.
pyvista.Actor.line_styleDash the lines while rendering them.
Used In#
Gallery Examples