pyvista.UnstructuredGrid.cast_to_explicit_structured_grid#

UnstructuredGrid.cast_to_explicit_structured_grid()[source]#

Cast to an explicit structured grid.

Returns:
pyvista.ExplicitStructuredGrid

An explicit structured grid.

Raises:
TypeError

If the unstructured grid doesn’t have the 'BLOCK_I', 'BLOCK_J' and 'BLOCK_K' cells arrays.

Examples

>>> from pyvista import examples
>>> grid = examples.load_explicit_structured()
>>> grid.plot(color='w', show_edges=True, show_bounds=True)
https://d33wubrfki0l68.cloudfront.net/ea647d90b0750b261ab7ddaa4eca16adb6fd4c2e/40a41/_images/pyvista-unstructuredgrid-cast_to_explicit_structured_grid-1_00_00.png
>>> grid = grid.hide_cells(range(80, 120))
>>> grid.plot(color='w', show_edges=True, show_bounds=True)
https://d33wubrfki0l68.cloudfront.net/a4438d836acb24eab2374fd5c87bea2f58360015/80c8d/_images/pyvista-unstructuredgrid-cast_to_explicit_structured_grid-1_01_00.png
>>> grid = grid.cast_to_unstructured_grid()
>>> grid.plot(color='w', show_edges=True, show_bounds=True)
https://d33wubrfki0l68.cloudfront.net/9b7c9547837986c2519bc0e72bae0f2761b791df/b871c/_images/pyvista-unstructuredgrid-cast_to_explicit_structured_grid-1_02_00.png
>>> grid = grid.cast_to_explicit_structured_grid()
>>> grid.plot(color='w', show_edges=True, show_bounds=True)
https://d33wubrfki0l68.cloudfront.net/a4438d836acb24eab2374fd5c87bea2f58360015/4e4ef/_images/pyvista-unstructuredgrid-cast_to_explicit_structured_grid-1_03_00.png