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

Volume plot doing something weird #5298

Open
SterlingButters opened this issue Dec 6, 2023 · 4 comments
Open

Volume plot doing something weird #5298

SterlingButters opened this issue Dec 6, 2023 · 4 comments
Labels
bug Uh-oh! Something isn't working as expected.

Comments

@SterlingButters
Copy link

Describe the bug, what's wrong, and what you expected.

I was attempting the example posted here:
https://docs.pyvista.org/version/stable/api/plotting/_autosummary/pyvista.Plotter.add_volume.html
and got something that looked like the figure the first time. Now I get something that looks like:
https://pasteboard.co/XENz46LHrFa1.png

What is happening?

Steps to reproduce the bug.

import pyvista as pv
grid = pv.ImageData(dimensions=(9, 9, 9))
grid['scalars'] = -grid.x
pl = pv.Plotter()
_ = pl.add_volume(grid, opacity='linear')
pl.show()

System Information

--------------------------------------------------------------------------------
  Date: Wed Dec 06 12:34:36 2023 Mountain Standard Time

                  OS : Windows
              CPU(s) : 12
             Machine : AMD64
        Architecture : 64bit
                 RAM : 31.7 GiB
         Environment : IPython
          GPU Vendor : NVIDIA Corporation
        GPU Renderer : Quadro T2000/PCIe/SSE2
         GPU Version : 4.5.0 NVIDIA 471.11
    MathText Support : False

  Python 3.9.13 (main, Aug 25 2022, 23:51:50) [MSC v.1916 64 bit (AMD64)]

             pyvista : 0.42.3
                 vtk : 9.2.6
               numpy : 1.24.4
          matplotlib : 3.5.2
              scooby : 0.9.2
               pooch : 1.8.0
              pillow : 9.2.0
             imageio : 2.19.3
               PyQt5 : 5.9.2
             IPython : 7.31.1
            colorcet : 3.0.0
          ipywidgets : 7.6.5
               scipy : 1.9.1
                tqdm : 4.64.1
          jupyterlab : 3.4.4
               trame : 3.3.0
        trame_client : 2.13.0
        trame_server : 2.12.1
           trame_vtk : 2.6.2
       trame_vuetify : 2.3.1
jupyter_server_proxy : 4.1.0
        nest_asyncio : 1.5.5

  Intel(R) oneAPI Math Kernel Library Version 2021.4-Product Build 20210904
  for Intel(R) 64 architecture applications
--------------------------------------------------------------------------------

Screenshots

No response

@SterlingButters SterlingButters added the bug Uh-oh! Something isn't working as expected. label Dec 6, 2023
@SterlingButters
Copy link
Author

SterlingButters commented Dec 6, 2023

Of note, there are no issues when I export the plot to html and render in the browser. Appears to be an issue specifically with the plotter.show() method

@banesullivan
Copy link
Member

Typically I'd say the artifacts you are seeing are a result of hardware (GPU) but I think a Quadro T2000/PCIe/SSE2 should be plenty good, otherwise a Windows driver issue.

For me, this plot looks like:
screenshot

@SterlingButters
Copy link
Author

Any debugging ideas or driver replacements I can make?

@banesullivan
Copy link
Member

Sorry, I should have given some direction in my above comment. This can be really tough to debug on Windows.

One thing you could try is to save that mesh out to a file and try to render it in ParaView:

import pyvista as pv
grid = pv.ImageData(dimensions=(9, 9, 9))
grid['scalars'] = -grid.x
grid.save('myvolume.vtk')

Then load that file into ParaView. Once in paraview, see if you have the same issues (as ParaView and PyVista are both using VTK under the hood). Then in paraview, you can experiment with different volume mappers to see what looks best.
Screenshot 2023-12-09 at 9 32 58 AM

If you can find a mapper or other rendering parameters in ParaView that look good, then we can mimic this in PyVista. If it continues to look bad in ParaView, then we can perhaps seek help from https://discourse.vtk.org/ on how to get this to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Uh-oh! Something isn't working as expected.
Projects
None yet
Development

No branches or pull requests

2 participants