/** @packageDocumentation * @module Bspline */ import { IndexedXYZCollection } from "../geometry3d/IndexedXYZCollection"; import { Point3d } from "../geometry3d/Point3dVector3d"; import { BSplineCurve3d } from "./BSplineCurve"; import { InterpolationCurve3dOptions, InterpolationCurve3dProps } from "./InterpolationCurve3d"; /** * A class with static methods for creating B-spline curves. * @public */ export declare class BSplineCurveOps { /** * Greville knot algorithm: alternative to traditional c2 cubic algorithm allowing for any order, but no end conditions or periodicity. * @param points pass-through points. * @param order bspline order (1 more than degree) */ static createThroughPoints(points: IndexedXYZCollection | Point3d[], order: number): BSplineCurve3d | undefined; /** * Construct BSplineCurve3d that fit points using the C2 cubic algorithm. * @param options curve definition, unmodified */ static createThroughPointsC2Cubic(options: InterpolationCurve3dOptions): BSplineCurve3d | undefined; } /** * Namespace for collecting curve fit API * @public */ export declare namespace BSplineCurveOps { /** * A helper class for creating C2 cubic fit curves. * Knots herein are understood to be *interior* knots (including the start/end knot), * so that there is one knot per fit point. In other words, the knots are fit parameters. * @private */ class C2CubicFit { /** Transform fit parameters to span [0,1] * @param knots fit parameters, normalized in place */ private static normalizeKnots; /** Compute chord-length fit parameters for C2 cubic fit algorithm */ private static constructChordLengthParameters; /** Compute uniform fit parameters for C2 cubic fit algorithm */ private static constructUniformParameters; /** Remove duplicate fit points, and their given knots in parallel */ private static removeDuplicateFitPoints; /** Construct fit parameters for the c2 cubic fit algorithm. * @param fitPoints validated fit points (should not contain duplicates) * @param isChordLength whether knots are computed using distances between successive fit points * @param closed whether curve is periodically defined * @return fit parameters, one per fit point */ static constructFitParametersFromPoints(fitPoints: Point3d[], isChordLength: number | undefined, closed: boolean | undefined): number[] | undefined; /** Construct fit parameters for the c2 cubic fit algorithm, if they are missing. * @param options validated as per validateOptions, possibly modified * @return whether fit parameters are valid */ static constructFitParameters(options: InterpolationCurve3dOptions): boolean; /** Compute a row of the tridiagonal system matrix from Farin. * @param alpha sub-diagonal, length = # fit points * @param beta diagonal, length = # fit points * @param gamma super-diagonal, length = # fit points * @param index 0-based row index to set */ private static computeAlphaBetaGamma; /** Setup tridiagonal system for 2 fit points * @param alpha sub-diagonal, length = 2 * @param beta diagonal, length = 2 * @param gamma super-diagonal, length = 2 */ private static setUpSystem2Points; /** Setup tridiagonal system for 3 fit points * @param alpha sub-diagonal, length = 3 * @param beta diagonal, length = 3 * @param gamma super-diagonal, length = 3 * @param options validated as per validateOptions, unmodified * @param useNaturalStartTangent whether to bake the natural end condition into the first row * @param useNaturalEndTangent whether to bake the natural end condition into the last row */ private static setUpSystem3Points; /** Setup tridiagonal system for 4 fit points or more * @param alpha sub-diagonal, length = # fit points * @param beta diagonal, length = # fit points * @param gamma super-diagonal, length = # fit points * @param options validated as per validateOptions, unmodified * @param useNaturalStartTangent whether to bake the natural end condition into the first row * @param useNaturalEndTangent whether to bake the natural end condition into the last row */ private static setUpSystem4PointsOrMore; /** Setup tridiagonal system * @param alpha sub-diagonal, length = # fitPoints * @param beta diagonal, length = # fitPoints * @param gamma super-diagonal, length = # fitPoints * @param options validated as per validateOptions, unmodified */ private static setUpSystem; /** Set the Bessel end condition for the linear system. * @param dataPts array whose middle is the system rhs (augmented with first/last fitPoint at beginning/end); * 2nd or penultimate point is set by this function. * @param options validated as per validateOptions, unmodified * @param atStart whether end condition is for start of curve (false: end of curve) */ private static setBesselEndCondition; /** Set the natural end condition for the linear system. * This is the end condition used by ADSK for fit-splines with a given zero tangent. * @param dataPts array whose middle is the system rhs (augmented with first/last fitPoint at beginning/end); * 2nd or penultimate point is set by this function. * @param options validated as per validateOptions, unmodified * @param atStart whether end condition is for start of curve (false: end of curve) */ private static setNaturalEndCondition; /** Set the end condition for the linear system to the given tangent, scaled by chord length. * This is the end condition used by ADSK for fit-splines with a given nonzero tangent. * @param dataPts array whose middle is the system rhs (augmented with first/last fitPoint at beginning/end); * 2nd or penultimate point is set by this function. * @param options validated as per validateOptions, unmodified * @param atStart whether end condition is for start of curve (false: end of curve) */ private static setChordLengthScaledEndCondition; /** Set the end condition for the linear system to the given tangent, scaled by bessel length. * @param dataPts array whose middle is the system rhs (augmented with first/last fitPoint at beginning/end); * 2nd or penultimate point is set by this function. * @param options validated as per validateOptions, unmodified * @param atStart whether end condition is for start of curve (false: end of curve) */ private static setBesselLengthScaledEndCondition; /** Set the end condition for a physically closed (non-periodic) interpolant. * @param dataPts array whose middle is the system rhs (augmented with first/last fitPoint at beginning/end); * 2nd or penultimate point is set by this function. * @param options validated as per validateOptions, unmodified */ private static setPhysicallyClosedEndCondition; /** Set end conditions for the linear system to solve for the poles of the open interpolant, as per Farin 3e/4e. * @param dataPts array whose interior is the system rhs and whose first/last entries are the first/last fitPoints; * points are inserted to become the 2nd and penultimate dataPts, the first/last rows of the system rhs. * @param options validated as per validateOptions, unmodified */ private static setEndConditions; /** Solve the near tridiagonal system for a periodic C2 cubic interpolant. * Alpha, beta, gamma are computed by setUpSystem, have same length as fitPts, and are overwritten. */ private static solveNearTridiagonal; /** Adjust options by correcting invalid combinations * @param options curve definition, possibly modified */ static validateOptions(options: InterpolationCurve3dOptions): boolean; /** Converts a full cubic knot vector of expected length into fit parameters, by removing extraneous exterior knots. * @param knots cubic knot vector, unmodified * @param numFitPoints number of fit points * @return fit parameters, or undefined if unexpected input **/ static convertCubicKnotVectorToFitParams(knots: number[] | undefined, numFitPoints: number, normalize?: boolean): number[] | undefined; /** Return fit parameters augmented to a full cubic knot vector. * @param params fit parameters, unmodified * @param legacy whether to create a legacy (DGN) full knot vector, or modern vector with two less knots **/ static convertFitParamsToCubicKnotVector(params: number[] | undefined, closed?: boolean, legacy?: boolean): number[] | undefined; /** Ensure full legacy knot vector for JSON export **/ static convertToJsonKnots(props: InterpolationCurve3dProps): void; /** Construct the control points for the c2 cubic fit algorithm * @param options validated as per validateOptions, possibly modified */ static constructPoles(options: InterpolationCurve3dOptions): Point3d[] | Float64Array | undefined; } } //# sourceMappingURL=BSplineCurveOps.d.ts.map