/** @packageDocumentation * @module Curve */ import { Angle } from "../../geometry3d/Angle"; import { AngleSweep } from "../../geometry3d/AngleSweep"; import { GeometryHandler, IStrokeHandler } from "../../geometry3d/GeometryHandler"; import { Plane3dByOriginAndUnitNormal } from "../../geometry3d/Plane3dByOriginAndUnitNormal"; import { Plane3dByOriginAndVectors } from "../../geometry3d/Plane3dByOriginAndVectors"; import { Point3d } from "../../geometry3d/Point3dVector3d"; import { Ray3d } from "../../geometry3d/Ray3d"; import { Segment1d } from "../../geometry3d/Segment1d"; import { Transform } from "../../geometry3d/Transform"; import { GeometryQuery } from "../GeometryQuery"; import { LineString3d } from "../LineString3d"; import { StrokeOptions } from "../StrokeOptions"; import { TransitionSpiral3d } from "./TransitionSpiral3d"; /** * An IntegratedSpiral3d is a curve defined by integrating its curvature. * * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians). * * Integrating (cos(theta), sin(theta)) gives displacement from the start point, and thus the actual curve position. * * The curvature functions of interest are all symmetric snap functions in the [[NormalizedTransition]] class. * * [[TransitionConditionalProperties]] implements the computations of the interrelationship of radii, bearing, and length. * @public */ export declare class IntegratedSpiral3d extends TransitionSpiral3d { /** String name for schema properties. */ readonly curvePrimitiveType = "transitionSpiral"; /** Start and end radii as a Segment1d. */ radius01: Segment1d; /** Start and end bearings as an AngleSweep. */ bearing01: AngleSweep; /** Stroked approximation of entire spiral. */ private _globalStrokes; /** * Stroked approximation of active spiral. * * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed * as partial versus complete. * * If no trimming, this points to the same place as the _globalStrokes. DO NOT double transform. */ private _activeStrokes?; /** Return the internal stroked form of the (possibly partial) spiral. */ get activeStrokes(): LineString3d; /** Evaluator for transition. */ private _evaluator; /** Total curve arc length (computed). */ private _arcLength01; /** Curvatures (inverse radii) at start and end. */ private _curvature01; private constructor(); /** Default spiral type name: clothoid. */ static readonly defaultSpiralType = "clothoid"; /** Use the integrated function to return an angle at fractional position. */ globalFractionToBearingRadians(fraction: number): number; /** Use the integrated function to return an angle at fractional position. */ globalFractionToCurvature(fraction: number): number; /** Return the bearing at given fraction of the active interval. */ fractionToBearingRadians(activeFraction: number): number; /** Return the curvature at given fraction of the active interval. */ fractionToCurvature(activeFraction: number): number; private static _gaussFraction; private static _gaussWeight; private static _gaussMapper; /** Initialize class level work arrays. */ static initWorkSpace(): void; /** * Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference * length (recall that theta is a nonlinear function of the fraction). * * This is a single interval of gaussian integration. * * The fraction is on the full spiral (not in the mapped active interval). * @param xyz advancing integrated point. * @param fractionA fraction at start of interval. * @param fractionB fraction at end of interval. * @param applyMatrix if true, apply the localToWorld matrix to the computed delta before adding to xyz. */ private fullSpiralIncrementalIntegral; /** Recompute strokes. */ refreshComputedProperties(): void; /** * Create a transition spiral with radius and bearing conditions. * @param radius01 radius (inverse curvature) at start and end (radius of zero means straight line). * @param bearing01 bearing angles at start and end. Bearings are measured from the x axis, positive clockwise * towards y axis. * @param activeFractionInterval fractional limits of the active portion of the spiral. * @param localToWorld placement frame. Fractional coordinate 0 is at the origin. */ static createRadiusRadiusBearingBearing(radius01: Segment1d, bearing01: AngleSweep, activeFractionInterval: Segment1d, localToWorld: Transform, typeName?: string): IntegratedSpiral3d | undefined; /** * Create a transition spiral. * * Inputs must provide exactly 4 of the 5 values `[radius0,radius1,bearing0,bearing1,length]`. * @param spiralType one of "clothoid", "bloss", "biquadratic", "cosine", "sine". If undefined, "clothoid" is used. * @param radius0 radius (or 0 for tangent to line) at start. * @param radius1 radius (or 0 for tangent to line) at end. * @param bearing0 bearing, measured CCW from x axis at start. * @param bearing1 bearing, measured CCW from x axis at end. * @param fractionInterval optional fractional interval for an "active" portion of the curve. If omitted, the full * [0,1] is used. * @param localToWorld placement transform. */ static createFrom4OutOf5(spiralType: string | undefined, radius0: number | undefined, radius1: number | undefined, bearing0: Angle | undefined, bearing1: Angle | undefined, arcLength: number | undefined, fractionInterval: undefined | Segment1d, localToWorld: Transform): IntegratedSpiral3d | undefined; /** Copy all defining data from another spiral. */ setFrom(other: IntegratedSpiral3d): IntegratedSpiral3d; /** Deep clone of this spiral. */ clone(): IntegratedSpiral3d; /** * Apply `transform` to this spiral's local to world transform. * * Only the rigid part of the transform is applied. */ tryTransformInPlace(transform: Transform): boolean; /** Return the spiral start point. */ startPoint(result?: Point3d): Point3d; /** Return the spiral end point. */ endPoint(result?: Point3d): Point3d; /** Test if the local to world transform places the spiral xy plane into `plane`. */ isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean; /** * Return length of the spiral. * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */ quickLength(): number; /** * Return length of the spiral. * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */ curveLength(): number; /** * Return (unsigned) length of the spiral between fractions. * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */ curveLengthBetweenFractions(fraction0: number, fraction1: number): number; /** Test if `other` is an instance of `TransitionSpiral3d`. */ isSameGeometryClass(other: any): boolean; /** * Add strokes from this spiral to `dest`. * @param options optional stroking options. Pass `undefined` to return cached strokes. */ emitStrokes(dest: LineString3d, options?: StrokeOptions): void; /** Emit stroke fragments to `dest` handler. */ emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void; /** * Return the stroke count required for given options. * @param options StrokeOptions that determine count. */ computeStrokeCountForOptions(options?: StrokeOptions): number; /** * Reverse the active interval and active strokes. * * Primary defining data remains unchanged. */ reverseInPlace(): void; /** Evaluate curve point with respect to fraction. */ fractionToPoint(activeFraction: number, result?: Point3d): Point3d; /** Evaluate curve point and derivative with respect to fraction. */ fractionToPointAndDerivative(activeFraction: number, result?: Ray3d): Ray3d; /** Return the frenet frame at fractional position. */ fractionToFrenetFrame(activeFraction: number, result?: Transform): Transform; /** * Return a plane with * * origin at fractional position along the curve. * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to * the fraction. * * vectorV is the second derivative, i.e.derivative of vectorU. */ fractionToPointAnd2Derivatives(activeFraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors | undefined; /** Second step of double dispatch: call `handler.handleTransitionSpiral(this)`. */ dispatchToGeometryHandler(handler: GeometryHandler): any; /** Compare various coordinate quantities. */ isAlmostEqual(other?: GeometryQuery): boolean; } //# sourceMappingURL=IntegratedSpiral3d.d.ts.map