splinebox.spline_curves.

HermiteSpline#

class splinebox.spline_curves.HermiteSpline(M, basis_function, closed=False, control_points=None, tangents=None, padding_function=<function padding_function>)#

Class for the construction of a Hermite spline. It inherits from splinebox.spline_curves.Spline. Here, we only document the additional methods and attributes. For information on the inherited methods and attributes refere to the documentation of splinebox.spline_curves.Spline.

Parameters:
Mint

Number of control points.

basis_functionsplinebox.basis_functions.BasisFunction

The basis function used to construct the spline. The multigenerator attribute has to be true and the __call__ method has to return two values instead of one.

closedboolean

Whether or not the spline is closed, i.e. the two ends are connected.

Attributes:
M
basis_function

The basis function \(\Phi\) of the spline (1).

closed
control_points

The control points \(c[k]\) as defined in equation (1).

half_support
integration_segment_size

Size of the segments for the Gauss-Legendre quadrature.

knots

The knots \(n[k]\) of this spline as defined in equation (3).

ndim

The dimensionality of the space the spline lives in, i.e.

pad
tangents

The tangents of this spline.

Methods

__call__(t[, derivative])

Evalute the spline or one of its derivatives at parameter value(s) t.

arc_length([stop, start])

Compute the arc length of the spline between the two parameter values specified.

arc_length_to_parameter(s[, atol])

Convert the arc length s to the coresponding value in parameter space.

copy()

Returns a deep copy of this spline.

curvature(t)

Compute the curvature of the spline at position(s) t.

curvilinear_reparametrization_energy([atol, ...])

This energy can be used to enforce equal spacing of the knots.

distance(points[, return_t])

Computes the distance of point from the spline.

draw(x, y)

Computes whether a point is inside or outside a closed spline on a regular grid of points.

dtheta(t)

Helper function for calculating the winding number.

fit(points[, boundary_condition])

Fit the provided points with the spline using least squares.

from_json(path)

Constructs a spline from a json file that was saved using splinebox.spline_curves.Spline.to_json().

is_inside(x, y)

Determines if a point with coordinates x, y is inside the spline.

mesh([radius, step_t, step_angle, ...])

Create a 3D mesh around the spline curve.

moving_frame(t[, method, initial_vector, shift])

Compute a moving frame (local orthonormal coordinate system) along the spline.

normal(t[, frame, initial_vector, shift])

Returns the normal vector(s) for 2D and 3D splines.

rotate(rotation_matrix[, centred])

Rotate the spline with the provided rotation matrix.

scale(scaling_factor)

Enlarge or shrink the spline by the provided factor.

to_json(path[, version])

Saves the spline as a json file.

translate(vector)

Translates the spline by a vector.