In Python, how can I export a 3D isosurface into Blender
Question: I have some 3D (x,y,z,value) data in python and I can visualize the
isosurfaces in Mayavi. How can I export this isosurface into a file that I can
read into Blender?

Here is some example code:

    
    
    import numpy
    from mayavi import mlab
    
    x, y, z = numpy.ogrid[-5:5:64j, -5:5:64j, -5:5:64j]
    values = x * x * 0.5 + y * y + z * z * 2.0
    mlab.contour3d(values, contours=[.5])
    mlab.show()
    


Answer: Using @timday's suggestion, I added the following code to save the isosurface
in a wavefront (.obj) format:

mlab.savefig('surface.obj')

Then, I can open it in Blender with File>>Import>>Wavefront (.obj)

I had to scale down the image considerably (~100x) to make it visible in the
Blender viewport.

![enter image description here](http://i.stack.imgur.com/PpNIL.png)

The origin is set way off to the side of the actual object, so the object is
easier to deal with if I use Object>>Transform>>Origin to Geometry

![enter image description here](http://i.stack.imgur.com/pt5rD.png)

After adding some lighting and a plane, the object looks pretty good!

![enter image description here](http://i.stack.imgur.com/SPqWf.jpg)

