@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
142 lines • 5.23 kB
TypeScript
import { AcGeBox3d, AcGeMatrix3d, AcGePlane, AcGePoint3d, AcGePointLike, AcGeVector3d, AcGeVector3dLike } from '../math';
import { AcGeCurve3d } from './AcGeCurve3d';
/**
* Class representing a 3d ellipse arc defined by center, normal, majorAxis, majorAxisRadius,
* minorAxisRadius, startAngle, and endAngle.
* - The majorAxis vector represents half the major axis of the ellipse (that is, from the center
* point to the start point of the ellipse) and is the zero angle for startAngle and endAngle.
* - Positive angles are counter-clockwise when looking down the normal vector (that is, right-hand
* rule). A startAngle of 0 and endAngle of 2pi will produce a closed Ellipse.
* - If startAngle is equal to 0 and endAngle is equal to 2 * Math.PI, it represents a full 3d ellipse.
*/
export declare class AcGeEllipseArc3d extends AcGeCurve3d {
private _center;
private _normal;
private _majorAxis;
private _majorAxisRadius;
private _minorAxisRadius;
private _startAngle;
private _endAngle;
/**
* Construct an instance of the ellipse arc.
* @param center Center point of the ellipse.
* @param normal Normal vector defining the plane of the ellipse
* @param majorAxis Major axis vector (in WCS coordinates) of the ellipse.
* @param majorAxisRadius Major axis radius of the ellipse.
* @param minorAxisRadius Minor axis radius of the ellipse.
* @param startAngle Start angle of the ellipse arc in radians.
* @param endAngle End angle of the ellipse arc in radians.
*/
constructor(center: AcGePointLike, normal: AcGeVector3dLike, majorAxis: AcGeVector3dLike, majorAxisRadius: number, minorAxisRadius: number, startAngle?: number, endAngle?: number);
/**
* Center of the ellipse in 3d space
*/
get center(): AcGePoint3d;
set center(value: AcGePointLike);
/**
* Major axis radius of the ellipse
*/
get majorAxisRadius(): number;
set majorAxisRadius(value: number);
/**
* Minor axis radius of the ellipse
*/
get minorAxisRadius(): number;
set minorAxisRadius(value: number);
/**
* Start angle of the ellipse arc in radians in the range -pi to pi.
*/
get startAngle(): number;
set startAngle(value: number);
/**
* End angle of the ellipse arc in radians in the range -pi to pi.
*/
get endAngle(): number;
set endAngle(value: number);
/**
* Return angle between endAngle and startAngle in range 0 to 2*PI
*/
get deltaAngle(): number;
/**
* Return true if the arc is a large arc whose delta angle value is greater than PI.
*/
get isLargeArc(): 0 | 1;
/**
* Return true if the arc is clockwise from startAngle to endAngle
*/
get clockwise(): boolean;
/**
* Unit normal vector defining the plane of the ellipse
*/
get normal(): AcGeVector3d;
set normal(value: AcGeVector3dLike);
/**
* Unit major axis vector (in WCS coordinates) of the ellipse. The major axis vector is the vector from the
* ellipse's center point to its start point.
*/
get majorAxis(): AcGeVector3d;
set majorAxis(value: AcGeVector3dLike);
/**
* Unit minor axis vector (in WCS coordinates) of the ellipse.
*/
get minorAxis(): AcGeVector3d;
/**
* Compute the start point of the ellipse arc.
* @returns Return the start point of the ellipse arc.
*/
get startPoint(): AcGePoint3d;
/**
* Compute the end point of the ellipse arc.
* @returns Return the end point of the ellipse arc.
*/
get endPoint(): AcGePoint3d;
/**
* @inheritdoc
*/
/**
* Check if this ellipse arc is actually a circular arc (major and minor radii are equal)
* @returns True if the ellipse arc is circular
*/
get isCircular(): boolean;
get length(): number;
/**
* Compute the bounding box of the 3D ellipse arc.
* The bounding box is defined by its minimum and maximum x, y, and z coordinates.
* @returns Return bounding box containing the min and max coordinates
*/
calculateBoundingBox(): AcGeBox3d;
/**
* Return true if its start point is identical to its end point. Otherwise, return false.
*/
get closed(): boolean;
getPoints(numPoints?: number): AcGePoint3d[];
/**
* Calculate a point on the ellipse at a given angle.
* @param angle Input the angle in radians where the point is to be calculated.
* @returns Return the 3d coordinates of the point on the ellipse.
*/
getPointAtAngle(angle: number): AcGePoint3d;
/**
* Determines whether a given point is inside the ellipse.
* @param point - The 3D point to check.
* @returns - True if the point is inside the ellipse, false otherwise.
*/
contains(point: AcGePoint3d): boolean;
/**
* @inheritdoc
*/
transform(_matrix: AcGeMatrix3d): this;
/**
* @inheritdoc
*/
copy(value: AcGeEllipseArc3d): this;
/**
* @inheritdoc
*/
clone(): AcGeEllipseArc3d;
/**
* Return the plane in which the ellipse arc lies.
*/
get plane(): AcGePlane;
}
//# sourceMappingURL=AcGeEllipseArc3d.d.ts.map