Curves
This repository contains the classes of parametric curves/splines (bezier, hermite, b-spline & catmull-rom)
Install / Use
/learn @vss2sn/CurvesREADME
Curves
This repository contains a set of classes to create N-dimensional curves in C++
<a name="toc"></a>
Table of contents:
<a name="curves"></a>
Curves:
- B-spline
- Bezier Curves
- Catmull-Rom Splines
- Hermite Splines
A special class for cubic hermite spline has also been created that might be deprecated in the future, as the generalized class of hermite spline can be used to create the cubic hermite spline.
<a name="instructions"></a>
To build and run:
git clone https://github.com/vss2sn/curves.git
cd curves
g++-10 main.cpp -std=c++2a #(Might need to specify g++-10 or higher)
./a.out
<a name="overview"></a>
Code Overview:
- Currently this is a header-only repository containing the classes for the curves listed above, implemented using
std::array - This allows for compile time checking of degrees, number of points, etc., and ensures that most mismatches are caught at compile time, and should be easier to understand and debug
- The constructors for each of the classes are
constexprallowing them to be created and used at compile time (this has been tested using thestd::is_constant_evaluated) - The main file has multiple examples of how to use each of the classes and the util and curve conversion functions.
<a name="todos"></a>
TO DOs:
- Add documentation
- Add references
- Add implementations using vectors
- Add tests
- Add knot insertion algorithm for converting
bsplineto group ofbeziercurves - Add functions to transform one type of curve into another
- Add (python?) plotting utility
- Move to standard C++ project file arrangement and format
Related Skills
node-connect
338.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
338.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.6kCommit, push, and open a PR
