@itwin/core-geometry 5.3.0 → 5.4.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -1
- package/lib/cjs/bspline/SurfaceLocationDetail.d.ts +1 -1
- package/lib/cjs/bspline/SurfaceLocationDetail.js +1 -1
- package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +13 -0
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +78 -3
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.d.ts +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js +1 -1
- package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.d.ts +3 -3
- package/lib/cjs/curve/spiral/ClothoidSeries.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/ClothoidSeries.js +15 -11
- package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.d.ts +2 -5
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js +4 -12
- package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +7 -6
- package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/DirectSpiral3d.js +8 -6
- package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +2 -2
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +9 -5
- package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.d.ts +8 -7
- package/lib/cjs/curve/spiral/NormalizedTransition.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/NormalizedTransition.js +32 -16
- package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js +1 -0
- package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js +1 -0
- package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.d.ts +1 -2
- package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Ray3d.js +1 -2
- package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
- package/lib/cjs/numerics/Newton.d.ts +1 -1
- package/lib/cjs/numerics/Newton.js +1 -1
- package/lib/cjs/numerics/Newton.js.map +1 -1
- package/lib/esm/bspline/SurfaceLocationDetail.d.ts +1 -1
- package/lib/esm/bspline/SurfaceLocationDetail.js +1 -1
- package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +13 -0
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +78 -3
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.d.ts +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js +1 -1
- package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.d.ts +3 -3
- package/lib/esm/curve/spiral/ClothoidSeries.d.ts.map +1 -1
- package/lib/esm/curve/spiral/ClothoidSeries.js +15 -11
- package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.d.ts +2 -5
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.d.ts.map +1 -1
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js +4 -12
- package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +7 -6
- package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/DirectSpiral3d.js +8 -6
- package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +2 -2
- package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js +9 -5
- package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.d.ts +8 -7
- package/lib/esm/curve/spiral/NormalizedTransition.d.ts.map +1 -1
- package/lib/esm/curve/spiral/NormalizedTransition.js +32 -16
- package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js +1 -0
- package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
- package/lib/esm/curve/spiral/TransitionSpiral3d.js +1 -0
- package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
- package/lib/esm/geometry3d/Ray3d.d.ts +1 -2
- package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
- package/lib/esm/geometry3d/Ray3d.js +1 -2
- package/lib/esm/geometry3d/Ray3d.js.map +1 -1
- package/lib/esm/numerics/Newton.d.ts +1 -1
- package/lib/esm/numerics/Newton.js +1 -1
- package/lib/esm/numerics/Newton.js.map +1 -1
- package/package.json +3 -3
|
@@ -73,7 +73,7 @@ export declare class IntegratedSpiral3d extends TransitionSpiral3d {
|
|
|
73
73
|
* @param xyz advancing integrated point.
|
|
74
74
|
* @param fractionA fraction at start of interval.
|
|
75
75
|
* @param fractionB fraction at end of interval.
|
|
76
|
-
* @param
|
|
76
|
+
* @param applyMatrix if true, apply the localToWorld matrix to the computed delta before adding to xyz.
|
|
77
77
|
*/
|
|
78
78
|
private fullSpiralIncrementalIntegral;
|
|
79
79
|
/** Recompute strokes. */
|
|
@@ -81,7 +81,7 @@ export declare class IntegratedSpiral3d extends TransitionSpiral3d {
|
|
|
81
81
|
/**
|
|
82
82
|
* Create a transition spiral with radius and bearing conditions.
|
|
83
83
|
* @param radius01 radius (inverse curvature) at start and end (radius of zero means straight line).
|
|
84
|
-
* @param bearing01 bearing angles at start and end.
|
|
84
|
+
* @param bearing01 bearing angles at start and end. Bearings are measured from the x axis, positive clockwise
|
|
85
85
|
* towards y axis.
|
|
86
86
|
* @param activeFractionInterval fractional limits of the active portion of the spiral.
|
|
87
87
|
* @param localToWorld placement frame. Fractional coordinate 0 is at the origin.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegratedSpiral3d.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/IntegratedSpiral3d.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAE7F,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"IntegratedSpiral3d.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/IntegratedSpiral3d.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,wBA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DAA8D;IACvD,mBAAmB,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;IAG/C;;;;OAIG;IACI,WAAW,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI;IAGrE,+CAA+C;IACxC,kBAAkB,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI;IAY9E;;;OAGG;IACI,4BAA4B,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM;IAYpE;;;OAGG;IACI,cAAc,IAAI,IAAI;IAM7B,qDAAqD;IAC9C,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAoCzE,oEAAoE;IAC7D,4BAA4B,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK;IASlF,sDAAsD;IACtC,qBAAqB,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS;IAW5F;;;;;;OAMG;IACI,8BAA8B,CACnC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,yBAAyB,GACzD,yBAAyB,GAAG,SAAS;IAcxC,oFAAoF;IAC7E,yBAAyB,CAAC,OAAO,EAAE,eAAe,GAAG,GAAG;IAG/D,6CAA6C;IAC7B,aAAa,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO;CAW9D"}
|
|
@@ -27,6 +27,7 @@ import { Plane3dByOriginAndVectors } from "../../geometry3d/Plane3dByOriginAndVe
|
|
|
27
27
|
* * [[TransitionConditionalProperties]] implements the computations of the interrelationship of radii, bearing, and length.
|
|
28
28
|
* @public
|
|
29
29
|
*/
|
|
30
|
+
// see internaldocs/Spiral.md for more info
|
|
30
31
|
export class IntegratedSpiral3d extends TransitionSpiral3d {
|
|
31
32
|
/** String name for schema properties. */
|
|
32
33
|
curvePrimitiveType = "transitionSpiral";
|
|
@@ -70,11 +71,13 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
|
|
|
70
71
|
static defaultSpiralType = "clothoid";
|
|
71
72
|
/** Use the integrated function to return an angle at fractional position. */
|
|
72
73
|
globalFractionToBearingRadians(fraction) {
|
|
74
|
+
// calculate area under curvature curve from 0 to fraction and add it to start angle to get angle at the given fraction
|
|
75
|
+
// see internaldocs/Spiral.md for more info
|
|
73
76
|
const areaFraction = this._evaluator.fractionToArea(fraction);
|
|
74
|
-
const
|
|
77
|
+
const arcLength = this._arcLength01;
|
|
75
78
|
return this.bearing01.startRadians
|
|
76
|
-
+
|
|
77
|
-
+
|
|
79
|
+
+ fraction * arcLength * this._curvature01.x0
|
|
80
|
+
+ areaFraction * arcLength * this._curvature01.signedDelta();
|
|
78
81
|
}
|
|
79
82
|
/** Use the integrated function to return an angle at fractional position. */
|
|
80
83
|
globalFractionToCurvature(fraction) {
|
|
@@ -113,9 +116,10 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
|
|
|
113
116
|
* @param xyz advancing integrated point.
|
|
114
117
|
* @param fractionA fraction at start of interval.
|
|
115
118
|
* @param fractionB fraction at end of interval.
|
|
116
|
-
* @param
|
|
119
|
+
* @param applyMatrix if true, apply the localToWorld matrix to the computed delta before adding to xyz.
|
|
117
120
|
*/
|
|
118
121
|
fullSpiralIncrementalIntegral(xyz, fractionA, fractionB, applyMatrix) {
|
|
122
|
+
// see internaldocs/Spiral.md for more info
|
|
119
123
|
const gaussFraction = IntegratedSpiral3d._gaussFraction;
|
|
120
124
|
const gaussWeight = IntegratedSpiral3d._gaussWeight;
|
|
121
125
|
const numEval = IntegratedSpiral3d._gaussMapper(fractionA, fractionB, gaussFraction, gaussWeight);
|
|
@@ -165,7 +169,7 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
|
|
|
165
169
|
/**
|
|
166
170
|
* Create a transition spiral with radius and bearing conditions.
|
|
167
171
|
* @param radius01 radius (inverse curvature) at start and end (radius of zero means straight line).
|
|
168
|
-
* @param bearing01 bearing angles at start and end.
|
|
172
|
+
* @param bearing01 bearing angles at start and end. Bearings are measured from the x axis, positive clockwise
|
|
169
173
|
* towards y axis.
|
|
170
174
|
* @param activeFractionInterval fractional limits of the active portion of the spiral.
|
|
171
175
|
* @param localToWorld placement frame. Fractional coordinate 0 is at the origin.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegratedSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/IntegratedSpiral3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAGvF;;;;;;;GAOG;AACH,MAAM,OAAO,kBAAmB,SAAQ,kBAAkB;IACxD,yCAAyC;IACzB,kBAAkB,GAAG,kBAAkB,CAAC;IACxD,0CAA0C;IACnC,QAAQ,C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C,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IACD,6CAA6C;IAC7B,aAAa,CAAC,KAAqB;QACjD,IAAI,KAAK,YAAY,kBAAkB,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC;mBAC7C,IAAI,CAAC,SAAS,CAAC,6BAA6B,CAAC,KAAK,CAAC,SAAS,CAAC;mBAC7D,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC;mBACnD,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC;mBAChE,IAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC,KAAK,CAAC,sBAAsB,CAAC;mBACvE,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;;AAEH,sDAAsD;AACtD,kBAAkB,CAAC,aAAa,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\nimport { AngleSweep } from \"../../geometry3d/AngleSweep\";\nimport { Transform } from \"../../geometry3d/Transform\";\nimport { LineString3d } from \"../LineString3d\";\nimport { NormalizedTransition } from \"./NormalizedTransition\";\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\nimport { Quadrature } from \"../../numerics/Quadrature\";\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\nimport { Angle } from \"../../geometry3d/Angle\";\nimport { Plane3dByOriginAndUnitNormal } from \"../../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { AxisOrder, Geometry } from \"../../Geometry\";\nimport { StrokeOptions } from \"../StrokeOptions\";\nimport { GeometryHandler, IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\nimport { GeometryQuery } from \"../GeometryQuery\";\n\n/**\n * An IntegratedSpiral3d is a curve defined by integrating its curvature.\n * * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians).\n * * Integrating (cos(theta), sin(theta)) gives displacement from the start point, and thus the actual curve position.\n * * The curvature functions of interest are all symmetric snap functions in the [[NormalizedTransition]] class.\n * * [[TransitionConditionalProperties]] implements the computations of the interrelationship of radii, bearing, and length.\n * @public\n */\nexport class IntegratedSpiral3d extends TransitionSpiral3d {\n /** String name for schema properties. */\n public readonly curvePrimitiveType = \"transitionSpiral\";\n /** Start and end radii as a Segment1d. */\n public radius01: Segment1d;\n /** Start and end bearings as an AngleSweep. */\n public bearing01: AngleSweep;\n /** Stroked approximation of entire spiral. */\n private _globalStrokes: LineString3d;\n /**\n * Stroked approximation of active spiral.\n * * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed\n * as partial versus complete.\n * * If no trimming, this points to the same place as the _globalStrokes. DO NOT double transform.\n */\n private _activeStrokes?: LineString3d;\n /** Return the internal stroked form of the (possibly partial) spiral. */\n public get activeStrokes(): LineString3d {\n return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes;\n }\n /** Evaluator for transition. */\n private _evaluator: NormalizedTransition;\n /** Total curve arc length (computed). */\n private _arcLength01: number;\n /** Curvatures (inverse radii) at start and end. */\n private _curvature01: Segment1d;\n // constructor demands all bearing, radius, and length data.\n // caller determines usual dependency of \"any 4 determine the 5th\".\n private constructor(\n spiralType: string | undefined,\n evaluator: NormalizedTransition,\n radius01: Segment1d,\n bearing01: AngleSweep,\n activeFractionInterval: Segment1d,\n localToWorld: Transform,\n arcLength: number,\n properties: TransitionConditionalProperties | undefined,\n ) {\n super(spiralType, localToWorld, activeFractionInterval, properties);\n this._evaluator = evaluator;\n this.radius01 = radius01;\n this.bearing01 = bearing01;\n this._arcLength01 = arcLength;\n this._globalStrokes = LineString3d.create();\n // initialize for compiler; but this will be recomputed in refreshComputeProperties\n this._curvature01 = Segment1d.create(0, 1);\n this.refreshComputedProperties();\n }\n /** Default spiral type name: clothoid. */\n public static readonly defaultSpiralType = \"clothoid\";\n /** Use the integrated function to return an angle at fractional position. */\n public globalFractionToBearingRadians(fraction: number): number {\n const areaFraction = this._evaluator.fractionToArea(fraction);\n const dx = this._arcLength01;\n return this.bearing01.startRadians\n + areaFraction * dx * this._curvature01.signedDelta()\n + fraction * this._curvature01.x0 * dx;\n }\n /** Use the integrated function to return an angle at fractional position. */\n public globalFractionToCurvature(fraction: number): number {\n const f = this._evaluator.fractionToCurvatureFraction(fraction);\n return this._curvature01.fractionToPoint(f);\n }\n /** Return the bearing at given fraction of the active interval. */\n public fractionToBearingRadians(activeFraction: number): number {\n const fraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n return this.bearing01.startRadians\n + fraction * this._arcLength01 * (this._curvature01.x0 + 0.5 * fraction * (this._curvature01.x1 - this._curvature01.x0));\n }\n /**\n * Return the curvature at given fraction of the active interval.\n * * The `undefined` result is to match the abstract class -- it cannot actually occur.\n */\n public override fractionToCurvature(activeFraction: number): number | undefined {\n // BUG? active interval\n return this._curvature01.fractionToPoint(this.activeFractionInterval.fractionToPoint(activeFraction));\n }\n // These static variables are reused on calls to integrateFromStartFraction\n private static _gaussFraction: Float64Array;\n private static _gaussWeight: Float64Array;\n private static _gaussMapper: (xA: number, xB: number, arrayX: Float64Array, arrayW: Float64Array) => number;\n /** Initialize class level work arrays. */\n public static initWorkSpace() {\n IntegratedSpiral3d._gaussFraction = new Float64Array(5);\n IntegratedSpiral3d._gaussWeight = new Float64Array(5);\n IntegratedSpiral3d._gaussMapper = (xA, xB, xMapped, wMapped) => Quadrature.setupGauss5(xA, xB, xMapped, wMapped);\n }\n /**\n * Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference\n * length (recall that theta is a nonlinear function of the fraction).\n * * This is a single interval of gaussian integration.\n * * The fraction is on the full spiral (not in the mapped active interval).\n * @param xyz advancing integrated point.\n * @param fractionA fraction at start of interval.\n * @param fractionB fraction at end of interval.\n * @param unitArcLength length of curve for 0 to 1 fractional.\n */\n private fullSpiralIncrementalIntegral(xyz: Point3d, fractionA: number, fractionB: number, applyMatrix: boolean) {\n const gaussFraction = IntegratedSpiral3d._gaussFraction;\n const gaussWeight = IntegratedSpiral3d._gaussWeight;\n const numEval = IntegratedSpiral3d._gaussMapper(fractionA, fractionB, gaussFraction, gaussWeight);\n const deltaL = this._arcLength01;\n let w = 0;\n let dx = 0.0;\n let dy = 0.0;\n for (let k = 0; k < numEval; k++) {\n const radians = this.globalFractionToBearingRadians(gaussFraction[k]);\n w = gaussWeight[k] * deltaL;\n dx += w * Math.cos(radians);\n dy += w * Math.sin(radians);\n }\n if (applyMatrix)\n Matrix3d.xyzPlusMatrixTimesXYZ(xyz, this.localToWorld.matrix, { x: dx, y: dy, z: 0.0 }, xyz);\n else\n xyz.addXYZInPlace(dx, dy, 0.0);\n }\n /** Recompute strokes. */\n public override refreshComputedProperties() {\n this._curvature01 = Segment1d.create(\n TransitionSpiral3d.radiusToCurvature(this.radius01.x0),\n TransitionSpiral3d.radiusToCurvature(this.radius01.x1),\n );\n this._globalStrokes.clear();\n const currentPoint = Point3d.create();\n this._globalStrokes.appendStrokePoint(currentPoint);\n const numInterval = 16;\n const fractionStep = 1.0 / numInterval;\n for (let i = 1; i <= numInterval; i++) {\n const fraction0 = (i - 1) * fractionStep;\n const fraction1 = i * fractionStep;\n this.fullSpiralIncrementalIntegral(currentPoint, fraction0, fraction1, false);\n this._globalStrokes.appendStrokePoint(currentPoint);\n }\n this._globalStrokes.tryTransformInPlace(this.localToWorld);\n if (!this.activeFractionInterval.isExact01) {\n if (this._activeStrokes === undefined)\n this._activeStrokes = LineString3d.create();\n this._activeStrokes.clear();\n // The active interval has finer strokes: it's the same fraction step but mapped to a sub-interval.\n // Below assumes fractionToPoint depends upon the global strokes we just computed, and not\n // on the active strokes we are computing.\n for (let i = 0; i <= numInterval; i++) {\n const localFraction = i * fractionStep;\n this._activeStrokes.addPoint(this.fractionToPoint(localFraction));\n }\n }\n }\n /**\n * Create a transition spiral with radius and bearing conditions.\n * @param radius01 radius (inverse curvature) at start and end (radius of zero means straight line).\n * @param bearing01 bearing angles at start and end. bearings are measured from the x axis, positive clockwise\n * towards y axis.\n * @param activeFractionInterval fractional limits of the active portion of the spiral.\n * @param localToWorld placement frame. Fractional coordinate 0 is at the origin.\n */\n public static createRadiusRadiusBearingBearing(\n radius01: Segment1d,\n bearing01: AngleSweep,\n activeFractionInterval: Segment1d,\n localToWorld: Transform,\n typeName?: string,\n ): IntegratedSpiral3d | undefined {\n const arcLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(\n radius01.x0, radius01.x1, bearing01.sweepRadians,\n );\n if (typeName === undefined)\n typeName = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(typeName);\n if (!evaluator)\n return undefined;\n return new IntegratedSpiral3d(\n typeName,\n evaluator,\n radius01.clone(),\n bearing01.clone(),\n activeFractionInterval.clone(),\n localToWorld.clone(),\n arcLength,\n new TransitionConditionalProperties(\n radius01.x0, radius01.x1, bearing01.startAngle.clone(), bearing01.endAngle.clone(), undefined,\n ),\n );\n }\n /**\n * Create a transition spiral.\n * * Inputs must provide exactly 4 of the 5 values `[radius0,radius1,bearing0,bearing1,length]`.\n * @param spiralType one of \"clothoid\", \"bloss\", \"biquadratic\", \"cosine\", \"sine\". If undefined, \"clothoid\" is used.\n * @param radius0 radius (or 0 for tangent to line) at start.\n * @param radius1 radius (or 0 for tangent to line) at end.\n * @param bearing0 bearing, measured CCW from x axis at start.\n * @param bearing1 bearing, measured CCW from x axis at end.\n * @param fractionInterval optional fractional interval for an \"active\" portion of the curve. If omitted, the full\n * [0,1] is used.\n * @param localToWorld placement transform.\n */\n public static createFrom4OutOf5(\n spiralType: string | undefined,\n radius0: number | undefined,\n radius1: number | undefined,\n bearing0: Angle | undefined,\n bearing1: Angle | undefined,\n arcLength: number | undefined,\n fractionInterval: undefined | Segment1d,\n localToWorld: Transform,\n ): IntegratedSpiral3d | undefined {\n if (spiralType === undefined)\n spiralType = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(spiralType);\n if (!evaluator)\n return undefined;\n const data = new TransitionConditionalProperties(radius0, radius1, bearing0, bearing1, arcLength);\n const data1 = data.clone();\n if (!data.tryResolveAnySingleUnknown())\n return undefined;\n if (fractionInterval === undefined)\n fractionInterval = Segment1d.create(0, 1);\n return new IntegratedSpiral3d(\n spiralType,\n evaluator,\n Segment1d.create(data.radius0, data.radius1),\n AngleSweep.createStartEnd(data.bearing0!, data.bearing1!),\n fractionInterval ? fractionInterval.clone() : Segment1d.create(0, 1),\n localToWorld,\n data.curveLength!,\n data1,\n );\n }\n /** Copy all defining data from another spiral. */\n public setFrom(other: IntegratedSpiral3d): IntegratedSpiral3d {\n this.localToWorld.setFrom(other.localToWorld);\n this.radius01.setFrom(other.radius01);\n this._curvature01.setFrom(other._curvature01);\n this.bearing01.setFrom(other.bearing01);\n this.localToWorld.setFrom(other.localToWorld);\n this.activeFractionInterval.setFrom(other.activeFractionInterval);\n this._arcLength01 = other._arcLength01;\n return this;\n }\n /** Deep clone of this spiral. */\n public override clone(): IntegratedSpiral3d {\n return new IntegratedSpiral3d(\n this._spiralType,\n this._evaluator,\n this.radius01.clone(),\n this.bearing01.clone(),\n this.activeFractionInterval.clone(),\n this.localToWorld.clone(),\n this._arcLength01,\n this._designProperties?.clone(),\n );\n }\n /** Apply `transform` to this spiral's local to world transform. */\n public tryTransformInPlace(transformA: Transform): boolean {\n const rigidData = this.applyRigidPartOfTransform(transformA);\n if (rigidData !== undefined) {\n this._curvature01.x0 /= rigidData.scale;\n this._curvature01.x1 /= rigidData.scale;\n this.radius01.x0 *= rigidData.scale;\n this.radius01.x1 *= rigidData.scale;\n this._arcLength01 *= rigidData.scale;\n }\n this.refreshComputedProperties();\n return true;\n }\n /** Return the spiral start point. */\n public override startPoint(result?: Point3d): Point3d {\n return this.activeStrokes.startPoint(result);\n }\n /** Return the spiral end point. */\n public override endPoint(result?: Point3d): Point3d {\n return this.activeStrokes.endPoint(result);\n }\n /** Test if the local to world transform places the spiral xy plane into `plane`. */\n public isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean {\n return plane.isPointInPlane(this.localToWorld.origin as Point3d)\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));\n }\n /**\n * Return length of the spiral.\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\n */\n public quickLength() {\n return this.curveLength();\n }\n /**\n * Return length of the spiral.\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\n */\n public override curveLength() {\n return this._arcLength01 * (this._activeFractionInterval.absoluteDelta());\n }\n /**\n * Return (unsigned) length of the spiral between fractions.\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\n */\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number) {\n return this._arcLength01 * (this._activeFractionInterval.absoluteDelta() * Math.abs(fraction1 - fraction0));\n }\n /** Test if `other` is an instance of `TransitionSpiral3d`. */\n public isSameGeometryClass(other: any): boolean {\n return other instanceof TransitionSpiral3d;\n }\n /**\n * Add strokes from this spiral to `dest`.\n * * Linestrings will usually stroke as just their points.\n * * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.\n */\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\n this.activeStrokes.emitStrokes(dest, options);\n }\n /** Emit stroke fragments to `dest` handler. */\n public emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void {\n const n = this.computeStrokeCountForOptions(options);\n dest.startParentCurvePrimitive(this);\n const activeStrokes = this.activeStrokes;\n const preferPrimary = dest.needPrimaryGeometryForStrokes === undefined ? false : dest.needPrimaryGeometryForStrokes();\n if (!preferPrimary && n <= activeStrokes.numPoints()) {\n this.activeStrokes.emitStrokableParts(dest, options);\n } else {\n dest.announceIntervalForUniformStepStrokes(this, n, 0.0, 1.0);\n }\n dest.endParentCurvePrimitive(this);\n }\n /**\n * Return the stroke count required for given options.\n * @param options StrokeOptions that determine count.\n */\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n let numStroke;\n if (options) {\n const rMin = Math.min(Math.abs(this.radius01.x0), Math.abs(this.radius01.x1));\n numStroke = options.applyTolerancesToArc(rMin, this.bearing01.sweepRadians);\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\n } else {\n numStroke = StrokeOptions.applyAngleTol(undefined, 4, this.bearing01.sweepRadians);\n }\n return numStroke;\n }\n /**\n * Reverse the active interval and active strokes.\n * * Primary defining data remains unchanged.\n */\n public reverseInPlace(): void {\n this.activeFractionInterval.reverseInPlace();\n if (this._activeStrokes === undefined)\n this._activeStrokes = this._globalStrokes.clone();\n this._activeStrokes.reverseInPlace();\n }\n /** Evaluate curve point with respect to fraction. */\n public fractionToPoint(activeFraction: number, result?: Point3d): Point3d {\n const targetGlobalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n const numStrokes = this._globalStrokes.packedPoints.length - 1;\n if (activeFraction > 1.0) {\n result = this._globalStrokes.packedPoints.back(result)!;\n const integrationStep = 1.0 / numStrokes;\n let currentGlobalFraction = 1.0;\n let nextGlobalFraction = currentGlobalFraction + integrationStep;\n while (nextGlobalFraction < targetGlobalFraction) {\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\n currentGlobalFraction = nextGlobalFraction;\n nextGlobalFraction += integrationStep;\n }\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\n } else if (activeFraction < 0.0) {\n result = this._globalStrokes.packedPoints.front(result)!;\n const integrationStep = 1.0 / numStrokes;\n let currentGlobalFraction = 0.0;\n let nextGlobalFraction = currentGlobalFraction - integrationStep;\n while (nextGlobalFraction > targetGlobalFraction) {\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\n currentGlobalFraction = nextGlobalFraction;\n nextGlobalFraction -= integrationStep;\n }\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\n } else {\n const clampedGlobalFraction = Geometry.clampToStartEnd(targetGlobalFraction, 0, 1);\n const index0 = Math.trunc(clampedGlobalFraction * numStrokes); // this indexes the point to the left of the query\n const globalFraction0 = index0 / numStrokes;\n result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(index0, result);\n // GeometryCoreTestIO.consoleLog(\"fractionToPoint \", activeFraction, this.activeFractionInterval, \"( global integration \" + globalFraction0 + \" to \" + globalFraction + \")\", index0);\n this.fullSpiralIncrementalIntegral(result, globalFraction0, targetGlobalFraction, true);\n\n }\n return result;\n }\n /** Evaluate curve point and derivative with respect to fraction. */\n public fractionToPointAndDerivative(activeFraction: number, result?: Ray3d): Ray3d {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n result = result ? result : Ray3d.createZero();\n this.fractionToPoint(activeFraction, result.origin);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const a = this._arcLength01 * this.activeFractionInterval.signedDelta();\n this.localToWorld.matrix.multiplyXY(a * Math.cos(radians), a * Math.sin(radians), result.direction);\n return result;\n }\n /** Return the frenet frame at fractional position. */\n public override fractionToFrenetFrame(activeFraction: number, result?: Transform): Transform {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n result = result ? result : Transform.createIdentity();\n result.origin.setFrom(this.fractionToPoint(activeFraction));\n Matrix3d.createRigidFromMatrix3d(this.localToWorld.matrix, AxisOrder.XYZ, result.matrix);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n result.matrix.applyGivensColumnOp(0, 1, c, s);\n return result;\n }\n /**\n * Return a plane with\n * * origin at fractional position along the curve.\n * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to\n * the fraction.\n * * vectorV is the second derivative, i.e.derivative of vectorU.\n */\n public fractionToPointAnd2Derivatives(\n activeFraction: number, result?: Plane3dByOriginAndVectors,\n ): Plane3dByOriginAndVectors | undefined {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n const origin = this.fractionToPoint(activeFraction);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n const delta = this.activeFractionInterval.signedDelta();\n const a = delta;\n const b = a * delta;\n const vectorX = this.localToWorld.matrix.multiplyXY(a * c, a * s);\n const vectorY = this.localToWorld.matrix.multiplyXY(-b * s, b * c);\n vectorY.scaleInPlace(this.globalFractionToCurvature(globalFraction));\n return Plane3dByOriginAndVectors.createCapture(origin, vectorX, vectorY, result);\n }\n /** Second step of double dispatch: call `handler.handleTransitionSpiral(this)`. */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleTransitionSpiral(this);\n }\n /** Compare various coordinate quantities. */\n public override isAlmostEqual(other?: GeometryQuery): boolean {\n if (other instanceof IntegratedSpiral3d) {\n return this.radius01.isAlmostEqual(other.radius01)\n && this.bearing01.isAlmostEqualAllowPeriodShift(other.bearing01)\n && this.localToWorld.isAlmostEqual(other.localToWorld)\n && Geometry.isSameCoordinate(this._arcLength01, other._arcLength01)\n && this.activeFractionInterval.isAlmostEqual(other.activeFractionInterval)\n && this._curvature01.isAlmostEqual(other._curvature01);\n }\n return false;\n }\n}\n// at load time, initialize gauss quadrature workspace\nIntegratedSpiral3d.initWorkSpace();\n"]}
|
|
1
|
+
{"version":3,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CAAC,KAAK,CAAC,QAAQ,CAAC;mBAC7C,IAAI,CAAC,SAAS,CAAC,6BAA6B,CAAC,KAAK,CAAC,SAAS,CAAC;mBAC7D,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC;mBACnD,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC;mBAChE,IAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC,KAAK,CAAC,sBAAsB,CAAC;mBACvE,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;;AAEH,sDAAsD;AACtD,kBAAkB,CAAC,aAAa,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\nimport { AngleSweep } from \"../../geometry3d/AngleSweep\";\nimport { Transform } from \"../../geometry3d/Transform\";\nimport { LineString3d } from \"../LineString3d\";\nimport { NormalizedTransition } from \"./NormalizedTransition\";\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\nimport { Quadrature } from \"../../numerics/Quadrature\";\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\nimport { Angle } from \"../../geometry3d/Angle\";\nimport { Plane3dByOriginAndUnitNormal } from \"../../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { AxisOrder, Geometry } from \"../../Geometry\";\nimport { StrokeOptions } from \"../StrokeOptions\";\nimport { GeometryHandler, IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\nimport { GeometryQuery } from \"../GeometryQuery\";\n\n/**\n * An IntegratedSpiral3d is a curve defined by integrating its curvature.\n * * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians).\n * * Integrating (cos(theta), sin(theta)) gives displacement from the start point, and thus the actual curve position.\n * * The curvature functions of interest are all symmetric snap functions in the [[NormalizedTransition]] class.\n * * [[TransitionConditionalProperties]] implements the computations of the interrelationship of radii, bearing, and length.\n * @public\n */\n// see internaldocs/Spiral.md for more info\nexport class IntegratedSpiral3d extends TransitionSpiral3d {\n /** String name for schema properties. */\n public readonly curvePrimitiveType = \"transitionSpiral\";\n /** Start and end radii as a Segment1d. */\n public radius01: Segment1d;\n /** Start and end bearings as an AngleSweep. */\n public bearing01: AngleSweep;\n /** Stroked approximation of entire spiral. */\n private _globalStrokes: LineString3d;\n /**\n * Stroked approximation of active spiral.\n * * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed\n * as partial versus complete.\n * * If no trimming, this points to the same place as the _globalStrokes. DO NOT double transform.\n */\n private _activeStrokes?: LineString3d;\n /** Return the internal stroked form of the (possibly partial) spiral. */\n public get activeStrokes(): LineString3d {\n return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes;\n }\n /** Evaluator for transition. */\n private _evaluator: NormalizedTransition;\n /** Total curve arc length (computed). */\n private _arcLength01: number;\n /** Curvatures (inverse radii) at start and end. */\n private _curvature01: Segment1d;\n // constructor demands all bearing, radius, and length data.\n // caller determines usual dependency of \"any 4 determine the 5th\".\n private constructor(\n spiralType: string | undefined,\n evaluator: NormalizedTransition,\n radius01: Segment1d,\n bearing01: AngleSweep,\n activeFractionInterval: Segment1d,\n localToWorld: Transform,\n arcLength: number,\n properties: TransitionConditionalProperties | undefined,\n ) {\n super(spiralType, localToWorld, activeFractionInterval, properties);\n this._evaluator = evaluator;\n this.radius01 = radius01;\n this.bearing01 = bearing01;\n this._arcLength01 = arcLength;\n this._globalStrokes = LineString3d.create();\n // initialize for compiler; but this will be recomputed in refreshComputeProperties\n this._curvature01 = Segment1d.create(0, 1);\n this.refreshComputedProperties();\n }\n /** Default spiral type name: clothoid. */\n public static readonly defaultSpiralType = \"clothoid\";\n /** Use the integrated function to return an angle at fractional position. */\n public globalFractionToBearingRadians(fraction: number): number {\n // calculate area under curvature curve from 0 to fraction and add it to start angle to get angle at the given fraction\n // see internaldocs/Spiral.md for more info\n const areaFraction = this._evaluator.fractionToArea(fraction);\n const arcLength = this._arcLength01;\n return this.bearing01.startRadians\n + fraction * arcLength * this._curvature01.x0\n + areaFraction * arcLength * this._curvature01.signedDelta();\n }\n /** Use the integrated function to return an angle at fractional position. */\n public globalFractionToCurvature(fraction: number): number {\n const f = this._evaluator.fractionToCurvatureFraction(fraction);\n return this._curvature01.fractionToPoint(f);\n }\n /** Return the bearing at given fraction of the active interval. */\n public fractionToBearingRadians(activeFraction: number): number {\n const fraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n return this.bearing01.startRadians\n + fraction * this._arcLength01 * (this._curvature01.x0 + 0.5 * fraction * (this._curvature01.x1 - this._curvature01.x0));\n }\n /**\n * Return the curvature at given fraction of the active interval.\n * * The `undefined` result is to match the abstract class -- it cannot actually occur.\n */\n public override fractionToCurvature(activeFraction: number): number | undefined {\n // BUG? active interval\n return this._curvature01.fractionToPoint(this.activeFractionInterval.fractionToPoint(activeFraction));\n }\n // These static variables are reused on calls to integrateFromStartFraction\n private static _gaussFraction: Float64Array;\n private static _gaussWeight: Float64Array;\n private static _gaussMapper: (xA: number, xB: number, arrayX: Float64Array, arrayW: Float64Array) => number;\n /** Initialize class level work arrays. */\n public static initWorkSpace() {\n IntegratedSpiral3d._gaussFraction = new Float64Array(5);\n IntegratedSpiral3d._gaussWeight = new Float64Array(5);\n IntegratedSpiral3d._gaussMapper = (xA, xB, xMapped, wMapped) => Quadrature.setupGauss5(xA, xB, xMapped, wMapped);\n }\n /**\n * Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference\n * length (recall that theta is a nonlinear function of the fraction).\n * * This is a single interval of gaussian integration.\n * * The fraction is on the full spiral (not in the mapped active interval).\n * @param xyz advancing integrated point.\n * @param fractionA fraction at start of interval.\n * @param fractionB fraction at end of interval.\n * @param applyMatrix if true, apply the localToWorld matrix to the computed delta before adding to xyz.\n */\n private fullSpiralIncrementalIntegral(xyz: Point3d, fractionA: number, fractionB: number, applyMatrix: boolean): void {\n // see internaldocs/Spiral.md for more info\n const gaussFraction = IntegratedSpiral3d._gaussFraction;\n const gaussWeight = IntegratedSpiral3d._gaussWeight;\n const numEval = IntegratedSpiral3d._gaussMapper(fractionA, fractionB, gaussFraction, gaussWeight);\n const deltaL = this._arcLength01;\n let w = 0;\n let dx = 0.0;\n let dy = 0.0;\n for (let k = 0; k < numEval; k++) {\n const radians = this.globalFractionToBearingRadians(gaussFraction[k]);\n w = gaussWeight[k] * deltaL;\n dx += w * Math.cos(radians);\n dy += w * Math.sin(radians);\n }\n if (applyMatrix)\n Matrix3d.xyzPlusMatrixTimesXYZ(xyz, this.localToWorld.matrix, { x: dx, y: dy, z: 0.0 }, xyz);\n else\n xyz.addXYZInPlace(dx, dy, 0.0);\n }\n /** Recompute strokes. */\n public override refreshComputedProperties() {\n this._curvature01 = Segment1d.create(\n TransitionSpiral3d.radiusToCurvature(this.radius01.x0),\n TransitionSpiral3d.radiusToCurvature(this.radius01.x1),\n );\n this._globalStrokes.clear();\n const currentPoint = Point3d.create();\n this._globalStrokes.appendStrokePoint(currentPoint);\n const numInterval = 16;\n const fractionStep = 1.0 / numInterval;\n for (let i = 1; i <= numInterval; i++) {\n const fraction0 = (i - 1) * fractionStep;\n const fraction1 = i * fractionStep;\n this.fullSpiralIncrementalIntegral(currentPoint, fraction0, fraction1, false);\n this._globalStrokes.appendStrokePoint(currentPoint);\n }\n this._globalStrokes.tryTransformInPlace(this.localToWorld);\n if (!this.activeFractionInterval.isExact01) {\n if (this._activeStrokes === undefined)\n this._activeStrokes = LineString3d.create();\n this._activeStrokes.clear();\n // The active interval has finer strokes: it's the same fraction step but mapped to a sub-interval.\n // Below assumes fractionToPoint depends upon the global strokes we just computed, and not\n // on the active strokes we are computing.\n for (let i = 0; i <= numInterval; i++) {\n const localFraction = i * fractionStep;\n this._activeStrokes.addPoint(this.fractionToPoint(localFraction));\n }\n }\n }\n /**\n * Create a transition spiral with radius and bearing conditions.\n * @param radius01 radius (inverse curvature) at start and end (radius of zero means straight line).\n * @param bearing01 bearing angles at start and end. Bearings are measured from the x axis, positive clockwise\n * towards y axis.\n * @param activeFractionInterval fractional limits of the active portion of the spiral.\n * @param localToWorld placement frame. Fractional coordinate 0 is at the origin.\n */\n public static createRadiusRadiusBearingBearing(\n radius01: Segment1d,\n bearing01: AngleSweep,\n activeFractionInterval: Segment1d,\n localToWorld: Transform,\n typeName?: string,\n ): IntegratedSpiral3d | undefined {\n const arcLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(\n radius01.x0, radius01.x1, bearing01.sweepRadians,\n );\n if (typeName === undefined)\n typeName = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(typeName);\n if (!evaluator)\n return undefined;\n return new IntegratedSpiral3d(\n typeName,\n evaluator,\n radius01.clone(),\n bearing01.clone(),\n activeFractionInterval.clone(),\n localToWorld.clone(),\n arcLength,\n new TransitionConditionalProperties(\n radius01.x0, radius01.x1, bearing01.startAngle.clone(), bearing01.endAngle.clone(), undefined,\n ),\n );\n }\n /**\n * Create a transition spiral.\n * * Inputs must provide exactly 4 of the 5 values `[radius0,radius1,bearing0,bearing1,length]`.\n * @param spiralType one of \"clothoid\", \"bloss\", \"biquadratic\", \"cosine\", \"sine\". If undefined, \"clothoid\" is used.\n * @param radius0 radius (or 0 for tangent to line) at start.\n * @param radius1 radius (or 0 for tangent to line) at end.\n * @param bearing0 bearing, measured CCW from x axis at start.\n * @param bearing1 bearing, measured CCW from x axis at end.\n * @param fractionInterval optional fractional interval for an \"active\" portion of the curve. If omitted, the full\n * [0,1] is used.\n * @param localToWorld placement transform.\n */\n public static createFrom4OutOf5(\n spiralType: string | undefined,\n radius0: number | undefined,\n radius1: number | undefined,\n bearing0: Angle | undefined,\n bearing1: Angle | undefined,\n arcLength: number | undefined,\n fractionInterval: undefined | Segment1d,\n localToWorld: Transform,\n ): IntegratedSpiral3d | undefined {\n if (spiralType === undefined)\n spiralType = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(spiralType);\n if (!evaluator)\n return undefined;\n const data = new TransitionConditionalProperties(radius0, radius1, bearing0, bearing1, arcLength);\n const data1 = data.clone();\n if (!data.tryResolveAnySingleUnknown())\n return undefined;\n if (fractionInterval === undefined)\n fractionInterval = Segment1d.create(0, 1);\n return new IntegratedSpiral3d(\n spiralType,\n evaluator,\n Segment1d.create(data.radius0, data.radius1),\n AngleSweep.createStartEnd(data.bearing0!, data.bearing1!),\n fractionInterval ? fractionInterval.clone() : Segment1d.create(0, 1),\n localToWorld,\n data.curveLength!,\n data1,\n );\n }\n /** Copy all defining data from another spiral. */\n public setFrom(other: IntegratedSpiral3d): IntegratedSpiral3d {\n this.localToWorld.setFrom(other.localToWorld);\n this.radius01.setFrom(other.radius01);\n this._curvature01.setFrom(other._curvature01);\n this.bearing01.setFrom(other.bearing01);\n this.localToWorld.setFrom(other.localToWorld);\n this.activeFractionInterval.setFrom(other.activeFractionInterval);\n this._arcLength01 = other._arcLength01;\n return this;\n }\n /** Deep clone of this spiral. */\n public override clone(): IntegratedSpiral3d {\n return new IntegratedSpiral3d(\n this._spiralType,\n this._evaluator,\n this.radius01.clone(),\n this.bearing01.clone(),\n this.activeFractionInterval.clone(),\n this.localToWorld.clone(),\n this._arcLength01,\n this._designProperties?.clone(),\n );\n }\n /** Apply `transform` to this spiral's local to world transform. */\n public tryTransformInPlace(transformA: Transform): boolean {\n const rigidData = this.applyRigidPartOfTransform(transformA);\n if (rigidData !== undefined) {\n this._curvature01.x0 /= rigidData.scale;\n this._curvature01.x1 /= rigidData.scale;\n this.radius01.x0 *= rigidData.scale;\n this.radius01.x1 *= rigidData.scale;\n this._arcLength01 *= rigidData.scale;\n }\n this.refreshComputedProperties();\n return true;\n }\n /** Return the spiral start point. */\n public override startPoint(result?: Point3d): Point3d {\n return this.activeStrokes.startPoint(result);\n }\n /** Return the spiral end point. */\n public override endPoint(result?: Point3d): Point3d {\n return this.activeStrokes.endPoint(result);\n }\n /** Test if the local to world transform places the spiral xy plane into `plane`. */\n public isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean {\n return plane.isPointInPlane(this.localToWorld.origin as Point3d)\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));\n }\n /**\n * Return length of the spiral.\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\n */\n public quickLength() {\n return this.curveLength();\n }\n /**\n * Return length of the spiral.\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\n */\n public override curveLength() {\n return this._arcLength01 * (this._activeFractionInterval.absoluteDelta());\n }\n /**\n * Return (unsigned) length of the spiral between fractions.\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\n */\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number) {\n return this._arcLength01 * (this._activeFractionInterval.absoluteDelta() * Math.abs(fraction1 - fraction0));\n }\n /** Test if `other` is an instance of `TransitionSpiral3d`. */\n public isSameGeometryClass(other: any): boolean {\n return other instanceof TransitionSpiral3d;\n }\n /**\n * Add strokes from this spiral to `dest`.\n * * Linestrings will usually stroke as just their points.\n * * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.\n */\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\n this.activeStrokes.emitStrokes(dest, options);\n }\n /** Emit stroke fragments to `dest` handler. */\n public emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void {\n const n = this.computeStrokeCountForOptions(options);\n dest.startParentCurvePrimitive(this);\n const activeStrokes = this.activeStrokes;\n const preferPrimary = dest.needPrimaryGeometryForStrokes === undefined ? false : dest.needPrimaryGeometryForStrokes();\n if (!preferPrimary && n <= activeStrokes.numPoints()) {\n this.activeStrokes.emitStrokableParts(dest, options);\n } else {\n dest.announceIntervalForUniformStepStrokes(this, n, 0.0, 1.0);\n }\n dest.endParentCurvePrimitive(this);\n }\n /**\n * Return the stroke count required for given options.\n * @param options StrokeOptions that determine count.\n */\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n let numStroke;\n if (options) {\n const rMin = Math.min(Math.abs(this.radius01.x0), Math.abs(this.radius01.x1));\n numStroke = options.applyTolerancesToArc(rMin, this.bearing01.sweepRadians);\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\n } else {\n numStroke = StrokeOptions.applyAngleTol(undefined, 4, this.bearing01.sweepRadians);\n }\n return numStroke;\n }\n /**\n * Reverse the active interval and active strokes.\n * * Primary defining data remains unchanged.\n */\n public reverseInPlace(): void {\n this.activeFractionInterval.reverseInPlace();\n if (this._activeStrokes === undefined)\n this._activeStrokes = this._globalStrokes.clone();\n this._activeStrokes.reverseInPlace();\n }\n /** Evaluate curve point with respect to fraction. */\n public fractionToPoint(activeFraction: number, result?: Point3d): Point3d {\n const targetGlobalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n const numStrokes = this._globalStrokes.packedPoints.length - 1;\n if (activeFraction > 1.0) {\n result = this._globalStrokes.packedPoints.back(result)!;\n const integrationStep = 1.0 / numStrokes;\n let currentGlobalFraction = 1.0;\n let nextGlobalFraction = currentGlobalFraction + integrationStep;\n while (nextGlobalFraction < targetGlobalFraction) {\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\n currentGlobalFraction = nextGlobalFraction;\n nextGlobalFraction += integrationStep;\n }\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\n } else if (activeFraction < 0.0) {\n result = this._globalStrokes.packedPoints.front(result)!;\n const integrationStep = 1.0 / numStrokes;\n let currentGlobalFraction = 0.0;\n let nextGlobalFraction = currentGlobalFraction - integrationStep;\n while (nextGlobalFraction > targetGlobalFraction) {\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\n currentGlobalFraction = nextGlobalFraction;\n nextGlobalFraction -= integrationStep;\n }\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\n } else {\n const clampedGlobalFraction = Geometry.clampToStartEnd(targetGlobalFraction, 0, 1);\n const index0 = Math.trunc(clampedGlobalFraction * numStrokes); // this indexes the point to the left of the query\n const globalFraction0 = index0 / numStrokes;\n result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(index0, result);\n // GeometryCoreTestIO.consoleLog(\"fractionToPoint \", activeFraction, this.activeFractionInterval, \"( global integration \" + globalFraction0 + \" to \" + globalFraction + \")\", index0);\n this.fullSpiralIncrementalIntegral(result, globalFraction0, targetGlobalFraction, true);\n\n }\n return result;\n }\n /** Evaluate curve point and derivative with respect to fraction. */\n public fractionToPointAndDerivative(activeFraction: number, result?: Ray3d): Ray3d {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n result = result ? result : Ray3d.createZero();\n this.fractionToPoint(activeFraction, result.origin);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const a = this._arcLength01 * this.activeFractionInterval.signedDelta();\n this.localToWorld.matrix.multiplyXY(a * Math.cos(radians), a * Math.sin(radians), result.direction);\n return result;\n }\n /** Return the frenet frame at fractional position. */\n public override fractionToFrenetFrame(activeFraction: number, result?: Transform): Transform {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n result = result ? result : Transform.createIdentity();\n result.origin.setFrom(this.fractionToPoint(activeFraction));\n Matrix3d.createRigidFromMatrix3d(this.localToWorld.matrix, AxisOrder.XYZ, result.matrix);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n result.matrix.applyGivensColumnOp(0, 1, c, s);\n return result;\n }\n /**\n * Return a plane with\n * * origin at fractional position along the curve.\n * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to\n * the fraction.\n * * vectorV is the second derivative, i.e.derivative of vectorU.\n */\n public fractionToPointAnd2Derivatives(\n activeFraction: number, result?: Plane3dByOriginAndVectors,\n ): Plane3dByOriginAndVectors | undefined {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n const origin = this.fractionToPoint(activeFraction);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n const delta = this.activeFractionInterval.signedDelta();\n const a = delta;\n const b = a * delta;\n const vectorX = this.localToWorld.matrix.multiplyXY(a * c, a * s);\n const vectorY = this.localToWorld.matrix.multiplyXY(-b * s, b * c);\n vectorY.scaleInPlace(this.globalFractionToCurvature(globalFraction));\n return Plane3dByOriginAndVectors.createCapture(origin, vectorX, vectorY, result);\n }\n /** Second step of double dispatch: call `handler.handleTransitionSpiral(this)`. */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleTransitionSpiral(this);\n }\n /** Compare various coordinate quantities. */\n public override isAlmostEqual(other?: GeometryQuery): boolean {\n if (other instanceof IntegratedSpiral3d) {\n return this.radius01.isAlmostEqual(other.radius01)\n && this.bearing01.isAlmostEqualAllowPeriodShift(other.bearing01)\n && this.localToWorld.isAlmostEqual(other.localToWorld)\n && Geometry.isSameCoordinate(this._arcLength01, other._arcLength01)\n && this.activeFractionInterval.isAlmostEqual(other.activeFractionInterval)\n && this._curvature01.isAlmostEqual(other._curvature01);\n }\n return false;\n }\n}\n// at load time, initialize gauss quadrature workspace\nIntegratedSpiral3d.initWorkSpace();\n"]}
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
* * Each implementation provides:
|
|
11
11
|
* * fractionToCurvature -- the f(u) function described above
|
|
12
12
|
* * fractionToCurvatureDerivative -- df(u)/du
|
|
13
|
-
* * fractionToArea --
|
|
14
|
-
*
|
|
13
|
+
* * fractionToArea -- antiderivative A of f, chosen such that A(0) = 0. The value of this function at
|
|
14
|
+
* fraction u is the area under f from 0 to u. In particular, the symmetry condition on f implies that
|
|
15
|
+
* 1/2 = "integral of f over [0,1]" = A(1) - A(0) = A(1).
|
|
15
16
|
* @internal
|
|
16
17
|
*/
|
|
17
18
|
export declare abstract class NormalizedTransition {
|
|
@@ -47,7 +48,7 @@ export declare abstract class NormalizedTransition {
|
|
|
47
48
|
}
|
|
48
49
|
/**
|
|
49
50
|
* Transition functions for clothoid spiral.
|
|
50
|
-
* *
|
|
51
|
+
* * Curvature variation is linear from (0,0) to (1,1).
|
|
51
52
|
* @internal
|
|
52
53
|
*/
|
|
53
54
|
export declare class NormalizedClothoidTransition extends NormalizedTransition {
|
|
@@ -93,10 +94,10 @@ export declare class NormalizedBiQuadraticTransition extends NormalizedTransitio
|
|
|
93
94
|
private basisDerivative;
|
|
94
95
|
/**
|
|
95
96
|
* At fractional position on the x axis, return the (normalized) curvature fraction.
|
|
96
|
-
* * For [u <= 0.5, u
|
|
97
|
-
* * f(u) = [
|
|
98
|
-
* * f'(u) = [
|
|
99
|
-
* * If(u) = [
|
|
97
|
+
* * For [u <= 0.5, u > 0.5]
|
|
98
|
+
* * f(u) = [2u^2, 1 - 2(1-u)^2]
|
|
99
|
+
* * f'(u) = [4u, 4(1-u)]
|
|
100
|
+
* * If(u) = [2u^3 / 3, u + 2(1-u)^3 /3]
|
|
100
101
|
*/
|
|
101
102
|
fractionToCurvatureFraction(u: number): number;
|
|
102
103
|
/** Return the derivative of the (normalized) curvature fraction. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NormalizedTransition.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/NormalizedTransition.ts"],"names":[],"mappings":"AAKA;;GAEG;A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zC;AAED;;;;;;GAMG;AACH,qBAAa,+BAAgC,SAAQ,oBAAoB;;IAIvE,OAAO,CAAC,eAAe;IAGvB,OAAO,CAAC,KAAK;IAGb,OAAO,CAAC,eAAe;IAGvB;;;;;;OAMG;IACI,2BAA2B,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAGrD,oEAAoE;IAC7D,qCAAqC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAG/D;;;OAGG;IACI,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;CAOzC;AAED;;;;;;GAMG;AACH,qBAAa,wBAAyB,SAAQ,oBAAoB;;IAQhE,wFAAwF;IACjF,2BAA2B,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAIrD,oEAAoE;IAC7D,qCAAqC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAI/D;;;OAGG;IACI,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;CAIzC;AAED;;;;GAIG;AACH,qBAAa,0BAA2B,SAAQ,oBAAoB;;IAOlE,wFAAwF;IACjF,2BAA2B,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAIrD,oEAAoE;IAC7D,qCAAqC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAI/D;;;OAGG;IACI,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;CAIzC"}
|
|
@@ -14,10 +14,12 @@
|
|
|
14
14
|
* * Each implementation provides:
|
|
15
15
|
* * fractionToCurvature -- the f(u) function described above
|
|
16
16
|
* * fractionToCurvatureDerivative -- df(u)/du
|
|
17
|
-
* * fractionToArea --
|
|
18
|
-
*
|
|
17
|
+
* * fractionToArea -- antiderivative A of f, chosen such that A(0) = 0. The value of this function at
|
|
18
|
+
* fraction u is the area under f from 0 to u. In particular, the symmetry condition on f implies that
|
|
19
|
+
* 1/2 = "integral of f over [0,1]" = A(1) - A(0) = A(1).
|
|
19
20
|
* @internal
|
|
20
21
|
*/
|
|
22
|
+
// see internaldocs/Spiral.md for more info
|
|
21
23
|
export class NormalizedTransition {
|
|
22
24
|
/** Constructor initializes with 0..1 values. Call "setBearingCurvatureLengthCurvature" to apply real values. */
|
|
23
25
|
constructor() { }
|
|
@@ -54,10 +56,13 @@ export class NormalizedTransition {
|
|
|
54
56
|
}
|
|
55
57
|
/**
|
|
56
58
|
* Transition functions for clothoid spiral.
|
|
57
|
-
* *
|
|
59
|
+
* * Curvature variation is linear from (0,0) to (1,1).
|
|
58
60
|
* @internal
|
|
59
61
|
*/
|
|
60
62
|
export class NormalizedClothoidTransition extends NormalizedTransition {
|
|
63
|
+
// clothoid curvature is f(x) = x
|
|
64
|
+
// derivative f'(x) = 1
|
|
65
|
+
// integral If(x) = x^2 / 2
|
|
61
66
|
constructor() {
|
|
62
67
|
super();
|
|
63
68
|
}
|
|
@@ -83,13 +88,12 @@ export class NormalizedClothoidTransition extends NormalizedTransition {
|
|
|
83
88
|
* @internal
|
|
84
89
|
*/
|
|
85
90
|
export class NormalizedBlossTransition extends NormalizedTransition {
|
|
86
|
-
// bloss
|
|
91
|
+
// bloss curvature is x^2 (3 - 2x)
|
|
87
92
|
// derivative 6x (1-x)
|
|
88
|
-
//
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
constructor() { super(); }
|
|
93
|
+
// integral is x^3 (1-x/2)
|
|
94
|
+
constructor() {
|
|
95
|
+
super();
|
|
96
|
+
}
|
|
93
97
|
/** At fractional position on the x axis, return the (normalized) curvature fraction. */
|
|
94
98
|
fractionToCurvatureFraction(u) {
|
|
95
99
|
return u * u * (3 - 2 * u);
|
|
@@ -128,17 +132,17 @@ export class NormalizedBiQuadraticTransition extends NormalizedTransition {
|
|
|
128
132
|
}
|
|
129
133
|
/**
|
|
130
134
|
* At fractional position on the x axis, return the (normalized) curvature fraction.
|
|
131
|
-
* * For [u <= 0.5, u
|
|
132
|
-
* * f(u) = [
|
|
133
|
-
* * f'(u) = [
|
|
134
|
-
* * If(u) = [
|
|
135
|
+
* * For [u <= 0.5, u > 0.5]
|
|
136
|
+
* * f(u) = [2u^2, 1 - 2(1-u)^2]
|
|
137
|
+
* * f'(u) = [4u, 4(1-u)]
|
|
138
|
+
* * If(u) = [2u^3 / 3, u + 2(1-u)^3 /3]
|
|
135
139
|
*/
|
|
136
140
|
fractionToCurvatureFraction(u) {
|
|
137
141
|
return u <= 0.5 ? this.basis(u) : 1.0 - this.basis(1.0 - u);
|
|
138
142
|
}
|
|
139
143
|
/** Return the derivative of the (normalized) curvature fraction. */
|
|
140
144
|
fractionToCurvatureFractionDerivative(u) {
|
|
141
|
-
return u
|
|
145
|
+
return u <= 0.5 ? this.basisDerivative(u) : this.basisDerivative(1 - u);
|
|
142
146
|
}
|
|
143
147
|
/**
|
|
144
148
|
* Return the integrated area under the curve.
|
|
@@ -147,6 +151,7 @@ export class NormalizedBiQuadraticTransition extends NormalizedTransition {
|
|
|
147
151
|
fractionToArea(u) {
|
|
148
152
|
if (u <= 0.5)
|
|
149
153
|
return this.integratedBasis(u);
|
|
154
|
+
// if u > 0.5, integral[0 to u] would be integral[0 to 0.5] of "2u^2" + integral[0.5 to u] of "1 - 2(1-u)^2"
|
|
150
155
|
const v = 1 - u;
|
|
151
156
|
return 0.5 - v + this.integratedBasis(v);
|
|
152
157
|
}
|
|
@@ -159,7 +164,13 @@ export class NormalizedBiQuadraticTransition extends NormalizedTransition {
|
|
|
159
164
|
* @internal
|
|
160
165
|
*/
|
|
161
166
|
export class NormalizedSineTransition extends NormalizedTransition {
|
|
162
|
-
|
|
167
|
+
// sine transition curvature is x - sin(2 pi x) / (2 pi)
|
|
168
|
+
// derivative 1 - cos(2 pi x)
|
|
169
|
+
// integral x^2 / 2 + (cos(2 pi x) - 1) / (4 pi^2)
|
|
170
|
+
// note: this is the only snap function whose antiderivative is chosen with nonzero integration constant.
|
|
171
|
+
constructor() {
|
|
172
|
+
super();
|
|
173
|
+
}
|
|
163
174
|
/** At fractional position on the x axis, return the (normalized) curvature fraction. */
|
|
164
175
|
fractionToCurvatureFraction(u) {
|
|
165
176
|
const a = 2.0 * Math.PI;
|
|
@@ -185,7 +196,12 @@ export class NormalizedSineTransition extends NormalizedTransition {
|
|
|
185
196
|
* @internal
|
|
186
197
|
*/
|
|
187
198
|
export class NormalizedCosineTransition extends NormalizedTransition {
|
|
188
|
-
|
|
199
|
+
// cosine transition curvature is 0.5 (1 - cos(pi x))
|
|
200
|
+
// derivative 0.5 pi sin(pi x)
|
|
201
|
+
// integral 0.5 (x - sin(pi x) / pi)
|
|
202
|
+
constructor() {
|
|
203
|
+
super();
|
|
204
|
+
}
|
|
189
205
|
/** At fractional position on the x axis, return the (normalized) curvature fraction. */
|
|
190
206
|
fractionToCurvatureFraction(u) {
|
|
191
207
|
const a = Math.PI;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NormalizedTransition.js","sourceRoot":"","sources":["../../../../src/curve/spiral/NormalizedTransition.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,OAAgB,oBAAoB;IACxC,gHAAgH;IAChH,gBAAgB,CAAC;IAUT,MAAM,CAAC,kBAAkB,CAAgC;IACzD,MAAM,CAAC,qBAAqB,CAAmC;IAC/D,MAAM,CAAC,eAAe,CAA6B;IACnD,MAAM,CAAC,cAAc,CAA4B;IACjD,MAAM,CAAC,gBAAgB,CAA8B;IAC7D;;;;;;;;;;;OAWG;IACI,MAAM,CAAC,aAAa,CAAC,IAAY;QACtC,IAAI,IAAI,KAAK,UAAU;YACrB,OAAO,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,GAAG,IAAI,4BAA4B,EAAE,CAAC,CAAC;QAC5H,IAAI,IAAI,KAAK,OAAO;YAClB,OAAO,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAA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AG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,oEAAoE;IAC7D,qCAAqC,CAAC,CAAS;QACpD,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC;IACD;;;OAGG;IACI,cAAc,CAAC,CAAS;QAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\n/**\n * NormalizedTransition is the (abstract) base class for clothoid, bloss, biquadratic, sine, and cosine transition functions.\n * * Each function maps fractional progress to a curvature value.\n * * f(0) === 0\n * * f(1) === 1\n * * f(u) === 1 - f(1-u)\n * * Each implementation provides:\n * * fractionToCurvature -- the f(u) function described above\n * * fractionToCurvatureDerivative -- df(u)/du\n * * fractionToArea -- integral of the area under f(u) from 0 to u.\n * * The symmetry condition ensures that the integral from 0 to 1 is 1/2.\n * @internal\n */\nexport abstract class NormalizedTransition {\n /** Constructor initializes with 0..1 values. Call \"setBearingCurvatureLengthCurvature\" to apply real values. */\n constructor() { }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public abstract fractionToCurvatureFraction(fractionX: number): number;\n /** Return the derivative of the (normalized) curvature fraction. */\n public abstract fractionToCurvatureFractionDerivative(fractionX: number): number;\n /**\n * Return the integrated area under the curve.\n * * This is equal to the accumulated angle change.\n */\n public abstract fractionToArea(fractionX: number): number;\n private static _clothoidEvaluator?: NormalizedClothoidTransition;\n private static _biquadraticEvaluator?: NormalizedBiQuadraticTransition;\n private static _blossEvaluator?: NormalizedBlossTransition;\n private static _sineEvaluator?: NormalizedSineTransition;\n private static _cosineEvaluator?: NormalizedCosineTransition;\n /**\n * Return a standard evaluator identified by string as:\n * * clothoid\n * * bloss\n * * biquadratic\n * * sine\n * * cosine\n * Each of these types\n * * is instantiated (only once) as a single static object within the NormalizedTransition class.\n * * has no instance data or mutator methods.\n * @param name string name of the transition.\n */\n public static findEvaluator(name: string): NormalizedTransition | undefined {\n if (name === \"clothoid\")\n return this._clothoidEvaluator ? this._clothoidEvaluator : (this._clothoidEvaluator = new NormalizedClothoidTransition());\n if (name === \"bloss\")\n return this._blossEvaluator ? this._blossEvaluator : (this._blossEvaluator = new NormalizedBlossTransition());\n if (name === \"biquadratic\")\n return this._biquadraticEvaluator ? this._biquadraticEvaluator : (this._biquadraticEvaluator = new NormalizedBiQuadraticTransition());\n if (name === \"sine\")\n return this._sineEvaluator ? this._sineEvaluator : (this._sineEvaluator = new NormalizedSineTransition());\n if (name === \"cosine\")\n return this._cosineEvaluator ? this._cosineEvaluator : (this._cosineEvaluator = new NormalizedCosineTransition());\n return undefined;\n }\n}\n\n/**\n * Transition functions for clothoid spiral.\n * * curvature variation is linear from (0,0) to (1,1)\n * @internal\n */\nexport class NormalizedClothoidTransition extends NormalizedTransition {\n constructor() {\n super();\n }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(fractionX: number): number {\n return fractionX;\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(_u: number): number {\n return 1.0;\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(fractionX: number): number {\n return fractionX * fractionX * 0.5;\n }\n}\n\n/**\n * Transition functions for bloss spiral.\n * * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1.\n * @internal\n */\nexport class NormalizedBlossTransition extends NormalizedTransition {\n // bloss curve is (3 - 2x) x ^2 = 3 x^2 - 2 x^3\n // derivative 6x (1-x)\n // 2nd derivative 6 - 12 x\n // derivatives zero at 0,1\n // inflection zero at 0.5\n // integral is x^3 - x^4 / 2 = x^3 (1-x/2)\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n return u * u * (3 - 2 * u);\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n return 6.0 * u * (1.0 - u);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n return u * u * u * (1 - 0.5 * u);\n }\n}\n\n/**\n * Transition functions for biquadratic transition.\n * * Curvature is a pair of joining quadratics.\n * * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin.\n * * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1.\n * @internal\n */\nexport class NormalizedBiQuadraticTransition extends NormalizedTransition {\n constructor() {\n super();\n }\n private integratedBasis(u: number): number {\n return u * u * u * (2.0 / 3.0);\n }\n private basis(u: number): number {\n return 2 * u * u;\n }\n private basisDerivative(u: number): number {\n return 4 * u;\n }\n /**\n * At fractional position on the x axis, return the (normalized) curvature fraction.\n * * For [u <= 0.5, u >= 0.5]\n * * f(u) = [2 u^2, 1 - 2 (1-u)^2]\n * * f'(u) = [4 u, 4 (1-u)]\n * * If(u) = [2 u^3 / 3, 0.5 (1 -u )^3/3]\n */\n public fractionToCurvatureFraction(u: number): number {\n return u <= 0.5 ? this.basis(u) : 1.0 - this.basis(1.0 - u);\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n return u < 0.5 ? this.basisDerivative(u) : this.basisDerivative(1 - u);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n if (u <= 0.5)\n return this.integratedBasis(u);\n const v = 1 - u;\n return 0.5 - v + this.integratedBasis(v);\n }\n}\n\n/**\n * Transition functions for sine transition.\n * * curvature variation is the sum of\n * * straight line from (0,0) to (1,1), like clothoid.\n * * additional full period of a sine wave, producing 0 slope at both ends.\n * @internal\n */\nexport class NormalizedSineTransition extends NormalizedTransition {\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n const a = 2.0 * Math.PI;\n return u - Math.sin(u * a) / a;\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n const a = 2.0 * Math.PI;\n return 1 - Math.cos(u * a);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n const a = 2.0 * Math.PI;\n return 0.5 * u * u + (Math.cos(u * a) - 1.0) / (a * a);\n }\n}\n\n/**\n * Transition functions for cosine.\n * * curvature variation is a half period of a cosine.\n * @internal\n */\nexport class NormalizedCosineTransition extends NormalizedTransition {\n constructor() { super(); }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n const a = Math.PI;\n return 0.5 * (1 - Math.cos(u * a));\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n const a = Math.PI;\n return 0.5 * a * Math.sin(u * a);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n const a = Math.PI;\n return 0.5 * u - 0.5 * Math.sin(u * a) / a;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NormalizedTransition.js","sourceRoot":"","sources":["../../../../src/curve/spiral/NormalizedTransition.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH;;;;;;;;;;;;;GAaG;AACH,2CAA2C;AAC3C,MAAM,OAAgB,oBAAoB;I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AAE,CAAC;QACxB,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,CAAC;IACD;;;OAGG;IACI,cAAc,CAAC,CAAS;QAC7B,MAAM,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACzD,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,0BAA2B,SAAQ,oBAAoB;IAClE,qDAAqD;IACrD,8BAA8B;IAC9B,oCAAoC;IACpC;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IACD,wFAAwF;IACjF,2BAA2B,CAAC,CAAS;QAC1C,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IACD,oEAAoE;IAC7D,qCAAqC,CAAC,CAAS;QACpD,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,CAAC;IACD;;;OAGG;IACI,cAAc,CAAC,CAAS;QAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\n/**\n * NormalizedTransition is the (abstract) base class for clothoid, bloss, biquadratic, sine, and cosine transition functions.\n * * Each function maps fractional progress to a curvature value.\n * * f(0) === 0\n * * f(1) === 1\n * * f(u) === 1 - f(1-u)\n * * Each implementation provides:\n * * fractionToCurvature -- the f(u) function described above\n * * fractionToCurvatureDerivative -- df(u)/du\n * * fractionToArea -- antiderivative A of f, chosen such that A(0) = 0. The value of this function at\n * fraction u is the area under f from 0 to u. In particular, the symmetry condition on f implies that\n * 1/2 = \"integral of f over [0,1]\" = A(1) - A(0) = A(1).\n * @internal\n */\n// see internaldocs/Spiral.md for more info\nexport abstract class NormalizedTransition {\n /** Constructor initializes with 0..1 values. Call \"setBearingCurvatureLengthCurvature\" to apply real values. */\n constructor() { }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public abstract fractionToCurvatureFraction(fractionX: number): number;\n /** Return the derivative of the (normalized) curvature fraction. */\n public abstract fractionToCurvatureFractionDerivative(fractionX: number): number;\n /**\n * Return the integrated area under the curve.\n * * This is equal to the accumulated angle change.\n */\n public abstract fractionToArea(fractionX: number): number;\n private static _clothoidEvaluator?: NormalizedClothoidTransition;\n private static _biquadraticEvaluator?: NormalizedBiQuadraticTransition;\n private static _blossEvaluator?: NormalizedBlossTransition;\n private static _sineEvaluator?: NormalizedSineTransition;\n private static _cosineEvaluator?: NormalizedCosineTransition;\n /**\n * Return a standard evaluator identified by string as:\n * * clothoid\n * * bloss\n * * biquadratic\n * * sine\n * * cosine\n * Each of these types\n * * is instantiated (only once) as a single static object within the NormalizedTransition class.\n * * has no instance data or mutator methods.\n * @param name string name of the transition.\n */\n public static findEvaluator(name: string): NormalizedTransition | undefined {\n if (name === \"clothoid\")\n return this._clothoidEvaluator ? this._clothoidEvaluator : (this._clothoidEvaluator = new NormalizedClothoidTransition());\n if (name === \"bloss\")\n return this._blossEvaluator ? this._blossEvaluator : (this._blossEvaluator = new NormalizedBlossTransition());\n if (name === \"biquadratic\")\n return this._biquadraticEvaluator ? this._biquadraticEvaluator : (this._biquadraticEvaluator = new NormalizedBiQuadraticTransition());\n if (name === \"sine\")\n return this._sineEvaluator ? this._sineEvaluator : (this._sineEvaluator = new NormalizedSineTransition());\n if (name === \"cosine\")\n return this._cosineEvaluator ? this._cosineEvaluator : (this._cosineEvaluator = new NormalizedCosineTransition());\n return undefined;\n }\n}\n\n/**\n * Transition functions for clothoid spiral.\n * * Curvature variation is linear from (0,0) to (1,1).\n * @internal\n */\nexport class NormalizedClothoidTransition extends NormalizedTransition {\n // clothoid curvature is f(x) = x\n // derivative f'(x) = 1\n // integral If(x) = x^2 / 2\n constructor() {\n super();\n }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(fractionX: number): number {\n return fractionX;\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(_u: number): number {\n return 1.0;\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(fractionX: number): number {\n return fractionX * fractionX * 0.5;\n }\n}\n\n/**\n * Transition functions for bloss spiral.\n * * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1.\n * @internal\n */\nexport class NormalizedBlossTransition extends NormalizedTransition {\n // bloss curvature is x^2 (3 - 2x)\n // derivative 6x (1-x)\n // integral is x^3 (1-x/2)\n constructor() {\n super();\n }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n return u * u * (3 - 2 * u);\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n return 6.0 * u * (1.0 - u);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n return u * u * u * (1 - 0.5 * u);\n }\n}\n\n/**\n * Transition functions for biquadratic transition.\n * * Curvature is a pair of joining quadratics.\n * * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin.\n * * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1.\n * @internal\n */\nexport class NormalizedBiQuadraticTransition extends NormalizedTransition {\n constructor() {\n super();\n }\n private integratedBasis(u: number): number {\n return u * u * u * (2.0 / 3.0);\n }\n private basis(u: number): number {\n return 2 * u * u;\n }\n private basisDerivative(u: number): number {\n return 4 * u;\n }\n /**\n * At fractional position on the x axis, return the (normalized) curvature fraction.\n * * For [u <= 0.5, u > 0.5]\n * * f(u) = [2u^2, 1 - 2(1-u)^2]\n * * f'(u) = [4u, 4(1-u)]\n * * If(u) = [2u^3 / 3, u + 2(1-u)^3 /3]\n */\n public fractionToCurvatureFraction(u: number): number {\n return u <= 0.5 ? this.basis(u) : 1.0 - this.basis(1.0 - u);\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n return u <= 0.5 ? this.basisDerivative(u) : this.basisDerivative(1 - u);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n if (u <= 0.5)\n return this.integratedBasis(u);\n // if u > 0.5, integral[0 to u] would be integral[0 to 0.5] of \"2u^2\" + integral[0.5 to u] of \"1 - 2(1-u)^2\"\n const v = 1 - u;\n return 0.5 - v + this.integratedBasis(v);\n }\n}\n\n/**\n * Transition functions for sine transition.\n * * curvature variation is the sum of\n * * straight line from (0,0) to (1,1), like clothoid.\n * * additional full period of a sine wave, producing 0 slope at both ends.\n * @internal\n */\nexport class NormalizedSineTransition extends NormalizedTransition {\n // sine transition curvature is x - sin(2 pi x) / (2 pi)\n // derivative 1 - cos(2 pi x)\n // integral x^2 / 2 + (cos(2 pi x) - 1) / (4 pi^2)\n // note: this is the only snap function whose antiderivative is chosen with nonzero integration constant.\n constructor() {\n super();\n }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n const a = 2.0 * Math.PI;\n return u - Math.sin(u * a) / a;\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n const a = 2.0 * Math.PI;\n return 1 - Math.cos(u * a);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n const a = 2.0 * Math.PI;\n return 0.5 * u * u + (Math.cos(u * a) - 1.0) / (a * a);\n }\n}\n\n/**\n * Transition functions for cosine.\n * * curvature variation is a half period of a cosine.\n * @internal\n */\nexport class NormalizedCosineTransition extends NormalizedTransition {\n // cosine transition curvature is 0.5 (1 - cos(pi x))\n // derivative 0.5 pi sin(pi x)\n // integral 0.5 (x - sin(pi x) / pi)\n constructor() {\n super();\n }\n /** At fractional position on the x axis, return the (normalized) curvature fraction. */\n public fractionToCurvatureFraction(u: number): number {\n const a = Math.PI;\n return 0.5 * (1 - Math.cos(u * a));\n }\n /** Return the derivative of the (normalized) curvature fraction. */\n public fractionToCurvatureFractionDerivative(u: number): number {\n const a = Math.PI;\n return 0.5 * a * Math.sin(u * a);\n }\n /**\n * Return the integrated area under the curve.\n * * This fraction is the angular change fraction.\n */\n public fractionToArea(u: number): number {\n const a = Math.PI;\n return 0.5 * u - 0.5 * Math.sin(u * a) / a;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionConditionalProperties.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionConditionalProperties.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAG/C;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"TransitionConditionalProperties.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionConditionalProperties.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAG/C;;;;;;;;;;;;GAYG;AAEH,qBAAa,+BAA+B;IAC1C;;;OAGG;IACI,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC;;;OAGG;IACI,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC;;;OAGG;IACI,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC;;;OAGG;IACI,QAAQ,EAAE,KAAK,GAAG,SAAS,CAAC;IACnC,oBAAoB;IACb,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC;;;;;;;OAOG;gBAED,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,QAAQ,EAAE,KAAK,GAAG,SAAS,EAC3B,QAAQ,EAAE,KAAK,GAAG,SAAS,EAC3B,SAAS,EAAE,MAAM,GAAG,SAAS;IAQ/B,kEAAkE;IAC3D,oBAAoB;IAO3B,qEAAqE;IAC9D,KAAK,IAAI,+BAA+B;IAS/C,0EAA0E;IACnE,qBAAqB,IAAI,OAAO;IAUvC;;;OAGG;IACI,0BAA0B,IAAI,OAAO;IAsC5C,OAAO,CAAC,qBAAqB;IAO7B,OAAO,CAAC,kBAAkB;IAO1B,8EAA8E;IACvE,aAAa,CAAC,KAAK,CAAC,EAAE,+BAA+B,GAAG,OAAO;IAetE,iFAAiF;IAC1E,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAUxC,uEAAuE;WACzD,cAAc,CAC1B,CAAC,EAAE,+BAA+B,GAAG,SAAS,EAAE,CAAC,EAAE,+BAA+B,GAAG,SAAS,GAC7F,OAAO;CAKX"}
|
|
@@ -21,6 +21,7 @@ import { TransitionSpiral3d } from "./TransitionSpiral3d";
|
|
|
21
21
|
* determines the remaining one.
|
|
22
22
|
* @public
|
|
23
23
|
*/
|
|
24
|
+
// see internaldocs/Spiral.md for more info
|
|
24
25
|
export class TransitionConditionalProperties {
|
|
25
26
|
/**
|
|
26
27
|
* Radius at start (radius of the osculating circle at the spiral segment's start).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransitionConditionalProperties.js","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionConditionalProperties.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,+BAA+B;IAC1C;;;OAGG;IACI,OAAO,CAAqB;IACnC;;;OAGG;IACI,OAAO,CAAqB;IACnC;;;OAGG;IACI,QAAQ,CAAoB;IACnC;;;OAGG;IACI,QAAQ,CAAoB;IACnC,oBAAoB;IACb,WAAW,CAAqB;IACvC;;;;;;;OAOG;IACH,YACE,OAA2B,EAC3B,OAA2B,EAC3B,QAA2B,EAC3B,QAA2B,EAC3B,SAA6B;QAE7B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC;IAC/B,CAAC;IACD,kEAAkE;IAC3D,oBAAoB;QACzB,OAAO,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;cACnC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC;cAChC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;cACjC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;cACjC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC3C,CAAC;IACD,qEAAqE;IAC9D,KAAK;QACV,OAAO,IAAI,+BAA+B,CACxC,IAAI,CAA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AAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;YACzD,OAAO,KAAK,CAAC;QACf,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC;YACzD,OAAO,KAAK,CAAC;QACf,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC;YAClE,OAAO,KAAK,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IACD,iFAAiF;IAC1E,gBAAgB,CAAC,CAAS;QAC/B,IAAI,CAAC,KAAK,CAAC;YACT,OAAO;QACT,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAC5B,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QACpB,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAC5B,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QACpB,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS;YAChC,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;IAC1B,CAAC;IACD,uEAAuE;IAChE,MAAM,CAAC,cAAc,CAC1B,CAA8C,EAAE,CAA8C;QAE9F,IAAI,CAAC,KAAK,SAAS;YACjB,OAAO,CAAC,KAAK,SAAS,CAAC;QACzB,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { Angle } from \"../../geometry3d/Angle\";\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\n\n/**\n * A true transition spiral is a curve defined by its curvature, with the curvature function symmetric about midpoint.\n * * The symmetry condition creates a relationship among the following 4 quantities:\n * ** curvature0 = curvature (i.e. 1/radius) at start.\n * ** curvature1 = curvature (i.e. 1/radius) at end.\n * ** sweepRadians = signed turning angle from start to end.\n * ** arcLength = length of curve.\n * * The relationship is the equation:\n * ** `sweepRadians = arcLength * average Curvature = arcLength * 0.5 * (curvature0 + curvature1)`\n * * That is, regardless of any curvature properties other than symmetry, specifying any 3 of the quantities fully\n * determines the remaining one.\n * @public\n */\nexport class TransitionConditionalProperties {\n /**\n * Radius at start (radius of the osculating circle at the spiral segment's start).\n * radius0 === 0 means straight line at start.\n */\n public radius0: number | undefined;\n /**\n * Radius at end (radius of the osculating circle at the spiral segment's end).\n * radius1 === 0 means straight line at end.\n */\n public radius1: number | undefined;\n /**\n * Bearing at start (the signed angle from global x-axis to the start tangent of the spiral).\n * * If the direction from x-axis to start tangent is CCW, the start bearing is positive.\n */\n public bearing0: Angle | undefined;\n /**\n * Bearing at end (the signed angle from global x-axis to the end tangent of the spiral).\n * * If the direction from x-axis to end tangent is CCW, the end bearing is positive.\n */\n public bearing1: Angle | undefined;\n /** Curve length. */\n public curveLength: number | undefined;\n /**\n * Capture numeric or undefined values.\n * @param radius0 start radius or undefined.\n * @param radius1 end radius or undefined.\n * @param bearing0 start bearing or undefined.\n * @param bearing1 end bearing or undefined.\n * @param arcLength arc length or undefined.\n */\n public constructor(\n radius0: number | undefined,\n radius1: number | undefined,\n bearing0: Angle | undefined,\n bearing1: Angle | undefined,\n arcLength: number | undefined,\n ) {\n this.radius0 = radius0;\n this.radius1 = radius1;\n this.bearing0 = bearing0;\n this.bearing1 = bearing1;\n this.curveLength = arcLength;\n }\n /** Return the number of defined values among the 5 properties. */\n public numDefinedProperties() {\n return Geometry.defined01(this.radius0)\n + Geometry.defined01(this.radius1)\n + Geometry.defined01(this.bearing0)\n + Geometry.defined01(this.bearing1)\n + Geometry.defined01(this.curveLength);\n }\n /** Clone with all 5 properties (i.e., preserve undefined states). */\n public clone(): TransitionConditionalProperties {\n return new TransitionConditionalProperties(\n this.radius0,\n this.radius1,\n this.bearing0 === undefined ? undefined : this.bearing0.clone(),\n this.bearing1 === undefined ? undefined : this.bearing1.clone(),\n this.curveLength,\n );\n }\n /** Return true if all 5 properties are defined and agree equationally. */\n public getIsValidCompleteSet(): boolean {\n if (this.curveLength !== undefined && this.bearing0 !== undefined && this.bearing1 !== undefined\n && this.radius0 !== undefined && this.radius1 !== undefined) {\n const arcLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(\n this.radius0, this.radius1, this.bearing1.radians - this.bearing0.radians,\n );\n return Geometry.isSameCoordinate(this.curveLength, arcLength);\n }\n return false;\n }\n /**\n * Examine which properties are defined and compute the (single) undefined.\n * @returns true if the input state had precisely one undefined member.\n */\n public tryResolveAnySingleUnknown(): boolean {\n if (this.getIsValidCompleteSet())\n return true;\n if (this.bearing0 && this.bearing1) {\n const sweepRadians = this.bearing1.radians - this.bearing0.radians;\n if (this.curveLength === undefined && this.radius0 !== undefined && this.radius1 !== undefined) {\n this.curveLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(this.radius0, this.radius1, sweepRadians);\n return true;\n }\n if (this.curveLength !== undefined && this.radius0 === undefined && this.radius1 !== undefined) {\n this.radius0 = TransitionSpiral3d.radius1LengthSweepRadiansToRadius0(this.radius1, this.curveLength, sweepRadians);\n return true;\n }\n if (this.curveLength !== undefined && this.radius0 !== undefined && this.radius1 === undefined) {\n this.radius1 = TransitionSpiral3d.radius0LengthSweepRadiansToRadius1(this.radius0, this.curveLength, sweepRadians);\n return true;\n }\n return false;\n }\n // at least one bearing is undefined\n if (this.curveLength === undefined || this.radius0 === undefined || this.radius1 === undefined)\n return false;\n if (this.bearing0) { // bearing 1 is undefined\n this.bearing1 = Angle.createRadians(\n this.bearing0.radians +\n TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength),\n );\n return true;\n }\n if (this.bearing1) { // bearing 0 is undefined\n this.bearing0 = Angle.createRadians(\n this.bearing1.radians -\n TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength),\n );\n return true;\n }\n return false;\n }\n private almostEqualCoordinate(a: number | undefined, b: number | undefined): boolean {\n if (a === undefined && b === undefined)\n return true;\n if (a !== undefined && b !== undefined)\n return Geometry.isSameCoordinate(a, b);\n return false;\n }\n private almostEqualBearing(a: Angle | undefined, b: Angle | undefined): boolean {\n if (a === undefined && b === undefined)\n return true;\n if (a !== undefined && b !== undefined)\n return a.isAlmostEqualNoPeriodShift(b);\n return false;\n }\n /** Test if `this` and `other` have matching numeric and undefined members. */\n public isAlmostEqual(other?: TransitionConditionalProperties): boolean {\n if (!other)\n return false;\n if (!this.almostEqualCoordinate(this.radius0, other.radius0))\n return false;\n if (!this.almostEqualCoordinate(this.radius1, other.radius1))\n return false;\n if (!this.almostEqualBearing(this.bearing0, other.bearing0))\n return false;\n if (!this.almostEqualBearing(this.bearing1, other.bearing1))\n return false;\n if (!this.almostEqualCoordinate(this.curveLength, other.curveLength))\n return false;\n return true;\n }\n /** Apply a NONZERO scale factor to all distances. If `a` is zero, do nothing. */\n public applyScaleFactor(a: number): void {\n if (a === 0)\n return;\n if (this.radius0 !== undefined)\n this.radius0 *= a;\n if (this.radius1 !== undefined)\n this.radius1 *= a;\n if (this.curveLength !== undefined)\n this.curveLength *= a;\n }\n /** Test if `a` and `b` have matching numeric and undefined members. */\n public static areAlmostEqual(\n a: TransitionConditionalProperties | undefined, b: TransitionConditionalProperties | undefined,\n ): boolean {\n if (a === undefined)\n return b === undefined;\n return a.isAlmostEqual(b);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"TransitionConditionalProperties.js","sourceRoot":"","sources":["../../../../src/curve/spiral/TransitionConditionalProperties.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,E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CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,WAAW,CAAC;YAClE,OAAO,KAAK,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IACD,iFAAiF;IAC1E,gBAAgB,CAAC,CAAS;QAC/B,IAAI,CAAC,KAAK,CAAC;YACT,OAAO;QACT,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAC5B,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QACpB,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS;YAC5B,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC;QACpB,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS;YAChC,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;IAC1B,CAAC;IACD,uEAAuE;IAChE,MAAM,CAAC,cAAc,CAC1B,CAA8C,EAAE,CAA8C;QAE9F,IAAI,CAAC,KAAK,SAAS;YACjB,OAAO,CAAC,KAAK,SAAS,CAAC;QACzB,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../../Geometry\";\nimport { Angle } from \"../../geometry3d/Angle\";\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\n\n/**\n * A true transition spiral is a curve defined by its curvature, with the curvature function symmetric about midpoint.\n * * The symmetry condition creates a relationship among the following 4 quantities:\n * ** curvature0 = curvature (i.e. 1/radius) at start.\n * ** curvature1 = curvature (i.e. 1/radius) at end.\n * ** sweepRadians = signed turning angle from start to end.\n * ** arcLength = length of curve.\n * * The relationship is the equation:\n * ** `sweepRadians = arcLength * average Curvature = arcLength * 0.5 * (curvature0 + curvature1)`\n * * That is, regardless of any curvature properties other than symmetry, specifying any 3 of the quantities fully\n * determines the remaining one.\n * @public\n */\n// see internaldocs/Spiral.md for more info\nexport class TransitionConditionalProperties {\n /**\n * Radius at start (radius of the osculating circle at the spiral segment's start).\n * radius0 === 0 means straight line at start.\n */\n public radius0: number | undefined;\n /**\n * Radius at end (radius of the osculating circle at the spiral segment's end).\n * radius1 === 0 means straight line at end.\n */\n public radius1: number | undefined;\n /**\n * Bearing at start (the signed angle from global x-axis to the start tangent of the spiral).\n * * If the direction from x-axis to start tangent is CCW, the start bearing is positive.\n */\n public bearing0: Angle | undefined;\n /**\n * Bearing at end (the signed angle from global x-axis to the end tangent of the spiral).\n * * If the direction from x-axis to end tangent is CCW, the end bearing is positive.\n */\n public bearing1: Angle | undefined;\n /** Curve length. */\n public curveLength: number | undefined;\n /**\n * Capture numeric or undefined values.\n * @param radius0 start radius or undefined.\n * @param radius1 end radius or undefined.\n * @param bearing0 start bearing or undefined.\n * @param bearing1 end bearing or undefined.\n * @param arcLength arc length or undefined.\n */\n public constructor(\n radius0: number | undefined,\n radius1: number | undefined,\n bearing0: Angle | undefined,\n bearing1: Angle | undefined,\n arcLength: number | undefined,\n ) {\n this.radius0 = radius0;\n this.radius1 = radius1;\n this.bearing0 = bearing0;\n this.bearing1 = bearing1;\n this.curveLength = arcLength;\n }\n /** Return the number of defined values among the 5 properties. */\n public numDefinedProperties() {\n return Geometry.defined01(this.radius0)\n + Geometry.defined01(this.radius1)\n + Geometry.defined01(this.bearing0)\n + Geometry.defined01(this.bearing1)\n + Geometry.defined01(this.curveLength);\n }\n /** Clone with all 5 properties (i.e., preserve undefined states). */\n public clone(): TransitionConditionalProperties {\n return new TransitionConditionalProperties(\n this.radius0,\n this.radius1,\n this.bearing0 === undefined ? undefined : this.bearing0.clone(),\n this.bearing1 === undefined ? undefined : this.bearing1.clone(),\n this.curveLength,\n );\n }\n /** Return true if all 5 properties are defined and agree equationally. */\n public getIsValidCompleteSet(): boolean {\n if (this.curveLength !== undefined && this.bearing0 !== undefined && this.bearing1 !== undefined\n && this.radius0 !== undefined && this.radius1 !== undefined) {\n const arcLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(\n this.radius0, this.radius1, this.bearing1.radians - this.bearing0.radians,\n );\n return Geometry.isSameCoordinate(this.curveLength, arcLength);\n }\n return false;\n }\n /**\n * Examine which properties are defined and compute the (single) undefined.\n * @returns true if the input state had precisely one undefined member.\n */\n public tryResolveAnySingleUnknown(): boolean {\n if (this.getIsValidCompleteSet())\n return true;\n if (this.bearing0 && this.bearing1) {\n const sweepRadians = this.bearing1.radians - this.bearing0.radians;\n if (this.curveLength === undefined && this.radius0 !== undefined && this.radius1 !== undefined) {\n this.curveLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(this.radius0, this.radius1, sweepRadians);\n return true;\n }\n if (this.curveLength !== undefined && this.radius0 === undefined && this.radius1 !== undefined) {\n this.radius0 = TransitionSpiral3d.radius1LengthSweepRadiansToRadius0(this.radius1, this.curveLength, sweepRadians);\n return true;\n }\n if (this.curveLength !== undefined && this.radius0 !== undefined && this.radius1 === undefined) {\n this.radius1 = TransitionSpiral3d.radius0LengthSweepRadiansToRadius1(this.radius0, this.curveLength, sweepRadians);\n return true;\n }\n return false;\n }\n // at least one bearing is undefined\n if (this.curveLength === undefined || this.radius0 === undefined || this.radius1 === undefined)\n return false;\n if (this.bearing0) { // bearing 1 is undefined\n this.bearing1 = Angle.createRadians(\n this.bearing0.radians +\n TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength),\n );\n return true;\n }\n if (this.bearing1) { // bearing 0 is undefined\n this.bearing0 = Angle.createRadians(\n this.bearing1.radians -\n TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength),\n );\n return true;\n }\n return false;\n }\n private almostEqualCoordinate(a: number | undefined, b: number | undefined): boolean {\n if (a === undefined && b === undefined)\n return true;\n if (a !== undefined && b !== undefined)\n return Geometry.isSameCoordinate(a, b);\n return false;\n }\n private almostEqualBearing(a: Angle | undefined, b: Angle | undefined): boolean {\n if (a === undefined && b === undefined)\n return true;\n if (a !== undefined && b !== undefined)\n return a.isAlmostEqualNoPeriodShift(b);\n return false;\n }\n /** Test if `this` and `other` have matching numeric and undefined members. */\n public isAlmostEqual(other?: TransitionConditionalProperties): boolean {\n if (!other)\n return false;\n if (!this.almostEqualCoordinate(this.radius0, other.radius0))\n return false;\n if (!this.almostEqualCoordinate(this.radius1, other.radius1))\n return false;\n if (!this.almostEqualBearing(this.bearing0, other.bearing0))\n return false;\n if (!this.almostEqualBearing(this.bearing1, other.bearing1))\n return false;\n if (!this.almostEqualCoordinate(this.curveLength, other.curveLength))\n return false;\n return true;\n }\n /** Apply a NONZERO scale factor to all distances. If `a` is zero, do nothing. */\n public applyScaleFactor(a: number): void {\n if (a === 0)\n return;\n if (this.radius0 !== undefined)\n this.radius0 *= a;\n if (this.radius1 !== undefined)\n this.radius1 *= a;\n if (this.curveLength !== undefined)\n this.curveLength *= a;\n }\n /** Test if `a` and `b` have matching numeric and undefined members. */\n public static areAlmostEqual(\n a: TransitionConditionalProperties | undefined, b: TransitionConditionalProperties | undefined,\n ): boolean {\n if (a === undefined)\n return b === undefined;\n return a.isAlmostEqual(b);\n }\n}\n"]}
|
|
@@ -33,7 +33,7 @@ export type IntegratedSpiralTypeName = "clothoid" | "bloss" | "biquadratic" | "c
|
|
|
33
33
|
* "Integrated" spiral types.
|
|
34
34
|
* @public
|
|
35
35
|
*/
|
|
36
|
-
export type DirectSpiralTypeName = "
|
|
36
|
+
export type DirectSpiralTypeName = "Arema" | "JapaneseCubic" | "ChineseCubic" | "WesternAustralian" | "HalfCosine" | "AustralianRailCorp" | "Czech" | "Italian" | "MXCubicAlongArc" | "Polish";
|
|
37
37
|
/**
|
|
38
38
|
* TransitionSpiral3d is a base class for multiple variants of spirals.
|
|
39
39
|
* * The menagerie of spiral types have 2 broad categories:
|