UNPKG

@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

108 lines 3.62 kB
import { AcGeBox2d, AcGeMatrix2d, AcGePoint2d, AcGePoint2dLike } from '../math'; import { AcGeCurve2d } from './AcGeCurve2d'; /** * Represent a circular arc. */ export declare class AcGeCircArc2d extends AcGeCurve2d { private _center; private _radius; private _startAngle; private _endAngle; private _clockwise; constructor(p1: AcGePoint2dLike, p2: AcGePoint2dLike, p3: AcGePoint2dLike); constructor(start: AcGePoint2dLike, end: AcGePoint2dLike, bulge: number); constructor(center: AcGePoint2dLike, radius: number, startAngle: number, endAngle: number, clockwise: boolean); /** * Create arc by three points * @param p1 Input the start point * @param p2 Input one point between the start point and the end point * @param p3 Input the end point */ private createByThreePoints; /** * Create circular arc by two points and one bugle factor * @param from Input start point * @param to Input end point * @param bulge Input the bulge factor used to indicate how much of an arc segment is present at this * vertex. The bulge factor is the tangent of one fourth the included angle for an arc segment, made * negative if the arc goes clockwise from the start point to the endpoint. A bulge of 0 indicates a * straight segment, and a bulge of 1 is a semicircle. Get more details from the following links. * - https://ezdxf.readthedocs.io/en/stable/dxfentities/lwpolyline.html * - https://www.afralisp.net/archive/lisp/Bulges1.htm */ private createByStartEndPointsAndBulge; /** * Center of circular arc */ get center(): AcGePoint2d; set center(value: AcGePoint2dLike); /** * Radius of circular arc */ get radius(): number; set radius(value: number); /** * Start angle in radians of circular arc in the range 0 to 2 * PI. */ get startAngle(): number; set startAngle(value: number); /** * End angle in radians of circular arc in the range 0 to 2 * PI. */ get endAngle(): number; set endAngle(value: number); /** * Angle between endAngle and startAngle in range 0 to 2*PI */ get deltaAngle(): number; /** * Rotation direction of the arc. */ get clockwise(): boolean; set clockwise(value: boolean); /** * Start point of circular arc */ get startPoint(): AcGePoint2d; /** * End point of circular arc */ get endPoint(): AcGePoint2d; /** * Middle point of circular arc */ get midPoint(): AcGePoint2d; /** * Return true if its start point is identical to its end point. Otherwise, return false. */ get closed(): boolean; /** * @inheritdoc */ calculateBoundingBox(): AcGeBox2d; /** * Get length of circular arc */ get length(): number; /** * @inheritdoc */ transform(_matrix: AcGeMatrix2d): this; /** * @inheritdoc */ clone(): AcGeCircArc2d; /** * 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 2d coordinates of the point on the circular arc. */ getPointAtAngle(angle: number): AcGePoint2d; /** * Divide this arc into the specified nubmer of points and return those points as an array of points. * @param numPoints Input the nubmer of points returned * @returns Return an array of points */ getPoints(numPoints?: number): AcGePoint2d[]; } //# sourceMappingURL=AcGeCircArc2d.d.ts.map