Pages

Thursday, 29 August 2013

Meshlab Load Multiple

Quick post about something I've just found out about +MeshLab. I was quickly trying to search for a way to load in multiple point clouds from .ply files into meshlab from the command line.

I'm interested in doing this as I want to trigger meshlab to load a bunch of files from a link in PowerPoint.

To launch external programs/files from PowerPoint...

- Select the text you want to create the link with
- 'Insert Tab'
- In the 'Links' panel click on 'Action'
- Point 'Run program' towards the .exe of the program you wish to launch

With Meshlab it'll look something like this
C:\Program Files\VCG\MeshLab\meshlab.exe pointCloud.ply

The problem was I wanted to load in 3 .ply files. Doing the following just loads in the first point cloud.

C:\Program Files\VCG\MeshLab\meshlab.exe pointCloud1.ply pointCloud2.ply

So the easiest way I can see is to just use a Meshlab project file. You can either load all your point clouds into Meshlab then go to File > Save Project

This creates a .mlp file that contains the following...

<!DOCTYPE MeshLabDocument>
<MeshLabProject>
 <MeshGroup>
  <MLMesh label="PC1.ply" filename="PC1.ply">
   <MLMatrix44>
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
</MLMatrix44>
  </MLMesh>
  <MLMesh label="PC2.ply" filename="PC2.ply">
   <MLMatrix44>
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
</MLMatrix44>
  </MLMesh>
  <MLMesh label="PC3.ply" filename="PC3.ply">
   <MLMatrix44>
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
</MLMatrix44>
  </MLMesh>
 </MeshGroup>
 <RasterGroup/>
</MeshLabProject>

Edit, with your favorite text editor, accordingly with all your .ply files. Then you can direct PowerPoint to
C:\Program Files\VCG\MeshLab\meshlab.exe "C:\work\stuff\projectfile.mlp"

No comments:

Post a Comment