msteinbeck/tinyspline logo

msteinbeck/tinyspline

Free

ANSI C library for NURBS, B-Splines, and Bézier curves with interfaces for C++, C#, D, Go, Java, Javascript, Lua, Octave, PHP, Python, R, and Ruby.

FreeFree tier
Type
Open Source

About msteinbeck/tinyspline

TinySpline is a small, powerful library for interpolating, transforming, and querying NURBS, B-Splines, and Bézier curves. Written in ANSI C (C89) with a C++ wrapper, it provides auto-generated bindings for C++, C#, D, Go, Java, JavaScript, Lua, Octave, PHP, Python, R, and Ruby. Features include spline interpolation (cubic natural, centripetal Catmull-Rom), evaluation, knot insertion, Bézier decomposition, derivative, degree elevation, rotation minimizing frames, morphing, and JSON serialization. It is distributed under the MIT license and can be installed via package managers like Conan, NuGet, PyPI, and more.

Key Features

Object-oriented programming model for spline manipulation
Supports B-Splines of any degree and dimensionality
Spline interpolation: cubic natural and centripetal Catmull-Rom
Evaluation, knot manipulation, and sampling (including equidistant points)
Knot insertion for refinement and sub-spline extraction
Bézier curve decomposition (subdivision) and degree elevation
Derivative computation and computation of rotation minimizing frames
Morphing and serialization (JSON) support
Vector math utilities included
Multi-language bindings for C++, C#, D, Go, Java, JavaScript, Lua, Octave, PHP, Python, R, and Ruby

Pros & Cons

Pros
  • Small footprint and high performance due to ANSI C core
  • Extensive multi-language support through auto-generated bindings
  • Comprehensive feature set for spline manipulation (NURBS, B-Splines, Bézier)
  • MIT open-source license allows free use and modification
  • Available via popular package managers (Conan, NuGet, PyPI, RubyGems, Maven, etc.)
Cons
  • Primarily focused on spline mathematics; lacks higher-level graphics rendering features
  • Documentation may be limited to examples and code comments

Best For

Computer-aided design (CAD) and modelingAnimation and graphics path interpolationScientific and numerical computing with splinesData interpolation and curve fitting

FAQ

What programming languages does TinySpline support?
TinySpline provides bindings for C++, C#, D, Go, Java, JavaScript, Lua, Octave, PHP, Python, R, and Ruby, in addition to its core ANSI C and C++ interfaces.
How can I install TinySpline?
Pre-built binaries are available on the releases page. It can also be installed via package managers such as Conan (C/C++), NuGet (C#), PyPI (Python), RubyGems, Maven (Java), and others.
What license does TinySpline use?
TinySpline is distributed under the MIT License.
Does TinySpline support NURBS curves?
Yes, TinySpline supports arbitrary NURBS, B-Splines, and Bézier curves.