code: def lines_from_points(points):
      
      # Assuming ordered points, create array defining line order
      npoints = points.shape[0] - 1
      lines = np.vstack((2 * np.ones(npoints, np.int),
                         np.arange(npoints),
                         np.arange(1, npoints + 1))).T.ravel()
  
      return vtki.PolyData(points, lines)
docs: Generates line from points.  Assumes points are ordered as line segments.
  
      Parameters
      ----------
      points : np.ndarray
          Points representing line segments.  For example, two line segments
          would be represented as:
  
          np.array([[0, 0, 0], [1, 0, 0], [1, 0, 0], [1, 1, 0]])
  
      Returns
      -------
      lines : vtki.PolyData
          PolyData with lines and cells.
  
      Examples
      --------
      This example plots two line segments at right angles to each other line.
  
      >>> import vtki
      >>> import numpy as np
      >>> points = np.array([[0, 0, 0], [1, 0, 0], [1, 0, 0], [1, 1, 0]])
      >>> lines = vtki.lines_from_points(points)
      >>> lines.plot() # doctest:+SKIP