You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(4) |
Jul
(1) |
Aug
|
Sep
(15) |
Oct
(32) |
Nov
(35) |
Dec
(48) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(46) |
Feb
(22) |
Mar
(65) |
Apr
(49) |
May
(22) |
Jun
(29) |
Jul
(51) |
Aug
(34) |
Sep
(32) |
Oct
(46) |
Nov
(30) |
Dec
(32) |
2002 |
Jan
(48) |
Feb
(4) |
Mar
(20) |
Apr
(28) |
May
(13) |
Jun
(34) |
Jul
(51) |
Aug
(15) |
Sep
(15) |
Oct
(35) |
Nov
(15) |
Dec
(20) |
2003 |
Jan
(31) |
Feb
(111) |
Mar
(41) |
Apr
(28) |
May
(36) |
Jun
(29) |
Jul
(27) |
Aug
(29) |
Sep
(47) |
Oct
(28) |
Nov
(7) |
Dec
(26) |
2004 |
Jan
(44) |
Feb
(9) |
Mar
(17) |
Apr
(26) |
May
(58) |
Jun
(13) |
Jul
(44) |
Aug
(64) |
Sep
(30) |
Oct
(11) |
Nov
(21) |
Dec
(28) |
2005 |
Jan
(29) |
Feb
(11) |
Mar
(11) |
Apr
(22) |
May
(85) |
Jun
(46) |
Jul
(17) |
Aug
(18) |
Sep
(14) |
Oct
(22) |
Nov
(1) |
Dec
(45) |
2006 |
Jan
(20) |
Feb
(36) |
Mar
(18) |
Apr
(24) |
May
(21) |
Jun
(48) |
Jul
(23) |
Aug
(20) |
Sep
(10) |
Oct
(41) |
Nov
(46) |
Dec
(40) |
2007 |
Jan
(40) |
Feb
(20) |
Mar
(13) |
Apr
(6) |
May
(24) |
Jun
(31) |
Jul
(30) |
Aug
(11) |
Sep
(11) |
Oct
(10) |
Nov
(56) |
Dec
(64) |
2008 |
Jan
(64) |
Feb
(22) |
Mar
(63) |
Apr
(28) |
May
(25) |
Jun
(36) |
Jul
(11) |
Aug
(9) |
Sep
(14) |
Oct
(41) |
Nov
(46) |
Dec
(130) |
2009 |
Jan
(95) |
Feb
(41) |
Mar
(24) |
Apr
(35) |
May
(53) |
Jun
(67) |
Jul
(48) |
Aug
(48) |
Sep
(86) |
Oct
(75) |
Nov
(64) |
Dec
(52) |
2010 |
Jan
(57) |
Feb
(31) |
Mar
(28) |
Apr
(40) |
May
(25) |
Jun
(42) |
Jul
(79) |
Aug
(31) |
Sep
(49) |
Oct
(66) |
Nov
(38) |
Dec
(25) |
2011 |
Jan
(29) |
Feb
(18) |
Mar
(44) |
Apr
(6) |
May
(28) |
Jun
(31) |
Jul
(36) |
Aug
(24) |
Sep
(30) |
Oct
(23) |
Nov
(21) |
Dec
(27) |
2012 |
Jan
(14) |
Feb
(11) |
Mar
(2) |
Apr
(48) |
May
(7) |
Jun
(32) |
Jul
(22) |
Aug
(25) |
Sep
(31) |
Oct
(32) |
Nov
(21) |
Dec
(17) |
2013 |
Jan
(44) |
Feb
(27) |
Mar
(3) |
Apr
(1) |
May
|
Jun
|
Jul
(3) |
Aug
(4) |
Sep
(1) |
Oct
(7) |
Nov
(5) |
Dec
(5) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
(2) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
(7) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Bruce S. <Bru...@nc...> - 2011-06-16 17:32:51
|
I personally have no idea. Are there readers of this list that are familiar with the Enthought distribution? Bruce Sherwood On Thu, Jun 16, 2011 at 8:37 AM, Adam O Hausknecht <aha...@um...> wrote: > Hi, > Is there a Visual Python installer for ENTHOUGHT's 32-bit Python > distribution for Mac 10.6.x? > Thanks and regards, > Adam Hausknecht > Professor Adam O. Hausknecht > Department of Mathematics > UMass Dartmouth > 285 Old Westport Road > North Dartmouth, MA 02747 > Office: > Arts and Sciences 394B 508-999-8322 > aha...@um... > > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |
From: Adam O H. <aha...@um...> - 2011-06-16 15:02:25
|
Hi, Is there a Visual Python installer for ENTHOUGHT's 32-bit Python distribution for Mac 10.6.x? Thanks and regards, Adam Hausknecht Professor Adam O. Hausknecht Department of Mathematics UMass Dartmouth 285 Old Westport Road North Dartmouth, MA 02747 Office: Arts and Sciences 394B 508-999-8322 aha...@um... |
From: Bruce S. <Bru...@nc...> - 2011-06-14 21:08:34
|
The current version (5.71) of VPython lets you do exactly what you are requesting. Here's the new paragraph from the documentation: Offsets: If you specify xmin or ymin to be greater than zero, or xmax or ymax to be less than zero, the crossing point (origin) of the x and y axes will no longer be at (0,0), and the graphing will be offset. If you offset the origin of the graph, you must specify xmax to be greater than xmin, and/or ymax to be greater than ymin. Bruce Sherwood On Tue, Jun 14, 2011 at 2:29 PM, Seth Morton <sm...@ps...> wrote: > Hello, > > I am trying to plot the visual portion of the electromagnetic spectrum > (350-750 nm) and nothing else, so I don't have any data points below > 350. I would like to set the lower limit of the x-axis to 350, but it > seems that the xmin attribute of the gcurve object is hard-coded to only > accept negative values. Is there a reason for this? More importantly, > does anybody know of a hack to get around this limitation? Right now I > have a plot where half of it is dead-space. > > Seth Morton > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
From: Seth M. <sm...@ps...> - 2011-06-14 20:29:30
|
Hello, I am trying to plot the visual portion of the electromagnetic spectrum (350-750 nm) and nothing else, so I don't have any data points below 350. I would like to set the lower limit of the x-axis to 350, but it seems that the xmin attribute of the gcurve object is hard-coded to only accept negative values. Is there a reason for this? More importantly, does anybody know of a hack to get around this limitation? Right now I have a plot where half of it is dead-space. Seth Morton |
From: Bruce S. <Bru...@nc...> - 2011-06-11 21:01:30
|
If you examine site-packages/vis/graph.py you'll see that gdots is implemented a self.dots = points(), gvbars is implemented as self.vbars = faces(), and ghbars is implemented as self.hbars = faces(). Clearly, what should be done is implement graphobject.clear(). I'll put it on a list. Bruce Sherwood On Sat, Jun 11, 2011 at 12:32 PM, Poul Riis <Pou...@sk...> wrote: > > > Bru...@nc... writes: > There's something missing in the documentation. The following sequence > will erase the gcurve. When you create a gcurve object, one of its > pieces is a curve object, and you can get at that curve object as > shown here. > f = gcurve(.....) > ..... > f.gcurve.pos = [] > I woud guess that there are similar commands for gvbars and gdots. However, > this seems not to be the case. The (dummy) example below can only delete the > gcurve and ends with an error message. > Poul Riis > > > from visual.graph import * > from time import * > oscillation = gdisplay(xtitle='Time', ytitle='Response') > funct1 = gcurve(color=color.cyan) > funct2 = gvbars(delta=0.5, color=color.red) > funct3 = gdots(color=color.yellow) > for t in arange(-30, 74, 1): > funct1.plot( pos=(t, 5.0+5.0*cos(-0.2*t)*exp(0.015*t)) ) > funct2.plot( pos=(t, 2.0+5.0*cos(-0.1*t)*exp(0.015*t)) ) > funct3.plot( pos=(t, 5.0*cos(-0.03*t)*exp(0.015*t)) ) > histo = gdisplay(title='Histogram', x=0, y=400, width=800,height=400) > datalist1 = [5, 37, 12, 21, 25, 28, 8, 63, 52, 75, 7] > data = ghistogram(bins=arange(-20, 80, 10), color=color.red) > data.plot(data=datalist1) > datalist2 = [7, 23, 25, 72, -15] > data.plot(data=datalist2, accumulate=1) > print 'Wait 2 seconds...' > sleep(2) > print 'Deleting a gcurve...' > funct1.gcurve.pos = [] > print 'Wait 2 seconds...' > sleep(2) > print 'Deleting vbars...' > funct2.gvbars.pos = [] > print 'Wait 2 seconds...' > sleep(2) > print 'Deleting gdots...' > funct3.gdots.pos = [] > > > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |
From: Poul R. <Pou...@sk...> - 2011-06-11 18:50:54
|
Bru...@nc... writes: >There's something missing in the documentation. The following sequence >will erase the gcurve. When you create a gcurve object, one of its >pieces is a curve object, and you can get at that curve object as >shown here. > >f = gcurve(.....) >..... >f.gcurve.pos = [] I woud guess that there are similar commands for gvbars and gdots. However, this seems not to be the case. The (dummy) example below can only delete the gcurve and ends with an error message. Poul Riis from visual.graph import * from time import * oscillation = gdisplay(xtitle='Time', ytitle='Response') funct1 = gcurve(color=color.cyan) funct2 = gvbars(delta=0.5, color=color.red) funct3 = gdots(color=color.yellow) for t in arange(-30, 74, 1): funct1.plot( pos=(t, 5.0+5.0*cos(-0.2*t)*exp(0.015*t)) ) funct2.plot( pos=(t, 2.0+5.0*cos(-0.1*t)*exp(0.015*t)) ) funct3.plot( pos=(t, 5.0*cos(-0.03*t)*exp(0.015*t)) ) histo = gdisplay(title='Histogram', x=0, y=400, width=800,height=400) datalist1 = [5, 37, 12, 21, 25, 28, 8, 63, 52, 75, 7] data = ghistogram(bins=arange(-20, 80, 10), color=color.red) data.plot(data=datalist1) datalist2 = [7, 23, 25, 72, -15] data.plot(data=datalist2, accumulate=1) print 'Wait 2 seconds...' sleep(2) print 'Deleting a gcurve...' funct1.gcurve.pos = [] print 'Wait 2 seconds...' sleep(2) print 'Deleting vbars...' funct2.gvbars.pos = [] print 'Wait 2 seconds...' sleep(2) print 'Deleting gdots...' funct3.gdots.pos = [] |
From: Bruce S. <Bru...@nc...> - 2011-06-11 17:03:18
|
Thanks for the code. I'll definitely try to get this into the next release. Bruce Sherwood On Sat, Jun 11, 2011 at 6:10 AM, Frank W. Samuelson <fr...@me...> wrote: > > I am interested in using vpython to make some simple games. Apparently there > are a few others like me based on some internet posts that I found. To make > games we need to know when keyboard buttons are released as well as pressed. > To facilitate this happening, I made a couple small code changes represented by > the below patch on the visual-5.71 release. You are welcome to incorporate or > ignore them. When keys are released, the generated keyboard events are > proceeded with the string "Released: " in front of them. > > The good: > -The patch is very small > -This hack is backwards compatible for people who use code like > s = scene.kb.getkey() > if s == 'k': ... > -Processing of keyboard events is still easy string comparisons > > The bad: > -The code is currently only for gtk. I don't have "Windows" or Mac computer on > which to test any change that I make. > > Thanks for all your work on vpython. It's great. > > -Frank > > > --- src/gtk2/display.cpp.~1.58.~ 2009-10-11 17:33:43.000000000 -0400 > +++ src/gtk2/display.cpp 2011-06-11 07:24:54.176217104 -0400 > @@ -133,6 +133,8 @@ > area->set_size_request( w, h ); > area->signal_key_press_event().connect( > sigc::mem_fun( *this, &display::on_key_pressed)); > + area->signal_key_release_event().connect( > + sigc::mem_fun( *this, &display::on_key_pressed)); > > // Glade-based UI. > // Turned off toolbar in display initialization for now; not yet available on Windows or Mac > @@ -270,6 +272,11 @@ > // other than a US keyboard. > guint k = key->keyval; > std::string ctrl_str; > + > + // Is this a press or release? > + if (key->type == GDK_KEY_RELEASE) { > + ctrl_str += "Released: "; > + } > // First trap for shift, ctrl, and alt. > if (key->state & GDK_CONTROL_MASK) { > ctrl_str += "ctrl+"; > > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
From: Frank W. S. <fr...@me...> - 2011-06-11 14:00:14
|
I am interested in using vpython to make some simple games. Apparently there are a few others like me based on some internet posts that I found. To make games we need to know when keyboard buttons are released as well as pressed. To facilitate this happening, I made a couple small code changes represented by the below patch on the visual-5.71 release. You are welcome to incorporate or ignore them. When keys are released, the generated keyboard events are proceeded with the string "Released: " in front of them. The good: -The patch is very small -This hack is backwards compatible for people who use code like s = scene.kb.getkey() if s == 'k': ... -Processing of keyboard events is still easy string comparisons The bad: -The code is currently only for gtk. I don't have "Windows" or Mac computer on which to test any change that I make. Thanks for all your work on vpython. It's great. -Frank --- src/gtk2/display.cpp.~1.58.~ 2009-10-11 17:33:43.000000000 -0400 +++ src/gtk2/display.cpp 2011-06-11 07:24:54.176217104 -0400 @@ -133,6 +133,8 @@ area->set_size_request( w, h ); area->signal_key_press_event().connect( sigc::mem_fun( *this, &display::on_key_pressed)); + area->signal_key_release_event().connect( + sigc::mem_fun( *this, &display::on_key_pressed)); // Glade-based UI. // Turned off toolbar in display initialization for now; not yet available on Windows or Mac @@ -270,6 +272,11 @@ // other than a US keyboard. guint k = key->keyval; std::string ctrl_str; + + // Is this a press or release? + if (key->type == GDK_KEY_RELEASE) { + ctrl_str += "Released: "; + } // First trap for shift, ctrl, and alt. if (key->state & GDK_CONTROL_MASK) { ctrl_str += "ctrl+"; |
From: Bruce S. <Bru...@nc...> - 2011-06-09 22:02:01
|
Thanks much for the detailed report. I agree that there should be a label option (and maybe as you say some other options). I can't promise when I might get to this; feel free to give it a try yourself and send it to me. Bruce Sherwood On Thu, Jun 9, 2011 at 3:50 PM, Seth Morton <sm...@ps...> wrote: > Hello all, > > I may have found a bug in the slider object regarding setting self.value > with __init__. When you declare a slider the slider first runs > ctrl.__init__, since it is a subclass of the ctrl object. Inside of > ctrl.__init__, if "value" is one of the arguments, it puts the value of > "value" into self.value, which is defined with the property function of > the slider as the method slider.setvalue. In slider.setvalue, it wants > to access self.axis, but self.axis is not defined until after > ctrl.__init__. This results as an AttributeError. A workaround is to > define value after running __init__ on the slider, but this is a bug > that might want to be looked at. > > As a side note, regarding the slider object, I have a feature request. > It would be nice if there could be a label on the slider like for a > button, so that the current value of the slider is displayed on the > handle. This is the case on the custom sliders in the colorsliders.py > example for vpython. Additionally, I notice that these sliders are made > of a sphere and cylinder, not of boxes. It might be nice for the user > to be able to choose the shape of the slider, either boxes or smooth. > > Seth Morton > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
From: Seth M. <sm...@ps...> - 2011-06-09 21:50:08
|
Hello all, I may have found a bug in the slider object regarding setting self.value with __init__. When you declare a slider the slider first runs ctrl.__init__, since it is a subclass of the ctrl object. Inside of ctrl.__init__, if "value" is one of the arguments, it puts the value of "value" into self.value, which is defined with the property function of the slider as the method slider.setvalue. In slider.setvalue, it wants to access self.axis, but self.axis is not defined until after ctrl.__init__. This results as an AttributeError. A workaround is to define value after running __init__ on the slider, but this is a bug that might want to be looked at. As a side note, regarding the slider object, I have a feature request. It would be nice if there could be a label on the slider like for a button, so that the current value of the slider is displayed on the handle. This is the case on the custom sliders in the colorsliders.py example for vpython. Additionally, I notice that these sliders are made of a sphere and cylinder, not of boxes. It might be nice for the user to be able to choose the shape of the slider, either boxes or smooth. Seth Morton |
From: Kadir H. <kha...@ya...> - 2011-06-09 07:18:50
|
You can use the new EXTRUSION object to start with any arbitrary shaped polygon in 2D. I do not know about the solid angles, but if it is able to reduce the number of "sides" of the polygon down to 4 with some algorithm, then you will end up with a 4-sided polygon, or a square if all with right angles. Kadir ________________________________ From: Joe Heafner <hea...@gm...> To: Visualpython-users <vis...@li...> Sent: Wed, June 8, 2011 11:22:23 PM Subject: [Visualpython-users] Need coding suggestions I want to create some VPython simulations related to Gauss's law, flux, and solid angle. I want to get across the point that any arbitrarily shaped surface can, mathematically, be morphed into a sphere using the concept of solid angle. Is there a way to make an arbitrarily shaped patch of area morph SMOOTHLY into a square in VPython? Below is the code I have so far. It works, but it's not as smooth as I'd like it to be. from visual import * # a field arrow E = vector(1,-0.5,0) Earrow = arrow(pos=vector(0,0,0),axis=E,shaftwidth=0.01,color=color.red) Ehat = norm(E) # a patch of area # include option for circular patches direction = vector(1,1,1) patch = box(pos=(0,0,0),axis=direction,length=0.02,width=0.5,height=0.5) # patch morphing is smoother if height > width # patch's initial area patch.height0 = patch.height patch.area = patch.height*patch.width print ("initial area ", patch.area) # a unit normal to patch nhat = norm(patch.axis) nhatarrow = arrow(pos=Earrow.pos,axis=nhat,shaftwidth=0.01,color=color.green) scene.forward = -nhat # get angle between the two vectors newtheta = acos(dot(Ehat,nhat)) # check for newtheta = 0 # check for newtheta = pi print ("angle ",newtheta*180.0/pi) print ("predicted perp area ", patch.area * cos(newtheta)) # get the new rotation axis newaxis = cross(Ehat,nhat) # rotation animation scene.mouse.getclick() print ("rotating...") dtheta=0.001 theta=0.0 while theta < newtheta: rate(1000) nhatarrow.rotate(angle=-dtheta,axis=newaxis) patch.rotate(angle=-dtheta,axis=newaxis) patch.height = patch.height0*cos(abs(theta)) theta += dtheta patch.area = patch.area * cos(newtheta) patch.width = sqrt(patch.area) patch.height = patch.width print ("actual perp area ", patch.height*patch.width) print ("patch axis ",norm(patch.axis)) print ("field axis ",norm(Earrow.axis)) Joe HeafnerSent from my iPad |
From: Bruce S. <Bru...@nc...> - 2011-06-09 04:03:06
|
Not sure what you're concerned about. It looks smooth to me until the very end, where there is an abrupt change in the shape of the rectangle. Also, something like rate(200) gives a better sense of the morphing than rate(1000), in my opinion. Bruce On Wed, Jun 8, 2011 at 2:22 PM, Joe Heafner <hea...@gm...> wrote: > I want to create some VPython simulations related to Gauss's law, flux, and > solid angle. I want to get across the point that any arbitrarily shaped > surface can, mathematically, be morphed into a sphere using the concept of > solid angle. Is there a way to make an arbitrarily shaped patch of area > morph SMOOTHLY into a square in VPython? Below is the code I have so far. It > works, but it's not as smooth as I'd like it to be. |
From: Bruce S. <Bru...@nc...> - 2011-06-09 03:34:05
|
There's something missing in the documentation. The following sequence will erase the gcurve. When you create a gcurve object, one of its pieces is a curve object, and you can get at that curve object as shown here. f = gcurve(.....) ..... f.gcurve.pos = [] Bruce Sherwood On Wed, Jun 8, 2011 at 8:37 PM, Seth Morton <sm...@ps...> wrote: > Hello all, > > I am trying to develop an application that can display how a function changes as different parameters are altered. For example, let's say that I want to plot y = sin(kx). I have a slider that controls the value of k, and I then replot the function with the new k whenever the slider is moved. By default, it appears that the gcurve object keeps all previously plotted data on the gdisplay. While I can envision situations where this is a benefit (like for binning a histogram), for this application I would like only plot the current value of k and not retain the plot of all previous values. In other words, I would like to reset the gcurve object before replotting with the new k. > > I haven't found an any easy way to reset the gcurve object without deleting the gdisplay object and then opening a new one. Is there an easy way to reset the gcurve object? > > Thanks, > > Seth Morton > > > > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
From: Seth M. <sm...@ps...> - 2011-06-09 02:37:58
|
Hello all, I am trying to develop an application that can display how a function changes as different parameters are altered. For example, let's say that I want to plot y = sin(kx). I have a slider that controls the value of k, and I then replot the function with the new k whenever the slider is moved. By default, it appears that the gcurve object keeps all previously plotted data on the gdisplay. While I can envision situations where this is a benefit (like for binning a histogram), for this application I would like only plot the current value of k and not retain the plot of all previous values. In other words, I would like to reset the gcurve object before replotting with the new k. I haven't found an any easy way to reset the gcurve object without deleting the gdisplay object and then opening a new one. Is there an easy way to reset the gcurve object? Thanks, Seth Morton |
From: Bruce S. <Bru...@nc...> - 2011-06-09 00:03:22
|
Yes, this is a good place to report errors. The only thing I can think of is a need to update the graphics drivers. I'll note that the latest Ubuntu 11.04 has some kind of graphic driver problem, about which there's a lot of talk on the web. Visual stopped working on my Linux machine when I upgraded to 11.04, and I haven't had time to try to sort this out. Bruce Sherwood On Wed, Jun 8, 2011 at 4:56 PM, Martin hansen <ma...@al...> wrote: > Hi > > I am not sure this list is for bugs, but i try anyway, forgive me if am wrong. > > I just installed vpython on debian, and wanted to try it out, made the standard test > program > > from visual import * > sphere() > > It creates the window, but it is just black, and i get this error > > r300 FP: Compiler Error: > Ran out of hardware temporaries > Using a dummy shader instead. > > > I tried to upgrade to newer version (pulled from sid), but same error, I tried to see if > my 3d i working by running another 3d program (lightspeed), no problems. Sp it seams > this is connected to vpython > > Python 2.6 > > print visual.__version__ > 1.5.1 > > ANyone seen this before, I found almost nothing on the net. > > > > -- > ||||| > @(~Ô^Ô~)@ > -------------oOo---U---oOo------------- > | | > | Ing. | > | Martin Hansen | > | | > | "klogest er den som ved, | > | hvad han ikke ved" | > | Ooo | > |_________________ooO____( )________| > ( ) ) / > \ ( (_/ > \_) > > > > ------------------------------------------------------------------------------ > EditLive Enterprise is the world's most technically advanced content > authoring tool. Experience the power of Track Changes, Inline Image > Editing and ensure content is compliant with Accessibility Checking. > http://p.sf.net/sfu/ephox-dev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
From: Martin h. <ma...@al...> - 2011-06-08 23:15:38
|
Hi I am not sure this list is for bugs, but i try anyway, forgive me if am wrong. I just installed vpython on debian, and wanted to try it out, made the standard test program from visual import * sphere() It creates the window, but it is just black, and i get this error r300 FP: Compiler Error: Ran out of hardware temporaries Using a dummy shader instead. I tried to upgrade to newer version (pulled from sid), but same error, I tried to see if my 3d i working by running another 3d program (lightspeed), no problems. Sp it seams this is connected to vpython Python 2.6 print visual.__version__ 1.5.1 ANyone seen this before, I found almost nothing on the net. -- ||||| @(~Ô^Ô~)@ -------------oOo---U---oOo------------- | | | Ing. | | Martin Hansen | | | | "klogest er den som ved, | | hvad han ikke ved" | | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_) |
From: K.-Michael A. <kmi...@gm...> - 2011-06-08 20:51:14
|
Maybe this is a use case for the PyGeo package that uses Vpython, I believe? Michael On 08.06.2011, at 22:23, Joe Heafner <hea...@gm...> wrote: I want to create some VPython simulations related to Gauss's law, flux, and solid angle. I want to get across the point that any arbitrarily shaped surface can, mathematically, be morphed into a sphere using the concept of solid angle. Is there a way to make an arbitrarily shaped patch of area morph SMOOTHLY into a square in VPython? Below is the code I have so far. It works, but it's not as smooth as I'd like it to be. from visual import * # a field arrow E = vector(1,-0.5,0) Earrow = arrow(pos=vector(0,0,0),axis=E,shaftwidth=0.01,color=color.red) Ehat = norm(E) # a patch of area # include option for circular patches direction = vector(1,1,1) patch = box(pos=(0,0,0),axis=direction,length=0.02,width=0.5,height=0.5) # patch morphing is smoother if height > width # patch's initial area patch.height0 = patch.height patch.area = patch.height*patch.width print ("initial area ", patch.area) # a unit normal to patch nhat = norm(patch.axis) nhatarrow = arrow(pos=Earrow.pos,axis=nhat,shaftwidth=0.01,color=color.green) scene.forward = -nhat # get angle between the two vectors newtheta = acos(dot(Ehat,nhat)) # check for newtheta = 0 # check for newtheta = pi print ("angle ",newtheta*180.0/pi) print ("predicted perp area ", patch.area * cos(newtheta)) # get the new rotation axis newaxis = cross(Ehat,nhat) # rotation animation scene.mouse.getclick() print ("rotating...") dtheta=0.001 theta=0.0 while theta < newtheta: rate(1000) nhatarrow.rotate(angle=-dtheta,axis=newaxis) patch.rotate(angle=-dtheta,axis=newaxis) patch.height = patch.height0*cos(abs(theta)) theta += dtheta patch.area = patch.area * cos(newtheta) patch.width = sqrt(patch.area) patch.height = patch.width print ("actual perp area ", patch.height*patch.width) print ("patch axis ",norm(patch.axis)) print ("field axis ",norm(Earrow.axis)) Joe Heafner Sent from my iPad ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ Visualpython-users mailing list Vis...@li... https://lists.sourceforge.net/lists/listinfo/visualpython-users |
From: Joe H. <hea...@gm...> - 2011-06-08 20:22:31
|
I want to create some VPython simulations related to Gauss's law, flux, and solid angle. I want to get across the point that any arbitrarily shaped surface can, mathematically, be morphed into a sphere using the concept of solid angle. Is there a way to make an arbitrarily shaped patch of area morph SMOOTHLY into a square in VPython? Below is the code I have so far. It works, but it's not as smooth as I'd like it to be. from visual import * # a field arrow E = vector(1,-0.5,0) Earrow = arrow(pos=vector(0,0,0),axis=E,shaftwidth=0.01,color=color.red) Ehat = norm(E) # a patch of area # include option for circular patches direction = vector(1,1,1) patch = box(pos=(0,0,0),axis=direction,length=0.02,width=0.5,height=0.5) # patch morphing is smoother if height > width # patch's initial area patch.height0 = patch.height patch.area = patch.height*patch.width print ("initial area ", patch.area) # a unit normal to patch nhat = norm(patch.axis) nhatarrow = arrow(pos=Earrow.pos,axis=nhat,shaftwidth=0.01,color=color.green) scene.forward = -nhat # get angle between the two vectors newtheta = acos(dot(Ehat,nhat)) # check for newtheta = 0 # check for newtheta = pi print ("angle ",newtheta*180.0/pi) print ("predicted perp area ", patch.area * cos(newtheta)) # get the new rotation axis newaxis = cross(Ehat,nhat) # rotation animation scene.mouse.getclick() print ("rotating...") dtheta=0.001 theta=0.0 while theta < newtheta: rate(1000) nhatarrow.rotate(angle=-dtheta,axis=newaxis) patch.rotate(angle=-dtheta,axis=newaxis) patch.height = patch.height0*cos(abs(theta)) theta += dtheta patch.area = patch.area * cos(newtheta) patch.width = sqrt(patch.area) patch.height = patch.width print ("actual perp area ", patch.height*patch.width) print ("patch axis ",norm(patch.axis)) print ("field axis ",norm(Earrow.axis)) Joe Heafner Sent from my iPad |
From: Symion <kn...@ip...> - 2011-05-31 08:47:54
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body text="#000000" bgcolor="#ffffff"> On 31/05/2011 5:15 PM, Symion wrote: <blockquote cite="mid:4DE...@ip..." type="cite"> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> Sorry, I should have included a little more explanation of how to control the Tkinter side.<br> </blockquote> You can extract the values of items in the Listbox, here are the methods.<br> Tkinter : Visual Interaction.<br> 'Esc' key will flip between Visual and Tkinter<br> Visual Control of Tkinter:<br> 'f1' = Menu on|off<br> 'f2' = Canvas on|off<br> 'f3' = Button Bank on|off<br> Tkinter Control:<br> To select item from a Listbox and Reveal its value:<br> Double Click Left Mouse Key inside Listbox<br> OR<br> Use Keyboard cursors and the Enter Key.<br> 'tab' will navigate around Gadget.<br> 'space bar' will activate widget current.<br> 'enter' = close Tkinter - leave Visual open <br> 'end' = quit and close in either!<br> <br> <blockquote cite="mid:4DE...@ip..." type="cite"> <pre wrap=""> <fieldset class="mimeAttachmentHeader"></fieldset> ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Data protection magic? Nope - It's vRanger. Get your free trial download today. <a class="moz-txt-link-freetext" href="http://p.sf.net/sfu/quest-sfdev2dev">http://p.sf.net/sfu/quest-sfdev2dev</a></pre> <pre wrap=""> <fieldset class="mimeAttachmentHeader"></fieldset> _______________________________________________ Visualpython-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:Vis...@li...">Vis...@li...</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/visualpython-users">https://lists.sourceforge.net/lists/listinfo/visualpython-users</a> </pre> </blockquote> <br> </body> </html> |
From: Symion <kn...@ip...> - 2011-05-31 07:45:22
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> </head> <body text="#000000" bgcolor="#ffffff"> Hi there,<br> <br> I have recently been testing the Tkinter module with the idea of building GUI's for controlling things like Visual.<br> <br> Tkinter makes it very easy to create Lists, Sliders, Buttons, Menus as well as viewing and editing Text files.<br> <br> I would like to be able to strip the OS decorator from Visual and insert the visual.scene into either a Tkinter Canvas or a Tkinter Frame object.<br> Alternately, it might be easier to assume Visual is already wrapped in a Tkinter TopLevel Object and try to insert Tkinter widgets into the current window surround.<br> <br> When I chased down this idea and looked at the "ui" module it shed no light as the instantiation vanished into C!<br> <br> Is there a way to have them Running and Interacting at the same time?<br> Has anyone written code for this?<br> If this could be achieved it would be very useful!<br> I note that master.update() might be relevant for Tkinter to continue operation but how to control Visual?<br> Any help would be greatly appreciated.<br> <br> Since I have had problems running Tkinter and Visual together, I have developed a simple to use method that enables one or the other to be "in the drivers seat".<br> It is based on the fact that Visual uses the escape key to end program execution, so I set Tkinter to act the same.<br> Now pressing the 'Esc' key will switch between Visual and Tkinter, no problems!<br> <br> This means that Tkinter can be used to modify or define Visual environment or Objects, then press 'Esc' and you are in Visual.<br> Once in Visual it is possible to modify or define Tkinter environment or Objects, then press 'Esc' and you are in Tkinter!<br> <br> Source Code: TkInVisual.py<br> <br> <small><small>from Tkinter import *<br> import vis<br> from math import (sqrt, pi)<br> from os import (access as Access, path as Path, F_OK)<br> <br> class TkInVisual:<br> """Tkinter : Visual Interaction.<br> 'esc' key will flip between Visual and Tkinter<br> Visual Control:<br> Tkinter Panel:<br> 'f1' = menu on|off<br> 'f2' = canvas on|off<br> 'f3' = button on|off<br> 'enter' = close Tkinter - leave Visual open <br> 'end' = quit and close Both<br> """<br> def __init__(self):<br> """Access multiple lists via Visual/Tkinter"""<br> self.version="1.0.0"<br> self.copyright = "Tkinter Method - GNU (c) Symion MMXI"<br> self.xpos, self.ypos, self.wide, self.high = 8, 8, 400, 300<br> self.visual = vis.scene<br> self.visual.visible = False<br> self.visual.title = "{0} : {1}".format(self.copyright, self.version)<br> self.visual.autoscale = False<br> self.visual.range = 256<br> self.visual.access = 6 # new vis.scene.variable<br> #<br> # For old graphics card users * Time to upgrade? *<br> #<br> self.visual.enable_shaders = False<br> # Pre-set opening list<br> self.inform = dict()<br> self.memory = ["Master_methods", "Frame_methods",<br> "LabelFrame_methods", "Canvas_methods",<br> "Text_methods", "Entry_methods",<br> "Listbox_methods", "Scrollbar_methods",<br> "Label_methods", "Button_methods",<br> "Menu_methods", "Graphic_methods"]<br> self.action = ["self.Do_a", "self.Do_b", "self.Do_c",<br> "self.Do_d", "self.Do_e", "self.Do_f",<br> "self.Do_g", "self.Do_h", "self.Do_i",<br> "self.Do_j", "self.Do_k", "self.Do_l"]<br> <br> def Create_widget(self, title, config):<br> """config = [Menu 0|1, Graphic 0|1, Button 0|1|]"""<br> self.parent = Tk()<br> self.parent.title(title)<br> self.parent["borderwidth"] = 4<br> # Customise Tkinter Panel<br> self.parent.tk_setPalette(background="#B0B0B0",<br> activeForeground="#FFFFFF",<br> selectForeground="#FFFF00",<br> activeBackground="#FF0000")<br> # self.parent.geometry("=%dx%d+%d+%d" %(self.wide,<br> # self.high,<br> # self.xpos,<br> # self.ypos))<br> self.parent.geometry("+%d+%d" % (self.xpos, self.ypos))<br> self.parent.resizable(width=False, height=False)<br> self.parent.bind("<Escape>", self.Ok_go)<br> self.parent.bind("<End>", self.Ok_quit)<br> base = LabelFrame(self.parent,<br> fg="#0000FF",<br> font=("times", 14, "normal"),<br> bd=5,<br> text="Tkinter Object Methods")<br> base.grid()<br> rows = 0<br> # config = [Menu 0|1, Graphic 0|1, Button 0|1]<br> if config[1] > 0:<br> paper = Canvas(base,<br> width=self.wide,<br> height=self.high//3,<br> bg="#FFFFFF",<br> relief=RIDGE,<br> borderwidth=2)<br> paper.grid(row=rows, column=0, columnspan=2)<br> rows += 1<br> if config[0] > 0:<br> self.menubar = Menu(self.parent)<br> # create 1st pulldown menu<br> filemenu = Menu(self.menubar, tearoff=0,<br> activebackground="#FF0000")<br> self.menubar.add_cascade(label = " Methods ", menu=filemenu)<br> # <br> for a,b in zip(self.memory[:5], self.action[:5]):<br> filemenu.add_command(label = a, command=eval(b))<br> filemenu.add_separator()<br> filemenu.add_command(label=" Exit : End", command=self.Ok_quit)<br> if False:<br> # create 2nd pulldown<br> visualmenu = Menu(self.menubar,<br> tearoff=0,<br> activebackground="#00FF00")<br> self.menubar.add_cascade(label=" Visual ", menu=visualmenu)<br> visualmenu.add_command(label=" Objects ", command=self.Test)<br> visualmenu.add_separator()<br> visualmenu.add_command(label=" Open ", command=self.Test)<br> visualmenu.add_command(label=" Close ", command=self.Test)<br> visualmenu.add_separator()<br> visualmenu.add_command(label=" Edit ", command=self.Test)<br> # create 3rd<br> extramenu = Menu(self.menubar,<br> tearoff=0,<br> activebackground="#0000FF")<br> self.menubar.add_cascade(label=" Extras ", menu=extramenu)<br> # <br> for a,b in zip(self.memory[5:], self.action[5:]):<br> extramenu.add_command(label = a, command=eval(b))<br> #<br> # display the menu<br> self.parent["menu"] = self.menubar<br> self.parent.config(padx=12, pady=12)<br> self.label = Label(base, font=("times", 14, "normal"))<br> self.label.grid(row=rows,<br> column=0,<br> columnspan=2,<br> sticky=E+W,<br> padx=5,<br> ipadx=5)<br> rows += 1<br> # Build a List Table of info.<br> self.list_table = Listbox(base,<br> bg="white",<br> width=50,<br> borderwidth=2,<br> font=("times", 12, "normal"),<br> relief=SUNKEN)<br> # "A list of Tkinter Object Methods"<br> self.visual.access = self.visual.access%len(self.memory)<br> self.Make_list(self.visual.access)<br> # <br> self.list_table.grid(row=rows, column=0, columnspan=2,<br> ipadx=5, ipady=5, sticky=E+W)<br> self.list_table.bind("<Return>", self.Ach_tung)<br> self.list_table.bind("<Double-Button-1>", self.By_pass)<br> self.scroll_bar = Scrollbar(base,<br> orient=VERTICAL,<br> takefocus=FALSE,<br> highlightthickness=4)<br> self.scroll_bar["command"] = self.list_table.yview<br> self.scroll_bar.grid(row=rows, column=1, columnspan=2, sticky=N+S+E)<br> self.list_table["yscrollcommand"]= self.scroll_bar.set<br> self.list_table["activestyle"] = "dotbox"<br> self.list_table.focus_set()<br> rows += 1<br> #<br> # Button pad<br> #<br> if config[2] > 0:<br> i = 0<br> for y in range(6):<br> for x in range(2):<br> a, b = self.memory[i], eval(self.action[i])<br> test = Button(base, text=a, command=b)<br> test.grid(row=rows + y, column=x, columnspan=1, sticky=E+W)<br> test.bind("<Return>", b)<br> i += 1<br> rows += y + 1<br> qquit = Button(base, text="Back to Visual", command=self.Ok_go)<br> qquit.grid(row=rows, column=0, columnspan=2, sticky=E+W)<br> qquit.bind("<Return>", self.Ok_go)<br> <br> def Make_list(self, ndata):<br> self.visual.access = ndata<br> self.label["text"] = self.memory[ndata]<br> self.data = "self.{0}()".format(self.memory[ndata])<br> self.Build_list(eval(self.data).config().keys())<br> <br> def Do_remove(self):<br> n = range(self.list_table.size())<br> for a in n:<br> self.list_table.delete(0)<br> <br> def Build_list(self, table):<br> self.Do_remove()<br> for a in table:<br> self.list_table.insert(END, a)<br> <br> def Do_a(self, event=None):<br> self.Make_list(0)<br> <br> def Do_b(self, event=None):<br> self.Make_list(1)<br> <br> def Do_c(self, event=None):<br> self.Make_list(2)<br> <br> def Do_d(self, event=None):<br> self.Make_list(3)<br> <br> def Do_e(self, event=None):<br> self.Make_list(4)<br> <br> def Do_f(self, event=None):<br> self.Make_list(5)<br> <br> def Do_g(self, event=None):<br> self.Make_list(6)<br> <br> def Do_h(self, event=None):<br> self.Make_list(7)<br> <br> def Do_i(self, event=None):<br> self.Make_list(8)<br> <br> def Do_j(self, event=None):<br> self.Make_list(9)<br> <br> def Do_k(self, event=None):<br> self.Make_list(10)<br> <br> def Do_l(self, event=None):<br> self.Make_list(11)<br> <br> def Test(self, event=None):<br> print self.menubar.cget('type')<br> <br> def Ach_tung(self, event=None):<br> self.answer = self.list_table.get(ACTIVE)<br> # Do other things than simply printing it into V-IDLE<br> # Append to a list or build a dictionary perhaps?<br> try:<br> self.inform[self.answer] = (self.visual.access, self.answer)<br> a = self.inform.get(self.answer)<br> # self.inform.append((self.visual.access, self.answer))<br> # a = self.inform[-1]<br> except:<br> a = None<br> finally:<br> if a:<br> self.De_code(a)<br> else:<br> b = self.memory[self.visual.access].replace("_methods", "")<br> print "{0}['{1}'] = ".format(b.lower(), self.answer)<br> <br> def By_pass(self, event=None):<br> self.answer = self.list_table.get(ACTIVE)<br> self.De_code((self.visual.access, self.answer))<br> <br> def De_code(self, a):<br> b = self.memory[a[0]]<br> M = eval("self.{0}()".format(b))<br> mc = M.cget(a[1])<br> if mc.__class__.__name__ == "Tcl_Obj":<br> mc = mc.string <br> b = b.replace("_methods", "")<br> print "{0}['{1}'] = {2}".format(b, a[1], repr(mc))<br> del M<br> <br> def Ok_go(self, event=None):<br> self.xpos = self.parent.winfo_x()<br> self.ypos = self.parent.winfo_y()<br> self.parent.destroy()<br> <br> def Ok_quit(self, event=None):<br> self.Ok_go()<br> self.acts = False<br> <br> #<br> # Make list<br> #<br> <br> def Master_methods(self):<br> return self.parent<br> <br> def Frame_methods(self):<br> return Frame(self.parent)<br> <br> def LabelFrame_methods(self):<br> return LabelFrame(self.parent)<br> <br> def Canvas_methods(self):<br> return Canvas(self.parent)<br> <br> def Text_methods(self):<br> return Text(self.parent)<br> <br> def Entry_methods(self):<br> return Entry(self.parent)<br> <br> def Listbox_methods(self):<br> return Listbox(self.parent)<br> <br> def Scrollbar_methods(self):<br> return Scrollbar(self.parent)<br> <br> def Label_methods(self):<br> return Label(self.parent)<br> <br> def Button_methods(self):<br> return Button(self.parent)<br> <br> def Menu_methods(self):<br> return Menu(self.parent)<br> <br> def Graphic_methods(self):<br> return self.parent<br> <br> <br> if __name__ == '__main__':<br> <br> def Inter_pret():<br> if len(master.inform) > 0:<br> master.parent = Tk()<br> print "\nAccumulated List:"<br> for c in master.inform.keys():<br> a = master.inform.get(c)<br> b = master.memory[a[0]]<br> M = eval("master.{0}()".format(b))<br> mc = M.cget(a[1])<br> if mc.__class__.__name__ == "Tcl_Obj":<br> mc = mc.string <br> b = b.replace("_methods", "")<br> print "{0}.config({1}) = {2}".format(b, a[1], repr(mc))<br> del M<br> else:<br> print "Returned Empty List."<br> <br> def Quit():<br> print "Zoom({0})".format(vis.mag(master.visual.mouse.camera - master.visual.center)/sqrt(3.0))<br> if kb == "\n":<br> p = dir()<br> print "Dir() : Length({0})\n".format(len(p))<br> for j, a in enumerate(p):<br> print "{0:03.0f} = {1}".format(j, a)<br> else:<br> master.visual.visible = False<br> <br> def Use_visual(x, y, z):<br> master.visual.visible = True<br> kb = ""<br> while 1:<br> while not master.visual.kb.keys:<br> if not master.visual.visible and not master.visual.exit:<br> master.visual.exit = True<br> kb = "break"<br> break<br> elif master.visual.mouse.events:<br> mk = master.visual.mouse.getevent()<br> if mk.release == "left":<br> if mk.pick:<br> master.visual.center = mk.pickpos<br> box.pos = mk.pickpos<br> else:<br> master.visual.center = master.visual.mouse.pickpos<br> while master.visual.kb.keys:<br> kb = master.visual.kb.getkey()<br> print "keyboard event={0}".format(kb)<br> #<br> # Function keys f1 to f3 control Tkinter configuration<br> #<br> if kb in ["\n", "end"]:<br> master.acts = False<br> break<br> elif kb in ["f1"]:<br> x = 1 - x<br> break<br> elif kb in ["f2"]:<br> y = 1 - y<br> break<br> elif kb in ["f3"]:<br> z = 1 - z<br> break<br> elif kb == "break":<br> break<br> return (kb, x, y, z)<br> <br> #<br> # Initialise Tkinter and Setup VPython with visual = vis.scene<br> #<br> master = TkInVisual()<br> #<br> # Display some vital information in VIDLE<br> #<br> print "{0} : Version({1})\n{2}\n".format(master.copyright,<br> master.version,<br> master.__doc__)<br> #<br> #<br> # Arbitrary Visual code ** Replace with Your Visual Code **<br> #<br> #<br> if True:<br> obj = vis.points(size=1, color=vis.color.red, shape="square")<br> w = 30.0<br> for y in range(50):<br> for x in range(50):<br> obj.append((x - w, y - w, 0))<br> obj.color[-1] = (w / (x + 1), w / (y + 1), w / (x + y + 1))<br> box = vis.box(pos=master.visual.center, opacity=0.5,<br> color=vis.color.red, radius=5)<br> else:<br> execfile(Path.join(Path.abspath("."),"Demo.py"))<br> # <br> # Tkinter Configuration List for Object.methods = values Device.<br> # Initialise Tkinter Default settings to your specification.<br> #<br> # x = Menu control ON|OFF<br> x = 1<br> # y = Canvas control ON|OFF<br> y = 0<br> # z = Buttonpad control ON|OFF<br> z = 0<br> #<br> # config = [Menu 0|1, Graphic 0|1, Button 0|1|2]<br> #<br> # Begin<br> #<br> master.acts = True<br> while master.acts:<br> master.visual.exit = False<br> master.visual.visible = False<br> # Build Tkinter Objects<br> master.Create_widget(master.copyright, config=[x, y, z])<br> # master.parent.after()<br> if sys.platform[:3]:<br> master.parent.iconify()<br> master.parent.update()<br> master.parent.deiconify()<br> master.parent.mainloop()<br> # Cleanup<br> del master.parent<br> if not master.acts:<br> kb = ""<br> break<br> # Visuals turn at the helm<br> kb, x, y, z = Use_visual(x, y, z)<br> # React differently if User pressed 'enter' to exit during Visual phase<br> Quit()<br> # Display Results Accumulated during Tkinter Phase<br> Inter_pret()</small></small><br> <br> Symion<br> <small>Tuesday, 31 May, 2011</small><br> </body> </html> |
From: Bruce S. <Bru...@nc...> - 2011-05-27 20:35:09
|
No, import visual.graph isn't what you should use. It sounds like what you want is probably import vis.graph, or possibly import vis.graph as graph, so that you can refer to a graphing object such as gcurve as graph.gcurve. I've again appended below the information on the first page of the VPython documentation. When you import visual.graph, you're importing a package that executes from visual import *, as the documentation below points out. That in turn brings in a random function, so visual.graph.random exists. You'll probably also need to do things such as the following, depending on your needs: from vis import color # for vis.color.cyan; or import vis and refer to vis.color from numpy import arange # or import numpy and refer to numpy.arange from math import cos, exp # or import math and refer to math.cos and math.exp If you're just trying to solve the problem of making sure you get the random that you really want, you could just import that particular function first, with its own name: from wherever import random as MyRandom As to the difference between 'import visual.graph' and 'from visual.graph import *', in the first case you refer to gdots as visual.graph.gdots, whereas in the latter case you refer to gdots simply as gdots. Bruce Sherwood ------------------------------------- As a convenience to novice programmers to provide everything that is needed to get started, the statement "from visual import *" imports all of the Visual features and executes "from math import *" and "from numpy import *". It also arranges that for routines common to both math and numpy such as sqrt, the much faster math routine is used when possible (when the argument is a scalar rather than an array). If you want to import the visual objects selectively, import them from the vis module. Two simple examples: import vis vis.box(color=vis.color.orange,material=vis.materials.wood) from vis import (box, color, materials) box(color=color.orange, material=materials.wood) There are clean modules vis.controls, vis.filedialog, and vis.graph equivalent to the modules visual.controls, visual.filedialog, and visual.graph. The latter versions execute "from visual import *" and are retained because some programs expect that behavior when importing one of these modules. The documentation is written assuming that "from visual import *" is used. On Fri, May 27, 2011 at 1:40 PM, Eric Dick <mon...@ma...> wrote: > The problem was with the next line of code. I should have used > 'import visual.graph' rather than 'from visual.graph import *' > Can anyone explain what the difference between the two calls is? Also why > does visual.graph have visual.graph.random? > The Problem > _______________________________ > import random > from visual.graph import * #bad idea > # imports random from numpy directory > # visual.graph. does have a .random > _______________________________ > Solution: > import visual.graph |
From: Eric D. <mon...@ma...> - 2011-05-27 19:40:42
|
The problem was with the next line of code. I should have used 'import visual.graph' rather than 'from visual.graph import *' Can anyone explain what the difference between the two calls is? Also why does visual.graph have visual.graph.random? The Problem _______________________________ import random from visual.graph import * #bad idea # imports random from numpy directory # visual.graph. does have a .random _______________________________ Solution: import visual.graph |
From: Bruce S. <Bru...@nc...> - 2011-05-27 15:04:09
|
Try the example programs that are included with the VPython installer. Many of these examples are dynamic animations. As far as I know, there are no books on VPython, though I am aware of a couple of projects for textbooks for computational physics courses in which Python and VPython are featured. Bruce Sherwood On Fri, May 27, 2011 at 5:49 AM, yogesh duratkar <og...@gm...> wrote: > Hello! > could i know some extra features of vpython means is it can be > used for dyanamic animations, also tell me some books name for that. > Thank you > > ------------------------------------------------------------------------------ > vRanger cuts backup time in half-while increasing security. > With the market-leading solution for virtual backup and recovery, > you get blazing-fast, flexible, and affordable data protection. > Download your free trial now. > http://p.sf.net/sfu/quest-d2dcopy1 > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > |
From: yogesh d. <og...@gm...> - 2011-05-27 11:49:55
|
Hello! could i know some extra features of vpython means is it can be used for dyanamic animations, also tell me some books name for that. Thank you |
From: Bruce S. <Bru...@nc...> - 2011-05-25 02:04:33
|
For someone "very very very new" to this, you ask your question very knowledgeably. From the first page of the VPython documentation: As a convenience to novice programmers to provide everything that is needed to get started, the statement "from visual import *" imports all of the Visual features and executes "from math import *" and "from numpy import *". It also arranges that for routines common to both math and numpy such as sqrt, the much faster math routine is used when possible (when the argument is a scalar rather than an array). If you want to import the visual objects selectively, import them from the vis module. Two simple examples: import vis vis.box(color=vis.color.orange,material=vis.materials.wood) from vis import (box, color, materials) box(color=color.orange, material=materials.wood) There are clean modules vis.controls, vis.filedialog, and vis.graph equivalent to the modules visual.controls, visual.filedialog, and visual.graph. The latter versions execute "from visual import *" and are retained because some programs expect that behavior when importing one of these modules. The documentation is written assuming that "from visual import *" is used. Bruce Sherwood On Tue, May 24, 2011 at 1:28 PM, Eric Dick <mon...@ma...> wrote: > Hello, > I recently installed the VPython v.3.1 and corresponding Python versions for > mac (OSX). I've been troubleshooting an old script of mine when I noticed > some odd behavior. > When I run my script, a line tries to import random. Oddly the shell > reports that its using a file from numpy rather than from > ~/python3.1/random.py. If I try to import random manually in the shell it > grabs the correct module from ~/python3.1/random.py. > A. Python Shell >>>> import random >>>> print (random.__file__) > /Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/random.py > B. Script File >>>> print (random.__file__) > /Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages/numpy/random/__init__.py > Does anyone know how to fix this? Also does anyone know what is going on? > Please reply with complete instructions, as I am very very very new to all > of this. > Thank you all in advance! > ------------------------------------------------------------------------------ > vRanger cuts backup time in half-while increasing security. > With the market-leading solution for virtual backup and recovery, > you get blazing-fast, flexible, and affordable data protection. > Download your free trial now. > http://p.sf.net/sfu/quest-d2dcopy1 > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |