add texture to cylinder
xfang1363 opened this issue · comments
xfang1363 commented
import pyvista as pv
cylinder = pv.Cylinder(radius=5, height=20, capping=False)
plotter = pv.Plotter()
image_path = "Data/puppy.jpg"
texture = pv.read_texture(image_path)
cylinder.texture_map_to_plane()
cylinder.plot(texture=texture)
plotter.add_mesh(cylinder, texture=texture)
plotter.show()
The texture is added symmetrically, how can I fit the image exactly to the side of the cylinder?