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

vtu files, multiple fields #41

Closed
fdeheeger opened this issue Jul 10, 2019 · 2 comments
Closed

vtu files, multiple fields #41

fdeheeger opened this issue Jul 10, 2019 · 2 comments

Comments

@fdeheeger
Copy link

fdeheeger commented Jul 10, 2019

very convenient to explore VTK files inside jupyter.

The example gallery is great but I cannot find a simple example of a direct show of a vtu file while picking the right scalar field to be presented on the mesh.
Any hints ?

@marcomusy
Copy link
Owner

Hi try for ex:

from vtkplotter import *

mesh = load(datadir+'pulley.vtu')

mesh.addPointScalars(mesh.coordinates()[:,0], 'my_x')
mesh.addPointScalars(mesh.coordinates()[:,1], 'my_y')
mesh.addPointScalars(mesh.coordinates()[:,2], 'my_z')

mesh.scalars('my_y') # or mesh.scalars(2)
printInfo(mesh)

show(mesh)

Inside jupyter:

image

(the actual printout format will be a bit different)

@fdeheeger
Copy link
Author

Thanks a lot for your help. printInfo does help a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants