Can I display the Mayavi chart as a .vtk file for embedding in a web application?

Ok, a bit of background here. I made a script that splits the dataset as 3D graphs using mlab.plot3d () several times in Mayavi, after reading it from the xlsx file. Now I'm trying to make a web application for interactive viewing of created 3D models in a web browser. After some searching, I found xtk and thought about saving Mayavi output as a .vtk file and viewing it on the Internet using xtk.

Question 1: is this a stupid plan? are there any simpler ways? Question 2: if possible, how can I output all the components of the mlab scene to a single vtk file?

I searched and found the save_output () function from the children of the Mayavi pipeline using a record, but this seems to work only for individual objects. Any idea how to do this for the whole scene?

+4
source share
1 answer

If you installed mayavi, then you would include the python tvtk library, which is one of its dependencies. The documentation provides some examples of how you can write your structures to a vtk file using a function write_data.

0
source

Source: https://habr.com/ru/post/1545465/


All Articles