I just wrote some classes for curve, still thinking/in-the-midst of implementing them in Path.
Basically, any line can subclass curve, for right now I have
Straight(Line)Curve, QuadraticBezierCurve, CubicBezierCurve, SplineCurve
Sub classes usually implements
getPoint: function ( t /* between 0 .. 1 */)
but inherits the common methods
getLength: function () {
getLengths: function (divisions) {
getPoint: function ( t /* between 0 .. 1 */) {
getPointAt: function ( u /* between 0 .. 1 */) {
getPoints: function (divisions) {
getSpacedPoints: function (divisions) {
getUtoTmapping: function (u, distance) {
soon, path.getPointAt(t) would call its curves getPointAt internally..
any thoughts or comments for this?
Nice one, now we can make procedurally generated amusement park entrances 😉