void View::updateSpline() { m_spl = tinyspline::BSpline{3, 2, m_spline.points.size(), TS_CLAMPED}; ts_bspline_set_ctrlp( m_spl.data(), reinterpret_cast<const tinyspline::real*>(m_spline.points.data()), m_spl.data()); }
void ts::BSpline::setCtrlp(const std::vector<ts::rational> ctrlp) { if (ctrlp.size() != nCtrlp() * dim()) { throw std::runtime_error("The number of values must be equals to the" " spline's number of control points multiplied by the dimension" " of each control point."); } const tsError err = ts_bspline_set_ctrlp(&bspline, ctrlp.data(), &bspline); if (err < 0) throw std::runtime_error(ts_enum_str(err)); }