Home > Degrafa > Degrafa Quadratic Spline Preview 1

Degrafa Quadratic Spline Preview 1

March 4, 2009

As development progresses on the Degrafa quadratic spline, I’ll post a few previews of how it works.  Once the code is released, I will post the test driver.  The non-interpolative path is finished; that is, the case where the spline passes through the first and last knots and its shape is influenced by interior knots.  The spline does not pass through the interior points unless the tension is set to 1.  Tension varies from 0 (loosest) to 1 (tightest).  At a tension of 1, the spline degrades into a sequence of straight lines connecting the knots.

In MXML, it’s easy to define the spline and its parameters,

<QuadraticSpline id="quadSpline" graphicsTarget="{[splineLayer]}"
  interpolates="false" tension="0" >
   <SolidStroke weight="2" color="#0000FF"/>

A screen shot is shown below.

Degrafa Quadratic Spline (non-interpolative)

Degrafa Quadratic Spline (non-interpolative)

I’ll probably start working on the interpolating code (where the spline passes through each knot regardless of tension) this weekend.  As I mentioned previously, the implementation is targeted towards applications where splines need to be drawn (or redrawn) very fast.  This spline creates a small number of lineTo and curveTo commands in the command stack and should draw very fast.

%d bloggers like this: