tessellate#

PointSet.tessellate(max_n_subdivide=3, merge_points=True, progress_bar=False)#

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, optional

Maximum number of subdivisions. Defaults to 3.

merge_pointsbool, optional

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

progress_barbool, optional

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
>>> 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 = pyvista.UnstructuredGrid(cells, cell_types, points)
>>> mesh.plot(show_edges=True, line_width=5)
../../../_images/pyvista-PointSet-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-PointSet-tessellate-1_01_00.png