add_splines

add_splines#

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

Add multiple splines (polylines) from stack-style 2D coordinate arrays.

Expects coordinate arrays shaped (spline_len, num_splines). Each column defines a separate spline. Internally, this is converted into a pyvista.PolyData with line cells connecting points within each spline.

Parameters:
*args

(sx, sy, sz) or (sx, sy, sz, values) where each coordinate array is 2D with shape (spline_len, num_splines).

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. Note: depending on how values is shaped/flattened upstream, it may represent either per-point or per-spline data.

**kwargs

Forwarded to add_mesh().

Returns:
Any

Whatever pyvista.Plotter.add_points() returns.

Raises:
ValueError

If coordinate arrays are not 2D with shape (spline_len, num_splines).