Commit 70c4ecba by Pierre Fernbach

### Merge branch 'topic/AddBezier3PythonBindingOnDevel' into 'devel'

Topic/add bezier3 python binding

See merge request loco-3d/curves!18
parents ea0f5767 3748285e
 ... ... @@ -333,9 +333,9 @@ namespace curves } t_point_t wps_first(size_),wps_second(size_); const Numeric u = (t-T_min_)/(T_max_-T_min_); wps_first[0] = control_points_.front(); wps_second[degree_] = control_points_.back(); t_point_t casteljau_pts = waypoints(); wps_first[0] = casteljau_pts.front(); wps_second[degree_] = casteljau_pts.back(); size_t id = 1; while(casteljau_pts.size() > 1) { ... ... @@ -344,31 +344,37 @@ namespace curves wps_second[degree_-id] = casteljau_pts.back(); ++id; } bezier_curve_t c_first(wps_first.begin(), wps_first.end(),T_min_,t,mult_T_); bezier_curve_t c_second(wps_second.begin(), wps_second.end(),t, T_max_,mult_T_); return std::make_pair(c_first,c_second); } bezier_curve_t extract(const Numeric t1, const Numeric t2){ /// \brief Extract a bezier curve defined between \f$[t_1,t_2]\f$ from the actual bezier curve /// defined between \f$[T_{min},T_{max}]\f$ with \f$T_{min} \leq t_1 \leq t_2 \leq T_{max}\f$. /// \param t1 : start time of bezier curve extracted. /// \param t2 : end time of bezier curve extracted. /// \return bezier curve extract defined between \f$[t_1,t_2]\f$. /// bezier_curve_t extract(const Numeric t1, const Numeric t2) { if(t1 < T_min_ || t1 > T_max_ || t2 < T_min_ || t2 > T_max_) { throw std::out_of_range("In Extract curve : times out of bounds"); } if (fabs(t1-T_min_) c_split = this->split(t1); return c_split.second.split(t2-t1).first; return c_split.second.split(t2).first; } private: ... ...