source_algorithm

source_algorithm#

source_algorithm(generator: Callable[[], DataSet], output_type: str | type = <class 'pyvista.core.pointset.UnstructuredGrid'>) SourceAlgorithm[source]#

Create a source algorithm that generates data from a callable.

A source has no input port. It produces data from scratch via generator.

Parameters:
generatorcallable()

generator() -> dataset.

output_typestr | type[pyvista.DataSet], default: pyvista.UnstructuredGrid

Output type. Accepts a VTK class name string or a PyVista DataSet subclass.

Returns:
SourceAlgorithm

The source algorithm.