find_span

compas.geometry.find_span(n, degree, knotvector, u)[source]

Find the knot span index for a given knot value.

Parameters:
nint

Number of control points minus 1.

degreeint

Degree of the curve.

knotvectorlist[int | float]

Knot vector of the curve.

ufloat

Parameter value.

Returns:
int

Knot span index.

Raises:
ValueError

If the parameter value is greater than the maximum knot or less than the minimum knot.

References

The NURBS Book. Chapter 2. Page 68. Algorithm A2.1.