- Generic Bezier Curve Library that supports control points of arbitary dimension numbers. (2D and 3D for normal, curvature calculations).
- Class of control point Container is built on top of Eigen Matrix; but can possibly be replaced with user-defined Point Container Class (which is quite a tedious task if starting from 0).
- Eigen : Current build with cmake was tested on Ubuntu 18.04. Build on lower version of Ubuntu OS might require modification of CMake to find Eigen OR manually build latest Eigen from source.
- Doxygen : Only used for building documentations. The lack of doxygen does not affect the building of this library.
cd /path/to/bezier_curve
mkdir build && cd build
cmake ../ && cmake --build .
- WITH_DEBUG=ON/OFF(default: OFF) : whether to enable debug
- WITH_GTEST=ON/OFF(default: OFF) : whether to enable gtest
- BUILD_EXAMPLES=ON/OFF(default: OFF) : whether to enable build examples
- BUILD_DOC=ON/OFF(default: ON) : whether to build doc (by doxygen) or not
- WITH_VISUALIZATION=ON/OFF(default: OFF) : whether to build examples with visualization (currently used matplotlib_cpp for visualization)
See Examples
Example for 5-degree bezier curve of the following 2d control points:
Example for 9-degree bezier curve of the following 3d control points:
In this function, I implemented the algorithm presented in the following paper:
Xiao-Diao Chen, Yin Zhou, Zhenyu Shu, Hua Su, Jean-Claude Paul. Improved Algebraic Algorithm
On Point Projection For Bézier Curves. Proceedings of the Second International Multi-Symposiums
on Computer and Computational Sciences (IMSCCS 2007), The University of Iowa, Iowa City, Iowa,
USA, Aug 2007, Iowa, United States. pp.158-163, ff10.1109/IMSCCS.2007.17ff. ffinria-00518379f
- This library is inspired by the following Bezier library, which supports only 2D space (as of 21st June, 2019).
- I partly reused the code introduced in
https://computingandrecording.wordpress.com/2017/03/20/closest-point-to-a-cubic-spline/
for the functionality of point projection.