What a lightweight python library for easy scientific visualization in 3D

I am writing a python program to experiment with an academic idea. Look at the resulting image that the program generates:

leaf

Thick skeletal lines in the middle of the sheet are what you need to visualize. Each segment of skeletal lines has a meaning associated with it, in the above image (drawn by pycairo ) different shades of gray are used for visualization, a lighter color means a higher value, black lines indicate that the lines have a value of 0 with them. The problem is that visualization using colors in this case is very unintuitive for the human eye, it would be much better to visualize the values ​​in 3D, as shown below (taken from the article):

2d in 3d

the left image is a three-dimensional visualization of the right, the values ​​associated with the lines are visualized as the height of adjacent walls in 3D.

What is the best library for this? I do not want to invest a lot of time in this, so a small library is recommended.

+4
source share
2 answers

If you need light weight, you can use PyOpenGL to simply exchange OpenGL calls in python directly. This is probably the easiest option.

If you want a lot of features, I would recommend using VTK . This is a very powerful visualization toolkit with Python covers (included). There are other packages at the top (such as Mayavi and Paraview), but VTK wrappers themselves are easier to use. This was probably my first choice, as they have good samples that you can use - all you have to do is make an instance of VtkPolyData and drop it into the renderer.

To simplify the development, you may need something that will simplify this for you, for example, wrappers for an easy rendering engine, for example Irrlicht via Pyrr . This facilitates image creation.

+4
source

Have you watched mayavi ? I don’t know if it meets your definition of "light", but it seems popular and easy enough to use to use it.

+3
source

All Articles