Intuition

We simplify science for you

Rotation Minimizing Frames along 3d space curve.

Geometry

Lockdown Geometry: Rotation Minimizing Frames

Guido Maciocci
Intuition
Published in
4 min readAug 16, 2021

--

It turns out that implementing computational geometry algorithms is as good a way as any to pass the time in lockdown. Educational, productive, and one more thing to do after doing more pushups in one day than I would usually do in a week and practicing relentless pentatonic runs on the guitar as if I was preparing to headline a stadium gig!

Lately, I’ve been spending some spare time working on G-Shark, an open-source C# geometry library aimed at computational designers in AEC, co-authored by a good friend and colleague Mirco Bianchini, and Cesare Caoduro. The most recent issue I tackled was implementing a very useful algorithm in computational design, Rotation Minimizing Frames (RMF) on space curves. RMFs are perpendicular planes distributed along a space curve (e.g. a spline) such that the relative rotation between each plane and the subsequent one is minimized.

Why is this useful you ask? The first application that comes to mind is the construction of swept surfaces. Swept surfaces are constructed from a series of section profiles distributed and oriented along a curve. The profiles are themselves are constructed on planes perpendicular to the direction of the curve. To generate a proper swept surface without unexpected twisting, however, it is important that the rotation between each successive plane, and therefore between each section profile, is minimized such that the resulting sweep is smooth.

If you were to create planes along the curve from tangent vectors and vectors perpendicular to the tangent vectors, these would not account change in torsion and curvature of the curve. To demonstrate, below are one hundred frames are constructed along a 3d space curve. The frames are represented as 3 axis vectors:

  1. Curve tangent (red)
  2. Vector perpendicular to tangent (orange)
  3. Cross product of 1 and 2, i.e. vector perpendicular to the plane defined by 1 and 2 (blue)
Abrupt rotation changes in frames resulting from perpendicular vector construction.

The abrupt changes in direction are expected and demonstrate the necessity for constructing rotation minimizing frames. The video below shows the effects of this approach on a resulting swept surface created from a series of square section profiles aligned to the planes formed by the orange and blue axis vectors of the curve frames.

If we imagine those one hundred curve frames to be snapshots in time of a single frame as it moves along the curve, what we want to achieve is a smooth motion without any sudden rotations about the curve. This is where RMFs come into play.

There are quite a few algorithms that can be implemented to approximate RMFs including two popular methods; the projection method proposed by Klok[1986] and the rotation method by Bloomenthal[1990]. In researching the topic, however, I stumbled upon the Double Reflection Method [Wang, W., J¨uttler, B., Zheng, D., and Liu, Y. 2008]. A faster, more accurate, and simpler to implement the algorithm. Triple kill!

I implemented the algorithm as a function that takes a NURBS curve, and a list of curve parameters at which to create the rotation minimizing frames, and returns a collection of RMFs. Below is the same curve from before, again sampled at one hundred parameters, showing the resulting RMFs.

RMFs on curve, notice smooth rotational transition between frames and axis alignment.

Now that we have our RMFs all clean and tidy, we can generate a clean-swept surface with no twists using the section profiles. The video below shows the result. Notice, in contrast to the previous video, how the last frame rotates more and more as the number of samples increases and the rotation of all the frames is smoothed out.

Feel free to dig into the mathematical details, but the essence of the algorithm (and its namesake) involves generating the RMFs by two simple reflection operations on the axis vectors of an initial frame. The implementation itself requires only a handful of code, and the result is a beautifully smooth motion of the frame along the curve. If you’d like to have a look at the code, or use it in your own workflows, it has been implemented in C# and is freely available as part of the G-Shark library.

If you enjoyed this content, have any feedback or suggestions for future topics to cover, let me know in the comments below!

References

  1. Frenet-Serret frames
  2. Wang, W., J¨uttler, B., Zheng, D., and Liu, Y. 2008. Computation of rotation minimizing frame.
  3. KLOK, F. 1986. Two moving frames for sweeping along a 3D trajectory. Computer Aided Geometric Design 3, 1, 217–229.
  4. BLOOMENTHAL, J. 1990. Calculation of reference frames along a space curve. In A. Glassner Ed. Graphics Gems, Academic Press. New York, NY.

--

--

Guido Maciocci
Guido Maciocci

Written by Guido Maciocci

Technology, Strategy, and Product | AEC Industry Founder @ AecFoundry

No responses yet