fcurve

0.0.3 • Public • Published

fcurve

Build Status Coverage Status npm npm

Blender uses bezier curves to control animations called FCurves. This library is a port of the evaluator. Given the same control point information, it should produce the same output (within a few points of numeric precision). This is verified by running Blender with the same curves and comparing the values. (⚠️ though we're not getting 100% code coverage yet)

Currently, only the bezier interpolation mode is fully supported.

In JS, FCurves should be represented like this:

{
  points: [
    {
      // point interpolation mode (only 'BEZIER' supported)
      interpolation: 'BEZIER',
      // (x, y) coordinate of point
      co: [10, 0],
      // (x, y) coordinate of left handle
      left: [-50, 0],
      // (x, y) coordinate of right handle
      right: [50, 0],
    },
    {
      interpolation: 'BEZIER',
      co: [120, -3],
      left: [70, -3],
      right: [170, -3],
    },
  ]
}

Readme

Keywords

none

Package Sidebar

Install

npm i fcurve

Weekly Downloads

1

Version

0.0.3

License

GPL

Last publish

Collaborators

  • chromakode