pyvista.DataSetMapper.resolve

pyvista.DataSetMapper.resolve#

property DataSetMapper.resolve: str[source]#

Set or return the global flag to avoid z-buffer resolution.

A global flag that controls whether the coincident topology (e.g., a line on top of a polygon) is shifted to avoid z-buffer resolution (and hence rendering problems).

If not off, there are two methods to choose from. polygon_offset uses graphics systems calls to shift polygons, lines, and points from each other. shift_zbuffer is a legacy method that is used to remap the z-buffer to distinguish vertices, lines, and polygons, but does not always produce acceptable results. You should only use the polygon_offset method (or none) at this point.

Returns:
str

Global flag to avoid z-buffer resolution. Must be either off, polygon_offset or shift_zbuffer.

Examples

>>> import pyvista as pv
>>> from pyvista import examples
>>> mesh = examples.download_tri_quadratic_hexahedron()
>>> surface_sep = mesh.separate_cells().extract_surface(
...     nonlinear_subdivision=4
... )
>>> edges = surface_sep.extract_feature_edges()
>>> surface = mesh.extract_surface(nonlinear_subdivision=4)
>>> plotter = pv.Plotter()
>>> _ = plotter.add_mesh(surface, smooth_shading=True, split_sharp_edges=True)
>>> actor = plotter.add_mesh(edges, color='k', line_width=3)
>>> actor.mapper.resolve = 'polygon_offset'
>>> plotter.show()
../../../_images/pyvista-DataSetMapper-resolve-1_00_00.png