Mayavi无法正确渲染实体表面

4
我刚刚在计算机上重新安装了Fedora 28,并决定尝试在Python 3中使用Mayavi,之前它只能在Python 2中运行。我使用pip3 install mayavi --userpip安装Mayavi时没有遇到任何问题。然而,当我运行this script来绘制球面调和函数时,我得到的表面看起来有缺口,而我以前(使用Python 2)得到的是一个实心表面。我不再有那样的系统设置了,但如果不清楚我的意思,我可以尝试重现旧的图形。

有什么办法让这个表面再次变得实心吗?

Current Mayavi window with partially transparent (or gaps in?) surface

如果相关的话,这里有一些小包信息:
$ pip3 show vtk mayavi
Name: vtk
Version: 8.1.1
Summary: VTK is an open-source toolkit for 3D computer graphics, image processing, and visualization
Home-page: https://vtk.org/
Author: VTK Community
Author-email: vtk-developers@vtk.org
License: BSD
Location: ~/.local/lib/python3.6/site-packages
Requires: 
---
Name: mayavi
Version: 4.6.2
Summary: 3D scientific data visualization library and application
Home-page: http://docs.enthought.com/mayavi/mayavi/
Author: Prabhu Ramachandran, et. al.
Author-email: prabhu@aero.iitb.ac.in
License: BSD
Location: ~/.local/lib/python3.6/site-packages
Requires: apptools, envisage, numpy, pyface, pygments, traits, traitsui, vtk

表面看起来很平滑。Win10 64位,vtk 7.0.0,mayavi 4.5.0。 - Felipe Lema
这可能是硬件问题吗? (请参见 https://docs.enthought.com/mayavi/mayavi/bugs.html)我使用英特尔图形卡(Intel Corporation Device 591b)时遇到了同样的问题。 - Johann Bzh
1个回答

3
可能是硬件问题。 在我的笔记本电脑(Debian GNU/Linux下)上,我有两个显卡:
  • 一个英特尔显卡
  • 一个带有Optimus技术的Nvidia显卡
为了利用Nvidia的功能,并且由于Optimus技术的限制,我必须安装bumblebee(https://bumblebee-project.org/)并使用optirun命令启动我的3D软件。
optirun python3 my_mayavi_script.py

代替:
python3 my_mayavi_script.py

如果我尝试按照这里的mayavi教程http://docs.enthought.com/mayavi/mayavi/mlab.html#simple-scripting-with-mlab而不使用optirun,我会得到以下结果:

enter image description here

如果我使用optirun,我会得到

enter image description here


你使用专有的Nvidia驱动程序还是nouveau?对我来说,使用Geforce GTX 660M的nouveau会产生与英特尔图形驱动程序相同的丑陋结果。 - laolux

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接