pyvista_wasm.Texture#
- class pyvista_wasm.Texture(url: str)#
Bases:
objectSurface texture wrapping an image URL.
Mirrors the PyVista
pyvista.TextureAPI for browser-based rendering via VTK.wasm. A texture is applied to a mesh by passing it toadd_mesh()as thetextureargument.- 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.