Cell#
- class Cell(*args, **kwargs)[source]#
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:
See also
Notes#
Accessing individual cells from a pyvista.DataSet using this class
will be much slower than accessing bulk data from the
pyvista.PolyData.faces or 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, pyvista.Cell.points) will not change the original dataset.
Examples#
Download Python source code | Download Jupyter notebook
Get the 0-th cell from a pyvista.PolyData.
>>> import pyvista as pv
>>> mesh = pv.Sphere()
>>> cell = mesh.get_cell(0)
>>> cell
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 pyvista.UnstructuredGrid.
>>> from pyvista import examples
>>> mesh = examples.load_hexbeam()
>>> cell = mesh.get_cell(0)
>>> cell
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
Methods#
Cast this cell to PolyData. |
|
Cast this cell to an unstructured grid. |
|
|
Return a copy of the cell. |
|
Get the i-th edge composing the cell. |
|
Get the i-th face composing the cell. |
|
Plot this cell. |
Attributes#
Get the cell bounds in |
|
Get the center of the cell. |
|
Return the cell dimension. |
|
Return a list of edges composing the cell. |
|
Return a list of faces composing the cell. |
|
Return if the cell is linear. |
|
Get the number of edges composing the cell. |
|
Get the number of faces composing the cell. |
|
Get the number of points composing the cell. |
|
Get the point IDs composing the cell. |
|
Get the point coordinates of the cell. |
|
Get the cell type from the enum |