1
  1. I want to do this in Python, and preferably SciPy.
  2. The tangent at the beginning and end of the spline are specified.

Assume I have a sequence of waypoints I want the spline to pass through

np.array([
    [-18., -20.],
    [-18.,  18.],
    [-14.,  18.],
    [-14., -18.],
    [-10., -18.],
    [-10.,  18.],
    [ -6.,  18.],
    [ -6., -18.],
    [ -2., -18.],
    [ -2.,  18.],
    [  2.,  18.],
    [  2., -18.],
    [  6., -18.],
    [  6.,  18.],
    [ 10.,  18.],
    [ 10., -18.],
    [ 14., -18.],
    [ 14.,  18.],
    [ 18.,  18.],
    [ 18., -20.]
])

I want the tangent at the beginning to pass through [-18, -20] and [-18, -20], and the tangent at the end to pass through [18, 18] and [18, -20].

Finally, I want to constrain the curvature of the spline to not exceed a ceratin value.

cisprague
  • 71
  • 8

1 Answers1

0

Curvature constraints are not available in scipy, the relevant fitpack routines are not wrapped (e.g. https://github.com/scipy/scipy/blob/master/scipy/interpolate/fitpack/cocosp.f).

End tangents you specify, via e.g. bc_type argument to CubicSpline or make_interp_spline.

ev-br
  • 24,968
  • 9
  • 65
  • 78