@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
85 lines • 3.75 kB
TypeScript
import { AcGePoint2d } from '../math/AcGePoint2d';
import { AcGeShape2d } from './AcGeShape2d';
/**
* Abstract base class for all 2d curves. Any class that is derived from this class represents
* a 2d curve.
*/
export declare abstract class AcGeCurve2d extends AcGeShape2d {
protected arcLengthDivisions: number;
constructor();
/**
* Return true if its start point is identical to its end point. Otherwise, return false.
*/
abstract get closed(): boolean;
/**
* Start point of this curve. If the curve is closed, coordinates of start point will be equal to coordinates
* of end point.
*/
get startPoint(): AcGePoint2d;
/**
* End point of this curve. If the curve is closed, coordinates of start point will be equal to coordinates
* of end point.
*/
get endPoint(): AcGePoint2d;
/**
* Length of this curve.
*/
get length(): number;
/**
* Return the point for a given position on the curve according to the arc length.
* @param t Input a position on the curve according to the arc length. Must be in the range [0, 1].
* @returns Return the point for a given position on the curve according to the arc length.
*/
getPoint(_t: number): AcGePoint2d;
/**
* Return a point for a given position on the curve according to the arc length.
* @param u Input a position on the curve according to the arc length. Must be in the range [0, 1].
* @returns Return a point for a given position on the curve according to the arc length.
*/
getPointAt(u: number): AcGePoint2d;
/**
* Return a set of divisions + 1 points using `getPoint(t)`.
* @param divisions Input number of pieces to divide the curve into. Default is 5.
* @returns Return a set of divisions + 1 points using `getPoint(t)`
*/
getPoints(divisions?: number): AcGePoint2d[];
/**
* Return a set of divisions + 1 equi-spaced points using `getPointAt(u)`.
* @param divisions Input number of pieces to divide the curve into. Default is 5.
* @returns Return a set of divisions + 1 equi-spaced points using `getPointAt(u)`.
*/
getSpacedPoints(divisions?: number): AcGePoint2d[];
/**
* Get total curve arc length.
* @returns Return total curve arc length.
*/
getLength(): number;
/**
* Get list of cumulative segment lengths.
* @param divisions Input number of pieces to divide the curve into.
* @returns Return list of cumulative segment lengths.
*/
getLengths(divisions?: number): number[];
/**
* Given `u` in the range (0 .. 1), returns t also in the range ( 0 .. 1 ). `u` and `t` can then be used to
* give you points which are equidistant from the ends of the curve, using `getPoint`.
*/
getUtoTmapping(u: number, distance?: number): number;
/**
* Return a unit vector tangent at `t`. If the derived curve does not implement its tangent derivation,
* two points a small delta apart will be used to find its gradient which seems to give a reasonable
* approximation.
* @param t Input a position on the curve. Must be in the range [ 0, 1 ].
* @returns Return a unit vector tangent at `t`.
*/
getTangent(t: number): AcGePoint2d;
/**
* Return tangent at a point which is equidistant to the ends of the curve from the point given in
* `getTangent`.
* @param u Input a position on the curve according to the arc length. Must be in the range [0, 1].
* @returns Return tangent at a point which is equidistant to the ends of the curve from the point
* given in `getTangent`.
*/
getTangentAt(u: number): AcGePoint2d;
}
//# sourceMappingURL=AcGeCurve2d.d.ts.map