scipy - In Python, how can I export a 3D isosurface into Blender -
i have 3d (x,y,z,value) data in python , can visualize isosurfaces in mayavi. how can export isosurface file can read blender?
here example code:
import numpy 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()
using @timday's suggestion, added following code save isosurface in wavefront (.obj) format:
mlab.savefig('surface.obj')
then, can open in blender file>>import>>wavefront (.obj)
i had scale down image considerably (~100x) make visible in blender viewport.
the origin set way off side of actual object, object easier deal if use object>>transform>>origin geometry
after adding lighting , plane, object looks pretty good!
Comments
Post a Comment