Skip to content

Latest commit

 

History

History
56 lines (46 loc) · 2.36 KB

README.md

File metadata and controls

56 lines (46 loc) · 2.36 KB

Bezier-Cpp

Build Status v1.0 Codacy Badge

Fast and lightweight class for using the Bezier curves of any order in C++

Algorithm implementations are based on A Primer on Bezier Curves by Pomax

Key Features

  • Any number of control points
  • Fast operations on curves
  • Dynamic manipulation

Implementeed methods

  • Get value, curvature, tangent and normal for parameter t
  • Get t from projection any point onto a curve
  • Get derivative curve
  • Split into two subcurves
  • Find extremes and bounding box
  • Find points of intersection with another curve
  • Elevate/lower order
  • Manipulate control points
  • Manipulate dot on curve (only for quadratic and cubic curves)

In development

  • v1.1 indev Bezier polycurves
    • Create polycurve (C0 continuity)
    • Equivalent methods from Bezier curves
    • Adding aditional curves to existing polycurve
    • Curve continuity and manipulation
  • v1.2 planned Bezier shapes

Dependencies

  • c++11
  • Eigen3

Add compile flag -march=native when compiling to use vectorization with Eigen.

Example program

A small Qt5 based program written as a playground for manipulating Bezier curves.

Usage

  • Starts with two Bezier curves (with 4 and 5 control points respectively)
  • Zoom in/out: Ctrl + mouse wheel
  • Manipulate control point or point on curve: Left mouse buttom
  • Project mouse pointer on all curves and show tangent: Right mouse buttom
  • Split curve at mouse point: Middle mouse buttom
  • Raise order of the curve: Double left click
  • Lower order of the curve Double right click
  • Toggle bounding boxes and curve intersections: Double middle click

Additional dependencies

  • qt5-default

Licence

Apache License Version 2.0