This is a simple transformation that changes lines to cubics. The transformation is useful if a line drawing needs to be animated into a curved drawing.

Each line command from (x1,y1) to (x2,y2) is converted to a cubic curve where:

  • Initial point is (x1,y1)
  • First control point is (0.6667x1+0.3333x2,0.6667y1+0.3333y2)
  • Second control point is (0.3333x1+0.6667x2,0.3333y1+0.6667y2)
  • Final point is (x2,y2)

In the example below, an arc has been converted to four cubics using remove_arc and the four lines have been converted to cubics. It is then possible to animate between the two in SVG as the structure of the two paths is the same.

No SVG Support

Figure 15.1: Animate arc to lines