Mesh cleanup changes topology after a 3D mesh result has been solved. Use it to correct invalid geometry, rebuild uneven triangles, increase resolution, or reduce polygon count.

Cleanup should address a measured problem. Do not remesh or repair a model simply because the operations are available; every rebuild can change edges, dimensions, or surface detail. This article follows Post-Processing in Rig Cad and completes the core modeling path from authored tree to final mesh.

The guide covers Repair, targeted intersection and tiny-triangle cleanup, Remesh, SDF Remesh, Refine, Subdivide, and Decimate.

Start with mesh diagnostics

Inspect the solved mesh before selecting an operation.

Metric What it indicates
Boundary edges Open boundaries or holes
Non-manifold edges or vertices Topology that cannot represent one unambiguous solid neighborhood
Inconsistent winding Faces oriented in conflicting directions
Degenerate triangles Collapsed or zero-area faces
Connected components Separate mesh islands
Triangle and vertex counts Geometry cost
Minimum edge length Sliver or micro-triangle risk

Viewport appearance is not sufficient. Compare topology statistics before and after every cleanup step.

Choose the least destructive operation

Problem First operation to consider
Holes, winding errors, degenerates, or unwanted islands Repair
Intersecting triangles Split Self-Intersections
Extremely short edges or micro-triangles Collapse Tiny Triangles
Uneven triangle size or poor distribution Remesh
Difficult topology needs a volumetric rebuild SDF Remesh
More surface resolution is required Refine or Subdivide
Triangle count is unnecessarily high Decimate

Apply one operation for one reason, then measure the result. A longer stack is not automatically a better mesh.

Repair mesh correctness

Repair is the general correctness pass. Auto Repair handles holes, winding, and degenerate faces together. Disable it when you need explicit control over individual actions.

Available targeted controls include:

  • Fill Holes for open boundaries;
  • Fix Winding for inconsistent face orientation;
  • Weld Vertices with a model-space epsilon;
  • Remove Degenerates for collapsed triangles;
  • Remove Islands below a triangle-count threshold; and
  • removal of enclosed islands or internal triangles.

Use the smallest weld epsilon that fixes the intended seam. An excessive value can merge nearby features that were meant to remain separate. Likewise, verify island removal against the object tree; a small disconnected component may be intentional.

Use targeted cleanup for specific defects

Split Self-Intersections divides triangles where the surface crosses itself so later repair or remeshing steps receive explicit topology. Enable diagnostics only when investigating the operation itself; verbose logging does not improve the mesh.

Collapse Tiny Triangles removes edges shorter than Length Threshold. The threshold is expressed in model-space units. Start near the measured minimum edge length and increase it only enough to remove the unwanted slivers.

These operations are narrower than Repair. Prefer them when the defect is known and the rest of the topology should remain untouched.

Rebuild topology when distribution is the problem

Operation Best use Primary controls
Remesh Produce a more uniform triangle distribution Edge Length, Iterations, split/collapse/flip edges, vertex shifting and projection
SDF Remesh Reconstruct difficult geometry through a volumetric grid Grid Precision, Smooth passes, reconstruction method, processor

For Remesh, smaller target edges preserve more detail and create more triangles. Vertex projection helps the rebuilt mesh follow the original surface. More iterations improve regularity but increase processing time.

SDF Remesh converts the surface through a sampled field and can resolve topology that direct repair cannot. Precision 0 selects Auto; smaller explicit values retain more detail and cost more time. FloodFill with LevelSet is the safest starting method. Expect fine edges to soften if the grid is too coarse or smoothing is excessive.

Increase resolution only when it is needed

Refine targets an edge length and can smooth the surface before subdivision. Use its sharp-angle and smoothness controls to prevent functional edges from being rounded unintentionally.

Subdivide splits edges longer than Max Edge Length. It adds triangles but does not perform the full edge redistribution of Remesh. Crease Angle keeps sharp transitions from being visually smoothed across.

Neither operation creates missing geometric detail. Additional triangles only provide more samples for a later deformation, smoothing pass, or export requirement.

Simplify with Decimate

Decimate reduces triangle count while limiting surface change.

  • Target Ratio is the fraction of triangles to retain; 0.5 targets half the original count.
  • Max Error stops reduction before deviation exceeds the allowed amount.
  • Crease Angle protects sharp features.
  • Flip Threshold rejects collapses that rotate a face too far.
  • Boundary Protection and Boundary Weight preserve open edges.

Begin with a conservative ratio and low error. Compare triangle count, bounds, sharp edges, and critical dimensions before reducing further. Decimate belongs near the end of the stack, after operations that require reliable source density.

Order the cleanup stack deliberately

A practical sequence is:

targeted defect cleanup → Repair → topology rebuild → density adjustment → Decimate

Examples:

  • Self-intersecting import: Split Self-Intersections → Repair → Remesh.
  • Noisy mesh with slivers: Collapse Tiny Triangles → Repair → Decimate.
  • Difficult invalid surface: Repair → SDF Remesh → Decimate.
  • Valid mesh needing more uniform triangles: Remesh alone may be sufficient.

Do not apply Refine or Subdivide immediately before Decimate unless an intermediate operation specifically needs the added resolution.

Interactive Sandbox
View project
Start with all three cleanup stages disabled to expose the high-resolution body and small disconnected island. Then enable Repair, Remesh, and Decimate in order while comparing topology and triangle count.
Explore the Mesh Cleanup LabInteractive Rig Cad editor

A focused cleanup pass

Use the embedded project to measure each stage:

  1. Select Mesh_Cleanup_Lab and disable repairOn, remeshOn, and decimateOn. Record the raw triangle count, connected components, and visible disconnected island.
  2. Enable repairOn. Verify that the unwanted island is removed and that the intended body remains one connected component. Adjust islandTriangleLimit to see why the removal threshold matters.
  3. Enable remeshOn. Compare triangle distribution, surface shape, bounds, and processing cost before and after the rebuild.
  4. Enable decimateOn. Reduce the target ratio conservatively and confirm that the required envelope and sharp features remain intact.
  5. Change remeshEdgeLength, remeshIterations, targetRatio, and maxError one at a time. Compare the same metrics after each edit.
  6. Restore the defaults and reset the article session when finished.

The correct result is not the mesh with the fewest triangles. It is the lightest valid mesh that preserves the required geometry.

Verify every cleanup result

Check Expected result
Solver status Settled with no processing failure
Bounds No unexplained size or placement change
Boundary edges Zero for a closed solid; intentional count for an open surface
Non-manifold counts Zero unless the representation deliberately permits them
Degenerate triangles Removed or reduced to the expected level
Connected components Matches the intended number of parts
Triangle count Appropriate for the required detail and downstream use
Sharp edges Preserved where they carry design intent

Inspect parameter extremes as well as the default state. A cleanup stack that works only for one configuration is not robust.

Mesh cleanup checklist

Before approving a cleanup stack, confirm:

  • each step addresses a specific measured defect or performance requirement;
  • the input is a compatible 3D mesh result;
  • tolerances and edge lengths use appropriate model-space units;
  • topology statistics improve rather than merely change;
  • functional edges and dimensions remain intact;
  • processing time is acceptable; and
  • the final triangle count matches the downstream requirement.

Next steps

This article completes the core path: editor operation, CSG structure, transforms, ordered post-processing, and final mesh validation. Return to Post-Processing in Rig Cad when the problem belongs earlier in the stack rather than in cleanup.

For volumetric reconstruction and field-defined geometry, continue with Signed Distance Fields: Geometry as a Function. When a validated project becomes a configurable product, use Beyond Sliders and the Parametric Goods overview.