In Python, how can I export a 3D isosurface into Blender

余生颓废 提交于 2019-12-05 15:08:12

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.

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

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

I've never tried it myself but I notice mlab's savefig also claims to support saving to Wavefront ".obj" format (also known as wavefront format), a 3D geometry format. Certainly I've seen importers from obj to Blender.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!