@mlightcad/geometry-engine
Version:
The geometry-engine package provides comprehensive geometric entities, mathematical operations, and transformations for 2D and 3D space. This package mimics AutoCAD ObjectARX's AcGe (Geometry) classes and provides the mathematical foundation for CAD opera
73 lines • 2.35 kB
TypeScript
import { AcGePoint3d, AcGePoint3dLike } from '../math';
/**
* Type for NURBS knot parameterization
*/
export type AcGeKnotParameterizationType = 'Uniform' | 'Chord' | 'SqrtChord';
/**
* A NURBS curve implementation that can be used by other curve classes
*/
export declare class AcGeNurbsCurve {
private _degree;
private _knots;
private _controlPoints;
private _weights;
constructor(degree: number, knots: number[], controlPoints: AcGePoint3dLike[], weights?: number[]);
/**
* Get the degree of the NURBS curve
*/
degree(): number;
/**
* Get the knot vector
*/
knots(): number[];
/**
* Get the control points
*/
controlPoints(): AcGePoint3dLike[];
/**
* Get the weights
*/
weights(): number[];
/**
* Calculate a point on the curve at parameter u
*/
point(u: number): number[];
/**
* Calculate curve length using numerical integration
*/
length(): number;
/**
* Create a NURBS curve from control points and knots
*/
static byKnotsControlPointsWeights(degree: number, knots: number[], controlPoints: AcGePoint3dLike[], weights?: number[]): AcGeNurbsCurve;
/**
* Create a NURBS curve from fit points using interpolation
*/
static byPoints(points: number[][], degree: number, parameterization?: AcGeKnotParameterizationType): AcGeNurbsCurve;
/**
* Get the valid parameter range for this curve
*/
getParameterRange(): {
start: number;
end: number;
};
/**
* Get points along the curve
* @param divisions - Number of divisions to create
* @returns Array of points along the curve
*/
getPoints(divisions: number): number[][];
/**
* Check if the curve is closed by comparing start and end points
*/
isClosed(tolerance?: number): boolean;
/**
* Create fit points for a closed NURBS curve using Catmull-Rom interpolation
*/
static createFitPointsForClosedCurve(points: AcGePoint3dLike[]): AcGePoint3d[];
/**
* Create a closed NURBS curve using Catmull-Rom interpolation for smooth closure
*/
static createClosedCurve(points: AcGePoint3dLike[], degree: number, parameterization?: AcGeKnotParameterizationType): AcGeNurbsCurve;
}
//# sourceMappingURL=AcGeNurbsCurve.d.ts.map