Thunderbots Project
Loading...
Searching...
No Matches
cubic_bezier_spline2d.h
1#pragma once
2
3#include "software/geom/bezier_curve2d.h"
4#include "software/geom/spline2d.h"
5
15{
16 public:
17 CubicBezierSpline2d() = delete;
18
58 explicit CubicBezierSpline2d(const Point& start_point, const Vector& start_vector,
59 const Point& end_point, const Vector& end_vector,
60 const std::vector<Point>& intermediate_knots);
61
62 const Point getValueAt(double t) const override;
63 const std::vector<Point> getKnots() const override;
64 size_t getNumKnots() const override;
65 std::vector<double> getKnotParametrizationValues() const override;
66 const Point getStartPoint() const override;
67 const Point getEndPoint() const override;
68 const std::vector<SplineSegment2d> getSplineSegments() const override;
69
77 const std::vector<Point>& getControlPoints() const;
78
84 size_t getNumSegments() const;
85
86
87 private:
88 // The degree of the bezier curves that make up this spline
89 static const size_t BEZIER_CURVE_DEGREE = 3;
90
99 BezierCurve2d getSegmentAtIndex(size_t index) const;
100
120 std::vector<Point> computeControlPoints(const Point& start_point,
121 const Vector& start_vector,
122 const Point& end_point,
123 const Vector& end_vector,
124 const std::vector<Point>& intermediate_knots);
125
126 // The control points that are the implicit representation of the bezier curves that
127 // form this splines.
128 // 0th-3rd (inclusive) points are the control points of the first bezier curve
129 // 3rd-6th (inclusive) points are the control points of the second bezier curve
130 // etc.
131 std::vector<Point> control_points;
132};
Definition bezier_curve2d.h:19
Definition cubic_bezier_spline2d.h:15
const std::vector< SplineSegment2d > getSplineSegments() const override
Definition cubic_bezier_spline2d.cpp:87
const std::vector< Point > getKnots() const override
Definition cubic_bezier_spline2d.cpp:42
const Point getEndPoint() const override
Definition cubic_bezier_spline2d.cpp:80
const Point getStartPoint() const override
Definition cubic_bezier_spline2d.cpp:73
const Point getValueAt(double t) const override
Definition cubic_bezier_spline2d.cpp:16
const std::vector< Point > & getControlPoints() const
Definition cubic_bezier_spline2d.cpp:99
std::vector< double > getKnotParametrizationValues() const override
Definition cubic_bezier_spline2d.cpp:60
size_t getNumSegments() const
Definition cubic_bezier_spline2d.cpp:104
size_t getNumKnots() const override
Definition cubic_bezier_spline2d.cpp:53
Definition point.h:14
Definition spline2d.h:66
Definition vector.h:12