pyvista_wasm.Texture

pyvista_wasm.Texture#

class pyvista_wasm.Texture(url: str)#

Bases: object

Surface texture wrapping an image URL.

Mirrors the PyVista pyvista.Texture API for browser-based rendering via VTK.wasm. A texture is applied to a mesh by passing it to add_mesh() as the texture argument.

Parameters:

url (str) – URL of the image to use as a texture (PNG, JPEG, etc.).

Examples

>>> import pyvista_wasm as pv
>>> from pyvista_wasm import examples
>>> texture = examples.download_masonry_texture()
>>> plotter = pv.Plotter()
>>> sphere = pv.Sphere()
>>> _ = plotter.add_mesh(sphere, texture=texture)
>>> plotter.show()
__init__(url: str) None#

Initialize a Texture from an image URL.

Methods

__init__(url)

Initialize a Texture from an image URL.