Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract rgb value for each vertex with a given mesh and its texture image #444

Open
hbgtjxzbbx opened this issue Jun 16, 2021 · 0 comments

Comments

@hbgtjxzbbx
Copy link

Hello
Thanks for this nice package!
I am new to pyvista. I have a naive question. I already have a mesh and its texture image. Is there any way to get the texture value for each vertex?

I can plot the mesh with a predefined texture via pyvista plotter.
Lets say the mesh has N vertices, how can I get a Nx3 (rbg) value for each vertex?

Thanks!

obj_path = 'path_to_obj'
data = pv.read(obj_path)
texture_path = 'path_to_texture_jpg'
tex = pv.read_texture(texture_path)
p = pv.Plotter(window_size=[1920, 1280])
p.add_mesh(data,texture=tex)
p.show()
@hbgtjxzbbx hbgtjxzbbx changed the title Extract texture value for each vertex with a given mesh and its texture Extract rgb value for each vertex with a given mesh and its texture image Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant