add_spline

add_spline#

Plot3d.add_spline(
*args,
iframe='rtp',
oframe='xyz',
forder=True,
v_name=None,
**kwargs,
)[source]#

Add a single polyline spline from stack-style coordinates.

Expects 1D coordinate arrays representing a single spline/trajectory of length spline_len. The points are stacked into an (spline_len, 3) array and passed to pyvista.Spline.

Parameters:
*args

(sx, sy, sz) or (sx, sy, sz, values). Coordinates must be 1D. If values are provided, they are attached to the spline mesh under v_name.

iframe, oframe{“rtp”, “xyz”}, optional

Input/output coordinate frames.

forderbool, optional

Present for symmetry; stack conversion does not currently use forder.

v_namestr or None, optional

Name for attached scalar data if values are provided.

**kwargs

Forwarded to add_mesh() (with defaults merged by parse_grid()).

Returns:
Any

Whatever pyvista.Plotter.add_points() returns.

Raises:
ValueError

If coordinate arrays are not 1D.