Rotation-Minimizing Frames
Builds a frame (tangent, normal, binormal) along a 3D curve that twists as little as possible, so tubes, ribbons and sweeps do not flip or spin. Computed with the double-reflection method.
In the family Geometry, meshing & signed distance fields, curve sweeps
Where it runs
Built inOfficial add-onPluginNone foundNot researched
| Engine | Support | How |
|---|---|---|
| three.js r187 | Built in | curve.computeFrenetFrames(segments, closed) docs Parallel-transport frames, used by TubeGeometry. |
| Babylon.js 9.38.0 | Built in | new BABYLON.Path3D(points) computes smooth tangent, normal, and binormal frames along a 3D curve docs |
| Godot 4.7 | Built in | Curve3D.up_vector_enabled = true (Curve3D::_bake computes a Parallel Transport Frame along baked points) docs |
| Unity | None found | Unity Splines provides tangent/up evaluation, not an explicit double-reflection rotation-minimizing frame API. |
| Unreal 5.7 | None found | |
| Blender 5.2 | None found | |
| WebGPU W3C | None found | |
| Metal | None found |
How it works
The Frenet frame uses curvature direction as the normal, which flips at inflection points and is undefined on straight segments. A rotation-minimizing frame keeps the normal as close to parallel transport as possible. The double reflection method does this iteratively from sampled points: given frame i with tangent t_i and normal r_i, reflect through the plane perpendicular to the chord between point i and i+1, then reflect again through the plane that maps the reflected tangent to the next tangent. The two reflections yield r_{i+1} with almost no extra twist and fourth-order accuracy. Closed curves need a residual twist correction distributed along the curve so the end frame matches the start. Sweeping a profile along these frames produces tubes and extrusions.
When to choose it
Reach for it when
- tube or ribbon along a curve twists or flips
- cables and roads spin unexpectedly along splines
- camera on a path rolls unpredictably
- need stable orientation for sweeping geometry along a curve
Choose it for tubes, cables, roads, plant stems and camera paths along a spline where you want stable orientation. Prefer a Frenet frame only for planar curves with consistent curvature, and an explicit up-vector or user-set twist keyframes when the artist needs control of roll, such as roller coaster rails.
Field marks
- Parallel transport accumulates twist on closed curves, leaving a seam unless corrected
- Frames are path-dependent: reversing the curve gives different frames
- Coarse sampling at high curvature loses accuracy
- Cannot satisfy a required roll such as a banked rail without a twist function
Presets
Rotation-minimizing frames (left) vs Frenet normals (right) along a space curve
{
"STEPS": 56,
"RIB": 0.07
}Show GLSL (42 lines)
// Frames along a space curve (orthographic view): left = double-reflection rotation-minimizing frame, right = Frenet normals.
const int STEPS = 56;
const float RIB = 0.07;
vec3 curve(float s) { return vec3(cos(s), sin(s), 0.55 * sin(3.0 * s)); }
vec3 tang(float s) { return normalize(vec3(-sin(s), cos(s), 1.65 * cos(3.0 * s))); }
vec3 acc(float s) { return vec3(-cos(s), -sin(s), -4.95 * sin(3.0 * s)); }
vec2 proj(vec3 p) { return vec2(p.x * 0.866 - p.y * 0.5, p.z * 0.9 + (p.x * 0.5 + p.y * 0.866) * 0.45); }
float segd(vec2 p, vec2 a, vec2 b) {
vec2 pa = p - a, ba = b - a;
return length(pa - ba * clamp(dot(pa, ba) / max(dot(ba, ba), 1e-6), 0.0, 1.0));
}
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
vec2 uv = fragCoord / iResolution.xy;
bool R = uv.x < 0.5;
vec2 q = (vec2(fract(uv.x * 2.0), uv.y) - 0.5) * 3.0 * vec2(1.0, 1.0) / 1.25;
float dc = 1e9, dr = 1e9; float hue = 0.0;
vec3 x0 = curve(0.0), t0 = tang(0.0);
vec3 r0 = normalize(cross(t0, vec3(0, 0, 1)));
vec2 prev = proj(x0);
for (int i = 1; i <= STEPS; i++) {
float s = 6.2831853 * float(i) / float(STEPS);
vec3 x1 = curve(s), t1 = tang(s);
vec3 v1 = x1 - x0; float c1 = dot(v1, v1);
vec3 rL = r0 - (2.0 / c1) * dot(v1, r0) * v1, tL = t0 - (2.0 / c1) * dot(v1, t0) * v1;
vec3 v2 = t1 - tL; float c2 = dot(v2, v2);
vec3 r1 = c2 > 1e-9 ? rL - (2.0 / c2) * dot(v2, rL) * v2 : rL;
vec3 a = acc(s); vec3 nf = normalize(a - dot(a, t1) * t1);
vec3 nn = R ? r1 : nf;
vec2 p1 = proj(x1);
dc = min(dc, segd(q, prev, p1));
float dd = segd(q, p1 - proj(nn * RIB), p1 + proj(nn * RIB));
if (dd < dr) { dr = dd; hue = float(i) / float(STEPS); }
prev = p1; x0 = x1; t0 = t1; r0 = r1;
}
vec3 col = vec3(0.05, 0.06, 0.09) + 0.03 * uv.y;
col = mix(col, vec3(0.8), smoothstep(0.012, 0.006, dc));
vec3 rc = 0.5 + 0.5 * cos(6.2831 * (hue + vec3(0.0, 0.33, 0.67)));
col = mix(col, rc, smoothstep(0.009, 0.005, dr));
col = mix(col, vec3(1.0), smoothstep(0.003, 0.0, abs(uv.x - 0.5)));
fragColor = vec4(pow(col, vec3(0.8)), 1.0);
}
Attribution: written for this index
Measured GPU weight & timing
| Preset | GPU | Weight / p50 / p95 | Method |
|---|---|---|---|
| rotation-minimizing-frames-specimen | Tesla T4 1920x1080 | 47.9× baseline (heavy) · 1.57 ms / 1.70 ms | opengl-timer-query · 40 frames · GPU Weight Atlas · Colab T4 sweep |
| rotation-minimizing-frames-specimen | NVIDIA L4 1920x1080 | 35.6× baseline (heavy) · 0.566 ms / 0.584 ms · 2.8× faster on L4 | opengl-timer-query · Cross-architecture validation |
| rotation-minimizing-frames-specimen | NVIDIA A100-SXM4-40GB 1920x1080 | 27.5× baseline (heavy) · 0.793 ms / 0.794 ms · 2.0× faster on A100 | opengl-timer-query · Cross-architecture validation |
Crosses
- Overgrown grammar cities: Ruins and old towns where vines follow what the building is: climbing drainpipes, hanging from ledges, avoiding glass. The grammar's semantic labels become growth guidance, and twist-free frames keep stems and leaves oriented.
- Marching Cubes: Sweep tubes into a volume or SDF and re-mesh with marching cubes for unions of tubes.
- Catmull-Clark Subdivision: The swept tube grid can be a subdivision cage.
Sources
- primaryWenping Wang, Bert Jüttler, Dayue Zheng, Yang Liu (2008). Computation of rotation minimizing frames. ACM Transactions on Graphics.Verified via crossref · 2026-11-29doi:10.1145/1330511.1330513
- implementationmrdoob (2010). mrdoob/three.js. JavaScript 3D Library.GitHub API · license MIT · 2026-11-29