Knot Vectors
Knot vectors are fundamental data structures that define the parametric domain and behavior of B-spline and NURBS bases.
Constructor
TinyGismo.KnotVector — Type
KnotVector(knots::Vector{Float64})Construct a knot vector from a vector of knot values.
Arguments
knots: A vector of knot values (non-decreasing)
Returns
A knot vector object
Details
A knot vector is a non-decreasing sequence of real numbers that define the parametric domain and behavior of B-spline and NURBS bases.
Examples
knots = [0.0, 0.0, 0.0, 0.25, 0.5, 0.75, 1.0, 1.0, 1.0]kv = KnotVector(knots)Query Functions
Base.size — Method
Base.size(kv::KnotVector)Get the total number of knots in the knot vector (including multiplicities).
Alias for the C++ size() method.
TinyGismo.uSize — Function
uSize(knotVector::KnotVector)Get the number of unique knot values.
Arguments
knotVector: The knot vector
Returns
The number of unique knots
TinyGismo.unique — Function
unique(knotVector::KnotVector)Get the unique knot values from the knot vector.
Arguments
knotVector: The knot vector
Returns
A vector of unique knot values in ascending order
TinyGismo.multiplicities — Function
multiplicities(knotVector::KnotVector)Get the multiplicity of each unique knot value.
Arguments
knotVector: The knot vector
Returns
A vector of multiplicities corresponding to each unique knot
Details
The multiplicity of a knot indicates how many times that knot value appears in the knot vector. Higher multiplicity reduces continuity at that knot.
TinyGismo.multiplicity — Function
multiplicity(knotVector::KnotVector, u::Real)Get the multiplicity of a single knot value.
Arguments
knotVector: The knot vectoru: The knot value to look up
Returns
How many times u occurs in the knot vector, or 0 if it is not a knot at all
Details
This is the per-value counterpart of multiplicities, which returns the multiplicity of every unique knot at once. A knot of multiplicity m in a degree-p basis leaves the spline C^(p-m) continuous there.
Examples
kv = KnotVector([0.0, 0.0, 0.0, 0.25, 0.5, 0.5, 1.0, 1.0, 1.0])multiplicity(kv, 0.5) # 2multiplicity(kv, 0.3) # 0 -- not a knotTinyGismo.knotContainer — Function
knotContainer(knotVector::KnotVector)Get the underlying knot values as an array.
Arguments
knotVector: The knot vector
Returns
A const array view of the knot values
Greville Abscissae
TinyGismo.greville! — Function
greville!(knotVector::KnotVector, out::gsMatrix{Float64})Compute all Greville abscissae of the knot vector (in-place).
Arguments
knotVector: The knot vectorout: OutputgsMatrix{Float64}, filled with a1 × nrow of abscissae, one per basis function (modified in-place)
Details
The i-th Greville abscissa is the average of the p knots following knot i, for degree p. They are the canonical interpolation sites of a spline space: a control point placed at its Greville abscissa gives a curve that stays close to the control polygon, which makes them the usual choice for control-point-based interpolation and for plotting a control net against the parameter axis.
Examples
kv = KnotVector([0.0, 0.0, 0.0, 0.25, 0.5, 0.5, 1.0, 1.0, 1.0])out = gsMatrix()greville!(kv, out)toVector(out) # [0.0, 0.125, 0.375, 0.5, 0.75, 1.0]See Also
TinyGismo.greville — Function
greville(knotVector::KnotVector)
greville(knotVector::KnotVector, i::Int)Get the Greville abscissae of the knot vector.
Without an index, returns all of them as a 1 × n gsMatrix — read it with toVector. With an index, returns that single abscissa as a Float64, 1-based.
Arguments
knotVector: The knot vectori: The index of a single abscissa (1-based)
Returns
A gsMatrix of all abscissae, or a single Float64
Examples
kv = KnotVector([0.0, 0.0, 0.0, 0.5, 1.0, 1.0, 1.0])toVector(greville(kv)) # [0.0, 0.25, 0.75, 1.0]greville(kv, 2) # 0.25See Also
greville!for the in-place variant
numElements- Get the number of elements (see Basis Functions - Query Functions)
Degree Operations
degree reads the degree implied by the end multiplicities; the in-place operations are documented in the Basis Functions section.
TinyGismo.degree- Get the polynomial degreedegreeIncrease!- Increase the polynomial degreedegreeDecrease!- Decrease the polynomial degreedegreeElevate!- Elevate the polynomial degree
Refinement
Refinement operations for knot vectors are documented in the Basis Functions - Refinement section.
uniformRefine!- Uniformly refine the knot vector