Skip to content

Commit

Permalink
interpolate_nurbs_curve_with_tangents: add cyclic option.
Browse files Browse the repository at this point in the history
  • Loading branch information
portnov committed Dec 24, 2022
1 parent fe9ea68 commit 12ea912
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions utils/curve/nurbs_solver_applications.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ def knotvector_with_tangents_from_tknots(degree, u):

def interpolate_nurbs_curve_with_tangents(degree, points, tangents,
metric='DISTANCE', tknots=None,
cyclic = False,
implementation = SvNurbsMaths.NATIVE,
logger = None):

Expand All @@ -200,6 +201,10 @@ def interpolate_nurbs_curve_with_tangents(degree, points, tangents,
if ndim not in {3,4}:
raise Exception(f"Points must be 3 or 4 dimensional, not {ndim}")

if cyclic:
points = np.append(points, [points[0]], axis=0)
tangents = np.append(tangents, [tangents[0]], axis=0)

if tknots is None:
tknots = Spline.create_knots(points, metric=metric)

Expand Down

0 comments on commit 12ea912

Please sign in to comment.