@numericelements/knot-sequence
Version:
A library for generating and manipulating knot sequences for b-spline curves and surfaces
27 lines (24 loc) • 907 B
JavaScript
import { AbstractKnotIndex } from './AbstractKnotIndex.js';
import { KNOT_INDEX_INCREASING_SEQUENCE } from './KnotIndexConstructorInterface.js';
/**
* Represents a knot index in an increasing sequence
*
* @description
* Implements a knot index where each value must be greater than or equal to the previous one
* in the sequence. This allows for repeated knot values, which is useful for representing
* B-spline knot sequences with multiple knots at the same position.
*
* @extends AbstractKnotIndex
*/
class KnotIndexIncreasingSequence extends AbstractKnotIndex {
/**
* Creates a new increasing knot index
* @param value - The initial index value
* @throws {RangeError} If value is negative
*/
constructor(value) {
super(value);
this._knotIndex = { type: KNOT_INDEX_INCREASING_SEQUENCE, index: value };
}
}
export { KnotIndexIncreasingSequence };