Skip to content

implementation of algorithms related to bezier curve for path smoothing

Notifications You must be signed in to change notification settings

fangzheng81/bezier_curve

Repository files navigation

Build Status License: MIT

Generic Bezier Curve Library

  • 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).

Dependencies

  • 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.

How to Build

cd /path/to/bezier_curve
mkdir build && cd build
cmake ../ && cmake --build .

Build Options

  • 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)

General Usage

See Examples

Examples

2d points

Example for 5-degree bezier curve of the following 2d control points:

Source Code

3d points

Example for 9-degree bezier curve of the following 3d control points:

Source Code

point projection from an external point to bezier curve

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

Source Code

bounding box for bezier curve

Source Code

Acknowledgement

  • 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.

About

implementation of algorithms related to bezier curve for path smoothing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published