splinepy.bspline.BSplineBase#

class splinepy.bspline.BSplineBase(*args, **kwargs)[source]#

Bases: Spline

BSpline base. Contains extra operations that are only available for bspline families, i.e., BSpline and NURBS.

Passes all arguments to super.__init__(), see Spline.

All B-Spline-like splines feature knot vectors for each parametric dimension. A knot vector can be considered as a set of non-decreasing parametric coordinates. If coordinates in the parametric dimension are denoted by \(u\in\mathbb{R}^{N_{param}}\), then the knot vector associated with this dimension contains values

\[\Theta_u = \{u_1,u_2,...,u_{l+p+1}\}\]

such that

\[u_1 \leq u_2 \leq ... \leq u_{l+p+1}\]

\(u_i\) is referred to as the \(i\)-th knot. Intervals of the type \([u_i,u_{i+1}]\) are known as knot spans or elements. As we can see, the number of knot entries, the number of control points, and the polynomial degree of the spline are related to each other by the equation \(\# knots=l+p+1\). Here, \(l\) denotes the number of control points along a parametric dimension and \(p\) the polynomial order of the spline. In the special case of a so-called open knot vector, the first and the last entry of the knot vector are repeated \(p+1\) times, that is

\[u_1 = ... = u_{p+1} < u_{p+2} < ... < u_l < u_{l+1} = ... = u_{l+p+1}\]

Splines with open knot vectors have the property that they exactly interpolate the first and the last control point in this parametric dimension.

Based on the knot vectors, the mono-variate basis functions are defined recursively via the Cox-de-Boor recursion formula for each parametric dimension:

\[\begin{split}N^{i;0}(u) &= \begin{cases} 1 & u\in [u_i,u_{i+1}] \\\\ 0 & \mathrm{else} \end{cases} \\\\ N^{i;p}(u) &= \frac{u-u_i}{u_{i+p}-u_i} N^{i;p-1}(u) + \frac{u_{i+p+1}-u}{u_{i+p+1}-u_{i+1}}N^{i+1;p-1}(u)\end{split}\]

For explanations on how to construct splines using these basis functions and usage examples, we refer to the documentation of the classes BSpline and NURBS.

Methods

BSplineBase.basis(queries[, nthreads])

Returns basis function values on the supports of given queries.

BSplineBase.basis_and_support(queries[, ...])

Returns basis function values and their support ids of given queries.

BSplineBase.basis_derivative(queries, orders)

Returns derivative of basis functions evaluated on the supports of given queries.

BSplineBase.basis_derivative_and_support(...)

Returns derivative of basis functions and their support ids of given queries.

BSplineBase.clear()

Clears core spline and saved data

BSplineBase.copy([saved_data])

Returns deepcopy of stored data and newly initialized self.

BSplineBase.current_core_properties(self)

BSplineBase.derivative(queries, orders[, ...])

Evaluates derivatives of spline.

BSplineBase.elevate_degrees(...)

Elevate degree.

BSplineBase.evaluate(queries[, nthreads])

Evaluates spline.

BSplineBase.export(fname)

Export spline.

BSplineBase.extract_bezier_patches()

Extract all knot spans as Bezier patches to perform further operations such as compositions and multiplications

BSplineBase.greville_abscissae([...])

Returns greville abscissae.

BSplineBase.insert_knots(...)

Inserts knots.

BSplineBase.jacobian(queries[, nthreads])

Evaluates jacobians on spline.

BSplineBase.knot_insertion_matrix([...])

Returns knot insertion matrix for a given set of knots in a specific parametric domain, if bezier flag is set, returns matrix, that creates C^(-1) spline spaces.

BSplineBase.mapper(reference)

Retrieve a mapper that can be used to get physical derivatives such as a gradient or hessian in physical space

BSplineBase.normalize_knot_vectors()

Sets all knot vectors into a range of [0,1], if applicable

BSplineBase.proximities(queries[, ...])

Given physical coordinate, finds a parametric coordinate that maps to the nearest physical coordinate.

BSplineBase.reduce_degrees(parametric_dimensions)

Tries to reduce degree.

BSplineBase.remove_knots(...[, tolerance])

Tries to removes knots.

BSplineBase.sample(resolutions[, nthreads])

Uniformly sample along each parametric dimensions from spline.

BSplineBase.show(**kwargs)

Equivalent to

BSplineBase.showable(**kwargs)

Equivalent to

BSplineBase.support(queries[, nthreads])

Returns basis support ids of given queries.

BSplineBase.todict([tolist])

Return current spline as dict.

BSplineBase.uniform_refine([para_dims, n_knots])

Uniformly refines all knot-spans in given direction(s) by given degree(s).

Attributes