bgrimstad/splinter

Interface to get spline coefficients

XWarin opened this issue · 2 comments

Dear Splinter developper

I need to get the polynomial coefficients and the mesh grid caracteristics associated to these coefficients.
Is there a C++ function to get theses informations.
Thank you for this very good library !
Sincerely yours

Xavier Warin

Hello Xavier,

Currently, you have access to the control points (coefficients), knot vectors and basis degrees via BSpline::getControlPoints, BSpline::getKnotVectors and BSpline::getBasisDegrees, respectively. The grid and the control points of the basis functions that have support on a given grid cell can be derived from these values.

Unfortunately, there are no helper functions for this, but you may cleverly use BSpline::evalBasis to see which basis functions that have support at the midpoint of a grid cell. You may then extract the corresponding control points, which have the same indices as the non-zero basis functions.

Hope this may help you.

Kind regards,
Bjarne