Point Cloud Processing Library for C++ and Python

From raw scans to a usable 3D model

MeshLib takes point clouds from LiDAR and 3D scanners through every step to a finished model: import, clean, sample, estimate normals, align scans with ICP and reconstruct a triangle mesh. One SDK for C++, Python, C# and C.

Point cloud algorithms in MeshLib

Point Cloud to Mesh

Point cloud triangulation turns a set of 3D points captured by LiDAR or other scanning technologies into a continuous triangle mesh.

Discover more

Mesh Triangulation

Mesh triangulation converts point clouds into triangle meshes quickly, using vertex normals to guide the surface.

Discover more

ICP: Iterative Closest Point

ICP aligns two 3D datasets: it takes a source point cloud or mesh and estimates the rigid transformation that places it onto the target.

Discover more

How does MeshLib process a point cloud?

A typical scan-to-model pipeline has six steps. Each one is a MeshLib function you can call on its own or chain with the others.

  1. Import scans

    Load point clouds from E57, LAS, LAZ, PLY, PTS, XYZ, XYZN, ASC, CSV, OBJ and DXF files.

    PointsLoad::fromAnySupportedFormat

  2. Remove outliers and sample

    Find stray points far from the surface, then thin dense scans with uniform or grid sampling to keep the detail you need at a size you can process.

    findOutlierspointUniformSamplingpointGridSampling

  3. Estimate and orient normals

    Raw scans usually come without normals. MeshLib computes them and orients them consistently, which reconstruction and point-to-plane registration depend on.

    makeOrientedNormalsorientNormals

  4. Align scans with ICP

    Register overlapping scans with point-to-point or point-to-plane ICP, or align many scans at once with multiway ICP. ICP is a local refinement: it starts from a rough initial placement of the scans.

    ICPMultiwayICP

  5. Reconstruct a mesh

    Triangulate the points directly, or fuse them through a voxel grid to get a single surface from overlapping scans.

    triangulatePointCloudpointsToMeshFusion

  6. Measure and compare

    Compute distances between point clouds and meshes to check a scan against a reference model.

    findMaxDistanceSqfindSignedDistances

Which point cloud formats does MeshLib read?

Laser scanner and LiDAR formats load directly, without a conversion step.

  • E57
  • LAS
  • LAZ
  • PLY
  • PTS
  • XYZ
  • XYZN
  • ASC
  • CSV
  • OBJ
  • DXF
All file formats supported by MeshLib

Point cloud to mesh in Python and C++

Three calls take a scan from a file to a triangle mesh. The same API is available in C# and C.

from meshlib import mrmeshpy as mm

cloud = mm.loadPoints("scan.ply")
mesh = mm.triangulatePointCloud(cloud)
mm.saveMesh(mesh, "scan_mesh.ply")
// error handling omitted for brevity
auto cloud = MR::PointsLoad::fromAnySupportedFormat( "scan.ply" );
auto mesh = MR::triangulatePointCloud( *cloud );
MR::MeshSave::toAnySupportedFormat( *mesh, "scan_mesh.ply" );
More code samples in the documentation

Try MeshLib now

Booleans, mesh repair, decimation and ICP — in your browser, as JavaScript and WebAssembly. No install, no sign-up.

Open live demo

Or install the SDK — free to evaluate

Setup guide · binaries or CMakeSetup guide · binaries, MeshLibC2

Point cloud processing FAQ

What is point cloud processing?

Point cloud processing is the set of operations that turn raw 3D scan points into usable data: loading the scan, removing outliers, sampling, estimating normals, aligning several scans and reconstructing a mesh surface.

Can MeshLib convert a point cloud to a mesh?

Yes. MeshLib triangulates point clouds directly with triangulatePointCloud and can also fuse overlapping scans through a voxel grid with pointsToMeshFusion. See Point Cloud to Mesh.

Which point cloud formats does MeshLib support?

MeshLib reads E57, LAS, LAZ, PLY, PTS, XYZ, XYZN, ASC, CSV, OBJ and DXF point clouds. The full list is on the file formats page.

Does MeshLib register (align) 3D scans?

Yes. MeshLib aligns scans with point-to-point and point-to-plane ICP and aligns many scans at once with multiway ICP. Point-to-plane ICP needs normals, so compute them first if the scan has none. See ICP.

Can I use MeshLib for point clouds in Python?

Yes. The Python package exposes the same point cloud functions as the C++ core; install it with pip install meshlib.