UNPKG

@numericelements/knot-sequence

Version:

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

17 lines (14 loc) 772 B
import { IncreasingPeriodicKnotSequenceClosedCurve } from '../IncreasingPeriodicKnotSequenceClosedCurve.js'; import { INCREASINGPERIODICKNOTSEQUENCE } from '../KnotSequenceConstructorInterface.js'; function fromStrictlyIncreasingPeriodicToIncreasingPeriodicKnotSequence(strictIncSeq) { const knotAbscissae = []; for (const knot of strictIncSeq) { if (knot !== undefined) { for (let i = 0; i < knot.multiplicity; i++) { knotAbscissae.push(knot.abscissa); } } } return new IncreasingPeriodicKnotSequenceClosedCurve(strictIncSeq.maxMultiplicityOrder, { type: INCREASINGPERIODICKNOTSEQUENCE, periodicKnots: knotAbscissae }); } export { fromStrictlyIncreasingPeriodicToIncreasingPeriodicKnotSequence };