Pyvista mesh plot not working with fenicsx

I’m trying to learn the PyVista tutorial for an application in FeniCSx.
So, I’m trying to run the following code given here:

import pyvista as pyvista
pyvista.set_jupyter_backend("pythreejs")

points = [[0, 0, 0],
          [1, 0, 0],
          [0.5, 0.667, 0]]
mesh = pyvista.PolyData(points)
mesh.plot(show_bounds=True, cpos='xy',color='red', point_size=20)


But it only outputs a blank coordinate plane:
image

Can I please know whether I’m doing anything wrong?

I would suggest posting this as an issue at the Pyvista Github as this seems to be unrelated to any DOLFINx functionality.

Running your code snippet, I get:

/usr/local/lib/python3.10/dist-packages/pyvista/jupyter/pv_pythreejs.py:436: UserWarning: Empty or unsupported dataset attached to actor
  warnings.warn('Empty or unsupported dataset attached to actor')

Thank you for the suggestion. I asked from them and seems like the pythreejs back end is causing the problem.
Changing it to ipyvtklink worked for me.

And seems like they are planning to develop a better backend for Pyvista. So, we might be able to use it too in the future!

Discussion link Here

1 Like