{"id":13445560,"url":"https://github.com/msteinbeck/tinyspline","last_synced_at":"2025-05-14T13:09:29.894Z","repository":{"id":21169952,"uuid":"24473646","full_name":"msteinbeck/tinyspline","owner":"msteinbeck","description":"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.","archived":false,"fork":false,"pushed_at":"2024-09-03T22:18:21.000Z","size":4528,"stargazers_count":1269,"open_issues_count":26,"forks_count":212,"subscribers_count":63,"default_branch":"master","last_synced_at":"2025-05-11T23:45:59.085Z","etag":null,"topics":["b-splines","bezier-curves","nurbs","splines"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msteinbeck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["msteinbeck"]}},"created_at":"2014-09-25T20:13:48.000Z","updated_at":"2025-05-09T09:17:39.000Z","dependencies_parsed_at":"2023-02-19T01:30:45.664Z","dependency_job_id":"e517c794-927e-40ef-b59e-576ffe974d54","html_url":"https://github.com/msteinbeck/tinyspline","commit_stats":{"total_commits":2277,"total_committers":26,"mean_commits":87.57692307692308,"dds":0.3952569169960475,"last_synced_commit":"0d523b9db865caa3e48029bd6ddfe45b6a4fc446"},"previous_names":["retuxx/tinyspline"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msteinbeck%2Ftinyspline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msteinbeck%2Ftinyspline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msteinbeck%2Ftinyspline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msteinbeck%2Ftinyspline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msteinbeck","download_url":"https://codeload.github.com/msteinbeck/tinyspline/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254149975,"owners_count":22022852,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["b-splines","bezier-curves","nurbs","splines"],"created_at":"2024-07-31T05:00:35.959Z","updated_at":"2025-05-14T13:09:24.875Z","avatar_url":"https://github.com/msteinbeck.png","language":"C","funding_links":["https://github.com/sponsors/msteinbeck"],"categories":["Graphics","Planning and Control","6. Planning"],"sub_categories":["Vector Map","3.4 High Performance Inference"],"readme":"TinySpline\n========\n\n![CI](https://github.com/msteinbeck/tinyspline/actions/workflows/ci.yml/badge.svg)\n![Security](https://github.com/msteinbeck/tinyspline/actions/workflows/codeql-analysis.yml/badge.svg)\n\nTinySpline is a small, yet powerful library for interpolating, transforming,\nand querying arbitrary NURBS, B-Splines, and Bézier curves. The core of the\nlibrary is written in ANSI C (C89) with a C++ wrapper for an object-oriented\nprogramming model. Based on the C++ wrapper, auto-generated bindings for C#, D,\nGo, Java, Javascript, Lua, Octave, PHP, Python, R, and Ruby are provided.\n\n### Table of Contents\n\n- [License](#license)\n- [Features](#features)\n- [Installation](#installation)\n  * [Pre-built Binaries](#pre-built-binaries)\n  * [Compiling From Source](#compiling-from-source)\n- [Getting Started](#getting-started)\n- [Documentation](#documentation)\n- [Publications](#publications)\n- [Theoretical Backgrounds](#theoretical-backgrounds)\n\n### License\nMIT License - see the LICENSE file in the source distribution.\n\n### Features\n\n- Object-oriented programming model\n- B-Splines of any degree and dimensionality\n- Spline interpolation\n  - Cubic natural\n  - Centripetal Catmull–Rom\n- Evaluation\n  - Knots\n  - Sampling (multiple knots at once)\n  - Equidistant points\n  - Components (find y for given x)\n- Reparametrization by arc length\n  - Mapping length \u003c--\u003e knot\n- Knot insertion (refinement)\n- Sub-spline extraction\n- Bézier curve decomposition\n  - (also known as subdivision)\n- Derivative\n- Degree elevation\n- Computation of rotation minimizing frames\n- Morphing\n- Serialization (JSON)\n- Vector math\n\n### Installation\n\n#### Pre-built Binaries\n\nReleases can be downloaded from the\n[releases](https://github.com/msteinbeck/tinyspline/releases) page. In\naddition, the following package manager are supported:\n\nConan (C/C++):  \nhttps://conan.io/center/tinyspline\n\nNuGet (C#):\n```xml\n\u003cPackageReference Include=\"tinyspline\" Version=\"0.6.0.1\" /\u003e\n```\n\nGo:\n```bash\ngo get github.com/tinyspline/go@v0.6.0\n```\n\nLuarocks (Lua):\n```bash\nluarocks install --server=https://tinyspline.github.io/lua tinyspline\n```\n\nMaven (Java):\n```xml\n\u003cdependency\u003e\n   \u003cgroupId\u003eorg.tinyspline\u003c/groupId\u003e\n   \u003cartifactId\u003etinyspline\u003c/artifactId\u003e\n   \u003cversion\u003e0.6.0-1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nPyPI (Python):\n```bash\npython -m pip install tinyspline\n```\n\nRubyGems (Ruby):\n```bash\ngem install tinyspline\n```\n\n#### Compiling From Source\n\nSee [BUILD.md](BUILD.md).\n\n### Getting Started\n\nA variety of examples (tests) can be found in the [test](test)\nsubdirectory.\n\nThe following listing shows a Python example:\n\n```python\nfrom tinyspline import *\nimport matplotlib.pyplot as plt\n\nspline = BSpline.interpolate_cubic_natural(\n  [\n     100, -100, # P1\n    -100,  200, # P2\n     100,  400, # P3\n     400,  300, # P4\n     700,  500  # P5\n  ], 2) # \u003c- dimensionality of the points\n\n# Draw spline as polyline.\npoints = spline.sample(100)\nx = points[0::2]\ny = points[1::2]\nplt.plot(x, y)\n\n# Draw point at knot 0.3.\nvec2 = spline.eval(0.3).result_vec2()\nplt.plot(vec2.x, vec2.y, 'ro')\n\n# Draw tangent at knot 0.7.\npos = spline(0.7).result_vec2() # operator () -\u003e eval\nder = spline.derive()(0.7).result_vec2().normalize() * 200\ns = pos - der\nt = pos + der\nplt.plot([s.x, t.x], [s.y, t.y])\n\n# Draw 15 normals with equidistant distribution.\nknots = spline.equidistant_knot_seq(15)\nframes = spline.compute_rmf(knots)\nfor i in range(frames.size()):\n    pos = frames.at(i).position\n    nor = pos + frames.at(i).normal * 20\n    # You can also fetch the tangent and binormal:\n    #     frames.at(i).tangent\n    #     frames.at(i).binormal\n    plt.plot([pos.x, nor.x], [pos.y, nor.y], 'g')\n\nplt.show()\n```\nResult:\n\n![Getting Started](res/getting_started.png)\n\n### Documentation\n\nThe latest Doxygen documentation can be found at:\nhttps://msteinbeck.github.io/tinyspline/\n\nThe documentation of the C interface\n(https://msteinbeck.github.io/tinyspline/tinyspline_8h.html) is quite\nextensive and also serves as an entry point for the C++ interface\ndocumentation (as well as the documentation for the bindings created\nfrom the C++ interface).\n\n### Publications\n\nIf you use TinySpline in your research, please cite it as below.\n\n```\n@INPROCEEDINGS{Steinbeck:SANER:21,\n  author =       {Steinbeck, Marcel and Koschke, Rainer},\n  booktitle =    {2021 IEEE International Conference on Software\n                  Analysis, Evolution and Reengineering (SANER)},\n  title =        {TinySpline: A Small, yet Powerful Library for\n                  Interpolating, Transforming, and Querying NURBS,\n                  B-Splines, and Bézier Curves},\n  year =         {2021},\n  pages =        {572-576},\n  doi =          {10.1109/SANER50967.2021.00068}\n}\n```\n\nOther publications:\n\n```\n@INPROCEEDINGS{Steinbeck:VISSOFT:22,\n  author =       {Steinbeck, Marcel and Koschke, Rainer},\n  booktitle =    {2022 Working Conference on Software Visualization\n                  (VISSOFT)},\n  title =        {Edge Animation in Software Visualization},\n  year =         {2022},\n  pages =        {63-74},\n  doi =          {10.1109/VISSOFT55257.2022.00015}\n}\n```\n\n### Theoretical Backgrounds\n[[1]](http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/B-spline/bspline-curve.html)\nis a very good starting point for B-Splines.\n\n[[2]](http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/B-spline/de-Boor.html)\nexplains De Boor's Algorithm and gives some pseudo code.\n\n[[3]](http://www.codeproject.com/Articles/996281/NURBS-curve-made-easy)\nprovides a good overview of NURBS with some mathematical background.\n\n[[4]](http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/NURBS/NURBS-def.html)\nis useful if you want to use NURBS in TinySpline.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsteinbeck%2Ftinyspline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsteinbeck%2Ftinyspline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsteinbeck%2Ftinyspline/lists"}