MPI-IS / meshlite

MeshLite is a lightweight package for visualizing, editing and saving meshes.
Other
40 stars 4 forks source link

Any example code for saving snapshot ? #1

Open eshafeeqe opened 5 years ago

eshafeeqe commented 5 years ago

Dear Authors,

First of all thanks for making this awesome tool opensource. I am aware that the mesh can be viewed using meshviewer class and different meshes could be visualised over iterations by changing dynamic_meshes method of this class.

However I tried to save snapshots on each iterations as shown the code below but its not working as I expected.

mv = MeshViewer()
for i in range(10,20):
      opt_v = sess.run(v)
      mesh_out = Mesh(v=np.squeeze(opt_v), f=model_f)
      mv.dynamic_meshes = [mesh_out]
      mv.save_snapshot("snapshot.png" )

Kindly let me know if I am missing something ?

naureenm commented 5 years ago

Hi, Thanks for the email & interest in this package!

The final line in your code snippet is what should save snapshot -- we've been using it this way on macOS and linux machines so far. However, two things I could point out are, 1) make sure the viewer displays what you are trying to save as an image, if the viewer does not have the image visible on screen, it will not save anything; 2) make sure the path given to the mv.save_snapshot() function is correct - this path needs to be a full directory + filename path.

I hope this helps!