Curve and Surface Fitting¶
fitting
module provides functions for interpolating and approximating Bspline curves and surfaces from points.
It provides functions for global interpolation and approximation to a list of data points.
Please see the following functions for details:
Function Reference¶

geomdl.fitting.
interpolate_curve
(points, degree, **kwargs)¶ Curve interpolation through the data points.
Please refer to Algorithm A9.1 on The NURBS Book (2nd Edition), pp.369370 for details.
 Keyword Arguments:
centripetal
: activates centripetal parametrization method. Default: False
Parameters:  points (list, tuple) – data points
 degree (int) – degree of the output parametric curve
Returns: interpolated BSpline curve
Return type:

geomdl.fitting.
interpolate_surface
(points, size_u, size_v, degree_u, degree_v, **kwargs)¶ Surface interpolation through the data points.
Please refer to the Algorithm A9.4 on The NURBS Book (2nd Edition), pp.380 for details.
 Keyword Arguments:
centripetal
: activates centripetal parametrization method. Default: False
Parameters:  points (list, tuple) – data points
 size_u (int) – number of data points on the udirection
 size_v (int) – number of data points on the vdirection
 degree_u (int) – degree of the output surface for the udirection
 degree_v (int) – degree of the output surface for the vdirection
Returns: interpolated BSpline surface
Return type:

geomdl.fitting.
approximate_curve
(points, degree, **kwargs)¶ Curve approximation using least squares method with fixed number of control points.
Please refer to The NURBS Book (2nd Edition), pp.410413 for details.
 Keyword Arguments:
centripetal
: activates centripetal parametrization method. Default: Falsectrlpts_size
: number of control points. Default: len(points)  1
Parameters:  points (list, tuple) – data points
 degree (int) – degree of the output parametric curve
Returns: approximated BSpline curve
Return type:

geomdl.fitting.
approximate_surface
(points, size_u, size_v, degree_u, degree_v, **kwargs)¶ Surface approximation using least squares method with fixed number of control points.
This algorithm interpolates the corner control points and approximates the remaining control points. Please refer to Algorithm A9.7 of The NURBS Book (2nd Edition), pp.422423 for details.
 Keyword Arguments:
centripetal
: activates centripetal parametrization method. Default: Falsectrlpts_size_u
: number of control points on the udirection. Default: size_u  1ctrlpts_size_v
: number of control points on the vdirection. Default: size_v  1
Parameters:  points (list, tuple) – data points
 size_u (int) – number of data points on the udirection,
 size_v (int) – number of data points on the vdirection,
 degree_u (int) – degree of the output surface for the udirection
 degree_v (int) – degree of the output surface for the vdirection
Returns: approximated BSpline surface
Return type: