This is a simple algorithm that elabourates the line drawing of a cubic. It assumes the cubics are short and smooth. The curve is split into quarters: x0,y0 newqx,newqy newcx,newcy new3qx,new3qy.

Offsets inside (i) and outside (o) these points perpendicular to the local tangent give:

  • x0o,y0o x0i,y0i xqo, xqi, xco,xci x3qo, x3qi x3o, x3i and same for y
  • x0fo,y0fo x0fi,y0fi xqfo, xqfi, xcfo,xcfi x3qfo, x3qfi x3fo, x3fi and same for y
elabourate_cubic .

Figure 23.1: elabourate_cubic control points

The ones with f in the name are twice as far away as ones without.

Any special effect using these points replaces the original cubic. A few examples are provided. Inputs are the length of the offset (thick) and the type of elabouration

java -jar saxon6.jar  -o t5.xml t4.xml  library/elabourate_cubic.xsl thick=10 type=1
java -jar saxon6.jar  -o elabcubic.svg   t5.xml  library/back_to_svg.xsl mode=abs

It is assumed that the user will add types as required. The examples below are:

  • green: thick=10 type=1
  • blue: thick=8 type=2
  • red: thick=6 type=3
  • brown: thick=4 type=4

Figure 23.2: Examples of elabourate_cubic drawing

The curves in the Beijing 2008 Logo animation used an earlier version of this transformation.