pyvista.PolyDataFilters.triangulate#
- PolyDataFilters.triangulate(
- *,
- pass_verts: bool = False,
- pass_lines: bool = False,
- inplace: bool = False,
- progress_bar: bool = False,
Return an all triangle mesh.
More complex polygons will be broken down into triangles.
- Parameters:
- pass_vertsbool, default:
False
Whether vertices cells are passed to the output PolyData.
Added in version 0.45.0.
- pass_linesbool, default:
False
Whether lines cells are passed to the output PolyData.
Added in version 0.45.0.
- inplacebool, default:
False
Whether to update the mesh in-place.
- progress_barbool, default:
False
Display a progress bar to indicate progress.
- pass_vertsbool, default:
- Returns:
pyvista.PolyData
Mesh containing only triangles.
Examples
Generate a mesh with quadrilateral faces.
>>> import pyvista as pv >>> plane = pv.Plane() >>> plane.point_data.clear() >>> plane.plot(show_edges=True, line_width=5)
Convert it to an all triangle mesh.
>>> mesh = plane.triangulate() >>> mesh.plot(show_edges=True, line_width=5)