For more info on MeshLab, you can watch the youtube videos of Mister P. MeshLab Tutorials
Random tip: For massive pointclouds (ie. >2mil points), you can:
- make it invisible
- take a smaller sample of it (how to sample)
- select the original (massive) pointcloud layer
- do operations (eg. selecting points/faces) on the invisible original pointcloud, while using the smaller sample pointcloud to guide you
or perhaps, view the normals of the sample pointcloud, to get a representative view of the normals of the original pointcloud (without the lag)
MeshLab does NOT:
- have an undo function
- prompt you to save when you close it
- prompt you when deleting layers, points/faces, etc.
- prompt you before performing an operation. Thus, before you perform an operation on a layer, ensure you selected the right layer
Saving / Exporting (back to Contents)
I highly recommend that you DON'T save using File > Save Project As...
(Ctrl + S).
- it's quite iffy
- forces you to choose to save/not-save each and every one of the layers
- if you change the directory of the project later, it might not be able to detect the mesh/pointcloud files when you open it
Instead, use File > Export Mesh As...
(Ctrl + Shift + E), which saves the selected layer as a file type of your choice. (I usually save as .ply
)
Then to open the mesh/pointcloud files, simply import them into MeshLab via File > Import Mesh...
(Ctrl + I) or by clicking this icon at the top left:
Navigation / Manipulation (back to Contents)
Basic (back to Contents)
Key | What it does |
---|---|
LeftMouseButton(LMB) (hold + drag) | rotate about trackball center |
MouseWheel | zoom in/out |
MiddleMouseButton(MMB) (hold + drag) | move trackball |
double click (on a point/face) | center trackball at the selected point/face |
Useful shortcuts (back to Contents)
Key | What it does |
---|---|
Ctrl + H | reset camera settings |
Shift + mouseWheel | change Field of View (FOV) |
Alt + Enter | fullscreen mode |
Ctrl + Shift + LMB (hold + drag) | change direction of lighting (effects are only visible if model has normals) |
Ctrl + mouseWheel | change near clipping range (how close a point/face has to be to you, before it unrenders) |
Ctrl + Shift + E | export mesh/pointcloud |
Point / Face display settings (at bottom right) (back to Contents)
Tip: Hold shift and change these settings to apply the settings to all visible layers.
Shading (for points) (back to Contents)
Setting | What it does |
---|---|
Vert | square points, shading based on point's normal and direction of lighting (adjustable via Ctrl + Shift + LMB (hold + drag)) |
Dot Decorator | circular points, no shading |
None | square points, no shading |
Color (back to Contents)
Setting | What it does |
---|---|
Vert | based on point's color |
Mesh | Usually either gray or purple color |
User-Def | defined your own color |
Back-Face (for faces) (back to Contents)
Setting | What it does |
---|---|
Single | face's normal pointing at you -> brightest pointing away from you -> darkest |
Double | face's normal is pointing at or away from you -> brightest pointing perpendicular from you -> darkest |
Fancy | face's normal pointing < 90° from you -> slightly bluishpointing > 90° from you -> slightly reddish |
Cull | face's normal pointing < 90° from you -> visiblepointing > 90° from you -> invisible |
Layer control (back to Contents)
Inverting the layers selected (back to Contents)
Hold shift and toggle the visibility of any one layer. It will cause all visible layers to be invisible, and vice versa.
Duplicating layers (back to Contents)
Right-click the desired layer, and select Duplicate current layer
Moving / Copying selected points/faces to new layer (back to Contents)
-
select the points/faces you want to move
-
right-click the layer
-
select
Move select faces/vertices to another layer
-
(Optional) If you want to copy to new layer instead of moving, uncheck
Delete original selection
-
Apply
Combining layers (back to Contents)
-
make all the layers you want to combine visible
-
right-click on any layer
-
select
Flatten visible layers
-
check:
Merge only visible layers
Merge duplicate vertices
(duplicate vertices are points that have exact same coordinates)Keep unreferenced vertices
(this is needed for pointclouds, else it will delete all points that doesn't have a face)
-
(Optional) If you only want the resulting merged layer, and don't want the currently selected componenet layers, check
Delete layers
-
Apply
Deleting layers (back to Contents)
WARNING
MeshLab does NOT prompt for confirmation when deleting layers.
- to delete 1 layer, right-click that layer, and select
Delete Current Mesh
- to delete multiple layers at once, make all the layers you want to keep visible, and all the layers you don't want invisible. Then right-click a layer and select
Delete all non visible Mesh Layers
.
Point / Face selection (back to Contents)
The selection mode (back to Contents)
To enter selection mode, click on one of these icons:
They are (from left to right):
Select vertexes
Select faces
Select connected components in a region
I've never used
Select connected components in a region
before so idk how to.
After clicking, most of the top-bar icons should be grayed out like this
To move/rotate the camera: click on the trackball icon or press Esc
To go back to selecting: click on the Select vertexes/face/connected components
icon again, or press Esc
.
Note: the red-highlighting of selected points might not be visible (or barely visible) at small point sizes.
Selecting (back to Contents)
To select points/faces, enter the selection mode (as described above), then hold and drag LMB.
When selecting, you can press and hold on these keys:
Key | What it does |
---|---|
Ctrl(Hold) | Additive/Union selection |
Shift(Hold) | Deselection |
Operations (back to Contents)
What it does | Location | Shortcut |
---|---|---|
Inverts the selection | Filters > Selection > Invert Selection |
Ctrl + Shift + I |
Select all | Filters > Selection > Select All |
Ctrl + Shift + A |
Deselect all | Filters > Selection > Select None |
Ctrl + Shift + D |
Some noteworthy advanced operations (back to Contents)
Note: The operations here are just the ones I often used. There's many more under
Filters > Selection
.
What it does | Location |
---|---|
Select big faces (useful for cleaning up meshs) | Filters > Selection > Select faces with edges longer than |
Select specific faces/vertices using a user-defined function | Filters > Selection > Conditional face/vertex selection |
Deleting (back to Contents)
WARNING
MeshLab does not have an undo function, and does not prompt for confirmation when deleting. So ensure that you select the correct pointcloud/mesh layer, as it's possible to accidentally delete from a selected non-visible layer.
To delete selected points/faces, click on one of these icons:
Sampling / Subsampling / Down-sampling (back to Contents)
It's an operation to take a smaller pointcloud sample from a pointcloud. Useful for when the pointcloud is too large.
I only used screen poisson-disk sampling, so idk about the other algorithms.
Poisson-disk sampling (back to Contents)
-
select
Filters > Sampling > Poisson-disk Sampling
-
set the
Number of samples
I often set to 2mil, which usually results in 400k-1mil points
If you want a specific number of samples, check
Exact number of samples
which will result in a pointcloud with (Number of samples
± 0.5%) points but takes MUCH longer -
check
Base Mesh Subsampling
(this is needed if the model is a pointcloud with no faces) -
Apply
Normals (back to Contents)
Computing normals for pointcloud (back to Contents)
Computing the normals for a pointcloud is quite easy:
- select
Filters > Normals, Curvatures and Orientation > Compute normals for point sets
- set desired
Neighbour num
I usually go for the default
10
, and it so far worked out; but I've seen some online articles state to set more neighbour (eg.16
) Apply
(orPreview
, if you want to preview the results instead)
HOWEVER, here's the problem (back to Contents)
Sometimes, computed normals points in the opposite direction of what you want.
Example images
Here's an image of the pointcloud of a floor.Notice how some of the normals are pointing downwards instead of up.
Here's a bird's-eye view of the same floor pointcloud.
The dark gray points have normals facing downwards instead of upwards.
Here's the cross section of a square column / pillar.
Notice how all the normals are pointing inwards instead of outwards.
This can cause problems during meshing, resulting in malformed meshes.
Example images
Here's an image of the pointcloud of a floor, where the dark yellow points are pointing the wrong way.Here's reconstructed mesh made from the above pointcloud.
Notice the rock-like malformation at the spot with alot of incorrectly pointed normals.
Also, it may cause problems when rendering pointcloud models. (this only cause problems when the normals are used in rendering, eg. for lighting, or back-face culling)
One such situation is when the rendering engine uses back-face culling, where if the points' normals are pointing away from you, it won't be rendered.
To fix the above problem (back to Contents)
-
For a simple model, that only has a single plane, like a wall or floor:
-
look at the pointcloud/mesh in the direction opposing the normal vector direction that you want. (eg. for a floor mesh, look at it from a bird's-eye view, as you want the normals to point up)
Zoom out so that the pointcloud/mesh looks far away from you (reason) -
select
Filters > Normals, Curvatures and Orientation > Compute normals for point sets
-
set desired
Neighbour num
-
under
Viewpoint Pos.
, in theGet
drop down list, selectView Pos.
-
check the
Flip normals w.r.t. viewpoint
option -
Apply
This will flip all the normals towards your view point in
Step 1
-
-
For models that aren't just a single plane pointcloud:
-
you'll have to first compute the normals with the
Flip normals w.r.t. viewpoint
option unchecked -
then by using multiple different view-points / view-directions, you'll need to flip the wrongly faced points using the method described in the
Flipping normals for pointcloud
section belowExample image
Here's the cross-section of a column / pillar.
Notice how some points' normals are facing inwards instead of outwards.
To flip the inward-facing normals using theFlipping normals for pointcloud
methods, at least 2 viewpoints are needed as shown.
To understand why, read up about how this works here.
-
Viewing normals (back to Contents)
Method 1 (back to Contents)
To get a rough visualisation of the normals
- change color of the points/faces to a either
Mesh
orUser-defined
- change shading of the points/faces to
Vert
This will make the points/faces (with normals that are pointing towards you) darker.
This is much less laggy than Method 2
.
Useful for finding outliers with normals that are facing the wrong way.
Image
The lighter-colored gray points have normals pointing towards me. The almost-black darker ones are pointing away from me.Method 2 (back to Contents)
WARNING
This method can get quite laggy if there are alot of points/faces. (around >1mil, depending on your GPU)
To see normals vectors:
-
select
Render > Show normals
-
if you don't see blue-purple lines like this:
go to the bottom right panel and checkPer Vertex/Face
-
(Optional) If the normals are too long or short, go to the bottom right panel and increase/decrease
Vector length
FYI: For very big pointclouds, you can do a
Sampling
operation to get a smaller pointcloud, and then viewing the normals of the sample instead.
Flipping normals for pointcloud (back to Contents)
Sometimes, computed normals points in the opposite direction of what you want.
To correct this:
Selection (back to Contents)
To select the points that are pointing the wrong direction:
-
If there are only a few points, just select them manually
-
If there are many:
- Method 1 - by view position (back to Contents)
-
look at the pointcloud/mesh in the direction opposing the normal vector direction that you want. (eg. for a floor mesh, look at it from a bird's-eye view, as you want the normals to point up)
Example image
This is a bird's-eye view of a pointcloud of a floor.
The dark gray points have normals facing downwards instead of upwards.
Zoom out so that the pointcloud/mesh looks far away from you (reason) -
select
Filters > Normals, Curvatures and Orientation > Compute normals for point sets
-
under
Viewpoint Pos.
, in theGet
drop down list, selectView Pos.
-
using notepad (or any other text program), replace the
cx
,cy
,cz
in the code below, with the xyz coordinates from theViewpoint Pos.
inStep 3
vsel && (acos((nx * (cx - x) + ny * (cy - y) + nz * (cz - z)) / (sqrt((cx - x) * (cx - x) + (cy - y) * (cy - y) + (cz - z) * (cz - z)))) > 3.14159265/2.0)
-
select the affected region. The operation will only pick points from the selected points
-
select
Filters > Selection > Conditional Vertex Selection
-
copy the modified code in
Step 4
into theboolean function
input, and apply.
This will select all the wrong-facing points from the points selected inStep 5
-
- Method 2 - by trackball (back to Contents)
-
by holding the middle-mouse-button (MMB), position the trackball center far away in the direction of the normals you want (eg. if you want the normals to point up, put the trackball far above the points)
-
select
Filters > Normals, Curvatures and Orientation > Compute normals for point sets
-
under
Viewpoint Pos.
, in theGet
drop down list, selectTrackball Center
-
Follow the steps from
Method 1 - by view position
startingStep 4
-
- Method 3 - by view direction (back to Contents)
-
look in the direction opposing the normal vector direction that you want (eg. if you want the normals to point up, look downwards) (this doesn't depend on your position, only your view direction)
-
select
Filters > Normals, Curvatures and Orientation > Compute normals for point sets
-
under
Viewpoint Pos.
, in theGet
drop down list, select something besidesView Dir.
first, then selectView Dir.
. (else it won't update theViewpoint Pos.
coords)
Ensure theViewpoint Pos.
coord isn't0, 0, 0
-
using notepad (or any other text program), replace the
vdx
,vdy
,vdz
in the code below, with the xyz coordinates from theViewpoint Pos.
inStep 3
vsel && (acos((nx * vdx + ny * vdy + nz * vdz) / (sqrt(vdx * vdx + vdy * vdy + vdz * vdz))) > 3.14159265/2.0)
-
select the affected region. The operation will only pick points from the selected points
-
select
Filters > Selection > Conditional Vertex Selection
-
copy the modified code in
Step 4
into theboolean function
input, and apply.
This will select all the wrong-facing points from the points selected inStep 5
Flipping the selected (back to Contents)
-
select
Normals, Curvatures, Orientation > Per Vertex Normal Function
-
leave the functions as default, and check
only on selection
-
Apply
How the 3 selection methods works (back to Contents)
For illustration purposes, 2D vectors are used here
-
For Method 1 (by view position) and Method 2 (by trackball):
-
a point is taken as the viewpoint, either by view position or by the trackball center.
-
for each point in the pointcloud:
-
a vector is created, from that point to the viewpoint
-
then the angle between the new vector and the point's normal is computed by using this formula:
θ = acos[(u • v) / (|u||v|)]
where θ is the angle,
u and v are the 2 vectors,
and |u| and |v| are their magnitudes. -
if that angle is > 90° (ie. π/2), the point's normal is flipped
-
-
as to why the view point must be far away from the model,
here's a gif showing a viewpoint thats very close the the model,
and a point that's on a "bump" on a floor pointcloud.
Notice how although the point's normal is facing the wrong way, it isn't flipped as the angle is < 90°.
-
-
For Method 3 (by view direction):
- with reference to the above
For Method 1 (by view position) and Method 2 (by trackball)
section, the new vector used is the view direction.
The view direction (obtained from Method 3 -Step 3
) is a vector with a direction opposing the direction you are facing. (ie. a vector that points at you)
- with reference to the above
Meshing of a pointcloud (back to Contents)
Note: You'll need a pointcloud WITH NORMALS to do meshing. If the pointcloud doesn't have normals, go to the Normals – Computing normals for pointcloud section to see how to computing the normals.
I only used screen poisson surface reconstruction, so idk about the other algorithms.
Poisson surface reconstruction algorithm (back to Contents)
-
select
Filters > Remeshing, Simplification and Reconstruction > Screen Poisson Surface Reconstruction
.
Which will display this menu: -
Reconstruction Depth
determines the resolution of the resulting mesh. It also depends on the size of the pointcloud (ie. if depth=10 produced a good mesh for one pointcloud, it might not for a bigger/smaller pointcloud)you'll have to experiment with this value yourself
-
For all the other parameters, idk what they exactly do. Click on
Help
for more info on them -
Apply
(the meshing might take awhile)
Cleaning the mesh (back to Contents)
Here's the mesh of a floor. The yellow region is the pointcloud used.
Notice how the mesh extents further than the pointcloud.
To remove this excess surface:
-
you can select and delete the excess faces manually
-
or you can select the based on the face size like this:
-
select
Filters > Selection > Select Faces with edges longer than...
. -
check the
Preview
option -
keep tweaking the
Edge Threshold
value until it selects as much of the excess faces , but none of the faces in the area that you want to keep -
Apply
-
delete the selected faces and their vertices, by clicking this icon:
-
Then you'll need to remove all the isolated pieces of faces by:
-
Closing holes in mesh (back to Contents)
If you mesh has holes like this:
you can fill / close them up by:
-
select
Filters > Remeshing, Simplification and Reconstruction > Close Holes
-
(if you want close specific holes) select the faces around the hole, and check
Close holes with selected faces
-
set desired
Max size to be close
(you'll need to experiment with this to find the right value) -
Apply
Moving, rotating, and scaling (back to Contents)
To do these, you need to click on the Manipulators Tool
, which is this icon:
Which will display this on the top left:
While in Manipulator
mode, if your trackball is displayed, press Esc
which should hide your trackball
If you want to rotate the camera view, press Esc
, which will display the trackball.
Press Esc
again to return to the manipulating.
Note: During translation, rotation, and scaling, ensure that your trackball is hidden. They won't work if your trackball is shown, because you are moving the camera instead.
To exit the Manipulator
mode, click on this icon again:
Moving / Translation (back to Contents)
-
if you want to move only in 1 axis, press
X
,Y
orZ
, which will lock the movement to only theX
,Y
orZ
axis respectively.
Which displays this:Note: Idk what's the difference between global and local
X
/Y
/Z
. -
left-click, hold and drag to move the model. Hold shift if you want to snap to the nearest integer
-
once you're done moving, press
Enter
to apply the translation.
If you want to discard the changes, pressBackspace
-
(IMPORTANT) right-click the model's layer, select
Matrix: Freeze Current Matrix
, andApply
CAUTION: If you don't freeze the matrix, the translation, rotation and/or scaling will be reverted after you export the model.
Rotation (back to Contents)
-
if you want to rotate about an axis, press
X
,Y
orZ
, which will lock the rotation to only theX
,Y
orZ
axis respectively. -
if you want to rotated about the center of the model instead of the origin, press
Spacebar
, which will showRotate around BBox center
instead ofRotate around Mesh Origin
-
left-click, hold and drag to rotate the model. Hold shift if you want to snap to the nearest integer
-
once you're done rotating, press
Enter
to apply the rotation.
If you want to discard the changes, pressBackspace
-
(IMPORTANT) right-click the model's layer, select
Matrix: Freeze Current Matrix
, andApply
CAUTION: If you don't freeze the matrix, the translation, rotation and/or scaling will be reverted after you export the model.
Scaling (back to Contents)
-
if you want to scale in 1 axis only, press
X
,Y
orZ
, which will lock the scaling to only theX
,Y
orZ
axis respectively. -
if you want the scaling to be centered at the center of the model instead of the origin, press
Spacebar
, which will showScale around BBox center
instead ofScale around Mesh Origin
-
left-click, hold and drag to scale the model. Hold shift if you want to snap to the nearest integer
-
once you're done rotating, press
Enter
to apply the scaling.
If you want to discard the changes, pressBackspace
-
(IMPORTANT) right-click the model's layer, select
Matrix: Freeze Current Matrix
, andApply
CAUTION: If you don't freeze the matrix, the translation, rotation and/or scaling will be reverted after you export the model.