Nodes/ComfyUI libigl/Sharpen Two Step (backend)
ComfyUI Node

Sharpen Two Step (backend)

The CAD-edge champ hiding in the dropdown

By PozzettiAndrea·Created 10 months ago·Updated 4 days ago· 218
Sharpen Two Step (backend)
  • trimesh
  • sharpened_mesh
  • info
smooth_steps3
normal_threshold60.0

If you've ever sharpened a photo in an editor, you know the gesture: pull out the edge, leave the flat areas alone. Sharpen Two Step does the same thing to a 3D mesh, and it's the GeometryPack backend the author explicitly points at for CAD-like geometry. Bolt head, bracket, mechanical part, anything with deliberate sharp bevels that came out of a generative model or a scan a little too rounded - this is the node.

It's a "backend" node, which means most people meet it through the Sharpen Mesh front node's dropdown (pick two_step). But you can also search "Sharpen Two Step (backend)" and drop it straight into a graph - the params are identical either way.

How it works

The name gives away the mechanism. Step one: smooth the normals of the mesh, not the positions, using bilateral normal filtering. That lets nearby faces that point in similar directions blend together while sharply-angled faces keep their identity. Step two: move the actual vertex positions so the surface matches those filtered normals. The result is a mesh whose flat regions get cleaner while the creases between them snap back to crisp lines.

The normal_threshold slider is the whole game. It's a dihedral angle in degrees - the angle between two adjacent faces. Edges whose dihedral angle is sharper than the threshold are treated as features and preserved; gentler ones get smoothed into the surrounding region. Default 60° works for most CAD parts. Drop it toward 0 and you tell the filter "almost everything is a crease," which preserves more detail but leaves more noise in. Crank it toward 180 and only truly flat surfaces get blended, which is a lot more aggressive.

Inputs and outputs

Only two knobs, which is refreshing:

  • trimesh - your input mesh (the pack's TRIMESH type).
  • smooth_steps (default 3, 1–50) - how many two-step passes to run. More passes = stronger sharpening, at the cost of slower execution and a slight risk of over-flattening. Start at 3, bump to 5–8 if the result is still soft.
  • normal_threshold (default 60, 0–180) - the dihedral crease threshold described above. Lower = more aggressive.

Outputs are sharpened_mesh (TRIMESH) and info (STRING) with backend diagnostics. Wire the mesh into a viewer or the pack's save node.

When to pick this over the others

Two Step is the safe default for hard-surface work. If your model is organic and lumpy, non_iterative or libigl_unsharp will treat it more gently; if you want true piecewise-flat plates for CAD prep, l0_minimize is the hammer. But when you just need a machine part to look machined again, this is the one. Install the pack via ComfyUI Manager (search "GeometryPack") or the manual git clone + pip install -r requirements.txt --upgrade + python install.py dance, and remember the installer's comfy-env/pixi setup is the usual source of first-run weirdness - let it finish before you judge the node.

Categorygeompack/smoothing

Inputs (3)

NameTypeDefaultDescription
trimeshTRIMESH
smooth_stepsINT31–50Number of two-step smoothing passes. More steps = stronger sharpening effect.
normal_thresholdFLOAT60.00–180Dihedral angle threshold in degrees. Edges sharper than this angle are preserved as features. Lower = more aggressive (more edges treated as creases). 60 is a good default for most CAD models.

Outputs (2)

NameTypeDescription
sharpened_meshTRIMESH
infoSTRING