UNPKG

@numericelements/knot-sequence

Version:

A library for generating and manipulating knot sequences for b-spline curves and surfaces

29 lines (25 loc) 1.02 kB
'use strict'; var AbstractKnotIndex = require('./AbstractKnotIndex.cjs'); var KnotIndexConstructorInterface = require('./KnotIndexConstructorInterface.cjs'); /** * 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.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: KnotIndexConstructorInterface.KNOT_INDEX_STRICTLY_INCREASING_SEQUENCE, index: value }; } } exports.KnotIndexStrictlyIncreasingSequence = KnotIndexStrictlyIncreasingSequence;