@itwin/ecschema-rpcinterface-tests 5.3.0-dev.17 → 5.3.0-dev.18
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/lib/backend/BackendInit.js.map +1 -1
- package/lib/common/Settings.js +4 -4
- package/lib/common/Settings.js.map +1 -1
- package/lib/common/SideChannels.js.map +1 -1
- package/lib/dist/bundled-tests.js +590 -445
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_cross-fetch_4_0_0_node_modules_cross-fetch_dist_browser-24291b.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_4_3_4__loaders_gl_core_4_3_4_node_modu-4c1fc9.bundled-tests.js.map +1 -1
- package/lib/frontend/SchemaRpcInterface.test.js.map +1 -1
- package/lib/frontend/setup/IModelSession.js.map +1 -1
- package/lib/frontend/setup/TestContext.js.map +1 -1
- package/package.json +16 -16
|
@@ -95454,7 +95454,7 @@ class SubCategoriesCache {
|
|
|
95454
95454
|
this._request = cache.load(categoryIds);
|
|
95455
95455
|
if (undefined === this._request) {
|
|
95456
95456
|
// All requested categories are already loaded.
|
|
95457
|
-
func();
|
|
95457
|
+
func(false);
|
|
95458
95458
|
return;
|
|
95459
95459
|
}
|
|
95460
95460
|
else {
|
|
@@ -95474,7 +95474,7 @@ class SubCategoriesCache {
|
|
|
95474
95474
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== this._current);
|
|
95475
95475
|
if (completed)
|
|
95476
95476
|
for (const func of this._current.funcs)
|
|
95477
|
-
func();
|
|
95477
|
+
func(true);
|
|
95478
95478
|
this._request = undefined;
|
|
95479
95479
|
this._current = undefined;
|
|
95480
95480
|
// If we have more requests, process them.
|
|
@@ -95485,7 +95485,7 @@ class SubCategoriesCache {
|
|
|
95485
95485
|
if (undefined === this._request) {
|
|
95486
95486
|
// All categories loaded.
|
|
95487
95487
|
for (const func of next.funcs)
|
|
95488
|
-
func();
|
|
95488
|
+
func(true);
|
|
95489
95489
|
}
|
|
95490
95490
|
else {
|
|
95491
95491
|
// We need to load the requested categories before invoking the pending functions.
|
|
@@ -100920,10 +100920,11 @@ class Viewport {
|
|
|
100920
100920
|
this.updateSubCategories(categoryIds, enableAllSubCategories);
|
|
100921
100921
|
}
|
|
100922
100922
|
updateSubCategories(categoryIds, enableAllSubCategories) {
|
|
100923
|
-
this.subcategories.push(this.iModel.subcategories, categoryIds, () => {
|
|
100924
|
-
if (enableAllSubCategories)
|
|
100923
|
+
this.subcategories.push(this.iModel.subcategories, categoryIds, (anySubCategoriesLoaded) => {
|
|
100924
|
+
if (true === enableAllSubCategories)
|
|
100925
100925
|
this.enableAllSubCategories(categoryIds);
|
|
100926
|
-
|
|
100926
|
+
if (undefined !== enableAllSubCategories || anySubCategoriesLoaded)
|
|
100927
|
+
this._changeFlags.setViewedCategories();
|
|
100927
100928
|
});
|
|
100928
100929
|
}
|
|
100929
100930
|
enableAllSubCategories(categoryIds) {
|
|
@@ -101258,6 +101259,10 @@ class Viewport {
|
|
|
101258
101259
|
this.registerViewListeners();
|
|
101259
101260
|
this.view.attachToViewport(this);
|
|
101260
101261
|
this._mapTiledGraphicsProvider = new _tile_internal__WEBPACK_IMPORTED_MODULE_21__.MapTiledGraphicsProvider(this.viewportId, this.displayStyle);
|
|
101262
|
+
// ViewState.load loads all the subcategories for the categories in its category selector.
|
|
101263
|
+
// But the set of categories may have changed since loading the view.
|
|
101264
|
+
// Ensure we fill the cache for the current set of categories.
|
|
101265
|
+
this.updateSubCategories(this.view.categorySelector.categories, undefined);
|
|
101261
101266
|
}
|
|
101262
101267
|
registerViewListeners() {
|
|
101263
101268
|
const view = this.view;
|
|
@@ -101268,6 +101273,7 @@ class Viewport {
|
|
|
101268
101273
|
removals.push(view.details.onClipVectorChanged.addListener(() => this.invalidateRenderPlan()));
|
|
101269
101274
|
removals.push(view.onViewedCategoriesChanged.addListener(() => {
|
|
101270
101275
|
this._changeFlags.setViewedCategories();
|
|
101276
|
+
this.updateSubCategories(view.categorySelector.categories, undefined);
|
|
101271
101277
|
this.maybeInvalidateScene();
|
|
101272
101278
|
}));
|
|
101273
101279
|
removals.push(view.onDisplayStyleChanged.addListener((newStyle) => {
|
|
@@ -146050,6 +146056,9 @@ class RootTile extends DynamicIModelTile {
|
|
|
146050
146056
|
get hiddenElements() {
|
|
146051
146057
|
return this._hiddenElements.toId64Array();
|
|
146052
146058
|
}
|
|
146059
|
+
get dynamicElements() {
|
|
146060
|
+
return this._elements.array.map((tile) => tile.contentId);
|
|
146061
|
+
}
|
|
146053
146062
|
get appearanceProvider() {
|
|
146054
146063
|
return this;
|
|
146055
146064
|
}
|
|
@@ -147424,6 +147433,11 @@ class IModelTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_6__.TileTre
|
|
|
147424
147433
|
const state = this._rootTile.tileState;
|
|
147425
147434
|
return "dynamic" === state.type ? state.rootTile.hiddenElements : [];
|
|
147426
147435
|
}
|
|
147436
|
+
/** Strictly for tests. */
|
|
147437
|
+
get dynamicElements() {
|
|
147438
|
+
const state = this._rootTile.tileState;
|
|
147439
|
+
return "dynamic" === state.type ? state.rootTile.dynamicElements : [];
|
|
147440
|
+
}
|
|
147427
147441
|
getTransformNodeRange(nodeId) {
|
|
147428
147442
|
return this._transformNodeRanges?.get(nodeId);
|
|
147429
147443
|
}
|
|
@@ -219767,9 +219781,15 @@ class AustralianRailCorpXYEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MO
|
|
|
219767
219781
|
this._nominalLength1 = nominalLength1;
|
|
219768
219782
|
this._nominalRadius1 = nominalRadius1;
|
|
219769
219783
|
}
|
|
219770
|
-
get nominalLength1() {
|
|
219771
|
-
|
|
219772
|
-
|
|
219784
|
+
get nominalLength1() {
|
|
219785
|
+
return this._nominalLength1;
|
|
219786
|
+
}
|
|
219787
|
+
get nominalRadius1() {
|
|
219788
|
+
return this._nominalRadius1;
|
|
219789
|
+
}
|
|
219790
|
+
clone() {
|
|
219791
|
+
return new AustralianRailCorpXYEvaluator(this._nominalLength1, this._nominalRadius1, this._axisLength, this._cubicM);
|
|
219792
|
+
}
|
|
219773
219793
|
static create(nominalLength1, nominalRadius1) {
|
|
219774
219794
|
const axisLength = AustralianRailCorpXYEvaluator.radiusAndNominalLengthToAxisLength(nominalRadius1, nominalLength1);
|
|
219775
219795
|
const phi = this.radiusAndAxisLengthToPhi(nominalRadius1, axisLength);
|
|
@@ -219777,11 +219797,7 @@ class AustralianRailCorpXYEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MO
|
|
|
219777
219797
|
const cubicM = Math.tan(phi) / (3.0 * xc2);
|
|
219778
219798
|
return new AustralianRailCorpXYEvaluator(nominalLength1, nominalRadius1, axisLength, cubicM);
|
|
219779
219799
|
}
|
|
219780
|
-
/**
|
|
219781
|
-
* Compute the phi constant for AustralianRail spiral with given end radius and length along axis.
|
|
219782
|
-
* @param nominalRadius1
|
|
219783
|
-
* @param axisLength
|
|
219784
|
-
*/
|
|
219800
|
+
/** Compute the phi constant for AustralianRail spiral with given end radius and length along axis. */
|
|
219785
219801
|
static radiusAndAxisLengthToPhi(nominalRadius1, axisLength) {
|
|
219786
219802
|
const xc = axisLength;
|
|
219787
219803
|
const expr1 = (2. / Math.sqrt(3.));
|
|
@@ -219794,26 +219810,23 @@ class AustralianRailCorpXYEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MO
|
|
|
219794
219810
|
return Math.asin(expr1 * Math.cos(Math.acos(expr2) / 3. + expr3));
|
|
219795
219811
|
}
|
|
219796
219812
|
scaleInPlace(scaleFactor) {
|
|
219797
|
-
// apply the scale factor to all contents
|
|
219798
|
-
// all distances scale directly . . .
|
|
219813
|
+
// apply the scale factor to all contents; all distances scale directly
|
|
219799
219814
|
this._nominalLength1 *= scaleFactor;
|
|
219800
219815
|
this._nominalRadius1 *= scaleFactor;
|
|
219801
219816
|
super.scaleInPlace(scaleFactor);
|
|
219802
219817
|
}
|
|
219803
|
-
/** Compute length along axis for AustralianRail spiral nominal radius and length.
|
|
219804
|
-
*
|
|
219805
|
-
*/
|
|
219818
|
+
/** Compute length along axis for AustralianRail spiral nominal radius and length. */
|
|
219806
219819
|
static radiusAndNominalLengthToAxisLength(nominalRadius1, nominalLength1, tolerance = 1.0e-5, requiredConvergenceCount = 2) {
|
|
219807
219820
|
const R = nominalRadius1;
|
|
219808
219821
|
let idx = 0;
|
|
219809
219822
|
let m, phi, xc2;
|
|
219810
219823
|
let xc = .7 * nominalLength1;
|
|
219811
219824
|
let convergenceCount = 0;
|
|
219812
|
-
// remark: This converges quickly
|
|
219825
|
+
// remark: This converges quickly
|
|
219813
219826
|
// for L=100, R=400
|
|
219814
219827
|
// ** full precision at 7th iteration.
|
|
219815
219828
|
// ** classic tolerance 1.0e-5 (7 digits from L) with requiredConvergenceCount = 1 gives 11 digits after 3 iterations
|
|
219816
|
-
// ** each iteration adds about 2 digits.
|
|
219829
|
+
// ** each iteration adds about 2 digits. This is quite good for a successive replacement without derivative
|
|
219817
219830
|
// ** Unanswerable question: If this is only done once and reused over all evaluations, do you want:
|
|
219818
219831
|
// * run the 7 iterations to get full precision
|
|
219819
219832
|
// * stop with the classic tolerance to get compatibility?
|
|
@@ -219822,8 +219835,7 @@ class AustralianRailCorpXYEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MO
|
|
|
219822
219835
|
xc2 = xc * xc;
|
|
219823
219836
|
m = Math.tan(phi) / (3.0 * xc2);
|
|
219824
219837
|
const m2x4 = m * m * xc2 * xc2;
|
|
219825
|
-
const correction = xc * m2x4 * ((9. / 10) + m2x4 * (-(9. / 8.) + m2x4 * (+(729. / 208.) + m2x4 *
|
|
219826
|
-
-(32805. / 2176.))));
|
|
219838
|
+
const correction = xc * m2x4 * ((9. / 10) + m2x4 * (-(9. / 8.) + m2x4 * (+(729. / 208.) + m2x4 * -(32805. / 2176.))));
|
|
219827
219839
|
const correctedLength = xc + correction;
|
|
219828
219840
|
xc = (nominalLength1 / correctedLength) * xc;
|
|
219829
219841
|
if (Math.abs(nominalLength1 - correctedLength) < tolerance) {
|
|
@@ -219848,12 +219860,15 @@ class AustralianRailCorpXYEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MO
|
|
|
219848
219860
|
}
|
|
219849
219861
|
/**
|
|
219850
219862
|
* Return a (quite good approximation) of fraction along x axis for given distance along spiral.
|
|
219851
|
-
* * The AustralianRailSpiral has a supporting power series to approximately map distance along the spiral to
|
|
219852
|
-
*
|
|
219863
|
+
* * The AustralianRailSpiral has a supporting power series to approximately map distance along the spiral to
|
|
219864
|
+
* an x coordinate.
|
|
219865
|
+
* * The `xToFraction(x)` method quickly (with a single divide) converts this x to fraction used for
|
|
219866
|
+
* this.fractionToX (fraction), this.fractionToY(fraction) etc to get coordinates and derivatives.
|
|
219853
219867
|
* * The x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.
|
|
219854
|
-
* * It is supported here for users interested in replicating the AustralianRail distance mapping rather than the
|
|
219855
|
-
*
|
|
219856
|
-
*
|
|
219868
|
+
* * It is supported here for users interested in replicating the AustralianRail distance mapping rather than the
|
|
219869
|
+
* more accurate CurvePrimitive measurements.
|
|
219870
|
+
* * Round tripping distance through (a) distanceAlongSpiralToAustralianApproximateX, (b) xToFraction, and
|
|
219871
|
+
* (c) curveLengthBetweenFractions has 10 digit accuracy for L/R = 4, 12 digit accuracy for L/R = 10.
|
|
219857
219872
|
* @param s distance along the axis.
|
|
219858
219873
|
*/
|
|
219859
219874
|
distanceAlongSpiralToAustralianApproximateX(s) {
|
|
@@ -219897,10 +219912,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
219897
219912
|
|
|
219898
219913
|
/**
|
|
219899
219914
|
* Methods to evaluate caller-specified number of terms of the x and y series for a clothoid.
|
|
219900
|
-
* Each instance has
|
|
219901
|
-
* *
|
|
219902
|
-
* * constant for theta=c
|
|
219903
|
-
* * This value is c=1/(2
|
|
219915
|
+
* Each instance has:
|
|
219916
|
+
* * number of x and y terms to use.
|
|
219917
|
+
* * constant for theta = c*x*x.
|
|
219918
|
+
* * This value is c = 1/(2*R*L) for curve length L measured from inflection to point with radius R.
|
|
219904
219919
|
* @internal
|
|
219905
219920
|
*/
|
|
219906
219921
|
class ClothoidSeriesRLEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODULE_0__.XYCurveEvaluator {
|
|
@@ -219923,7 +219938,7 @@ class ClothoidSeriesRLEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODU
|
|
|
219923
219938
|
this.nominalLength1 *= scaleFactor;
|
|
219924
219939
|
this.constantDiv2LR /= (scaleFactor * scaleFactor);
|
|
219925
219940
|
}
|
|
219926
|
-
/** Member by member matchup
|
|
219941
|
+
/** Member by member matchup. */
|
|
219927
219942
|
isAlmostEqual(other) {
|
|
219928
219943
|
if (other instanceof ClothoidSeriesRLEvaluator) {
|
|
219929
219944
|
return this.numXTerms === other.numXTerms
|
|
@@ -219937,43 +219952,55 @@ class ClothoidSeriesRLEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODU
|
|
|
219937
219952
|
* Evaluate the X series at a nominal distance along the curve.
|
|
219938
219953
|
* @param fraction fractional position along the curve.
|
|
219939
219954
|
*/
|
|
219940
|
-
fractionToX(fraction) {
|
|
219955
|
+
fractionToX(fraction) {
|
|
219956
|
+
return this.fractionToXGo(fraction, this.numXTerms);
|
|
219957
|
+
}
|
|
219941
219958
|
/**
|
|
219942
219959
|
* Evaluate the Y series at a nominal distance along the curve.
|
|
219943
219960
|
* @param fraction fractional position along the curve.
|
|
219944
219961
|
*/
|
|
219945
|
-
fractionToY(fraction) {
|
|
219962
|
+
fractionToY(fraction) {
|
|
219963
|
+
return this.fractionToYGo(fraction, this.numYTerms);
|
|
219964
|
+
}
|
|
219946
219965
|
/**
|
|
219947
219966
|
* Evaluate the derivative of the X series at a nominal distance along the curve.
|
|
219948
219967
|
* @param fraction fractional position along the curve.
|
|
219949
219968
|
*/
|
|
219950
|
-
fractionToDX(fraction) {
|
|
219969
|
+
fractionToDX(fraction) {
|
|
219970
|
+
return this.fractionToDXGo(fraction, this.numXTerms);
|
|
219971
|
+
}
|
|
219951
219972
|
/**
|
|
219952
219973
|
* Evaluate the derivative of the Y series at a nominal distance along the curve.
|
|
219953
219974
|
* @param fraction fractional position along the curve.
|
|
219954
219975
|
*/
|
|
219955
|
-
fractionToDY(fraction) {
|
|
219976
|
+
fractionToDY(fraction) {
|
|
219977
|
+
return this.fractionToDYGo(fraction, this.numYTerms);
|
|
219978
|
+
}
|
|
219956
219979
|
/**
|
|
219957
219980
|
* Evaluate the derivative of the X series at a nominal distance along the curve.
|
|
219958
219981
|
* @param fraction fractional position along the curve.
|
|
219959
219982
|
*/
|
|
219960
|
-
fractionToDDX(fraction) {
|
|
219983
|
+
fractionToDDX(fraction) {
|
|
219984
|
+
return this.fractionToDDXGo(fraction, this.numXTerms);
|
|
219985
|
+
}
|
|
219961
219986
|
/**
|
|
219962
219987
|
* Evaluate the derivative of the Y series at a nominal distance along the curve.
|
|
219963
219988
|
* @param fraction fractional position along the curve.
|
|
219964
219989
|
*/
|
|
219965
|
-
fractionToDDY(fraction) {
|
|
219990
|
+
fractionToDDY(fraction) {
|
|
219991
|
+
return this.fractionToDDYGo(fraction, this.numYTerms);
|
|
219992
|
+
}
|
|
219966
219993
|
/**
|
|
219967
219994
|
* Evaluate the X series at a nominal distance along the curve.
|
|
219968
219995
|
* @param fraction fractional position along the curve.
|
|
219969
219996
|
* @param numTerms number of terms to use.
|
|
219970
219997
|
*/
|
|
219971
219998
|
fractionToXGo(fraction, numTerms) {
|
|
219972
|
-
//
|
|
219999
|
+
// write the series for cos(theta)
|
|
219973
220000
|
// replace theta by s*s*c
|
|
219974
220001
|
// integrate wrt s
|
|
219975
220002
|
// x = s - s^5 c^4/ 2 + s^9 c^8/(4!) - s^13 c^12 / 6!
|
|
219976
|
-
// x = s(1 - (s^4 c^2/2) ( 1/5 -s^4 c^2 / (3*4)
|
|
220003
|
+
// x = s(1 - (s^4 c^2/2) ( 1/5 -s^4 c^2 / (3*4) (1/9 - ...) ) )
|
|
219977
220004
|
const s = fraction * this.nominalLength1;
|
|
219978
220005
|
let result = s;
|
|
219979
220006
|
if (numTerms < 2)
|
|
@@ -219992,7 +220019,7 @@ class ClothoidSeriesRLEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODU
|
|
|
219992
220019
|
return result;
|
|
219993
220020
|
}
|
|
219994
220021
|
fractionToYGo(fraction, numTerms) {
|
|
219995
|
-
//
|
|
220022
|
+
// write the series for sin(theta)
|
|
219996
220023
|
// replace theta by s*s*c
|
|
219997
220024
|
// integrate wrt s
|
|
219998
220025
|
// x = s^3 c^2/ 3( (1/3)) - s^7 c^6/(3!) ((1/7)) - s^11 c^10 / 5! ((1/9) - ...)
|
|
@@ -220014,7 +220041,7 @@ class ClothoidSeriesRLEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODU
|
|
|
220014
220041
|
return result;
|
|
220015
220042
|
}
|
|
220016
220043
|
fractionToDXGo(fraction, numTerms) {
|
|
220017
|
-
//
|
|
220044
|
+
// yes -- this does happen during derivatives of cosines with more than 0 terms
|
|
220018
220045
|
if (numTerms <= 0)
|
|
220019
220046
|
return 0;
|
|
220020
220047
|
// dX = 1 - s^4c^2/2 + s^8 c^4 / 4! -
|
|
@@ -220069,7 +220096,7 @@ class ClothoidSeriesRLEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODU
|
|
|
220069
220096
|
fractionToDDYGo(fraction, numTerms) {
|
|
220070
220097
|
// DY is "sine"
|
|
220071
220098
|
// DDY is "cosine" series times chain rule dTheta/ds = 2 * s * this.constantDivLR
|
|
220072
|
-
// BUT .... derivative of the cosine series leading term is zero ... use one less term
|
|
220099
|
+
// BUT .... derivative of the cosine series leading term is zero ... use one less term
|
|
220073
220100
|
const s = fraction * this.nominalLength1;
|
|
220074
220101
|
const dTheta = 2 * this.constantDiv2LR * s;
|
|
220075
220102
|
const cosine = this.fractionToDXGo(fraction, numTerms);
|
|
@@ -220132,9 +220159,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
220132
220159
|
* @module Curve
|
|
220133
220160
|
*/
|
|
220134
220161
|
|
|
220135
|
-
/**
|
|
220162
|
+
/**
|
|
220163
|
+
* Intermediate class for evaluation of bare cubic spirals `y = m ^x^3` with x axis from [0..xLength]
|
|
220136
220164
|
* * This implements all the computations among fraction, x, and y.
|
|
220137
|
-
* * Derived classes implement specialized logic such as (a) precomputing `m` and (b) domain-specific fraction-to-distance
|
|
220165
|
+
* * Derived classes implement specialized logic such as (a) precomputing `m` and (b) domain-specific fraction-to-distance
|
|
220166
|
+
* approximations.
|
|
220138
220167
|
* @internal
|
|
220139
220168
|
*/
|
|
220140
220169
|
class CubicEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODULE_0__.XYCurveEvaluator {
|
|
@@ -220150,26 +220179,37 @@ class CubicEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODULE_0__.XYCu
|
|
|
220150
220179
|
this._axisLength = axisLength;
|
|
220151
220180
|
this._cubicM = cubicM;
|
|
220152
220181
|
}
|
|
220153
|
-
get axisLength() {
|
|
220154
|
-
|
|
220182
|
+
get axisLength() {
|
|
220183
|
+
return this._axisLength;
|
|
220184
|
+
}
|
|
220185
|
+
get cubicM() {
|
|
220186
|
+
return this._cubicM;
|
|
220187
|
+
}
|
|
220155
220188
|
/**
|
|
220156
220189
|
* Apply `scaleFactor` to the xLength and cubicM.
|
|
220157
220190
|
* * Derived classes commonly call this as `super.scaleInPlace()`, and additionally apply the scale to their members.
|
|
220158
|
-
* @param scaleFactor
|
|
220159
220191
|
*/
|
|
220160
220192
|
scaleInPlace(scaleFactor) {
|
|
220161
220193
|
this._axisLength *= scaleFactor;
|
|
220162
|
-
// "x" arriving at "m * x^3" will be scaled. "m" has to be divided by the scale to cancel 2 of the 3
|
|
220194
|
+
// "x" arriving at "m * x^3" will be scaled. "m" has to be divided by the scale to cancel 2 of the 3
|
|
220163
220195
|
this._cubicM /= (scaleFactor * scaleFactor);
|
|
220164
220196
|
}
|
|
220165
220197
|
/** Evaluate X at fraction. */
|
|
220166
|
-
fractionToX(fraction) {
|
|
220167
|
-
|
|
220168
|
-
|
|
220169
|
-
/** Evaluate
|
|
220170
|
-
|
|
220171
|
-
|
|
220172
|
-
|
|
220198
|
+
fractionToX(fraction) {
|
|
220199
|
+
return fraction * this._axisLength;
|
|
220200
|
+
}
|
|
220201
|
+
/** Evaluate derivative of X with respect to fraction. */
|
|
220202
|
+
fractionToDX(_fraction) {
|
|
220203
|
+
return this._axisLength;
|
|
220204
|
+
}
|
|
220205
|
+
/** Evaluate second derivative of X with respect to fraction. */
|
|
220206
|
+
fractionToDDX(_fraction) {
|
|
220207
|
+
return 0.0;
|
|
220208
|
+
}
|
|
220209
|
+
/** Evaluate third derivative of X with respect to fraction. */
|
|
220210
|
+
fractionToD3X(_fraction) {
|
|
220211
|
+
return 0.0;
|
|
220212
|
+
}
|
|
220173
220213
|
/** Evaluate Y at fraction. */
|
|
220174
220214
|
fractionToY(fraction) {
|
|
220175
220215
|
const x = fraction * this._axisLength;
|
|
@@ -220190,7 +220230,9 @@ class CubicEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODULE_0__.XYCu
|
|
|
220190
220230
|
return 6.0 * this._cubicM * this._axisLength * this._axisLength * this._axisLength;
|
|
220191
220231
|
}
|
|
220192
220232
|
/** Evaluate fraction at x. */
|
|
220193
|
-
xToFraction(x) {
|
|
220233
|
+
xToFraction(x) {
|
|
220234
|
+
return x / this._axisLength;
|
|
220235
|
+
}
|
|
220194
220236
|
}
|
|
220195
220237
|
|
|
220196
220238
|
|
|
@@ -220224,21 +220266,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
220224
220266
|
/**
|
|
220225
220267
|
* Czech cubic.
|
|
220226
220268
|
* This is y= m*x^3 with
|
|
220227
|
-
* * x any point on the x axis
|
|
220228
|
-
* * `fraction` along the spiral goes to `x = fraction * L
|
|
220229
|
-
* * m is gamma / (6RL)
|
|
220269
|
+
* * x any point on the x axis.
|
|
220270
|
+
* * `fraction` along the spiral goes to `x = fraction * L`.
|
|
220271
|
+
* * m is gamma / (6RL).
|
|
220230
220272
|
* * 1/(6RL) is the leading term of the sine series.
|
|
220231
220273
|
* * `gamma = 2R/sqrt (4RR-LL)` pushes y down a little bit to simulate the lost series terms.
|
|
220232
|
-
* @param localToWorld
|
|
220233
|
-
* @param nominalL1
|
|
220234
|
-
* @param nominalR1
|
|
220235
|
-
* @param activeInterval
|
|
220236
220274
|
* @internal
|
|
220237
220275
|
*/
|
|
220238
220276
|
class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.CubicEvaluator {
|
|
220239
220277
|
nominalLength1;
|
|
220240
220278
|
nominalRadius1;
|
|
220241
|
-
/** Constructor is private.
|
|
220279
|
+
/** Constructor is private. Caller responsible for cubicM validity. */
|
|
220242
220280
|
constructor(length1, radius1, cubicM) {
|
|
220243
220281
|
super(length1, cubicM);
|
|
220244
220282
|
this.nominalLength1 = length1;
|
|
@@ -220248,8 +220286,6 @@ class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
220248
220286
|
* Return the scale factor between simple x^3 / (6RL) cubic and the czech correction.
|
|
220249
220287
|
* * For typical case with l1/R1 smallish, this is just less than 1.0:
|
|
220250
220288
|
* (0.25==>0.99215), (0.15==>0.997184), (0.10==>0.998749), (0.05==>999687)
|
|
220251
|
-
* @param length1
|
|
220252
|
-
* @param radius1
|
|
220253
220289
|
*/
|
|
220254
220290
|
static gammaConstant(length1, radius1) {
|
|
220255
220291
|
return 2.0 * radius1 / Math.sqrt(4.0 * radius1 * radius1 - length1 * length1);
|
|
@@ -220257,10 +220293,10 @@ class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
220257
220293
|
/** Compute the czech cubic constant. */
|
|
220258
220294
|
static computeCubicM(length1, radius1) {
|
|
220259
220295
|
const gamma = CzechSpiralEvaluator.gammaConstant(length1, radius1);
|
|
220260
|
-
//
|
|
220296
|
+
// in the private update method, the LR values should have been vetted
|
|
220261
220297
|
if (gamma === undefined)
|
|
220262
220298
|
return undefined;
|
|
220263
|
-
//
|
|
220299
|
+
// if radius is negative, it shows up in gamma; but the a signed denominator undoes it so take abs of denominator
|
|
220264
220300
|
return gamma / Math.abs((6.0 * radius1 * length1));
|
|
220265
220301
|
}
|
|
220266
220302
|
static create(length1, radius1) {
|
|
@@ -220274,9 +220310,11 @@ class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
220274
220310
|
this.nominalRadius1 *= scaleFactor;
|
|
220275
220311
|
super.scaleInPlace(scaleFactor);
|
|
220276
220312
|
}
|
|
220277
|
-
/**
|
|
220278
|
-
clone() {
|
|
220279
|
-
|
|
220313
|
+
/** Return a deep copy of the evaluator. */
|
|
220314
|
+
clone() {
|
|
220315
|
+
return new CzechSpiralEvaluator(this.nominalLength1, this.nominalRadius1, this.cubicM);
|
|
220316
|
+
}
|
|
220317
|
+
/** Member by member matchup. */
|
|
220280
220318
|
isAlmostEqual(other) {
|
|
220281
220319
|
if (other instanceof CzechSpiralEvaluator) {
|
|
220282
220320
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)
|
|
@@ -220287,7 +220325,8 @@ class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
220287
220325
|
/**
|
|
220288
220326
|
* Return a (fast but mediocre) approximation of spiral length as a function of x axis position.
|
|
220289
220327
|
* * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.
|
|
220290
|
-
* * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
|
|
220328
|
+
* * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
|
|
220329
|
+
* CurvePrimitive measurements.
|
|
220291
220330
|
* @param x distance along the x axis.
|
|
220292
220331
|
*/
|
|
220293
220332
|
xToCzechApproximateDistance(x) {
|
|
@@ -220296,16 +220335,15 @@ class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
220296
220335
|
/**
|
|
220297
220336
|
* Return the inverse of the `forwardL2R2Map` function.
|
|
220298
220337
|
* * The undefined result can only occur for distances outside the usual spirals.
|
|
220299
|
-
* @param
|
|
220300
|
-
*
|
|
220338
|
+
* @param d (approximate) distance along the spiral.
|
|
220301
220339
|
*/
|
|
220302
220340
|
czechApproximateDistanceToX(d) {
|
|
220303
220341
|
return CzechSpiralEvaluator.inverseL2R2Map(d, 1.0, this.nominalLength1, this.nominalRadius1);
|
|
220304
220342
|
}
|
|
220305
220343
|
/**
|
|
220306
|
-
|
|
220307
|
-
|
|
220308
|
-
|
|
220344
|
+
* Evaluate a series expansion that is used with varying signs (plus or minus 1) in czech and italian spirals.
|
|
220345
|
+
* @param x distance along the x axis.
|
|
220346
|
+
*/
|
|
220309
220347
|
static forwardL2R2Map(x, sign, length, radius) {
|
|
220310
220348
|
const l2 = length * length;
|
|
220311
220349
|
const r2 = radius * radius;
|
|
@@ -220316,17 +220354,16 @@ class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
220316
220354
|
/**
|
|
220317
220355
|
* Return the inverse of the `forwardL2R2Map` function.
|
|
220318
220356
|
* * The undefined result can only occur for distances outside the usual spirals.
|
|
220319
|
-
* @param
|
|
220320
|
-
*
|
|
220357
|
+
* @param d (approximate) distance along the spiral.
|
|
220321
220358
|
*/
|
|
220322
|
-
static inverseL2R2Map(
|
|
220359
|
+
static inverseL2R2Map(d, sign, length, radius) {
|
|
220323
220360
|
const l2 = length * length;
|
|
220324
220361
|
const r2 = radius * radius;
|
|
220325
220362
|
const Q = 4.0 * r2 - l2;
|
|
220326
220363
|
const a = sign / (10.0 * Q * l2);
|
|
220327
|
-
return _numerics_Newton__WEBPACK_IMPORTED_MODULE_2__.SimpleNewton.runNewton1D(
|
|
220364
|
+
return _numerics_Newton__WEBPACK_IMPORTED_MODULE_2__.SimpleNewton.runNewton1D(d, (x) => {
|
|
220328
220365
|
const xx = x * x;
|
|
220329
|
-
return x * (1.0 + xx * xx * a) -
|
|
220366
|
+
return x * (1.0 + xx * xx * a) - d;
|
|
220330
220367
|
}, (x) => {
|
|
220331
220368
|
const xx = x * x;
|
|
220332
220369
|
return 1.0 + 5 * xx * xx * a;
|
|
@@ -220336,39 +220373,36 @@ class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
220336
220373
|
/**
|
|
220337
220374
|
* Italian cubic.
|
|
220338
220375
|
* This is y= m*x^3 with
|
|
220339
|
-
* * x any point on the x axis
|
|
220340
|
-
* * `fraction` along the spiral goes to `x = fraction * L
|
|
220341
|
-
* * m is gamma / (6RL)
|
|
220376
|
+
* * x any point on the x axis.
|
|
220377
|
+
* * `fraction` along the spiral goes to `x = fraction * L`.
|
|
220378
|
+
* * m is gamma / (6RL).
|
|
220342
220379
|
* * 1/(6RL) is the leading term of the sine series.
|
|
220343
220380
|
* * `gamma = 2R/sqrt (4RR-LL)` pushes y down a little bit to simulate the lost series terms.
|
|
220344
|
-
* @param localToWorld
|
|
220345
|
-
* @param nominalL1
|
|
220346
|
-
* @param nominalR1
|
|
220347
|
-
* @param activeInterval
|
|
220348
220381
|
* @internal
|
|
220349
220382
|
*/
|
|
220350
220383
|
class ItalianSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.CubicEvaluator {
|
|
220351
220384
|
nominalLength1;
|
|
220352
220385
|
nominalRadius1;
|
|
220353
|
-
/**
|
|
220354
|
-
*
|
|
220386
|
+
/**
|
|
220387
|
+
* Compute the czech cubic constant.
|
|
220388
|
+
* * Funky mixture of lengths.
|
|
220355
220389
|
*/
|
|
220356
220390
|
static computeCubicM(lengthXByForward, radius1) {
|
|
220357
220391
|
const gamma = CzechSpiralEvaluator.gammaConstant(lengthXByForward, radius1);
|
|
220358
|
-
//
|
|
220392
|
+
// in the private update method, the LR values should have been vetted
|
|
220359
220393
|
if (gamma === undefined)
|
|
220360
220394
|
return undefined;
|
|
220361
|
-
//
|
|
220395
|
+
// if radius is negative, it shows up in gamma; but the a signed denominator undoes it so take abs of denominator
|
|
220362
220396
|
return gamma / Math.abs((6.0 * radius1 * lengthXByForward));
|
|
220363
220397
|
}
|
|
220364
|
-
/** Constructor is private.
|
|
220398
|
+
/** Constructor is private. Caller responsible for cubicM validity. */
|
|
220365
220399
|
constructor(length1, radius1, lengthX, cubicM) {
|
|
220366
220400
|
super(lengthX, cubicM);
|
|
220367
220401
|
this.nominalLength1 = length1;
|
|
220368
220402
|
this.nominalRadius1 = radius1;
|
|
220369
220403
|
}
|
|
220370
220404
|
static create(length1, radius1) {
|
|
220371
|
-
//
|
|
220405
|
+
// this seems goofy.; lengthX from forward, then invert for another but that's what the native code does too
|
|
220372
220406
|
const lengthX = CzechSpiralEvaluator.forwardL2R2Map(length1, -1.0, length1, radius1);
|
|
220373
220407
|
const lengthX1 = CzechSpiralEvaluator.inverseL2R2Map(length1, 1.0, lengthX, radius1);
|
|
220374
220408
|
if (lengthX1 === undefined)
|
|
@@ -220383,9 +220417,11 @@ class ItalianSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0_
|
|
|
220383
220417
|
this.nominalRadius1 *= scaleFactor;
|
|
220384
220418
|
super.scaleInPlace(scaleFactor);
|
|
220385
220419
|
}
|
|
220386
|
-
/**
|
|
220387
|
-
clone() {
|
|
220388
|
-
|
|
220420
|
+
/** Return a deep copy of the evaluator. */
|
|
220421
|
+
clone() {
|
|
220422
|
+
return new ItalianSpiralEvaluator(this.nominalLength1, this.nominalRadius1, super.axisLength, this.cubicM);
|
|
220423
|
+
}
|
|
220424
|
+
/** Member by member matchup. */
|
|
220389
220425
|
isAlmostEqual(other) {
|
|
220390
220426
|
if (other instanceof ItalianSpiralEvaluator) {
|
|
220391
220427
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)
|
|
@@ -220394,19 +220430,19 @@ class ItalianSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0_
|
|
|
220394
220430
|
return false;
|
|
220395
220431
|
}
|
|
220396
220432
|
/**
|
|
220397
|
-
|
|
220398
|
-
|
|
220399
|
-
|
|
220400
|
-
|
|
220401
|
-
|
|
220433
|
+
* Return a (fast but mediocre) approximation of spiral length as a function of x axis position.
|
|
220434
|
+
* * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.
|
|
220435
|
+
* * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
|
|
220436
|
+
* CurvePrimitive measurements.
|
|
220437
|
+
* @param x distance along the x axis.
|
|
220438
|
+
*/
|
|
220402
220439
|
distanceToItalianApproximateX(x) {
|
|
220403
220440
|
return CzechSpiralEvaluator.forwardL2R2Map(x, -1.0, this.nominalLength1, this.nominalRadius1);
|
|
220404
220441
|
}
|
|
220405
220442
|
/**
|
|
220406
220443
|
* Return the inverse of the `forwardL2R2Map` function.
|
|
220407
220444
|
* * The undefined result can only occur for distances outside the usual spirals.
|
|
220408
|
-
* @param
|
|
220409
|
-
*
|
|
220445
|
+
* @param d (approximate) distance along the spiral.
|
|
220410
220446
|
*/
|
|
220411
220447
|
xToItalianApproximateDistance(d) {
|
|
220412
220448
|
return CzechSpiralEvaluator.inverseL2R2Map(d, -1.0, this.nominalLength1, this.nominalRadius1);
|
|
@@ -220467,9 +220503,11 @@ class DirectHalfCosineSpiralEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTE
|
|
|
220467
220503
|
this.nominalRadius1 *= scaleFactor;
|
|
220468
220504
|
this.updateConstants();
|
|
220469
220505
|
}
|
|
220470
|
-
/**
|
|
220471
|
-
clone() {
|
|
220472
|
-
|
|
220506
|
+
/** Return a deep copy of the evaluator. */
|
|
220507
|
+
clone() {
|
|
220508
|
+
return new DirectHalfCosineSpiralEvaluator(this.nominalLength1, this.nominalRadius1);
|
|
220509
|
+
}
|
|
220510
|
+
/** Member by member matchup. */
|
|
220473
220511
|
isAlmostEqual(other) {
|
|
220474
220512
|
if (other instanceof DirectHalfCosineSpiralEvaluator) {
|
|
220475
220513
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)
|
|
@@ -220479,14 +220517,18 @@ class DirectHalfCosineSpiralEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTE
|
|
|
220479
220517
|
return false;
|
|
220480
220518
|
}
|
|
220481
220519
|
/** Evaluate X at fractional position. */
|
|
220482
|
-
fractionToX(fraction) {
|
|
220520
|
+
fractionToX(fraction) {
|
|
220521
|
+
return fraction * this.nominalLength1;
|
|
220522
|
+
}
|
|
220483
220523
|
/** Evaluate Y at fractional position. */
|
|
220484
220524
|
fractionToY(fraction) {
|
|
220485
220525
|
const theta = fraction * Math.PI;
|
|
220486
220526
|
return this._c * (this._c2 * fraction * fraction - this._c1 * (1.0 - Math.cos(theta)));
|
|
220487
220527
|
}
|
|
220488
220528
|
/** Evaluate derivative of X with respect to fraction at fractional position. */
|
|
220489
|
-
fractionToDX(_fraction) {
|
|
220529
|
+
fractionToDX(_fraction) {
|
|
220530
|
+
return this.nominalLength1;
|
|
220531
|
+
}
|
|
220490
220532
|
/** Evaluate derivative of Y with respect to fraction at fractional position. */
|
|
220491
220533
|
fractionToDY(fraction) {
|
|
220492
220534
|
const pi = Math.PI;
|
|
@@ -220494,7 +220536,9 @@ class DirectHalfCosineSpiralEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTE
|
|
|
220494
220536
|
return this._c * (2.0 * this._c2 * fraction - this._c1 * pi * Math.sin(theta));
|
|
220495
220537
|
}
|
|
220496
220538
|
/** Evaluate second derivative of X with respect to fraction at fractional position. */
|
|
220497
|
-
fractionToDDX(_fraction) {
|
|
220539
|
+
fractionToDDX(_fraction) {
|
|
220540
|
+
return 0.0;
|
|
220541
|
+
}
|
|
220498
220542
|
/** Evaluate third derivative of Y with respect to fraction at fractional position. */
|
|
220499
220543
|
fractionToDDY(fraction) {
|
|
220500
220544
|
const pi = Math.PI;
|
|
@@ -220502,7 +220546,9 @@ class DirectHalfCosineSpiralEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTE
|
|
|
220502
220546
|
return this._c * (2.0 * this._c2 - this._c1 * pi * pi * Math.cos(theta));
|
|
220503
220547
|
}
|
|
220504
220548
|
/** Evaluate second derivative of X with respect to fraction at fractional position. */
|
|
220505
|
-
fractionToD3X(_fraction) {
|
|
220549
|
+
fractionToD3X(_fraction) {
|
|
220550
|
+
return 0.0;
|
|
220551
|
+
}
|
|
220506
220552
|
/** Evaluate third derivative of Y with respect to fraction at fractional position. */
|
|
220507
220553
|
fractionToD3Y(fraction) {
|
|
220508
220554
|
const pi = Math.PI;
|
|
@@ -220569,10 +220615,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
220569
220615
|
|
|
220570
220616
|
|
|
220571
220617
|
/**
|
|
220572
|
-
* DirectSpiral3d acts like a TransitionSpiral3d for serialization purposes, but implements spiral types that have
|
|
220573
|
-
* for IntegratedSpiral3d.
|
|
220618
|
+
* DirectSpiral3d acts like a TransitionSpiral3d for serialization purposes, but implements spiral types that have
|
|
220619
|
+
* "direct" xy calculations without the integrations required for IntegratedSpiral3d.
|
|
220574
220620
|
* * Each DirectSpiral3d carries an XYCurveEvaluator to give it specialized behavior.
|
|
220575
|
-
* * Direct spirals that flow through serialization to native imodel02 are
|
|
220621
|
+
* * Direct spirals that flow through serialization to native imodel02 are created with these static methods:
|
|
220576
220622
|
* * createArema
|
|
220577
220623
|
* * createJapaneseCubic
|
|
220578
220624
|
* * createAustralianRail
|
|
@@ -220585,32 +220631,45 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
220585
220631
|
* @public
|
|
220586
220632
|
*/
|
|
220587
220633
|
class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.TransitionSpiral3d {
|
|
220588
|
-
/** String name for schema properties */
|
|
220634
|
+
/** String name for schema properties. */
|
|
220589
220635
|
curvePrimitiveType = "transitionSpiral";
|
|
220590
|
-
/**
|
|
220636
|
+
/** Stroked approximation of entire spiral. This is AFTER the localToWorld transform. */
|
|
220591
220637
|
_globalStrokes;
|
|
220592
|
-
/**
|
|
220593
|
-
*
|
|
220594
|
-
* *
|
|
220638
|
+
/**
|
|
220639
|
+
* Stroked approximation of active spiral. This is AFTER the localToWorld transform.
|
|
220640
|
+
* * Same count as global; possibly overly fine, but it gives some consistency between same clothoid constructed as
|
|
220641
|
+
* partial versus complete.
|
|
220642
|
+
* * If no trimming, this points to the same place as the _globalStrokes. DO NOT double transform.
|
|
220595
220643
|
*/
|
|
220596
220644
|
_activeStrokes;
|
|
220597
|
-
/** Return the internal stroked form of the (possibly partial) spiral
|
|
220598
|
-
get activeStrokes() {
|
|
220645
|
+
/** Return the internal stroked form of the (possibly partial) spiral. */
|
|
220646
|
+
get activeStrokes() {
|
|
220647
|
+
return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes;
|
|
220648
|
+
}
|
|
220599
220649
|
_nominalL1;
|
|
220600
220650
|
_nominalR1;
|
|
220601
220651
|
_evaluator;
|
|
220602
220652
|
/** Return the nominal end radius. */
|
|
220603
|
-
get nominalR1() {
|
|
220653
|
+
get nominalR1() {
|
|
220654
|
+
return this._nominalR1;
|
|
220655
|
+
}
|
|
220604
220656
|
/** Return the nominal distance from inflection to endpoint. */
|
|
220605
|
-
get nominalL1() {
|
|
220657
|
+
get nominalL1() {
|
|
220658
|
+
return this._nominalL1;
|
|
220659
|
+
}
|
|
220606
220660
|
/** Return the nominal end curvature */
|
|
220607
|
-
get nominalCurvature1() {
|
|
220608
|
-
|
|
220661
|
+
get nominalCurvature1() {
|
|
220662
|
+
return _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.TransitionSpiral3d.radiusToCurvature(this._nominalR1);
|
|
220663
|
+
}
|
|
220664
|
+
/**
|
|
220665
|
+
* Return the low level evaluator.
|
|
220609
220666
|
* @internal
|
|
220610
220667
|
*/
|
|
220611
|
-
get evaluator() {
|
|
220668
|
+
get evaluator() {
|
|
220669
|
+
return this._evaluator;
|
|
220670
|
+
}
|
|
220612
220671
|
// constructor demands radius1 and distance1 for nominal construction.
|
|
220613
|
-
// caller is responsible for managing intervals of partial spiral
|
|
220672
|
+
// caller is responsible for managing intervals of partial spiral.
|
|
220614
220673
|
constructor(localToWorld, spiralType, originalProperties, nominalL1, nominalR1, activeFractionInterval, evaluator) {
|
|
220615
220674
|
super(spiralType, localToWorld, activeFractionInterval, originalProperties);
|
|
220616
220675
|
this._nominalL1 = nominalL1;
|
|
@@ -220618,14 +220677,16 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220618
220677
|
this._evaluator = evaluator;
|
|
220619
220678
|
this._globalStrokes = _LineString3d__WEBPACK_IMPORTED_MODULE_1__.LineString3d.create();
|
|
220620
220679
|
this._activeStrokes = _LineString3d__WEBPACK_IMPORTED_MODULE_1__.LineString3d.create();
|
|
220621
|
-
// initialize for compiler
|
|
220680
|
+
// initialize for compiler; but this will be recomputed in refreshComputeProperties
|
|
220622
220681
|
this.refreshComputedProperties();
|
|
220623
220682
|
}
|
|
220624
220683
|
/**
|
|
220625
220684
|
* Compute stroke data in an interval.
|
|
220626
220685
|
* @param strokes strokes to clear and refill.
|
|
220627
|
-
* @param
|
|
220628
|
-
* @param
|
|
220686
|
+
* @param fractionA start fraction.
|
|
220687
|
+
* @param fractionB end fraction.
|
|
220688
|
+
* @param numInterval number of intervals.
|
|
220689
|
+
* @param applyLocalToWorld if true, apply the localToWorld transform.
|
|
220629
220690
|
*/
|
|
220630
220691
|
computeStrokes(strokes, fractionA, fractionB, numInterval, applyLocalToWorld = true) {
|
|
220631
220692
|
if (numInterval < 1)
|
|
@@ -220654,7 +220715,7 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220654
220715
|
trueDistance0 = trueDistance1;
|
|
220655
220716
|
}
|
|
220656
220717
|
}
|
|
220657
|
-
/** Recompute strokes */
|
|
220718
|
+
/** Recompute strokes. */
|
|
220658
220719
|
refreshComputedProperties() {
|
|
220659
220720
|
const sweepRadians = this.nominalL1 / (2.0 * this.nominalR1);
|
|
220660
220721
|
const radiansStep = 0.02;
|
|
@@ -220666,12 +220727,14 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220666
220727
|
}
|
|
220667
220728
|
/**
|
|
220668
220729
|
* Create a spiral object which uses numXTerm terms from the clothoid X series and numYTerm from the clothoid Y series.
|
|
220669
|
-
* @param
|
|
220730
|
+
* @param spiralType type of spiral.
|
|
220731
|
+
* @param localToWorld placement frame. Inflection point is at origin, initial direction is along x axis.
|
|
220732
|
+
* @param numXTerm number of terms to use from X series
|
|
220670
220733
|
* @param numYTerm number of terms to use from Y series
|
|
220671
|
-
* @param
|
|
220734
|
+
* @param originalProperties (optional) transition conditional properties.
|
|
220672
220735
|
* @param nominalL1 design distance from inflection to end point.
|
|
220673
220736
|
* @param nominalR1 design radius at end point.
|
|
220674
|
-
* @param activeInterval active interval (as fractions of nominalL1
|
|
220737
|
+
* @param activeInterval (optional) active interval (as fractions of nominalL1)
|
|
220675
220738
|
*/
|
|
220676
220739
|
static createTruncatedClothoid(spiralType, localToWorld, numXTerm, numYTerm, originalProperties, nominalL1, nominalR1, activeInterval) {
|
|
220677
220740
|
if (numXTerm < 1)
|
|
@@ -220682,13 +220745,13 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220682
220745
|
return new DirectSpiral3d(localToWorld.clone(), spiralType, originalProperties, nominalL1, nominalR1, activeInterval ? activeInterval.clone() : _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_5__.Segment1d.create(0, 1), evaluator);
|
|
220683
220746
|
}
|
|
220684
220747
|
/**
|
|
220685
|
-
* Create
|
|
220748
|
+
* Create a Japanese spiral clothoid approximation.
|
|
220686
220749
|
* * X is 1 terms of the clothoid series as a function of nominal distance along.
|
|
220687
|
-
* * Y is 1 terms
|
|
220688
|
-
* * Remark: This is identical to the ChineseCubic
|
|
220689
|
-
* @param localToWorld axes with inflection at origin, tangent along x axis
|
|
220750
|
+
* * Y is 1 terms of the clothoid series as a function of nominal distance along.
|
|
220751
|
+
* * Remark: This is identical to the ChineseCubic.
|
|
220752
|
+
* @param localToWorld axes with inflection at origin, tangent along x axis.
|
|
220690
220753
|
* @param nominalL1 nominal length as used in series LR terms.
|
|
220691
|
-
* @param nominalR1 nominal final radius as used in series LR terms
|
|
220754
|
+
* @param nominalR1 nominal final radius as used in series LR terms.
|
|
220692
220755
|
* @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along
|
|
220693
220756
|
*/
|
|
220694
220757
|
static createJapaneseCubic(localToWorld, nominalL1, nominalR1, activeInterval) {
|
|
@@ -220696,14 +220759,14 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220696
220759
|
}
|
|
220697
220760
|
/**
|
|
220698
220761
|
* Create a czech cubic.
|
|
220699
|
-
* This is y= m*x^3 with
|
|
220700
|
-
* * x any point on the x axis
|
|
220701
|
-
* * `fraction` along the spiral goes to `x = fraction * L
|
|
220702
|
-
* * m is gamma / (6RL)
|
|
220762
|
+
* This is y = m*x^3 with
|
|
220763
|
+
* * x any point on the x axis.
|
|
220764
|
+
* * `fraction` along the spiral goes to `x = fraction * L`.
|
|
220765
|
+
* * m is gamma / (6RL).
|
|
220703
220766
|
* * 1/(6RL) is the leading term of the sine series.
|
|
220704
|
-
* * `gamma = 2R/sqrt
|
|
220767
|
+
* * `gamma = 2R/sqrt(4RR-LL)` pushes y up a little bit to simulate the lost series terms.
|
|
220705
220768
|
* @param localToWorld
|
|
220706
|
-
* @param nominalLx nominal length along x axis
|
|
220769
|
+
* @param nominalLx nominal length along x axis.
|
|
220707
220770
|
* @param nominalR1
|
|
220708
220771
|
* @param activeInterval
|
|
220709
220772
|
*/
|
|
@@ -220715,15 +220778,14 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220715
220778
|
}
|
|
220716
220779
|
/**
|
|
220717
220780
|
* Create an italian spiral
|
|
220718
|
-
* This is y= m*x^3 with
|
|
220719
|
-
* * x any point on the x axis
|
|
220720
|
-
* * `fraction` along the spiral goes to `x = fraction * L
|
|
220721
|
-
* * m is gamma / (6RL)
|
|
220781
|
+
* This is y = m*x^3 with
|
|
220782
|
+
* * x any point on the x axis.
|
|
220783
|
+
* * `fraction` along the spiral goes to `x = fraction * L`.
|
|
220784
|
+
* * m is gamma / (6RL).
|
|
220722
220785
|
* * 1/(6RL) is the leading term of the sine series.
|
|
220723
|
-
* * `gamma = 2R/sqrt
|
|
220724
|
-
* * L in gamma and m is the
|
|
220786
|
+
* * `gamma = 2R/sqrt(4RR-LL)` pushes y up a little bit to simulate the lost series terms.
|
|
220725
220787
|
* @param localToWorld
|
|
220726
|
-
* @param nominalL1 nominal length along the spiral
|
|
220788
|
+
* @param nominalL1 nominal length along the spiral.
|
|
220727
220789
|
* @param nominalR1
|
|
220728
220790
|
* @param activeInterval
|
|
220729
220791
|
*/
|
|
@@ -220735,12 +220797,12 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220735
220797
|
}
|
|
220736
220798
|
/**
|
|
220737
220799
|
* Create an MX Cubic whose nominal length is close to along the curve.
|
|
220738
|
-
* This is y= m*x^3 with
|
|
220739
|
-
* * m is 1/ (6RL1)
|
|
220800
|
+
* This is y = m*x^3 with
|
|
220801
|
+
* * m is 1/ (6RL1).
|
|
220740
220802
|
* * 1/(6RL) is the leading term of the sine series.
|
|
220741
|
-
* * L1 is an along-the-x-axis distance that is slightly LESS THAN the nominal length
|
|
220742
|
-
* * x is axis position that is slightly LESS than nominal distance along
|
|
220743
|
-
* * L1, x use the approximation
|
|
220803
|
+
* * L1 is an along-the-x-axis distance that is slightly LESS THAN the nominal length.
|
|
220804
|
+
* * x is axis position that is slightly LESS than nominal distance along.
|
|
220805
|
+
* * L1, x use the approximation `x = s * ( 1 - s^4/ (40 R R L L))
|
|
220744
220806
|
* @param localToWorld
|
|
220745
220807
|
* @param nominalL1
|
|
220746
220808
|
* @param nominalR1
|
|
@@ -220755,11 +220817,11 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220755
220817
|
/**
|
|
220756
220818
|
* Create a polish cubic
|
|
220757
220819
|
* This is y= m*x^3 with
|
|
220758
|
-
* * m is 1/ (6RL)
|
|
220820
|
+
* * m is 1/ (6RL).
|
|
220759
220821
|
* * 1/(6RL) is the leading term of the sine series.
|
|
220760
|
-
* * L is nominal length
|
|
220822
|
+
* * L is nominal length.
|
|
220761
220823
|
* * R is nominal end radius.
|
|
220762
|
-
* * x ranges up to the x axis distance for which the polish distance series produces f(x)=L
|
|
220824
|
+
* * x ranges up to the x axis distance for which the polish distance series produces f(x) = L.
|
|
220763
220825
|
* * The support class PolishCubicEvaluator has static methods for the distance series and its inversion.
|
|
220764
220826
|
*/
|
|
220765
220827
|
static createPolishCubic(localToWorld, nominalL1, nominalR1, activeInterval) {
|
|
@@ -220771,9 +220833,9 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220771
220833
|
/**
|
|
220772
220834
|
* Create an AustralianRailCorp spiral
|
|
220773
220835
|
* This is y= m*x^3 with
|
|
220774
|
-
* * x any point on the x axis
|
|
220775
|
-
* * `fraction` along the spiral goes to `x = fraction * L
|
|
220776
|
-
* * m is gamma / (6RL)
|
|
220836
|
+
* * x any point on the x axis.
|
|
220837
|
+
* * `fraction` along the spiral goes to `x = fraction * L`.
|
|
220838
|
+
* * m is gamma / (6RL).
|
|
220777
220839
|
* * 1/(6RL) is the leading term of the sine series.
|
|
220778
220840
|
* * `gamma = 2R/sqrt (4RR-LL)` pushes y up a little bit to simulate the lost series terms.
|
|
220779
220841
|
* @param localToWorld
|
|
@@ -220788,64 +220850,65 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220788
220850
|
return new DirectSpiral3d(localToWorld.clone(), "AustralianRailCorp", undefined, nominalL1, nominalR1, activeInterval ? activeInterval.clone() : _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_5__.Segment1d.create(0, 1), evaluator);
|
|
220789
220851
|
}
|
|
220790
220852
|
static createDirectHalfCosine(localToWorld, nominalL1, nominalR1, activeInterval) {
|
|
220791
|
-
return new
|
|
220853
|
+
return new DirectSpiral3d(localToWorld, "HalfCosine", undefined, nominalL1, nominalR1, activeInterval, new _DirectHalfCosineSpiralEvaluator__WEBPACK_IMPORTED_MODULE_10__.DirectHalfCosineSpiralEvaluator(nominalL1, nominalR1));
|
|
220792
220854
|
}
|
|
220793
220855
|
/**
|
|
220794
220856
|
* Create an Arema spiral clothoid approximation
|
|
220795
|
-
* * X is 2 terms of the clothoid series as a function of nominal distance along
|
|
220796
|
-
* * Y is 2 terms f the clothoid series as a function of nominal distance along
|
|
220797
|
-
* * Remark: This is identical to the ChineseCubic
|
|
220798
|
-
* @param localToWorld axes with inflection at origin, tangent along x axis
|
|
220857
|
+
* * X is 2 terms of the clothoid series as a function of nominal distance along.
|
|
220858
|
+
* * Y is 2 terms f the clothoid series as a function of nominal distance along.
|
|
220859
|
+
* * Remark: This is identical to the ChineseCubic.
|
|
220860
|
+
* @param localToWorld axes with inflection at origin, tangent along x axis.
|
|
220799
220861
|
* @param nominalL1 nominal length as used in series LR terms.
|
|
220800
|
-
* @param nominalR1 nominal final radius as used in series LR terms
|
|
220801
|
-
* @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along
|
|
220862
|
+
* @param nominalR1 nominal final radius as used in series LR terms.
|
|
220863
|
+
* @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along.
|
|
220802
220864
|
*/
|
|
220803
220865
|
static createArema(localToWorld, nominalL1, nominalR1, activeInterval) {
|
|
220804
220866
|
return this.createTruncatedClothoid("Arema", localToWorld, 2, 2, undefined, nominalL1, nominalR1, activeInterval);
|
|
220805
220867
|
}
|
|
220806
220868
|
/**
|
|
220807
220869
|
* Create a Chinese clothoid approximation
|
|
220808
|
-
* * X is 2 terms of the clothoid series as a function of nominal distance along
|
|
220809
|
-
* * Y is 2 terms f the clothoid series as a function of nominal distance along
|
|
220810
|
-
* * Remark: This is identical to the Arema spiral
|
|
220811
|
-
* @param localToWorld axes with inflection at origin, tangent along x axis
|
|
220870
|
+
* * X is 2 terms of the clothoid series as a function of nominal distance along.
|
|
220871
|
+
* * Y is 2 terms f the clothoid series as a function of nominal distance along.
|
|
220872
|
+
* * Remark: This is identical to the Arema spiral.
|
|
220873
|
+
* @param localToWorld axes with inflection at origin, tangent along x axis.
|
|
220812
220874
|
* @param nominalL1 nominal length as used in series LR terms.
|
|
220813
|
-
* @param nominalR1 nominal final radius as used in series LR terms
|
|
220814
|
-
* @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along
|
|
220875
|
+
* @param nominalR1 nominal final radius as used in series LR terms.
|
|
220876
|
+
* @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along.
|
|
220815
220877
|
*/
|
|
220816
220878
|
static createChineseCubic(localToWorld, nominalL1, nominalR1, activeInterval) {
|
|
220817
220879
|
return this.createTruncatedClothoid("ChineseCubic", localToWorld, 2, 2, undefined, nominalL1, nominalR1, activeInterval);
|
|
220818
220880
|
}
|
|
220819
220881
|
/**
|
|
220820
220882
|
* Create a Western Australian direct spiral.
|
|
220821
|
-
* * X is 2 terms of the clothoid series as a function of distance along
|
|
220822
|
-
* * Y is 1 term (cubic in nominal distance along)
|
|
220823
|
-
* @param localToWorld axes with inflection at origin, tangent along x axis
|
|
220883
|
+
* * X is 2 terms of the clothoid series as a function of distance along.
|
|
220884
|
+
* * Y is 1 term (cubic in nominal distance along).
|
|
220885
|
+
* @param localToWorld axes with inflection at origin, tangent along x axis.
|
|
220824
220886
|
* @param nominalL1 nominal length as used in series LR terms.
|
|
220825
|
-
* @param nominalR1 nominal final radius as used in series LR terms
|
|
220826
|
-
* @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along
|
|
220887
|
+
* @param nominalR1 nominal final radius as used in series LR terms.
|
|
220888
|
+
* @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along.
|
|
220827
220889
|
*/
|
|
220828
220890
|
static createWesternAustralian(localToWorld, nominalL1, nominalR1, activeInterval) {
|
|
220829
220891
|
return this.createTruncatedClothoid("WesternAustralian", localToWorld, 2, 1, undefined, nominalL1, nominalR1, activeInterval);
|
|
220830
220892
|
}
|
|
220831
220893
|
/**
|
|
220832
220894
|
* Create (if possible) a DirectSpiral3d, applying various strict conditions appropriate to the spiral type.
|
|
220833
|
-
* The parameter list includes extraneous values in order to directly match IntegratedSpiral3d.create, which has
|
|
220834
|
-
*
|
|
220835
|
-
* * IMPORTANT RESTRICTIONS
|
|
220895
|
+
* The parameter list includes extraneous values in order to directly match IntegratedSpiral3d.create, which has
|
|
220896
|
+
* greater flexibility about mixtures of values.
|
|
220897
|
+
* * IMPORTANT RESTRICTIONS:
|
|
220836
220898
|
* * Direct spirals must have the inflection at the origin of their coordinate system, aligned with the x axis.
|
|
220837
|
-
* * hence bearing0 = 0
|
|
220838
|
-
* * hence radius0 = 0
|
|
220839
|
-
* * bearing1 is ignored
|
|
220899
|
+
* * hence bearing0 = 0.
|
|
220900
|
+
* * hence radius0 = 0.
|
|
220901
|
+
* * bearing1 is ignored.
|
|
220840
220902
|
* * radius1 must be given.
|
|
220841
220903
|
* * arcLength must be given,
|
|
220842
|
-
* @param spiralType one of the types in `
|
|
220843
|
-
* @param radius0 radius (or 0 for tangent to line) at start.
|
|
220904
|
+
* @param spiralType one of the types in `DirectSpiralTypeName`
|
|
220905
|
+
* @param radius0 radius (or 0 for tangent to line) at start. Must be ZERO or UNDEFINED
|
|
220844
220906
|
* @param radius1 radius (or 0 for tangent to line) at end.
|
|
220845
|
-
* @param bearing0 bearing, measured CCW from x axis at start.
|
|
220846
|
-
* @param bearing1 bearing, measured CCW from x axis at end.
|
|
220847
|
-
* @param fractionInterval optional fractional interval for an "active" portion of the curve.
|
|
220848
|
-
*
|
|
220907
|
+
* @param bearing0 bearing, measured CCW from x axis at start. Must be ZERO or UNDEFINED
|
|
220908
|
+
* @param bearing1 bearing, measured CCW from x axis at end. IGNORED.
|
|
220909
|
+
* @param fractionInterval (optional) fractional interval for an "active" portion of the curve. If omitted, the
|
|
220910
|
+
* full [0,1] is used.
|
|
220911
|
+
* @param localToWorld placement transform.
|
|
220849
220912
|
*/
|
|
220850
220913
|
static createFromLengthAndRadius(spiralType, radius0, radius1, bearing0, _bearing1, arcLength, activeInterval, localToWorld) {
|
|
220851
220914
|
if (bearing0 !== undefined && !bearing0.isAlmostZero)
|
|
@@ -220878,11 +220941,11 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220878
220941
|
return this.createPolishCubic(localToWorld, arcLength, radius1, activeInterval);
|
|
220879
220942
|
return undefined;
|
|
220880
220943
|
}
|
|
220881
|
-
/** Deep clone of this spiral */
|
|
220944
|
+
/** Deep clone of this spiral. */
|
|
220882
220945
|
clone() {
|
|
220883
220946
|
return new DirectSpiral3d(this.localToWorld.clone(), this._spiralType, this.designProperties?.clone(), this._nominalL1, this._nominalR1, this._activeFractionInterval?.clone(), this._evaluator.clone());
|
|
220884
220947
|
}
|
|
220885
|
-
/**
|
|
220948
|
+
/** Apply `transform` to this spiral's local to world transform. */
|
|
220886
220949
|
tryTransformInPlace(transformA) {
|
|
220887
220950
|
const rigidData = this.applyRigidPartOfTransform(transformA);
|
|
220888
220951
|
if (rigidData !== undefined) {
|
|
@@ -220897,17 +220960,18 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220897
220960
|
startPoint(result) {
|
|
220898
220961
|
return this.activeStrokes.startPoint(result);
|
|
220899
220962
|
}
|
|
220900
|
-
/**
|
|
220963
|
+
/** Return the spiral end point. */
|
|
220901
220964
|
endPoint(result) {
|
|
220902
220965
|
return this.activeStrokes.endPoint(result);
|
|
220903
220966
|
}
|
|
220904
|
-
/**
|
|
220967
|
+
/** Test if the local to world transform places the spiral xy plane into `plane`. */
|
|
220905
220968
|
isInPlane(plane) {
|
|
220906
220969
|
return plane.isPointInPlane(this.localToWorld.origin)
|
|
220907
220970
|
&& _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))
|
|
220908
220971
|
&& _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));
|
|
220909
220972
|
}
|
|
220910
|
-
/**
|
|
220973
|
+
/**
|
|
220974
|
+
* Return quick length of the spiral.
|
|
220911
220975
|
* The tangent vector of a true clothoid is length 1 everywhere, so simple proportion of nominalL1 is a good approximation.
|
|
220912
220976
|
*/
|
|
220913
220977
|
quickLength() {
|
|
@@ -220915,18 +220979,24 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220915
220979
|
const n = distanceData.length;
|
|
220916
220980
|
return distanceData.getYAtUncheckedPointIndex(n - 1);
|
|
220917
220981
|
}
|
|
220918
|
-
|
|
220919
|
-
|
|
220920
|
-
|
|
220921
|
-
//
|
|
220982
|
+
// We claim true length is stored at the back of `packedUVParams`.
|
|
220983
|
+
// Nevertheless defer to the generic integrator in the default implementation.
|
|
220984
|
+
// public override curveLength() {
|
|
220985
|
+
// return this.quickLength();
|
|
220986
|
+
// }
|
|
220922
220987
|
/** Test if `other` is an instance of `TransitionSpiral3d` */
|
|
220923
|
-
isSameGeometryClass(other) {
|
|
220924
|
-
|
|
220925
|
-
|
|
220988
|
+
isSameGeometryClass(other) {
|
|
220989
|
+
return other instanceof _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.TransitionSpiral3d;
|
|
220990
|
+
}
|
|
220991
|
+
/**
|
|
220992
|
+
* Add strokes from this spiral to `dest`.
|
|
220993
|
+
* * Line strings will usually stroke as just their points.
|
|
220926
220994
|
* * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.
|
|
220927
220995
|
*/
|
|
220928
|
-
emitStrokes(dest, options) {
|
|
220929
|
-
|
|
220996
|
+
emitStrokes(dest, options) {
|
|
220997
|
+
this.activeStrokes.emitStrokes(dest, options);
|
|
220998
|
+
}
|
|
220999
|
+
/** Emit stroke fragments to `dest` handler. */
|
|
220930
221000
|
emitStrokableParts(dest, options) {
|
|
220931
221001
|
const n = this.computeStrokeCountForOptions(options);
|
|
220932
221002
|
const activeStrokes = this.activeStrokes;
|
|
@@ -220947,8 +221017,8 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220947
221017
|
dest.endParentCurvePrimitive(this);
|
|
220948
221018
|
}
|
|
220949
221019
|
/**
|
|
220950
|
-
*
|
|
220951
|
-
* @param options StrokeOptions that determine count
|
|
221020
|
+
* Return the stroke count required for given options.
|
|
221021
|
+
* @param options StrokeOptions that determine count.
|
|
220952
221022
|
*/
|
|
220953
221023
|
computeStrokeCountForOptions(options) {
|
|
220954
221024
|
let numStroke;
|
|
@@ -220965,8 +221035,9 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220965
221035
|
numStroke = Math.ceil(this._activeFractionInterval.absoluteDelta() * numStroke);
|
|
220966
221036
|
return numStroke;
|
|
220967
221037
|
}
|
|
220968
|
-
/**
|
|
220969
|
-
*
|
|
221038
|
+
/**
|
|
221039
|
+
* Reverse the active interval and active strokes.
|
|
221040
|
+
* * Primary defining data remains unchanged.
|
|
220970
221041
|
*/
|
|
220971
221042
|
reverseInPlace() {
|
|
220972
221043
|
this._activeFractionInterval.reverseInPlace();
|
|
@@ -220989,10 +221060,11 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
220989
221060
|
result.transformInPlace(this.localToWorld);
|
|
220990
221061
|
return result;
|
|
220991
221062
|
}
|
|
220992
|
-
/**
|
|
220993
|
-
*
|
|
220994
|
-
* * origin at fractional position along the curve
|
|
220995
|
-
* * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to
|
|
221063
|
+
/**
|
|
221064
|
+
* Return a plane with
|
|
221065
|
+
* * origin at fractional position along the curve.
|
|
221066
|
+
* * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to
|
|
221067
|
+
* the fraction.
|
|
220996
221068
|
* * vectorV is the second derivative, i.e.derivative of vectorU.
|
|
220997
221069
|
*/
|
|
220998
221070
|
fractionToPointAnd2Derivatives(activeFraction, result) {
|
|
@@ -221004,11 +221076,11 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
221004
221076
|
result.transformInPlace(this.localToWorld);
|
|
221005
221077
|
return result;
|
|
221006
221078
|
}
|
|
221007
|
-
/** Second step of double dispatch:
|
|
221079
|
+
/** Second step of double dispatch: call `handler.handleTransitionSpiral(this)`. */
|
|
221008
221080
|
dispatchToGeometryHandler(handler) {
|
|
221009
221081
|
return handler.handleTransitionSpiral(this);
|
|
221010
221082
|
}
|
|
221011
|
-
/**
|
|
221083
|
+
/** Compare various coordinate quantities. */
|
|
221012
221084
|
isAlmostEqual(other) {
|
|
221013
221085
|
if (other instanceof DirectSpiral3d) {
|
|
221014
221086
|
return _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSameCoordinate(this._nominalL1, other._nominalL1)
|
|
@@ -221072,35 +221144,40 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
221072
221144
|
|
|
221073
221145
|
/**
|
|
221074
221146
|
* An IntegratedSpiral3d is a curve defined by integrating its curvature.
|
|
221075
|
-
* * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians)
|
|
221147
|
+
* * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians).
|
|
221076
221148
|
* * Integrating (cos(theta), sin(theta)) gives displacement from the start point, and thus the actual curve position.
|
|
221077
|
-
* * The curvature functions of interest are all symmetric snap functions in the NormalizedTransition class.
|
|
221078
|
-
* *
|
|
221149
|
+
* * The curvature functions of interest are all symmetric snap functions in the [[NormalizedTransition]] class.
|
|
221150
|
+
* * [[TransitionConditionalProperties]] implements the computations of the interrelationship of radii, bearing, and length.
|
|
221079
221151
|
* @public
|
|
221080
221152
|
*/
|
|
221081
221153
|
class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.TransitionSpiral3d {
|
|
221082
|
-
/** String name for schema properties */
|
|
221154
|
+
/** String name for schema properties. */
|
|
221083
221155
|
curvePrimitiveType = "transitionSpiral";
|
|
221084
|
-
/**
|
|
221156
|
+
/** Start and end radii as a Segment1d. */
|
|
221085
221157
|
radius01;
|
|
221086
|
-
/**
|
|
221158
|
+
/** Start and end bearings as an AngleSweep. */
|
|
221087
221159
|
bearing01;
|
|
221088
|
-
/**
|
|
221160
|
+
/** Stroked approximation of entire spiral. */
|
|
221089
221161
|
_globalStrokes;
|
|
221090
|
-
/**
|
|
221091
|
-
*
|
|
221092
|
-
* *
|
|
221162
|
+
/**
|
|
221163
|
+
* Stroked approximation of active spiral.
|
|
221164
|
+
* * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed
|
|
221165
|
+
* as partial versus complete.
|
|
221166
|
+
* * If no trimming, this points to the same place as the _globalStrokes. DO NOT double transform.
|
|
221093
221167
|
*/
|
|
221094
221168
|
_activeStrokes;
|
|
221095
|
-
/** Return the internal stroked form of the (possibly partial) spiral
|
|
221096
|
-
get activeStrokes() {
|
|
221169
|
+
/** Return the internal stroked form of the (possibly partial) spiral. */
|
|
221170
|
+
get activeStrokes() {
|
|
221171
|
+
return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes;
|
|
221172
|
+
}
|
|
221173
|
+
/** Evaluator for transition. */
|
|
221097
221174
|
_evaluator;
|
|
221098
|
-
/** Total curve arc length (computed) */
|
|
221175
|
+
/** Total curve arc length (computed). */
|
|
221099
221176
|
_arcLength01;
|
|
221100
|
-
/** Curvatures (inverse radii) at start and end */
|
|
221177
|
+
/** Curvatures (inverse radii) at start and end. */
|
|
221101
221178
|
_curvature01;
|
|
221102
|
-
|
|
221103
|
-
//
|
|
221179
|
+
// constructor demands all bearing, radius, and length data.
|
|
221180
|
+
// caller determines usual dependency of "any 4 determine the 5th".
|
|
221104
221181
|
constructor(spiralType, evaluator, radius01, bearing01, activeFractionInterval, localToWorld, arcLength, properties) {
|
|
221105
221182
|
super(spiralType, localToWorld, activeFractionInterval, properties);
|
|
221106
221183
|
this._evaluator = evaluator;
|
|
@@ -221108,29 +221185,32 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
221108
221185
|
this.bearing01 = bearing01;
|
|
221109
221186
|
this._arcLength01 = arcLength;
|
|
221110
221187
|
this._globalStrokes = _LineString3d__WEBPACK_IMPORTED_MODULE_1__.LineString3d.create();
|
|
221111
|
-
// initialize for compiler
|
|
221188
|
+
// initialize for compiler; but this will be recomputed in refreshComputeProperties
|
|
221112
221189
|
this._curvature01 = _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_2__.Segment1d.create(0, 1);
|
|
221113
221190
|
this.refreshComputedProperties();
|
|
221114
221191
|
}
|
|
221115
|
-
/**
|
|
221192
|
+
/** Default spiral type name: clothoid. */
|
|
221116
221193
|
static defaultSpiralType = "clothoid";
|
|
221117
|
-
/**
|
|
221194
|
+
/** Use the integrated function to return an angle at fractional position. */
|
|
221118
221195
|
globalFractionToBearingRadians(fraction) {
|
|
221119
221196
|
const areaFraction = this._evaluator.fractionToArea(fraction);
|
|
221120
221197
|
const dx = this._arcLength01;
|
|
221121
|
-
return this.bearing01.startRadians + areaFraction * dx * this._curvature01.signedDelta()
|
|
221198
|
+
return this.bearing01.startRadians + areaFraction * dx * this._curvature01.signedDelta()
|
|
221199
|
+
+ fraction * this._curvature01.x0 * dx;
|
|
221122
221200
|
}
|
|
221123
|
-
/**
|
|
221201
|
+
/** Use the integrated function to return an angle at fractional position. */
|
|
221124
221202
|
globalFractionToCurvature(fraction) {
|
|
221125
221203
|
const f = this._evaluator.fractionToCurvatureFraction(fraction);
|
|
221126
221204
|
return this._curvature01.fractionToPoint(f);
|
|
221127
221205
|
}
|
|
221128
|
-
/** Return the bearing at given fraction of the active interval
|
|
221206
|
+
/** Return the bearing at given fraction of the active interval. */
|
|
221129
221207
|
fractionToBearingRadians(activeFraction) {
|
|
221130
221208
|
const fraction = this.activeFractionInterval.fractionToPoint(activeFraction);
|
|
221131
|
-
return this.bearing01.startRadians
|
|
221209
|
+
return this.bearing01.startRadians
|
|
221210
|
+
+ fraction * this._arcLength01 * (this._curvature01.x0 + 0.5 * fraction * (this._curvature01.x1 - this._curvature01.x0));
|
|
221132
221211
|
}
|
|
221133
|
-
/**
|
|
221212
|
+
/**
|
|
221213
|
+
* Return the curvature at given fraction of the active interval.
|
|
221134
221214
|
* * The `undefined` result is to match the abstract class -- it cannot actually occur.
|
|
221135
221215
|
*/
|
|
221136
221216
|
fractionToCurvature(activeFraction) {
|
|
@@ -221147,14 +221227,15 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
221147
221227
|
IntegratedSpiral3d._gaussWeight = new Float64Array(5);
|
|
221148
221228
|
IntegratedSpiral3d._gaussMapper = (xA, xB, xMapped, wMapped) => _numerics_Quadrature__WEBPACK_IMPORTED_MODULE_3__.Quadrature.setupGauss5(xA, xB, xMapped, wMapped);
|
|
221149
221229
|
}
|
|
221150
|
-
/**
|
|
221151
|
-
*
|
|
221230
|
+
/**
|
|
221231
|
+
* Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference
|
|
221232
|
+
* length (recall that theta is a nonlinear function of the fraction).
|
|
221152
221233
|
* * This is a single interval of gaussian integration.
|
|
221153
|
-
* * The fraction is on the full spiral (not in the mapped active interval)
|
|
221234
|
+
* * The fraction is on the full spiral (not in the mapped active interval).
|
|
221154
221235
|
* @param xyz advancing integrated point.
|
|
221155
|
-
* @param fractionA fraction at start of interval
|
|
221236
|
+
* @param fractionA fraction at start of interval.
|
|
221156
221237
|
* @param fractionB fraction at end of interval.
|
|
221157
|
-
* @param unitArcLength length of curve for 0 to 1 fractional
|
|
221238
|
+
* @param unitArcLength length of curve for 0 to 1 fractional.
|
|
221158
221239
|
*/
|
|
221159
221240
|
fullSpiralIncrementalIntegral(xyz, fractionA, fractionB, applyMatrix) {
|
|
221160
221241
|
const gaussFraction = IntegratedSpiral3d._gaussFraction;
|
|
@@ -221175,7 +221256,7 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
221175
221256
|
else
|
|
221176
221257
|
xyz.addXYZInPlace(dx, dy, 0.0);
|
|
221177
221258
|
}
|
|
221178
|
-
/** Recompute strokes */
|
|
221259
|
+
/** Recompute strokes. */
|
|
221179
221260
|
refreshComputedProperties() {
|
|
221180
221261
|
this._curvature01 = _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_2__.Segment1d.create(_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.TransitionSpiral3d.radiusToCurvature(this.radius01.x0), _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.TransitionSpiral3d.radiusToCurvature(this.radius01.x1));
|
|
221181
221262
|
this._globalStrokes.clear();
|
|
@@ -221194,8 +221275,9 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
221194
221275
|
if (this._activeStrokes === undefined)
|
|
221195
221276
|
this._activeStrokes = _LineString3d__WEBPACK_IMPORTED_MODULE_1__.LineString3d.create();
|
|
221196
221277
|
this._activeStrokes.clear();
|
|
221197
|
-
// finer strokes
|
|
221198
|
-
//
|
|
221278
|
+
// The active interval has finer strokes: it's the same fraction step but mapped to a sub-interval.
|
|
221279
|
+
// Below assumes fractionToPoint depends upon the global strokes we just computed, and not
|
|
221280
|
+
// on the active strokes we are computing.
|
|
221199
221281
|
for (let i = 0; i <= numInterval; i++) {
|
|
221200
221282
|
const localFraction = i * fractionStep;
|
|
221201
221283
|
this._activeStrokes.addPoint(this.fractionToPoint(localFraction));
|
|
@@ -221204,10 +221286,11 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
221204
221286
|
}
|
|
221205
221287
|
/**
|
|
221206
221288
|
* Create a transition spiral with radius and bearing conditions.
|
|
221207
|
-
* @param radius01 radius (inverse curvature) at start and end
|
|
221208
|
-
* @param bearing01 bearing angles at start and end. bearings are measured from the x axis, positive clockwise
|
|
221289
|
+
* @param radius01 radius (inverse curvature) at start and end (radius of zero means straight line).
|
|
221290
|
+
* @param bearing01 bearing angles at start and end. bearings are measured from the x axis, positive clockwise
|
|
221291
|
+
* towards y axis.
|
|
221209
221292
|
* @param activeFractionInterval fractional limits of the active portion of the spiral.
|
|
221210
|
-
* @param localToWorld placement frame.
|
|
221293
|
+
* @param localToWorld placement frame. Fractional coordinate 0 is at the origin.
|
|
221211
221294
|
*/
|
|
221212
221295
|
static createRadiusRadiusBearingBearing(radius01, bearing01, activeFractionInterval, localToWorld, typeName) {
|
|
221213
221296
|
const arcLength = _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(radius01.x0, radius01.x1, bearing01.sweepRadians);
|
|
@@ -221222,12 +221305,13 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
221222
221305
|
* Create a transition spiral.
|
|
221223
221306
|
* * Inputs must provide exactly 4 of the 5 values `[radius0,radius1,bearing0,bearing1,length`.
|
|
221224
221307
|
* @param spiralType one of "clothoid", "bloss", "biquadratic", "cosine", "sine". If undefined, "clothoid" is used.
|
|
221225
|
-
* @param radius0 radius (or 0 for tangent to line) at start
|
|
221226
|
-
* @param radius1 radius (or 0 for tangent to line) at end
|
|
221308
|
+
* @param radius0 radius (or 0 for tangent to line) at start.
|
|
221309
|
+
* @param radius1 radius (or 0 for tangent to line) at end.
|
|
221227
221310
|
* @param bearing0 bearing, measured CCW from x axis at start.
|
|
221228
221311
|
* @param bearing1 bearing, measured CCW from x axis at end.
|
|
221229
|
-
* @param fractionInterval optional fractional interval for an "active" portion of the curve.
|
|
221230
|
-
*
|
|
221312
|
+
* @param fractionInterval optional fractional interval for an "active" portion of the curve. If omitted, the full
|
|
221313
|
+
* [0,1] is used.
|
|
221314
|
+
* @param localToWorld placement transform.
|
|
221231
221315
|
*/
|
|
221232
221316
|
static createFrom4OutOf5(spiralType, radius0, radius1, bearing0, bearing1, arcLength, fractionInterval, localToWorld) {
|
|
221233
221317
|
if (spiralType === undefined)
|
|
@@ -221254,11 +221338,11 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
221254
221338
|
this._arcLength01 = other._arcLength01;
|
|
221255
221339
|
return this;
|
|
221256
221340
|
}
|
|
221257
|
-
/** Deep clone of this spiral */
|
|
221341
|
+
/** Deep clone of this spiral. */
|
|
221258
221342
|
clone() {
|
|
221259
221343
|
return new IntegratedSpiral3d(this._spiralType, this._evaluator, this.radius01.clone(), this.bearing01.clone(), this.activeFractionInterval.clone(), this.localToWorld.clone(), this._arcLength01, this._designProperties?.clone());
|
|
221260
221344
|
}
|
|
221261
|
-
/**
|
|
221345
|
+
/** Apply `transform` to this spiral's local to world transform. */
|
|
221262
221346
|
tryTransformInPlace(transformA) {
|
|
221263
221347
|
const rigidData = this.applyRigidPartOfTransform(transformA);
|
|
221264
221348
|
if (rigidData !== undefined) {
|
|
@@ -221275,32 +221359,50 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
221275
221359
|
startPoint(result) {
|
|
221276
221360
|
return this.activeStrokes.startPoint(result);
|
|
221277
221361
|
}
|
|
221278
|
-
/**
|
|
221362
|
+
/** Return the spiral end point. */
|
|
221279
221363
|
endPoint(result) {
|
|
221280
221364
|
return this.activeStrokes.endPoint(result);
|
|
221281
221365
|
}
|
|
221282
|
-
/**
|
|
221366
|
+
/** Test if the local to world transform places the spiral xy plane into `plane`. */
|
|
221283
221367
|
isInPlane(plane) {
|
|
221284
221368
|
return plane.isPointInPlane(this.localToWorld.origin)
|
|
221285
221369
|
&& _Geometry__WEBPACK_IMPORTED_MODULE_9__.Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))
|
|
221286
221370
|
&& _Geometry__WEBPACK_IMPORTED_MODULE_9__.Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));
|
|
221287
221371
|
}
|
|
221288
|
-
/**
|
|
221289
|
-
|
|
221290
|
-
|
|
221291
|
-
|
|
221292
|
-
|
|
221372
|
+
/**
|
|
221373
|
+
* Return length of the spiral.
|
|
221374
|
+
* * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.
|
|
221375
|
+
*/
|
|
221376
|
+
quickLength() {
|
|
221377
|
+
return this.curveLength();
|
|
221378
|
+
}
|
|
221379
|
+
/**
|
|
221380
|
+
* Return length of the spiral.
|
|
221381
|
+
* * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.
|
|
221382
|
+
*/
|
|
221383
|
+
curveLength() {
|
|
221384
|
+
return this._arcLength01 * (this._activeFractionInterval.absoluteDelta());
|
|
221385
|
+
}
|
|
221386
|
+
/**
|
|
221387
|
+
* Return (unsigned) length of the spiral between fractions.
|
|
221388
|
+
* * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.
|
|
221389
|
+
*/
|
|
221293
221390
|
curveLengthBetweenFractions(fraction0, fraction1) {
|
|
221294
221391
|
return this._arcLength01 * (this._activeFractionInterval.absoluteDelta() * Math.abs(fraction1 - fraction0));
|
|
221295
221392
|
}
|
|
221296
|
-
/** Test if `other` is an instance of `TransitionSpiral3d
|
|
221297
|
-
isSameGeometryClass(other) {
|
|
221298
|
-
|
|
221393
|
+
/** Test if `other` is an instance of `TransitionSpiral3d`. */
|
|
221394
|
+
isSameGeometryClass(other) {
|
|
221395
|
+
return other instanceof _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.TransitionSpiral3d;
|
|
221396
|
+
}
|
|
221397
|
+
/**
|
|
221398
|
+
* Add strokes from this spiral to `dest`.
|
|
221299
221399
|
* * Linestrings will usually stroke as just their points.
|
|
221300
221400
|
* * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.
|
|
221301
221401
|
*/
|
|
221302
|
-
emitStrokes(dest, options) {
|
|
221303
|
-
|
|
221402
|
+
emitStrokes(dest, options) {
|
|
221403
|
+
this.activeStrokes.emitStrokes(dest, options);
|
|
221404
|
+
}
|
|
221405
|
+
/** Emit stroke fragments to `dest` handler. */
|
|
221304
221406
|
emitStrokableParts(dest, options) {
|
|
221305
221407
|
const n = this.computeStrokeCountForOptions(options);
|
|
221306
221408
|
dest.startParentCurvePrimitive(this);
|
|
@@ -221315,8 +221417,8 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
221315
221417
|
dest.endParentCurvePrimitive(this);
|
|
221316
221418
|
}
|
|
221317
221419
|
/**
|
|
221318
|
-
*
|
|
221319
|
-
* @param options StrokeOptions that determine count
|
|
221420
|
+
* Return the stroke count required for given options.
|
|
221421
|
+
* @param options StrokeOptions that determine count.
|
|
221320
221422
|
*/
|
|
221321
221423
|
computeStrokeCountForOptions(options) {
|
|
221322
221424
|
let numStroke;
|
|
@@ -221331,8 +221433,9 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
221331
221433
|
}
|
|
221332
221434
|
return numStroke;
|
|
221333
221435
|
}
|
|
221334
|
-
/**
|
|
221335
|
-
*
|
|
221436
|
+
/**
|
|
221437
|
+
* Reverse the active interval and active strokes.
|
|
221438
|
+
* * Primary defining data remains unchanged.
|
|
221336
221439
|
*/
|
|
221337
221440
|
reverseInPlace() {
|
|
221338
221441
|
this.activeFractionInterval.reverseInPlace();
|
|
@@ -221370,10 +221473,10 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
221370
221473
|
}
|
|
221371
221474
|
else {
|
|
221372
221475
|
const clampedGlobalFraction = _Geometry__WEBPACK_IMPORTED_MODULE_9__.Geometry.clampToStartEnd(targetGlobalFraction, 0, 1);
|
|
221373
|
-
const index0 = Math.trunc(clampedGlobalFraction * numStrokes); //
|
|
221476
|
+
const index0 = Math.trunc(clampedGlobalFraction * numStrokes); // this indexes the point to the left of the query
|
|
221374
221477
|
const globalFraction0 = index0 / numStrokes;
|
|
221375
221478
|
result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(index0, result);
|
|
221376
|
-
// GeometryCoreTestIO.consoleLog("
|
|
221479
|
+
// GeometryCoreTestIO.consoleLog("fractionToPoint ", activeFraction, this.activeFractionInterval, "( global integration " + globalFraction0 + " to " + globalFraction + ")", index0);
|
|
221377
221480
|
this.fullSpiralIncrementalIntegral(result, globalFraction0, targetGlobalFraction, true);
|
|
221378
221481
|
}
|
|
221379
221482
|
return result;
|
|
@@ -221400,10 +221503,11 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
221400
221503
|
result.matrix.applyGivensColumnOp(0, 1, c, s);
|
|
221401
221504
|
return result;
|
|
221402
221505
|
}
|
|
221403
|
-
/**
|
|
221404
|
-
*
|
|
221405
|
-
* * origin at fractional position along the curve
|
|
221406
|
-
* * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to
|
|
221506
|
+
/**
|
|
221507
|
+
* Return a plane with
|
|
221508
|
+
* * origin at fractional position along the curve.
|
|
221509
|
+
* * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to
|
|
221510
|
+
* the fraction.
|
|
221407
221511
|
* * vectorV is the second derivative, i.e.derivative of vectorU.
|
|
221408
221512
|
*/
|
|
221409
221513
|
fractionToPointAnd2Derivatives(activeFraction, result) {
|
|
@@ -221420,11 +221524,11 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
221420
221524
|
vectorY.scaleInPlace(this.globalFractionToCurvature(globalFraction));
|
|
221421
221525
|
return _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_13__.Plane3dByOriginAndVectors.createCapture(origin, vectorX, vectorY, result);
|
|
221422
221526
|
}
|
|
221423
|
-
/** Second step of double dispatch: call `handler.handleTransitionSpiral(this)
|
|
221527
|
+
/** Second step of double dispatch: call `handler.handleTransitionSpiral(this)`. */
|
|
221424
221528
|
dispatchToGeometryHandler(handler) {
|
|
221425
221529
|
return handler.handleTransitionSpiral(this);
|
|
221426
221530
|
}
|
|
221427
|
-
/**
|
|
221531
|
+
/** Compare various coordinate quantities. */
|
|
221428
221532
|
isAlmostEqual(other) {
|
|
221429
221533
|
if (other instanceof IntegratedSpiral3d) {
|
|
221430
221534
|
return this.radius01.isAlmostEqual(other.radius01)
|
|
@@ -221468,16 +221572,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
221468
221572
|
/**
|
|
221469
221573
|
* MX Cubic along arc.
|
|
221470
221574
|
* This is y= m*x^3 with
|
|
221471
|
-
* * x any point on the x axis
|
|
221472
|
-
* * `fraction` along the spiral goes to `x = fraction * Lx
|
|
221473
|
-
* * m is (1/6RL)
|
|
221575
|
+
* * x any point on the x axis.
|
|
221576
|
+
* * `fraction` along the spiral goes to `x = fraction * Lx`.
|
|
221577
|
+
* * m is (1/6RL).
|
|
221474
221578
|
* * construction length L is nominal along the curve.
|
|
221475
221579
|
* * x length Lx is along the axis, determined by two terms of the clothoid x series.
|
|
221476
|
-
* *
|
|
221477
|
-
* @param localToWorld
|
|
221478
|
-
* @param nominalL1
|
|
221479
|
-
* @param nominalR1
|
|
221480
|
-
* @param activeInterval
|
|
221481
221580
|
* @internal
|
|
221482
221581
|
*/
|
|
221483
221582
|
class MXCubicAlongArcEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.CubicEvaluator {
|
|
@@ -221506,9 +221605,11 @@ class MXCubicAlongArcEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_
|
|
|
221506
221605
|
this.nominalRadius1 *= scaleFactor;
|
|
221507
221606
|
super.scaleInPlace(scaleFactor);
|
|
221508
221607
|
}
|
|
221509
|
-
/**
|
|
221510
|
-
clone() {
|
|
221511
|
-
|
|
221608
|
+
/** Return a deep copy of the evaluator. */
|
|
221609
|
+
clone() {
|
|
221610
|
+
return new MXCubicAlongArcEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM);
|
|
221611
|
+
}
|
|
221612
|
+
/** Member by member matchup. */
|
|
221512
221613
|
isAlmostEqual(other) {
|
|
221513
221614
|
if (other instanceof MXCubicAlongArcEvaluator) {
|
|
221514
221615
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)
|
|
@@ -221519,7 +221620,8 @@ class MXCubicAlongArcEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_
|
|
|
221519
221620
|
/**
|
|
221520
221621
|
* Return a (fast but mediocre) approximation of spiral x position as function of approximate distance along the curve.
|
|
221521
221622
|
* * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.
|
|
221522
|
-
* * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
|
|
221623
|
+
* * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
|
|
221624
|
+
* CurvePrimitive measurements.
|
|
221523
221625
|
* @param x distance along the x axis.
|
|
221524
221626
|
*/
|
|
221525
221627
|
static approximateDistanceAlongToX(nominalLength1, nominalRadius1, nominalDistanceAlong) {
|
|
@@ -221570,7 +221672,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
221570
221672
|
* @internal
|
|
221571
221673
|
*/
|
|
221572
221674
|
class NormalizedTransition {
|
|
221573
|
-
/** Constructor initializes with 0..1 values
|
|
221675
|
+
/** Constructor initializes with 0..1 values. Call "setBearingCurvatureLengthCurvature" to apply real values. */
|
|
221574
221676
|
constructor() { }
|
|
221575
221677
|
static _clothoidEvaluator;
|
|
221576
221678
|
static _biquadraticEvaluator;
|
|
@@ -221611,10 +221713,15 @@ class NormalizedTransition {
|
|
|
221611
221713
|
class NormalizedClothoidTransition extends NormalizedTransition {
|
|
221612
221714
|
constructor() { super(); }
|
|
221613
221715
|
/** At fractional position on the x axis, return the (normalized) curvature fraction. */
|
|
221614
|
-
fractionToCurvatureFraction(fractionX) {
|
|
221615
|
-
|
|
221616
|
-
|
|
221617
|
-
/** Return the
|
|
221716
|
+
fractionToCurvatureFraction(fractionX) {
|
|
221717
|
+
return fractionX;
|
|
221718
|
+
}
|
|
221719
|
+
/** Return the derivative of the (normalized) curvature fraction. */
|
|
221720
|
+
fractionToCurvatureFractionDerivative(_u) {
|
|
221721
|
+
return 1.0;
|
|
221722
|
+
}
|
|
221723
|
+
/**
|
|
221724
|
+
* Return the integrated area under the curve.
|
|
221618
221725
|
* * This fraction is the angular change fraction.
|
|
221619
221726
|
*/
|
|
221620
221727
|
fractionToArea(fractionX) {
|
|
@@ -221623,24 +221730,27 @@ class NormalizedClothoidTransition extends NormalizedTransition {
|
|
|
221623
221730
|
}
|
|
221624
221731
|
/**
|
|
221625
221732
|
* Transition functions for bloss spiral.
|
|
221626
|
-
* * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1
|
|
221733
|
+
* * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1.
|
|
221627
221734
|
* @internal
|
|
221628
221735
|
*/
|
|
221629
221736
|
class NormalizedBlossTransition extends NormalizedTransition {
|
|
221630
221737
|
// bloss curve is (3 - 2x) x ^2 = 3 x^2 - 2 x^3
|
|
221631
|
-
//
|
|
221632
|
-
//
|
|
221633
|
-
//
|
|
221634
|
-
//
|
|
221635
|
-
//
|
|
221738
|
+
// derivative 6x (1-x)
|
|
221739
|
+
// 2nd derivative 6 - 12 x
|
|
221740
|
+
// derivatives zero at 0,1
|
|
221741
|
+
// inflection zero at 0.5
|
|
221742
|
+
// integral is x^3 - x^4 / 2 = x^3 ( 1-x/2)
|
|
221636
221743
|
constructor() { super(); }
|
|
221637
221744
|
/** At fractional position on the x axis, return the (normalized) curvature fraction. */
|
|
221638
|
-
fractionToCurvatureFraction(u) {
|
|
221639
|
-
|
|
221745
|
+
fractionToCurvatureFraction(u) {
|
|
221746
|
+
return u * u * (3 - 2 * u);
|
|
221747
|
+
}
|
|
221748
|
+
/** Return the derivative of the (normalized) curvature fraction. */
|
|
221640
221749
|
fractionToCurvatureFractionDerivative(u) {
|
|
221641
221750
|
return 6.0 * u * (1.0 - u);
|
|
221642
221751
|
}
|
|
221643
|
-
/**
|
|
221752
|
+
/**
|
|
221753
|
+
* Return the integrated area under the curve.
|
|
221644
221754
|
* * This fraction is the angular change fraction.
|
|
221645
221755
|
*/
|
|
221646
221756
|
fractionToArea(u) {
|
|
@@ -221648,31 +221758,41 @@ class NormalizedBlossTransition extends NormalizedTransition {
|
|
|
221648
221758
|
}
|
|
221649
221759
|
}
|
|
221650
221760
|
/**
|
|
221651
|
-
* Transition functions for biquadratic transition
|
|
221761
|
+
* Transition functions for biquadratic transition.
|
|
221652
221762
|
* * Curvature is a pair of joining quadratics.
|
|
221653
|
-
* * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin
|
|
221654
|
-
* * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1
|
|
221763
|
+
* * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin.
|
|
221764
|
+
* * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1.
|
|
221655
221765
|
* @internal
|
|
221656
221766
|
*/
|
|
221657
221767
|
class NormalizedBiQuadraticTransition extends NormalizedTransition {
|
|
221658
|
-
constructor() {
|
|
221659
|
-
|
|
221660
|
-
|
|
221661
|
-
|
|
221662
|
-
|
|
221663
|
-
|
|
221664
|
-
|
|
221665
|
-
|
|
221666
|
-
|
|
221768
|
+
constructor() {
|
|
221769
|
+
super();
|
|
221770
|
+
}
|
|
221771
|
+
integratedBasis(u) {
|
|
221772
|
+
return u * u * u * (2.0 / 3.0);
|
|
221773
|
+
}
|
|
221774
|
+
basis(u) {
|
|
221775
|
+
return 2 * u * u;
|
|
221776
|
+
}
|
|
221777
|
+
basisDerivative(u) {
|
|
221778
|
+
return 4 * u;
|
|
221779
|
+
}
|
|
221780
|
+
/**
|
|
221781
|
+
* At fractional position on the x axis, return the (normalized) curvature fraction.
|
|
221782
|
+
* * For [u <= 0.5, u >= 0.5]
|
|
221783
|
+
* * f(u) = [2 u^2, 1 - 2 (1-u)^2]
|
|
221784
|
+
* * f'(u) = [4 u, 4 (1-u)]
|
|
221785
|
+
* * If(u) = [2 u^3 / 3, 0.5 (1 -u )^3/3]
|
|
221667
221786
|
*/
|
|
221668
221787
|
fractionToCurvatureFraction(u) {
|
|
221669
221788
|
return u <= 0.5 ? this.basis(u) : 1.0 - this.basis(1.0 - u);
|
|
221670
221789
|
}
|
|
221671
|
-
/** Return the derivative of the (normalized) curvature fraction */
|
|
221790
|
+
/** Return the derivative of the (normalized) curvature fraction. */
|
|
221672
221791
|
fractionToCurvatureFractionDerivative(u) {
|
|
221673
221792
|
return u < 0.5 ? this.basisDerivative(u) : this.basisDerivative(1 - u);
|
|
221674
221793
|
}
|
|
221675
|
-
/**
|
|
221794
|
+
/**
|
|
221795
|
+
* Return the integrated area under the curve.
|
|
221676
221796
|
* * This fraction is the angular change fraction.
|
|
221677
221797
|
*/
|
|
221678
221798
|
fractionToArea(u) {
|
|
@@ -221683,10 +221803,10 @@ class NormalizedBiQuadraticTransition extends NormalizedTransition {
|
|
|
221683
221803
|
}
|
|
221684
221804
|
}
|
|
221685
221805
|
/**
|
|
221686
|
-
* Transition functions for sine transition
|
|
221806
|
+
* Transition functions for sine transition.
|
|
221687
221807
|
* * curvature variation is the sum of
|
|
221688
|
-
* * straight line from (0,0) to (1,1), like clothoid
|
|
221689
|
-
* * additional full period of a sine wave, producing 0 slope at both ends
|
|
221808
|
+
* * straight line from (0,0) to (1,1), like clothoid.
|
|
221809
|
+
* * additional full period of a sine wave, producing 0 slope at both ends.
|
|
221690
221810
|
* @internal
|
|
221691
221811
|
*/
|
|
221692
221812
|
class NormalizedSineTransition extends NormalizedTransition {
|
|
@@ -221696,7 +221816,7 @@ class NormalizedSineTransition extends NormalizedTransition {
|
|
|
221696
221816
|
const a = 2.0 * Math.PI;
|
|
221697
221817
|
return u - Math.sin(u * a) / a;
|
|
221698
221818
|
}
|
|
221699
|
-
/** Return the derivative of the (normalized) curvature fraction */
|
|
221819
|
+
/** Return the derivative of the (normalized) curvature fraction. */
|
|
221700
221820
|
fractionToCurvatureFractionDerivative(u) {
|
|
221701
221821
|
const a = 2.0 * Math.PI;
|
|
221702
221822
|
return 1 - Math.cos(u * a);
|
|
@@ -221710,8 +221830,8 @@ class NormalizedSineTransition extends NormalizedTransition {
|
|
|
221710
221830
|
}
|
|
221711
221831
|
}
|
|
221712
221832
|
/**
|
|
221713
|
-
* Transition functions for cosine
|
|
221714
|
-
* * curvature variation is a half period of a cosine
|
|
221833
|
+
* Transition functions for cosine.
|
|
221834
|
+
* * curvature variation is a half period of a cosine.
|
|
221715
221835
|
* @internal
|
|
221716
221836
|
*/
|
|
221717
221837
|
class NormalizedCosineTransition extends NormalizedTransition {
|
|
@@ -221721,7 +221841,7 @@ class NormalizedCosineTransition extends NormalizedTransition {
|
|
|
221721
221841
|
const a = Math.PI;
|
|
221722
221842
|
return 0.5 * (1 - Math.cos(u * a));
|
|
221723
221843
|
}
|
|
221724
|
-
/** Return the derivative of the (normalized) curvature fraction */
|
|
221844
|
+
/** Return the derivative of the (normalized) curvature fraction. */
|
|
221725
221845
|
fractionToCurvatureFractionDerivative(u) {
|
|
221726
221846
|
const a = Math.PI;
|
|
221727
221847
|
return 0.5 * a * Math.sin(u * a);
|
|
@@ -221766,14 +221886,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
221766
221886
|
* Polish Cubic.
|
|
221767
221887
|
* * Construction takes nominal length and end radius.
|
|
221768
221888
|
* curve is is y= m*x^3 with
|
|
221769
|
-
* * x any point on the x axis
|
|
221770
|
-
* * m is (1/6RL)
|
|
221771
|
-
* * Lx = x length is along the axis, determined by inversion of a distance series at nominal length
|
|
221772
|
-
* *
|
|
221773
|
-
* @param localToWorld
|
|
221774
|
-
* @param nominalL1
|
|
221775
|
-
* @param nominalR1
|
|
221776
|
-
* @param activeInterval
|
|
221889
|
+
* * x any point on the x axis.
|
|
221890
|
+
* * m is (1/6RL).
|
|
221891
|
+
* * Lx = x length is along the axis, determined by inversion of a distance series at nominal length.
|
|
221777
221892
|
* @internal
|
|
221778
221893
|
*/
|
|
221779
221894
|
class PolishCubicEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.CubicEvaluator {
|
|
@@ -221803,9 +221918,11 @@ class PolishCubicEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
221803
221918
|
this.nominalRadius1 *= scaleFactor;
|
|
221804
221919
|
super.scaleInPlace(scaleFactor);
|
|
221805
221920
|
}
|
|
221806
|
-
/**
|
|
221807
|
-
clone() {
|
|
221808
|
-
|
|
221921
|
+
/** Return a deep copy of the evaluator. */
|
|
221922
|
+
clone() {
|
|
221923
|
+
return new PolishCubicEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM);
|
|
221924
|
+
}
|
|
221925
|
+
/** Member by member matchup. */
|
|
221809
221926
|
isAlmostEqual(other) {
|
|
221810
221927
|
if (other instanceof PolishCubicEvaluator) {
|
|
221811
221928
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)
|
|
@@ -221813,15 +221930,15 @@ class PolishCubicEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
221813
221930
|
}
|
|
221814
221931
|
return false;
|
|
221815
221932
|
}
|
|
221816
|
-
/** Compute the coefficient of x^4 in the x-to-distance series expansion */
|
|
221933
|
+
/** Compute the coefficient of x^4 in the x-to-distance series expansion. */
|
|
221817
221934
|
static computeX4SeriesCoefficient(length1, radius1) {
|
|
221818
221935
|
return 1.0 / (4.0 * length1 * length1 * radius1 * radius1);
|
|
221819
221936
|
}
|
|
221820
221937
|
/**
|
|
221821
221938
|
* Evaluate a series approximation of distance along the true curve.
|
|
221822
|
-
* @param x distance along x axis
|
|
221823
|
-
* @param radius1 nominal end radius
|
|
221824
|
-
* @param length1 nominal length along curve
|
|
221939
|
+
* @param x distance along x axis.
|
|
221940
|
+
* @param radius1 nominal end radius.
|
|
221941
|
+
* @param length1 nominal length along curve.
|
|
221825
221942
|
* @returns
|
|
221826
221943
|
*/
|
|
221827
221944
|
static xToApproximateDistance(x, radius1, length1) {
|
|
@@ -221835,9 +221952,9 @@ class PolishCubicEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
221835
221952
|
}
|
|
221836
221953
|
/**
|
|
221837
221954
|
* Evaluate the derivative of the x-to-distance series.
|
|
221838
|
-
* @param x distance along x axis
|
|
221839
|
-
* @param radius1 nominal end radius
|
|
221840
|
-
* @param length1 nominal length along curve
|
|
221955
|
+
* @param x distance along x axis.
|
|
221956
|
+
* @param radius1 nominal end radius.
|
|
221957
|
+
* @param length1 nominal length along curve.
|
|
221841
221958
|
* @returns
|
|
221842
221959
|
*/
|
|
221843
221960
|
static xToApproximateDistanceDerivative(x, radius1, length1) {
|
|
@@ -221846,13 +221963,13 @@ class PolishCubicEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
221846
221963
|
const ax2 = a4 * x * x;
|
|
221847
221964
|
const ax3 = ax2 * x;
|
|
221848
221965
|
const ax4 = ax3 * x;
|
|
221849
|
-
// derivative notes
|
|
221966
|
+
// derivative notes:
|
|
221850
221967
|
// take away leading x -- this reduces each power by 1
|
|
221851
221968
|
// multiply each coefficient by its original power:
|
|
221852
|
-
//
|
|
221853
|
-
// 1/72==>
|
|
221854
|
-
// 1/208==>13/208=1/16
|
|
221855
|
-
// 1/2176==>17/2176= 1/128
|
|
221969
|
+
// 0.1 ==> 0.5
|
|
221970
|
+
// 1/72 ==> 9/72 = 1/8
|
|
221971
|
+
// 1/208 ==> 13/208 = 1/16
|
|
221972
|
+
// 1/2176 ==> 17/2176 = 1/128
|
|
221856
221973
|
const ds = (1.0 + ax4 * (0.5 + ax4 * (-1.0 / 8.0 + ax4 * (1.0 / 16.0 - 5.0 * ax4 / 128.0))));
|
|
221857
221974
|
return ds;
|
|
221858
221975
|
}
|
|
@@ -221890,36 +222007,37 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
221890
222007
|
|
|
221891
222008
|
|
|
221892
222009
|
|
|
221893
|
-
|
|
221894
|
-
|
|
222010
|
+
/**
|
|
222011
|
+
* A true transition spiral is a curve defined by its curvature, with the curvature function symmetric about midpoint.
|
|
221895
222012
|
* * The symmetry condition creates a relationship among the following 4 quantities:
|
|
221896
222013
|
* ** curvature0 = curvature (i.e. 1/radius) at start
|
|
221897
222014
|
* ** curvature1 = curvature (i.e. 1/radius) at end
|
|
221898
222015
|
* ** sweepRadians = signed turning angle from start to end
|
|
221899
222016
|
* ** arcLength = length of curve
|
|
221900
|
-
* * The relationship is the equation
|
|
222017
|
+
* * The relationship is the equation:
|
|
221901
222018
|
* ** `sweepRadians = arcLength * average Curvature = arcLength * 0.5 * (curvature0 + curvature1)`
|
|
221902
|
-
* * That is, regardless of any curvature properties other than symmetry, specifying any 3 of the quantities fully
|
|
222019
|
+
* * That is, regardless of any curvature properties other than symmetry, specifying any 3 of the quantities fully
|
|
222020
|
+
* determines the remaining one.
|
|
221903
222021
|
* @public
|
|
221904
222022
|
*/
|
|
221905
222023
|
class TransitionConditionalProperties {
|
|
221906
|
-
/**
|
|
222024
|
+
/** Radius (or 0 at start). */
|
|
221907
222025
|
radius0;
|
|
221908
|
-
/**
|
|
222026
|
+
/** Radius (or 0) at end. */
|
|
221909
222027
|
radius1;
|
|
221910
|
-
/**
|
|
222028
|
+
/** Bearing at start, measured from x towards y. */
|
|
221911
222029
|
bearing0;
|
|
221912
|
-
/**
|
|
222030
|
+
/** Bearing at end, measured from x towards y. */
|
|
221913
222031
|
bearing1;
|
|
221914
|
-
/**
|
|
222032
|
+
/** Curve length. */
|
|
221915
222033
|
curveLength;
|
|
221916
222034
|
/**
|
|
221917
|
-
*
|
|
221918
|
-
* @param radius0 start radius or undefined
|
|
221919
|
-
* @param radius1 end radius or undefined
|
|
221920
|
-
* @param bearing0 start bearing or undefined
|
|
221921
|
-
* @param bearing1 end bearing or undefined
|
|
221922
|
-
* @param arcLength arc length or undefined
|
|
222035
|
+
* Capture numeric or undefined values.
|
|
222036
|
+
* @param radius0 start radius or undefined.
|
|
222037
|
+
* @param radius1 end radius or undefined.
|
|
222038
|
+
* @param bearing0 start bearing or undefined.
|
|
222039
|
+
* @param bearing1 end bearing or undefined.
|
|
222040
|
+
* @param arcLength arc length or undefined.
|
|
221923
222041
|
*/
|
|
221924
222042
|
constructor(radius0, radius1, bearing0, bearing1, arcLength) {
|
|
221925
222043
|
this.radius0 = radius0;
|
|
@@ -221928,7 +222046,7 @@ class TransitionConditionalProperties {
|
|
|
221928
222046
|
this.bearing1 = bearing1;
|
|
221929
222047
|
this.curveLength = arcLength;
|
|
221930
222048
|
}
|
|
221931
|
-
/**
|
|
222049
|
+
/** Return the number of defined values among the 5 properties. */
|
|
221932
222050
|
numDefinedProperties() {
|
|
221933
222051
|
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.defined01(this.radius0)
|
|
221934
222052
|
+ _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.defined01(this.radius1)
|
|
@@ -221936,21 +222054,22 @@ class TransitionConditionalProperties {
|
|
|
221936
222054
|
+ _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.defined01(this.bearing1)
|
|
221937
222055
|
+ _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.defined01(this.curveLength);
|
|
221938
222056
|
}
|
|
221939
|
-
/**
|
|
222057
|
+
/** Clone with all 5 properties (i.e., preserve undefined states). */
|
|
221940
222058
|
clone() {
|
|
221941
222059
|
return new TransitionConditionalProperties(this.radius0, this.radius1, this.bearing0 === undefined ? undefined : this.bearing0.clone(), this.bearing1 === undefined ? undefined : this.bearing1.clone(), this.curveLength);
|
|
221942
222060
|
}
|
|
221943
|
-
/** Return true if all
|
|
222061
|
+
/** Return true if all 5 properties are defined and agree equationally. */
|
|
221944
222062
|
getIsValidCompleteSet() {
|
|
221945
222063
|
if (this.curveLength !== undefined && this.bearing0 !== undefined && this.bearing1 !== undefined
|
|
221946
222064
|
&& this.radius0 !== undefined && this.radius1 !== undefined) {
|
|
221947
|
-
const
|
|
221948
|
-
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.curveLength,
|
|
222065
|
+
const arcLength = _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_1__.TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(this.radius0, this.radius1, this.bearing1.radians - this.bearing0.radians);
|
|
222066
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.curveLength, arcLength);
|
|
221949
222067
|
}
|
|
221950
222068
|
return false;
|
|
221951
222069
|
}
|
|
221952
|
-
/**
|
|
221953
|
-
*
|
|
222070
|
+
/**
|
|
222071
|
+
* Examine which properties are defined and compute the (single) undefined.
|
|
222072
|
+
* @returns true if the input state had precisely one undefined member.
|
|
221954
222073
|
*/
|
|
221955
222074
|
tryResolveAnySingleUnknown() {
|
|
221956
222075
|
if (this.getIsValidCompleteSet())
|
|
@@ -221971,15 +222090,17 @@ class TransitionConditionalProperties {
|
|
|
221971
222090
|
}
|
|
221972
222091
|
return false;
|
|
221973
222092
|
}
|
|
221974
|
-
// at least one bearing is undefined
|
|
222093
|
+
// at least one bearing is undefined
|
|
221975
222094
|
if (this.curveLength === undefined || this.radius0 === undefined || this.radius1 === undefined)
|
|
221976
222095
|
return false;
|
|
221977
222096
|
if (this.bearing0) { // bearing 1 is undefined
|
|
221978
|
-
this.bearing1 = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(this.bearing0.radians +
|
|
222097
|
+
this.bearing1 = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(this.bearing0.radians +
|
|
222098
|
+
_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_1__.TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength));
|
|
221979
222099
|
return true;
|
|
221980
222100
|
}
|
|
221981
222101
|
if (this.bearing1) { // bearing 0 is undefined
|
|
221982
|
-
this.bearing0 = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(this.bearing1.radians -
|
|
222102
|
+
this.bearing0 = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(this.bearing1.radians -
|
|
222103
|
+
_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_1__.TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength));
|
|
221983
222104
|
return true;
|
|
221984
222105
|
}
|
|
221985
222106
|
return false;
|
|
@@ -221998,9 +222119,7 @@ class TransitionConditionalProperties {
|
|
|
221998
222119
|
return a.isAlmostEqualNoPeriodShift(b);
|
|
221999
222120
|
return false;
|
|
222000
222121
|
}
|
|
222001
|
-
/**
|
|
222002
|
-
* Test if this and other have matching numeric and undefined members.
|
|
222003
|
-
*/
|
|
222122
|
+
/** Test if `this` and `other` have matching numeric and undefined members. */
|
|
222004
222123
|
isAlmostEqual(other) {
|
|
222005
222124
|
if (!other)
|
|
222006
222125
|
return false;
|
|
@@ -222016,8 +222135,10 @@ class TransitionConditionalProperties {
|
|
|
222016
222135
|
return false;
|
|
222017
222136
|
return true;
|
|
222018
222137
|
}
|
|
222019
|
-
/** Apply a NONZERO scale factor to all distances. */
|
|
222138
|
+
/** Apply a NONZERO scale factor to all distances. If `a` is zero, do nothing. */
|
|
222020
222139
|
applyScaleFactor(a) {
|
|
222140
|
+
if (a === 0)
|
|
222141
|
+
return;
|
|
222021
222142
|
if (this.radius0 !== undefined)
|
|
222022
222143
|
this.radius0 *= a;
|
|
222023
222144
|
if (this.radius1 !== undefined)
|
|
@@ -222025,6 +222146,7 @@ class TransitionConditionalProperties {
|
|
|
222025
222146
|
if (this.curveLength !== undefined)
|
|
222026
222147
|
this.curveLength *= a;
|
|
222027
222148
|
}
|
|
222149
|
+
/** Test if `a` and `b` have matching numeric and undefined members. */
|
|
222028
222150
|
static areAlmostEqual(a, b) {
|
|
222029
222151
|
if (a === undefined)
|
|
222030
222152
|
return b === undefined;
|
|
@@ -222069,31 +222191,38 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
222069
222191
|
/**
|
|
222070
222192
|
* TransitionSpiral3d is a base class for multiple variants of spirals.
|
|
222071
222193
|
* * The menagerie of spiral types have 2 broad categories:
|
|
222072
|
-
* * IntegratedSpiral3d -- a spiral whose direct function for curvature versus distance must be integrated to
|
|
222073
|
-
*
|
|
222194
|
+
* * IntegratedSpiral3d -- a spiral whose direct function for curvature versus distance must be integrated to
|
|
222195
|
+
* determine x,y.
|
|
222196
|
+
* * The IntegratedSpiral3d types are enumerated in `IntegratedSpiralTypes`.
|
|
222074
222197
|
* * DirectSpiral3d -- a spiral implemented with direct calculation of x,y from fractional position along the spiral.
|
|
222075
|
-
* * The direct spiral types are enumerated in the `DirectSpiralType
|
|
222076
|
-
* * The method set for CurvePrimitive support includes a `handleTransitionSpiral(g: TransitionSpiral3d)` which receives
|
|
222198
|
+
* * The direct spiral types are enumerated in the `DirectSpiralType`.
|
|
222199
|
+
* * The method set for CurvePrimitive support includes a `handleTransitionSpiral(g: TransitionSpiral3d)` which receives
|
|
222200
|
+
* all the spiral types.
|
|
222077
222201
|
* * The spiral class may impose expectations that its inflection is at the origin, with tangent along the x axis.
|
|
222078
222202
|
* * This is generally necessary for direct spirals.
|
|
222079
222203
|
* * This is not necessary for integrated spirals.
|
|
222080
222204
|
* @public
|
|
222081
222205
|
*/
|
|
222082
222206
|
class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePrimitive {
|
|
222083
|
-
/**
|
|
222207
|
+
/** String name of spiral type. */
|
|
222084
222208
|
_spiralType;
|
|
222085
222209
|
/** Original defining properties. */
|
|
222086
222210
|
_designProperties;
|
|
222087
|
-
/**
|
|
222088
|
-
|
|
222211
|
+
/** Placement transform. */
|
|
222212
|
+
_localToWorld;
|
|
222213
|
+
/**
|
|
222214
|
+
* Fractional interval for the "active" part of a containing spiral.
|
|
222215
|
+
* (the radius, angle, and length conditions define a complete spiral, and some portion of it is "active")
|
|
222089
222216
|
*/
|
|
222090
222217
|
_activeFractionInterval;
|
|
222091
222218
|
/** Return (reference to) the active portion of the reference spiral. */
|
|
222092
|
-
get activeFractionInterval() {
|
|
222093
|
-
|
|
222094
|
-
|
|
222095
|
-
/** (
|
|
222096
|
-
get localToWorld() {
|
|
222219
|
+
get activeFractionInterval() {
|
|
222220
|
+
return this._activeFractionInterval;
|
|
222221
|
+
}
|
|
222222
|
+
/** (Reference to) placement transform. */
|
|
222223
|
+
get localToWorld() {
|
|
222224
|
+
return this._localToWorld;
|
|
222225
|
+
}
|
|
222097
222226
|
constructor(spiralType, localToWorld, activeFractionInterval, designProperties) {
|
|
222098
222227
|
super();
|
|
222099
222228
|
this._spiralType = spiralType ? spiralType : "unknownSpiralType";
|
|
@@ -222101,10 +222230,14 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
222101
222230
|
this._localToWorld = localToWorld;
|
|
222102
222231
|
this._activeFractionInterval = activeFractionInterval ? activeFractionInterval : _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_1__.Segment1d.create(0, 1);
|
|
222103
222232
|
}
|
|
222104
|
-
get spiralType() {
|
|
222105
|
-
|
|
222106
|
-
|
|
222107
|
-
/** Return 1/
|
|
222233
|
+
get spiralType() {
|
|
222234
|
+
return this._spiralType;
|
|
222235
|
+
}
|
|
222236
|
+
/** Return 1/r with convention that exact zero input returns 0 (straight line, zero curvature, infinite radius). */
|
|
222237
|
+
static radiusToCurvature(radius) {
|
|
222238
|
+
return (radius === 0.0) ? 0.0 : 1.0 / radius;
|
|
222239
|
+
}
|
|
222240
|
+
/** Return 1/k with convention that near-zero input returns 0 (straight line, zero curvature, infinite radius). */
|
|
222108
222241
|
static curvatureToRadius(curvature) {
|
|
222109
222242
|
if (Math.abs(curvature) < _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallAngleRadians)
|
|
222110
222243
|
return 0.0;
|
|
@@ -222119,10 +222252,10 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
222119
222252
|
spiralB.refreshComputedProperties();
|
|
222120
222253
|
return spiralB;
|
|
222121
222254
|
}
|
|
222122
|
-
/** Clone with a transform applied */
|
|
222255
|
+
/** Clone with a transform applied. */
|
|
222123
222256
|
cloneTransformed(transform) {
|
|
222124
222257
|
const result = this.clone();
|
|
222125
|
-
result.tryTransformInPlace(transform); //
|
|
222258
|
+
result.tryTransformInPlace(transform); // we're confident it will always work
|
|
222126
222259
|
return result;
|
|
222127
222260
|
}
|
|
222128
222261
|
/** Return the average of the start and end curvatures. */
|
|
@@ -222130,17 +222263,18 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
222130
222263
|
return 0.5 * (TransitionSpiral3d.radiusToCurvature(radiusLimits.x0) + TransitionSpiral3d.radiusToCurvature(radiusLimits.x1));
|
|
222131
222264
|
}
|
|
222132
222265
|
/**
|
|
222133
|
-
* Given two radii (or zeros for 0 curvature) return the average curvature
|
|
222134
|
-
* @param r0 start radius, or 0 for line
|
|
222135
|
-
* @param r1 end radius, or 0 for line
|
|
222266
|
+
* Given two radii (or zeros for 0 curvature) return the average curvature.
|
|
222267
|
+
* @param r0 start radius, or 0 for line.
|
|
222268
|
+
* @param r1 end radius, or 0 for line.
|
|
222136
222269
|
*/
|
|
222137
222270
|
static averageCurvatureR0R1(r0, r1) {
|
|
222138
222271
|
return 0.5 * (TransitionSpiral3d.radiusToCurvature(r0) + TransitionSpiral3d.radiusToCurvature(r1));
|
|
222139
222272
|
}
|
|
222140
222273
|
/**
|
|
222141
|
-
* Given two radii (or zeros for 0 curvature) return the
|
|
222142
|
-
* @param r0 start radius, or 0 for line
|
|
222143
|
-
* @param
|
|
222274
|
+
* Given two radii (or zeros for 0 curvature) return the curvature at the given fraction.
|
|
222275
|
+
* @param r0 start radius, or 0 for line.
|
|
222276
|
+
* @param fraction fractional position between the curvatures defined by r0 and r1.
|
|
222277
|
+
* @param r1 end radius, or 0 for line.
|
|
222144
222278
|
*/
|
|
222145
222279
|
static interpolateCurvatureR0R1(r0, fraction, r1) {
|
|
222146
222280
|
return _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(TransitionSpiral3d.radiusToCurvature(r0), fraction, TransitionSpiral3d.radiusToCurvature(r1));
|
|
@@ -222162,9 +222296,12 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
222162
222296
|
return TransitionSpiral3d.curvatureToRadius((2.0 * sweepRadians / arcLength) - TransitionSpiral3d.radiusToCurvature(radius1));
|
|
222163
222297
|
}
|
|
222164
222298
|
/** Return the original defining properties (if any) saved by the constructor. */
|
|
222165
|
-
get designProperties() {
|
|
222299
|
+
get designProperties() {
|
|
222300
|
+
return this._designProperties;
|
|
222301
|
+
}
|
|
222166
222302
|
/**
|
|
222167
|
-
* * If transformA is rigid with uniform scale, apply the rigid part of transformA to the localToWorld transform and
|
|
222303
|
+
* * If transformA is rigid with uniform scale, apply the rigid part of transformA to the localToWorld transform and
|
|
222304
|
+
* return the scale and rigid separation.
|
|
222168
222305
|
* * If not rigid, do nothing and return undefined.
|
|
222169
222306
|
* * Also apply the scale factor to the designProperties.
|
|
222170
222307
|
* @param transformA
|
|
@@ -222173,9 +222310,9 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
222173
222310
|
const rigidData = transformA.matrix.factorRigidWithSignedScale();
|
|
222174
222311
|
if (rigidData !== undefined) {
|
|
222175
222312
|
// [sQ a][R b] = [sQ*R sQb+a]
|
|
222176
|
-
// but we save it as [Q*R sQb+a] with spiral data scaled by s
|
|
222313
|
+
// but we save it as [Q*R sQb+a] with spiral data scaled by s
|
|
222177
222314
|
const transformC0 = transformA.multiplyTransformTransform(this.localToWorld);
|
|
222178
|
-
//
|
|
222315
|
+
// but pull the scale part out of the matrix
|
|
222179
222316
|
const matrixC = rigidData.rigidAxes.multiplyMatrixMatrix(this.localToWorld.matrix);
|
|
222180
222317
|
this._localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_3__.Transform.createOriginAndMatrix(transformC0.origin, matrixC);
|
|
222181
222318
|
if (this.designProperties)
|
|
@@ -222186,9 +222323,9 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
222186
222323
|
}
|
|
222187
222324
|
/**
|
|
222188
222325
|
* Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).
|
|
222189
|
-
* * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset
|
|
222190
|
-
*
|
|
222191
|
-
* @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object
|
|
222326
|
+
* * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset for an
|
|
222327
|
+
* aggregate instance (e.g., LineString3d, CurveChainWithDistanceIndex), use RegionOps.constructCurveXYOffset() instead.
|
|
222328
|
+
* @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object.
|
|
222192
222329
|
*/
|
|
222193
222330
|
constructOffsetXY(offsetDistanceOrOptions) {
|
|
222194
222331
|
const options = _OffsetOptions__WEBPACK_IMPORTED_MODULE_4__.OffsetOptions.create(offsetDistanceOrOptions);
|
|
@@ -222196,13 +222333,13 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
222196
222333
|
this.emitStrokableParts(handler, options.strokeOptions);
|
|
222197
222334
|
return handler.claimResult();
|
|
222198
222335
|
}
|
|
222199
|
-
/**
|
|
222336
|
+
/** Extend the range by the strokes of the spiral. */
|
|
222200
222337
|
extendRange(rangeToExtend, transform) {
|
|
222201
|
-
|
|
222202
|
-
rangeToExtend.extendRange(myRange);
|
|
222338
|
+
rangeToExtend.extendRange(this.rangeBetweenFractions(0.0, 1.0, transform));
|
|
222203
222339
|
}
|
|
222204
|
-
/**
|
|
222205
|
-
*
|
|
222340
|
+
/**
|
|
222341
|
+
* Return the range of spiral between fractions of the activeStrokes.
|
|
222342
|
+
* * Use activeStrokes point count times interval factor for initial evaluation count, but do at least 5.
|
|
222206
222343
|
*/
|
|
222207
222344
|
rangeBetweenFractions(fractionA, fractionB, transform) {
|
|
222208
222345
|
const strokes = this.activeStrokes;
|
|
@@ -222212,10 +222349,13 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
222212
222349
|
count = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.clamp(5, count, 30);
|
|
222213
222350
|
return this.rangeBetweenFractionsByCount(fractionA, fractionB, count, transform, 0.5);
|
|
222214
222351
|
}
|
|
222215
|
-
/**
|
|
222352
|
+
/**
|
|
222353
|
+
* Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of
|
|
222354
|
+
* projection.
|
|
222216
222355
|
* @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.
|
|
222217
222356
|
* @param lowHigh optional receiver for output
|
|
222218
|
-
* @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the
|
|
222357
|
+
* @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the
|
|
222358
|
+
* end of the ray.
|
|
222219
222359
|
*/
|
|
222220
222360
|
projectedParameterRange(ray, lowHigh) {
|
|
222221
222361
|
return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_7__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
|
|
@@ -222259,8 +222399,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
222259
222399
|
* XYCurveEvaluator is an abstract with methods for evaluating X and Y parts of a curve parameterized by a fraction.
|
|
222260
222400
|
* * The required methods call for independent X and Y evaluation.
|
|
222261
222401
|
* * Base class methods package those (multiple) calls into point, ray, and plane structures.
|
|
222262
|
-
* *
|
|
222263
|
-
*
|
|
222402
|
+
* * An implementation that has evaluation substantial cost that can be shared among x,y parts or between
|
|
222403
|
+
* primary functions and derivatives might choose to implement the point and derivative methods directly.
|
|
222264
222404
|
* @internal
|
|
222265
222405
|
*/
|
|
222266
222406
|
class XYCurveEvaluator {
|
|
@@ -222268,11 +222408,17 @@ class XYCurveEvaluator {
|
|
|
222268
222408
|
fractionToPoint(fraction, result) {
|
|
222269
222409
|
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create(this.fractionToX(fraction), this.fractionToY(fraction), 0.0, result);
|
|
222270
222410
|
}
|
|
222271
|
-
/**
|
|
222411
|
+
/**
|
|
222412
|
+
* Evaluate both X and Y and their first derivatives at fractional coordinate, return bundled as origin and
|
|
222413
|
+
* (non-unit) direction vector.
|
|
222414
|
+
*/
|
|
222272
222415
|
fractionToPointAndDerivative(fraction, result) {
|
|
222273
222416
|
return _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_1__.Ray3d.createXYZUVW(this.fractionToX(fraction), this.fractionToY(fraction), 0.0, this.fractionToDX(fraction), this.fractionToDY(fraction), 0, result);
|
|
222274
222417
|
}
|
|
222275
|
-
/**
|
|
222418
|
+
/**
|
|
222419
|
+
* Evaluate both X and Y and their second derivatives at fractional coordinate, return bundled as origin and
|
|
222420
|
+
* (non-unit) vectorU an vectorV.
|
|
222421
|
+
*/
|
|
222276
222422
|
fractionToPointAnd2Derivatives(fraction, result) {
|
|
222277
222423
|
return _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_2__.Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(this.fractionToX(fraction), this.fractionToY(fraction), 0.0, this.fractionToDX(fraction), this.fractionToDY(fraction), 0, this.fractionToDDX(fraction), this.fractionToDDY(fraction), 0, result);
|
|
222278
222424
|
}
|
|
@@ -222285,12 +222431,13 @@ class XYCurveEvaluator {
|
|
|
222285
222431
|
const v = this.fractionToDY(fraction);
|
|
222286
222432
|
return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.hypotenuseXY(u, v);
|
|
222287
222433
|
}
|
|
222288
|
-
/** Initialize class level work arrays for 5 point Gaussian Quadrature. */
|
|
222289
|
-
// Class resources for integration . . .
|
|
222290
|
-
// These static variables are reused on calls to integrateFromStartFraction
|
|
222291
222434
|
static _gaussX;
|
|
222292
222435
|
static _gaussWeight;
|
|
222293
222436
|
static _gaussMapper;
|
|
222437
|
+
/**
|
|
222438
|
+
* Initialize class level work arrays for 5 point Gaussian quadrature.
|
|
222439
|
+
* * These static variables are reused on calls to [[integrateDistanceBetweenFractions]].
|
|
222440
|
+
*/
|
|
222294
222441
|
static initWorkSpace() {
|
|
222295
222442
|
XYCurveEvaluator._gaussX = new Float64Array(5);
|
|
222296
222443
|
XYCurveEvaluator._gaussWeight = new Float64Array(5);
|
|
@@ -222299,8 +222446,6 @@ class XYCurveEvaluator {
|
|
|
222299
222446
|
/**
|
|
222300
222447
|
* Integrate between nominal fractions with default gauss rule.
|
|
222301
222448
|
* * The caller is expected to choose nearby fractions so that the single gauss interval accuracy is good.
|
|
222302
|
-
* @param fraction0
|
|
222303
|
-
* @param fraction1
|
|
222304
222449
|
*/
|
|
222305
222450
|
integrateDistanceBetweenFractions(fraction0, fraction1) {
|
|
222306
222451
|
const gaussX = XYCurveEvaluator._gaussX;
|
|
@@ -222313,11 +222458,11 @@ class XYCurveEvaluator {
|
|
|
222313
222458
|
return sum;
|
|
222314
222459
|
}
|
|
222315
222460
|
/**
|
|
222316
|
-
* Inverse integrated distance
|
|
222317
|
-
* @param fraction0 start of fraction interval
|
|
222318
|
-
* @param fraction1 end of fraction interval
|
|
222319
|
-
* @param distance0 distance at start
|
|
222320
|
-
* @param distance1 distance at end
|
|
222461
|
+
* Inverse integrated distance.
|
|
222462
|
+
* @param fraction0 start of fraction interval.
|
|
222463
|
+
* @param fraction1 end of fraction interval.
|
|
222464
|
+
* @param distance0 distance at start.
|
|
222465
|
+
* @param distance1 distance at end.
|
|
222321
222466
|
* @param targetDistance intermediate distance.
|
|
222322
222467
|
*/
|
|
222323
222468
|
inverseDistanceFraction(fraction0, fraction1, distance0, distance1, targetDistance) {
|
|
@@ -222331,12 +222476,12 @@ class XYCurveEvaluator {
|
|
|
222331
222476
|
return undefined;
|
|
222332
222477
|
}
|
|
222333
222478
|
/**
|
|
222334
|
-
*
|
|
222479
|
+
* Get the point and its derivatives at a given fraction.
|
|
222335
222480
|
* @param fraction fractional position along x axis
|
|
222336
222481
|
* @param xy xy coordinates of point on the curve
|
|
222337
|
-
* @param d1xy
|
|
222338
|
-
* @param d2xy
|
|
222339
|
-
* @param d3xy
|
|
222482
|
+
* @param d1xy first derivative vector
|
|
222483
|
+
* @param d2xy second derivative vector
|
|
222484
|
+
* @param d3xy third derivative vector
|
|
222340
222485
|
*/
|
|
222341
222486
|
fractionToPointAnd3Derivatives(fraction, xy, d1xy, d2xy, d3xy) {
|
|
222342
222487
|
xy.set(this.fractionToX(fraction), this.fractionToY(fraction), 0);
|
|
@@ -308596,10 +308741,10 @@ class Settings {
|
|
|
308596
308741
|
});
|
|
308597
308742
|
}
|
|
308598
308743
|
toString() {
|
|
308599
|
-
return `Configurations:
|
|
308600
|
-
oidc client id: ${this.oidcClientId},
|
|
308601
|
-
oidc scopes: ${this.oidcScopes},
|
|
308602
|
-
applicationId: ${this.gprid},
|
|
308744
|
+
return `Configurations:
|
|
308745
|
+
oidc client id: ${this.oidcClientId},
|
|
308746
|
+
oidc scopes: ${this.oidcScopes},
|
|
308747
|
+
applicationId: ${this.gprid},
|
|
308603
308748
|
log level: ${this.logLevel}`;
|
|
308604
308749
|
}
|
|
308605
308750
|
}
|
|
@@ -321554,7 +321699,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
321554
321699
|
/***/ ((module) => {
|
|
321555
321700
|
|
|
321556
321701
|
"use strict";
|
|
321557
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.3.0-dev.
|
|
321702
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.3.0-dev.18","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers && npm run -s copy:draco","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"5.2.2-dev.2","@types/chai-as-promised":"^7","@types/draco3d":"^1.4.10","@types/sinon":"^17.0.2","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.31.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","sinon":"^17.0.2","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.3.4","@loaders.gl/draco":"^4.3.4","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
321558
321703
|
|
|
321559
321704
|
/***/ })
|
|
321560
321705
|
|