From: Jonathan B. <jbr...@ea...> - 2005-12-06 05:37:35
|
On Mon, 2005-12-05 at 20:49 -0600, John Brawley wrote: > "Traceback (most recent call last): > File "C:\Python24\Lib\site-packages\Tverse\TVVgapViewer2.py", line 114, in > ? > cyl=gap(xyzs,xyzs2,gapLen) > File "C:\Python24\Lib\site-packages\Tverse\TVVgapViewer2.py", line 24, in > gap > return > cylinder(pos=x1s,axis=x2s-x1s,color=gapCol,length=gapLen,radius=pRad/20.0) > File "C:\PYTHON24\lib\site-packages\visual\primitives.py", line 131, in > __init__ > process_init_args_from_keyword_dictionary(self, keywords) > File "C:\PYTHON24\lib\site-packages\visual\primitives.py", line 49, in > process_init_args_from_keyword_dictionary > displayobject.color = keywords['color'] > ArgumentError: Python argument types in > None.None(cylinder, NoneType) > did not match C++ signature: > None(visual::Primitive {lvalue}, visual::rgb)" > > My guess: due to my strange (but fast and cute) means of getting a color, > occasionally my program spits a number at VPython's OpenGL system that is > out of range (or, it is zero), which causes the OpenGL system to spit crap > at the video card, which then shows me this horrible screen trash. It does > not, however, crash the program; this oddness will continue indefinitely. > It _seems_ to me from the traceback, that my rgb value was divided by a > cylinder length of zero (or less), which produced a color number that, > essentially, didn't exist. I think that it means that you were somehow creating an visual object with an explicit color value set to "None" rather than a 3-tuple. You can add an extra couple of lines of code to process_init_args_from_keyword_dictionary (in primitives.py) that tests keywords for the 'color' key and prints out the value if it exists. eg, if 'color' in keywords: print type(keywords['color']), keywords['color'] > I would like to know if you (anyone?) concur, or, if you know what all that > traceback stuff actually means (especially the last couple of lines of it, > which I don't understand), could you tell me _exactly_ what it is that > happened? Try to reduce the program to the minimum that reproduces the problem. If that process doesn't help you find it, post the minimal example here. Otherwise, it will be nearly impossible to see what is wrong. -Jonathan |