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#
Download Python source code | Download Jupyter notebook
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()
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()