util Package

util Package

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.

paraview.util.ReplaceDollarVariablesWithEnvironment(text)[source]

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)