aerocaps.geom.nurbs_purepython.bspline_curve_eval#

bspline_curve_eval(p: List[List[float]], k: List[float], t: float) List[float][source]#

Evaluates a B-spline curve with \(n+1\) control points at a single \(t\)-value according to

\[\mathbf{C}(t) = \sum\limits_{i=0}^n N_{i,q}(t) \mathbf{P}_i\]

where \(N_{i,q}(t)\) is the B-spline basis function of degree \(q\), defined recursively as

\[N_{i,q} = \frac{t - t_i}{t_{i+q} - t_i} N_{i,q-1}(t) + \frac{t_{i+q+1} - t}{t_{i+q+1} - t_{i+1}} N_{i+1, q-1}(t)\]

with base case

\[\begin{split}N_{i,0} = \begin{cases} 1, & \text{if } t_i \leq t < t_{i+1} \text{ and } t_i < t_{i+1} \\ 0, & \text{otherwise} \end{cases}\end{split}\]

The degree of the B-spline is computed as q = k.len() - len(p) - 1.

Parameters:
  • p (List[List[float]]) – 2-D list or array of control points where the inner dimension can have any size, but the typical size is 3 (\(x\)-\(y\)-\(z\) space)

  • k (List[float]) – 1-D list or array of knots

  • t (float) – Parameter value \(t\) at which to evaluate

Returns:

Value of the B-spline curve at \(t\). Has the same size as the inner dimension of p

Return type:

List[float]