pyvista.Texture.repeat

Contents

pyvista.Texture.repeat#

property Texture.repeat: bool[source]#

Repeat the texture.

This is provided for convenience and backwards compatibility.

For new code, use Texture.wrap().

Examples

Load the masonry texture and create a simple pyvista.PolyData with texture coordinates using pyvista.Plane(). By default the texture coordinates are between 0 and 1. Let’s raise these values over 1 by multiplying them in place. This will allow us to wrap the texture.

>>> import pyvista as pv
>>> from pyvista import examples
>>> texture = examples.download_masonry_texture()
>>> plane = pv.Plane()
>>> plane.active_texture_coordinates *= 2

This is the texture plotted with repeat set to False.

>>> texture.repeat = False
>>> pl = pv.Plotter()
>>> actor = pl.add_mesh(plane, texture=texture)
>>> pl.camera.zoom('tight')
>>> pl.show()
../../../_images/pyvista-Texture-repeat-1_00_00.png

This is the texture plotted with repeat set to True.

>>> texture.repeat = True
>>> pl = pv.Plotter()
>>> actor = pl.add_mesh(plane, texture=texture)
>>> pl.camera.zoom('tight')
>>> pl.show()
../../../_images/pyvista-Texture-repeat-1_01_00.png