Home > Degrafa > Degrafa – Introduction to Splines Part VI

Degrafa – Introduction to Splines Part VI

December 9, 2008

Continuing from Part V, there are a couple points to clear up about arc-length parameterization. First and foremost, a spline’s parameterization does not affect the way the spline is drawn.  Eventually, you will be able to choose between uniform and arc-length parameterization for the Degrafa cubic Bezier spline.  Each selection draws the exact same spline through a given set of knots.

The spline’s parameterization does affect how sprites are distributed along the curve.  A common mistake is to assume that t = 0.5 automatically places a sprite exactly halfway along the length of any parametric curve.  This is generally not true for any parameteric curve, splines included.   In order to achieve such a result, the curve must be re-parameterized on arc length.  There are numerous online demos and TechNotes discussing these topics here.

Arc-length parameterization is a necessity for any application involving uniform distribution of other graphic assets along a spline path.  This is why I can not move any work I’ve done on path-deforming text along a spline to Degrafa until arc-length parameterization is available.  As mentioned in the prior post, this will require enhancements to the Degrafa cubic Bezier class.

Another topic of interest in creating graphical assets using splines is that of closed shapes.  It is tempting to think that a shape can be closed simply by adding an additional knots whose coordinates are the same as the first knot.  While this does formally close the outline, it does not address the issue of continuity at the closure.

A lot of work is involved in matching in- and out-tangents at each join.  Closing the spline essentially adds another join.  Fortunately, the Singularity spline that is being ported to Degrafa in phases has support for automatic closure in a manner that preserves the smoothness of the spline through all knots.  Spline closure is illustrated in this post.

Notice how the control points for each individual cubic Bezier curve are constructed.  The automatic closure adds the additional point to the knot set and computes Bezier control points to properly match tangent directions.  It should be pointed out that the algorithm is ‘reactive’ in the sense that it just closes the shape.  The out-tangent for the first knot is computed as if there were no closure.  When the algorithm gets to the final knot, it is forced to match that direction with the in-tangent to the final control point (which is a duplicate of the first knot).  There is no attempt to ‘balance’ the tangent directions based on a closed loop.

In the next post, we will finally get to the fun part; actually drawing a spline using MXML.

Categories: Degrafa Tags: , , ,
  1. Daniel
    December 9, 2008 at 2:45 pm

    Hello Jim

    Your series on Splines in Degrafa is a great read. I am taking an introductory course to computer graphics and it’s nice to see your perspective on the topic.

    Looking forward to more on this.


    • December 9, 2008 at 4:59 pm


      Best of luck with your studies!

      – jim armstrong

  1. December 10, 2008 at 10:22 am
Comments are closed.
%d bloggers like this: