class_docstr: Wrapping of vtkCell.
  
  This class provides the capability to access a given cell topology and can
  be useful when walking through a cell's individual faces or investigating
  cell properties.
  
  Parameters
  ----------
  vtk_cell : vtk.vtkCell, optional
      The vtk object to wrap as Cell, that must be of ``vtk.vtkCell`` type.
  
  cell_type : int, optional
      VTK cell type. Determined from ``vtk_cell`` if not input.
  
  deep : bool, default: False
      Perform a deep copy of the original cell.
  
  Notes
  -----
  Accessing individual cells from a :class:`pyvista.DataSet` using this class
  will be much slower than accessing bulk data from the
  :attr:`pyvista.PolyData.faces` or :attr:`pyvista.UnstructuredGrid.cells` attributes.
  
  Also note that the cell object is a deep copy of the original cell and
  is unassociated with the original cell. Changing any data of
  that cell (for example, :attr:`pyvista.Cell.points`) will not change the original dataset.
  
  Examples
  --------
  Get the 0-th cell from a :class:`pyvista.PolyData`.
  
  >>> import pyvista as pv
  >>> mesh = pv.Sphere()
  >>> cell = mesh.get_cell(0)
  >>> cell  # doctest: +SKIP
  Cell (0x7fa760075a10)
    Type:       <CellType.TRIANGLE: 5>
    Linear:     True
    Dimension:  2
    N Points:   3
    N Faces:    0
    N Edges:    3
    X Bounds:   -5.406e-02, -5.551e-17
    Y Bounds:   0.000e+00, 1.124e-02
    Z Bounds:   -5.000e-01, -4.971e-01
  
  Get the 0-th cell from a :class:`pyvista.UnstructuredGrid`.
  
  >>> from pyvista import examples
  >>> mesh = examples.load_hexbeam()
  >>> cell = mesh.get_cell(0)
  >>> cell  # doctest: +SKIP
  Cell (0x7fdc71a3c210)
    Type:       <CellType.HEXAHEDRON: 12>
    Linear:     True
    Dimension:  3
    N Points:   8
    N Faces:    6
    N Edges:    12
    X Bounds:   0.000e+00, 5.000e-01
    Y Bounds:   0.000e+00, 5.000e-01
    Z Bounds:   0.000e+00, 5.000e-01
docstr: Cast this cell to an unstructured grid.
  
  Returns
  -------
  pyvista.UnstructuredGrid
      This cell cast to a :class:`pyvista.UnstructuredGrid`.
  
  Examples
  --------
  >>> from pyvista import examples
  >>> mesh = examples.load_hexbeam()
  >>> cell = mesh.get_cell(0)
  >>> grid = cell.cast_to_unstructured_grid()
  >>> grid  # doctest: +SKIP
  UnstructuredGrid (0x7f9383619540)
    N Cells:      1
    N Points:     8
    X Bounds:     0.000e+00, 5.000e-01
    Y Bounds:     0.000e+00, 5.000e-01
    Z Bounds:     0.000e+00, 5.000e-01
    N Arrays:     0
docstr_tok: ["Cast","this","cell","to","an","unstructured","grid",".","Returns","--","--","--","-","pyvista.UnstructuredGrid","This","cell","cast","to","a",":","class",":","`","pyvista.UnstructuredGrid","`",".","Examples","--","--","--","--",">",">",">","from","pyvista","import","examples",">",">",">","mesh","=","examples.load_hexbeam","(",")",">",">",">","cell","=","mesh.get_cell","(","0",")",">",">",">","grid","=","cell.cast_to_unstructured_grid","(",")",">",">",">","grid","#","doctest",":","+SKIP","UnstructuredGrid","(","0x7f9383619540",")","N","Cells",":","1","N","Points",":","8","X","Bounds",":","0.000e+00",",","5.000e-01","Y","Bounds",":","0.000e+00",",","5.000e-01","Z","Bounds",":","0.000e+00",",","5.000e-01","N","Arrays",":","0"]
code: def cast_to_unstructured_grid(self) -> pyvista.UnstructuredGrid:
      """Cast this cell to an unstructured grid.
  
      Returns
      -------
      pyvista.UnstructuredGrid
          This cell cast to a :class:`pyvista.UnstructuredGrid`.
  
      Examples
      --------
      >>> from pyvista import examples
      >>> mesh = examples.load_hexbeam()
      >>> cell = mesh.get_cell(0)
      >>> grid = cell.cast_to_unstructured_grid()
      >>> grid  # doctest: +SKIP
      UnstructuredGrid (0x7f9383619540)
        N Cells:      1
        N Points:     8
        X Bounds:     0.000e+00, 5.000e-01
        Y Bounds:     0.000e+00, 5.000e-01
        Z Bounds:     0.000e+00, 5.000e-01
        N Arrays:     0
  
      """
      if self.type == CellType.POLYHEDRON:
          # construct from faces
          cell_ids = [self.n_faces]
          for face in self.faces:
              cell_ids.append(len(face.point_ids))
              cell_ids.extend(
                  self.point_ids.index(i) for i in face.point_ids
              )
          cell_ids.insert(0, len(cell_ids))
      else:
          cell_ids = [len(self.point_ids)] + list(
              range(len(self.point_ids))
          )
      return pyvista.UnstructuredGrid(
          cell_ids,
          [int(self.type)],
          self.points.copy(),
      )
  
imports: from __future__ import annotations
  from typing import List, Optional, Sequence, Tuple, Union, cast
  import numpy
  import pyvista
  from .None import _vtk_core
  from ._typing_core import Matrix, NumpyArray, Vector
  from .celltype import CellType
  from .dataset import DataObject
  from .errors import CellSizeError
  from .utilities.cells import ncells_from_cells, numpy_to_idarr
label_desc: Use image node_id 6 for calling the Cell obj's underlying member method code with example usage: obj.cast_to_unstructured_grid() and returns: pyvista