13 #ifndef eli_geom_curve_explicit_bezier_hpp
14 #define eli_geom_curve_explicit_bezier_hpp
16 #include "eli/code_eli.hpp"
31 template<
typename data__,
typename tol__=eli::util::tolerance<data__> >
100 point_type
f(
const data_type &t)
const
107 point_type
fp(
const data_type &t)
const
114 point_type
fpp(
const data_type &t)
const
121 point_type
fppp(
const data_type &t)
const
130 point_type tgt(
fp(t));
154 data_type
fit(
const fit_container_type &fcon,
const index_type °_in)
156 std::vector<data_type> t;
157 return fit(t, fcon, deg_in);
160 data_type
fit(std::vector<data_type> &t,
const fit_container_type &fcon,
const index_type °_in)
163 std::vector<point_type, Eigen::aligned_allocator<point_type> > pts(npts);
164 std::vector<Eigen::Matrix<data_type, 1, 1>, Eigen::aligned_allocator<Eigen::Matrix<data_type, 1, 1> > > ypts(npts);
178 for (i=0; i<npts; ++i)
181 ypts[i](0)=pts[i](1);
212 std::vector<typename fit_container_type::index_type> indexes(nconpts);
217 for (
size_t i=0; i<nconpts; ++i)
235 B.row(bi)=T.transpose()*N;
236 d.row(bi)=ypts[indexes[i]];
245 B.row(bi)=Tp.transpose()*N;
256 B.row(bi)=Tpp.transpose()*N;
276 for (i=0; i<pts.size(); ++i)
286 std::vector<data_type> t;
290 void interpolate(std::vector<data_type> &t,
const fit_container_type &fcon)
293 std::vector<point_type, Eigen::aligned_allocator<point_type> > pts(npts);
294 std::vector<Eigen::Matrix<data_type, 1, 1>, Eigen::aligned_allocator<Eigen::Matrix<data_type, 1, 1> > > ypts(npts);
308 for (i=0; i<npts; ++i)
311 ypts[i](0)=pts[i](1);
323 std::vector<typename fit_container_type::index_type> indexes(nconpts);
328 for (
size_t i=0; i<nconpts; ++i)
349 A.row(ai)=Tp.transpose()*N;
362 A.row(ai)=Tpp.transpose()*N;
382 typedef Eigen::Matrix<data_type, Eigen::Dynamic, 1>
col_type;
383 typedef Eigen::Matrix<data_type, Eigen::Dynamic, Eigen::Dynamic>
mat_type;
void interpolate(std::vector< data_type > &t, const fit_container_type &fcon)
Definition: explicit_bezier.hpp:290
point_type f(const data_type &t) const
Definition: explicit_bezier.hpp:100
Derived1__::Scalar distance(const Eigen::MatrixBase< Derived1__ > &p1, const Eigen::MatrixBase< Derived2__ > &p2)
Definition: distance.hpp:33
use_states using_fp() const
Definition: fit_container.hpp:88
curve_type y_curve
Definition: explicit_bezier.hpp:386
curve_type::index_type index_type
Definition: explicit_bezier.hpp:42
void least_squares_eqcon(Eigen::MatrixBase< data1__ > &x, const Eigen::MatrixBase< data2__ > &A, const Eigen::MatrixBase< data3__ > &b, const Eigen::MatrixBase< data4__ > &B, const Eigen::MatrixBase< data5__ > &d)
Definition: least_squares.hpp:38
geom::curve::fit_container< data_type, index_type, 2, 1 > fit_container_type
Definition: explicit_bezier.hpp:43
Eigen::Matrix< data_type, 1, dim__ > point_type
Definition: bezier.hpp:114
explicit_bezier(const explicit_bezier< data_type, tolerance_type > &eb)
Definition: explicit_bezier.hpp:49
curve_type::data_type data_type
Definition: explicit_bezier.hpp:39
void least_squares_uncon(Eigen::MatrixBase< data1__ > &x, const Eigen::MatrixBase< data2__ > &A, const Eigen::MatrixBase< data3__ > &r)
Definition: least_squares.hpp:25
point_type fpp(const data_type &t) const
Definition: explicit_bezier.hpp:114
explicit_bezier()
Definition: explicit_bezier.hpp:47
void degree_promote()
Definition: bezier.hpp:436
point_type f(const data_type &t) const
Definition: bezier.hpp:324
size_t number_constraint_points() const
Definition: fit_container.hpp:375
Eigen::Matrix< data_type, Eigen::Dynamic, 1 > col_type
Definition: explicit_bezier.hpp:382
size_t number_points() const
Definition: fit_container.hpp:374
tol__ tolerance_type
Definition: bezier.hpp:118
void bezier_T_p(Eigen::MatrixBase< Derived > &Tp, const typename Derived::Scalar &t, const typename Derived::Index &n)
Definition: bezier.hpp:356
Definition: fit_container.hpp:34
bool open() const
Definition: explicit_bezier.hpp:71
Definition: explicit_bezier.hpp:32
void build_fit_Ab(Eigen::MatrixBase< Derived1 > &A, Eigen::MatrixBase< Derived2 > &b, std::vector< typename Derived1::Scalar > &t, const std::vector< PointType, Eigen::aligned_allocator< PointType > > &pts, const typename Derived1::Index &n, const size_t &dim)
Definition: bezier.hpp:43
void bezier_T(Eigen::MatrixBase< Derived > &T, const typename Derived::Scalar &t, const typename Derived::Index &n)
Definition: bezier.hpp:341
use_states using_fpp() const
Definition: fit_container.hpp:89
data_type fit(const fit_container_type &fcon, const index_type °_in)
Definition: explicit_bezier.hpp:154
index_type degree() const
Definition: bezier.hpp:191
curve_type::tolerance_type tolerance_type
Definition: explicit_bezier.hpp:44
Definition: fit_container.hpp:43
void reverse()
Definition: explicit_bezier.hpp:95
error_code get_constraint(const index_type &i, constraint_info &ci) const
Definition: fit_container.hpp:476
point_type fpp(const data_type &t) const
Definition: bezier.hpp:369
control_point_type get_control_point(const index_type &i) const
Definition: bezier.hpp:213
curve_type::dimension_type dimension_type
Definition: explicit_bezier.hpp:38
Definition: continuity.hpp:27
void degree_promote()
Definition: explicit_bezier.hpp:144
bool degree_demote(const geom::general::continuity &continuity_degree=geom::general::C0)
Definition: explicit_bezier.hpp:149
bool closed() const
Definition: explicit_bezier.hpp:75
point_type get_fpp() const
Definition: fit_container.hpp:87
point_type tangent(const data_type &t) const
Definition: explicit_bezier.hpp:128
void resize(const index_type &t_dim)
Definition: explicit_bezier.hpp:66
index_type1 determine_n(const index_type1 °_in, const index_type2 &nconstrs, const index_type3 &npts)
Definition: bezier.hpp:78
curve_type::point_type control_point_type
Definition: explicit_bezier.hpp:41
data_type fit(std::vector< data_type > &t, const fit_container_type &fcon, const index_type °_in)
Definition: explicit_bezier.hpp:160
Definition: fit_container.hpp:57
Eigen::Matrix< data_type, Eigen::Dynamic, 1 > row_pts_type
Definition: explicit_bezier.hpp:381
static dimension_type dimension()
Definition: explicit_bezier.hpp:64
index_type degree() const
Definition: explicit_bezier.hpp:80
explicit_bezier(const index_type &n)
Definition: explicit_bezier.hpp:48
control_point_type get_control_point(const index_type &i) const
Definition: explicit_bezier.hpp:90
void frenet_serret_frame(point_type &t, point_type &n, point_type &b, const data_type &t0)
Definition: explicit_bezier.hpp:136
point_type get_fp() const
Definition: fit_container.hpp:86
void resize(const index_type &t_dim)
Definition: bezier.hpp:186
void set_control_point(const control_point_type &cp, const index_type &i)
Definition: bezier.hpp:201
bool operator==(const explicit_bezier< data_type, tolerance_type > &eb) const
Definition: explicit_bezier.hpp:52
point_type fppp(const data_type &t) const
Definition: explicit_bezier.hpp:121
point_type fp(const data_type &t) const
Definition: explicit_bezier.hpp:107
~explicit_bezier()
Definition: explicit_bezier.hpp:50
continuity
Definition: continuity.hpp:24
bezier< data__, 1, tol__ > curve_type
Definition: explicit_bezier.hpp:35
error_code
Definition: fit_container.hpp:41
point_type fppp(const data_type &t) const
Definition: bezier.hpp:394
Eigen::Matrix< data_type, 1, 2 > point_type
Definition: explicit_bezier.hpp:40
void interpolate(const fit_container_type &fcon)
Definition: explicit_bezier.hpp:284
point_type fp(const data_type &t) const
Definition: bezier.hpp:344
void set_control_point(const control_point_type &cp_in, const index_type &i)
Definition: explicit_bezier.hpp:85
Definition: fit_container.hpp:50
data__ data_type
Definition: bezier.hpp:113
void get_points(it__ itb) const
Definition: fit_container.hpp:451
unsigned short dimension_type
Definition: bezier.hpp:112
void bezier_N(Eigen::MatrixBase< Derived > &N, const typename Derived::Index &n)
Definition: bezier.hpp:316
void reverse()
Definition: bezier.hpp:256
size_t number_constraints(bool fit=true) const
Definition: fit_container.hpp:377
error_code get_constraint_indexes(it__ itout) const
Definition: fit_container.hpp:688
bool closed() const
Definition: fit_container.hpp:396
bool operator!=(const explicit_bezier< data_type, tolerance_type > &eb) const
Definition: explicit_bezier.hpp:59
void bezier_T_pp(Eigen::MatrixBase< Derived > &Tpp, const typename Derived::Scalar &t, const typename Derived::Index &n)
Definition: bezier.hpp:374
Eigen::Matrix< data_type, Eigen::Dynamic, Eigen::Dynamic > mat_type
Definition: explicit_bezier.hpp:383
bool degree_demote(const geom::general::continuity &continuity_degree=geom::general::C0)
Definition: bezier.hpp:460
point_type::Index index_type
Definition: bezier.hpp:116