Mesh Processing Algorithms

Repair, combine and optimize triangle meshes

MeshLib covers the whole life of a triangle mesh: repair what the scanner or the export broke, combine and compare parts, then simplify and offset the result for printing, machining or visualization. One SDK for C++, Python, C# and C.

Repair and clean meshes

Repair mesh defects before any other operation.

Mesh Healing

Mesh healing repairs holes and topology defects to prepare a mesh for the rest of the 3D pipeline: simulation, printing and analysis.

Discover more

Fill Holes

Hole filling corrects topological defects: missing regions where a continuous surface is expected.

Discover more

Mesh Smoothing

Smoothing algorithms reposition vertices to reduce noise and improve surface quality.

Discover more

Combine and compare meshes

Boolean operations, exact common volumes and collision checks between models.

Mesh Boolean

Union, intersection and difference of two 3D objects, used to reshape their geometry.

Discover more

Mesh Intersection

Mesh intersection computes the exact common volume shared by two polygonal models.

Discover more

Collision Detection

Collision detection determines whether two or more objects intersect.

Discover more

Simplify and reshape meshes

Reduce triangle counts and control wall thickness without losing the shape.

Mesh Simplification

Mesh simplification, also called decimation, reduces the number of triangles in a 3D model.

Discover more

Mesh Offsetting

Mesh offsetting expands or contracts a mesh surface by a set distance, for example to control wall thickness for 3D printing.

Discover more

Mesh boolean in Python and C++

Every mesh algorithm follows the same pattern: load, call one function, save. The same API is available in C# and C.

from meshlib import mrmeshpy as mm

a = mm.loadMesh("part_a.stl")
b = mm.loadMesh("part_b.stl")
result = mm.boolean(a, b, mm.BooleanOperation.Union)
if result.valid():
    mm.saveMesh(result.mesh, "union.stl")
// error handling of load and save omitted for brevity
auto a = MR::MeshLoad::fromAnySupportedFormat( "part_a.stl" );
auto b = MR::MeshLoad::fromAnySupportedFormat( "part_b.stl" );
auto result = MR::boolean( *a, *b, MR::BooleanOperation::Union );
if ( result.valid() )
    MR::MeshSave::toAnySupportedFormat( result.mesh, "union.stl" );
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

Mesh processing FAQ

What is mesh processing?

Mesh processing is the set of algorithms that repair, combine, simplify and reshape polygonal 3D models: mesh healing and hole filling, boolean operations, intersection and collision checks, decimation and offsetting.

Which programming languages does MeshLib support?

MeshLib is written in C++ and has bindings for Python, C# and C. It also runs in the browser through JavaScript and WebAssembly.

Can MeshLib repair a broken mesh before a boolean operation?

Yes. Run mesh healing and hole filling first, then the boolean. Our article on mesh repair for boolean operations walks through it.

Can I try MeshLib without installing it?

Yes. The MeshLib live demo runs in the browser with no registration and covers booleans, mesh repair, decimation and more.