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 the constructing the 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
constructor(): Arc3d Protected    
allPerpendicularAngles(spacePoint: Point3d, _extend: boolean = true, _endpoints: boolean = false): number[] Return all angles (in radians) 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.  
circularRadius(): number | undefined If the arc is circular, return its radius.  
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): CurvePrimitive | undefined Return (if possible) an arc which is a portion of this curve.  
cloneTransformed(transform: Transform): CurvePrimitive 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.  
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 tof the arc.  
extendRange(range: Range3d, transform?: Transform): void Extend a range to include the range of the arc.  
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
origin at the fractional position along the arc
x axis is the first derivative, i.e.
 
fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d Convert a fractional position to xyz coordinates and derivative with respect to fraction.  
getFractionToDistanceScale(): number | undefined The arc has simple proportional arc length if and only if it is a circular arc.  
isAlmostEqual(otherGeometry: GeometryQuery): 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.  
maxVectorLength(): number Return the larger of the two defining vectors.  
moveSignedDistanceFromFraction(startFraction: number, signedDistance: number, allowExtension: false, result?: CurveLocationDetail): CurveLocationDetail See extended comments on CurvePrimitive.moveSignedDistanceFromFraction
A zero length line generates CurveSearchStatus.error
* Nonzero length line generates CurveSearchStatus.success or CurveSearchStatus.stoppedAtBoundary
 
otherArcAsLocalVectors(other: Arc3d): ArcVectors | undefined Compute the center and vectors of another arc as local coordinates within this arc's frame.  
quickEccentricity(): number Return a quick estimate of the eccentricity of the ellipse.  
quickLength(): number Return an approximate (but easy to compute) arc length.  
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
origin at arc center
vectorU from center to arc at angle (in radians)
* vectorV from center to arc at 90 degrees past the angle.
 
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 | undefined): 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:
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)
 
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 tof the arc.  
toJSON(): any Convert to a JSON object.  
toScaledMatrix3d(): object Return the arc definition with rigid matrix form with axis radii.  
toTransformedPoint4d(matrix: Matrix4d): object Return the arc definition with center, two vectors, and angle sweep, transformed to 4d points.  
toTransformedVectors(transform?: Transform): object 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 Creat 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  
createCircularStartMiddleEnd(pointA: XYAndZ, pointB: XYAndZ, pointC: XYAndZ, result?: Arc3d): Arc3d | LineString3d | undefined Static Create a circular arc defined by start point, any intermediate point, and end point.  
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.  
createUnitCircle(): Arc3d Static Create a new arc which is a unit circle centered at the origin.  
createXY(center: Point3d, radius: number, sweep: AngleSweep = AngleSweep.create360()): 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 = AngleSweep.create360()): 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 parameter space.  

Inherited methods

Name Inherited from Description
addMappedStrokesToLineString3D(map: StrokeCountMap, linestring: LineString3d): number CurvePrimitive * evaluate strokes at fractions indicated in a StrokeCountMap.
computeAndAttachRecursiveStrokeCounts(options?: StrokeOptions, parentMap?: StrokeCountMap): void CurvePrimitive attach StrokeCountMap structure to this primitive (and recursively to any children)
* Base class implementation (here) gets the simple count from computeStrokeCountForOptions and attaches it.
curveLengthWithFixedIntervalCountQuadrature(fraction0: number, fraction1: number, numInterval: number, numGauss: number = 5): number CurvePrimitive Run an integration (with a default gaussian quadrature) with a fixed fractional step
This is typically called by specific curve type implementations of curveLengthBetweenFractions.
fractionAndDistanceToPointOnTangent(fraction: number, distance: number): Point3d CurvePrimitive Construct a point extrapolated along tangent at fraction.
fractionToFrenetFrame(fraction: number, result?: Transform): Transform | undefined CurvePrimitive Construct a frenet frame:
origin at the point on the curve
x axis is unit vector along the curve (tangent)
* y axis is perpendicular and in the plane of the osculating circle.
fractionToPointAndUnitTangent(fraction: number, result?: Ray3d): Ray3d CurvePrimitive Returns a ray whose origin is the curve point and direction is the unit tangent.
moveSignedDistanceFromFractionGeneric(startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail): CurveLocationDetail Protected CurvePrimitive Generic algorithm to search for point at signed distance from a fractional startPoint.
range(transform?: Transform, result?: Range3d): Range3d GeometryQuery return the range of the entire (tree) GeometryQuery
tryTranslateInPlace(dx: number, dy: number = 0, dz: number = 0): boolean GeometryQuery try to move the geometry by dx,dy,dz
installStrokeCountMap(curve: CurvePrimitive, curveMap: StrokeCountMap, parentMap?: StrokeCountMap): void Static CurvePrimitive final install step to save curveMap in curve.

Properties

Name Type Description
center Accessor ReadOnly Point3d read property for (clone of) center  
curvePrimitiveType "arc" = "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  
matrix Accessor ReadOnly Matrix3d read property for (clone of!) matrix of vector0, vector90, unit normal  
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 5 Gauss point quadrature count for evaluating curve length.  
quadratureIntervalAngleDegrees Static 10 In quadrature for arc length, use this interval (divided by quickEccentricity)  
sweep Accessor AngleSweep property getter for the angle sweep  
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 ReadOnly GeometryQuery[] | undefined GeometryQuery return GeometryQuery children for recursive queries.

* leaf classes do not need to implement.
geometryCategory "curvePrimitive" = "curvePrimitive" CurvePrimitive String name for schema properties
strokeData undefined | StrokeCountMap CurvePrimitive data attached during stroking for facets.

Defined in

Last Updated: 08 January, 2020