This commit bakes in a certain kind of representation for brush strokes:
c(t,s) = p(t) + R(theta(t)) b(t,s)
This representation allows us to cancel out some rotation terms when
computing the envelope equation, improving the efficiency of the
cusp-finding methods.
This commit makes it easier to switch between the 2-dim and 3-dim
formulations of the cusp-finding problem. This is still work in progress,
trying to improve the performance of the cusp-finding algorithms.
The code is now generic over the dimension. There is a slight performance
loss that I need to investigate; perhaps some things are not getting
specialised? Maybe it is better to be more explicit about staging and
splice in the functions with fixed dimensions.