UNPKG

@numericelements/knot-sequence

Version:

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

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