bgrimstad / splinter

Library for multivariate function approximation with splines (B-spline, P-spline, and more) with interfaces to C++, C, Python and MATLAB
Mozilla Public License 2.0
418 stars 115 forks source link

One bug in PSPLINE #121

Closed aishuirenjia closed 3 years ago

aishuirenjia commented 5 years ago

Dear Bjarne,

My English writing ability is not good, but I will try my best to express what i have come across.

I have looked into SPLINTER because I need to calculate p-splines for boundary points from 2D point clouds. I use C++ interface. My code is that

BSpline pspline = BSpline::Builder(samples).degree(3).smoothing(BSpline::Smoothing::PSPLINE).alpha(1.0).build();

When I did the circular boundary, something went wrong. As we known, x and y of the circle do not map uniquely to each other. so if i do the code

 pspline.eval(x)

, it will occur that one x value corresponds to two y values, and there is ambiguity.

I was wondering if you have handled this kind of event in your code???

bgrimstad commented 3 years ago

A tad late in my reply. To my knowledge, Splinter has not been tested with periodic or circular end conditions. It is suggested in #22 to implement and test such and other end conditions for knot sequences.