← All tutorials · Renderloom

Tutorial 8 of 9

Measure and clean point clouds in Mesh Lab

Intermediate 8 min

Open a PLY or XYZ point cloud in Mesh Lab, read its size and point spacing, fit floors and walls with RANSAC, thin it on a voxel grid, estimate normals and export the result.

Mesh Lab also reads point clouds: PLY files without faces, and XYZ, CSV or PTS tables with x, y, z per line (optionally with colours and normals). It measures the cloud, removes stray points, thins it, estimates normals and fits planes — on your device, with the same engine as the Point Cloud Tools (PLY, XYZ) tool, so the numbers are identical. It does not turn points into a mesh.

Get a test cloud

Open the Point Cloud Tools (PLY, XYZ) tool page and choose the example Room corner: floor and two walls as three planes. Set Download the processed cloud as to XYZ text, calculate, and download corner-processed.xyz. It holds 700 points sampled from a floor and two walls, 2 m × 2 m each, with 3 mm noise.

Open it in Mesh Lab

Choose Mesh Lab in the toolbar and pick the file under Mesh file (STL, OBJ or PLY). Point clouds go to the Point cloud section instead of the mesh report; the status line reads 700 points read from corner-processed.xyz. You can also choose a .xyz or .pts file with Open in the toolbar.

The Input cloud table shows the bounding box (2.007 × 2.0094 × 1.9998), the centroid and the Nearest-neighbour spacing: median of 0.062159. The median spacing is the scan resolution; use it to choose voxel sizes and thresholds. Preview view switches between an isometric view and the top, front and side projections.

Fit the floor and the walls

Under Plane fit (RANSAC) set Number of planes to 3 and Inlier distance threshold (0 = automatic) to 0.02, then choose Fit plane. The status reads Plane fit finished: 241 inliers in the best plane. and the preview colours each plane's points.

The tables list each plane's equation, normal, inliers, RMS distance and tilt:

  • Plane 1 is the floor: tilt 0.052204°, 241 inliers, RMS distance 0.00313427.
  • Plane 2 and Plane 3 are the walls, tilted 89.999° and 89.974°.

The RMS distance is close to the 3 mm noise of the scan. Random seed fixes the random choices, so the same settings always give the same planes; with 0 as threshold, Mesh Lab uses 2.5 × the median spacing.

Clean and thin

Each action works on the current cloud, and Steps and export lists what you did.

  1. Under Clean and thin, set Voxel size to 0.1 and choose Downsample. The status reads 530 points in the working cloud. Each occupied 0.1 cube keeps one point at the centroid of its points.
  2. Remove outliers drops points whose mean distance to their Neighbours for outlier removal (k) is more than Standard deviation multiplier (α) standard deviations above average. Use it on real scans before downsampling.

Reset to the original cloud goes back to the file.

Normals

Under Normals, set Viewpoint x, y, z to 3, 3, 3 — a point inside the room, where a scanner would stand — and choose Estimate normals. The Normals table reports 12 neighbours, the number of normals flipped towards the viewpoint and the mean surface variation (0.0109577 here): near 0 on flat areas, higher along the edges where the walls meet. For scans of closed objects choose Away from the centroid (closed objects) under Normal orientation.

Export

Download PLY writes a binary PLY with double-precision coordinates, normals and colours when present; Download XYZ writes a text table with a # x y z … header. Both open in other point-cloud software and in the Point Cloud Tools page.

Ready to try it?

Launch Renderloom →