/** @packageDocumentation * @module Curve */ import { Clipper } from "../clipping/ClipUtils"; import { BeJSONFunctions, PlaneAltitudeEvaluator } from "../Geometry"; import { Angle } from "../geometry3d/Angle"; import { AngleSweep } from "../geometry3d/AngleSweep"; import { GeometryHandler, IStrokeHandler } from "../geometry3d/GeometryHandler"; import { Matrix3d } from "../geometry3d/Matrix3d"; import { Plane3dByOriginAndUnitNormal } from "../geometry3d/Plane3dByOriginAndUnitNormal"; import { Plane3dByOriginAndVectors } from "../geometry3d/Plane3dByOriginAndVectors"; import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d"; import { Range1d, Range3d } from "../geometry3d/Range"; import { Ray3d } from "../geometry3d/Ray3d"; import { Transform } from "../geometry3d/Transform"; import { XYAndZ } from "../geometry3d/XYZProps"; import { Matrix4d } from "../geometry4d/Matrix4d"; import { Point4d } from "../geometry4d/Point4d"; import { SineCosinePolynomial } from "../numerics/Polynomials"; import { CurveChain } from "./CurveCollection"; import { VariantCurveExtendParameter } from "./CurveExtendMode"; import { CurveLocationDetail } from "./CurveLocationDetail"; import { AnnounceNumberNumberCurvePrimitive, CurvePrimitive, TangentOptions } from "./CurvePrimitive"; import { GeometryQuery } from "./GeometryQuery"; import { LineSegment3d } from "./LineSegment3d"; import { LineString3d } from "./LineString3d"; import { OffsetOptions } from "./OffsetOptions"; import { StrokeOptions } from "./StrokeOptions"; /** * Compact vector form of an elliptic arc defined by center, vectors at 0 and 90 degrees, and angular sweep. * * @see [Curve Collections]($docs/learning/geometry/CurvePrimitive.md) learning article for further details of the * parameterization and meaning of the vectors. * @public */ export interface ArcVectors { /** Center point of arc. */ center: Point3d; /** Vector from the arc center to the arc point at parameter 0 degrees. */ vector0: Vector3d; /** Vector from the arc center to the arc point at parameter 90 degrees. */ vector90: Vector3d; /** Angular range swept by the arc, of length less than 2*pi if not a full ellipse. */ sweep: AngleSweep; } /** * Carrier structure for an arc with fractional data on incoming, outgoing curves. * @public */ export interface ArcBlendData { /** Constructed arc. */ arc?: Arc3d; /** Fraction "moving backward" on the inbound curve. */ fraction10: number; /** Fraction "moving forward" on the outbound curve. */ fraction12: number; /** Optional reference point. */ point?: Point3d; } /** * Enumeration of methods used to sample an elliptical arc in [[Arc3d.constructCircularArcChainApproximation]]. * * Because ellipses have two axes of symmetry, samples are computed for one quadrant and reflected across each * axis to the other quadrants. Any samples that fall outside the arc sweep are filtered out. * @public */ export declare enum EllipticalArcSampleMethod { /** Generate n samples uniformly interpolated between the min and max parameters of a full ellipse quadrant. */ UniformParameter = 0, /** Generate n samples uniformly interpolated between the min and max curvatures of a full ellipse quadrant. */ UniformCurvature = 1, /** * Generate n samples interpolated between the min and max curvatures of a full ellipse quadrant, using a * [[FractionMapper]] callback to generate the interpolation weights. */ NonUniformCurvature = 2, /** * Generate samples by subdividing parameter space until the approximation has less than a given max * distance to the elliptical arc. */ AdaptiveSubdivision = 3 } /** * A function that maps [0,1]->[0,1]. * @public */ export type FractionMapper = (f: number) => number; /** * Options for generating samples for the construction of an approximation to an elliptical arc. * * Used by [[Arc3d.constructCircularArcChainApproximation]]. * @public */ export declare class EllipticalArcApproximationOptions { private _sampleMethod; private _numSamplesInQuadrant; private _maxError; private _remapFunction; private _forcePath; /** Default error tolerance. */ static defaultMaxError: number; private constructor(); /** * Construct options with optional defaults. * @param method sample method, default [[EllipticalArcSampleMethod.AdaptiveSubdivision]]. * @param numSamplesInQuadrant samples in each full quadrant for interpolation methods, default 4. * @param maxError positive maximum distance to ellipse for the subdivision method, default 1cm. * @param remapFunction optional callback to remap fraction space for [[EllipticalArcSampleMethod.NonUniformCurvature]], * default quadratic. For best results, this function should be a bijection. * @param forcePath whether to return a [[Path]] instead of a [[Loop]] when approximating a full elliptical arc, * default false. */ static create(method?: EllipticalArcSampleMethod, numSamplesInQuadrant?: number, maxError?: number, remapFunction?: FractionMapper, forcePath?: boolean): EllipticalArcApproximationOptions; /** Clone the options. */ clone(): EllipticalArcApproximationOptions; /** Method used to sample the elliptical arc. */ get sampleMethod(): EllipticalArcSampleMethod; set sampleMethod(method: EllipticalArcSampleMethod); /** * Number of samples to return in each full quadrant, including endpoint(s). * * Used by interpolation sample methods. * * In general, for n samples, the approximating [[Path]] consists of n-1 primitives, * and the approximating [[Loop]] consists of n primitives. * * Minimum value is 2. */ get numSamplesInQuadrant(): number; set numSamplesInQuadrant(numSamples: number); /** * Maximum distance (in meters) of the computed approximation to the elliptical arc. * * Used by [[EllipticalArcSampleMethod.AdaptiveSubdivision]]. */ get maxError(): number; set maxError(error: number); /** * Callback function to remap fraction space to fraction space. * * Used by [[EllipticalArcSampleMethod.NonUniformCurvature]]. */ get remapFunction(): FractionMapper; set remapFunction(f: FractionMapper); /** Whether to return a [[Path]] instead of a [[Loop]] when approximating a full (closed) ellipse. */ get forcePath(): boolean; set forcePath(value: boolean); } /** * Circular or elliptic arc. * * The angle to point equation is: * * `X = center + cos(theta) * vector0 + sin(theta) * vector90` * * The arc's `sweep` determines the range of theta values (angles). In particular: * * The point at `theta = n*360` degrees is `center + vector0` for any integer n. * * The point at `theta = 90 + n*360` degrees is `center + vector90` for any integer n. * * The arc's `sweep` _together with_ `vector0` and `vector90` determine the arc's orientation: * * If `sweep.startDegrees < sweep.endDegrees`, the arc's orientation is counterclockwise with respect to its * `perpendicularVector` (i.e., looking at the arc from the head of this vector). * * Similarly, if `sweep.startDegrees > sweep.endDegrees`, the arc's orientation is clockwise with respect to * its `perpendicularVector`. * * The arc's orientation is _always_ counterclockwise with respect to its `binormalVector`. * * When `vector0` and `vector90` are perpendicular and have equal length, the arc is circular. * * When they are non-perpendicular, the arc is always elliptic. * * When they have unequal length, the arc is always elliptic. * * To create an ellipse in standard major-minor axis form: * * `vector0` is the vector from the center to the major axis extreme. * * `vector90` is the vector from the center to the minor axis extreme. * * Note that constructing these vectors to the extreme points makes them perpendicular. * * The method [[Arc3d.toScaledMatrix3d]] can be called to convert an arc with unrestricted `vector0` and `vector90` * to an arc in standard major-minor axis form. * * The unrestricted form is much easier to work with for common calculations: stroking, projection to 2d, * intersection with plane. * @public */ export declare class Arc3d extends CurvePrimitive implements BeJSONFunctions { /** String name for schema properties. */ readonly curvePrimitiveType = "arc"; /** Test if this and other are both instances of Arc3d. */ isSameGeometryClass(other: GeometryQuery): boolean; private _center; private _matrix; private _sweep; private static _workPointA; private static _workPointB; private static _workPointC; private static _workVectorU; private static _workVectorV; private static _workVectorW; private static _workRay0; private static _workRay1; private static _workRay2; /** Read/write the center. Getter returns clone. */ get center(): Point3d; set center(center: XYAndZ); /** Read property for (reference to) the arc center. */ get centerRef(): Point3d; /** * Read property for (clone of) the x-column of the arc matrix. * * This vector determines the point on the arc corresponding to angles n*360 degrees. */ get vector0(): Vector3d; /** * Read property for (clone of) the y-column of the arc matrix. * * This vector determines the point on the arc corresponding to angles 90 + n*360 degrees. */ get vector90(): Vector3d; /** * Compute an arc binormal vector with arbitrary length. * * The arc parameterization is counterclockwise with respect to this vector. * * This vector is parallel to [[perpendicularVector]] and possibly opposite. */ binormalVector(result?: Vector3d): Vector3d; /** * Read property for (clone of) the z-column of the arc matrix. * * This vector is nominally the normalized cross product: `vector0 x vector90`. * * To compute a vector with respect to which the arc sweep is counterclockwise, use [[binormalVector]]. */ get perpendicularVector(): Vector3d; /** Return a clone of the arc matrix. */ matrixClone(): Matrix3d; /** Read property for (reference to) the arc matrix. */ get matrixRef(): Matrix3d; /** Read/write the sweep. Getter returns reference. */ get sweep(): AngleSweep; set sweep(value: AngleSweep); /** An Arc3d extends along its complete elliptic arc. */ get isExtensibleFractionSpace(): boolean; /** Constructor. Captures the inputs. */ private constructor(); /** Return a clone of the arc, with transform applied. */ cloneTransformed(transform: Transform): Arc3d; /** * Redefine the arc with (captured references to) given data. * @param center arc center. * @param matrix matrix with columns vector0, vector90, and their unit cross product. * @param sweep angle sweep. */ setRefs(center: Point3d, matrix: Matrix3d, sweep: AngleSweep): void; /** * Redefine the arc with (copies of) the given data. * * Even if an input is omitted, the corresponding instance data is set to the default value. * * For example, all default inputs result in a unit circle centered at the origin in the xy-plane. * @param center arc center. Default is zero. * @param matrix matrix with columns vector0, vector90, and their unit cross product. Default is identity. * @param sweep angle sweep. Default is full sweep. * @returns the instance */ set(center?: Point3d, matrix?: Matrix3d, sweep?: AngleSweep): Arc3d; /** Copy center, matrix, and sweep from other Arc3d. */ setFrom(other: Arc3d): void; /** Return a clone of this arc. */ clone(): Arc3d; /** * Create an arc, capturing references to center, matrix and sweep. * * Default inputs construct a unit circle centered at the origin in the xy-plane. * @param center center point. Default is zero. * @param matrix matrix with columns vector0, vector90, and their unit cross product. Default is identity. * @param sweep sweep limits. Default is full sweep. * @param result optional preallocated result to receive copies of the inputs (or default values) and return. */ static createRefs(center?: Point3d, matrix?: Matrix3d, sweep?: AngleSweep, result?: Arc3d): Arc3d; /** * Create an arc from center, x column to be scaled, and y column to be scaled. * @param center center of ellipse. * @param matrix the x-column and y-column of this matrix are scaled by `radius0` and `radius90` to define the * arc's `vector0` and `vector90`. * @param radius0 radius along `vector0`. * @param radius90 radius along `vector90`. * @param sweep sweep limits. * @param result optional preallocated result. */ static createScaledXYColumns(center: Point3d | undefined, matrix: Matrix3d, radius0: number, radius90: number, sweep?: AngleSweep, result?: Arc3d): Arc3d; /** * Create a full circle from center, normal and radius. * @param center center of circle. If undefined, use 000. * @param normal normal vector. * @param radius radius of the circle. * @param result optional preallocated result. */ static createCenterNormalRadius(center: Point3d | undefined, normal: Vector3d, radius: number, result?: Arc3d): Arc3d; /** * Create an elliptical arc by center with vectors to points at 0 and 90 degrees in parameter space. * @param center arc center. * @param vector0 vector to 0 degrees (commonly major axis). * @param vector90 vector to 90 degree point (commonly minor axis). * @param sweep sweep limits; defaults to full sweep. * @param result optional preallocated result. */ static create(center: Point3d | undefined, vector0: Vector3d, vector90: Vector3d, sweep?: AngleSweep, result?: Arc3d): Arc3d; /** * Create an elliptical arc from three points on the ellipse: two points on an axis and one in between. * @param start start of arc, on an axis. * @param middle point on arc somewhere between `start` and `end`. * @param end point on arc directly opposite `start`. * @param sweep angular sweep, measured from `start` in the direction of `middle`. * For a half-ellipse from `start` to `end` passing through `middle`, pass `AngleSweep.createStartEndDegrees(0,180)`. * Default value is full sweep to create the entire ellipse. * @param result optional preallocated result. * @returns elliptical arc, or undefined if construction impossible. */ static createStartMiddleEnd(start: XYAndZ, middle: XYAndZ, end: XYAndZ, sweep?: AngleSweep, result?: Arc3d): Arc3d | undefined; /** * Create a circular arc defined by start point, tangent at start point, and end point. * * The circular arc is swept from `start` to `end` in the direction of `tangentAtStart`. * * If `tangentAtStart` is parallel to the line segment from `start` to `end`, return the line segment. */ static createCircularStartTangentEnd(start: Point3d, tangentAtStart: Vector3d, end: Point3d, result?: Arc3d): Arc3d | LineSegment3d; /** * Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep. * * The vector from start point to center is in the direction of upVector crossed with tangentA. * @param start start point. * @param tangentAtStart vector in tangent direction at the start. * @param radius signed radius. * @param upVector optional out-of-plane vector. Defaults to positive Z. * @param sweep angular range. If single `Angle` is given, start angle is at 0 degrees (the start point). */ static createCircularStartTangentRadius(start: Point3d, tangentAtStart: Vector3d, radius: number, upVector?: Vector3d, sweep?: Angle | AngleSweep): Arc3d | undefined; /** * Create a circular arc defined by start and end points and radius. * @param start start point of the arc. * @param end end point of the arc. * @param helper a third point near the arc in its plane, or a vector in the direction of the arc normal. * @param result optional preallocated result to populate and return. * @returns the constructed arc, or undefined if desired arc cannot be constructed. */ static createCircularStartEndRadius(start: Point3d, end: Point3d, radius: number, helper: Point3d | Vector3d, result?: Arc3d): Arc3d | undefined; /** * Return a clone of this arc, projected to given z value. * * If `z` is omitted, the clone is at the z of the center. * * This function projects the arc into a plane parallel to xy-plane. * * Note that projection to fixed z can change circle into ellipse (and (rarely) ellipse to circle). */ cloneAtZ(z?: number): Arc3d; /** * Create an arc by center (cx,cy,xz) with vectors (ux,uy,uz) and (vx,vy,vz) to points at 0 and 90 degrees in * parameter space. * @param result optional preallocated result. */ static createXYZXYZXYZ(cx: number, cy: number, cz: number, ux: number, uy: number, uz: number, vx: number, vy: number, vz: number, sweep?: AngleSweep, result?: Arc3d): Arc3d; /** * Return a quick estimate of the eccentricity of the ellipse. * * The estimator is the cross magnitude of the product of vectors U and V, divided by square of the larger magnitude * * for typical Arc3d with perpendicular UV, this is exactly the small axis divided by large. * * note that the eccentricity is AT MOST ONE. */ quickEccentricity(): number; /** * Create a circular arc defined by start point, any intermediate point, and end point. * If the points are colinear, assemble them into a linestring. */ static createCircularStartMiddleEnd(pointA: XYAndZ, pointB: XYAndZ, pointC: XYAndZ, result?: Arc3d): Arc3d | LineString3d; /** The arc has simple proportional arc length if and only if it is a circular arc. */ getFractionToDistanceScale(): number | undefined; /** * Convert a fractional position to xyz coordinates. * @param fraction fractional position on arc. * @param result optional preallocated result. */ fractionToPoint(fraction: number, result?: Point3d): Point3d; /** * Convert fractional arc and radial positions to xyz coordinates. * @param fraction fractional position on arc. * @param result optional preallocated result. */ fractionAndRadialFractionToPoint(arcFraction: number, radialFraction: number, result?: Point3d): Point3d; /** * Convert a fractional position to xyz coordinates and derivative with respect to fraction. * @param fraction fractional position on arc. * @param result optional preallocated result. */ fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d; /** * Construct a plane with * * origin at the fractional position along the arc. * * x axis is the first derivative, i.e. tangent along the arc. * * y axis is the second derivative, i.e. in the plane and on the center side of the tangent. * If the arc is circular, the second derivative is directly towards the center. */ fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors; /** * Evaluate the point and derivative with respect to the angle (in radians). * @param radians angular position. * @param result optional preallocated ray. */ radiansToPointAndDerivative(radians: number, result?: Ray3d): Ray3d; /** * Evaluate the point with respect to the angle (in radians). * @param radians angular position. * @param result optional preallocated ray. */ radiansToPoint(radians: number, result?: Point3d): Point3d; /** * Return a parametric plane with * * origin at arc center. * * vectorU from center to arc at angle (in radians). * * vectorV from center to arc at 90 degrees past the angle. * @param radians angular position. * @param result optional preallocated plane. */ radiansToRotatedBasis(radians: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors; /** * Evaluate the point and derivative with respect to the angle (in radians). * @param theta angular position. * @param result optional preallocated ray. */ angleToPointAndDerivative(theta: Angle, result?: Ray3d): Ray3d; /** * Return the start point of the arc. * @param result optional preallocated result. */ startPoint(result?: Point3d): Point3d; /** * Whether the start and end points are defined and within tolerance. * * Does not check for degeneracy. * @param tolerance optional distance tolerance (default is [[Geometry.smallMetricDistance]]) * @param xyOnly if true, ignore z coordinate (default is `false`) */ isPhysicallyClosedCurve(tolerance?: number, xyOnly?: boolean): boolean; /** * Return the end point of the arc. * @param result optional preallocated result. */ endPoint(result?: Point3d): Point3d; /** * If this is a circular arc, return the simple length derived from radius and sweep. * * Otherwise (i.e. if this elliptical) fall through to CurvePrimitive base implementation which * Uses quadrature. */ curveLength(): number; /** * Gauss point quadrature count for evaluating curve length. (The number of intervals is adjusted to the arc sweep). * @deprecated in 5.0 - might be removed in next major version. Use correct spelling quadratureGaussCount. */ static readonly quadratureGuassCount = 5; /** Gauss point quadrature count for evaluating curve length. (The number of intervals is adjusted to the arc sweep). */ static readonly quadratureGaussCount = 5; /** In quadrature for arc length, use this interval (divided by quickEccentricity). */ static readonly quadratureIntervalAngleDegrees = 10; /** * * If this is a circular arc, return the simple length derived from radius and sweep. * * Otherwise (i.e. if this elliptical) fall through CurvePrimitive integrator. */ curveLengthBetweenFractions(fraction0: number, fraction1: number): number; /** * Return an approximate (but easy to compute) arc length. * The estimate is: * * Form 8 chords on full circle, proportionally fewer for partials (but 2 extras if less than half circle). * * Sum the chord lengths. * * For a circle, we know this crude approximation has to be increased by a factor (theta/(2*sin(theta/2))). * * Apply that factor. * * Experiments confirm that this is within 3 percent for a variety of eccentricities and arc sweeps. */ quickLength(): number; /** * * See extended comments on `CurvePrimitive.moveSignedDistanceFromFraction`. * * A zero length line generates `CurveSearchStatus.error`. * * Nonzero length line generates `CurveSearchStatus.success` or `CurveSearchStatus.stoppedAtBoundary`. */ moveSignedDistanceFromFraction(startFraction: number, signedDistance: number, allowExtension: false, result?: CurveLocationDetail): CurveLocationDetail; /** * Return all radian angles where the ellipse tangent is perpendicular to the vector to a spacePoint. * @param spacePoint point of origin of vectors to the ellipse. * @param _extend always true. Sweep is ignored: perpendiculars for the full ellipse are returned. * @param endpoints if true, force the end radians into the result. */ allPerpendicularAngles(spacePoint: Point3d, _extend?: boolean, endpoints?: boolean): number[]; /** * Return details of the closest point on the arc, optionally extending to full ellipse. * @param spacePoint search for point closest to this point. * @param extend if true, consider projections to the complete ellipse. If false (default), consider only endpoints * and projections within the arc sweep. Note that for an open arc, extending one end is the same as extending both ends. * @param result optional preallocated result. */ closestPoint(spacePoint: Point3d, extend?: VariantCurveExtendParameter, result?: CurveLocationDetail): CurveLocationDetail; /** * Search for a point on the Arc3d that is closest to the spacePoint as viewed in the xy-plane (ignoring z). * * If the space point is exactly on the curve, this is the reverse of fractionToPoint. * * Since CurvePrimitive should always have start and end available as candidate points, this method should always * succeed. * @param spacePoint point in space. * @param extend if true, consider projections to the complete ellipse. If false (default), consider only endpoints * and projections within the arc sweep. Note that for an open arc, extending one end is the same as extending both ends. * @param result (optional) pre-allocated detail to populate and return. * @returns details of the closest point. */ closestPointXY(spacePoint: Point3d, extend?: VariantCurveExtendParameter, result?: CurveLocationDetail): CurveLocationDetail | undefined; /** Override of [[CurvePrimitive.emitTangents]] for Arc3d. */ emitTangents(spacePoint: Point3d, announceTangent: (tangent: CurveLocationDetail) => any, options?: TangentOptions): void; /** Reverse the sweep of the arc. */ reverseInPlace(): void; /** * Apply a transform to the arc basis vectors. * * nonuniform (i.e. skewing) transforms are allowed. * * The transformed vector0 and vector90 are NOT squared up as major minor axes (this is a good feature). */ tryTransformInPlace(transform: Transform): boolean; /** Return true if the ellipse center and basis vectors are in the plane. */ isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean; /** Return true if the vector0 and vector90 are of equal length and perpendicular. */ get isCircular(): boolean; /** Return true if the vector0 and vector90 xy parts are of equal length and perpendicular. */ get isCircularXY(): boolean; /** Return true if the arc has zero radius (is a point). */ get isDegenerateCircle(): boolean; /** Return radius if the vector0 and vector90 are of equal length and perpendicular. Ignores z. */ circularRadiusXY(): number | undefined; /** If the arc is circular, return its radius. Otherwise return undefined. */ circularRadius(): number | undefined; /** Return the larger length of the two defining vectors. */ maxVectorLength(): number; /** * Compute intersections with a plane. * @param plane plane to intersect. * @param result array of locations on the curve. */ appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number; /** * Extend a range to include the range of the arc. * @param range range being extended. * @param transform optional transform to apply to the arc. */ extendRange(range: Range3d, transform?: Transform): void; /** * Extend a range to include the range of the arc, using specified range in place of the arc range. * @param range range being extended. * @param transform optional transform to apply to the arc. */ extendRangeInSweep(range: Range3d, sweep: AngleSweep, transform?: Transform): void; /** * Returns a (high accuracy) range of the curve between fractional positions. * * Default implementation returns the range of the curve from clonePartialCurve. */ rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d; /** * Set up a SineCosinePolynomial as the function c+u*cos(theta)+v*sin(theta) where * c,u,v are coefficients obtained by evaluating altitude and velocity relative to the plane. * @param plane plane for altitude calculation. * @param result optional result. * @internal */ getPlaneAltitudeSineCosinePolynomial(plane: PlaneAltitudeEvaluator, result?: SineCosinePolynomial): SineCosinePolynomial; /** * Create a new arc which is a unit circle in the xy-plane centered at the origin. * @param result optional preallocated object to populate and return. */ static createUnitCircle(result?: Arc3d): Arc3d; /** * Create a new arc which is parallel to the xy plane, with given center and radius and optional angle sweep. * @param center center of arc. * @param radius radius of arc. * @param sweep sweep limits; defaults to full circle. * @param result optional preallocated object to populate and return. */ static createXY(center: Point3d, radius: number, sweep?: AngleSweep, result?: Arc3d): Arc3d; /** * Create a new arc which is parallel to the xy plane, with given center and x,y radii, and optional angle sweep * @param center center of ellipse. * @param radiusA x axis radius. * @param radiusB y axis radius. * @param sweep angle sweep. Default is full circle. * @param result optional preallocated object to populate and return. */ static createXYEllipse(center: Point3d, radiusA: number, radiusB: number, sweep?: AngleSweep, result?: Arc3d): Arc3d; /** * Replace the arc's 0 and 90 degree vectors. * @param vector0 vector from center to ellipse point at 0 degrees in parameter space. * @param vector90 vector from center to ellipse point at 90 degrees in parameter space. */ setVector0Vector90(vector0: Vector3d, vector90: Vector3d): void; /** * Return the symmetric definition of the arc, with rigid axes and radii. * * The caller can send the returned data into [[createScaledXYColumns]] to construct the major-minor axis * version of the instance arc. This formulation of the arc has the same shape, but has perpendicular axes, * from which the arc's symmetry is readily apparent. */ toScaledMatrix3d(): { center: Point3d; axes: Matrix3d; r0: number; r90: number; sweep: AngleSweep; }; /** Return the arc definition with center, two vectors, and angle sweep. */ toVectors(): ArcVectors; /** Return the arc definition with center, two vectors, and angle sweep, optionally transformed. */ toTransformedVectors(transform?: Transform): { center: Point3d; vector0: Vector3d; vector90: Vector3d; sweep: AngleSweep; }; /** Return the arc definition with center, two vectors, and angle sweep, transformed to 4d points. */ toTransformedPoint4d(matrix: Matrix4d): { center: Point4d; vector0: Point4d; vector90: Point4d; sweep: AngleSweep; }; /** * Set this arc from a json object with these values: * * center center point. * * vector0 vector from center to 0 degree point in parameter space (commonly but not always the major axis vector). * * vector90 vector from center to 90 degree point in parameter space (commonly but not always the minor axis vector). * @param json */ setFromJSON(json?: any): void; /** * Convert to a JSON object. * @return {*} [center: [], vector0:[], vector90:[], sweep []} */ toJSON(): any; /** Test if this arc is almost equal to another GeometryQuery object. */ isAlmostEqual(otherGeometry: GeometryQuery, distanceTol?: number, radianTol?: number): boolean; /** Emit strokes to caller-supplied linestring. */ emitStrokes(dest: LineString3d, options?: StrokeOptions): void; /** Emit strokes to caller-supplied handler. */ emitStrokableParts(handler: IStrokeHandler, options?: StrokeOptions): void; /** * Return the stroke count required for given options. * @param options StrokeOptions that determine count. */ computeStrokeCountForOptions(options?: StrokeOptions): number; /** Second step of double dispatch: call `handler.handleArc3d(this)` */ dispatchToGeometryHandler(handler: GeometryHandler): any; /** * Return (if possible) an arc which is a portion of this curve. * @param fractionA start fraction. * @param fractionB end fraction. */ clonePartialCurve(fractionA: number, fractionB: number): Arc3d; /** * Return an arc whose basis vectors are rotated by given angle within the current basis space. * * The returned arc will have `vector0 = this.vector0 * cos(theta) + this.vector90 * sin(theta)`. * * The returned arc has the same shape as the instance. * * In other words, the arc's sweep is adjusted so that all fractional parameters evaluate to the same points. * * Specifically, theta is subtracted from the original start and end angles. * @param theta the angle (in the input arc space) which is to become the 0-degree point in the new arc. */ cloneInRotatedBasis(theta: Angle): Arc3d; /** * Return a cloned arc with basis rotated to align with the global axes. The arc's shape is unchanged. * * This method is most useful when the instance is an xy-circular arc, for then the aligned arc's stored sweep * angles can be understood as being measured from the global positive x-axis to the arc's start/end. This is *not* * the case for xy-elliptical arcs: the parameter angle difference between two points on an ellipse is in general * not the same as the angle measured between their radials. * * For an xy instance, the output arc will have: * * vector0 is in the same direction as the positive x-axis * * perpendicularVector is in the same direction as the positive z-axis * * For a general instance, the output arc will have: * * vector0 is in the same direction as the projection of the positive x-axis vector onto the arc plane * * perpendicularVector lies in the halfspace z >= 0 * @returns cloned arc, or undefined (if the instance normal is parallel to the x-axis, or its matrix is singular) */ cloneAxisAligned(): Arc3d | undefined; /** * Find intervals of this CurvePrimitive that are interior to a clipper. * @param clipper clip structure (e.g.clip planes). * @param announce (optional) function to be called announcing fractional intervals * `announce(fraction0, fraction1, curvePrimitive)`. * @returns true if any "in" segments are announced. */ announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean; /** Compute the center and vectors of another arc as local coordinates within this arc's frame. */ otherArcAsLocalVectors(other: Arc3d): ArcVectors | undefined; /** * Determine an arc "at a point of inflection" of a point sequence. * * Return the arc along with the fractional positions of the tangency points. * * In the returned object: * * `arc` is the (bounded) arc. * * `fraction10` is the tangency point's position as an interpolating fraction of the line segment from * `point1` (backwards) to `point0`. * * `fraction12` is the tangency point's position as an interpolating fraction of the line segment from * `point1` (forward) to `point2`. * * `point` is the `point1` input. * * If unable to construct the arc: * * `point` is the `point1` input. * * both fractions are zero. * * `arc` is undefined. * @param point0 first point of path (the point before the point of inflection). * @param point1 second point of path (the point of inflection). * @param point2 third point of path (the point after the point of inflection). * @param radius arc radius. */ static createFilletArc(point0: Point3d, point1: Point3d, point2: Point3d, radius: number): ArcBlendData; /** Scale the vector0 and vector90 vectors by `scaleFactor`. */ scaleAboutCenterInPlace(scaleFactor: number): void; /** Return the (signed) area between (a fractional portion of) the arc and the chord between those points. */ areaToChordXY(fraction0: number, fraction1: number): number; /** * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z). * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object. */ constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): CurvePrimitive | CurvePrimitive[] | undefined; /** * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of projection. * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin. * @param lowHigh optional receiver for output. * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the end of the ray. */ projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined; /** * Construct a circular arc chain approximation to the instance elliptical arc. * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/ArcApproximationGeneral and * https://www.itwinjs.org/sandbox/SaeedTorabi/ArcApproximation * @param options bundle of options for sampling an elliptical arc (use default options if undefined). * @returns the approximating curve chain, the circular instance, or undefined if construction fails. */ constructCircularArcChainApproximation(options?: EllipticalArcApproximationOptions): CurveChain | Arc3d | undefined; /** * Compute the intersection of the tangent vectors at two fractional parameters along the arc. * * In the civil design context of filleting a line string, the default values yield a fillet arc's "point of * intersection", aka _PI_. This point is the line string vertex that was rounded by the fillet arc placed * between the vertex's adjacent segments. In other words, the original line string vertices can be recovered * from the fillets with this method. * @param f0 fractional parameter of one tangent. Default is 0 (the arc's start tangent). * @param f1 fractional parameter of the other tangent. Default is 1 (the arc's end tangent). * @param result optional point to populate and return. * @returns intersection point, or undefined if tangents are zero or parallel. */ computeTangentIntersection(f0?: number, f1?: number, result?: Point3d): Point3d | undefined; } //# sourceMappingURL=Arc3d.d.ts.map