util Package

util Package

paraview.util.Glob(path, rootDir=None)[source]

Given a path, this function performs globbing on the file names inside the input directory. rootDir is an optional parameter that can set a relative root directory from which path is defined. This function returns the list of files matching the globbing pattern (the wildcard * is an example of pattern that can be used) of the input path. Note that for this function to work, the globbing pattern needs to only belong to the file name at the end of path. fnmatch package is used as the backend for processing the input pattern.

paraview.util.IntegrateCell(dataset, cellId)[source]

This functions uses vtkCellIntegrator’s Integrate method that calculates the length/area/volume of a 1D/2D/3D cell. The calculation is exact for lines, polylines, triangles, triangle strips, pixels, voxels, convex polygons, quads and tetrahedra. All other 3D cells are triangulated during volume calculation. In such cases, the result may not be exact.


Replaces all substrings of the type ${FOO} with FOO obtained from the os.environ. If the key is not defined in the environment, this raises a KeyError.

paraview.util.SetOutputWholeExtent(algorithm, extent)[source]

Convenience method to help set the WHOLE_EXTENT() in RequestInformation. Commonly used by programmable filters. The arguments are the algorithm and a tuple/list with 6 elements (xmin, xmax, ymin, ymax, zmin, zmax).

Example use:

import paraview.util
# The output will be of dimensions 10, 1, 1
paraview.util.SetOutputWholeExtent(algorithm, (0, 9, 0, 0, 0, 0)