Vedo: vtu files, multiple fields

Created on 10 Jul 2019  路  2Comments  路  Source: marcomusy/vedo

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 ?

help wanted

All 2 comments

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)

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hmralavi picture hmralavi  路  7Comments

FedeClaudi picture FedeClaudi  路  7Comments

RubendeBruin picture RubendeBruin  路  3Comments

Yoorthiziri picture Yoorthiziri  路  5Comments

MarkusRosen picture MarkusRosen  路  3Comments