houdini · vex
Fixing twist artifacts on the Sweep SOP
2026.06.10 — notes on vertex order and frame computation

The Sweep SOP builds its cross-section frames from the curve's tangent and an up-vector estimate. When neighboring frames flip relative to each other, you get a visible twist running along the surface. The example below shows the geometry before any fix, with the cross-section rotating sharply around the middle of the curve.

SWEEP_TWIST — BEFORE
fig 1 — untreated frame flip around parameter t = 0.5

why it happens

Houdini computes each frame independently from the previous one using a rotation-minimizing approach. On curves with sharp curvature changes, floating point drift causes the up-vector to flip sign between adjacent points.

// stabilize up-vector across points vector up = point(0, "up", @ptnum); vector prev_up = point(0, "up", @ptnum - 1); if (dot(up, prev_up) < 0) up *= -1; v@up = up;

Here's the same curve after re-aligning the up-vector per point so adjacent frames never flip relative to each other.

result

The fix is cheap, a single dot product comparison per point, but it removes the twist entirely without needing to manually place orientation points along the curve.

sweep sop vex rigging