Closed FSchwar closed 8 months ago
Can you remove draft flag when it's ready?
also, I guess we don't need _fitting_queries
as BSpline
's member anymore. Just a note for next PR, as it also require some changes in visualize.py
Just a couple of suggestions for the parameterisation. I have yet to check the rest of the code, but I thought, maybe this could be a more general approach
Overview
Implement fitting feature in python.
Automatically interpolates (n_cps = n_queries) or approximates (n_cps < n_queries) depending on the given parameters. If input is unambiguous (e.g. given target spline and given knot vector), parameters are prioritised as follows: target spline > knot_vector and degree > n_control_points
If too few parameters are given (e.g. only knot vector/degree): assumes interpolation (n_control_points = n_points) and calculates respective missing parameter (e.g. degree/knot vector)
Results are equal to C++ implementation of interpolation/approximation as shown below (upper row: C++ implementation, lower row: python implementation) curve fit: surface fit:
Addressed issues
Showcase
A short / one-liner example to highlight the (new) feature
1 remaining issue: Tests complete but example file "fitting.py" result is different (as shown below). The maximum errors during least square solving are in the magnitude of 1e-3, therefore it seems strange that the maximum error in the example file is that high. I couldn't find any bug in the code.
Checklists