|
Hi,
I read your Mayavi question from about a year ago, because I have exactly the same problem. I believe it has to do with windows, because I have seen it work under Linux. Did anyone reply to your query and if so, do you know why the screen goes red?
I attached your email so that you know what I am talking about.
Thanks
Alexej
Hello NG, I'm trying to follow the mayavi documentation in order to runmayavi from python. In "Chapter 4. Using MayaVi from Python", there isa simple example like this: # generate the data.from Numeric import *import scipyx = (arange(50.0)-25)/2.0y = (arange(50.0)-25)/2.0r = sqrt(x[:,NewAxis]**2+y**2)z = 5.0*scipy.special.j0(r) # Bessel function of order 0# now dump the data to a VTK file.import pyvtk# Flatten the 2D array data as per VTK's requirements.z1 = reshape(transpose(z), (-1,))point_data = pyvtk.PointData(pyvtk.Scalars(z1))grid = pyvtk.StructuredPoints((50,50, 1), (-12.5, -12.5, 0), (0.5,0.5, 1))data = "" point_data)data.tofile('test.vtk') import mayaviv = mayavi.mayavi() # create a MayaVi window.d = v.open_vtk('test.vtk', config=0) # open the data file.# The config option turns on/off showing a GUI control for thedata/filter/module.# load the filters.f = v.load_filter('WarpScalar', config=0) n = v.load_filter('PolyDataNormals', 0)n.fil.SetFeatureAngle (45) # configure the normals.# Load the necessary modules.m = v.load_module('SurfaceMap', 0)a = v.load_module('Axes', 0)a.axes.SetCornerOffset(0.0) # configure the axes module.o = v.load_module('Outline', 0)v.Render() # Re-render the scene. Everything goes fine, but at the end I obtain the mayavi windowcompletely red (without the expected surface/image), and when I clickon this window I get different errors depending on which Python editorI run: 1) Pythonwin: Error: Microsoft Visual C++ Runtime Error. EverythingCrashes. After this, I get a vtkwindow coming up and showing me the"always-present" error message from mayavi: "Generic Warning: In /debian/stage/vtk-4.2.4/Rendering/vtkTkRenderWidget.cxx, line 638A TkRenderWidget is being destroyed before it associatedvtkRenderWindowis destroyed. This is very bad and usually due to the order in which objects are being destroyed. Always destroy the vtkRenderWindow beforedestroying the user interface components" I don't know why, but with mayavi this warning is EXTREMELY common... 2) IDLE for Python: All is frozen, nothing happen, I have to killPython;3) Python Command Line: No windows appears, nothing happen. Moreover, I would like to be able to compile my Python application toa standalone EXE file by using py2exe, but py2exe complains about somemissing modules (either from mayavi and for scipy), and the createdEXE does not start.I have installed Python using the Enthought Installer for Python (withlots of site-packages inside), located at: http://www.enthought.com/python/ I'm running Win2000, without administrator privileges (if this canmake differences). Does anyone have an idea? Thanks for every suggestion. Andrea. |
-- http://mail.python.org/mailman/listinfo/python-list
