Arc3d Class

Circular or elliptic arc.

  • The angle to point equation is:
    • X = center + cos(theta) * vector0 + sin(theta) * vector90
  • When the two vectors are perpendicular and have equal length, it is a true circle.
  • Non-perpendicular vectors are always elliptic.
  • Vectors of unequal length are always elliptic.
  • To create an ellipse in the common "major and minor axis" form of an ellipse:
    • 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 toScaledMatrix3d() can be called to convert the unrestricted vector0, vector90 to perpendicular form.
  • The unrestricted form is much easier to work with for common calculations: stroking, projection to 2d, intersection with plane.

Extends

Implements

Methods

Name Description
allPerpendicularAngles(spacePoint: Point3d, _extend: booleantrue, endpoints: booleanfalse): number[] Return all radian angles where the ellipse tangent is perpendicular to the vector to a spacePoint.  
angleToPointAndDerivative(theta: Angle, result?: Ray3d): Ray3d Evaluate the point and derivative with respect to the angle (in radians).  
announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean Find intervals of this CurvePrimitive that are interior to a clipper.  
appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number Compute intersections with a plane.  
areaToChordXY(fraction0: number, fraction1: number): number Return the (signed!) area between (a fractional portion of) the arc and the chord between those points.  
circularRadius(): undefined | number If the arc is circular, return its radius.  
circularRadiusXY(): undefined | number Return radius if the vector0 and vector90 are of equal length and perpendicular.  
clone(): Arc3d Return a clone of this arc.  
cloneAtZ(z?: number): Arc3d Return a clone of this arc, projected to given z value.  
cloneInRotatedBasis(theta: Angle): Arc3d Return an arc whose basis vectors are rotated by given angle within the current basis space.  
clonePartialCurve(fractionA: number, fractionB: number): Arc3d Return (if possible) an arc which is a portion of this curve.  
cloneTransformed(transform: Transform): Arc3d Return a clone of the arc, with transform applied.  
closestPoint(spacePoint: Point3d, extend: VariantCurveExtendParameter, result?: CurveLocationDetail): CurveLocationDetail Return details of the closest point on the arc, optionally extending to full ellipse.  
computeStrokeCountForOptions(options?: StrokeOptions): number Return the stroke count required for given options.  
constructCircularArcChainApproximation(options?: EllipticalArcApproximationOptions): undefined | Arc3d | CurveChain Construct a circular arc chain approximation to the instance elliptical arc.  
constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): undefined | CurvePrimitive | CurvePrimitive[] Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).  
curveLength(): number If this is a circular arc, return the simple length derived from radius and sweep.  
curveLengthBetweenFractions(fraction0: number, fraction1: number): number * If this is a circular arc, return the simple length derived from radius and sweep.  
dispatchToGeometryHandler(handler: GeometryHandler): any Second step of double dispatch: call handler.handleArc3d(this)  
emitStrokableParts(handler: IStrokeHandler, options?: StrokeOptions): void Emit strokes to caller-supplied handler.  
emitStrokes(dest: LineString3d, options?: StrokeOptions): void Emit strokes to caller-supplied linestring.  
endPoint(result?: Point3d): Point3d Return the end point of the arc.  
extendRange(range: Range3d, transform?: Transform): void Extend a range to include the range of the arc.  
extendRangeInSweep(range: Range3d, sweep: AngleSweep, transform?: Transform): void Extend a range to include the range of the arc, using specified range in place of the arc range.  
fractionAndRadialFractionToPoint(arcFraction: number, radialFraction: number, result?: Point3d): Point3d Convert fractional arc and radial positions to xyz coordinates.  
fractionToPoint(fraction: number, result?: Point3d): Point3d Convert a fractional position to xyz coordinates.  
fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors Construct a plane with  
fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d Convert a fractional position to xyz coordinates and derivative with respect to fraction.  
getFractionToDistanceScale(): undefined | number The arc has simple proportional arc length if and only if it is a circular arc.  
isAlmostEqual(otherGeometry: GeometryQuery, distanceTol: numberGeometry.smallMetricDistance, radianTol: numberGeometry.smallAngleRadians): boolean Test if this arc is almost equal to another GeometryQuery object.  
isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean Return true if the ellipse center and basis vectors are in the plane.  
isSameGeometryClass(other: GeometryQuery): boolean Test if this and other are both instances of Arc3d.  
matrixClone(): Matrix3d Read property for (clone of) matrix of vector0, vector90, unit normal.  
maxVectorLength(): number Return the larger length of the two defining vectors.  
moveSignedDistanceFromFraction(startFraction: number, signedDistance: number, allowExtension: "false", result?: CurveLocationDetail): CurveLocationDetail * See extended comments on CurvePrimitive.moveSignedDistanceFromFraction.  
otherArcAsLocalVectors(other: Arc3d): undefined | ArcVectors Compute the center and vectors of another arc as local coordinates within this arc's frame.  
projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): undefined | Range1d Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of projection.  
quickEccentricity(): number Return a quick estimate of the eccentricity of the ellipse.  
quickLength(): number Return an approximate (but easy to compute) arc length.  
radiansToPoint(radians: number, result?: Point3d): Point3d Evaluate the point with respect to the angle (in radians).  
radiansToPointAndDerivative(radians: number, result?: Ray3d): Ray3d Evaluate the point and derivative with respect to the angle (in radians).  
radiansToRotatedBasis(radians: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors Return a parametric plane with  
rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d Returns a (high accuracy) range of the curve between fractional positions.  
reverseInPlace(): void Reverse the sweep of the arc.  
scaleAboutCenterInPlace(scaleFactor: number): void Scale the vector0 and vector90 vectors by scaleFactor.  
set(center: Point3d, matrix: Matrix3d, sweep: AngleSweep): void Redefine the arc with (clones of) given data.  
setFrom(other: Arc3d): void Copy center, matrix, and sweep from other Arc3d.  
setFromJSON(json?: any): void Set this arc from a json object with these values:  
setRefs(center: Point3d, matrix: Matrix3d, sweep: AngleSweep): void Redefine the arc with (captured references to) given data.  
setVector0Vector90(vector0: Vector3d, vector90: Vector3d): void Replace the arc's 0 and 90 degree vectors.  
startPoint(result?: Point3d): Point3d Return the start point of the arc.  
toJSON(): any Convert to a JSON object.  
toScaledMatrix3d(): { axes: Matrix3d, center: Point3d, r0: number, r90: number, sweep: AngleSweep } Return the arc definition with rigid matrix form with axis radii.  
toTransformedPoint4d(matrix: Matrix4d): { center: Point4d, sweep: AngleSweep, vector0: Point4d, vector90: Point4d } Return the arc definition with center, two vectors, and angle sweep, transformed to 4d points.  
toTransformedVectors(transform?: Transform): { center: Point3d, sweep: AngleSweep, vector0: Vector3d, vector90: Vector3d } Return the arc definition with center, two vectors, and angle sweep, optionally transformed.  
toVectors(): ArcVectors Return the arc definition with center, two vectors, and angle sweep.  
tryTransformInPlace(transform: Transform): boolean Apply a transform to the arc basis vectors.  
create(center: Point3d, vector0: Vector3d, vector90: Vector3d, sweep?: AngleSweep, result?: Arc3d): Arc3d Static Create an arc by center with vectors to points at 0 and 90 degrees in parameter space.  
createCenterNormalRadius(center: Point3d, normal: Vector3d, radius: number, result?: Arc3d): Arc3d Static Create a (full circular) arc from center, normal and radius.  
createCircularStartEndRadius(start: Point3d, end: Point3d, radius: number, helper: Point3d | Vector3d): undefined | Arc3d Static Create a circular arc defined by start and end points and radius.  
createCircularStartMiddleEnd(pointA: Readonly<WritableXYAndZ>, pointB: Readonly<WritableXYAndZ>, pointC: Readonly<WritableXYAndZ>, result?: Arc3d): LineString3d | Arc3d Static Create a circular arc defined by start point, any intermediate point, and end point.  
createCircularStartTangentEnd(start: Point3d, tangentAtStart: Vector3d, end: Point3d, result?: Arc3d): LineSegment3d | Arc3d Static Create a circular arc defined by start point, tangent at start point, and end point.  
createCircularStartTangentRadius(start: Point3d, tangentAtStart: Vector3d, radius: number, upVector?: Vector3d, sweep?: Angle | AngleSweep): undefined | Arc3d Static Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep.  
createFilletArc(point0: Point3d, point1: Point3d, point2: Point3d, radius: number): ArcBlendData Static Determine an arc "at a point of inflection" of a point sequence.  
createRefs(center: Point3d, matrix: Matrix3d, sweep: AngleSweep, result?: Arc3d): Arc3d Static Create an arc, capturing references to center, matrix and sweep.  
createScaledXYColumns(center: Point3d, matrix: Matrix3d, radius0: number, radius90: number, sweep?: AngleSweep, result?: Arc3d): Arc3d Static Create an arc from center, x column to be scaled, and y column to be scaled.  
createStartMiddleEnd(start: Readonly<WritableXYAndZ>, middle: Readonly<WritableXYAndZ>, end: Readonly<WritableXYAndZ>, sweep?: AngleSweep, result?: Arc3d): undefined | Arc3d Static Create an elliptical arc from three points on the ellipse: two points on an axis and one in between.  
createUnitCircle(): Arc3d Static Create a new arc which is a unit circle in the xy-plane centered at the origin.  
createXY(center: Point3d, radius: number, sweep: AngleSweep...): Arc3d Static Create a new arc which is parallel to the xy plane, with given center and radius and optional angle sweep.  
createXYEllipse(center: Point3d, radiusA: number, radiusB: number, sweep: AngleSweep...): Arc3d Static Create a new arc which is parallel to the xy plane, with given center and x,y radii, and optional angle sweep  
createXYZXYZXYZ(cx: number, cy: number, cz: number, ux: number, uy: number, uz: number, vx: number, vy: number, vz: number, sweep?: AngleSweep, result?: Arc3d): Arc3d Static 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  

Inherited methods

Name Inherited from Description
addMappedStrokesToLineString3D(map: StrokeCountMap, linestring: LineString3d): number Inherited CurvePrimitive Evaluate strokes at fractions indicated in a StrokeCountMap.
collectCurvePrimitives(collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: booleanfalse, explodeLinestrings: booleanfalse): CurvePrimitive[] Inherited CurvePrimitive Return an array containing only the curve primitives.
collectCurvePrimitivesGo(collectorArray: CurvePrimitive[], _smallestPossiblePrimitives: boolean, _explodeLinestrings: booleanfalse): void Inherited CurvePrimitive Return an array containing only the curve primitives.
computeAndAttachRecursiveStrokeCounts(options?: StrokeOptions, parentMap?: StrokeCountMap): void Inherited CurvePrimitive Attach StrokeCountMap structure to this primitive (and recursively to any children)
curveLengthWithFixedIntervalCountQuadrature(fraction0: number, fraction1: number, numInterval: number, numGauss: number5): number Inherited CurvePrimitive Run an integration (with a default Gaussian quadrature) with a fixed fractional step
fractionAndDistanceToPointOnTangent(fraction: number, distance: number): Point3d Inherited CurvePrimitive Construct a point extrapolated along tangent at fraction.
fractionToCurvature(fraction: number): undefined | number Inherited CurvePrimitive Returns the (absolute) curvature magnitude.
fractionToFrenetFrame(fraction: number, result?: Transform): undefined | Transform Inherited CurvePrimitive Construct a frenet frame:
fractionToPointAndUnitTangent(fraction: number, result?: Ray3d): Ray3d Inherited CurvePrimitive Returns a ray whose origin is the curve point and direction is the unit tangent.
fractionToSignedXYRadiusOfCurvature(fraction: number): number Inherited CurvePrimitive Construct signed distance from a point on the planar curve to its center of curvature (in xy only).
moveSignedDistanceFromFractionGeneric(startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail): CurveLocationDetail Protected Inherited CurvePrimitive Generic algorithm to search for point at signed distance from a fractional startPoint.
range(transform?: Transform, result?: Range3d): Range3d Inherited CurvePrimitive Return the range of the entire GeometryQuery tree.
rangeBetweenFractionsByClone(fraction0: number, fraction1: number, transform?: Transform): Range3d Inherited CurvePrimitive Returns a (high accuracy) range of the curve between fractional positions
rangeBetweenFractionsByCount(fraction0: number, fraction1: number, count: number, transform?: Transform, extrapolationFactor: number0.0): Range3d Inherited CurvePrimitive Returns an approximate range based on a fixed number of evaluations
tryTranslateInPlace(dx: number, dy: number0.0, dz: number0.0): boolean Inherited CurvePrimitive Try to move the geometry by dx,dy,dz.
areAlmostEqual(a: GeometryQuery, b: GeometryQuery): boolean Static Inherited CurvePrimitive Apply instance method isAlmostEqual if both are defined.
installStrokeCountMap(curve: CurvePrimitive, curveMap: StrokeCountMap, parentMap?: StrokeCountMap): void Static Inherited CurvePrimitive Final install step to save curveMap in curve.

Properties

Name Type Description
center Accessor ReadOnly Point3d Read property for (clone of) center.  
curvePrimitiveType Readonly "arc" String name for schema properties.  
isCircular Accessor ReadOnly boolean Return true if the vector0 and vector90 are of equal length and perpendicular.  
isExtensibleFractionSpace Accessor ReadOnly boolean An Arc3d extends along its complete elliptic arc.  
matrixRef Accessor ReadOnly Matrix3d Read property for (reference to) matrix of vector0, vector90, unit normal.  
perpendicularVector Accessor ReadOnly Vector3d Read property for (clone of) plane normal, with arbitrary length.  
quadratureGuassCount Static Readonly "5" Gauss point quadrature count for evaluating curve length.  
quadratureIntervalAngleDegrees Static Readonly "10" In quadrature for arc length, use this interval (divided by quickEccentricity).  
sweep Accessor AngleSweep Sweep of the angle.  
vector0 Accessor ReadOnly Vector3d Read property for (clone of) vector0.  
vector90 Accessor ReadOnly Vector3d Read property for (clone of) vector90.  

Inherited properties

Name Type Inherited from Description
children Accessor Inherited ReadOnly undefined | GeometryQuery[] CurvePrimitive Return GeometryQuery children for recursive queries.
* leaf classes do not need to implement.
geometryCategory Readonly Inherited "curvePrimitive" CurvePrimitive String name for schema properties
parent Inherited any | undefined CurvePrimitive Data attached by various algorithms (e.g.
strokeData Inherited StrokeCountMap | undefined CurvePrimitive Data attached during stroking for facets.

Defined in

Last Updated: 14 November, 2024