@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClothoidSeries.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/ClothoidSeries.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD;;;;;;;GAOG;AACH,qBAAa,yBAA0B,SAAQ,gBAAgB;IAC7D,iDAAiD;IAC1C,SAAS,EAAE,MAAM,CAAC;IACzB,iDAAiD;IAC1C,SAAS,EAAE,MAAM,CAAC;IACzB
|
|
1
|
+
{"version":3,"file":"ClothoidSeries.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/ClothoidSeries.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD;;;;;;;GAOG;AACH,qBAAa,yBAA0B,SAAQ,gBAAgB;IAC7D,iDAAiD;IAC1C,SAAS,EAAE,MAAM,CAAC;IACzB,iDAAiD;IAC1C,SAAS,EAAE,MAAM,CAAC;IACzB,yCAAyC;IAClC,cAAc,EAAE,MAAM,CAAC;IAC9B,gCAAgC;IACzB,cAAc,EAAE,MAAM,CAAC;gBACX,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MA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|
|
@@ -15,8 +15,8 @@ const Newton_1 = require("../../numerics/Newton");
|
|
|
15
15
|
* Methods to evaluate caller-specified number of terms of the x and y Taylor series for a clothoid.
|
|
16
16
|
* Each instance has:
|
|
17
17
|
* * number of x and y terms to use.
|
|
18
|
-
* * constant for theta =
|
|
19
|
-
* * This value is c = 1/
|
|
18
|
+
* * constant for theta = cxx.
|
|
19
|
+
* * This value is c = 1/2RL for curve length L measured from inflection to point with radius R.
|
|
20
20
|
* @internal
|
|
21
21
|
*/
|
|
22
22
|
class ClothoidSeriesRLEvaluator extends XYCurveEvaluator_1.XYCurveEvaluator {
|
|
@@ -24,7 +24,7 @@ class ClothoidSeriesRLEvaluator extends XYCurveEvaluator_1.XYCurveEvaluator {
|
|
|
24
24
|
numXTerms;
|
|
25
25
|
/** Number of terms to use in y Taylor series. */
|
|
26
26
|
numYTerms;
|
|
27
|
-
/** Constant c = 1/
|
|
27
|
+
/** Constant c = 1/2RL in theta = cxx. */
|
|
28
28
|
constantDiv2LR;
|
|
29
29
|
/** The nominal curve length. */
|
|
30
30
|
nominalLength1;
|
|
@@ -101,10 +101,12 @@ class ClothoidSeriesRLEvaluator extends XYCurveEvaluator_1.XYCurveEvaluator {
|
|
|
101
101
|
* @param numTerms number of terms to use.
|
|
102
102
|
*/
|
|
103
103
|
fractionToXGo(fraction, numTerms) {
|
|
104
|
-
// write the Taylor series for cos(theta)
|
|
105
|
-
//
|
|
106
|
-
//
|
|
107
|
-
//
|
|
104
|
+
// write the Taylor series for cos(theta):
|
|
105
|
+
// 1 - theta^2 / 2! + theta^4 / 4! - theta^6 / 6! + ...
|
|
106
|
+
// replace theta by s*s*c:
|
|
107
|
+
// 1 - s^4c^2 / 2! + s^8c^4 / 4! - s^12c^6 / 6! + ...
|
|
108
|
+
// integrate wrt s:
|
|
109
|
+
// x = s - s^5 c^2 / 5*2! + s^9 c^4 / 9*4! - s^13 c^6 / 13*6! + ...
|
|
108
110
|
// x = s(1 - (s^4 c^2/2) ( 1/5 - (s^4 c^2 / 3*4) (1/9 - ...) ) )
|
|
109
111
|
const s = fraction * this.nominalLength1;
|
|
110
112
|
let result = s;
|
|
@@ -124,9 +126,11 @@ class ClothoidSeriesRLEvaluator extends XYCurveEvaluator_1.XYCurveEvaluator {
|
|
|
124
126
|
return result;
|
|
125
127
|
}
|
|
126
128
|
fractionToYGo(fraction, numTerms) {
|
|
127
|
-
// write the Taylor series for sin(theta)
|
|
128
|
-
//
|
|
129
|
-
//
|
|
129
|
+
// write the Taylor series for sin(theta):
|
|
130
|
+
// theta - theta^3 / 3! + theta^5 / 5! - theta^7 / 7! + ...
|
|
131
|
+
// replace theta by s*s*c:
|
|
132
|
+
// s^2 c - s^6 c^3 / 3! + s^10 c^5 / 5! - s^14 c^7 / 7! + ...
|
|
133
|
+
// integrate wrt s:
|
|
130
134
|
// y = s^3 c / 3 - s^7 c^3 / 7*3! + s^11 c^5 / 11*5! - s^15 c^7 / 15*7! + ...
|
|
131
135
|
// y = s^3 c ( 1/3 - s^4 c^2/ 3! ( (1/7) - (s^4 c^2 / 4*5) (1/11 - ...) ) )
|
|
132
136
|
const s = fraction * this.nominalLength1;
|
|
@@ -174,7 +178,7 @@ class ClothoidSeriesRLEvaluator extends XYCurveEvaluator_1.XYCurveEvaluator {
|
|
|
174
178
|
// dY = q - q^3/3!
|
|
175
179
|
// q = s^2 c
|
|
176
180
|
// dY = s^2 c - s^6 c^3/3! + s^10 c^5/ 5!
|
|
177
|
-
// recurrence
|
|
181
|
+
// recurrence advancing m by 2 alpha *= -(s^4 c^2) / (m(m+1))
|
|
178
182
|
const s = fraction * this.nominalLength1;
|
|
179
183
|
const q1 = s * s * this.constantDiv2LR;
|
|
180
184
|
let result = q1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClothoidSeries.js","sourceRoot":"","sources":["../../../../src/curve/spiral/ClothoidSeries.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,6CAA0C;AAC1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GAAG,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC;IAClG,CAAC;IACM,WAAW,CAAC,CAAS;QAC1B,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,cAAc,CAAC;QAC1C,MAAM,SAAS,GAAG,qBAAY,CAAC,WAAW,CAAC,SAAS,EAClD,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EACxC,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,SAAS,KAAK,SAAS;YACzB,OAAO,SAAS,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AA/ND,8DA+NC","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\nimport { Geometry } from \"../../Geometry\";\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\nimport { SimpleNewton } from \"../../numerics/Newton\";\n\n/**\n * Methods to evaluate caller-specified number of terms of the x and y Taylor series for a clothoid.\n * Each instance has:\n * * number of x and y terms to use.\n * * constant for theta = c*x*x.\n * * This value is c = 1/(2*R*L) for curve length L measured from inflection to point with radius R.\n * @internal\n */\nexport class ClothoidSeriesRLEvaluator extends XYCurveEvaluator {\n /** Number of terms to use in x Taylor series. */\n public numXTerms: number;\n /** Number of terms to use in y Taylor series. */\n public numYTerms: number;\n /** Constant c = 1/(2*R*L) in theta = c*s*s. */\n public constantDiv2LR: number;\n /** The nominal curve length. */\n public nominalLength1: number;\n public constructor(nominalLength1: number, constantDiv2LR: number, numXTerms: number = 4, numYTerms: number = 4) {\n super();\n this.nominalLength1 = nominalLength1;\n this.constantDiv2LR = constantDiv2LR;\n this.numXTerms = numXTerms;\n this.numYTerms = numYTerms;\n }\n /** Return a deep clone. */\n public clone(): ClothoidSeriesRLEvaluator {\n return new ClothoidSeriesRLEvaluator(this.nominalLength1, this.constantDiv2LR, this.numXTerms, this.numYTerms);\n }\n public scaleInPlace(scaleFactor: number): void {\n this.nominalLength1 *= scaleFactor;\n this.constantDiv2LR /= (scaleFactor * scaleFactor);\n }\n /** Member by member matchup. */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof ClothoidSeriesRLEvaluator) {\n return this.numXTerms === other.numXTerms\n && this.numYTerms === other.numYTerms\n && Geometry.isAlmostEqualNumber(this.constantDiv2LR, other.constantDiv2LR)\n && Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1);\n }\n return false;\n }\n /**\n * Evaluate the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToX(fraction: number): number {\n return this.fractionToXGo(fraction, this.numXTerms);\n }\n /**\n * Evaluate the Y series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToY(fraction: number): number {\n return this.fractionToYGo(fraction, this.numYTerms);\n }\n /**\n * Evaluate the derivative of the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDX(fraction: number): number {\n return this.fractionToDXGo(fraction, this.numXTerms);\n }\n /**\n * Evaluate the derivative of the Y series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDY(fraction: number): number {\n return this.fractionToDYGo(fraction, this.numYTerms);\n }\n /**\n * Evaluate the derivative of the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDDX(fraction: number): number {\n return this.fractionToDDXGo(fraction, this.numXTerms);\n }\n /**\n * Evaluate the derivative of the Y series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDDY(fraction: number): number {\n return this.fractionToDDYGo(fraction, this.numYTerms);\n }\n /**\n * Evaluate the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n * @param numTerms number of terms to use.\n */\n public fractionToXGo(fraction: number, numTerms: number): number {\n // write the Taylor series for cos(theta)\n // replace theta by s*s*c\n // integrate wrt s\n // x = s - s^5 c^2/ 5*2! + s^9 c^4 / 9*4! - s^13 c^6 / 13*6! + ...\n // x = s(1 - (s^4 c^2/2) ( 1/5 - (s^4 c^2 / 3*4) (1/9 - ...) ) )\n const s = fraction * this.nominalLength1;\n let result = s;\n if (numTerms < 2)\n return result;\n const q1 = s * s * this.constantDiv2LR;\n const beta = - q1 * q1;\n let alpha = s;\n let m = 1;\n let n = 5;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha / n;\n m += 2;\n n += 4;\n }\n return result;\n }\n public fractionToYGo(fraction: number, numTerms: number): number {\n // write the Taylor series for sin(theta)\n // replace theta by s*s*c\n // integrate wrt s\n // y = s^3 c / 3 - s^7 c^3 / 7*3! + s^11 c^5 / 11*5! - s^15 c^7 / 15*7! + ...\n // y = s^3 c ( 1/3 - s^4 c^2/ 3! ( (1/7) - (s^4 c^2 / 4*5) (1/11 - ...) ) )\n const s = fraction * this.nominalLength1;\n const q1 = s * s * this.constantDiv2LR;\n let result = q1 * s / 3;\n if (numTerms < 2)\n return result;\n const beta = - q1 * q1;\n let alpha = q1 * s;\n let m = 2;\n let n = 7;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha / n;\n m += 2;\n n += 4;\n }\n return result;\n }\n public fractionToDXGo(fraction: number, numTerms: number): number {\n // yes -- this does happen during derivatives of cosines with more than 0 terms\n if (numTerms <= 0)\n return 0;\n // dX = 1 - s^4c^2/2 + s^8 c^4 / 4! -\n // new Term = old Term * beta / (m(m+1))\n const s = fraction * this.nominalLength1;\n let result = 1;\n if (numTerms < 2) {\n return result * this.nominalLength1;\n }\n const q1 = s * s * this.constantDiv2LR;\n const beta = - q1 * q1;\n let alpha = 1.0;\n let m = 1;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha;\n m += 2;\n }\n return result * this.nominalLength1;\n }\n public fractionToDYGo(fraction: number, numTerms: number): number {\n if (numTerms <= 0)\n return 0;\n // dY = q - q^3/3!\n // q = s^2 c\n // dY = s^2 c - s^6 c^3/3! + s^10 c^5/ 5!\n // recurrence advancing m by 2 alpha *= -(s^4 c^2) / (m(m+1))\n const s = fraction * this.nominalLength1;\n const q1 = s * s * this.constantDiv2LR;\n let result = q1;\n if (numTerms < 2)\n return result * this.nominalLength1;\n const beta = - q1 * q1;\n let alpha = q1;\n let m = 2;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha;\n m += 2;\n }\n return result * this.nominalLength1;\n }\n public fractionToDDXGo(fraction: number, numTerms: number): number {\n // DX is \"cosine\"\n // DDX is \"- sine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n const s = fraction * this.nominalLength1;\n const dTheta = 2 * this.constantDiv2LR * s;\n const sine = this.fractionToDYGo(fraction, numTerms - 1);\n const resultA = (- dTheta * sine * this.nominalLength1);\n return resultA;\n }\n public fractionToDDYGo(fraction: number, numTerms: number): number {\n // DY is \"sine\"\n // DDY is \"cosine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n // BUT .... derivative of the cosine series leading term is zero ... use one less term\n const s = fraction * this.nominalLength1;\n const dTheta = 2 * this.constantDiv2LR * s;\n const cosine = this.fractionToDXGo(fraction, numTerms);\n return cosine * dTheta * this.nominalLength1;\n }\n public fractionToD3X(fraction: number): number {\n if (this.numXTerms <= 1)\n return 0.0;\n // DX is \"cosine\"\n // DDX is \"- sine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n const s = fraction * this.nominalLength1;\n const dTheta = 2.0 * this.constantDiv2LR * s;\n const d2Theta = 2.0 * this.constantDiv2LR;\n const sine = this.fractionToDYGo(fraction, this.numXTerms - 1);\n const cosine = this.fractionToDXGo(fraction, this.numXTerms - 1);\n return (- cosine * dTheta * dTheta - sine * d2Theta) * this.nominalLength1 * this.nominalLength1;\n }\n public fractionToD3Y(fraction: number): number {\n // DY is \"sine\"\n // DDY is \"cosine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n const s = fraction * this.nominalLength1;\n const dTheta = 2.0 * this.constantDiv2LR * s;\n const d2Theta = 2.0 * this.constantDiv2LR;\n // dY is sine series with numYTerms.\n // ddY is cosine series. Leading term of sine series is non-constant, so numYTerms here also\n // d3Y is sine series. Derivative of preceding cosine killed first term.\n const cosine = this.fractionToDXGo(fraction, this.numYTerms);\n const sine = this.fractionToDYGo(fraction, this.numYTerms - 1);\n return (-sine * dTheta * dTheta + cosine * d2Theta) * this.nominalLength1 * this.nominalLength1;\n }\n public xToFraction(x: number): number | undefined {\n const fraction0 = x / this.nominalLength1;\n const fraction1 = SimpleNewton.runNewton1D(fraction0,\n (f: number) => (this.fractionToX(f) - x),\n (f: number) => this.fractionToDX(f));\n if (fraction1 === undefined)\n return undefined;\n return fraction1;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ClothoidSeries.js","sourceRoot":"","sources":["../../../../src/curve/spiral/ClothoidSeries.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AAEH,6CAA0C;AAC1C,yDAAsD;AACtD,kDAAqD;AAErD;;;;;;;GAOG;AACH,MAAa,yBAA0B,SAAQ,mCAAgB;IAC7D,iDAAiD;IAC1C,SAAS,CAAS;IACzB,iDAAiD;IAC1C,SAAS,CAAS;IACzB,yCAAyC;IAClC,cAAc,CAAS;IAC9B,gCAAgC;IACzB,cAAc,CAAS;IAC9B,YAAmB,cAAsB,EAAE,cAAsB,EAAE,YAAoB,CAAC,EAAE,YAAoB,CAAC;QAC7G,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC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S;YACzB,OAAO,SAAS,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;CACF;AAnOD,8DAmOC","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\nimport { Geometry } from \"../../Geometry\";\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\nimport { SimpleNewton } from \"../../numerics/Newton\";\n\n/**\n * Methods to evaluate caller-specified number of terms of the x and y Taylor series for a clothoid.\n * Each instance has:\n * * number of x and y terms to use.\n * * constant for theta = cxx.\n * * This value is c = 1/2RL for curve length L measured from inflection to point with radius R.\n * @internal\n */\nexport class ClothoidSeriesRLEvaluator extends XYCurveEvaluator {\n /** Number of terms to use in x Taylor series. */\n public numXTerms: number;\n /** Number of terms to use in y Taylor series. */\n public numYTerms: number;\n /** Constant c = 1/2RL in theta = cxx. */\n public constantDiv2LR: number;\n /** The nominal curve length. */\n public nominalLength1: number;\n public constructor(nominalLength1: number, constantDiv2LR: number, numXTerms: number = 4, numYTerms: number = 4) {\n super();\n this.nominalLength1 = nominalLength1;\n this.constantDiv2LR = constantDiv2LR;\n this.numXTerms = numXTerms;\n this.numYTerms = numYTerms;\n }\n /** Return a deep clone. */\n public clone(): ClothoidSeriesRLEvaluator {\n return new ClothoidSeriesRLEvaluator(this.nominalLength1, this.constantDiv2LR, this.numXTerms, this.numYTerms);\n }\n public scaleInPlace(scaleFactor: number): void {\n this.nominalLength1 *= scaleFactor;\n this.constantDiv2LR /= (scaleFactor * scaleFactor);\n }\n /** Member by member matchup. */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof ClothoidSeriesRLEvaluator) {\n return this.numXTerms === other.numXTerms\n && this.numYTerms === other.numYTerms\n && Geometry.isAlmostEqualNumber(this.constantDiv2LR, other.constantDiv2LR)\n && Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1);\n }\n return false;\n }\n /**\n * Evaluate the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToX(fraction: number): number {\n return this.fractionToXGo(fraction, this.numXTerms);\n }\n /**\n * Evaluate the Y series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToY(fraction: number): number {\n return this.fractionToYGo(fraction, this.numYTerms);\n }\n /**\n * Evaluate the derivative of the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDX(fraction: number): number {\n return this.fractionToDXGo(fraction, this.numXTerms);\n }\n /**\n * Evaluate the derivative of the Y series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDY(fraction: number): number {\n return this.fractionToDYGo(fraction, this.numYTerms);\n }\n /**\n * Evaluate the derivative of the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDDX(fraction: number): number {\n return this.fractionToDDXGo(fraction, this.numXTerms);\n }\n /**\n * Evaluate the derivative of the Y series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n */\n public fractionToDDY(fraction: number): number {\n return this.fractionToDDYGo(fraction, this.numYTerms);\n }\n /**\n * Evaluate the X series at a nominal distance along the curve.\n * @param fraction fractional position along the curve.\n * @param numTerms number of terms to use.\n */\n public fractionToXGo(fraction: number, numTerms: number): number {\n // write the Taylor series for cos(theta):\n // 1 - theta^2 / 2! + theta^4 / 4! - theta^6 / 6! + ...\n // replace theta by s*s*c:\n // 1 - s^4c^2 / 2! + s^8c^4 / 4! - s^12c^6 / 6! + ...\n // integrate wrt s:\n // x = s - s^5 c^2 / 5*2! + s^9 c^4 / 9*4! - s^13 c^6 / 13*6! + ...\n // x = s(1 - (s^4 c^2/2) ( 1/5 - (s^4 c^2 / 3*4) (1/9 - ...) ) )\n const s = fraction * this.nominalLength1;\n let result = s;\n if (numTerms < 2)\n return result;\n const q1 = s * s * this.constantDiv2LR;\n const beta = - q1 * q1;\n let alpha = s;\n let m = 1;\n let n = 5;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha / n;\n m += 2;\n n += 4;\n }\n return result;\n }\n public fractionToYGo(fraction: number, numTerms: number): number {\n // write the Taylor series for sin(theta):\n // theta - theta^3 / 3! + theta^5 / 5! - theta^7 / 7! + ...\n // replace theta by s*s*c:\n // s^2 c - s^6 c^3 / 3! + s^10 c^5 / 5! - s^14 c^7 / 7! + ...\n // integrate wrt s:\n // y = s^3 c / 3 - s^7 c^3 / 7*3! + s^11 c^5 / 11*5! - s^15 c^7 / 15*7! + ...\n // y = s^3 c ( 1/3 - s^4 c^2/ 3! ( (1/7) - (s^4 c^2 / 4*5) (1/11 - ...) ) )\n const s = fraction * this.nominalLength1;\n const q1 = s * s * this.constantDiv2LR;\n let result = q1 * s / 3;\n if (numTerms < 2)\n return result;\n const beta = - q1 * q1;\n let alpha = q1 * s;\n let m = 2;\n let n = 7;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha / n;\n m += 2;\n n += 4;\n }\n return result;\n }\n public fractionToDXGo(fraction: number, numTerms: number): number {\n // yes -- this does happen during derivatives of cosines with more than 0 terms\n if (numTerms <= 0)\n return 0;\n // dX = 1 - s^4c^2/2 + s^8 c^4 / 4! -\n // new Term = old Term * beta / (m(m+1))\n const s = fraction * this.nominalLength1;\n let result = 1;\n if (numTerms < 2) {\n return result * this.nominalLength1;\n }\n const q1 = s * s * this.constantDiv2LR;\n const beta = - q1 * q1;\n let alpha = 1.0;\n let m = 1;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha;\n m += 2;\n }\n return result * this.nominalLength1;\n }\n public fractionToDYGo(fraction: number, numTerms: number): number {\n if (numTerms <= 0)\n return 0;\n // dY = q - q^3/3!\n // q = s^2 c\n // dY = s^2 c - s^6 c^3/3! + s^10 c^5/ 5!\n // recurrence advancing m by 2 alpha *= -(s^4 c^2) / (m(m+1))\n const s = fraction * this.nominalLength1;\n const q1 = s * s * this.constantDiv2LR;\n let result = q1;\n if (numTerms < 2)\n return result * this.nominalLength1;\n const beta = - q1 * q1;\n let alpha = q1;\n let m = 2;\n for (let i = 1; i < numTerms; i++) {\n alpha *= beta / (m * (m + 1));\n result += alpha;\n m += 2;\n }\n return result * this.nominalLength1;\n }\n public fractionToDDXGo(fraction: number, numTerms: number): number {\n // DX is \"cosine\"\n // DDX is \"- sine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n const s = fraction * this.nominalLength1;\n const dTheta = 2 * this.constantDiv2LR * s;\n const sine = this.fractionToDYGo(fraction, numTerms - 1);\n const resultA = (- dTheta * sine * this.nominalLength1);\n return resultA;\n }\n public fractionToDDYGo(fraction: number, numTerms: number): number {\n // DY is \"sine\"\n // DDY is \"cosine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n // BUT .... derivative of the cosine series leading term is zero ... use one less term\n const s = fraction * this.nominalLength1;\n const dTheta = 2 * this.constantDiv2LR * s;\n const cosine = this.fractionToDXGo(fraction, numTerms);\n return cosine * dTheta * this.nominalLength1;\n }\n public fractionToD3X(fraction: number): number {\n if (this.numXTerms <= 1)\n return 0.0;\n // DX is \"cosine\"\n // DDX is \"- sine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n const s = fraction * this.nominalLength1;\n const dTheta = 2.0 * this.constantDiv2LR * s;\n const d2Theta = 2.0 * this.constantDiv2LR;\n const sine = this.fractionToDYGo(fraction, this.numXTerms - 1);\n const cosine = this.fractionToDXGo(fraction, this.numXTerms - 1);\n return (- cosine * dTheta * dTheta - sine * d2Theta) * this.nominalLength1 * this.nominalLength1;\n }\n public fractionToD3Y(fraction: number): number {\n // DY is \"sine\"\n // DDY is \"cosine\" series times chain rule dTheta/ds = 2 * s * this.constantDivLR\n const s = fraction * this.nominalLength1;\n const dTheta = 2.0 * this.constantDiv2LR * s;\n const d2Theta = 2.0 * this.constantDiv2LR;\n // dY is sine series with numYTerms.\n // ddY is cosine series. Leading term of sine series is non-constant, so numYTerms here also\n // d3Y is sine series. Derivative of preceding cosine killed first term.\n const cosine = this.fractionToDXGo(fraction, this.numYTerms);\n const sine = this.fractionToDYGo(fraction, this.numYTerms - 1);\n return (-sine * dTheta * dTheta + cosine * d2Theta) * this.nominalLength1 * this.nominalLength1;\n }\n public xToFraction(x: number): number | undefined {\n const fraction0 = x / this.nominalLength1;\n const fraction1 = SimpleNewton.runNewton1D(fraction0,\n (f: number) => (this.fractionToX(f) - x),\n (f: number) => this.fractionToDX(f));\n if (fraction1 === undefined)\n return undefined;\n return fraction1;\n }\n}\n"]}
|
|
@@ -20,7 +20,7 @@ export declare class CzechSpiralEvaluator extends CubicEvaluator {
|
|
|
20
20
|
* (0.25==>0.99215), (0.15==>0.997184), (0.10==>0.998749), (0.05==>999687)
|
|
21
21
|
*/
|
|
22
22
|
static gammaConstant(length1: number, radius1: number): number | undefined;
|
|
23
|
-
/** Compute the
|
|
23
|
+
/** Compute the Czech cubic constant. */
|
|
24
24
|
static computeCubicM(length1: number, radius1: number): number | undefined;
|
|
25
25
|
static create(length1: number, radius1: number): CzechSpiralEvaluator | undefined;
|
|
26
26
|
scaleInPlace(scaleFactor: number): void;
|
|
@@ -67,10 +67,7 @@ export declare class CzechSpiralEvaluator extends CubicEvaluator {
|
|
|
67
67
|
export declare class ItalianSpiralEvaluator extends CubicEvaluator {
|
|
68
68
|
nominalLength1: number;
|
|
69
69
|
nominalRadius1: number;
|
|
70
|
-
/**
|
|
71
|
-
* Compute the czech cubic constant.
|
|
72
|
-
* * Funky mixture of lengths.
|
|
73
|
-
*/
|
|
70
|
+
/** Compute the Italian cubic constant. */
|
|
74
71
|
private static computeCubicM;
|
|
75
72
|
/** Constructor is private. Caller responsible for cubicM validity. */
|
|
76
73
|
private constructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CzechSpiralEvaluator.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/CzechSpiralEvaluator.ts"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,MAAM,CAAC;IAC9B,0CAA0C;IAC1C,OAAO,CAAC,MAAM,CAAC,aAAa;IAG5B,sEAAsE;IACtE,OAAO;WAKO,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,sBAAsB,GAAG,SAAS;IAW1E,YAAY,CAAC,WAAW,EAAE,MAAM;IAKhD,2CAA2C;IACpC,KAAK,IAAI,sBAAsB;IAGtC,gCAAgC;IACzB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;IAOzC;;;;;;OAMG;IACI,6BAA6B,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM;IAGvD;;;;OAIG;IACI,6BAA6B,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAGpE"}
|
|
@@ -38,7 +38,7 @@ class CzechSpiralEvaluator extends CubicEvaluator_1.CubicEvaluator {
|
|
|
38
38
|
static gammaConstant(length1, radius1) {
|
|
39
39
|
return 2.0 * radius1 / Math.sqrt(4.0 * radius1 * radius1 - length1 * length1);
|
|
40
40
|
}
|
|
41
|
-
/** Compute the
|
|
41
|
+
/** Compute the Czech cubic constant. */
|
|
42
42
|
static computeCubicM(length1, radius1) {
|
|
43
43
|
const gamma = CzechSpiralEvaluator.gammaConstant(length1, radius1);
|
|
44
44
|
// in the private update method, the LR values should have been vetted
|
|
@@ -132,17 +132,9 @@ exports.CzechSpiralEvaluator = CzechSpiralEvaluator;
|
|
|
132
132
|
class ItalianSpiralEvaluator extends CubicEvaluator_1.CubicEvaluator {
|
|
133
133
|
nominalLength1;
|
|
134
134
|
nominalRadius1;
|
|
135
|
-
/**
|
|
136
|
-
* Compute the czech cubic constant.
|
|
137
|
-
* * Funky mixture of lengths.
|
|
138
|
-
*/
|
|
135
|
+
/** Compute the Italian cubic constant. */
|
|
139
136
|
static computeCubicM(lengthXByForward, radius1) {
|
|
140
|
-
|
|
141
|
-
// in the private update method, the LR values should have been vetted
|
|
142
|
-
if (gamma === undefined)
|
|
143
|
-
return undefined;
|
|
144
|
-
// if radius is negative, it shows up in gamma; but the a signed denominator undoes it so take abs of denominator
|
|
145
|
-
return gamma / Math.abs((6.0 * radius1 * lengthXByForward));
|
|
137
|
+
return CzechSpiralEvaluator.computeCubicM(lengthXByForward, radius1);
|
|
146
138
|
}
|
|
147
139
|
/** Constructor is private. Caller responsible for cubicM validity. */
|
|
148
140
|
constructor(length1, radius1, lengthX, cubicM) {
|
|
@@ -151,7 +143,7 @@ class ItalianSpiralEvaluator extends CubicEvaluator_1.CubicEvaluator {
|
|
|
151
143
|
this.nominalRadius1 = radius1;
|
|
152
144
|
}
|
|
153
145
|
static create(length1, radius1) {
|
|
154
|
-
// this seems goofy
|
|
146
|
+
// this seems goofy; lengthX from forward, then invert for another but that's what the native code does too
|
|
155
147
|
const lengthX = CzechSpiralEvaluator.forwardL2R2Map(length1, -1.0, length1, radius1);
|
|
156
148
|
const lengthX1 = CzechSpiralEvaluator.inverseL2R2Map(length1, 1.0, lengthX, radius1);
|
|
157
149
|
if (lengthX1 === undefined)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CzechSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/CzechSpiralEvaluator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,6CAA0C;AAC1C,qDAAkD;AAClD,kDAAqD;AAErD;;;;;;;;;GASG;AACH,MAAa,oBAAqB,SAAQ,+BAAc;IAC/C,cAAc,CAAS;IACvB,cAAc,CAAS;IAC9B,sEAAsE;IACtE,YAAoB,OAAe,EAAE,OAAe,EAAE,MAAc;QAClE,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACvB,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;QAC9B,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;IAChC,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,aAAa,CAAC,OAAe,EAAE,OAAe;QAC1D,OAAO,GAAG,G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C,CAAC;IAChG,CAAC;IACD;;;;OAIG;IACI,6BAA6B,CAAC,CAAS;QAC5C,OAAO,oBAAoB,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAChG,CAAC;CACF;AApED,wDAoEC","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 { CubicEvaluator } from \"./CubicEvaluator\";\nimport { SimpleNewton } from \"../../numerics/Newton\";\n\n/**\n * Czech cubic.\n * This is y = m*x^3 with\n * * x any point on the x axis.\n * * `fraction` along the spiral goes to `x = fraction * L`.\n * * m is gamma/(6RL).\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt(4RR-LL)` pushes y down a little bit to simulate the lost series terms.\n * @internal\n */\nexport class CzechSpiralEvaluator extends CubicEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n /** Constructor is private. Caller responsible for cubicM validity. */\n private constructor(length1: number, radius1: number, cubicM: number) {\n super(length1, cubicM);\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n }\n /**\n * Return the scale factor between simple x^3 / (6RL) cubic and the czech correction.\n * * For typical case with l1/R1 smallish, this is just less than 1.0:\n * (0.25==>0.99215), (0.15==>0.997184), (0.10==>0.998749), (0.05==>999687)\n */\n public static gammaConstant(length1: number, radius1: number): number | undefined {\n return 2.0 * radius1 / Math.sqrt(4.0 * radius1 * radius1 - length1 * length1);\n }\n /** Compute the czech cubic constant. */\n public static computeCubicM(length1: number, radius1: number): number | undefined {\n const gamma = CzechSpiralEvaluator.gammaConstant(length1, radius1);\n // in the private update method, the LR values should have been vetted\n if (gamma === undefined)\n return undefined;\n // if radius is negative, it shows up in gamma; but the a signed denominator undoes it so take abs of denominator\n return gamma / Math.abs((6.0 * radius1 * length1));\n }\n public static create(length1: number, radius1: number): CzechSpiralEvaluator | undefined {\n const m = this.computeCubicM(length1, radius1);\n if (m === undefined)\n return undefined;\n return new CzechSpiralEvaluator(length1, radius1, m);\n }\n public override scaleInPlace(scaleFactor: number) {\n this.nominalLength1 *= scaleFactor;\n this.nominalRadius1 *= scaleFactor;\n super.scaleInPlace(scaleFactor);\n }\n /** Return a deep copy of the evaluator. */\n public clone(): CzechSpiralEvaluator {\n return new CzechSpiralEvaluator(this.nominalLength1, this.nominalRadius1, this.cubicM);\n }\n /** Member by member matchup. */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof CzechSpiralEvaluator) {\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\n }\n return false;\n }\n /**\n * Return a (fast but mediocre) approximation of spiral length as a function of x axis position.\n * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\n * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate\n * CurvePrimitive measurements.\n * @param x distance along the x axis.\n */\n public xToCzechApproximateDistance(x: number): number {\n return CzechSpiralEvaluator.forwardL2R2Map(x, 1.0, this.nominalLength1, this.nominalRadius1);\n }\n /**\n * Return the inverse of the `forwardL2R2Map` function.\n * * The undefined result can only occur for distances outside the usual spirals.\n * @param d (approximate) distance along the spiral.\n */\n public czechApproximateDistanceToX(d: number): number | undefined {\n return CzechSpiralEvaluator.inverseL2R2Map(d, 1.0, this.nominalLength1, this.nominalRadius1);\n }\n /**\n * Evaluate a series expansion that is used with varying signs (plus or minus 1) in czech and italian spirals.\n * @param x distance along the x axis.\n */\n public static forwardL2R2Map(x: number, sign: number, length: number, radius: number): number {\n const l2 = length * length;\n const r2 = radius * radius;\n const Q = 4.0 * r2 - l2;\n const xx = x * x;\n return x * (1.0 + sign * xx * xx / (10.0 * Q * l2));\n }\n /**\n * Return the inverse of the `forwardL2R2Map` function.\n * * The undefined result can only occur for distances outside the usual spirals.\n * @param d (approximate) distance along the spiral.\n */\n public static inverseL2R2Map(d: number, sign: number, length: number, radius: number): number | undefined {\n const l2 = length * length;\n const r2 = radius * radius;\n const Q = 4.0 * r2 - l2;\n const a = sign / (10.0 * Q * l2);\n return SimpleNewton.runNewton1D(\n d,\n (x: number) => {\n const xx = x * x;\n return x * (1.0 + xx * xx * a) - d;\n },\n (x: number) => {\n const xx = x * x;\n return 1.0 + 5 * xx * xx * a;\n },\n );\n }\n}\n\n/**\n * Italian cubic.\n * This is y = m*x^3 with\n * * x any point on the x axis.\n * * `fraction` along the spiral goes to `x = fraction * L`.\n * * m is gamma/(6RL).\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt(4RR-LL)` pushes y down a little bit to simulate the lost series terms.\n * @internal\n */\nexport class ItalianSpiralEvaluator extends CubicEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n\n /**\n * Compute the czech cubic constant.\n * * Funky mixture of lengths.\n */\n private static computeCubicM(lengthXByForward: number, radius1: number): number | undefined {\n const gamma = CzechSpiralEvaluator.gammaConstant(lengthXByForward, radius1);\n // in the private update method, the LR values should have been vetted\n if (gamma === undefined)\n return undefined;\n // if radius is negative, it shows up in gamma; but the a signed denominator undoes it so take abs of denominator\n return gamma / Math.abs((6.0 * radius1 * lengthXByForward));\n }\n /** Constructor is private. Caller responsible for cubicM validity. */\n private constructor(length1: number, radius1: number, lengthX: number, cubicM: number) {\n super(lengthX, cubicM);\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n }\n public static create(length1: number, radius1: number): ItalianSpiralEvaluator | undefined {\n // this seems goofy.; lengthX from forward, then invert for another but that's what the native code does too\n const lengthX = CzechSpiralEvaluator.forwardL2R2Map(length1, -1.0, length1, radius1);\n const lengthX1 = CzechSpiralEvaluator.inverseL2R2Map(length1, 1.0, lengthX, radius1);\n if (lengthX1 === undefined)\n return undefined;\n const m = ItalianSpiralEvaluator.computeCubicM(lengthX, radius1);\n if (m === undefined)\n return undefined;\n return new ItalianSpiralEvaluator(length1, radius1, lengthX1, m);\n }\n public override scaleInPlace(scaleFactor: number) {\n this.nominalLength1 *= scaleFactor;\n this.nominalRadius1 *= scaleFactor;\n super.scaleInPlace(scaleFactor);\n }\n /** Return a deep copy of the evaluator. */\n public clone(): ItalianSpiralEvaluator {\n return new ItalianSpiralEvaluator(this.nominalLength1, this.nominalRadius1, super.axisLength, this.cubicM);\n }\n /** Member by member matchup. */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof ItalianSpiralEvaluator) {\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\n }\n return false;\n }\n /**\n * Return a (fast but mediocre) approximation of spiral length as a function of x axis position.\n * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\n * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate\n * CurvePrimitive measurements.\n * @param x distance along the x axis.\n */\n public distanceToItalianApproximateX(x: number): number {\n return CzechSpiralEvaluator.forwardL2R2Map(x, -1.0, this.nominalLength1, this.nominalRadius1);\n }\n /**\n * Return the inverse of the `forwardL2R2Map` function.\n * * The undefined result can only occur for distances outside the usual spirals.\n * @param d (approximate) distance along the spiral.\n */\n public xToItalianApproximateDistance(d: number): number | undefined {\n return CzechSpiralEvaluator.inverseL2R2Map(d, -1.0, this.nominalLength1, this.nominalRadius1);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CzechSpiralEvaluator.js","sourceRoot":"","sources":["../../../../src/curve/spiral/CzechSpiralEvaluator.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,6CAA0C;AAC1C,qDAAkD;AAClD,kDAAqD;AAErD;;;;;;;;;GASG;AACH,MAAa,oBAAqB,SAAQ,+BAAc;IAC/C,cAAc,CAAS;IACvB,cAAc,CAAS;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Ac,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAChG,CAAC;IACD;;;;OAIG;IACI,6BAA6B,CAAC,CAAS;QAC5C,OAAO,oBAAoB,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAChG,CAAC;CACF;AA3DD,wDA2DC","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 { CubicEvaluator } from \"./CubicEvaluator\";\nimport { SimpleNewton } from \"../../numerics/Newton\";\n\n/**\n * Czech cubic.\n * This is y = m*x^3 with\n * * x any point on the x axis.\n * * `fraction` along the spiral goes to `x = fraction * L`.\n * * m is gamma/(6RL).\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt(4RR-LL)` pushes y down a little bit to simulate the lost series terms.\n * @internal\n */\nexport class CzechSpiralEvaluator extends CubicEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n /** Constructor is private. Caller responsible for cubicM validity. */\n private constructor(length1: number, radius1: number, cubicM: number) {\n super(length1, cubicM);\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n }\n /**\n * Return the scale factor between simple x^3 / (6RL) cubic and the czech correction.\n * * For typical case with l1/R1 smallish, this is just less than 1.0:\n * (0.25==>0.99215), (0.15==>0.997184), (0.10==>0.998749), (0.05==>999687)\n */\n public static gammaConstant(length1: number, radius1: number): number | undefined {\n return 2.0 * radius1 / Math.sqrt(4.0 * radius1 * radius1 - length1 * length1);\n }\n /** Compute the Czech cubic constant. */\n public static computeCubicM(length1: number, radius1: number): number | undefined {\n const gamma = CzechSpiralEvaluator.gammaConstant(length1, radius1);\n // in the private update method, the LR values should have been vetted\n if (gamma === undefined)\n return undefined;\n // if radius is negative, it shows up in gamma; but the a signed denominator undoes it so take abs of denominator\n return gamma / Math.abs((6.0 * radius1 * length1));\n }\n public static create(length1: number, radius1: number): CzechSpiralEvaluator | undefined {\n const m = this.computeCubicM(length1, radius1);\n if (m === undefined)\n return undefined;\n return new CzechSpiralEvaluator(length1, radius1, m);\n }\n public override scaleInPlace(scaleFactor: number) {\n this.nominalLength1 *= scaleFactor;\n this.nominalRadius1 *= scaleFactor;\n super.scaleInPlace(scaleFactor);\n }\n /** Return a deep copy of the evaluator. */\n public clone(): CzechSpiralEvaluator {\n return new CzechSpiralEvaluator(this.nominalLength1, this.nominalRadius1, this.cubicM);\n }\n /** Member by member matchup. */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof CzechSpiralEvaluator) {\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\n }\n return false;\n }\n /**\n * Return a (fast but mediocre) approximation of spiral length as a function of x axis position.\n * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\n * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate\n * CurvePrimitive measurements.\n * @param x distance along the x axis.\n */\n public xToCzechApproximateDistance(x: number): number {\n return CzechSpiralEvaluator.forwardL2R2Map(x, 1.0, this.nominalLength1, this.nominalRadius1);\n }\n /**\n * Return the inverse of the `forwardL2R2Map` function.\n * * The undefined result can only occur for distances outside the usual spirals.\n * @param d (approximate) distance along the spiral.\n */\n public czechApproximateDistanceToX(d: number): number | undefined {\n return CzechSpiralEvaluator.inverseL2R2Map(d, 1.0, this.nominalLength1, this.nominalRadius1);\n }\n /**\n * Evaluate a series expansion that is used with varying signs (plus or minus 1) in czech and italian spirals.\n * @param x distance along the x axis.\n */\n public static forwardL2R2Map(x: number, sign: number, length: number, radius: number): number {\n const l2 = length * length;\n const r2 = radius * radius;\n const Q = 4.0 * r2 - l2;\n const xx = x * x;\n return x * (1.0 + sign * xx * xx / (10.0 * Q * l2));\n }\n /**\n * Return the inverse of the `forwardL2R2Map` function.\n * * The undefined result can only occur for distances outside the usual spirals.\n * @param d (approximate) distance along the spiral.\n */\n public static inverseL2R2Map(d: number, sign: number, length: number, radius: number): number | undefined {\n const l2 = length * length;\n const r2 = radius * radius;\n const Q = 4.0 * r2 - l2;\n const a = sign / (10.0 * Q * l2);\n return SimpleNewton.runNewton1D(\n d,\n (x: number) => {\n const xx = x * x;\n return x * (1.0 + xx * xx * a) - d;\n },\n (x: number) => {\n const xx = x * x;\n return 1.0 + 5 * xx * xx * a;\n },\n );\n }\n}\n\n/**\n * Italian cubic.\n * This is y = m*x^3 with\n * * x any point on the x axis.\n * * `fraction` along the spiral goes to `x = fraction * L`.\n * * m is gamma/(6RL).\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt(4RR-LL)` pushes y down a little bit to simulate the lost series terms.\n * @internal\n */\nexport class ItalianSpiralEvaluator extends CubicEvaluator {\n public nominalLength1: number;\n public nominalRadius1: number;\n /** Compute the Italian cubic constant. */\n private static computeCubicM(lengthXByForward: number, radius1: number): number | undefined {\n return CzechSpiralEvaluator.computeCubicM(lengthXByForward, radius1);\n }\n /** Constructor is private. Caller responsible for cubicM validity. */\n private constructor(length1: number, radius1: number, lengthX: number, cubicM: number) {\n super(lengthX, cubicM);\n this.nominalLength1 = length1;\n this.nominalRadius1 = radius1;\n }\n public static create(length1: number, radius1: number): ItalianSpiralEvaluator | undefined {\n // this seems goofy; lengthX from forward, then invert for another but that's what the native code does too\n const lengthX = CzechSpiralEvaluator.forwardL2R2Map(length1, -1.0, length1, radius1);\n const lengthX1 = CzechSpiralEvaluator.inverseL2R2Map(length1, 1.0, lengthX, radius1);\n if (lengthX1 === undefined)\n return undefined;\n const m = ItalianSpiralEvaluator.computeCubicM(lengthX, radius1);\n if (m === undefined)\n return undefined;\n return new ItalianSpiralEvaluator(length1, radius1, lengthX1, m);\n }\n public override scaleInPlace(scaleFactor: number) {\n this.nominalLength1 *= scaleFactor;\n this.nominalRadius1 *= scaleFactor;\n super.scaleInPlace(scaleFactor);\n }\n /** Return a deep copy of the evaluator. */\n public clone(): ItalianSpiralEvaluator {\n return new ItalianSpiralEvaluator(this.nominalLength1, this.nominalRadius1, super.axisLength, this.cubicM);\n }\n /** Member by member matchup. */\n public isAlmostEqual(other: any): boolean {\n if (other instanceof ItalianSpiralEvaluator) {\n return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)\n && Geometry.isSameCoordinate(this.nominalRadius1, other.nominalRadius1);\n }\n return false;\n }\n /**\n * Return a (fast but mediocre) approximation of spiral length as a function of x axis position.\n * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.\n * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate\n * CurvePrimitive measurements.\n * @param x distance along the x axis.\n */\n public distanceToItalianApproximateX(x: number): number {\n return CzechSpiralEvaluator.forwardL2R2Map(x, -1.0, this.nominalLength1, this.nominalRadius1);\n }\n /**\n * Return the inverse of the `forwardL2R2Map` function.\n * * The undefined result can only occur for distances outside the usual spirals.\n * @param d (approximate) distance along the spiral.\n */\n public xToItalianApproximateDistance(d: number): number | undefined {\n return CzechSpiralEvaluator.inverseL2R2Map(d, -1.0, this.nominalLength1, this.nominalRadius1);\n }\n}\n"]}
|
|
@@ -15,16 +15,17 @@ import { XYCurveEvaluator } from "./XYCurveEvaluator";
|
|
|
15
15
|
* DirectSpiral3d acts like a TransitionSpiral3d for serialization purposes, but implements spiral types that have
|
|
16
16
|
* "direct" xy calculations without the integrations required for IntegratedSpiral3d.
|
|
17
17
|
* * Each DirectSpiral3d carries an XYCurveEvaluator to give it specialized behavior.
|
|
18
|
-
* * Direct spirals
|
|
18
|
+
* * Direct spirals are created with these static methods:
|
|
19
19
|
* * createArema
|
|
20
20
|
* * createJapaneseCubic
|
|
21
|
-
* * createAustralianRail
|
|
22
|
-
* * createDirectHalfCosine
|
|
23
21
|
* * createChineseCubic
|
|
22
|
+
* * createWesternAustralian
|
|
23
|
+
* * createDirectHalfCosine
|
|
24
|
+
* * createAustralianRail
|
|
24
25
|
* * createCzechCubic
|
|
25
26
|
* * createPolishCubic
|
|
27
|
+
* * createMXCubicAlongArc
|
|
26
28
|
* * createItalian
|
|
27
|
-
* * createWesternAustralian
|
|
28
29
|
* @public
|
|
29
30
|
*/
|
|
30
31
|
export declare class DirectSpiral3d extends TransitionSpiral3d {
|
|
@@ -110,11 +111,11 @@ export declare class DirectSpiral3d extends TransitionSpiral3d {
|
|
|
110
111
|
/**
|
|
111
112
|
* Create an MX Cubic whose nominal length is close to along the curve.
|
|
112
113
|
* This is y = m*x^3 with
|
|
113
|
-
* * m is 1/(
|
|
114
|
+
* * m is 1/(6RL).
|
|
114
115
|
* * 1/(6RL) is the leading term of the sine series.
|
|
115
116
|
* * L1 is an along-the-x-axis distance that is slightly LESS THAN the nominal length.
|
|
116
117
|
* * x is axis position that is slightly LESS than nominal distance along.
|
|
117
|
-
* * L1, x use the approximation `x = s * ( 1 - s^4/ (40
|
|
118
|
+
* * L1, x use the approximation `x = s * ( 1 - s^4/ (40 RR LL))
|
|
118
119
|
* @param localToWorld
|
|
119
120
|
* @param nominalL1
|
|
120
121
|
* @param nominalR1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DirectSpiral3d.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/DirectSpiral3d.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAC7F,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;A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AGG;IACI,4BAA4B,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM;IAcpE;;;OAGG;IACI,cAAc,IAAI,IAAI;IAM7B,qDAAqD;IAC9C,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO;IAMzE,oEAAoE;IAC7D,4BAA4B,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK;IAOlF;;;;;;OAMG;IACI,8BAA8B,CACnC,cAAc,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,yBAAyB,GACzD,yBAAyB,GAAG,SAAS;IASxC,mFAAmF;IAC5E,yBAAyB,CAAC,OAAO,EAAE,eAAe,GAAG,GAAG;IAG/D,6CAA6C;IAC7B,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;CAUnD"}
|
|
@@ -24,18 +24,20 @@ const TransitionSpiral3d_1 = require("./TransitionSpiral3d");
|
|
|
24
24
|
* DirectSpiral3d acts like a TransitionSpiral3d for serialization purposes, but implements spiral types that have
|
|
25
25
|
* "direct" xy calculations without the integrations required for IntegratedSpiral3d.
|
|
26
26
|
* * Each DirectSpiral3d carries an XYCurveEvaluator to give it specialized behavior.
|
|
27
|
-
* * Direct spirals
|
|
27
|
+
* * Direct spirals are created with these static methods:
|
|
28
28
|
* * createArema
|
|
29
29
|
* * createJapaneseCubic
|
|
30
|
-
* * createAustralianRail
|
|
31
|
-
* * createDirectHalfCosine
|
|
32
30
|
* * createChineseCubic
|
|
31
|
+
* * createWesternAustralian
|
|
32
|
+
* * createDirectHalfCosine
|
|
33
|
+
* * createAustralianRail
|
|
33
34
|
* * createCzechCubic
|
|
34
35
|
* * createPolishCubic
|
|
36
|
+
* * createMXCubicAlongArc
|
|
35
37
|
* * createItalian
|
|
36
|
-
* * createWesternAustralian
|
|
37
38
|
* @public
|
|
38
39
|
*/
|
|
40
|
+
// see internaldocs/Spiral.md for more info
|
|
39
41
|
class DirectSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
40
42
|
/** String name for schema properties. */
|
|
41
43
|
curvePrimitiveType = "transitionSpiral";
|
|
@@ -191,11 +193,11 @@ class DirectSpiral3d extends TransitionSpiral3d_1.TransitionSpiral3d {
|
|
|
191
193
|
/**
|
|
192
194
|
* Create an MX Cubic whose nominal length is close to along the curve.
|
|
193
195
|
* This is y = m*x^3 with
|
|
194
|
-
* * m is 1/(
|
|
196
|
+
* * m is 1/(6RL).
|
|
195
197
|
* * 1/(6RL) is the leading term of the sine series.
|
|
196
198
|
* * L1 is an along-the-x-axis distance that is slightly LESS THAN the nominal length.
|
|
197
199
|
* * x is axis position that is slightly LESS than nominal distance along.
|
|
198
|
-
* * L1, x use the approximation `x = s * ( 1 - s^4/ (40
|
|
200
|
+
* * L1, x use the approximation `x = s * ( 1 - s^4/ (40 RR LL))
|
|
199
201
|
* @param localToWorld
|
|
200
202
|
* @param nominalL1
|
|
201
203
|
* @param nominalR1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DirectSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/DirectSpiral3d.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,6CAA0C;AAO1C,0DAAuD;AAEvD,+EAA4E;AAC5E,kDAA+C;AAC/C,oDAAiD;AACjD,mFAAgF;AAChF,qDAA6D;AAC7D,iEAAsF;AACtF,uFAAoF;AACpF,qFAA4E;AAC5E,6EAAoE;AAEpE,6DAA0D;AAG1D;;;;;;;;;;;;;;;EAeE;AACF,MAAa,cAAe,SAAQ,uCAAkB;IACpD,yCAAyC;IACzB,kBAAkB,GAAG,kBAAkB,CAAC;IACxD,wFAAwF;IAChF,cAAc,CAAe;IACrC;;;;;OAKG;IACK,cAAc,CAAgB;IACtC,yEAAyE;IACzE,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI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C,CAAC,GAAG,CAAC,CAAC,CAAC;QACnC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3C,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,mFAAmF;IAC5E,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IACD,6CAA6C;IAC7B,aAAa,CAAC,KAAU;QACtC,IAAI,KAAK,YAAY,cAAc,EAAE,CAAC;YACpC,OAAO,mBAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC;mBAC9D,mBAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC;mBAC5D,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC;mBACnD,IAAI,CAAC,uBAAuB,CAAC,aAAa,CAAC,KAAK,CAAC,uBAAuB,CAAC;mBACzE,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAlkBD,wCAkkBC","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 */\nimport { Geometry } from \"../../Geometry\";\nimport { Angle } from \"../../geometry3d/Angle\";\nimport { GeometryHandler, IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\nimport { Plane3dByOriginAndUnitNormal } from \"../../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\nimport { Transform } from \"../../geometry3d/Transform\";\nimport { CurveLengthContext } from \"../internalContexts/CurveLengthContext\";\nimport { LineString3d } from \"../LineString3d\";\nimport { StrokeOptions } from \"../StrokeOptions\";\nimport { AustralianRailCorpXYEvaluator } from \"./AustralianRailCorpXYEvaluator\";\nimport { ClothoidSeriesRLEvaluator } from \"./ClothoidSeries\";\nimport { CzechSpiralEvaluator, ItalianSpiralEvaluator } from \"./CzechSpiralEvaluator\";\nimport { DirectHalfCosineSpiralEvaluator } from \"./DirectHalfCosineSpiralEvaluator\";\nimport { MXCubicAlongArcEvaluator } from \"./MXCubicAlongArcSpiralEvaluator\";\nimport { PolishCubicEvaluator } from \"./PolishCubicSpiralEvaluator\";\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\n\n/**\n* DirectSpiral3d acts like a TransitionSpiral3d for serialization purposes, but implements spiral types that have\n* \"direct\" xy calculations without the integrations required for IntegratedSpiral3d.\n* * Each DirectSpiral3d carries an XYCurveEvaluator to give it specialized behavior.\n* * Direct spirals that flow through serialization to native imodel02 are created with these static methods:\n* * createArema\n* * createJapaneseCubic\n* * createAustralianRail\n* * createDirectHalfCosine\n* * createChineseCubic\n* * createCzechCubic\n* * createPolishCubic\n* * createItalian\n* * createWesternAustralian\n* @public\n*/\nexport class DirectSpiral3d extends TransitionSpiral3d {\n /** String name for schema properties. */\n public readonly curvePrimitiveType = \"transitionSpiral\";\n /** Stroked approximation of entire spiral. This is AFTER the localToWorld transform. */\n private _globalStrokes: LineString3d;\n /**\n * Stroked approximation of active spiral. This is AFTER the localToWorld transform.\n * * Same count as global; possibly overly fine, but it gives some consistency between same clothoid constructed as\n * 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 private _nominalL1: number;\n private _nominalR1: number;\n private _evaluator: XYCurveEvaluator;\n /** Return the nominal end radius. */\n public get nominalR1(): number {\n return this._nominalR1;\n }\n /** Return the nominal distance from inflection to endpoint. */\n public get nominalL1(): number {\n return this._nominalL1;\n }\n /** Return the nominal end curvature */\n public get nominalCurvature1(): number {\n return TransitionSpiral3d.radiusToCurvature(this._nominalR1);\n }\n /**\n * Return the low level evaluator.\n * @internal\n */\n public get evaluator(): XYCurveEvaluator {\n return this._evaluator;\n }\n // constructor demands radius1 and distance1 for nominal construction.\n // caller is responsible for managing intervals of partial spiral.\n public constructor(\n localToWorld: Transform,\n spiralType: string | undefined,\n originalProperties: TransitionConditionalProperties | undefined,\n nominalL1: number,\n nominalR1: number,\n activeFractionInterval: Segment1d | undefined,\n evaluator: XYCurveEvaluator,\n ) {\n super(spiralType, localToWorld, activeFractionInterval, originalProperties);\n this._nominalL1 = nominalL1;\n this._nominalR1 = nominalR1;\n this._evaluator = evaluator;\n this._globalStrokes = LineString3d.create();\n this._activeStrokes = LineString3d.create();\n // initialize for compiler; but this will be recomputed in refreshComputeProperties\n this.refreshComputedProperties();\n }\n /**\n * Compute stroke data in an interval.\n * @param strokes strokes to clear and refill.\n * @param fractionA start fraction.\n * @param fractionB end fraction.\n * @param numInterval number of intervals.\n * @param applyLocalToWorld if true, apply the localToWorld transform.\n */\n private computeStrokes(\n strokes: LineString3d, fractionA: number, fractionB: number, numInterval: number, applyLocalToWorld: boolean = true,\n ): void {\n if (numInterval < 1)\n numInterval = 1;\n strokes.clear();\n strokes.ensureEmptyUVParams();\n strokes.ensureEmptyFractions();\n const distances = strokes.packedUVParams!;\n const nominalIntervalLength = Math.abs(fractionB - fractionA) * this._nominalL1;\n for (let i = 0; i <= numInterval; i++) {\n const fraction = Geometry.interpolate(fractionA, i / numInterval, fractionB);\n const nominalDistanceAlong = fraction * nominalIntervalLength;\n strokes.packedPoints.pushXYZ(this._evaluator.fractionToX(fraction), this._evaluator.fractionToY(fraction), 0);\n distances.pushXY(fraction, nominalDistanceAlong); // the second distance will be updated below\n }\n if (applyLocalToWorld)\n strokes.tryTransformInPlace(this._localToWorld);\n let fraction0 = distances.getXAtUncheckedPointIndex(0);\n let trueDistance0 = distances.getYAtUncheckedPointIndex(0); // whatever was assigned as start distance is fine\n let trueDistance1, fraction1;\n for (let i = 1; i <= numInterval; i++) {\n fraction1 = distances.getXAtUncheckedPointIndex(i);\n trueDistance1 = trueDistance0 + this._evaluator.integrateDistanceBetweenFractions(fraction0, fraction1);\n distances.setXYAtCheckedPointIndex(i, fraction1, trueDistance1);\n fraction0 = fraction1;\n trueDistance0 = trueDistance1;\n }\n }\n /** Recompute strokes. */\n public override refreshComputedProperties() {\n const sweepRadians = this.nominalL1 / (2.0 * this.nominalR1);\n const radiansStep = 0.02;\n const numInterval = StrokeOptions.applyAngleTol(undefined, 4, sweepRadians, radiansStep);\n this.computeStrokes(this._globalStrokes, 0, 1, numInterval);\n const numActiveInterval = Math.ceil(this._activeFractionInterval.absoluteDelta() * numInterval);\n this._activeStrokes = LineString3d.create();\n this.computeStrokes(\n this._activeStrokes, this._activeFractionInterval.x0, this._activeFractionInterval.x1, numActiveInterval,\n );\n }\n /**\n * Create a spiral object which uses numXTerm terms from the clothoid X series and numYTerm from the clothoid Y series.\n * @param spiralType type of spiral.\n * @param localToWorld placement frame. Inflection point is at origin, initial direction is along x axis.\n * @param numXTerm number of terms to use from X series\n * @param numYTerm number of terms to use from Y series\n * @param originalProperties (optional) transition conditional properties.\n * @param nominalL1 design distance from inflection to end point.\n * @param nominalR1 design radius at end point.\n * @param activeInterval (optional) active interval (as fractions of nominalL1)\n */\n public static createTruncatedClothoid(\n spiralType: string,\n localToWorld: Transform,\n numXTerm: number,\n numYTerm: number,\n originalProperties: TransitionConditionalProperties | undefined,\n nominalL1: number,\n nominalR1: number,\n activeInterval: Segment1d | undefined,\n ): DirectSpiral3d | undefined {\n if (numXTerm < 1)\n numXTerm = 1;\n if (numYTerm < 1)\n numYTerm = 1;\n const evaluator = new ClothoidSeriesRLEvaluator(nominalL1, 1.0 / (2.0 * nominalL1 * nominalR1), numXTerm, numYTerm);\n return new DirectSpiral3d(\n localToWorld.clone(),\n spiralType,\n originalProperties,\n nominalL1,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n evaluator,\n );\n }\n /**\n * Create a czech cubic.\n * This is y = m*x^3 with\n * * x any point on the x axis.\n * * `fraction` along the spiral goes to `x = fraction * L`.\n * * m is gamma/(6RL).\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt(4RR-LL)` pushes y up a little bit to simulate the lost series terms.\n * @param localToWorld\n * @param nominalLx nominal length along x axis.\n * @param nominalR1\n * @param activeInterval\n */\n public static createCzechCubic(\n localToWorld: Transform, nominalLx: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n const evaluator = CzechSpiralEvaluator.create(nominalLx, nominalR1);\n if (evaluator === undefined)\n return undefined;\n return new DirectSpiral3d(\n localToWorld.clone(),\n \"Czech\",\n undefined,\n nominalLx,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n evaluator,\n );\n }\n /**\n * Create an italian spiral\n * This is y = m*x^3 with\n * * x any point on the x axis.\n * * `fraction` along the spiral goes to `x = fraction * L`.\n * * m is gamma/(6RL).\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt(4RR-LL)` pushes y up a little bit to simulate the lost series terms.\n * @param localToWorld\n * @param nominalL1 nominal length along the spiral.\n * @param nominalR1\n * @param activeInterval\n */\n public static createItalian(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n const evaluator = ItalianSpiralEvaluator.create(nominalL1, nominalR1);\n if (evaluator === undefined)\n return undefined;\n return new DirectSpiral3d(\n localToWorld.clone(),\n \"Italian\",\n undefined,\n nominalL1,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n evaluator,\n );\n }\n /**\n * Create an MX Cubic whose nominal length is close to along the curve.\n * This is y = m*x^3 with\n * * m is 1/(6RL1).\n * * 1/(6RL) is the leading term of the sine series.\n * * L1 is an along-the-x-axis distance that is slightly LESS THAN the nominal length.\n * * x is axis position that is slightly LESS than nominal distance along.\n * * L1, x use the approximation `x = s * ( 1 - s^4/ (40 R R L L))\n * @param localToWorld\n * @param nominalL1\n * @param nominalR1\n * @param activeInterval\n */\n public static createMXCubicAlongArc(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n const evaluator = MXCubicAlongArcEvaluator.create(nominalL1, nominalR1);\n if (evaluator === undefined)\n return undefined;\n return new DirectSpiral3d(\n localToWorld.clone(),\n \"MXCubicAlongArc\",\n undefined,\n nominalL1,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n evaluator,\n );\n }\n /**\n * Create a polish cubic\n * This is y = m*x^3 with\n * * m is 1/(6RL).\n * * 1/(6RL) is the leading term of the sine series.\n * * L is nominal length.\n * * R is nominal end radius.\n * * x ranges up to the x axis distance for which the polish distance series produces f(x) = L.\n * * The support class PolishCubicEvaluator has static methods for the distance series and its inversion.\n */\n public static createPolishCubic(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n const evaluator = PolishCubicEvaluator.create(nominalL1, nominalR1);\n if (evaluator === undefined)\n return undefined;\n return new DirectSpiral3d(\n localToWorld.clone(),\n \"PolishCubic\",\n undefined,\n nominalL1,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n evaluator,\n );\n }\n /**\n * Create an AustralianRailCorp spiral\n * This is y = m*x^3 with\n * * x any point on the x axis.\n * * `fraction` along the spiral goes to `x = fraction * L`.\n * * m is gamma/(6RL).\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt(4RR-LL)` pushes y up a little bit to simulate the lost series terms.\n * @param localToWorld\n * @param nominalL1\n * @param nominalR1\n * @param activeInterval\n */\n public static createAustralianRail(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n const evaluator = AustralianRailCorpXYEvaluator.create(nominalL1, nominalR1);\n if (evaluator === undefined)\n return undefined;\n return new DirectSpiral3d(\n localToWorld.clone(),\n \"AustralianRailCorp\",\n undefined,\n nominalL1,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n evaluator,\n );\n }\n public static createDirectHalfCosine(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n return new DirectSpiral3d(\n localToWorld,\n \"HalfCosine\",\n undefined,\n nominalL1,\n nominalR1,\n activeInterval,\n new DirectHalfCosineSpiralEvaluator(nominalL1, nominalR1),\n );\n }\n /**\n * Create an Arema spiral clothoid approximation\n * * X is 2 terms of the clothoid series as a function of nominal distance along.\n * * Y is 2 terms f the clothoid series as a function of nominal distance along.\n * * Remark: This is identical to the ChineseCubic.\n * @param localToWorld axes with inflection at origin, tangent along x axis.\n * @param nominalL1 nominal length as used in series LR terms.\n * @param nominalR1 nominal final radius as used in series LR terms.\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along.\n */\n public static createArema(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n return this.createTruncatedClothoid(\"Arema\", localToWorld, 2, 2, undefined, nominalL1, nominalR1, activeInterval);\n }\n /**\n * Create a Japanese spiral clothoid approximation.\n * * X is 1 terms of the clothoid series as a function of nominal distance along.\n * * Y is 1 terms of the clothoid series as a function of nominal distance along.\n * * Remark: This is identical to the ChineseCubic.\n * @param localToWorld axes with inflection at origin, tangent along x axis.\n * @param nominalL1 nominal length as used in series LR terms.\n * @param nominalR1 nominal final radius as used in series LR terms.\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along\n */\n public static createJapaneseCubic(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n return this.createTruncatedClothoid(\n \"JapaneseCubic\", localToWorld, 1, 1, undefined, nominalL1, nominalR1, activeInterval,\n );\n }\n /**\n * Create a Chinese clothoid approximation\n * * X is 2 terms of the clothoid series as a function of nominal distance along.\n * * Y is 2 terms f the clothoid series as a function of nominal distance along.\n * * Remark: This is identical to the Arema spiral.\n * @param localToWorld axes with inflection at origin, tangent along x axis.\n * @param nominalL1 nominal length as used in series LR terms.\n * @param nominalR1 nominal final radius as used in series LR terms.\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along.\n */\n public static createChineseCubic(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n return this.createTruncatedClothoid(\"ChineseCubic\", localToWorld, 2, 2, undefined, nominalL1, nominalR1, activeInterval);\n }\n /**\n * Create a Western Australian direct spiral.\n * * X is 2 terms of the clothoid series as a function of distance along.\n * * Y is 1 term (cubic in nominal distance along).\n * @param localToWorld axes with inflection at origin, tangent along x axis.\n * @param nominalL1 nominal length as used in series LR terms.\n * @param nominalR1 nominal final radius as used in series LR terms.\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along.\n */\n public static createWesternAustralian(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n return this.createTruncatedClothoid(\"WesternAustralian\", localToWorld, 2, 1, undefined, nominalL1, nominalR1, activeInterval);\n }\n /**\n * Create (if possible) a DirectSpiral3d, applying various strict conditions appropriate to the spiral type.\n * The parameter list includes extraneous values in order to directly match IntegratedSpiral3d.create, which has\n * greater flexibility about mixtures of values.\n * * IMPORTANT RESTRICTIONS:\n * * Direct spirals must have the inflection at the origin of their coordinate system, aligned with the x axis.\n * * hence bearing0 = 0.\n * * hence radius0 = 0.\n * * bearing1 is ignored.\n * * radius1 must be given.\n * * arcLength must be given,\n * @param spiralType one of the types in `DirectSpiralTypeName`\n * @param radius0 radius (or 0 for tangent to line) at start. Must be ZERO or UNDEFINED\n * @param radius1 radius (or 0 for tangent to line) at end.\n * @param bearing0 bearing, measured CCW from x axis at start. Must be ZERO or UNDEFINED\n * @param bearing1 bearing, measured CCW from x axis at end. IGNORED.\n * @param fractionInterval (optional) fractional interval for an \"active\" portion of the curve. If omitted, the\n * full [0,1] is used.\n * @param localToWorld placement transform.\n */\n public static createFromLengthAndRadius(\n spiralType: string,\n radius0: number | undefined,\n radius1: number | undefined,\n bearing0: Angle | undefined,\n _bearing1: Angle | undefined,\n arcLength: number | undefined,\n activeInterval: undefined | Segment1d,\n localToWorld: Transform,\n ): TransitionSpiral3d | undefined {\n if (bearing0 !== undefined && !bearing0.isAlmostZero)\n return undefined;\n if (radius0 !== undefined && !Geometry.isSmallMetricDistance(radius0))\n return undefined;\n if (radius1 === undefined || Geometry.isSmallMetricDistance(radius1))\n return undefined;\n if (arcLength === undefined)\n return undefined;\n if (Geometry.equalStringNoCase(spiralType, \"Arema\"))\n return this.createArema(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"ChineseCubic\"))\n return this.createChineseCubic(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"JapaneseCubic\"))\n return this.createJapaneseCubic(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"HalfCosine\"))\n return this.createDirectHalfCosine(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"Czech\"))\n return this.createCzechCubic(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"Italian\"))\n return this.createItalian(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"AustralianRailCorp\"))\n return this.createAustralianRail(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"MXCubicAlongArc\"))\n return this.createMXCubicAlongArc(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"WesternAustralian\"))\n return this.createWesternAustralian(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"PolishCubic\"))\n return this.createPolishCubic(localToWorld, arcLength, radius1, activeInterval);\n return undefined;\n }\n /** Deep clone of this spiral. */\n public override clone(): DirectSpiral3d {\n return new DirectSpiral3d(\n this.localToWorld.clone(),\n this._spiralType,\n this.designProperties?.clone(),\n this._nominalL1,\n this._nominalR1,\n this._activeFractionInterval?.clone(),\n this._evaluator.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._nominalL1 *= rigidData.scale;\n this._nominalR1 *= rigidData.scale;\n this.evaluator.scaleInPlace(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 quick length of the spiral.\n * The tangent vector of a true clothoid is length 1 everywhere, so simple proportion of nominalL1 is a good approximation.\n */\n public quickLength() {\n const distanceData = this._globalStrokes.packedUVParams!;\n const n = distanceData.length;\n return distanceData.getYAtUncheckedPointIndex(n - 1);\n }\n // We claim true length is stored at the back of `packedUVParams`.\n // Nevertheless defer to the generic integrator in the default implementation.\n // public override curveLength() {\n // return this.quickLength();\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 * * Line strings 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 const activeStrokes = this.activeStrokes;\n dest.startParentCurvePrimitive(this);\n // hack: specify the extended range so we can compute length of an extended spiral\n let globalFraction0 = 0.0;\n let globalFraction1 = 1.0;\n if (dest instanceof CurveLengthContext) {\n if (dest.getFraction0 < 0.0)\n globalFraction0 = dest.getFraction0;\n if (dest.getFraction1 > 1.0)\n globalFraction1 = dest.getFraction1;\n }\n if (n <= activeStrokes.numPoints())\n dest.announceIntervalForUniformStepStrokes(this, 2 * activeStrokes.numPoints(), globalFraction0, globalFraction1);\n else\n dest.announceIntervalForUniformStepStrokes(this, n, globalFraction0, globalFraction1);\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 const nominalRadians = this._nominalL1 / (2.0 * this._nominalR1);\n if (options) {\n const rMin = Math.abs(this._nominalR1);\n numStroke = options.applyTolerancesToArc(rMin, nominalRadians);\n numStroke = options.applyMaxEdgeLength(numStroke, this.quickLength());\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\n } else {\n numStroke = StrokeOptions.applyAngleTol(undefined, 4, nominalRadians, 0.02);\n }\n numStroke = Math.ceil(this._activeFractionInterval.absoluteDelta() * numStroke);\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 globalFraction = this._activeFractionInterval.fractionToPoint(activeFraction);\n result = this._evaluator.fractionToPoint(globalFraction, result);\n this.localToWorld.multiplyPoint3d(result, result);\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 = this._evaluator.fractionToPointAndDerivative(globalFraction, result);\n result.direction.scaleInPlace(this._activeFractionInterval.signedDelta());\n result.transformInPlace(this.localToWorld);\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 result = this._evaluator.fractionToPointAnd2Derivatives(globalFraction, result);\n const a = this._activeFractionInterval.signedDelta();\n result.vectorU.scaleInPlace(a);\n result.vectorV.scaleInPlace(a * a);\n result.transformInPlace(this.localToWorld);\n return 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: any): boolean {\n if (other instanceof DirectSpiral3d) {\n return Geometry.isSameCoordinate(this._nominalL1, other._nominalL1)\n && Geometry.isSameCoordinate(this._nominalR1, other._nominalR1)\n && this.localToWorld.isAlmostEqual(other.localToWorld)\n && this._activeFractionInterval.isAlmostEqual(other._activeFractionInterval)\n && this._evaluator.isAlmostEqual(other._evaluator);\n }\n return false;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"DirectSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/DirectSpiral3d.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,6CAA0C;AAO1C,0DAAuD;AAEvD,+EAA4E;AAC5E,kDAA+C;AAC/C,oDAAiD;AACjD,mFAAgF;AAChF,qDAA6D;AAC7D,iEAAsF;AACtF,uFAAoF;AACpF,qFAA4E;AAC5E,6EAAoE;AAEpE,6DAA0D;AAG1D;;;;;;;;;;;;;;;;EAgBE;AACF,2CAA2C;AAC3C,MAAa,cAAe,SAAQ,uCAAkB;IACpD,yCAAyC;IACzB,kBAAkB,GAAG,kBAAkB,CAAC;IACxD,wFAAwF;IAChF,cAAc,CAAe;IACrC;;;;;OAKG;IACK,cAAc,CAAgB;IACtC,yEAAyE;IACzE,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC;IACvF,CAAC;IACO,UAAU,CAAS;IACnB,UAAU,CAAS;IACnB,UAAU,CAAmB;IACrC,qCAAqC;IACrC,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IACD,+DAA+D;IAC/D,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IACD,uCAAuC;IACvC,IAAW,iBAAiB;QAC1B,OAAO,uCAAkB,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC/D,CAAC;IACD;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO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B,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC;mBAC5D,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC;mBACnD,IAAI,CAAC,uBAAuB,CAAC,aAAa,CAAC,KAAK,CAAC,uBAAuB,CAAC;mBACzE,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAlkBD,wCAkkBC","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 */\nimport { Geometry } from \"../../Geometry\";\nimport { Angle } from \"../../geometry3d/Angle\";\nimport { GeometryHandler, IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\nimport { Plane3dByOriginAndUnitNormal } from \"../../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\nimport { Transform } from \"../../geometry3d/Transform\";\nimport { CurveLengthContext } from \"../internalContexts/CurveLengthContext\";\nimport { LineString3d } from \"../LineString3d\";\nimport { StrokeOptions } from \"../StrokeOptions\";\nimport { AustralianRailCorpXYEvaluator } from \"./AustralianRailCorpXYEvaluator\";\nimport { ClothoidSeriesRLEvaluator } from \"./ClothoidSeries\";\nimport { CzechSpiralEvaluator, ItalianSpiralEvaluator } from \"./CzechSpiralEvaluator\";\nimport { DirectHalfCosineSpiralEvaluator } from \"./DirectHalfCosineSpiralEvaluator\";\nimport { MXCubicAlongArcEvaluator } from \"./MXCubicAlongArcSpiralEvaluator\";\nimport { PolishCubicEvaluator } from \"./PolishCubicSpiralEvaluator\";\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\nimport { XYCurveEvaluator } from \"./XYCurveEvaluator\";\n\n/**\n* DirectSpiral3d acts like a TransitionSpiral3d for serialization purposes, but implements spiral types that have\n* \"direct\" xy calculations without the integrations required for IntegratedSpiral3d.\n* * Each DirectSpiral3d carries an XYCurveEvaluator to give it specialized behavior.\n* * Direct spirals are created with these static methods:\n* * createArema\n* * createJapaneseCubic\n* * createChineseCubic\n* * createWesternAustralian\n* * createDirectHalfCosine\n* * createAustralianRail\n* * createCzechCubic\n* * createPolishCubic\n* * createMXCubicAlongArc\n* * createItalian\n* @public\n*/\n// see internaldocs/Spiral.md for more info\nexport class DirectSpiral3d extends TransitionSpiral3d {\n /** String name for schema properties. */\n public readonly curvePrimitiveType = \"transitionSpiral\";\n /** Stroked approximation of entire spiral. This is AFTER the localToWorld transform. */\n private _globalStrokes: LineString3d;\n /**\n * Stroked approximation of active spiral. This is AFTER the localToWorld transform.\n * * Same count as global; possibly overly fine, but it gives some consistency between same clothoid constructed as\n * 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 private _nominalL1: number;\n private _nominalR1: number;\n private _evaluator: XYCurveEvaluator;\n /** Return the nominal end radius. */\n public get nominalR1(): number {\n return this._nominalR1;\n }\n /** Return the nominal distance from inflection to endpoint. */\n public get nominalL1(): number {\n return this._nominalL1;\n }\n /** Return the nominal end curvature */\n public get nominalCurvature1(): number {\n return TransitionSpiral3d.radiusToCurvature(this._nominalR1);\n }\n /**\n * Return the low level evaluator.\n * @internal\n */\n public get evaluator(): XYCurveEvaluator {\n return this._evaluator;\n }\n // constructor demands radius1 and distance1 for nominal construction.\n // caller is responsible for managing intervals of partial spiral.\n public constructor(\n localToWorld: Transform,\n spiralType: string | undefined,\n originalProperties: TransitionConditionalProperties | undefined,\n nominalL1: number,\n nominalR1: number,\n activeFractionInterval: Segment1d | undefined,\n evaluator: XYCurveEvaluator,\n ) {\n super(spiralType, localToWorld, activeFractionInterval, originalProperties);\n this._nominalL1 = nominalL1;\n this._nominalR1 = nominalR1;\n this._evaluator = evaluator;\n this._globalStrokes = LineString3d.create();\n this._activeStrokes = LineString3d.create();\n // initialize for compiler; but this will be recomputed in refreshComputeProperties\n this.refreshComputedProperties();\n }\n /**\n * Compute stroke data in an interval.\n * @param strokes strokes to clear and refill.\n * @param fractionA start fraction.\n * @param fractionB end fraction.\n * @param numInterval number of intervals.\n * @param applyLocalToWorld if true, apply the localToWorld transform.\n */\n private computeStrokes(\n strokes: LineString3d, fractionA: number, fractionB: number, numInterval: number, applyLocalToWorld: boolean = true,\n ): void {\n if (numInterval < 1)\n numInterval = 1;\n strokes.clear();\n strokes.ensureEmptyUVParams();\n strokes.ensureEmptyFractions();\n const distances = strokes.packedUVParams!;\n const nominalIntervalLength = Math.abs(fractionB - fractionA) * this._nominalL1;\n for (let i = 0; i <= numInterval; i++) {\n const fraction = Geometry.interpolate(fractionA, i / numInterval, fractionB);\n const nominalDistanceAlong = fraction * nominalIntervalLength;\n strokes.packedPoints.pushXYZ(this._evaluator.fractionToX(fraction), this._evaluator.fractionToY(fraction), 0);\n distances.pushXY(fraction, nominalDistanceAlong); // the second distance will be updated below\n }\n if (applyLocalToWorld)\n strokes.tryTransformInPlace(this._localToWorld);\n let fraction0 = distances.getXAtUncheckedPointIndex(0);\n let trueDistance0 = distances.getYAtUncheckedPointIndex(0); // whatever was assigned as start distance is fine\n let trueDistance1, fraction1;\n for (let i = 1; i <= numInterval; i++) {\n fraction1 = distances.getXAtUncheckedPointIndex(i);\n trueDistance1 = trueDistance0 + this._evaluator.integrateDistanceBetweenFractions(fraction0, fraction1);\n distances.setXYAtCheckedPointIndex(i, fraction1, trueDistance1);\n fraction0 = fraction1;\n trueDistance0 = trueDistance1;\n }\n }\n /** Recompute strokes. */\n public override refreshComputedProperties() {\n const sweepRadians = this.nominalL1 / (2.0 * this.nominalR1);\n const radiansStep = 0.02;\n const numInterval = StrokeOptions.applyAngleTol(undefined, 4, sweepRadians, radiansStep);\n this.computeStrokes(this._globalStrokes, 0, 1, numInterval);\n const numActiveInterval = Math.ceil(this._activeFractionInterval.absoluteDelta() * numInterval);\n this._activeStrokes = LineString3d.create();\n this.computeStrokes(\n this._activeStrokes, this._activeFractionInterval.x0, this._activeFractionInterval.x1, numActiveInterval,\n );\n }\n /**\n * Create a spiral object which uses numXTerm terms from the clothoid X series and numYTerm from the clothoid Y series.\n * @param spiralType type of spiral.\n * @param localToWorld placement frame. Inflection point is at origin, initial direction is along x axis.\n * @param numXTerm number of terms to use from X series\n * @param numYTerm number of terms to use from Y series\n * @param originalProperties (optional) transition conditional properties.\n * @param nominalL1 design distance from inflection to end point.\n * @param nominalR1 design radius at end point.\n * @param activeInterval (optional) active interval (as fractions of nominalL1)\n */\n public static createTruncatedClothoid(\n spiralType: string,\n localToWorld: Transform,\n numXTerm: number,\n numYTerm: number,\n originalProperties: TransitionConditionalProperties | undefined,\n nominalL1: number,\n nominalR1: number,\n activeInterval: Segment1d | undefined,\n ): DirectSpiral3d | undefined {\n if (numXTerm < 1)\n numXTerm = 1;\n if (numYTerm < 1)\n numYTerm = 1;\n const evaluator = new ClothoidSeriesRLEvaluator(nominalL1, 1.0 / (2.0 * nominalL1 * nominalR1), numXTerm, numYTerm);\n return new DirectSpiral3d(\n localToWorld.clone(),\n spiralType,\n originalProperties,\n nominalL1,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n evaluator,\n );\n }\n /**\n * Create a czech cubic.\n * This is y = m*x^3 with\n * * x any point on the x axis.\n * * `fraction` along the spiral goes to `x = fraction * L`.\n * * m is gamma/(6RL).\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt(4RR-LL)` pushes y up a little bit to simulate the lost series terms.\n * @param localToWorld\n * @param nominalLx nominal length along x axis.\n * @param nominalR1\n * @param activeInterval\n */\n public static createCzechCubic(\n localToWorld: Transform, nominalLx: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n const evaluator = CzechSpiralEvaluator.create(nominalLx, nominalR1);\n if (evaluator === undefined)\n return undefined;\n return new DirectSpiral3d(\n localToWorld.clone(),\n \"Czech\",\n undefined,\n nominalLx,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n evaluator,\n );\n }\n /**\n * Create an italian spiral\n * This is y = m*x^3 with\n * * x any point on the x axis.\n * * `fraction` along the spiral goes to `x = fraction * L`.\n * * m is gamma/(6RL).\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt(4RR-LL)` pushes y up a little bit to simulate the lost series terms.\n * @param localToWorld\n * @param nominalL1 nominal length along the spiral.\n * @param nominalR1\n * @param activeInterval\n */\n public static createItalian(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n const evaluator = ItalianSpiralEvaluator.create(nominalL1, nominalR1);\n if (evaluator === undefined)\n return undefined;\n return new DirectSpiral3d(\n localToWorld.clone(),\n \"Italian\",\n undefined,\n nominalL1,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n evaluator,\n );\n }\n /**\n * Create an MX Cubic whose nominal length is close to along the curve.\n * This is y = m*x^3 with\n * * m is 1/(6RL).\n * * 1/(6RL) is the leading term of the sine series.\n * * L1 is an along-the-x-axis distance that is slightly LESS THAN the nominal length.\n * * x is axis position that is slightly LESS than nominal distance along.\n * * L1, x use the approximation `x = s * ( 1 - s^4/ (40 RR LL))\n * @param localToWorld\n * @param nominalL1\n * @param nominalR1\n * @param activeInterval\n */\n public static createMXCubicAlongArc(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n const evaluator = MXCubicAlongArcEvaluator.create(nominalL1, nominalR1);\n if (evaluator === undefined)\n return undefined;\n return new DirectSpiral3d(\n localToWorld.clone(),\n \"MXCubicAlongArc\",\n undefined,\n nominalL1,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n evaluator,\n );\n }\n /**\n * Create a polish cubic\n * This is y = m*x^3 with\n * * m is 1/(6RL).\n * * 1/(6RL) is the leading term of the sine series.\n * * L is nominal length.\n * * R is nominal end radius.\n * * x ranges up to the x axis distance for which the polish distance series produces f(x) = L.\n * * The support class PolishCubicEvaluator has static methods for the distance series and its inversion.\n */\n public static createPolishCubic(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n const evaluator = PolishCubicEvaluator.create(nominalL1, nominalR1);\n if (evaluator === undefined)\n return undefined;\n return new DirectSpiral3d(\n localToWorld.clone(),\n \"PolishCubic\",\n undefined,\n nominalL1,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n evaluator,\n );\n }\n /**\n * Create an AustralianRailCorp spiral\n * This is y = m*x^3 with\n * * x any point on the x axis.\n * * `fraction` along the spiral goes to `x = fraction * L`.\n * * m is gamma/(6RL).\n * * 1/(6RL) is the leading term of the sine series.\n * * `gamma = 2R/sqrt(4RR-LL)` pushes y up a little bit to simulate the lost series terms.\n * @param localToWorld\n * @param nominalL1\n * @param nominalR1\n * @param activeInterval\n */\n public static createAustralianRail(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n const evaluator = AustralianRailCorpXYEvaluator.create(nominalL1, nominalR1);\n if (evaluator === undefined)\n return undefined;\n return new DirectSpiral3d(\n localToWorld.clone(),\n \"AustralianRailCorp\",\n undefined,\n nominalL1,\n nominalR1,\n activeInterval ? activeInterval.clone() : Segment1d.create(0, 1),\n evaluator,\n );\n }\n public static createDirectHalfCosine(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n return new DirectSpiral3d(\n localToWorld,\n \"HalfCosine\",\n undefined,\n nominalL1,\n nominalR1,\n activeInterval,\n new DirectHalfCosineSpiralEvaluator(nominalL1, nominalR1),\n );\n }\n /**\n * Create an Arema spiral clothoid approximation\n * * X is 2 terms of the clothoid series as a function of nominal distance along.\n * * Y is 2 terms f the clothoid series as a function of nominal distance along.\n * * Remark: This is identical to the ChineseCubic.\n * @param localToWorld axes with inflection at origin, tangent along x axis.\n * @param nominalL1 nominal length as used in series LR terms.\n * @param nominalR1 nominal final radius as used in series LR terms.\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along.\n */\n public static createArema(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n return this.createTruncatedClothoid(\"Arema\", localToWorld, 2, 2, undefined, nominalL1, nominalR1, activeInterval);\n }\n /**\n * Create a Japanese spiral clothoid approximation.\n * * X is 1 terms of the clothoid series as a function of nominal distance along.\n * * Y is 1 terms of the clothoid series as a function of nominal distance along.\n * * Remark: This is identical to the ChineseCubic.\n * @param localToWorld axes with inflection at origin, tangent along x axis.\n * @param nominalL1 nominal length as used in series LR terms.\n * @param nominalR1 nominal final radius as used in series LR terms.\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along\n */\n public static createJapaneseCubic(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n return this.createTruncatedClothoid(\n \"JapaneseCubic\", localToWorld, 1, 1, undefined, nominalL1, nominalR1, activeInterval,\n );\n }\n /**\n * Create a Chinese clothoid approximation\n * * X is 2 terms of the clothoid series as a function of nominal distance along.\n * * Y is 2 terms f the clothoid series as a function of nominal distance along.\n * * Remark: This is identical to the Arema spiral.\n * @param localToWorld axes with inflection at origin, tangent along x axis.\n * @param nominalL1 nominal length as used in series LR terms.\n * @param nominalR1 nominal final radius as used in series LR terms.\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along.\n */\n public static createChineseCubic(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n return this.createTruncatedClothoid(\"ChineseCubic\", localToWorld, 2, 2, undefined, nominalL1, nominalR1, activeInterval);\n }\n /**\n * Create a Western Australian direct spiral.\n * * X is 2 terms of the clothoid series as a function of distance along.\n * * Y is 1 term (cubic in nominal distance along).\n * @param localToWorld axes with inflection at origin, tangent along x axis.\n * @param nominalL1 nominal length as used in series LR terms.\n * @param nominalR1 nominal final radius as used in series LR terms.\n * @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along.\n */\n public static createWesternAustralian(\n localToWorld: Transform, nominalL1: number, nominalR1: number, activeInterval?: Segment1d,\n ): DirectSpiral3d | undefined {\n return this.createTruncatedClothoid(\"WesternAustralian\", localToWorld, 2, 1, undefined, nominalL1, nominalR1, activeInterval);\n }\n /**\n * Create (if possible) a DirectSpiral3d, applying various strict conditions appropriate to the spiral type.\n * The parameter list includes extraneous values in order to directly match IntegratedSpiral3d.create, which has\n * greater flexibility about mixtures of values.\n * * IMPORTANT RESTRICTIONS:\n * * Direct spirals must have the inflection at the origin of their coordinate system, aligned with the x axis.\n * * hence bearing0 = 0.\n * * hence radius0 = 0.\n * * bearing1 is ignored.\n * * radius1 must be given.\n * * arcLength must be given,\n * @param spiralType one of the types in `DirectSpiralTypeName`\n * @param radius0 radius (or 0 for tangent to line) at start. Must be ZERO or UNDEFINED\n * @param radius1 radius (or 0 for tangent to line) at end.\n * @param bearing0 bearing, measured CCW from x axis at start. Must be ZERO or UNDEFINED\n * @param bearing1 bearing, measured CCW from x axis at end. IGNORED.\n * @param fractionInterval (optional) fractional interval for an \"active\" portion of the curve. If omitted, the\n * full [0,1] is used.\n * @param localToWorld placement transform.\n */\n public static createFromLengthAndRadius(\n spiralType: string,\n radius0: number | undefined,\n radius1: number | undefined,\n bearing0: Angle | undefined,\n _bearing1: Angle | undefined,\n arcLength: number | undefined,\n activeInterval: undefined | Segment1d,\n localToWorld: Transform,\n ): TransitionSpiral3d | undefined {\n if (bearing0 !== undefined && !bearing0.isAlmostZero)\n return undefined;\n if (radius0 !== undefined && !Geometry.isSmallMetricDistance(radius0))\n return undefined;\n if (radius1 === undefined || Geometry.isSmallMetricDistance(radius1))\n return undefined;\n if (arcLength === undefined)\n return undefined;\n if (Geometry.equalStringNoCase(spiralType, \"Arema\"))\n return this.createArema(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"ChineseCubic\"))\n return this.createChineseCubic(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"JapaneseCubic\"))\n return this.createJapaneseCubic(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"HalfCosine\"))\n return this.createDirectHalfCosine(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"Czech\"))\n return this.createCzechCubic(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"Italian\"))\n return this.createItalian(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"AustralianRailCorp\"))\n return this.createAustralianRail(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"MXCubicAlongArc\"))\n return this.createMXCubicAlongArc(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"WesternAustralian\"))\n return this.createWesternAustralian(localToWorld, arcLength, radius1, activeInterval);\n if (Geometry.equalStringNoCase(spiralType, \"PolishCubic\"))\n return this.createPolishCubic(localToWorld, arcLength, radius1, activeInterval);\n return undefined;\n }\n /** Deep clone of this spiral. */\n public override clone(): DirectSpiral3d {\n return new DirectSpiral3d(\n this.localToWorld.clone(),\n this._spiralType,\n this.designProperties?.clone(),\n this._nominalL1,\n this._nominalR1,\n this._activeFractionInterval?.clone(),\n this._evaluator.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._nominalL1 *= rigidData.scale;\n this._nominalR1 *= rigidData.scale;\n this.evaluator.scaleInPlace(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 quick length of the spiral.\n * The tangent vector of a true clothoid is length 1 everywhere, so simple proportion of nominalL1 is a good approximation.\n */\n public quickLength() {\n const distanceData = this._globalStrokes.packedUVParams!;\n const n = distanceData.length;\n return distanceData.getYAtUncheckedPointIndex(n - 1);\n }\n // We claim true length is stored at the back of `packedUVParams`.\n // Nevertheless defer to the generic integrator in the default implementation.\n // public override curveLength() {\n // return this.quickLength();\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 * * Line strings 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 const activeStrokes = this.activeStrokes;\n dest.startParentCurvePrimitive(this);\n // hack: specify the extended range so we can compute length of an extended spiral\n let globalFraction0 = 0.0;\n let globalFraction1 = 1.0;\n if (dest instanceof CurveLengthContext) {\n if (dest.getFraction0 < 0.0)\n globalFraction0 = dest.getFraction0;\n if (dest.getFraction1 > 1.0)\n globalFraction1 = dest.getFraction1;\n }\n if (n <= activeStrokes.numPoints())\n dest.announceIntervalForUniformStepStrokes(this, 2 * activeStrokes.numPoints(), globalFraction0, globalFraction1);\n else\n dest.announceIntervalForUniformStepStrokes(this, n, globalFraction0, globalFraction1);\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 const nominalRadians = this._nominalL1 / (2.0 * this._nominalR1);\n if (options) {\n const rMin = Math.abs(this._nominalR1);\n numStroke = options.applyTolerancesToArc(rMin, nominalRadians);\n numStroke = options.applyMaxEdgeLength(numStroke, this.quickLength());\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\n } else {\n numStroke = StrokeOptions.applyAngleTol(undefined, 4, nominalRadians, 0.02);\n }\n numStroke = Math.ceil(this._activeFractionInterval.absoluteDelta() * numStroke);\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 globalFraction = this._activeFractionInterval.fractionToPoint(activeFraction);\n result = this._evaluator.fractionToPoint(globalFraction, result);\n this.localToWorld.multiplyPoint3d(result, result);\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 = this._evaluator.fractionToPointAndDerivative(globalFraction, result);\n result.direction.scaleInPlace(this._activeFractionInterval.signedDelta());\n result.transformInPlace(this.localToWorld);\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 result = this._evaluator.fractionToPointAnd2Derivatives(globalFraction, result);\n const a = this._activeFractionInterval.signedDelta();\n result.vectorU.scaleInPlace(a);\n result.vectorV.scaleInPlace(a * a);\n result.transformInPlace(this.localToWorld);\n return 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: any): boolean {\n if (other instanceof DirectSpiral3d) {\n return Geometry.isSameCoordinate(this._nominalL1, other._nominalL1)\n && Geometry.isSameCoordinate(this._nominalR1, other._nominalR1)\n && this.localToWorld.isAlmostEqual(other.localToWorld)\n && this._activeFractionInterval.isAlmostEqual(other._activeFractionInterval)\n && this._evaluator.isAlmostEqual(other._evaluator);\n }\n return false;\n }\n}\n"]}
|