pyvista.DataSet#

class DataSet(*args, **kwargs)[source]#

Methods in common to spatially referenced objects.

Parameters:
*args

Any extra args are passed as option to spatially referenced objects.

**kwargs

Any extra keyword args are passed as option to spatially referenced objects.

Methods

DataSet.cast_to_pointset([pass_cell_data])

Extract the points of this dataset and return a pyvista.PointSet.

DataSet.cast_to_poly_points([pass_cell_data])

Extract the points of this dataset and return a pyvista.PolyData.

DataSet.cast_to_unstructured_grid()

Get a new representation of this object as a pyvista.UnstructuredGrid.

DataSet.cell_neighbors(ind[, connections])

Get the cell neighbors of the ind-th cell.

DataSet.cell_neighbors_levels(ind[, ...])

Get consecutive levels of cell neighbors.

DataSet.clear_cell_data()

Remove all cell arrays.

DataSet.clear_data()

Remove all arrays from point/cell/field data.

DataSet.clear_point_data()

Remove all point arrays.

DataSet.copy_from(mesh[, deep])

Overwrite this dataset inplace with the new dataset's geometries and data.

DataSet.copy_meta_from(ido[, deep])

Copy pyvista meta data onto this object from another object.

DataSet.find_cells_along_line(pointa, pointb)

Find the index of cells whose bounds intersect a line.

DataSet.find_cells_intersecting_line(pointa, ...)

Find the index of cells that intersect a line.

DataSet.find_cells_within_bounds(bounds)

Find the index of cells in this mesh within bounds.

DataSet.find_closest_cell(point[, ...])

Find index of closest cell in this mesh to the given point.

DataSet.find_closest_point(point[, n])

Find index of closest point in this mesh to the given point.

DataSet.find_containing_cell(point)

Find index of a cell that contains the given point.

DataSet.flip_normal(normal[, point, ...])

Flip mesh about the normal.

DataSet.flip_x([point, ...])

Flip mesh about the x-axis.

DataSet.flip_y([point, ...])

Flip mesh about the y-axis.

DataSet.flip_z([point, ...])

Flip mesh about the z-axis.

DataSet.get_array(name[, preference])

Search both point, cell and field data for an array.

DataSet.get_array_association(name[, preference])

Get the association of an array.

DataSet.get_cell(index)

Return a pyvista.Cell object.

DataSet.get_data_range([arr_var, preference])

Get the min and max of a named array.

DataSet.plot([off_screen, full_screen, ...])

Plot a PyVista, numpy, or vtk object.

DataSet.point_cell_ids(ind)

Get the cell IDs that use the ind-th point.

DataSet.point_is_inside_cell(ind, point)

Return whether one or more points are inside a cell.

DataSet.point_neighbors(ind)

Get the point neighbors of the ind-th point.

DataSet.point_neighbors_levels(ind[, n_levels])

Get consecutive levels of point neighbors.

DataSet.rename_array(old_name, new_name[, ...])

Change array name by searching for the array then renaming it.

DataSet.rotate_vector(vector, angle[, ...])

Rotate mesh about a vector.

DataSet.rotate_x(angle[, point, ...])

Rotate mesh about the x-axis.

DataSet.rotate_y(angle[, point, ...])

Rotate mesh about the y-axis.

DataSet.rotate_z(angle[, point, ...])

Rotate mesh about the z-axis.

DataSet.scale(xyz[, ...])

Scale the mesh.

DataSet.set_active_scalars(name[, preference])

Find the scalars by name and appropriately sets it as active.

DataSet.set_active_tensors(name[, preference])

Find the tensors by name and appropriately sets it as active.

DataSet.set_active_vectors(name[, preference])

Find the vectors by name and appropriately sets it as active.

DataSet.translate(xyz[, ...])

Translate the mesh.

Attributes

DataSet.active_normals

Return the active normals as an array.

DataSet.active_scalars

Return the active scalars as an array.

DataSet.active_scalars_info

Return the active scalar's association and name.

DataSet.active_scalars_name

Return the name of the active scalars.

DataSet.active_t_coords

Return the active texture coordinates on the points.

DataSet.active_tensors

Return the active tensors array.

DataSet.active_tensors_info

Return the active tensor's field and name: [field, name].

DataSet.active_tensors_name

Return the name of the active tensor array.

DataSet.active_texture_coordinates

Return the active texture coordinates on the points.

DataSet.active_vectors

Return the active vectors array.

DataSet.active_vectors_info

Return the active vector's association and name.

DataSet.active_vectors_name

Return the name of the active vectors array.

DataSet.area

Return the mesh area if 2D.

DataSet.array_names

Return a list of array names for the dataset.

DataSet.arrows

Return a glyph representation of the active vector data as arrows.

DataSet.bounds

Return the bounding box of this dataset.

DataSet.cell

A generator that provides an easy way to loop over all cells.

DataSet.cell_data

Return cell data as DataSetAttributes.

DataSet.center

Return the center of the bounding box.

DataSet.length

Return the length of the diagonal of the bounding box.

DataSet.n_arrays

Return the number of arrays present in the dataset.

DataSet.n_cells

Return the number of cells in the entire dataset.

DataSet.n_points

Return the number of points in the entire dataset.

DataSet.number_of_cells

Return the number of cells.

DataSet.number_of_points

Return the number of points.

DataSet.point_data

Return point data as DataSetAttributes.

DataSet.points

Return a reference to the points as a numpy object.

DataSet.volume

Return the mesh volume.