Closed gdmcbain closed 3 years ago
License seems to be MIT. I don't oppose this, the plots look great. I'll try to get it working on my Python setup and try it out.
A quick experiment went well.
On a laptop running Microsoft Windows 10
pip install vtkplotter
Then after having run ex32.py
from #342, run
from vtkplotter import Plotter
vp = Plotter()
vp.load('ex32.vtk')
vp.show()
This pops up a 'Visualization Toolkit Win32OpenGL' showing a green triangulated ellipsoid which can be rotated, translated, and zoomed with the mouse.
This does nicely show the p ~xy pattern expected from creeping convection in a horizontally heated ellipsoid.
I assume this could be scripted, once I read the docs.
To generate a PNG rather than a window,
from vtkplotter import Plotter, screenshot
vp = Plotter(offscreen=True)
...
screenshot('ex32.png')
See marcomusy/vtkplotter#55.
That saves the PNG without throwing up a window; however, it doesn't colour by pressure. The answer to that might be in marcomusy/vtkplotter#131.
Here we go:
from vtkplotter import Plotter, screenshot
Plotter(offscreen=True).load("ex32.vtk").pointColors("pressure").show()
screenshot("ex32.png")
I'd deferred this as it wasn't working on my Ubuntu 19.10 desktop (something about nvidia nouveau); as mentioned the previous work had been done under Microsoft Windows 10.
Yesterday I updated the desktop to Ubuntu 20.04 LTS and it's working fine. Here's a recipe.
python=3.7
in a conda create
# gives Python 3.7.7conda install vtk
pip install vtkplotter
I've been encountering issues trying to run this in a docker container, I'm only developing inside containers nowadays.
I think I have to next try it out in a Ubuntu 20.04 virtual machine.
As noted in #44, matplotlib distorts three-dimensional views uncontrollably. Some very nice plots were added to #357 using vtkplotter. It might be a worthwhile addition to
skfem.visuals
#286. (I haven't looked at the licence or portability.)