Russell's Blog

New. Improved. Stays crunchy in milk.

Playing with MayaVi2

Posted by Russell on December 06, 2006 at 9:20 p.m.
I've been looking for a good 3D plotting tool that can, in some way, be coaxed into a healthy relationship with python. Actually, I'd settle for anything, really. All I really want is the ability to easily embed points and surfaces into a volume, and then be able to apply some basic manipulations (rotation, translation and zoom). What I'd really like is to have an interface that would work something like this :
import scipy
import plot3d
plotter = plot3d()

plot = plotter( title="I'm a plot!" )
plot.point( 1.0, -0.5, 1.25 )
plot.point( 0.25, -1.5, -1.25 )

def f( x, y ) :
    return scipy.sin(x) + scipy.sin(y)

xx = arange( -1.0, 1.0, 0.01 )
yy = arange( -1.0, 1.0, 0.01 )

plot.func( xx, yy, f )

plot.show()

plot.save( filetype='png', 'image.png' )

The output doesn't have to be accelerated, although that would be nice. The important thing is producing tolerably good images. Well, the closest thing that I can find is MayaVi2. I would include a link to it, but the site (sites?) is/are confusing enough that I can't even guess where to point the link. You will do no worse than me with a Google search. Clearly, something interesting is going on, but it's not altogether clear what.

Anyway, by checking out a staggeringly large amount of code and following the relatively simple build instructions, here is what the output looks like :

Evidently, the thing I actually want is called mlab, which sort of emulates the 3D plotting available in MatLab. The idea is rather like the pylab API of the fantastic matplotlib package, but for 3D. The rest of the code appears to be some kind of huge visualization framework, like OpenDX rebuilt in wxPython with similar intentions and a completely different design.

There are some rendering bugs that are probably the fault of my graphics driver, and the visualization system itself is bewildering and semi-working. The mlab module only seems to work correctly when called from the python console embedded in the MayaVi2 GUI, and even then segfaults when certain other modules are loaded (e.g., matplotlib). Also, the snapshot feature is completely broken, and will either crash or write a file full of garbage (the image above is screen capture via X.org). Maybe I will appreciate it more when it works a little better, but for the moment, I would be happy if someone kidnapped mlab and moved it into the matplotlib family of tools.

I will have to play with this some more. It has a lot of promise if I can get around some of the bugs.

coach outlet on May 19, 2013 at 9:26 p.m.

A blog is something that can Coach Factory only benefit you and not hurt you, most of Coach Factory Online air max the time that is. Once you establish a presence online via louis vuitton outlet blog you then create more potential followers for you and your business that you didn’t previously have. You see there is much to gain when you create a blog, so read through this article and see how blogging can help you.



Choose a domain name that immediately tells potential readers what your blog is about. coach outlet It’s not likely that you louboutin are going to ralph lauren be able to procure a name like but, your blog is more likely to be about some particular aspect Hogan of your subject. Incorporate that aspect into the domain name along with your louis vuitton Coach Factory Outlet overall focus.



Don’t be afraid to stretch out your louis vuitton hand and ask your reader for a donation. Your loyal readers, in particular, will be likely to donate some to coach outlet your cause. If your blog is valuable enough, people will realize it. They will also realize that, longchamp not Coach Factory louis vuitton outlet Online only does Coach Outlet it cost you money to produce your blog, your time is valuable.



Make sure that you have a blog mailing list started early. The sooner you get this started, the more time you coach outlet will have gucci to make that list larger. Once your blog is more established, this list will be used to bring in money, and you will be thankful that you already took care of this.

Ignore this field:
 optional; will not be displayed
Don't put anything in this field:
 optional
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p>.