From 44d87a972c694371462378672429f2acc24249b2 Mon Sep 17 00:00:00 2001 From: Michael Mugnai Date: Tue, 2 Jun 2020 19:38:43 +0200 Subject: [PATCH] curve fitting: take u_k as optional argument --- geomdl/fitting.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/geomdl/fitting.py b/geomdl/fitting.py index 86b3f3d9..5878a70e 100644 --- a/geomdl/fitting.py +++ b/geomdl/fitting.py @@ -34,8 +34,10 @@ def interpolate_curve(points, degree, **kwargs): # Number of control points num_points = len(points) - # Get uk - uk = compute_params_curve(points, use_centripetal) + # Get uk as argument or compute it + uk = kwargs.get('uk', None) + if uk is None: + uk = compute_params_curve(points, use_centripetal) # Compute knot vector kv = compute_knot_vector(degree, num_points, uk) @@ -49,6 +51,7 @@ def interpolate_curve(points, degree, **kwargs): curve.degree = degree curve.ctrlpts = ctrlpts curve.knotvector = kv + curve.uk = uk return curve