Search code examples
meshlabpymeshlab

Updating a mesh in meshlab live, from command line


So I have a mesh (a triangulation) which I am performing moves on (Pachner moves...) using a C code, which I want to have some visualizations for. I implemented something in gnuplot, in which the mesh is updated every time a make I move (and I will be making hundreds of moves), but gnuplot is not that great at displaying these things. Meshlab is way better!

So what I'd really like is to be able to live-update something in meshlab, using CLI tools. Right now, I'm able to

  • Create the triangulation in C and make the moves
  • Send that to Python (via pymeshlab) to turn those edges/vertices/triangles into a mesh
  • Open meshlab via CLI: "meshlab TEST.ply"

But, this requires re-opening meshlab every time that line of the code is hit, and then closing again before continuing, which is not really desirable. Is there a way of implementing live-updating in meshlab, so I can have a code, like change a text file and have the updates appear in meshlab?


Solution

  • If you don't mind to have to use the mouse or the keyboard to update the mesh, you can avoid to relaunch meshlab.

    Just keep your program overwriting the TEST.ply file and press Ctrl-Shift-R to reload the TEST.ply file. You also can do this clicking on one of these buttons in the menu bar:

    enter image description here

    If you really need full automation, like update every 10 seconds or detect if the file has changed, you will need to use another program (as libIGL)