DataSet.get_cell#
- DataSet.get_cell(index: int) Cell[source]#
Return a
pyvista.Cellobject.- Parameters:
- index
int Cell ID.
- index
- Returns:
pyvista.CellThe i-th pyvista.Cell.
Notes#
Cells returned from this method are deep copies of the original
cells. Changing properties (for example, points) will not affect
the dataset they originated from.
Examples#
Download Python source code | Download Jupyter notebook
Get the 0-th cell.
>>> from pyvista import examples
>>> mesh = examples.load_airplane()
>>> cell = mesh.get_cell(0)
>>> cell
Cell ...
Get the point ids of the first cell
>>> cell.point_ids
[0, 1, 2]
Get the point coordinates of the first cell
>>> cell.points
array([[897.0, 48.8, 82.3],
[906.6, 48.8, 80.7],
[907.5, 55.5, 83.7]])
For the first cell, get the points associated with the first edge
>>> cell.edges[0].point_ids
[0, 1]
For a Tetrahedron, get the point ids of the last face
>>> mesh = examples.cells.Tetrahedron()
>>> cell = mesh.get_cell(0)
>>> cell.faces[-1].point_ids
[0, 2, 1]
Used In#
Guides
- Cells (1 use)
Docstring Examples
ImageDataFilters.points_to_cells(3 uses)Cell(1 use)Cell.bounds(1 use)Cell.cast_to_polydata(1 use)Cell.cast_to_unstructured_grid(1 use)17 more
Cell.center(1 use)Cell.copy(1 use)Cell.dimension(1 use)Cell.edges(1 use)Cell.faces(1 use)Cell.get_edge(1 use)Cell.get_face(1 use)Cell.is_linear(1 use)Cell.n_edges(1 use)Cell.n_faces(1 use)Cell.n_points(1 use)Cell.plot(1 use)Cell.point_ids(1 use)Cell.points(1 use)Cell.type(1 use)DataSet.point_is_inside_cell(1 use)Polyhedron(1 use)
Gallery Examples