enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.28k stars 282 forks source link

Incomplete rendering of triangles using test_mesh_sphere() #907

Open kerkelae opened 4 years ago

kerkelae commented 4 years ago

I wanted to use Mayavi for doing some simple visualizations of ellipsoids with various shapes and orientations, but the resulting surfaces have triangular holes in them. I then ran the test mesh sphere method and experienced the same problem.

I used virtualenv to create a virtual environment.

virtualenv tensorviz -p python3.7
pip install mayavi vtk pyqt5
source tensorviz/bin/activate

Then I executed the following in the Python console.

from mayavi import mlab
mlab.test_mesh_sphere()
mlab.show()

The results are shown below. It seems like every other triangle is not rendered.

sphere

I have Ubuntu 16.04 and the following packages in my virtual environment.

apptools==4.5.0
configobj==5.0.6
envisage==4.9.2
mayavi==4.7.1
numpy==1.18.2
pyface==6.1.2
Pygments==2.6.1
PyQt5==5.14.2
PyQt5-sip==12.7.2
six==1.14.0
traits==6.0.0
traitsui==6.1.3
vtk==8.1.2

Does someone know how to fix this issue?

kerkelae commented 4 years ago

When I zoom in far enough, the triangles are rendered properly.

zoomed_in

ricma commented 4 years ago

Hi there,

I had the same issue. Note that in your second figure the rendering is not "right" -- you just zoomed in so far that you are now inside the sphere. The first image has a rendering problem with the z-order and does not display the front part of the sphere correctly.

FWIW, I realized that this seems to be a Qt problem and switched to wx as a toolkit which solved my problem.

Note: I had to install wx for that (e.g. via aptitude install python3-wxgtk4.0) and then set export ETS_TOOLKIT=wx. Then your example from above was displayed fine.

HTH, M.