@numericelements/knot-sequence
Version:
A library for generating and manipulating knot sequences for b-spline curves and surfaces
27 lines (24 loc) • 931 B
JavaScript
import { AbstractKnotIndex } from './AbstractKnotIndex.js';
import { KNOT_INDEX_STRICTLY_INCREASING_SEQUENCE } from './KnotIndexConstructorInterface.js';
/**
* Represents a knot index in a strictly increasing sequence
*
* @description
* Implements a knot index where each value must be strictly greater than the previous one
* in the sequence. This is used in B-spline knot sequences where no repeated knot values
* are allowed, ensuring strict monotonicity.
*
* @extends AbstractKnotIndex
*/
class KnotIndexStrictlyIncreasingSequence extends AbstractKnotIndex {
/**
* Creates a new strictly increasing knot index
* @param value - The initial index value
* @throws {RangeError} If value is negative
*/
constructor(value) {
super(value);
this._knotIndex = { type: KNOT_INDEX_STRICTLY_INCREASING_SEQUENCE, index: value };
}
}
export { KnotIndexStrictlyIncreasingSequence };