Bezier
Fast and lightweight class for using the Bezier curves of any order in C++
|
22 #include "Bezier/bezier.h"
23 #include "Bezier/declarations.h"
93 unsigned size()
const;
117 std::deque<Curve>&
curves();
118 const std::deque<Curve>&
curves()
const;
139 double length(
double t)
const;
147 double length(
double t1,
double t2)
const;
161 std::pair<Point, Point>
endPoints()
const;
282 #endif // POLYCURVE_H
double distance(const Point &point) const
Get distance of the point to the polycurve.
Point valueAt(double t) const
Get the point on polycurve for a given t.
Eigen::AlignedBox2d BoundingBox
Bounding box class.
Definition: declarations.h:74
void removeBack()
Remove a subcurve from the end of the polycurve.
A Bezier curve class.
Definition: bezier.h:35
Eigen::Vector2d Point
Point in xy plane.
Definition: declarations.h:59
std::deque< Curve > curves_
Structure for holding underlying Bezier curves.
Definition: polycurve.h:278
Vector tangentAt(double t, bool normalize=true) const
Get the tangent of the polycurve for a given t.
double curvatureAt(double t) const
Get curvature of the polycurve for a given t.
void insertAt(unsigned idx, Curve curve)
Insert new curve into polycurve.
Vector derivativeAt(double t) const
Get value of a derivative for a given t.
double projectPoint(const Point &point) const
Get the parameter t where polycurve is closest to given point.
Curve & curve(unsigned idx)
Get pointer of a subcurve.
void removeFirst()
Remove a subcurve from the beginning of the polycurve.
std::vector< Point > PointVector
A vector of Points.
Definition: declarations.h:64
BoundingBox boundingBox() const
Get the bounding box of the polycurve.
PointVector polyline(double flatness=0.5) const
Get a polyline representation of the polycurve as a vector of points on curve.
std::pair< Point, Point > endPoints() const
Get first and last control points.
unsigned curveIdx(double t) const
Resolve polycurve parameter to subcurve index.
void setControlPoint(unsigned idx, const Point &point)
Set the new coordinates to a control point.
A Bezier polycurve class.
Definition: polycurve.h:37
double length() const
Compute exact arc length using Chebyshev polynomials.
void removeAt(unsigned idx)
Remove a subcurve from the polycurve.
Eigen::Vector2d Vector
A Vector in xy plane.
Definition: declarations.h:69
PointVector controlPoints() const
Get the control points of all subcurves.
double curvatureDerivativeAt(double t) const
Get curvature derivative of curve for a given t.
void insertFront(Curve curve)
Insert new curve at the beginning of the polycurve.
unsigned size() const
Get number of subcurves.
void insertBack(Curve curve)
Insert new curve at the end of the polycurve.
PointVector intersections(const Curve_PolyCurve &curve) const
Get the points of intersection with another curve or polycurve.
double iterateByLength(double t, double s) const
Compute parameter t which is S distance from given t.
Vector normalAt(double t, bool normalize=true) const
Get the normal of the polycurve for a given t.
std::deque< Curve > & curves()
Get list of all subcurves.