{"id":15047368,"url":"https://github.com/arkaht/cpp-curve-x","last_synced_at":"2026-04-01T17:19:16.417Z","repository":{"id":235891003,"uuid":"791375610","full_name":"arkaht/cpp-curve-x","owner":"arkaht","description":"Curve-X ─ a small and easy-to-use C++ Bézier library to create 2D-splines with its own GUI editor.","archived":false,"fork":false,"pushed_at":"2024-05-22T21:37:03.000Z","size":71,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-28T00:37:07.973Z","etag":null,"topics":["bezier","cmake","cpp","cpp11","cpp14","cpp17","cpp20","curve","library","spline"],"latest_commit_sha":null,"homepage":"https://guthen.itch.io/curve-editor-x","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/arkaht.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-24T15:53:20.000Z","updated_at":"2025-08-01T11:29:20.000Z","dependencies_parsed_at":"2024-05-13T22:23:54.043Z","dependency_job_id":"7985fb21-59a6-4550-8c4e-41d33f1c7c4b","html_url":"https://github.com/arkaht/cpp-curve-x","commit_stats":null,"previous_names":["arkaht/cpp-curve-x"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arkaht/cpp-curve-x","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arkaht%2Fcpp-curve-x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arkaht%2Fcpp-curve-x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arkaht%2Fcpp-curve-x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arkaht%2Fcpp-curve-x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arkaht","download_url":"https://codeload.github.com/arkaht/cpp-curve-x/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arkaht%2Fcpp-curve-x/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31290537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bezier","cmake","cpp","cpp11","cpp14","cpp17","cpp20","curve","library","spline"],"created_at":"2024-09-24T20:57:12.314Z","updated_at":"2026-04-01T17:19:16.399Z","avatar_url":"https://github.com/arkaht.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Curve-X\n**Curve-X is a small and easy-to-use C++ Bézier library to create 2D-splines with its own GUI editor.**\n\n*If you are a game developer working on your own C++ game or engine and you want to have fine control over your values (let's say: gamepad sensitivity, dynamic FOV depending on the player's speed, gravity force, particle effects, animations, etc.) for the sake of game feel, this project may interests you.*\n\nCurve-X allows to create 2D-splines, either they are intended to be geometrical shapes or for timed-based values. It is simple of usage yet allows a lot of manipulation. The code is also well-documented: each class, functions and enums are properly described.\n\nBy default, the project is built for C++17, yet it is compatible with the versions specified in [Dependencies](#dependencies).\n\nThis project is still under development, feel free to raise [issues](https://github.com/arkaht/cpp-curve-x/issues) as you encounter them.\n\n## Dependencies \n+ C++11, 14, 17 or 20 compiler\n+ CMake 3.11 is optional\n\n## Features\n+ **Carefully well-documented code for classes, functions and enums**\n+ Written in **simple and straightforward C++17** using **snake_case** notation\n+ Project IDE-independent thanks to **CMake**\n+ **Custom [GUI editor](https://github.com/arkaht/cpp-curve-editor-x) to easily create and edit curve files**\n+ Support for both geometrical shapes and timed-based curves\n+ Multiple evaluation methods: progress (from 0.0 to 1.0), time (using X-axis) and distance.\n+ **Embedded curves serialization and un-serialization methods**\n+ Custom and human-readable text format for curves serialization\n+ **Free and open-source**\n\n![image](https://github.com/arkaht/cpp-curve-x/assets/114919245/a32a058e-9ba1-4add-89f0-de4ad0f14434)\n\u003e Two examples: a geometrical shape curve ([`samples/heart.cvx`](https://github.com/arkaht/cpp-curve-x/blob/master/samples/heart.cvx)) and a timed-based curve ([`samples/controller-gamepad-sensitivity.cvx`](https://github.com/arkaht/cpp-curve-x/blob/master/samples/controller-gamepad-sensitivity.cvx)) from the [GUI editor](https://github.com/arkaht/cpp-curve-editor-x)\n\n## Project Structure\nThis project is split into two Github repositories: the library (this one) and the [GUI editor](https://github.com/arkaht/cpp-curve-editor-x). You are not forced to use the editor, it is entirely optional but it is here to facilitate your experience with Curve-X.\n\n**Folder structure:**\n+ **`include/curve-x/`** contains header files that you, as the library user, want to use inside your project. The most important one is `curve.h`, containing all required definitions to start using the library. If you want to have a deep-dive into the code, I'd recommend you to check the header files in this order: `point.h`, `utils.h`, `key.h`, `curve.h` and finally `curve-serializer.h`. \n+ **`src/`** contains source files and implementations of the header files located in the folder `include/curve-x/`.\n+ **`tests/`** contains source files for testing and usage examples. You may want to look at it to better understand how to use the library. \n+ **`samples/`** contains samples of curve files generated by the library. You can import these inside the [GUI editor](https://github.com/arkaht/cpp-curve-editor-x) or in your code for testing. It's also here so you can get a grasp of what the text format is.\n\n## Code Example\nFrom [`tests/simple_example.cpp`](https://github.com/arkaht/cpp-curve-x/tree/master/tests/simple_example.cpp):\n```cpp\n//  Includes all necessary code including the Curve class\n#include \u003ccurve-x/curve.h\u003e\n//  Includes the CurveSerializer class, only if you want to import or export\n//  the curves data from or to files\n#include \u003ccurve-x/curve-serializer.h\u003e\n\n//  Includes std::ofstream to output the curve data to files \n#include \u003cfstream\u003e\n\nint main()\n{\n\t//  Initialize a curve object\n\tcurve_x::Curve curve;\n\n\t//  Add two keys with different control points\n\tcurve.add_key( curve_x::CurveKey( { 0.0f, 0.0f } ) );\n\tcurve.add_key( curve_x::CurveKey( { 1.0f, 1.0f } ) );\n\n\t//  Evaluate the curve at x=0.3f\n\tfloat time = 0.3f;\n\tfloat value = curve.evaluate_by_time( time );\n\tprintf( \"Evaluation for x=%f: y=%f\\n\\n\", time, value );\n\t//  Output:\n\t//  Evaluation for x=0.300000: y=0.216000\n\n\t//  Serialize the curve into a string\n\tcurve_x::CurveSerializer serializer;\n\tstd::string data = serializer.serialize( curve );\n\tprintf( \"Curve serialized data:\\n%s\\n\", data.c_str() );\n\t//  Output:\n\t//  Curve serialized data:\n\t//  version:1\n\t//  0:x=0.000000;y=0.000000,x=-1.000000;y=0.000000,x=1.000000;y=0.000000,0\n\t//  1:x=1.000000;y=1.000000,x=-1.000000;y=0.000000,x=1.000000;y=0.000000,0\n\n\t//  Write the serialized curve into a file\n\tstd::ofstream file( \"my_curve.cvx\" );\n\tfile \u003c\u003c data;\n\tfile.close();\n}\n```\n\nFor more examples, look at the [`tests/`](https://github.com/arkaht/cpp-curve-x/tree/master/tests) folder.\n\n## Getting Started\nThis project is built using **CMake 3.11**. However, with proper setup it is not required to add it inside your projects.\n\n### Add Curve-X to your project\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eWith CMake\u003c/b\u003e\u003c/summary\u003e\n\n1. Clone `arkaht/cpp-curve-x` or [download the ZIP](https://github.com/arkaht/cpp-curve-x/archive/refs/heads/master.zip) and extract it\n2. Move the `curve-x` folder inside your project libraries folder, for example: \n\n```\n\u003cyour_project\u003e/\n├── libs/\n│   ├── curve-x/\n│   │   ├── include/\n│   │   │   └── ...\n│   │   ├── src/\n│   │   │   └── ...\n│   │   ├── CMakeLists.txt\n│   │   └── ...\n│   └── ...\n├── main.cpp\n├── CMakeLists.txt\n└── ...\n```\n3. Optionally, delete folders that aren't required for your project such as `samples/` and `tests/`.\n4. In `\u003cyour_project\u003e/CMakeLists.txt`:\n+ Use `add_subdirectory` with the library's path to include it:\n```cmake\nadd_subdirectory(\"libs/curve-x\")\n```\n+ Link the library to your project with `target_link_libraries`:\n```cmake\ntarget_link_libraries(\u003cyour_project_target\u003e PRIVATE curve-x \u003cyour_project_libs\u003e)\n```\n5. In your code, use the library, for example in your `main.cpp`:\n```cpp\n#include \u003ccurve-x/curve.h\u003e\n\n// ...\n\nint main()\n{\n\tcurve_x::Curve curve;\n\n\t// ...\n}\n```\n6. Compile and run your project, you're ready to go!\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eWithout CMake\u003c/b\u003e\u003c/summary\u003e\n\n1. Clone `arkaht/cpp-curve-x` or [download the ZIP](https://github.com/arkaht/cpp-curve-x/archive/refs/heads/master.zip) and extract it\n2. Move the `curve-x` folder inside your project libraries folder, for example: \n```\n\u003cyour_project\u003e/\n├── libs/\n│   ├── curve-x/\n│   │   ├── include/\n│   │   │   └── ...\n│   │   ├── src/\n│   │   │   └── ...\n│   │   └── ...\n│   └── ...\n├── main.cpp\n└── ...\n```\n3. Optionally, delete folders that aren't required for your project such as `samples/` and `tests/`.\n4. Add an additional include directory at `libs/curve-x/include/`.\n5. Add the source files at `libs/curve-x/src/*.cpp` to be compiled.\n5. In your code, use the library, for example in your `main.cpp`:\n```cpp\n#include \u003ccurve-x/curve.h\u003e\n\n// ...\n\nint main()\n{\n\tcurve_x::Curve curve;\n\n\t// ...\n}\n```\n6. Compile and run your project, you're ready to go!\n\u003c/details\u003e\n\n### Build the project\n\u003e [!NOTE]\n\u003e *As I don't have **Linux** or **MacOS** machines, the following instructions have been written only for **Windows**.* If you know how to do it in those platforms, I'd welcome a pull request!\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eVisual Studio Code\u003c/b\u003e\u003c/summary\u003e\n\n1. Install **Visual Studio Code** extensions [C/C++](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools) and [CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) from Microsoft.\n2. Clone `arkaht/cpp-curve-x` or [download the ZIP](https://github.com/arkaht/cpp-curve-x/archive/refs/heads/master.zip) and extract it\n3. Open the project's folder inside **Visual Studio Code**\n4. Configure the project with **CMake** (`Ctrl+Shift+P \u003e CMake: Configure`)\n5. Build the project with **CMake** (`Ctrl+Shift+P \u003e CMake: Build`, `F7` or `⚙ Build` button at the bottom-left)\n6. Run the project examples, you're ready to make changes!\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eVisual Studio 2022\u003c/b\u003e\u003c/summary\u003e\n\n1. Clone `arkaht/cpp-curve-x` or [download the ZIP](https://github.com/arkaht/cpp-curve-x/archive/refs/heads/master.zip) and extract it\n2. Open the project's folder inside **Visual Studio 2022**\n3. Once the project has been automatically configured, run the project examples, you're ready to make changes!\n\u003c/details\u003e\n\n## Why did I make it?\nOriginally, it was because I wanted time-based curves for my game engine so I could better control the feeling of my games, especially when I wanted to tweak each parameter of my explosion effects (i.e. transform scales and color lerps) with precise control and better visualization instead of having to hardcode them one by one. I wanted something very similar to implementations in popular engines like Unreal, Unity or Godot.\n\nI searched but couldn't find a C++ curve library that would suits my needs: a library easy-to-use, small to install and a GUI editor compatible with it.\n\nThen, as I'm still a student, it also became a learning project to know more about curves.\n\nIt is also my first time using CMake and Git Submodules (used in the [editor repository](https://github.com/arkaht/cpp-curve-editor-x)).\n\n## Credits\nThis library has been possible thanks to all these online resources:\n+ [The Continuity of Splines](https://www.youtube.com/watch?v=jvPPXbo87ds) by **Freya Holmér**\n+ [Cubic Hermite spline](https://en.wikipedia.org/wiki/Cubic_Hermite_spline) from **Wikipedia**\n+ [Bézier spline](https://en.wikipedia.org/wiki/B%C3%A9zier_curve) from **Wikipedia**\n+ [Curves and Splines](https://catlikecoding.com/unity/tutorials/curves-and-splines/) from **Catlike Coding**\n+ [A Primer on Bézier Curve](https://pomax.github.io/BezierInfo-2/) by **Pomax**\n+ **Unreal Engine**'s `FRichCurve` code for evaluation by time\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farkaht%2Fcpp-curve-x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farkaht%2Fcpp-curve-x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farkaht%2Fcpp-curve-x/lists"}