Keyframe reduction is a python library written in C. The main function of the database is to obtain a small number of control points and to fit complex curves.
- Build:
$ git clone https://github.com/Realibox/KeyRed.git
$ cd KeyRed
$ python setup.py build
- Install the library
$ python setup.py install
- run test script:
$ python test_simplify.py
.
Usage:
import animation
from math import *
data = []
n = 512
error = 0.05
for t in [x * 2 * pi / n for x in range(n + 1)]:
data.append((t, sin(t)))
out = animation.simplify(data, error)
for i in list(range(len(out))):
print(out[i])