splinepy.helpme.fit.curve#

splinepy.helpme.fit.curve(fitting_points, degree=None, n_control_points=None, knot_vector=None, fitting_spline=None, associated_queries=None, centripetal=True, interpolate_endpoints=True, verbose_output=False)[source]#

Fits a spline with given parameters through given fitting_points. Spline will be interpolated if n_control_points = n_fitting_points and approximated if not.

Parameters:
  • fitting_points ((m, dim) array) – points to be interpolated/approximated

  • degree (int) – degree of spline

  • n_control_points (int) – number of control points

  • knot_vector (list) – desired knot vector of spline

  • fitting_spline (Spline) – spline used for interpolation/approximation

  • associated_queries ((n, 1) np.ndarray) – values where the spline will be evaluated

  • centripetal (bool (default = True)) – if True -> centripetal parameterization will be used

  • interpolate_endpoints (bool) – if True -> endpoints are interpolated

  • verbose_outputs (dict) – returns additional information as dict

Returns:

  • fitted_spline (Spline) – interpolated/approximated spline

  • residual (float) – residual (coefficient_matrix @ control_points - fitting_points)