CellArray#
- class CellArray(*args, **kwargs)[source]#
PyVista wrapping of vtkCellArray.
Provides convenience functions to simplify creating a CellArray from a NumPy array or list.
- Parameters:
- cells
np.ndarrayorlist,optional Import an array of data with the legacy vtkCellArray layout: each cell is stored as its point count followed by that many point indices, with cells concatenated back-to-back (for example
[3, 0, 1, 2, 4, 0, 1, 2, 3]for a triangle followed by a quad).
- cells
Examples#
Download Python source code | Download Jupyter notebook
Create a cell array containing two triangles from the traditional interleaved format
Create a cell array containing two triangles from separate offsets and connectivity arrays
>>> from pyvista.core.cell import CellArray
>>> offsets = [0, 3, 6]
>>> connectivity = [0, 1, 2, 3, 4, 5]
>>> cellarr = CellArray.from_arrays(offsets, connectivity)
Inheritance#
Wraps vtkCellArray.
Attributes#
Return the connectivity array. |
|
Return the offsets array. |
|
Return a NumPy array of the cells. |
|
Return the array with the point ids that define the cells' connectivity. |
|
Return the number of cells. |
|
Return the array used to store cell offsets. |
|
Return a ( |
Methods#
|
Construct a CellArray from offsets and connectivity arrays. |
Construct a |
|
|
Construct a |