Meshlab
Software for general work with meshes and texturing. Also allows to simply process pointclouds.
General tips
- Use the Linux AppImage from Meshlab official website.
- Faster Real-Time Rendering
Tools -> Options
- Scroll down to
maxGPUMemDedicatedTechnology
- Set it according to our GPU memory, e.g., for 4000 MB RAM, set slightly lower to 3500 MB
- Restart MeshLab and open some large model. On left down panel, there is information about FPS and rendering mode:
- BO_RENDERING (Buffer Object Rendering): everything is running on the GPU - fast
- IMMEDIATE_MODE_RENDERING: only CPU, much slower
- DO NOT FORGET TO SAVE REGULARLY YOUR WORK! MESHLAB LIKES TO CRASH
- Run the Meshlab from the commandline to be able to watch the events.
Useful links
Import and merge
Describe steps to import .ptx
and .pts
files into MeshLab.
.ptx
-
Meshlab has a new setting in the
Settings->Tools
for each file format. Please set it as shown in the image
- At the end, merge all imported layers into one. Click on the one of the layer with
Right mouse button -> Flatten Visible Layers
. Check Keep unreferenced vertices and click Apply. - Use the tool Select Faces/Vertices inside polyline area to clean the pointcloud.
- Make sure to have the layer you want to clean active (in blue color)!
- IMPORTANT: Adjust the PointCloud coordinate system. It is useful to do ASAP at the beginning of the process.
- The best option is to align the coordinate system before exporting the data from Leica as explained here.
- Show the coordinate system with the
Draw XYZ axes in world coordinates
icon - Click the
Manipulators tool
icon - Follow the instruction to adjust the position of the pointcloud
- If you are stasified with the adjustement, firstly save the Meshlab project. It keeps the transformation from the original position in the readable XML format simple savefile.
- Run
Matrix: Freeze Current Matrix
function to apply the transformation on current file.
- Save the final
.ply
file
.pts
-
Please set it as shown in the image
-
Imported
.pts
file has to be renamed to.txt
. -
Point format
asX Y Z Reflectance R G B
-
Separator
asSPACE
-
Click
OK
Mesh computing
We are using manily two methods to create a mesh from a pointcloud. Screened Poisson and VGC.
-
Mesh computing requires a huge amount of RAM! It is recommended to have at least 32 GB RAM with some backup swap. If you can provide 64 GB RAM, even better!
-
The input pointcloud has to be simplified to be able to mesh it. The ideal number of vertices is 6--10 milions.
-
The general rule: Better to create a huge model and simplify it than create a small model right away.
-
AMD processors are much faster on Ubuntu to create the mesh: It takes much longer time for Intel to do the same task.
- Surface Reconstruction: Screened Poission: this methos is useful for most cases. It usually works well for closed environemnts as buildings. Various parameters are possible to set. I have found useful to increase the Reconstruction Depth. The "optimal" number is between 12--16. The higher the number, the more detailed is the model. The RAM demands increases faster than linear. Example of the set values is in the image below.
- Surface Reconstruction: Ball Pivoting: Single thread, slow. Creates loose pointcloud with bunch of holes.
- Surface Reconstruction: VGC: Single thread in the most part, slower. Suitable for smaller "open" models as electrical tower. It crashes a lot (Segmentation fault). Check Vertex Splatting box before executing. Most useful parameter is the Voxel side. The smaller the value, the more detailed and precised is the model. Recommend to set the value to 0.01 which corresponds to
1 cm
voxel side. Geodesic Weightening value increase makes the mesh smoother in general. Volume Laplacian iter will inflate the volume of the model. Widening makes the model wider, even decrease the value might be more useful.
- Surface Reconstruction: Screened Poission: this methos is useful for most cases. It usually works well for closed environemnts as buildings. Various parameters are possible to set. I have found useful to increase the Reconstruction Depth. The "optimal" number is between 12--16. The higher the number, the more detailed is the model. The RAM demands increases faster than linear. Example of the set values is in the image below.
-
The mesh processing can take a long time, check the commandline for further details.
-
Simplify the model with Simplification: Quadric Edge Collapse Decimation functionality.
- I recommend to use the checkboxes as shown in the image. Most of those preserve the original shape and the planarity as well. Other parameters in the image are just an example. The higher the default mesh, the longer the processing time. At the beginning, it could be around 30 minutes for 1GB mesh. Meshlab show the percentage done for this method.
-
Save the model into
.ply
and check the file size.- Recommend
.ply
file size in between 10--150MB, depending on the application. For texture processing, the lower the better. The texture will cover inperfections. For model with no texture, the quality is visible more. If you would like to use the model in the simulation, assume 2.5x times larger final exported file, so shrink the file accordingly. If exported with texture later on, the size will be about 2.5x times bigger. These numbers depends on the amount of saved information in the .ply file.
- Recommend
Texturing
We use two types of texturing. Pointcloud vertex color texturing and Raster image texturing. Both will be described below.
A good quality texture can significantly improve the low quality mesh model