ComfyUI Node

MeshFix

The one-click-ish mesh doctor for wrecked scans

By PozzettiAndrea·Created 10 months ago·Updated 4 days ago· 218
MeshFix
  • input_mesh
  • repaired_mesh
  • info
remove_small_componentstrue
join_componentsfalse
fill_holestrue
max_hole_edges0
refine_holestrue
clean_meshtrue
clean_iterations10
inner_loops3

MeshFix is the pack's "just make it watertight" node, built on the classic MeshFix algorithm by Marco Attene (via the pymeshfix wrapper). Photogrammetry scans come out broken in every way at once - holes, floating fragments, self-intersections, degenerate triangles. This node runs the whole cleanup in one pass: strip small junk, join nearby pieces, fill holes, and clear out self-intersections. It's the node you reach for before you've even decided what's actually wrong.

What it actually does

The defaults do a sensible full sweep:

  • remove_small_components (default true) - deletes isolated fragments.
  • join_components (default false) - attempt to stitch nearby disconnected parts together. Off by default, because joining things is riskier than deleting; turn it on when you know the pieces belong together.
  • fill_holes (default true) - close boundary holes, with max_hole_edges (default 0 = fill everything) and refine_holes (default true) for better triangulation on the patches.
  • clean_mesh (default true) - remove self-intersections and degenerate faces, with clean_iterations (default 10) and inner_loops (default 3) controlling how hard it works.

Outputs are repaired_mesh (TRIMESH) and an info report. The info string is worth reading - it tells you how many holes were closed and faces removed, which is how you know whether the fix actually bit.

Why it beats the single-purpose repair nodes

The pack has specialist fixers - Fill Holes (six backends), Fix Self Intersections (Removal), Fix Normals. MeshFix is the shotgun instead of the scalpel: fewer knobs, broader coverage, and it handles the common case of "I have no idea what's wrong, just fix it." For a scan that needs to be printable or boolean-able, run MeshFix first, then check the result in Preview Mesh, then reach for a specialist only if something specific survived. That's the workflow the pack's author points new users toward in the release thread - repair, then inspect.

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/PozzettiAndrea/ComfyUI-GeometryPack.git
cd ComfyUI-GeometryPack
pip install -r requirements.txt --upgrade
python install.py

Or ComfyUI Manager → GeometryPack → Install, restart. pymeshfix is a main-env dependency - lighter than the Blender/CGAL side of the pack.

Where people get burned

MeshFix is not magic. Truly catastrophic input - giant overlapping regions, zero manifold structure - can produce a result that's watertight but geometrically wrong (pinched, warped, or features flattened). Check the viewer before you trust it. And join_components is the setting people flip on out of hope and regret: joining what shouldn't be joined welds unrelated parts together with ugly bridges. Start with it off, turn it on only when you know the pieces are one object. This pack is young - a fast-moving author means update before you debug.

Categorygeompack/repair

Inputs (9)

NameTypeDefaultDescription
input_meshTRIMESH
remove_small_componentsoptCOMBOtrueRemove small isolated mesh fragments before repair
join_componentsoptCOMBOfalseAttempt to join nearby disconnected components
fill_holesoptCOMBOtrueFill boundary holes in the mesh
max_hole_edgesoptINT00–10000Max edges for holes to fill. 0 = fill all holes regardless of size
refine_holesoptCOMBOtrueRefine triangulation when filling holes for better quality
clean_meshoptCOMBOtrueRemove self-intersections and degenerate faces
clean_iterationsoptINT101–100Max iterations for self-intersection removal
inner_loopsoptINT31–10Inner loops per clean iteration

Outputs (2)

NameTypeDescription
repaired_meshTRIMESH
infoSTRING