DirectSpiral3d Class

DirectSpiral3d acts like a TransitionSpiral3d for serialization purposes, but implements spiral types that have "direct" xy calculations without the integrations required for IntegratedSpiral3d.

  • Each DirectSpiral3d carries an XYCurveEvaluator to give it specialized behavior.
  • Direct spirals that flow through serialization to native imodel02 are create with these static methods:
    • createArema
    • createJapaneseCubic
    • createAustralianRail
    • createDirectHalfCosine
    • createChineseCubic
    • createCzechCubic
    • createPolishCubic
    • createItalian
    • createWesternAustralian

Extends

Methods

Name Description
constructor(localToWorld: Transform, spiralType: undefined | string, originalProperties: undefined | TransitionConditionalProperties, nominalL1: number, nominalR1: number, activeFractionInterval: undefined | Segment1d, evaluator: ): DirectSpiral3d    
clone(): DirectSpiral3d Deep clone of this spiral  
computeStrokeCountForOptions(options?: StrokeOptions): number return the stroke count required for given options.  
dispatchToGeometryHandler(handler: GeometryHandler): any Second step of double dispatch: call handler.handleTransitionSpiral(this)  
emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void emit stroke fragments to dest handler.  
emitStrokes(dest: LineString3d, options?: StrokeOptions): void Add strokes from this spiral to dest.  
endPoint(): Point3d return the spiral end point.  
fractionToPoint(activeFraction: number, result?: Point3d): Point3d Evaluate curve point with respect to fraction.  
fractionToPointAnd2Derivatives(activeFraction: number, result?: Plane3dByOriginAndVectors): undefined | Plane3dByOriginAndVectors Return a plane with  
fractionToPointAndDerivative(activeFraction: number, result?: Ray3d): Ray3d Evaluate curve point and derivative with respect to fraction.  
isAlmostEqual(other: any): boolean compare various coordinate quantities  
isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean test if the local to world transform places the spiral xy plane into plane  
isSameGeometryClass(other: any): boolean Test if other is an instance of TransitionSpiral3d  
quickLength(): number Return quick length of the spiral.  
refreshComputedProperties(): void Recompute strokes  
reverseInPlace(): void Reverse the active interval and active strokes.  
startPoint(): Point3d Return the spiral start point.  
tryTransformInPlace(transformA: Transform): boolean apply transform to this spiral's local to world transform.  
createArema(localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d): undefined | DirectSpiral3d Static Create an Arema spiral clothoid approximation  
createAustralianRail(localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d): undefined | DirectSpiral3d Static Create an AustralianRailCorp spiral  
createChineseCubic(localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d): undefined | DirectSpiral3d Static Create a Chinese clothoid approximation  
createCzechCubic(localToWorld: Transform, nominalLx: number, nominalR1: number, activeInterval?: Segment1d): undefined | DirectSpiral3d Static Create a czech cubic.  
createDirectHalfCosine(localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d): undefined | DirectSpiral3d Static    
createFromLengthAndRadius(spiralType: string, radius0: undefined | number, radius1: undefined | number, bearing0: undefined | Angle, _bearing1: undefined | Angle, arcLength: undefined | number, activeInterval: undefined | Segment1d, localToWorld: Transform): undefined | TransitionSpiral3d Static Create (if possible) a DirectSpiral3d, applying various strict conditions appropriate to the spiral type.  
createItalian(localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d): undefined | DirectSpiral3d Static Create an italian spiral  
createJapaneseCubic(localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d): undefined | DirectSpiral3d Static Create an Japanese spiral clothoid approximation  
createMXCubicAlongArc(localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d): undefined | DirectSpiral3d Static Create an MX Cubic whose nominal length is close to along the curve.  
createPolishCubic(localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d): undefined | DirectSpiral3d Static Create a polish cubic  
createTruncatedClothoid(spiralType: string, localToWorld: Transform, numXTerm: number, numYTerm: number, originalProperties: undefined | TransitionConditionalProperties, nominalL1: number, nominalR1: number, activeInterval: undefined | Segment1d): undefined | DirectSpiral3d Static Create a spiral object which uses numXTerm terms from the clothoid X series and numYTerm from the clothoid Y series.  
createWesternAustralian(localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d): undefined | DirectSpiral3d Static Create a Western Australian direct spiral.  

Inherited methods

Name Inherited from Description
addMappedStrokesToLineString3D(map: StrokeCountMap, linestring: LineString3d): number TransitionSpiral3d * evaluate strokes at fractions indicated in a StrokeCountMap.
announceClipIntervals(_clipper: Clipper, _announce?: AnnounceNumberNumberCurvePrimitive): boolean TransitionSpiral3d Find intervals of this curvePrimitive that are interior to a clipper
appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number TransitionSpiral3d Compute intersections with a plane.
applyRigidPartOfTransform(transformA: Transform): undefined | { rigidAxes: Matrix3d, scale: number } Protected TransitionSpiral3d * If transformA is rigid with uniform scale, apply the rigid part of transformA to the localToWorld transform and return the scale and rigid separation.
clonePartialCurve(fractionA: number, fractionB: number): TransitionSpiral3d TransitionSpiral3d Return (if possible) a spiral which is a portion of this curve.
cloneTransformed(transform: Transform): TransitionSpiral3d TransitionSpiral3d Clone with a transform applied
closestPoint(spacePoint: Point3d, extend: VariantCurveExtendParameter): undefined | CurveLocationDetail TransitionSpiral3d Search for the curve point that is closest to the spacePoint.
collectCurvePrimitives(collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLinestrings: boolean = false): CurvePrimitive[] TransitionSpiral3d Return an array containing only the curve primitives.
collectCurvePrimitivesGo(collectorArray: CurvePrimitive[], _smallestPossiblePrimitives: boolean, _explodeLinestrings: boolean = false): void TransitionSpiral3d Return an array containing only the curve primitives.
computeAndAttachRecursiveStrokeCounts(options?: StrokeOptions, parentMap?: StrokeCountMap): void TransitionSpiral3d attach StrokeCountMap structure to this primitive (and recursively to any children)
constructOffsetXY(offsetDistanceOrOptions: number | OffsetOptions): undefined | CurvePrimitive | CurvePrimitive[] TransitionSpiral3d Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).
curveLength(): number TransitionSpiral3d return the length of the curve.
curveLengthBetweenFractions(fraction0: number, fraction1: number): number TransitionSpiral3d Returns a (high accuracy) length of the curve between fractional positions
curveLengthWithFixedIntervalCountQuadrature(fraction0: number, fraction1: number, numInterval: number, numGauss: number = 5): number TransitionSpiral3d * Run an integration (with a default gaussian quadrature) with a fixed fractional step
extendRange(rangeToExtend: Range3d, transform?: Transform): void TransitionSpiral3d extend the range by the strokes of the spiral
fractionAndDistanceToPointOnTangent(fraction: number, distance: number): Point3d TransitionSpiral3d Construct a point extrapolated along tangent at fraction.
fractionToCurvature(fraction: number): undefined | number TransitionSpiral3d Returns the (absolute) curvature magnitude.
fractionToFrenetFrame(fraction: number, result?: Transform): undefined | Transform TransitionSpiral3d Construct a frenet frame:
fractionToPointAndUnitTangent(fraction: number, result?: Ray3d): Ray3d TransitionSpiral3d Returns a ray whose origin is the curve point and direction is the unit tangent.
fractionToSignedXYRadiusOfCurvature(fraction: number): number TransitionSpiral3d Construct signed distance from a point on the curve to its center of curvature (in xy only).
getFractionToDistanceScale(): undefined | number TransitionSpiral3d * If the curve primitive has distance-along-curve strictly proportional to curve fraction, return the scale factor.
moveSignedDistanceFromFraction(startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail): CurveLocationDetail TransitionSpiral3d * (Attempt to) find a position on the curve at a signed distance from start fraction.
moveSignedDistanceFromFractionGeneric(startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail): CurveLocationDetail Protected TransitionSpiral3d Generic algorithm to search for point at signed distance from a fractional startPoint.
projectedParameterRange(ray: Ray3d | Vector3d, lowHigh?: Range1d): undefined | Range1d TransitionSpiral3d Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of projection.
range(transform?: Transform, result?: Range3d): Range3d TransitionSpiral3d return the range of the entire (tree) GeometryQuery
rangeBetweenFractions(fractionA: number, fractionB: number, transform?: Transform): Range3d TransitionSpiral3d return the range of spiral between fractions of the activeStrokes.
rangeBetweenFractionsByClone(fraction0: number, fraction1: number, transform?: Transform): Range3d TransitionSpiral3d Returns a (high accuracy) range of the curve between fractional positions
rangeBetweenFractionsByCount(fraction0: number, fraction1: number, count: number, transform?: Transform, extrapolationFactor: number = 0.0): Range3d TransitionSpiral3d Returns an approximate range based on a fixed number of evaluations
tryTranslateInPlace(dx: number, dy: number = 0.0, dz: number = 0.0): boolean TransitionSpiral3d try to move the geometry by dx,dy,dz
areAlmostEqual(a: undefined | GeometryQuery, b: undefined | GeometryQuery): boolean Static TransitionSpiral3d apply instance method isAlmostEqual if both are defined.
averageCurvature(radiusLimits: Segment1d): number Static TransitionSpiral3d Return the average of the start and end curvatures.
averageCurvatureR0R1(r0: number, r1: number): number Static TransitionSpiral3d Given two radii (or zeros for 0 curvature) return the average curvature
curvatureToRadius(curvature: number): number Static TransitionSpiral3d Return 1/k with convention that if near-zero is given as curvature, its infinite radius is returned as 0
installStrokeCountMap(curve: CurvePrimitive, curveMap: StrokeCountMap, parentMap?: StrokeCountMap): void Static TransitionSpiral3d final install step to save curveMap in curve.
interpolateCurvatureR0R1(r0: number, fraction: number, r1: number): number Static TransitionSpiral3d Given two radii (or zeros for 0 curvature) return the average curvature
radius0LengthSweepRadiansToRadius1(radius0: number, arcLength: number, sweepRadians: number): number Static TransitionSpiral3d Return the end radius for spiral of given start radius, length, and turn angle.
radius1LengthSweepRadiansToRadius0(radius1: number, arcLength: number, sweepRadians: number): number Static TransitionSpiral3d Return the start radius for spiral of given end radius, length, and turn angle.
radiusRadiusLengthToSweepRadians(radius0: number, radius1: number, arcLength: number): number Static TransitionSpiral3d Return the turn angle for spiral of given length between two radii
radiusRadiusSweepRadiansToArcLength(radius0: number, radius1: number, sweepRadians: number): number Static TransitionSpiral3d Return the arc length of a transition spiral with given sweep and radius pair.
radiusToCurvature(radius: number): number Static TransitionSpiral3d Return 1/r with convention that if true zero is given as radius it represents infinite radius (0 curvature, straight line)

Properties

Name Type Description
activeStrokes Accessor ReadOnly LineString3d Return the internal stroked form of the (possibly partial) spiral  
curvePrimitiveType Readonly "transitionSpiral" String name for schema properties  
nominalCurvature1 Accessor ReadOnly number Return the nominal end curvature  
nominalL1 Accessor ReadOnly number Return the nominal distance from inflection to endpoint.  
nominalR1 Accessor ReadOnly number Return the nominal end radius.  

Inherited properties

Name Type Inherited from Description
_activeFractionInterval Protected Segment1d TransitionSpiral3d Fractional interval for the "active" part of a containing spiral.
_designProperties Protected undefined | TransitionConditionalProperties TransitionSpiral3d Original defining properties.
_localToWorld Protected Transform TransitionSpiral3d Placement transform
_spiralType Protected string TransitionSpiral3d string name of spiral type
activeFractionInterval Accessor ReadOnly Segment1d TransitionSpiral3d Return (reference to) the active portion of the reference spiral.
children Accessor ReadOnly undefined | GeometryQuery[] TransitionSpiral3d return GeometryQuery children for recursive queries.

* leaf classes do not need to implement.
designProperties Accessor ReadOnly undefined | TransitionConditionalProperties TransitionSpiral3d Return the original defining properties (if any) saved by the constructor.
geometryCategory Readonly "curvePrimitive" TransitionSpiral3d String name for schema properties
isExtensibleFractionSpace Accessor ReadOnly boolean TransitionSpiral3d * Returns true if the curve's fraction queries extend beyond 0..1.
* Base class default implementation returns false.
* These class (and perhaps others in the future) will return true:
* LineSegment3d
* LineString3d
* Arc3d
localToWorld Accessor ReadOnly Transform TransitionSpiral3d (reference to) placement transform.
parent undefined | any TransitionSpiral3d data attached by various algorithms (e.g.
spiralType Accessor ReadOnly string TransitionSpiral3d  
strokeData undefined | StrokeCountMap TransitionSpiral3d data attached during stroking for facets.

Defined in

Last Updated: 30 November, 2023