# Examples from pyvista.CellArray.cell_connectivity
# =================================================

import pyvista as pv
cell_array = pv.CellArray.from_arrays([0, 3, 6], [0, 1, 2, 3, 4, 5])
cell_array.cell_connectivity

cell_array.cell_connectivity = [5, 4, 3, 2, 1, 0]
cell_array.cell_connectivity

# For a cell array large enough that the copy matters, keep the connectivity
# array and edit it in place.
import numpy as np
connectivity = np.array([0, 1, 2, 3, 4, 5], dtype=pv.ID_TYPE)
cell_array = pv.CellArray.from_arrays([0, 3, 6], connectivity, deep=False)
connectivity[:] = [5, 4, 3, 2, 1, 0]
cell_array.cell_connectivity

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code
