pyvista.PolyData.lines#
- property PolyData.lines: NumpyArray[int][source]#
Return the lines connectivity array.
Like all padded VTK connectivity arrays, the array is structured as:
[n0, p0_0, p0_1, ..., p0_n, n1, p1_0, p1_1, ..., p1_n, ...]
where
n0is the number of points in line 0, andpX_Yis the Y’th point in line X.Lines can be a single
LINEcell with connectivity to two points, or aPOLY_LINEwith connectivity to any number of points.For example, a single line and poly-line with five points might be represented as:
[2, 0, 1, 5, 3, 2, 4, 6, 5]
Where the two separate line cells are
[2, 0, 1]and[5, 3, 2, 4, 6, 5].Lines can also be set by assigning a
CellArray.Examples
Return the lines from a spline.
>>> import pyvista as pv >>> import numpy as np >>> points = np.random.default_rng().random((3, 3)) >>> spline = pv.Spline(points, 10) >>> spline.lines array([10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9])