pyvista.DataSetFilters.tessellate

pyvista.DataSetFilters.tessellate#

DataSetFilters.tessellate(max_n_subdivide=3, merge_points=True, progress_bar=False)[source]#

Tessellate a mesh.

This filter approximates nonlinear FEM-like elements with linear simplices. The output mesh will have geometry and any fields specified as attributes in the input mesh’s point data. The attribute’s copy flags are honored, except for normals.

For more details see vtkTessellatorFilter.

Parameters:
max_n_subdivideint, default: 3

Maximum number of subdivisions.

merge_pointsbool, default: True

The adaptive tessellation will output vertices that are not shared among cells, even where they should be. This can be corrected to some extent.

progress_barbool, default: False

Display a progress bar to indicate progress.

Returns:
pyvista.DataSet

Dataset with tessellated mesh. Return type matches input.

Examples

First, plot the high order FEM-like elements.

>>> import pyvista as pv
>>> import numpy as np
>>> points = np.array(
...     [
...         [0.0, 0.0, 0.0],
...         [2.0, 0.0, 0.0],
...         [1.0, 2.0, 0.0],
...         [1.0, 0.5, 0.0],
...         [1.5, 1.5, 0.0],
...         [0.5, 1.5, 0.0],
...     ]
... )
>>> cells = np.array([6, 0, 1, 2, 3, 4, 5])
>>> cell_types = np.array([69])
>>> mesh = pv.UnstructuredGrid(cells, cell_types, points)
>>> mesh.plot(show_edges=True, line_width=5)
../../../_images/pyvista-DataSetFilters-tessellate-1_00_00.png

Now, plot the tessellated mesh.

>>> tessellated = mesh.tessellate()
>>> tessellated.clear_data()  # cleans up plot
>>> tessellated.plot(show_edges=True, line_width=5)
../../../_images/pyvista-DataSetFilters-tessellate-1_01_00.png