Fix Normals IGL BFS (backend)
When half your mesh is inside-out, this fixes it
- trimesh
- fixed_mesh
- info
A mesh with inconsistent normals is a mesh where some faces point out and some point in. It renders with black splotches, boolean operations misbehave, and slicers get confused. Fix Normals IGL BFS is the hidden backend behind the igl_bfs option in the pack's Fix Normals front node, and it does one thing: makes every face agree on which way is out.
How it works
It calls igl.bfs_orient - libigl's breadth-first search over the face adjacency graph. Starting from a seed face, it propagates orientation across shared edges, flipping any face that disagrees with its neighbor. When it's done, all faces point consistently. The node's own info output is admirably honest about the limits: "BFS makes faces consistent but doesn't determine inside/outside." Translation: it fixes the rendering problem, but it can't tell whether the whole mesh should have been flipped in the first place. For that you'd want a signed-distance or winding-number approach - the front node's igl_winding and igl_signed_dist backends exist precisely for that.
The inputs are minimal: just trimesh. Outputs are fixed_mesh (TRIMESH) and an info report showing orientation consistency before/after and how many orientation components were found - multiple components means disconnected regions, each fixed independently.
When to use it
Anytime a mesh "looks wrong" in the viewer - dark faces, weird shading, holes that seem to be facing away from you. It's the cheapest fix in the repair toolkit, pure geometry, no remeshing, no topology change. Run it before booleans, before printing, and it'll save you a class of confusing failures downstream. It's also genuinely fast - BFS orientation is one of the lighter operations in libigl.
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. Needs libigl, which the pack installs in the main environment - nothing exotic for this particular backend.
Where people get burned
Expecting it to "flip the whole mesh." If the entire object is consistently inward (a classic failure from certain reconstruction pipelines), BFS will cheerfully report "consistent" and leave it inside-out, because consistency and correctness aren't the same thing. Check the info line: if it says consistent but the viewer still looks hollow, you've got a whole-mesh flip, and you want the winding/signed-distance backend instead. And per the usual pack pattern: old saved workflows with stale combo values can fail validation - re-pick the backend and re-save before tearing your hair out.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| trimesh | TRIMESH | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| fixed_mesh | TRIMESH | — |
| info | STRING | — |