algorithm_to_mesh_handler

algorithm_to_mesh_handler#

algorithm_to_mesh_handler(
mesh_or_algo,
port=0,
) tuple[DataSet, _vtk.vtkAlgorithm | _vtk.vtkAlgorithmOutput | None][source]#

Handle vtkAlgorithm where mesh objects are expected.

This is a convenience method to handle vtkAlgorithm when passed to methods that expect a DataSet. This method will check if the passed object is a vtkAlgorithm or vtkAlgorithmOutput and if so, return that algorithm’s output dataset (mesh) as the mesh to be used by the calling function.

Parameters:
mesh_or_algoDataSet | vtkAlgorithm | vtkAlgorithmOutput

The input to be used as a data set (mesh) or vtkAlgorithm object.

portint, default: 0

If the input (mesh_or_algo) is an algorithm, this specifies which output port to use on that algorithm for the returned mesh.

Returns:
meshpyvista.DataSet

The resulting mesh data set from the input.

algorithmvtkAlgorithm | vtkAlgorithmOutput | None

If an algorithm is passed, it will be returned. Otherwise returns None.