code: def stack_3D(points, return_2D=False):
      
      points = np.asanyarray(points, dtype=np.float64)
      shape = points.shape
  
      if len(shape) != 2:
          raise ValueError('Points must be 2D array!')
  
      if shape[1] == 2:
          points = np.column_stack((points,
                                    np.zeros(len(points))))
          is_2D = True
      elif shape[1] == 3:
          is_2D = False
      else:
          raise ValueError('Points must be (n,2) or (n,3)!')
  
      if return_2D:
          return points, is_2D
  
      return points
docs: For a list of (n, 2) or (n, 3) points return them
      as (n, 3) 3D points, 2D points on the XY plane.
  
      Parameters
      ----------
      points :  (n, 2) or (n, 3) float
        Points in either 2D or 3D space
      return_2D : bool
        Were the original points 2D?
  
      Returns
      ----------
      points : (n, 3) float
        Points in space
      is_2D : bool
        Only returned if return_2D
        If source points were (n, 2) True