New vtkplotter module for visualization

I wrote a function that emulates the plot() behaviour which works with the vtkplotter module.
It comes with a bunch of examples here, and preliminary documentation.

To install it:
pip install vtkplotter

Example usage:

import dolfin
from vtkplotter.dolfin import datadir, plot
mesh = dolfin.Mesh(datadir+"dolfin_fine.xml")
plot(mesh)

Other examples:

ex06_elasticity1.py

elastodynamics.py

At the moment I only tested it with python3 and dolfin 2019.1.0, if you find bugs please report them. all feedback is very welcome!

5 Likes

Honestly, that looks great! Are there any plans for supporting level sets?

1 Like

Thanks!
by level sets you mean isosurfaces? that would not be difficult to include…

I do a lot of axi-symmetric modelling where I have a 2d mesh but 3d velocity fields. Is there an easy way of plotting 3d vectors on a 2d mesh? (My first naive try threw an error).

Have you tried this ?
Change mode="lines" to mode="arrows", these are anyway in 3d.
(n.b.: this specific script needs python3)

Thanks! That works better :slight_smile:

1 Like

vtkplotter is now available on Debian and Ubuntu.