zerolugithub / pythonxy

Automatically exported from code.google.com/p/pythonxy
0 stars 0 forks source link

Python(x,y) 2.6.7 Mayavi "Light" Error #722

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Python(x,y) 2.6.7 with Mayavi version 4.3.1 at windows 8.1(x64 platform)

and no additional plugins have been installed, Python(x,y) installed with 
Default settings, Default path and Full components, installed for "all 
users",logged in python (x,y) as a regular user.

with this version python(x,y) and Mayavi, the 3D render may have some problem 
with the "light", by changing the #232 line in light_manager.py  
from 
self.sourcs.color = val

which light_manager.py is located at:
..\Python27\Lib\site-packages\mayavi-4.3.1-py2.7-win32.egg\tvtk\pyface 

Original issue reported on code.google.com by scott910...@gmail.com on 7 Mar 2014 at 1:42

GoogleCodeExporter commented 9 years ago
with this version python(x,y) and Mayavi, the 3D render may have some problem 
with the "light", by changing the #232 line in light_manager.py  
from 
self.sourcs.color = val
to 
self.color = val

may solve this problem.

Original comment by scott910...@gmail.com on 7 Mar 2014 at 1:55

GoogleCodeExporter commented 9 years ago
sample code to reproduce the issue will be very helpfull

Original comment by grizzly.nyo on 9 Mar 2014 at 6:00

GoogleCodeExporter commented 9 years ago
after switching the qt api to api #2, and enter the python code below may 
reproduce the "Light" error,

#--------------------------------------------------------code starts here.
# -*- coding: utf-8 -*-
from numpy import *
from enthought.mayavi import mlab

# Create the data.
dphi, dtheta = pi/20.0, pi/20.0
[phi,theta] = mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta]
m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4;
r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + sin(m4*theta)**m5 + cos(m6*theta)**m7
x = r*sin(phi)*cos(theta)
y = r*cos(phi)
z = r*sin(phi)*sin(theta)

# View it.
s = mlab.mesh(x, y, z, representation="wireframe", line_width=1.0 )

mlab.show()
#--------------------------------------------------------code Ends here.

thank you.

Original comment by scott910...@gmail.com on 10 Mar 2014 at 7:35