@itwin/rpcinterface-full-stack-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 +12 -12
- package/lib/common/Settings.js.map +1 -1
- package/lib/common/SideChannels.js.map +1 -1
- package/lib/dist/bundled-tests.js +606 -461
- 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/DevToolsRpc.test.js.map +1 -1
- package/lib/frontend/Elements.test.js.map +1 -1
- package/lib/frontend/IModel.test.js.map +1 -1
- package/lib/frontend/IModelConnection.test.js.map +1 -1
- package/lib/frontend/Models.test.js.map +1 -1
- package/lib/frontend/PresentationRpc.test.js.map +1 -1
- package/lib/frontend/Views.test.js.map +1 -1
- package/lib/frontend/setup/IModelSession.js.map +1 -1
- package/lib/frontend/setup/TestContext.js.map +1 -1
- package/lib/frontend/workflows/BasicScenarios.test.js.map +1 -1
- package/package.json +15 -15
|
@@ -125089,7 +125089,7 @@ class SubCategoriesCache {
|
|
|
125089
125089
|
this._request = cache.load(categoryIds);
|
|
125090
125090
|
if (undefined === this._request) {
|
|
125091
125091
|
// All requested categories are already loaded.
|
|
125092
|
-
func();
|
|
125092
|
+
func(false);
|
|
125093
125093
|
return;
|
|
125094
125094
|
}
|
|
125095
125095
|
else {
|
|
@@ -125109,7 +125109,7 @@ class SubCategoriesCache {
|
|
|
125109
125109
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== this._current);
|
|
125110
125110
|
if (completed)
|
|
125111
125111
|
for (const func of this._current.funcs)
|
|
125112
|
-
func();
|
|
125112
|
+
func(true);
|
|
125113
125113
|
this._request = undefined;
|
|
125114
125114
|
this._current = undefined;
|
|
125115
125115
|
// If we have more requests, process them.
|
|
@@ -125120,7 +125120,7 @@ class SubCategoriesCache {
|
|
|
125120
125120
|
if (undefined === this._request) {
|
|
125121
125121
|
// All categories loaded.
|
|
125122
125122
|
for (const func of next.funcs)
|
|
125123
|
-
func();
|
|
125123
|
+
func(true);
|
|
125124
125124
|
}
|
|
125125
125125
|
else {
|
|
125126
125126
|
// We need to load the requested categories before invoking the pending functions.
|
|
@@ -130555,10 +130555,11 @@ class Viewport {
|
|
|
130555
130555
|
this.updateSubCategories(categoryIds, enableAllSubCategories);
|
|
130556
130556
|
}
|
|
130557
130557
|
updateSubCategories(categoryIds, enableAllSubCategories) {
|
|
130558
|
-
this.subcategories.push(this.iModel.subcategories, categoryIds, () => {
|
|
130559
|
-
if (enableAllSubCategories)
|
|
130558
|
+
this.subcategories.push(this.iModel.subcategories, categoryIds, (anySubCategoriesLoaded) => {
|
|
130559
|
+
if (true === enableAllSubCategories)
|
|
130560
130560
|
this.enableAllSubCategories(categoryIds);
|
|
130561
|
-
|
|
130561
|
+
if (undefined !== enableAllSubCategories || anySubCategoriesLoaded)
|
|
130562
|
+
this._changeFlags.setViewedCategories();
|
|
130562
130563
|
});
|
|
130563
130564
|
}
|
|
130564
130565
|
enableAllSubCategories(categoryIds) {
|
|
@@ -130893,6 +130894,10 @@ class Viewport {
|
|
|
130893
130894
|
this.registerViewListeners();
|
|
130894
130895
|
this.view.attachToViewport(this);
|
|
130895
130896
|
this._mapTiledGraphicsProvider = new _tile_internal__WEBPACK_IMPORTED_MODULE_21__.MapTiledGraphicsProvider(this.viewportId, this.displayStyle);
|
|
130897
|
+
// ViewState.load loads all the subcategories for the categories in its category selector.
|
|
130898
|
+
// But the set of categories may have changed since loading the view.
|
|
130899
|
+
// Ensure we fill the cache for the current set of categories.
|
|
130900
|
+
this.updateSubCategories(this.view.categorySelector.categories, undefined);
|
|
130896
130901
|
}
|
|
130897
130902
|
registerViewListeners() {
|
|
130898
130903
|
const view = this.view;
|
|
@@ -130903,6 +130908,7 @@ class Viewport {
|
|
|
130903
130908
|
removals.push(view.details.onClipVectorChanged.addListener(() => this.invalidateRenderPlan()));
|
|
130904
130909
|
removals.push(view.onViewedCategoriesChanged.addListener(() => {
|
|
130905
130910
|
this._changeFlags.setViewedCategories();
|
|
130911
|
+
this.updateSubCategories(view.categorySelector.categories, undefined);
|
|
130906
130912
|
this.maybeInvalidateScene();
|
|
130907
130913
|
}));
|
|
130908
130914
|
removals.push(view.onDisplayStyleChanged.addListener((newStyle) => {
|
|
@@ -175685,6 +175691,9 @@ class RootTile extends DynamicIModelTile {
|
|
|
175685
175691
|
get hiddenElements() {
|
|
175686
175692
|
return this._hiddenElements.toId64Array();
|
|
175687
175693
|
}
|
|
175694
|
+
get dynamicElements() {
|
|
175695
|
+
return this._elements.array.map((tile) => tile.contentId);
|
|
175696
|
+
}
|
|
175688
175697
|
get appearanceProvider() {
|
|
175689
175698
|
return this;
|
|
175690
175699
|
}
|
|
@@ -177059,6 +177068,11 @@ class IModelTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_6__.TileTre
|
|
|
177059
177068
|
const state = this._rootTile.tileState;
|
|
177060
177069
|
return "dynamic" === state.type ? state.rootTile.hiddenElements : [];
|
|
177061
177070
|
}
|
|
177071
|
+
/** Strictly for tests. */
|
|
177072
|
+
get dynamicElements() {
|
|
177073
|
+
const state = this._rootTile.tileState;
|
|
177074
|
+
return "dynamic" === state.type ? state.rootTile.dynamicElements : [];
|
|
177075
|
+
}
|
|
177062
177076
|
getTransformNodeRange(nodeId) {
|
|
177063
177077
|
return this._transformNodeRanges?.get(nodeId);
|
|
177064
177078
|
}
|
|
@@ -249402,9 +249416,15 @@ class AustralianRailCorpXYEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MO
|
|
|
249402
249416
|
this._nominalLength1 = nominalLength1;
|
|
249403
249417
|
this._nominalRadius1 = nominalRadius1;
|
|
249404
249418
|
}
|
|
249405
|
-
get nominalLength1() {
|
|
249406
|
-
|
|
249407
|
-
|
|
249419
|
+
get nominalLength1() {
|
|
249420
|
+
return this._nominalLength1;
|
|
249421
|
+
}
|
|
249422
|
+
get nominalRadius1() {
|
|
249423
|
+
return this._nominalRadius1;
|
|
249424
|
+
}
|
|
249425
|
+
clone() {
|
|
249426
|
+
return new AustralianRailCorpXYEvaluator(this._nominalLength1, this._nominalRadius1, this._axisLength, this._cubicM);
|
|
249427
|
+
}
|
|
249408
249428
|
static create(nominalLength1, nominalRadius1) {
|
|
249409
249429
|
const axisLength = AustralianRailCorpXYEvaluator.radiusAndNominalLengthToAxisLength(nominalRadius1, nominalLength1);
|
|
249410
249430
|
const phi = this.radiusAndAxisLengthToPhi(nominalRadius1, axisLength);
|
|
@@ -249412,11 +249432,7 @@ class AustralianRailCorpXYEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MO
|
|
|
249412
249432
|
const cubicM = Math.tan(phi) / (3.0 * xc2);
|
|
249413
249433
|
return new AustralianRailCorpXYEvaluator(nominalLength1, nominalRadius1, axisLength, cubicM);
|
|
249414
249434
|
}
|
|
249415
|
-
/**
|
|
249416
|
-
* Compute the phi constant for AustralianRail spiral with given end radius and length along axis.
|
|
249417
|
-
* @param nominalRadius1
|
|
249418
|
-
* @param axisLength
|
|
249419
|
-
*/
|
|
249435
|
+
/** Compute the phi constant for AustralianRail spiral with given end radius and length along axis. */
|
|
249420
249436
|
static radiusAndAxisLengthToPhi(nominalRadius1, axisLength) {
|
|
249421
249437
|
const xc = axisLength;
|
|
249422
249438
|
const expr1 = (2. / Math.sqrt(3.));
|
|
@@ -249429,26 +249445,23 @@ class AustralianRailCorpXYEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MO
|
|
|
249429
249445
|
return Math.asin(expr1 * Math.cos(Math.acos(expr2) / 3. + expr3));
|
|
249430
249446
|
}
|
|
249431
249447
|
scaleInPlace(scaleFactor) {
|
|
249432
|
-
// apply the scale factor to all contents
|
|
249433
|
-
// all distances scale directly . . .
|
|
249448
|
+
// apply the scale factor to all contents; all distances scale directly
|
|
249434
249449
|
this._nominalLength1 *= scaleFactor;
|
|
249435
249450
|
this._nominalRadius1 *= scaleFactor;
|
|
249436
249451
|
super.scaleInPlace(scaleFactor);
|
|
249437
249452
|
}
|
|
249438
|
-
/** Compute length along axis for AustralianRail spiral nominal radius and length.
|
|
249439
|
-
*
|
|
249440
|
-
*/
|
|
249453
|
+
/** Compute length along axis for AustralianRail spiral nominal radius and length. */
|
|
249441
249454
|
static radiusAndNominalLengthToAxisLength(nominalRadius1, nominalLength1, tolerance = 1.0e-5, requiredConvergenceCount = 2) {
|
|
249442
249455
|
const R = nominalRadius1;
|
|
249443
249456
|
let idx = 0;
|
|
249444
249457
|
let m, phi, xc2;
|
|
249445
249458
|
let xc = .7 * nominalLength1;
|
|
249446
249459
|
let convergenceCount = 0;
|
|
249447
|
-
// remark: This converges quickly
|
|
249460
|
+
// remark: This converges quickly
|
|
249448
249461
|
// for L=100, R=400
|
|
249449
249462
|
// ** full precision at 7th iteration.
|
|
249450
249463
|
// ** classic tolerance 1.0e-5 (7 digits from L) with requiredConvergenceCount = 1 gives 11 digits after 3 iterations
|
|
249451
|
-
// ** each iteration adds about 2 digits.
|
|
249464
|
+
// ** each iteration adds about 2 digits. This is quite good for a successive replacement without derivative
|
|
249452
249465
|
// ** Unanswerable question: If this is only done once and reused over all evaluations, do you want:
|
|
249453
249466
|
// * run the 7 iterations to get full precision
|
|
249454
249467
|
// * stop with the classic tolerance to get compatibility?
|
|
@@ -249457,8 +249470,7 @@ class AustralianRailCorpXYEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MO
|
|
|
249457
249470
|
xc2 = xc * xc;
|
|
249458
249471
|
m = Math.tan(phi) / (3.0 * xc2);
|
|
249459
249472
|
const m2x4 = m * m * xc2 * xc2;
|
|
249460
|
-
const correction = xc * m2x4 * ((9. / 10) + m2x4 * (-(9. / 8.) + m2x4 * (+(729. / 208.) + m2x4 *
|
|
249461
|
-
-(32805. / 2176.))));
|
|
249473
|
+
const correction = xc * m2x4 * ((9. / 10) + m2x4 * (-(9. / 8.) + m2x4 * (+(729. / 208.) + m2x4 * -(32805. / 2176.))));
|
|
249462
249474
|
const correctedLength = xc + correction;
|
|
249463
249475
|
xc = (nominalLength1 / correctedLength) * xc;
|
|
249464
249476
|
if (Math.abs(nominalLength1 - correctedLength) < tolerance) {
|
|
@@ -249483,12 +249495,15 @@ class AustralianRailCorpXYEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MO
|
|
|
249483
249495
|
}
|
|
249484
249496
|
/**
|
|
249485
249497
|
* Return a (quite good approximation) of fraction along x axis for given distance along spiral.
|
|
249486
|
-
* * The AustralianRailSpiral has a supporting power series to approximately map distance along the spiral to
|
|
249487
|
-
*
|
|
249498
|
+
* * The AustralianRailSpiral has a supporting power series to approximately map distance along the spiral to
|
|
249499
|
+
* an x coordinate.
|
|
249500
|
+
* * The `xToFraction(x)` method quickly (with a single divide) converts this x to fraction used for
|
|
249501
|
+
* this.fractionToX (fraction), this.fractionToY(fraction) etc to get coordinates and derivatives.
|
|
249488
249502
|
* * The x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.
|
|
249489
|
-
* * It is supported here for users interested in replicating the AustralianRail distance mapping rather than the
|
|
249490
|
-
*
|
|
249491
|
-
*
|
|
249503
|
+
* * It is supported here for users interested in replicating the AustralianRail distance mapping rather than the
|
|
249504
|
+
* more accurate CurvePrimitive measurements.
|
|
249505
|
+
* * Round tripping distance through (a) distanceAlongSpiralToAustralianApproximateX, (b) xToFraction, and
|
|
249506
|
+
* (c) curveLengthBetweenFractions has 10 digit accuracy for L/R = 4, 12 digit accuracy for L/R = 10.
|
|
249492
249507
|
* @param s distance along the axis.
|
|
249493
249508
|
*/
|
|
249494
249509
|
distanceAlongSpiralToAustralianApproximateX(s) {
|
|
@@ -249532,10 +249547,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
249532
249547
|
|
|
249533
249548
|
/**
|
|
249534
249549
|
* Methods to evaluate caller-specified number of terms of the x and y series for a clothoid.
|
|
249535
|
-
* Each instance has
|
|
249536
|
-
* *
|
|
249537
|
-
* * constant for theta=c
|
|
249538
|
-
* * This value is c=1/(2
|
|
249550
|
+
* Each instance has:
|
|
249551
|
+
* * number of x and y terms to use.
|
|
249552
|
+
* * constant for theta = c*x*x.
|
|
249553
|
+
* * This value is c = 1/(2*R*L) for curve length L measured from inflection to point with radius R.
|
|
249539
249554
|
* @internal
|
|
249540
249555
|
*/
|
|
249541
249556
|
class ClothoidSeriesRLEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODULE_0__.XYCurveEvaluator {
|
|
@@ -249558,7 +249573,7 @@ class ClothoidSeriesRLEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODU
|
|
|
249558
249573
|
this.nominalLength1 *= scaleFactor;
|
|
249559
249574
|
this.constantDiv2LR /= (scaleFactor * scaleFactor);
|
|
249560
249575
|
}
|
|
249561
|
-
/** Member by member matchup
|
|
249576
|
+
/** Member by member matchup. */
|
|
249562
249577
|
isAlmostEqual(other) {
|
|
249563
249578
|
if (other instanceof ClothoidSeriesRLEvaluator) {
|
|
249564
249579
|
return this.numXTerms === other.numXTerms
|
|
@@ -249572,43 +249587,55 @@ class ClothoidSeriesRLEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODU
|
|
|
249572
249587
|
* Evaluate the X series at a nominal distance along the curve.
|
|
249573
249588
|
* @param fraction fractional position along the curve.
|
|
249574
249589
|
*/
|
|
249575
|
-
fractionToX(fraction) {
|
|
249590
|
+
fractionToX(fraction) {
|
|
249591
|
+
return this.fractionToXGo(fraction, this.numXTerms);
|
|
249592
|
+
}
|
|
249576
249593
|
/**
|
|
249577
249594
|
* Evaluate the Y series at a nominal distance along the curve.
|
|
249578
249595
|
* @param fraction fractional position along the curve.
|
|
249579
249596
|
*/
|
|
249580
|
-
fractionToY(fraction) {
|
|
249597
|
+
fractionToY(fraction) {
|
|
249598
|
+
return this.fractionToYGo(fraction, this.numYTerms);
|
|
249599
|
+
}
|
|
249581
249600
|
/**
|
|
249582
249601
|
* Evaluate the derivative of the X series at a nominal distance along the curve.
|
|
249583
249602
|
* @param fraction fractional position along the curve.
|
|
249584
249603
|
*/
|
|
249585
|
-
fractionToDX(fraction) {
|
|
249604
|
+
fractionToDX(fraction) {
|
|
249605
|
+
return this.fractionToDXGo(fraction, this.numXTerms);
|
|
249606
|
+
}
|
|
249586
249607
|
/**
|
|
249587
249608
|
* Evaluate the derivative of the Y series at a nominal distance along the curve.
|
|
249588
249609
|
* @param fraction fractional position along the curve.
|
|
249589
249610
|
*/
|
|
249590
|
-
fractionToDY(fraction) {
|
|
249611
|
+
fractionToDY(fraction) {
|
|
249612
|
+
return this.fractionToDYGo(fraction, this.numYTerms);
|
|
249613
|
+
}
|
|
249591
249614
|
/**
|
|
249592
249615
|
* Evaluate the derivative of the X series at a nominal distance along the curve.
|
|
249593
249616
|
* @param fraction fractional position along the curve.
|
|
249594
249617
|
*/
|
|
249595
|
-
fractionToDDX(fraction) {
|
|
249618
|
+
fractionToDDX(fraction) {
|
|
249619
|
+
return this.fractionToDDXGo(fraction, this.numXTerms);
|
|
249620
|
+
}
|
|
249596
249621
|
/**
|
|
249597
249622
|
* Evaluate the derivative of the Y series at a nominal distance along the curve.
|
|
249598
249623
|
* @param fraction fractional position along the curve.
|
|
249599
249624
|
*/
|
|
249600
|
-
fractionToDDY(fraction) {
|
|
249625
|
+
fractionToDDY(fraction) {
|
|
249626
|
+
return this.fractionToDDYGo(fraction, this.numYTerms);
|
|
249627
|
+
}
|
|
249601
249628
|
/**
|
|
249602
249629
|
* Evaluate the X series at a nominal distance along the curve.
|
|
249603
249630
|
* @param fraction fractional position along the curve.
|
|
249604
249631
|
* @param numTerms number of terms to use.
|
|
249605
249632
|
*/
|
|
249606
249633
|
fractionToXGo(fraction, numTerms) {
|
|
249607
|
-
//
|
|
249634
|
+
// write the series for cos(theta)
|
|
249608
249635
|
// replace theta by s*s*c
|
|
249609
249636
|
// integrate wrt s
|
|
249610
249637
|
// x = s - s^5 c^4/ 2 + s^9 c^8/(4!) - s^13 c^12 / 6!
|
|
249611
|
-
// x = s(1 - (s^4 c^2/2) ( 1/5 -s^4 c^2 / (3*4)
|
|
249638
|
+
// x = s(1 - (s^4 c^2/2) ( 1/5 -s^4 c^2 / (3*4) (1/9 - ...) ) )
|
|
249612
249639
|
const s = fraction * this.nominalLength1;
|
|
249613
249640
|
let result = s;
|
|
249614
249641
|
if (numTerms < 2)
|
|
@@ -249627,7 +249654,7 @@ class ClothoidSeriesRLEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODU
|
|
|
249627
249654
|
return result;
|
|
249628
249655
|
}
|
|
249629
249656
|
fractionToYGo(fraction, numTerms) {
|
|
249630
|
-
//
|
|
249657
|
+
// write the series for sin(theta)
|
|
249631
249658
|
// replace theta by s*s*c
|
|
249632
249659
|
// integrate wrt s
|
|
249633
249660
|
// x = s^3 c^2/ 3( (1/3)) - s^7 c^6/(3!) ((1/7)) - s^11 c^10 / 5! ((1/9) - ...)
|
|
@@ -249649,7 +249676,7 @@ class ClothoidSeriesRLEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODU
|
|
|
249649
249676
|
return result;
|
|
249650
249677
|
}
|
|
249651
249678
|
fractionToDXGo(fraction, numTerms) {
|
|
249652
|
-
//
|
|
249679
|
+
// yes -- this does happen during derivatives of cosines with more than 0 terms
|
|
249653
249680
|
if (numTerms <= 0)
|
|
249654
249681
|
return 0;
|
|
249655
249682
|
// dX = 1 - s^4c^2/2 + s^8 c^4 / 4! -
|
|
@@ -249704,7 +249731,7 @@ class ClothoidSeriesRLEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODU
|
|
|
249704
249731
|
fractionToDDYGo(fraction, numTerms) {
|
|
249705
249732
|
// DY is "sine"
|
|
249706
249733
|
// DDY is "cosine" series times chain rule dTheta/ds = 2 * s * this.constantDivLR
|
|
249707
|
-
// BUT .... derivative of the cosine series leading term is zero ... use one less term
|
|
249734
|
+
// BUT .... derivative of the cosine series leading term is zero ... use one less term
|
|
249708
249735
|
const s = fraction * this.nominalLength1;
|
|
249709
249736
|
const dTheta = 2 * this.constantDiv2LR * s;
|
|
249710
249737
|
const cosine = this.fractionToDXGo(fraction, numTerms);
|
|
@@ -249767,9 +249794,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
249767
249794
|
* @module Curve
|
|
249768
249795
|
*/
|
|
249769
249796
|
|
|
249770
|
-
/**
|
|
249797
|
+
/**
|
|
249798
|
+
* Intermediate class for evaluation of bare cubic spirals `y = m ^x^3` with x axis from [0..xLength]
|
|
249771
249799
|
* * This implements all the computations among fraction, x, and y.
|
|
249772
|
-
* * Derived classes implement specialized logic such as (a) precomputing `m` and (b) domain-specific fraction-to-distance
|
|
249800
|
+
* * Derived classes implement specialized logic such as (a) precomputing `m` and (b) domain-specific fraction-to-distance
|
|
249801
|
+
* approximations.
|
|
249773
249802
|
* @internal
|
|
249774
249803
|
*/
|
|
249775
249804
|
class CubicEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODULE_0__.XYCurveEvaluator {
|
|
@@ -249785,26 +249814,37 @@ class CubicEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODULE_0__.XYCu
|
|
|
249785
249814
|
this._axisLength = axisLength;
|
|
249786
249815
|
this._cubicM = cubicM;
|
|
249787
249816
|
}
|
|
249788
|
-
get axisLength() {
|
|
249789
|
-
|
|
249817
|
+
get axisLength() {
|
|
249818
|
+
return this._axisLength;
|
|
249819
|
+
}
|
|
249820
|
+
get cubicM() {
|
|
249821
|
+
return this._cubicM;
|
|
249822
|
+
}
|
|
249790
249823
|
/**
|
|
249791
249824
|
* Apply `scaleFactor` to the xLength and cubicM.
|
|
249792
249825
|
* * Derived classes commonly call this as `super.scaleInPlace()`, and additionally apply the scale to their members.
|
|
249793
|
-
* @param scaleFactor
|
|
249794
249826
|
*/
|
|
249795
249827
|
scaleInPlace(scaleFactor) {
|
|
249796
249828
|
this._axisLength *= scaleFactor;
|
|
249797
|
-
// "x" arriving at "m * x^3" will be scaled. "m" has to be divided by the scale to cancel 2 of the 3
|
|
249829
|
+
// "x" arriving at "m * x^3" will be scaled. "m" has to be divided by the scale to cancel 2 of the 3
|
|
249798
249830
|
this._cubicM /= (scaleFactor * scaleFactor);
|
|
249799
249831
|
}
|
|
249800
249832
|
/** Evaluate X at fraction. */
|
|
249801
|
-
fractionToX(fraction) {
|
|
249802
|
-
|
|
249803
|
-
|
|
249804
|
-
/** Evaluate
|
|
249805
|
-
|
|
249806
|
-
|
|
249807
|
-
|
|
249833
|
+
fractionToX(fraction) {
|
|
249834
|
+
return fraction * this._axisLength;
|
|
249835
|
+
}
|
|
249836
|
+
/** Evaluate derivative of X with respect to fraction. */
|
|
249837
|
+
fractionToDX(_fraction) {
|
|
249838
|
+
return this._axisLength;
|
|
249839
|
+
}
|
|
249840
|
+
/** Evaluate second derivative of X with respect to fraction. */
|
|
249841
|
+
fractionToDDX(_fraction) {
|
|
249842
|
+
return 0.0;
|
|
249843
|
+
}
|
|
249844
|
+
/** Evaluate third derivative of X with respect to fraction. */
|
|
249845
|
+
fractionToD3X(_fraction) {
|
|
249846
|
+
return 0.0;
|
|
249847
|
+
}
|
|
249808
249848
|
/** Evaluate Y at fraction. */
|
|
249809
249849
|
fractionToY(fraction) {
|
|
249810
249850
|
const x = fraction * this._axisLength;
|
|
@@ -249825,7 +249865,9 @@ class CubicEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTED_MODULE_0__.XYCu
|
|
|
249825
249865
|
return 6.0 * this._cubicM * this._axisLength * this._axisLength * this._axisLength;
|
|
249826
249866
|
}
|
|
249827
249867
|
/** Evaluate fraction at x. */
|
|
249828
|
-
xToFraction(x) {
|
|
249868
|
+
xToFraction(x) {
|
|
249869
|
+
return x / this._axisLength;
|
|
249870
|
+
}
|
|
249829
249871
|
}
|
|
249830
249872
|
|
|
249831
249873
|
|
|
@@ -249859,21 +249901,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
249859
249901
|
/**
|
|
249860
249902
|
* Czech cubic.
|
|
249861
249903
|
* This is y= m*x^3 with
|
|
249862
|
-
* * x any point on the x axis
|
|
249863
|
-
* * `fraction` along the spiral goes to `x = fraction * L
|
|
249864
|
-
* * m is gamma / (6RL)
|
|
249904
|
+
* * x any point on the x axis.
|
|
249905
|
+
* * `fraction` along the spiral goes to `x = fraction * L`.
|
|
249906
|
+
* * m is gamma / (6RL).
|
|
249865
249907
|
* * 1/(6RL) is the leading term of the sine series.
|
|
249866
249908
|
* * `gamma = 2R/sqrt (4RR-LL)` pushes y down a little bit to simulate the lost series terms.
|
|
249867
|
-
* @param localToWorld
|
|
249868
|
-
* @param nominalL1
|
|
249869
|
-
* @param nominalR1
|
|
249870
|
-
* @param activeInterval
|
|
249871
249909
|
* @internal
|
|
249872
249910
|
*/
|
|
249873
249911
|
class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.CubicEvaluator {
|
|
249874
249912
|
nominalLength1;
|
|
249875
249913
|
nominalRadius1;
|
|
249876
|
-
/** Constructor is private.
|
|
249914
|
+
/** Constructor is private. Caller responsible for cubicM validity. */
|
|
249877
249915
|
constructor(length1, radius1, cubicM) {
|
|
249878
249916
|
super(length1, cubicM);
|
|
249879
249917
|
this.nominalLength1 = length1;
|
|
@@ -249883,8 +249921,6 @@ class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
249883
249921
|
* Return the scale factor between simple x^3 / (6RL) cubic and the czech correction.
|
|
249884
249922
|
* * For typical case with l1/R1 smallish, this is just less than 1.0:
|
|
249885
249923
|
* (0.25==>0.99215), (0.15==>0.997184), (0.10==>0.998749), (0.05==>999687)
|
|
249886
|
-
* @param length1
|
|
249887
|
-
* @param radius1
|
|
249888
249924
|
*/
|
|
249889
249925
|
static gammaConstant(length1, radius1) {
|
|
249890
249926
|
return 2.0 * radius1 / Math.sqrt(4.0 * radius1 * radius1 - length1 * length1);
|
|
@@ -249892,10 +249928,10 @@ class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
249892
249928
|
/** Compute the czech cubic constant. */
|
|
249893
249929
|
static computeCubicM(length1, radius1) {
|
|
249894
249930
|
const gamma = CzechSpiralEvaluator.gammaConstant(length1, radius1);
|
|
249895
|
-
//
|
|
249931
|
+
// in the private update method, the LR values should have been vetted
|
|
249896
249932
|
if (gamma === undefined)
|
|
249897
249933
|
return undefined;
|
|
249898
|
-
//
|
|
249934
|
+
// if radius is negative, it shows up in gamma; but the a signed denominator undoes it so take abs of denominator
|
|
249899
249935
|
return gamma / Math.abs((6.0 * radius1 * length1));
|
|
249900
249936
|
}
|
|
249901
249937
|
static create(length1, radius1) {
|
|
@@ -249909,9 +249945,11 @@ class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
249909
249945
|
this.nominalRadius1 *= scaleFactor;
|
|
249910
249946
|
super.scaleInPlace(scaleFactor);
|
|
249911
249947
|
}
|
|
249912
|
-
/**
|
|
249913
|
-
clone() {
|
|
249914
|
-
|
|
249948
|
+
/** Return a deep copy of the evaluator. */
|
|
249949
|
+
clone() {
|
|
249950
|
+
return new CzechSpiralEvaluator(this.nominalLength1, this.nominalRadius1, this.cubicM);
|
|
249951
|
+
}
|
|
249952
|
+
/** Member by member matchup. */
|
|
249915
249953
|
isAlmostEqual(other) {
|
|
249916
249954
|
if (other instanceof CzechSpiralEvaluator) {
|
|
249917
249955
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)
|
|
@@ -249922,7 +249960,8 @@ class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
249922
249960
|
/**
|
|
249923
249961
|
* Return a (fast but mediocre) approximation of spiral length as a function of x axis position.
|
|
249924
249962
|
* * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.
|
|
249925
|
-
* * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
|
|
249963
|
+
* * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
|
|
249964
|
+
* CurvePrimitive measurements.
|
|
249926
249965
|
* @param x distance along the x axis.
|
|
249927
249966
|
*/
|
|
249928
249967
|
xToCzechApproximateDistance(x) {
|
|
@@ -249931,16 +249970,15 @@ class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
249931
249970
|
/**
|
|
249932
249971
|
* Return the inverse of the `forwardL2R2Map` function.
|
|
249933
249972
|
* * The undefined result can only occur for distances outside the usual spirals.
|
|
249934
|
-
* @param
|
|
249935
|
-
*
|
|
249973
|
+
* @param d (approximate) distance along the spiral.
|
|
249936
249974
|
*/
|
|
249937
249975
|
czechApproximateDistanceToX(d) {
|
|
249938
249976
|
return CzechSpiralEvaluator.inverseL2R2Map(d, 1.0, this.nominalLength1, this.nominalRadius1);
|
|
249939
249977
|
}
|
|
249940
249978
|
/**
|
|
249941
|
-
|
|
249942
|
-
|
|
249943
|
-
|
|
249979
|
+
* Evaluate a series expansion that is used with varying signs (plus or minus 1) in czech and italian spirals.
|
|
249980
|
+
* @param x distance along the x axis.
|
|
249981
|
+
*/
|
|
249944
249982
|
static forwardL2R2Map(x, sign, length, radius) {
|
|
249945
249983
|
const l2 = length * length;
|
|
249946
249984
|
const r2 = radius * radius;
|
|
@@ -249951,17 +249989,16 @@ class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
249951
249989
|
/**
|
|
249952
249990
|
* Return the inverse of the `forwardL2R2Map` function.
|
|
249953
249991
|
* * The undefined result can only occur for distances outside the usual spirals.
|
|
249954
|
-
* @param
|
|
249955
|
-
*
|
|
249992
|
+
* @param d (approximate) distance along the spiral.
|
|
249956
249993
|
*/
|
|
249957
|
-
static inverseL2R2Map(
|
|
249994
|
+
static inverseL2R2Map(d, sign, length, radius) {
|
|
249958
249995
|
const l2 = length * length;
|
|
249959
249996
|
const r2 = radius * radius;
|
|
249960
249997
|
const Q = 4.0 * r2 - l2;
|
|
249961
249998
|
const a = sign / (10.0 * Q * l2);
|
|
249962
|
-
return _numerics_Newton__WEBPACK_IMPORTED_MODULE_2__.SimpleNewton.runNewton1D(
|
|
249999
|
+
return _numerics_Newton__WEBPACK_IMPORTED_MODULE_2__.SimpleNewton.runNewton1D(d, (x) => {
|
|
249963
250000
|
const xx = x * x;
|
|
249964
|
-
return x * (1.0 + xx * xx * a) -
|
|
250001
|
+
return x * (1.0 + xx * xx * a) - d;
|
|
249965
250002
|
}, (x) => {
|
|
249966
250003
|
const xx = x * x;
|
|
249967
250004
|
return 1.0 + 5 * xx * xx * a;
|
|
@@ -249971,39 +250008,36 @@ class CzechSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
249971
250008
|
/**
|
|
249972
250009
|
* Italian cubic.
|
|
249973
250010
|
* This is y= m*x^3 with
|
|
249974
|
-
* * x any point on the x axis
|
|
249975
|
-
* * `fraction` along the spiral goes to `x = fraction * L
|
|
249976
|
-
* * m is gamma / (6RL)
|
|
250011
|
+
* * x any point on the x axis.
|
|
250012
|
+
* * `fraction` along the spiral goes to `x = fraction * L`.
|
|
250013
|
+
* * m is gamma / (6RL).
|
|
249977
250014
|
* * 1/(6RL) is the leading term of the sine series.
|
|
249978
250015
|
* * `gamma = 2R/sqrt (4RR-LL)` pushes y down a little bit to simulate the lost series terms.
|
|
249979
|
-
* @param localToWorld
|
|
249980
|
-
* @param nominalL1
|
|
249981
|
-
* @param nominalR1
|
|
249982
|
-
* @param activeInterval
|
|
249983
250016
|
* @internal
|
|
249984
250017
|
*/
|
|
249985
250018
|
class ItalianSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.CubicEvaluator {
|
|
249986
250019
|
nominalLength1;
|
|
249987
250020
|
nominalRadius1;
|
|
249988
|
-
/**
|
|
249989
|
-
*
|
|
250021
|
+
/**
|
|
250022
|
+
* Compute the czech cubic constant.
|
|
250023
|
+
* * Funky mixture of lengths.
|
|
249990
250024
|
*/
|
|
249991
250025
|
static computeCubicM(lengthXByForward, radius1) {
|
|
249992
250026
|
const gamma = CzechSpiralEvaluator.gammaConstant(lengthXByForward, radius1);
|
|
249993
|
-
//
|
|
250027
|
+
// in the private update method, the LR values should have been vetted
|
|
249994
250028
|
if (gamma === undefined)
|
|
249995
250029
|
return undefined;
|
|
249996
|
-
//
|
|
250030
|
+
// if radius is negative, it shows up in gamma; but the a signed denominator undoes it so take abs of denominator
|
|
249997
250031
|
return gamma / Math.abs((6.0 * radius1 * lengthXByForward));
|
|
249998
250032
|
}
|
|
249999
|
-
/** Constructor is private.
|
|
250033
|
+
/** Constructor is private. Caller responsible for cubicM validity. */
|
|
250000
250034
|
constructor(length1, radius1, lengthX, cubicM) {
|
|
250001
250035
|
super(lengthX, cubicM);
|
|
250002
250036
|
this.nominalLength1 = length1;
|
|
250003
250037
|
this.nominalRadius1 = radius1;
|
|
250004
250038
|
}
|
|
250005
250039
|
static create(length1, radius1) {
|
|
250006
|
-
//
|
|
250040
|
+
// this seems goofy.; lengthX from forward, then invert for another but that's what the native code does too
|
|
250007
250041
|
const lengthX = CzechSpiralEvaluator.forwardL2R2Map(length1, -1.0, length1, radius1);
|
|
250008
250042
|
const lengthX1 = CzechSpiralEvaluator.inverseL2R2Map(length1, 1.0, lengthX, radius1);
|
|
250009
250043
|
if (lengthX1 === undefined)
|
|
@@ -250018,9 +250052,11 @@ class ItalianSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0_
|
|
|
250018
250052
|
this.nominalRadius1 *= scaleFactor;
|
|
250019
250053
|
super.scaleInPlace(scaleFactor);
|
|
250020
250054
|
}
|
|
250021
|
-
/**
|
|
250022
|
-
clone() {
|
|
250023
|
-
|
|
250055
|
+
/** Return a deep copy of the evaluator. */
|
|
250056
|
+
clone() {
|
|
250057
|
+
return new ItalianSpiralEvaluator(this.nominalLength1, this.nominalRadius1, super.axisLength, this.cubicM);
|
|
250058
|
+
}
|
|
250059
|
+
/** Member by member matchup. */
|
|
250024
250060
|
isAlmostEqual(other) {
|
|
250025
250061
|
if (other instanceof ItalianSpiralEvaluator) {
|
|
250026
250062
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)
|
|
@@ -250029,19 +250065,19 @@ class ItalianSpiralEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0_
|
|
|
250029
250065
|
return false;
|
|
250030
250066
|
}
|
|
250031
250067
|
/**
|
|
250032
|
-
|
|
250033
|
-
|
|
250034
|
-
|
|
250035
|
-
|
|
250036
|
-
|
|
250068
|
+
* Return a (fast but mediocre) approximation of spiral length as a function of x axis position.
|
|
250069
|
+
* * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.
|
|
250070
|
+
* * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
|
|
250071
|
+
* CurvePrimitive measurements.
|
|
250072
|
+
* @param x distance along the x axis.
|
|
250073
|
+
*/
|
|
250037
250074
|
distanceToItalianApproximateX(x) {
|
|
250038
250075
|
return CzechSpiralEvaluator.forwardL2R2Map(x, -1.0, this.nominalLength1, this.nominalRadius1);
|
|
250039
250076
|
}
|
|
250040
250077
|
/**
|
|
250041
250078
|
* Return the inverse of the `forwardL2R2Map` function.
|
|
250042
250079
|
* * The undefined result can only occur for distances outside the usual spirals.
|
|
250043
|
-
* @param
|
|
250044
|
-
*
|
|
250080
|
+
* @param d (approximate) distance along the spiral.
|
|
250045
250081
|
*/
|
|
250046
250082
|
xToItalianApproximateDistance(d) {
|
|
250047
250083
|
return CzechSpiralEvaluator.inverseL2R2Map(d, -1.0, this.nominalLength1, this.nominalRadius1);
|
|
@@ -250102,9 +250138,11 @@ class DirectHalfCosineSpiralEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTE
|
|
|
250102
250138
|
this.nominalRadius1 *= scaleFactor;
|
|
250103
250139
|
this.updateConstants();
|
|
250104
250140
|
}
|
|
250105
|
-
/**
|
|
250106
|
-
clone() {
|
|
250107
|
-
|
|
250141
|
+
/** Return a deep copy of the evaluator. */
|
|
250142
|
+
clone() {
|
|
250143
|
+
return new DirectHalfCosineSpiralEvaluator(this.nominalLength1, this.nominalRadius1);
|
|
250144
|
+
}
|
|
250145
|
+
/** Member by member matchup. */
|
|
250108
250146
|
isAlmostEqual(other) {
|
|
250109
250147
|
if (other instanceof DirectHalfCosineSpiralEvaluator) {
|
|
250110
250148
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)
|
|
@@ -250114,14 +250152,18 @@ class DirectHalfCosineSpiralEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTE
|
|
|
250114
250152
|
return false;
|
|
250115
250153
|
}
|
|
250116
250154
|
/** Evaluate X at fractional position. */
|
|
250117
|
-
fractionToX(fraction) {
|
|
250155
|
+
fractionToX(fraction) {
|
|
250156
|
+
return fraction * this.nominalLength1;
|
|
250157
|
+
}
|
|
250118
250158
|
/** Evaluate Y at fractional position. */
|
|
250119
250159
|
fractionToY(fraction) {
|
|
250120
250160
|
const theta = fraction * Math.PI;
|
|
250121
250161
|
return this._c * (this._c2 * fraction * fraction - this._c1 * (1.0 - Math.cos(theta)));
|
|
250122
250162
|
}
|
|
250123
250163
|
/** Evaluate derivative of X with respect to fraction at fractional position. */
|
|
250124
|
-
fractionToDX(_fraction) {
|
|
250164
|
+
fractionToDX(_fraction) {
|
|
250165
|
+
return this.nominalLength1;
|
|
250166
|
+
}
|
|
250125
250167
|
/** Evaluate derivative of Y with respect to fraction at fractional position. */
|
|
250126
250168
|
fractionToDY(fraction) {
|
|
250127
250169
|
const pi = Math.PI;
|
|
@@ -250129,7 +250171,9 @@ class DirectHalfCosineSpiralEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTE
|
|
|
250129
250171
|
return this._c * (2.0 * this._c2 * fraction - this._c1 * pi * Math.sin(theta));
|
|
250130
250172
|
}
|
|
250131
250173
|
/** Evaluate second derivative of X with respect to fraction at fractional position. */
|
|
250132
|
-
fractionToDDX(_fraction) {
|
|
250174
|
+
fractionToDDX(_fraction) {
|
|
250175
|
+
return 0.0;
|
|
250176
|
+
}
|
|
250133
250177
|
/** Evaluate third derivative of Y with respect to fraction at fractional position. */
|
|
250134
250178
|
fractionToDDY(fraction) {
|
|
250135
250179
|
const pi = Math.PI;
|
|
@@ -250137,7 +250181,9 @@ class DirectHalfCosineSpiralEvaluator extends _XYCurveEvaluator__WEBPACK_IMPORTE
|
|
|
250137
250181
|
return this._c * (2.0 * this._c2 - this._c1 * pi * pi * Math.cos(theta));
|
|
250138
250182
|
}
|
|
250139
250183
|
/** Evaluate second derivative of X with respect to fraction at fractional position. */
|
|
250140
|
-
fractionToD3X(_fraction) {
|
|
250184
|
+
fractionToD3X(_fraction) {
|
|
250185
|
+
return 0.0;
|
|
250186
|
+
}
|
|
250141
250187
|
/** Evaluate third derivative of Y with respect to fraction at fractional position. */
|
|
250142
250188
|
fractionToD3Y(fraction) {
|
|
250143
250189
|
const pi = Math.PI;
|
|
@@ -250204,10 +250250,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
250204
250250
|
|
|
250205
250251
|
|
|
250206
250252
|
/**
|
|
250207
|
-
* DirectSpiral3d acts like a TransitionSpiral3d for serialization purposes, but implements spiral types that have
|
|
250208
|
-
* for IntegratedSpiral3d.
|
|
250253
|
+
* DirectSpiral3d acts like a TransitionSpiral3d for serialization purposes, but implements spiral types that have
|
|
250254
|
+
* "direct" xy calculations without the integrations required for IntegratedSpiral3d.
|
|
250209
250255
|
* * Each DirectSpiral3d carries an XYCurveEvaluator to give it specialized behavior.
|
|
250210
|
-
* * Direct spirals that flow through serialization to native imodel02 are
|
|
250256
|
+
* * Direct spirals that flow through serialization to native imodel02 are created with these static methods:
|
|
250211
250257
|
* * createArema
|
|
250212
250258
|
* * createJapaneseCubic
|
|
250213
250259
|
* * createAustralianRail
|
|
@@ -250220,32 +250266,45 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
250220
250266
|
* @public
|
|
250221
250267
|
*/
|
|
250222
250268
|
class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.TransitionSpiral3d {
|
|
250223
|
-
/** String name for schema properties */
|
|
250269
|
+
/** String name for schema properties. */
|
|
250224
250270
|
curvePrimitiveType = "transitionSpiral";
|
|
250225
|
-
/**
|
|
250271
|
+
/** Stroked approximation of entire spiral. This is AFTER the localToWorld transform. */
|
|
250226
250272
|
_globalStrokes;
|
|
250227
|
-
/**
|
|
250228
|
-
*
|
|
250229
|
-
* *
|
|
250273
|
+
/**
|
|
250274
|
+
* Stroked approximation of active spiral. This is AFTER the localToWorld transform.
|
|
250275
|
+
* * Same count as global; possibly overly fine, but it gives some consistency between same clothoid constructed as
|
|
250276
|
+
* partial versus complete.
|
|
250277
|
+
* * If no trimming, this points to the same place as the _globalStrokes. DO NOT double transform.
|
|
250230
250278
|
*/
|
|
250231
250279
|
_activeStrokes;
|
|
250232
|
-
/** Return the internal stroked form of the (possibly partial) spiral
|
|
250233
|
-
get activeStrokes() {
|
|
250280
|
+
/** Return the internal stroked form of the (possibly partial) spiral. */
|
|
250281
|
+
get activeStrokes() {
|
|
250282
|
+
return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes;
|
|
250283
|
+
}
|
|
250234
250284
|
_nominalL1;
|
|
250235
250285
|
_nominalR1;
|
|
250236
250286
|
_evaluator;
|
|
250237
250287
|
/** Return the nominal end radius. */
|
|
250238
|
-
get nominalR1() {
|
|
250288
|
+
get nominalR1() {
|
|
250289
|
+
return this._nominalR1;
|
|
250290
|
+
}
|
|
250239
250291
|
/** Return the nominal distance from inflection to endpoint. */
|
|
250240
|
-
get nominalL1() {
|
|
250292
|
+
get nominalL1() {
|
|
250293
|
+
return this._nominalL1;
|
|
250294
|
+
}
|
|
250241
250295
|
/** Return the nominal end curvature */
|
|
250242
|
-
get nominalCurvature1() {
|
|
250243
|
-
|
|
250296
|
+
get nominalCurvature1() {
|
|
250297
|
+
return _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.TransitionSpiral3d.radiusToCurvature(this._nominalR1);
|
|
250298
|
+
}
|
|
250299
|
+
/**
|
|
250300
|
+
* Return the low level evaluator.
|
|
250244
250301
|
* @internal
|
|
250245
250302
|
*/
|
|
250246
|
-
get evaluator() {
|
|
250303
|
+
get evaluator() {
|
|
250304
|
+
return this._evaluator;
|
|
250305
|
+
}
|
|
250247
250306
|
// constructor demands radius1 and distance1 for nominal construction.
|
|
250248
|
-
// caller is responsible for managing intervals of partial spiral
|
|
250307
|
+
// caller is responsible for managing intervals of partial spiral.
|
|
250249
250308
|
constructor(localToWorld, spiralType, originalProperties, nominalL1, nominalR1, activeFractionInterval, evaluator) {
|
|
250250
250309
|
super(spiralType, localToWorld, activeFractionInterval, originalProperties);
|
|
250251
250310
|
this._nominalL1 = nominalL1;
|
|
@@ -250253,14 +250312,16 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250253
250312
|
this._evaluator = evaluator;
|
|
250254
250313
|
this._globalStrokes = _LineString3d__WEBPACK_IMPORTED_MODULE_1__.LineString3d.create();
|
|
250255
250314
|
this._activeStrokes = _LineString3d__WEBPACK_IMPORTED_MODULE_1__.LineString3d.create();
|
|
250256
|
-
// initialize for compiler
|
|
250315
|
+
// initialize for compiler; but this will be recomputed in refreshComputeProperties
|
|
250257
250316
|
this.refreshComputedProperties();
|
|
250258
250317
|
}
|
|
250259
250318
|
/**
|
|
250260
250319
|
* Compute stroke data in an interval.
|
|
250261
250320
|
* @param strokes strokes to clear and refill.
|
|
250262
|
-
* @param
|
|
250263
|
-
* @param
|
|
250321
|
+
* @param fractionA start fraction.
|
|
250322
|
+
* @param fractionB end fraction.
|
|
250323
|
+
* @param numInterval number of intervals.
|
|
250324
|
+
* @param applyLocalToWorld if true, apply the localToWorld transform.
|
|
250264
250325
|
*/
|
|
250265
250326
|
computeStrokes(strokes, fractionA, fractionB, numInterval, applyLocalToWorld = true) {
|
|
250266
250327
|
if (numInterval < 1)
|
|
@@ -250289,7 +250350,7 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250289
250350
|
trueDistance0 = trueDistance1;
|
|
250290
250351
|
}
|
|
250291
250352
|
}
|
|
250292
|
-
/** Recompute strokes */
|
|
250353
|
+
/** Recompute strokes. */
|
|
250293
250354
|
refreshComputedProperties() {
|
|
250294
250355
|
const sweepRadians = this.nominalL1 / (2.0 * this.nominalR1);
|
|
250295
250356
|
const radiansStep = 0.02;
|
|
@@ -250301,12 +250362,14 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250301
250362
|
}
|
|
250302
250363
|
/**
|
|
250303
250364
|
* Create a spiral object which uses numXTerm terms from the clothoid X series and numYTerm from the clothoid Y series.
|
|
250304
|
-
* @param
|
|
250365
|
+
* @param spiralType type of spiral.
|
|
250366
|
+
* @param localToWorld placement frame. Inflection point is at origin, initial direction is along x axis.
|
|
250367
|
+
* @param numXTerm number of terms to use from X series
|
|
250305
250368
|
* @param numYTerm number of terms to use from Y series
|
|
250306
|
-
* @param
|
|
250369
|
+
* @param originalProperties (optional) transition conditional properties.
|
|
250307
250370
|
* @param nominalL1 design distance from inflection to end point.
|
|
250308
250371
|
* @param nominalR1 design radius at end point.
|
|
250309
|
-
* @param activeInterval active interval (as fractions of nominalL1
|
|
250372
|
+
* @param activeInterval (optional) active interval (as fractions of nominalL1)
|
|
250310
250373
|
*/
|
|
250311
250374
|
static createTruncatedClothoid(spiralType, localToWorld, numXTerm, numYTerm, originalProperties, nominalL1, nominalR1, activeInterval) {
|
|
250312
250375
|
if (numXTerm < 1)
|
|
@@ -250317,13 +250380,13 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250317
250380
|
return new DirectSpiral3d(localToWorld.clone(), spiralType, originalProperties, nominalL1, nominalR1, activeInterval ? activeInterval.clone() : _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_5__.Segment1d.create(0, 1), evaluator);
|
|
250318
250381
|
}
|
|
250319
250382
|
/**
|
|
250320
|
-
* Create
|
|
250383
|
+
* Create a Japanese spiral clothoid approximation.
|
|
250321
250384
|
* * X is 1 terms of the clothoid series as a function of nominal distance along.
|
|
250322
|
-
* * Y is 1 terms
|
|
250323
|
-
* * Remark: This is identical to the ChineseCubic
|
|
250324
|
-
* @param localToWorld axes with inflection at origin, tangent along x axis
|
|
250385
|
+
* * Y is 1 terms of the clothoid series as a function of nominal distance along.
|
|
250386
|
+
* * Remark: This is identical to the ChineseCubic.
|
|
250387
|
+
* @param localToWorld axes with inflection at origin, tangent along x axis.
|
|
250325
250388
|
* @param nominalL1 nominal length as used in series LR terms.
|
|
250326
|
-
* @param nominalR1 nominal final radius as used in series LR terms
|
|
250389
|
+
* @param nominalR1 nominal final radius as used in series LR terms.
|
|
250327
250390
|
* @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along
|
|
250328
250391
|
*/
|
|
250329
250392
|
static createJapaneseCubic(localToWorld, nominalL1, nominalR1, activeInterval) {
|
|
@@ -250331,14 +250394,14 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250331
250394
|
}
|
|
250332
250395
|
/**
|
|
250333
250396
|
* Create a czech cubic.
|
|
250334
|
-
* This is y= m*x^3 with
|
|
250335
|
-
* * x any point on the x axis
|
|
250336
|
-
* * `fraction` along the spiral goes to `x = fraction * L
|
|
250337
|
-
* * m is gamma / (6RL)
|
|
250397
|
+
* This is y = m*x^3 with
|
|
250398
|
+
* * x any point on the x axis.
|
|
250399
|
+
* * `fraction` along the spiral goes to `x = fraction * L`.
|
|
250400
|
+
* * m is gamma / (6RL).
|
|
250338
250401
|
* * 1/(6RL) is the leading term of the sine series.
|
|
250339
|
-
* * `gamma = 2R/sqrt
|
|
250402
|
+
* * `gamma = 2R/sqrt(4RR-LL)` pushes y up a little bit to simulate the lost series terms.
|
|
250340
250403
|
* @param localToWorld
|
|
250341
|
-
* @param nominalLx nominal length along x axis
|
|
250404
|
+
* @param nominalLx nominal length along x axis.
|
|
250342
250405
|
* @param nominalR1
|
|
250343
250406
|
* @param activeInterval
|
|
250344
250407
|
*/
|
|
@@ -250350,15 +250413,14 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250350
250413
|
}
|
|
250351
250414
|
/**
|
|
250352
250415
|
* Create an italian spiral
|
|
250353
|
-
* This is y= m*x^3 with
|
|
250354
|
-
* * x any point on the x axis
|
|
250355
|
-
* * `fraction` along the spiral goes to `x = fraction * L
|
|
250356
|
-
* * m is gamma / (6RL)
|
|
250416
|
+
* This is y = m*x^3 with
|
|
250417
|
+
* * x any point on the x axis.
|
|
250418
|
+
* * `fraction` along the spiral goes to `x = fraction * L`.
|
|
250419
|
+
* * m is gamma / (6RL).
|
|
250357
250420
|
* * 1/(6RL) is the leading term of the sine series.
|
|
250358
|
-
* * `gamma = 2R/sqrt
|
|
250359
|
-
* * L in gamma and m is the
|
|
250421
|
+
* * `gamma = 2R/sqrt(4RR-LL)` pushes y up a little bit to simulate the lost series terms.
|
|
250360
250422
|
* @param localToWorld
|
|
250361
|
-
* @param nominalL1 nominal length along the spiral
|
|
250423
|
+
* @param nominalL1 nominal length along the spiral.
|
|
250362
250424
|
* @param nominalR1
|
|
250363
250425
|
* @param activeInterval
|
|
250364
250426
|
*/
|
|
@@ -250370,12 +250432,12 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250370
250432
|
}
|
|
250371
250433
|
/**
|
|
250372
250434
|
* Create an MX Cubic whose nominal length is close to along the curve.
|
|
250373
|
-
* This is y= m*x^3 with
|
|
250374
|
-
* * m is 1/ (6RL1)
|
|
250435
|
+
* This is y = m*x^3 with
|
|
250436
|
+
* * m is 1/ (6RL1).
|
|
250375
250437
|
* * 1/(6RL) is the leading term of the sine series.
|
|
250376
|
-
* * L1 is an along-the-x-axis distance that is slightly LESS THAN the nominal length
|
|
250377
|
-
* * x is axis position that is slightly LESS than nominal distance along
|
|
250378
|
-
* * L1, x use the approximation
|
|
250438
|
+
* * L1 is an along-the-x-axis distance that is slightly LESS THAN the nominal length.
|
|
250439
|
+
* * x is axis position that is slightly LESS than nominal distance along.
|
|
250440
|
+
* * L1, x use the approximation `x = s * ( 1 - s^4/ (40 R R L L))
|
|
250379
250441
|
* @param localToWorld
|
|
250380
250442
|
* @param nominalL1
|
|
250381
250443
|
* @param nominalR1
|
|
@@ -250390,11 +250452,11 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250390
250452
|
/**
|
|
250391
250453
|
* Create a polish cubic
|
|
250392
250454
|
* This is y= m*x^3 with
|
|
250393
|
-
* * m is 1/ (6RL)
|
|
250455
|
+
* * m is 1/ (6RL).
|
|
250394
250456
|
* * 1/(6RL) is the leading term of the sine series.
|
|
250395
|
-
* * L is nominal length
|
|
250457
|
+
* * L is nominal length.
|
|
250396
250458
|
* * R is nominal end radius.
|
|
250397
|
-
* * x ranges up to the x axis distance for which the polish distance series produces f(x)=L
|
|
250459
|
+
* * x ranges up to the x axis distance for which the polish distance series produces f(x) = L.
|
|
250398
250460
|
* * The support class PolishCubicEvaluator has static methods for the distance series and its inversion.
|
|
250399
250461
|
*/
|
|
250400
250462
|
static createPolishCubic(localToWorld, nominalL1, nominalR1, activeInterval) {
|
|
@@ -250406,9 +250468,9 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250406
250468
|
/**
|
|
250407
250469
|
* Create an AustralianRailCorp spiral
|
|
250408
250470
|
* This is y= m*x^3 with
|
|
250409
|
-
* * x any point on the x axis
|
|
250410
|
-
* * `fraction` along the spiral goes to `x = fraction * L
|
|
250411
|
-
* * m is gamma / (6RL)
|
|
250471
|
+
* * x any point on the x axis.
|
|
250472
|
+
* * `fraction` along the spiral goes to `x = fraction * L`.
|
|
250473
|
+
* * m is gamma / (6RL).
|
|
250412
250474
|
* * 1/(6RL) is the leading term of the sine series.
|
|
250413
250475
|
* * `gamma = 2R/sqrt (4RR-LL)` pushes y up a little bit to simulate the lost series terms.
|
|
250414
250476
|
* @param localToWorld
|
|
@@ -250423,64 +250485,65 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250423
250485
|
return new DirectSpiral3d(localToWorld.clone(), "AustralianRailCorp", undefined, nominalL1, nominalR1, activeInterval ? activeInterval.clone() : _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_5__.Segment1d.create(0, 1), evaluator);
|
|
250424
250486
|
}
|
|
250425
250487
|
static createDirectHalfCosine(localToWorld, nominalL1, nominalR1, activeInterval) {
|
|
250426
|
-
return new
|
|
250488
|
+
return new DirectSpiral3d(localToWorld, "HalfCosine", undefined, nominalL1, nominalR1, activeInterval, new _DirectHalfCosineSpiralEvaluator__WEBPACK_IMPORTED_MODULE_10__.DirectHalfCosineSpiralEvaluator(nominalL1, nominalR1));
|
|
250427
250489
|
}
|
|
250428
250490
|
/**
|
|
250429
250491
|
* Create an Arema spiral clothoid approximation
|
|
250430
|
-
* * X is 2 terms of the clothoid series as a function of nominal distance along
|
|
250431
|
-
* * Y is 2 terms f the clothoid series as a function of nominal distance along
|
|
250432
|
-
* * Remark: This is identical to the ChineseCubic
|
|
250433
|
-
* @param localToWorld axes with inflection at origin, tangent along x axis
|
|
250492
|
+
* * X is 2 terms of the clothoid series as a function of nominal distance along.
|
|
250493
|
+
* * Y is 2 terms f the clothoid series as a function of nominal distance along.
|
|
250494
|
+
* * Remark: This is identical to the ChineseCubic.
|
|
250495
|
+
* @param localToWorld axes with inflection at origin, tangent along x axis.
|
|
250434
250496
|
* @param nominalL1 nominal length as used in series LR terms.
|
|
250435
|
-
* @param nominalR1 nominal final radius as used in series LR terms
|
|
250436
|
-
* @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along
|
|
250497
|
+
* @param nominalR1 nominal final radius as used in series LR terms.
|
|
250498
|
+
* @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along.
|
|
250437
250499
|
*/
|
|
250438
250500
|
static createArema(localToWorld, nominalL1, nominalR1, activeInterval) {
|
|
250439
250501
|
return this.createTruncatedClothoid("Arema", localToWorld, 2, 2, undefined, nominalL1, nominalR1, activeInterval);
|
|
250440
250502
|
}
|
|
250441
250503
|
/**
|
|
250442
250504
|
* Create a Chinese clothoid approximation
|
|
250443
|
-
* * X is 2 terms of the clothoid series as a function of nominal distance along
|
|
250444
|
-
* * Y is 2 terms f the clothoid series as a function of nominal distance along
|
|
250445
|
-
* * Remark: This is identical to the Arema spiral
|
|
250446
|
-
* @param localToWorld axes with inflection at origin, tangent along x axis
|
|
250505
|
+
* * X is 2 terms of the clothoid series as a function of nominal distance along.
|
|
250506
|
+
* * Y is 2 terms f the clothoid series as a function of nominal distance along.
|
|
250507
|
+
* * Remark: This is identical to the Arema spiral.
|
|
250508
|
+
* @param localToWorld axes with inflection at origin, tangent along x axis.
|
|
250447
250509
|
* @param nominalL1 nominal length as used in series LR terms.
|
|
250448
|
-
* @param nominalR1 nominal final radius as used in series LR terms
|
|
250449
|
-
* @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along
|
|
250510
|
+
* @param nominalR1 nominal final radius as used in series LR terms.
|
|
250511
|
+
* @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along.
|
|
250450
250512
|
*/
|
|
250451
250513
|
static createChineseCubic(localToWorld, nominalL1, nominalR1, activeInterval) {
|
|
250452
250514
|
return this.createTruncatedClothoid("ChineseCubic", localToWorld, 2, 2, undefined, nominalL1, nominalR1, activeInterval);
|
|
250453
250515
|
}
|
|
250454
250516
|
/**
|
|
250455
250517
|
* Create a Western Australian direct spiral.
|
|
250456
|
-
* * X is 2 terms of the clothoid series as a function of distance along
|
|
250457
|
-
* * Y is 1 term (cubic in nominal distance along)
|
|
250458
|
-
* @param localToWorld axes with inflection at origin, tangent along x axis
|
|
250518
|
+
* * X is 2 terms of the clothoid series as a function of distance along.
|
|
250519
|
+
* * Y is 1 term (cubic in nominal distance along).
|
|
250520
|
+
* @param localToWorld axes with inflection at origin, tangent along x axis.
|
|
250459
250521
|
* @param nominalL1 nominal length as used in series LR terms.
|
|
250460
|
-
* @param nominalR1 nominal final radius as used in series LR terms
|
|
250461
|
-
* @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along
|
|
250522
|
+
* @param nominalR1 nominal final radius as used in series LR terms.
|
|
250523
|
+
* @param activeInterval fractional interval with (0, nominalL1) range for nominal distance along.
|
|
250462
250524
|
*/
|
|
250463
250525
|
static createWesternAustralian(localToWorld, nominalL1, nominalR1, activeInterval) {
|
|
250464
250526
|
return this.createTruncatedClothoid("WesternAustralian", localToWorld, 2, 1, undefined, nominalL1, nominalR1, activeInterval);
|
|
250465
250527
|
}
|
|
250466
250528
|
/**
|
|
250467
250529
|
* Create (if possible) a DirectSpiral3d, applying various strict conditions appropriate to the spiral type.
|
|
250468
|
-
* The parameter list includes extraneous values in order to directly match IntegratedSpiral3d.create, which has
|
|
250469
|
-
*
|
|
250470
|
-
* * IMPORTANT RESTRICTIONS
|
|
250530
|
+
* The parameter list includes extraneous values in order to directly match IntegratedSpiral3d.create, which has
|
|
250531
|
+
* greater flexibility about mixtures of values.
|
|
250532
|
+
* * IMPORTANT RESTRICTIONS:
|
|
250471
250533
|
* * Direct spirals must have the inflection at the origin of their coordinate system, aligned with the x axis.
|
|
250472
|
-
* * hence bearing0 = 0
|
|
250473
|
-
* * hence radius0 = 0
|
|
250474
|
-
* * bearing1 is ignored
|
|
250534
|
+
* * hence bearing0 = 0.
|
|
250535
|
+
* * hence radius0 = 0.
|
|
250536
|
+
* * bearing1 is ignored.
|
|
250475
250537
|
* * radius1 must be given.
|
|
250476
250538
|
* * arcLength must be given,
|
|
250477
|
-
* @param spiralType one of the types in `
|
|
250478
|
-
* @param radius0 radius (or 0 for tangent to line) at start.
|
|
250539
|
+
* @param spiralType one of the types in `DirectSpiralTypeName`
|
|
250540
|
+
* @param radius0 radius (or 0 for tangent to line) at start. Must be ZERO or UNDEFINED
|
|
250479
250541
|
* @param radius1 radius (or 0 for tangent to line) at end.
|
|
250480
|
-
* @param bearing0 bearing, measured CCW from x axis at start.
|
|
250481
|
-
* @param bearing1 bearing, measured CCW from x axis at end.
|
|
250482
|
-
* @param fractionInterval optional fractional interval for an "active" portion of the curve.
|
|
250483
|
-
*
|
|
250542
|
+
* @param bearing0 bearing, measured CCW from x axis at start. Must be ZERO or UNDEFINED
|
|
250543
|
+
* @param bearing1 bearing, measured CCW from x axis at end. IGNORED.
|
|
250544
|
+
* @param fractionInterval (optional) fractional interval for an "active" portion of the curve. If omitted, the
|
|
250545
|
+
* full [0,1] is used.
|
|
250546
|
+
* @param localToWorld placement transform.
|
|
250484
250547
|
*/
|
|
250485
250548
|
static createFromLengthAndRadius(spiralType, radius0, radius1, bearing0, _bearing1, arcLength, activeInterval, localToWorld) {
|
|
250486
250549
|
if (bearing0 !== undefined && !bearing0.isAlmostZero)
|
|
@@ -250513,11 +250576,11 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250513
250576
|
return this.createPolishCubic(localToWorld, arcLength, radius1, activeInterval);
|
|
250514
250577
|
return undefined;
|
|
250515
250578
|
}
|
|
250516
|
-
/** Deep clone of this spiral */
|
|
250579
|
+
/** Deep clone of this spiral. */
|
|
250517
250580
|
clone() {
|
|
250518
250581
|
return new DirectSpiral3d(this.localToWorld.clone(), this._spiralType, this.designProperties?.clone(), this._nominalL1, this._nominalR1, this._activeFractionInterval?.clone(), this._evaluator.clone());
|
|
250519
250582
|
}
|
|
250520
|
-
/**
|
|
250583
|
+
/** Apply `transform` to this spiral's local to world transform. */
|
|
250521
250584
|
tryTransformInPlace(transformA) {
|
|
250522
250585
|
const rigidData = this.applyRigidPartOfTransform(transformA);
|
|
250523
250586
|
if (rigidData !== undefined) {
|
|
@@ -250532,17 +250595,18 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250532
250595
|
startPoint(result) {
|
|
250533
250596
|
return this.activeStrokes.startPoint(result);
|
|
250534
250597
|
}
|
|
250535
|
-
/**
|
|
250598
|
+
/** Return the spiral end point. */
|
|
250536
250599
|
endPoint(result) {
|
|
250537
250600
|
return this.activeStrokes.endPoint(result);
|
|
250538
250601
|
}
|
|
250539
|
-
/**
|
|
250602
|
+
/** Test if the local to world transform places the spiral xy plane into `plane`. */
|
|
250540
250603
|
isInPlane(plane) {
|
|
250541
250604
|
return plane.isPointInPlane(this.localToWorld.origin)
|
|
250542
250605
|
&& _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))
|
|
250543
250606
|
&& _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));
|
|
250544
250607
|
}
|
|
250545
|
-
/**
|
|
250608
|
+
/**
|
|
250609
|
+
* Return quick length of the spiral.
|
|
250546
250610
|
* The tangent vector of a true clothoid is length 1 everywhere, so simple proportion of nominalL1 is a good approximation.
|
|
250547
250611
|
*/
|
|
250548
250612
|
quickLength() {
|
|
@@ -250550,18 +250614,24 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250550
250614
|
const n = distanceData.length;
|
|
250551
250615
|
return distanceData.getYAtUncheckedPointIndex(n - 1);
|
|
250552
250616
|
}
|
|
250553
|
-
|
|
250554
|
-
|
|
250555
|
-
|
|
250556
|
-
//
|
|
250617
|
+
// We claim true length is stored at the back of `packedUVParams`.
|
|
250618
|
+
// Nevertheless defer to the generic integrator in the default implementation.
|
|
250619
|
+
// public override curveLength() {
|
|
250620
|
+
// return this.quickLength();
|
|
250621
|
+
// }
|
|
250557
250622
|
/** Test if `other` is an instance of `TransitionSpiral3d` */
|
|
250558
|
-
isSameGeometryClass(other) {
|
|
250559
|
-
|
|
250560
|
-
|
|
250623
|
+
isSameGeometryClass(other) {
|
|
250624
|
+
return other instanceof _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.TransitionSpiral3d;
|
|
250625
|
+
}
|
|
250626
|
+
/**
|
|
250627
|
+
* Add strokes from this spiral to `dest`.
|
|
250628
|
+
* * Line strings will usually stroke as just their points.
|
|
250561
250629
|
* * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.
|
|
250562
250630
|
*/
|
|
250563
|
-
emitStrokes(dest, options) {
|
|
250564
|
-
|
|
250631
|
+
emitStrokes(dest, options) {
|
|
250632
|
+
this.activeStrokes.emitStrokes(dest, options);
|
|
250633
|
+
}
|
|
250634
|
+
/** Emit stroke fragments to `dest` handler. */
|
|
250565
250635
|
emitStrokableParts(dest, options) {
|
|
250566
250636
|
const n = this.computeStrokeCountForOptions(options);
|
|
250567
250637
|
const activeStrokes = this.activeStrokes;
|
|
@@ -250582,8 +250652,8 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250582
250652
|
dest.endParentCurvePrimitive(this);
|
|
250583
250653
|
}
|
|
250584
250654
|
/**
|
|
250585
|
-
*
|
|
250586
|
-
* @param options StrokeOptions that determine count
|
|
250655
|
+
* Return the stroke count required for given options.
|
|
250656
|
+
* @param options StrokeOptions that determine count.
|
|
250587
250657
|
*/
|
|
250588
250658
|
computeStrokeCountForOptions(options) {
|
|
250589
250659
|
let numStroke;
|
|
@@ -250600,8 +250670,9 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250600
250670
|
numStroke = Math.ceil(this._activeFractionInterval.absoluteDelta() * numStroke);
|
|
250601
250671
|
return numStroke;
|
|
250602
250672
|
}
|
|
250603
|
-
/**
|
|
250604
|
-
*
|
|
250673
|
+
/**
|
|
250674
|
+
* Reverse the active interval and active strokes.
|
|
250675
|
+
* * Primary defining data remains unchanged.
|
|
250605
250676
|
*/
|
|
250606
250677
|
reverseInPlace() {
|
|
250607
250678
|
this._activeFractionInterval.reverseInPlace();
|
|
@@ -250624,10 +250695,11 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250624
250695
|
result.transformInPlace(this.localToWorld);
|
|
250625
250696
|
return result;
|
|
250626
250697
|
}
|
|
250627
|
-
/**
|
|
250628
|
-
*
|
|
250629
|
-
* * origin at fractional position along the curve
|
|
250630
|
-
* * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to
|
|
250698
|
+
/**
|
|
250699
|
+
* Return a plane with
|
|
250700
|
+
* * origin at fractional position along the curve.
|
|
250701
|
+
* * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to
|
|
250702
|
+
* the fraction.
|
|
250631
250703
|
* * vectorV is the second derivative, i.e.derivative of vectorU.
|
|
250632
250704
|
*/
|
|
250633
250705
|
fractionToPointAnd2Derivatives(activeFraction, result) {
|
|
@@ -250639,11 +250711,11 @@ class DirectSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.Tr
|
|
|
250639
250711
|
result.transformInPlace(this.localToWorld);
|
|
250640
250712
|
return result;
|
|
250641
250713
|
}
|
|
250642
|
-
/** Second step of double dispatch:
|
|
250714
|
+
/** Second step of double dispatch: call `handler.handleTransitionSpiral(this)`. */
|
|
250643
250715
|
dispatchToGeometryHandler(handler) {
|
|
250644
250716
|
return handler.handleTransitionSpiral(this);
|
|
250645
250717
|
}
|
|
250646
|
-
/**
|
|
250718
|
+
/** Compare various coordinate quantities. */
|
|
250647
250719
|
isAlmostEqual(other) {
|
|
250648
250720
|
if (other instanceof DirectSpiral3d) {
|
|
250649
250721
|
return _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSameCoordinate(this._nominalL1, other._nominalL1)
|
|
@@ -250707,35 +250779,40 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
250707
250779
|
|
|
250708
250780
|
/**
|
|
250709
250781
|
* An IntegratedSpiral3d is a curve defined by integrating its curvature.
|
|
250710
|
-
* * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians)
|
|
250782
|
+
* * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians).
|
|
250711
250783
|
* * Integrating (cos(theta), sin(theta)) gives displacement from the start point, and thus the actual curve position.
|
|
250712
|
-
* * The curvature functions of interest are all symmetric snap functions in the NormalizedTransition class.
|
|
250713
|
-
* *
|
|
250784
|
+
* * The curvature functions of interest are all symmetric snap functions in the [[NormalizedTransition]] class.
|
|
250785
|
+
* * [[TransitionConditionalProperties]] implements the computations of the interrelationship of radii, bearing, and length.
|
|
250714
250786
|
* @public
|
|
250715
250787
|
*/
|
|
250716
250788
|
class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.TransitionSpiral3d {
|
|
250717
|
-
/** String name for schema properties */
|
|
250789
|
+
/** String name for schema properties. */
|
|
250718
250790
|
curvePrimitiveType = "transitionSpiral";
|
|
250719
|
-
/**
|
|
250791
|
+
/** Start and end radii as a Segment1d. */
|
|
250720
250792
|
radius01;
|
|
250721
|
-
/**
|
|
250793
|
+
/** Start and end bearings as an AngleSweep. */
|
|
250722
250794
|
bearing01;
|
|
250723
|
-
/**
|
|
250795
|
+
/** Stroked approximation of entire spiral. */
|
|
250724
250796
|
_globalStrokes;
|
|
250725
|
-
/**
|
|
250726
|
-
*
|
|
250727
|
-
* *
|
|
250797
|
+
/**
|
|
250798
|
+
* Stroked approximation of active spiral.
|
|
250799
|
+
* * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed
|
|
250800
|
+
* as partial versus complete.
|
|
250801
|
+
* * If no trimming, this points to the same place as the _globalStrokes. DO NOT double transform.
|
|
250728
250802
|
*/
|
|
250729
250803
|
_activeStrokes;
|
|
250730
|
-
/** Return the internal stroked form of the (possibly partial) spiral
|
|
250731
|
-
get activeStrokes() {
|
|
250804
|
+
/** Return the internal stroked form of the (possibly partial) spiral. */
|
|
250805
|
+
get activeStrokes() {
|
|
250806
|
+
return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes;
|
|
250807
|
+
}
|
|
250808
|
+
/** Evaluator for transition. */
|
|
250732
250809
|
_evaluator;
|
|
250733
|
-
/** Total curve arc length (computed) */
|
|
250810
|
+
/** Total curve arc length (computed). */
|
|
250734
250811
|
_arcLength01;
|
|
250735
|
-
/** Curvatures (inverse radii) at start and end */
|
|
250812
|
+
/** Curvatures (inverse radii) at start and end. */
|
|
250736
250813
|
_curvature01;
|
|
250737
|
-
|
|
250738
|
-
//
|
|
250814
|
+
// constructor demands all bearing, radius, and length data.
|
|
250815
|
+
// caller determines usual dependency of "any 4 determine the 5th".
|
|
250739
250816
|
constructor(spiralType, evaluator, radius01, bearing01, activeFractionInterval, localToWorld, arcLength, properties) {
|
|
250740
250817
|
super(spiralType, localToWorld, activeFractionInterval, properties);
|
|
250741
250818
|
this._evaluator = evaluator;
|
|
@@ -250743,29 +250820,32 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
250743
250820
|
this.bearing01 = bearing01;
|
|
250744
250821
|
this._arcLength01 = arcLength;
|
|
250745
250822
|
this._globalStrokes = _LineString3d__WEBPACK_IMPORTED_MODULE_1__.LineString3d.create();
|
|
250746
|
-
// initialize for compiler
|
|
250823
|
+
// initialize for compiler; but this will be recomputed in refreshComputeProperties
|
|
250747
250824
|
this._curvature01 = _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_2__.Segment1d.create(0, 1);
|
|
250748
250825
|
this.refreshComputedProperties();
|
|
250749
250826
|
}
|
|
250750
|
-
/**
|
|
250827
|
+
/** Default spiral type name: clothoid. */
|
|
250751
250828
|
static defaultSpiralType = "clothoid";
|
|
250752
|
-
/**
|
|
250829
|
+
/** Use the integrated function to return an angle at fractional position. */
|
|
250753
250830
|
globalFractionToBearingRadians(fraction) {
|
|
250754
250831
|
const areaFraction = this._evaluator.fractionToArea(fraction);
|
|
250755
250832
|
const dx = this._arcLength01;
|
|
250756
|
-
return this.bearing01.startRadians + areaFraction * dx * this._curvature01.signedDelta()
|
|
250833
|
+
return this.bearing01.startRadians + areaFraction * dx * this._curvature01.signedDelta()
|
|
250834
|
+
+ fraction * this._curvature01.x0 * dx;
|
|
250757
250835
|
}
|
|
250758
|
-
/**
|
|
250836
|
+
/** Use the integrated function to return an angle at fractional position. */
|
|
250759
250837
|
globalFractionToCurvature(fraction) {
|
|
250760
250838
|
const f = this._evaluator.fractionToCurvatureFraction(fraction);
|
|
250761
250839
|
return this._curvature01.fractionToPoint(f);
|
|
250762
250840
|
}
|
|
250763
|
-
/** Return the bearing at given fraction of the active interval
|
|
250841
|
+
/** Return the bearing at given fraction of the active interval. */
|
|
250764
250842
|
fractionToBearingRadians(activeFraction) {
|
|
250765
250843
|
const fraction = this.activeFractionInterval.fractionToPoint(activeFraction);
|
|
250766
|
-
return this.bearing01.startRadians
|
|
250844
|
+
return this.bearing01.startRadians
|
|
250845
|
+
+ fraction * this._arcLength01 * (this._curvature01.x0 + 0.5 * fraction * (this._curvature01.x1 - this._curvature01.x0));
|
|
250767
250846
|
}
|
|
250768
|
-
/**
|
|
250847
|
+
/**
|
|
250848
|
+
* Return the curvature at given fraction of the active interval.
|
|
250769
250849
|
* * The `undefined` result is to match the abstract class -- it cannot actually occur.
|
|
250770
250850
|
*/
|
|
250771
250851
|
fractionToCurvature(activeFraction) {
|
|
@@ -250782,14 +250862,15 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
250782
250862
|
IntegratedSpiral3d._gaussWeight = new Float64Array(5);
|
|
250783
250863
|
IntegratedSpiral3d._gaussMapper = (xA, xB, xMapped, wMapped) => _numerics_Quadrature__WEBPACK_IMPORTED_MODULE_3__.Quadrature.setupGauss5(xA, xB, xMapped, wMapped);
|
|
250784
250864
|
}
|
|
250785
|
-
/**
|
|
250786
|
-
*
|
|
250865
|
+
/**
|
|
250866
|
+
* Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference
|
|
250867
|
+
* length (recall that theta is a nonlinear function of the fraction).
|
|
250787
250868
|
* * This is a single interval of gaussian integration.
|
|
250788
|
-
* * The fraction is on the full spiral (not in the mapped active interval)
|
|
250869
|
+
* * The fraction is on the full spiral (not in the mapped active interval).
|
|
250789
250870
|
* @param xyz advancing integrated point.
|
|
250790
|
-
* @param fractionA fraction at start of interval
|
|
250871
|
+
* @param fractionA fraction at start of interval.
|
|
250791
250872
|
* @param fractionB fraction at end of interval.
|
|
250792
|
-
* @param unitArcLength length of curve for 0 to 1 fractional
|
|
250873
|
+
* @param unitArcLength length of curve for 0 to 1 fractional.
|
|
250793
250874
|
*/
|
|
250794
250875
|
fullSpiralIncrementalIntegral(xyz, fractionA, fractionB, applyMatrix) {
|
|
250795
250876
|
const gaussFraction = IntegratedSpiral3d._gaussFraction;
|
|
@@ -250810,7 +250891,7 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
250810
250891
|
else
|
|
250811
250892
|
xyz.addXYZInPlace(dx, dy, 0.0);
|
|
250812
250893
|
}
|
|
250813
|
-
/** Recompute strokes */
|
|
250894
|
+
/** Recompute strokes. */
|
|
250814
250895
|
refreshComputedProperties() {
|
|
250815
250896
|
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));
|
|
250816
250897
|
this._globalStrokes.clear();
|
|
@@ -250829,8 +250910,9 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
250829
250910
|
if (this._activeStrokes === undefined)
|
|
250830
250911
|
this._activeStrokes = _LineString3d__WEBPACK_IMPORTED_MODULE_1__.LineString3d.create();
|
|
250831
250912
|
this._activeStrokes.clear();
|
|
250832
|
-
// finer strokes
|
|
250833
|
-
//
|
|
250913
|
+
// The active interval has finer strokes: it's the same fraction step but mapped to a sub-interval.
|
|
250914
|
+
// Below assumes fractionToPoint depends upon the global strokes we just computed, and not
|
|
250915
|
+
// on the active strokes we are computing.
|
|
250834
250916
|
for (let i = 0; i <= numInterval; i++) {
|
|
250835
250917
|
const localFraction = i * fractionStep;
|
|
250836
250918
|
this._activeStrokes.addPoint(this.fractionToPoint(localFraction));
|
|
@@ -250839,10 +250921,11 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
250839
250921
|
}
|
|
250840
250922
|
/**
|
|
250841
250923
|
* Create a transition spiral with radius and bearing conditions.
|
|
250842
|
-
* @param radius01 radius (inverse curvature) at start and end
|
|
250843
|
-
* @param bearing01 bearing angles at start and end. bearings are measured from the x axis, positive clockwise
|
|
250924
|
+
* @param radius01 radius (inverse curvature) at start and end (radius of zero means straight line).
|
|
250925
|
+
* @param bearing01 bearing angles at start and end. bearings are measured from the x axis, positive clockwise
|
|
250926
|
+
* towards y axis.
|
|
250844
250927
|
* @param activeFractionInterval fractional limits of the active portion of the spiral.
|
|
250845
|
-
* @param localToWorld placement frame.
|
|
250928
|
+
* @param localToWorld placement frame. Fractional coordinate 0 is at the origin.
|
|
250846
250929
|
*/
|
|
250847
250930
|
static createRadiusRadiusBearingBearing(radius01, bearing01, activeFractionInterval, localToWorld, typeName) {
|
|
250848
250931
|
const arcLength = _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(radius01.x0, radius01.x1, bearing01.sweepRadians);
|
|
@@ -250857,12 +250940,13 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
250857
250940
|
* Create a transition spiral.
|
|
250858
250941
|
* * Inputs must provide exactly 4 of the 5 values `[radius0,radius1,bearing0,bearing1,length`.
|
|
250859
250942
|
* @param spiralType one of "clothoid", "bloss", "biquadratic", "cosine", "sine". If undefined, "clothoid" is used.
|
|
250860
|
-
* @param radius0 radius (or 0 for tangent to line) at start
|
|
250861
|
-
* @param radius1 radius (or 0 for tangent to line) at end
|
|
250943
|
+
* @param radius0 radius (or 0 for tangent to line) at start.
|
|
250944
|
+
* @param radius1 radius (or 0 for tangent to line) at end.
|
|
250862
250945
|
* @param bearing0 bearing, measured CCW from x axis at start.
|
|
250863
250946
|
* @param bearing1 bearing, measured CCW from x axis at end.
|
|
250864
|
-
* @param fractionInterval optional fractional interval for an "active" portion of the curve.
|
|
250865
|
-
*
|
|
250947
|
+
* @param fractionInterval optional fractional interval for an "active" portion of the curve. If omitted, the full
|
|
250948
|
+
* [0,1] is used.
|
|
250949
|
+
* @param localToWorld placement transform.
|
|
250866
250950
|
*/
|
|
250867
250951
|
static createFrom4OutOf5(spiralType, radius0, radius1, bearing0, bearing1, arcLength, fractionInterval, localToWorld) {
|
|
250868
250952
|
if (spiralType === undefined)
|
|
@@ -250889,11 +250973,11 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
250889
250973
|
this._arcLength01 = other._arcLength01;
|
|
250890
250974
|
return this;
|
|
250891
250975
|
}
|
|
250892
|
-
/** Deep clone of this spiral */
|
|
250976
|
+
/** Deep clone of this spiral. */
|
|
250893
250977
|
clone() {
|
|
250894
250978
|
return new IntegratedSpiral3d(this._spiralType, this._evaluator, this.radius01.clone(), this.bearing01.clone(), this.activeFractionInterval.clone(), this.localToWorld.clone(), this._arcLength01, this._designProperties?.clone());
|
|
250895
250979
|
}
|
|
250896
|
-
/**
|
|
250980
|
+
/** Apply `transform` to this spiral's local to world transform. */
|
|
250897
250981
|
tryTransformInPlace(transformA) {
|
|
250898
250982
|
const rigidData = this.applyRigidPartOfTransform(transformA);
|
|
250899
250983
|
if (rigidData !== undefined) {
|
|
@@ -250910,32 +250994,50 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
250910
250994
|
startPoint(result) {
|
|
250911
250995
|
return this.activeStrokes.startPoint(result);
|
|
250912
250996
|
}
|
|
250913
|
-
/**
|
|
250997
|
+
/** Return the spiral end point. */
|
|
250914
250998
|
endPoint(result) {
|
|
250915
250999
|
return this.activeStrokes.endPoint(result);
|
|
250916
251000
|
}
|
|
250917
|
-
/**
|
|
251001
|
+
/** Test if the local to world transform places the spiral xy plane into `plane`. */
|
|
250918
251002
|
isInPlane(plane) {
|
|
250919
251003
|
return plane.isPointInPlane(this.localToWorld.origin)
|
|
250920
251004
|
&& _Geometry__WEBPACK_IMPORTED_MODULE_9__.Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))
|
|
250921
251005
|
&& _Geometry__WEBPACK_IMPORTED_MODULE_9__.Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));
|
|
250922
251006
|
}
|
|
250923
|
-
/**
|
|
250924
|
-
|
|
250925
|
-
|
|
250926
|
-
|
|
250927
|
-
|
|
251007
|
+
/**
|
|
251008
|
+
* Return length of the spiral.
|
|
251009
|
+
* * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.
|
|
251010
|
+
*/
|
|
251011
|
+
quickLength() {
|
|
251012
|
+
return this.curveLength();
|
|
251013
|
+
}
|
|
251014
|
+
/**
|
|
251015
|
+
* Return length of the spiral.
|
|
251016
|
+
* * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.
|
|
251017
|
+
*/
|
|
251018
|
+
curveLength() {
|
|
251019
|
+
return this._arcLength01 * (this._activeFractionInterval.absoluteDelta());
|
|
251020
|
+
}
|
|
251021
|
+
/**
|
|
251022
|
+
* Return (unsigned) length of the spiral between fractions.
|
|
251023
|
+
* * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.
|
|
251024
|
+
*/
|
|
250928
251025
|
curveLengthBetweenFractions(fraction0, fraction1) {
|
|
250929
251026
|
return this._arcLength01 * (this._activeFractionInterval.absoluteDelta() * Math.abs(fraction1 - fraction0));
|
|
250930
251027
|
}
|
|
250931
|
-
/** Test if `other` is an instance of `TransitionSpiral3d
|
|
250932
|
-
isSameGeometryClass(other) {
|
|
250933
|
-
|
|
251028
|
+
/** Test if `other` is an instance of `TransitionSpiral3d`. */
|
|
251029
|
+
isSameGeometryClass(other) {
|
|
251030
|
+
return other instanceof _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0__.TransitionSpiral3d;
|
|
251031
|
+
}
|
|
251032
|
+
/**
|
|
251033
|
+
* Add strokes from this spiral to `dest`.
|
|
250934
251034
|
* * Linestrings will usually stroke as just their points.
|
|
250935
251035
|
* * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.
|
|
250936
251036
|
*/
|
|
250937
|
-
emitStrokes(dest, options) {
|
|
250938
|
-
|
|
251037
|
+
emitStrokes(dest, options) {
|
|
251038
|
+
this.activeStrokes.emitStrokes(dest, options);
|
|
251039
|
+
}
|
|
251040
|
+
/** Emit stroke fragments to `dest` handler. */
|
|
250939
251041
|
emitStrokableParts(dest, options) {
|
|
250940
251042
|
const n = this.computeStrokeCountForOptions(options);
|
|
250941
251043
|
dest.startParentCurvePrimitive(this);
|
|
@@ -250950,8 +251052,8 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
250950
251052
|
dest.endParentCurvePrimitive(this);
|
|
250951
251053
|
}
|
|
250952
251054
|
/**
|
|
250953
|
-
*
|
|
250954
|
-
* @param options StrokeOptions that determine count
|
|
251055
|
+
* Return the stroke count required for given options.
|
|
251056
|
+
* @param options StrokeOptions that determine count.
|
|
250955
251057
|
*/
|
|
250956
251058
|
computeStrokeCountForOptions(options) {
|
|
250957
251059
|
let numStroke;
|
|
@@ -250966,8 +251068,9 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
250966
251068
|
}
|
|
250967
251069
|
return numStroke;
|
|
250968
251070
|
}
|
|
250969
|
-
/**
|
|
250970
|
-
*
|
|
251071
|
+
/**
|
|
251072
|
+
* Reverse the active interval and active strokes.
|
|
251073
|
+
* * Primary defining data remains unchanged.
|
|
250971
251074
|
*/
|
|
250972
251075
|
reverseInPlace() {
|
|
250973
251076
|
this.activeFractionInterval.reverseInPlace();
|
|
@@ -251005,10 +251108,10 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
251005
251108
|
}
|
|
251006
251109
|
else {
|
|
251007
251110
|
const clampedGlobalFraction = _Geometry__WEBPACK_IMPORTED_MODULE_9__.Geometry.clampToStartEnd(targetGlobalFraction, 0, 1);
|
|
251008
|
-
const index0 = Math.trunc(clampedGlobalFraction * numStrokes); //
|
|
251111
|
+
const index0 = Math.trunc(clampedGlobalFraction * numStrokes); // this indexes the point to the left of the query
|
|
251009
251112
|
const globalFraction0 = index0 / numStrokes;
|
|
251010
251113
|
result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(index0, result);
|
|
251011
|
-
// GeometryCoreTestIO.consoleLog("
|
|
251114
|
+
// GeometryCoreTestIO.consoleLog("fractionToPoint ", activeFraction, this.activeFractionInterval, "( global integration " + globalFraction0 + " to " + globalFraction + ")", index0);
|
|
251012
251115
|
this.fullSpiralIncrementalIntegral(result, globalFraction0, targetGlobalFraction, true);
|
|
251013
251116
|
}
|
|
251014
251117
|
return result;
|
|
@@ -251035,10 +251138,11 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
251035
251138
|
result.matrix.applyGivensColumnOp(0, 1, c, s);
|
|
251036
251139
|
return result;
|
|
251037
251140
|
}
|
|
251038
|
-
/**
|
|
251039
|
-
*
|
|
251040
|
-
* * origin at fractional position along the curve
|
|
251041
|
-
* * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to
|
|
251141
|
+
/**
|
|
251142
|
+
* Return a plane with
|
|
251143
|
+
* * origin at fractional position along the curve.
|
|
251144
|
+
* * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to
|
|
251145
|
+
* the fraction.
|
|
251042
251146
|
* * vectorV is the second derivative, i.e.derivative of vectorU.
|
|
251043
251147
|
*/
|
|
251044
251148
|
fractionToPointAnd2Derivatives(activeFraction, result) {
|
|
@@ -251055,11 +251159,11 @@ class IntegratedSpiral3d extends _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_0_
|
|
|
251055
251159
|
vectorY.scaleInPlace(this.globalFractionToCurvature(globalFraction));
|
|
251056
251160
|
return _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_13__.Plane3dByOriginAndVectors.createCapture(origin, vectorX, vectorY, result);
|
|
251057
251161
|
}
|
|
251058
|
-
/** Second step of double dispatch: call `handler.handleTransitionSpiral(this)
|
|
251162
|
+
/** Second step of double dispatch: call `handler.handleTransitionSpiral(this)`. */
|
|
251059
251163
|
dispatchToGeometryHandler(handler) {
|
|
251060
251164
|
return handler.handleTransitionSpiral(this);
|
|
251061
251165
|
}
|
|
251062
|
-
/**
|
|
251166
|
+
/** Compare various coordinate quantities. */
|
|
251063
251167
|
isAlmostEqual(other) {
|
|
251064
251168
|
if (other instanceof IntegratedSpiral3d) {
|
|
251065
251169
|
return this.radius01.isAlmostEqual(other.radius01)
|
|
@@ -251103,16 +251207,11 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
251103
251207
|
/**
|
|
251104
251208
|
* MX Cubic along arc.
|
|
251105
251209
|
* This is y= m*x^3 with
|
|
251106
|
-
* * x any point on the x axis
|
|
251107
|
-
* * `fraction` along the spiral goes to `x = fraction * Lx
|
|
251108
|
-
* * m is (1/6RL)
|
|
251210
|
+
* * x any point on the x axis.
|
|
251211
|
+
* * `fraction` along the spiral goes to `x = fraction * Lx`.
|
|
251212
|
+
* * m is (1/6RL).
|
|
251109
251213
|
* * construction length L is nominal along the curve.
|
|
251110
251214
|
* * x length Lx is along the axis, determined by two terms of the clothoid x series.
|
|
251111
|
-
* *
|
|
251112
|
-
* @param localToWorld
|
|
251113
|
-
* @param nominalL1
|
|
251114
|
-
* @param nominalR1
|
|
251115
|
-
* @param activeInterval
|
|
251116
251215
|
* @internal
|
|
251117
251216
|
*/
|
|
251118
251217
|
class MXCubicAlongArcEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.CubicEvaluator {
|
|
@@ -251141,9 +251240,11 @@ class MXCubicAlongArcEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_
|
|
|
251141
251240
|
this.nominalRadius1 *= scaleFactor;
|
|
251142
251241
|
super.scaleInPlace(scaleFactor);
|
|
251143
251242
|
}
|
|
251144
|
-
/**
|
|
251145
|
-
clone() {
|
|
251146
|
-
|
|
251243
|
+
/** Return a deep copy of the evaluator. */
|
|
251244
|
+
clone() {
|
|
251245
|
+
return new MXCubicAlongArcEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM);
|
|
251246
|
+
}
|
|
251247
|
+
/** Member by member matchup. */
|
|
251147
251248
|
isAlmostEqual(other) {
|
|
251148
251249
|
if (other instanceof MXCubicAlongArcEvaluator) {
|
|
251149
251250
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)
|
|
@@ -251154,7 +251255,8 @@ class MXCubicAlongArcEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_
|
|
|
251154
251255
|
/**
|
|
251155
251256
|
* Return a (fast but mediocre) approximation of spiral x position as function of approximate distance along the curve.
|
|
251156
251257
|
* * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.
|
|
251157
|
-
* * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
|
|
251258
|
+
* * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
|
|
251259
|
+
* CurvePrimitive measurements.
|
|
251158
251260
|
* @param x distance along the x axis.
|
|
251159
251261
|
*/
|
|
251160
251262
|
static approximateDistanceAlongToX(nominalLength1, nominalRadius1, nominalDistanceAlong) {
|
|
@@ -251205,7 +251307,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
251205
251307
|
* @internal
|
|
251206
251308
|
*/
|
|
251207
251309
|
class NormalizedTransition {
|
|
251208
|
-
/** Constructor initializes with 0..1 values
|
|
251310
|
+
/** Constructor initializes with 0..1 values. Call "setBearingCurvatureLengthCurvature" to apply real values. */
|
|
251209
251311
|
constructor() { }
|
|
251210
251312
|
static _clothoidEvaluator;
|
|
251211
251313
|
static _biquadraticEvaluator;
|
|
@@ -251246,10 +251348,15 @@ class NormalizedTransition {
|
|
|
251246
251348
|
class NormalizedClothoidTransition extends NormalizedTransition {
|
|
251247
251349
|
constructor() { super(); }
|
|
251248
251350
|
/** At fractional position on the x axis, return the (normalized) curvature fraction. */
|
|
251249
|
-
fractionToCurvatureFraction(fractionX) {
|
|
251250
|
-
|
|
251251
|
-
|
|
251252
|
-
/** Return the
|
|
251351
|
+
fractionToCurvatureFraction(fractionX) {
|
|
251352
|
+
return fractionX;
|
|
251353
|
+
}
|
|
251354
|
+
/** Return the derivative of the (normalized) curvature fraction. */
|
|
251355
|
+
fractionToCurvatureFractionDerivative(_u) {
|
|
251356
|
+
return 1.0;
|
|
251357
|
+
}
|
|
251358
|
+
/**
|
|
251359
|
+
* Return the integrated area under the curve.
|
|
251253
251360
|
* * This fraction is the angular change fraction.
|
|
251254
251361
|
*/
|
|
251255
251362
|
fractionToArea(fractionX) {
|
|
@@ -251258,24 +251365,27 @@ class NormalizedClothoidTransition extends NormalizedTransition {
|
|
|
251258
251365
|
}
|
|
251259
251366
|
/**
|
|
251260
251367
|
* Transition functions for bloss spiral.
|
|
251261
|
-
* * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1
|
|
251368
|
+
* * curvature variation is cubic from (0,0) with slope 0 to (1,1) with slope 1.
|
|
251262
251369
|
* @internal
|
|
251263
251370
|
*/
|
|
251264
251371
|
class NormalizedBlossTransition extends NormalizedTransition {
|
|
251265
251372
|
// bloss curve is (3 - 2x) x ^2 = 3 x^2 - 2 x^3
|
|
251266
|
-
//
|
|
251267
|
-
//
|
|
251268
|
-
//
|
|
251269
|
-
//
|
|
251270
|
-
//
|
|
251373
|
+
// derivative 6x (1-x)
|
|
251374
|
+
// 2nd derivative 6 - 12 x
|
|
251375
|
+
// derivatives zero at 0,1
|
|
251376
|
+
// inflection zero at 0.5
|
|
251377
|
+
// integral is x^3 - x^4 / 2 = x^3 ( 1-x/2)
|
|
251271
251378
|
constructor() { super(); }
|
|
251272
251379
|
/** At fractional position on the x axis, return the (normalized) curvature fraction. */
|
|
251273
|
-
fractionToCurvatureFraction(u) {
|
|
251274
|
-
|
|
251380
|
+
fractionToCurvatureFraction(u) {
|
|
251381
|
+
return u * u * (3 - 2 * u);
|
|
251382
|
+
}
|
|
251383
|
+
/** Return the derivative of the (normalized) curvature fraction. */
|
|
251275
251384
|
fractionToCurvatureFractionDerivative(u) {
|
|
251276
251385
|
return 6.0 * u * (1.0 - u);
|
|
251277
251386
|
}
|
|
251278
|
-
/**
|
|
251387
|
+
/**
|
|
251388
|
+
* Return the integrated area under the curve.
|
|
251279
251389
|
* * This fraction is the angular change fraction.
|
|
251280
251390
|
*/
|
|
251281
251391
|
fractionToArea(u) {
|
|
@@ -251283,31 +251393,41 @@ class NormalizedBlossTransition extends NormalizedTransition {
|
|
|
251283
251393
|
}
|
|
251284
251394
|
}
|
|
251285
251395
|
/**
|
|
251286
|
-
* Transition functions for biquadratic transition
|
|
251396
|
+
* Transition functions for biquadratic transition.
|
|
251287
251397
|
* * Curvature is a pair of joining quadratics.
|
|
251288
|
-
* * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin
|
|
251289
|
-
* * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1
|
|
251398
|
+
* * In lower half of the interval, the quadratic is from (0,0) to (0.5, 0.5) with zero slope at origin.
|
|
251399
|
+
* * In upper half of the interval, the quadratic is from (0.5,0.5) to (1,1) with zero slope at 1.
|
|
251290
251400
|
* @internal
|
|
251291
251401
|
*/
|
|
251292
251402
|
class NormalizedBiQuadraticTransition extends NormalizedTransition {
|
|
251293
|
-
constructor() {
|
|
251294
|
-
|
|
251295
|
-
|
|
251296
|
-
|
|
251297
|
-
|
|
251298
|
-
|
|
251299
|
-
|
|
251300
|
-
|
|
251301
|
-
|
|
251403
|
+
constructor() {
|
|
251404
|
+
super();
|
|
251405
|
+
}
|
|
251406
|
+
integratedBasis(u) {
|
|
251407
|
+
return u * u * u * (2.0 / 3.0);
|
|
251408
|
+
}
|
|
251409
|
+
basis(u) {
|
|
251410
|
+
return 2 * u * u;
|
|
251411
|
+
}
|
|
251412
|
+
basisDerivative(u) {
|
|
251413
|
+
return 4 * u;
|
|
251414
|
+
}
|
|
251415
|
+
/**
|
|
251416
|
+
* At fractional position on the x axis, return the (normalized) curvature fraction.
|
|
251417
|
+
* * For [u <= 0.5, u >= 0.5]
|
|
251418
|
+
* * f(u) = [2 u^2, 1 - 2 (1-u)^2]
|
|
251419
|
+
* * f'(u) = [4 u, 4 (1-u)]
|
|
251420
|
+
* * If(u) = [2 u^3 / 3, 0.5 (1 -u )^3/3]
|
|
251302
251421
|
*/
|
|
251303
251422
|
fractionToCurvatureFraction(u) {
|
|
251304
251423
|
return u <= 0.5 ? this.basis(u) : 1.0 - this.basis(1.0 - u);
|
|
251305
251424
|
}
|
|
251306
|
-
/** Return the derivative of the (normalized) curvature fraction */
|
|
251425
|
+
/** Return the derivative of the (normalized) curvature fraction. */
|
|
251307
251426
|
fractionToCurvatureFractionDerivative(u) {
|
|
251308
251427
|
return u < 0.5 ? this.basisDerivative(u) : this.basisDerivative(1 - u);
|
|
251309
251428
|
}
|
|
251310
|
-
/**
|
|
251429
|
+
/**
|
|
251430
|
+
* Return the integrated area under the curve.
|
|
251311
251431
|
* * This fraction is the angular change fraction.
|
|
251312
251432
|
*/
|
|
251313
251433
|
fractionToArea(u) {
|
|
@@ -251318,10 +251438,10 @@ class NormalizedBiQuadraticTransition extends NormalizedTransition {
|
|
|
251318
251438
|
}
|
|
251319
251439
|
}
|
|
251320
251440
|
/**
|
|
251321
|
-
* Transition functions for sine transition
|
|
251441
|
+
* Transition functions for sine transition.
|
|
251322
251442
|
* * curvature variation is the sum of
|
|
251323
|
-
* * straight line from (0,0) to (1,1), like clothoid
|
|
251324
|
-
* * additional full period of a sine wave, producing 0 slope at both ends
|
|
251443
|
+
* * straight line from (0,0) to (1,1), like clothoid.
|
|
251444
|
+
* * additional full period of a sine wave, producing 0 slope at both ends.
|
|
251325
251445
|
* @internal
|
|
251326
251446
|
*/
|
|
251327
251447
|
class NormalizedSineTransition extends NormalizedTransition {
|
|
@@ -251331,7 +251451,7 @@ class NormalizedSineTransition extends NormalizedTransition {
|
|
|
251331
251451
|
const a = 2.0 * Math.PI;
|
|
251332
251452
|
return u - Math.sin(u * a) / a;
|
|
251333
251453
|
}
|
|
251334
|
-
/** Return the derivative of the (normalized) curvature fraction */
|
|
251454
|
+
/** Return the derivative of the (normalized) curvature fraction. */
|
|
251335
251455
|
fractionToCurvatureFractionDerivative(u) {
|
|
251336
251456
|
const a = 2.0 * Math.PI;
|
|
251337
251457
|
return 1 - Math.cos(u * a);
|
|
@@ -251345,8 +251465,8 @@ class NormalizedSineTransition extends NormalizedTransition {
|
|
|
251345
251465
|
}
|
|
251346
251466
|
}
|
|
251347
251467
|
/**
|
|
251348
|
-
* Transition functions for cosine
|
|
251349
|
-
* * curvature variation is a half period of a cosine
|
|
251468
|
+
* Transition functions for cosine.
|
|
251469
|
+
* * curvature variation is a half period of a cosine.
|
|
251350
251470
|
* @internal
|
|
251351
251471
|
*/
|
|
251352
251472
|
class NormalizedCosineTransition extends NormalizedTransition {
|
|
@@ -251356,7 +251476,7 @@ class NormalizedCosineTransition extends NormalizedTransition {
|
|
|
251356
251476
|
const a = Math.PI;
|
|
251357
251477
|
return 0.5 * (1 - Math.cos(u * a));
|
|
251358
251478
|
}
|
|
251359
|
-
/** Return the derivative of the (normalized) curvature fraction */
|
|
251479
|
+
/** Return the derivative of the (normalized) curvature fraction. */
|
|
251360
251480
|
fractionToCurvatureFractionDerivative(u) {
|
|
251361
251481
|
const a = Math.PI;
|
|
251362
251482
|
return 0.5 * a * Math.sin(u * a);
|
|
@@ -251401,14 +251521,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
251401
251521
|
* Polish Cubic.
|
|
251402
251522
|
* * Construction takes nominal length and end radius.
|
|
251403
251523
|
* curve is is y= m*x^3 with
|
|
251404
|
-
* * x any point on the x axis
|
|
251405
|
-
* * m is (1/6RL)
|
|
251406
|
-
* * Lx = x length is along the axis, determined by inversion of a distance series at nominal length
|
|
251407
|
-
* *
|
|
251408
|
-
* @param localToWorld
|
|
251409
|
-
* @param nominalL1
|
|
251410
|
-
* @param nominalR1
|
|
251411
|
-
* @param activeInterval
|
|
251524
|
+
* * x any point on the x axis.
|
|
251525
|
+
* * m is (1/6RL).
|
|
251526
|
+
* * Lx = x length is along the axis, determined by inversion of a distance series at nominal length.
|
|
251412
251527
|
* @internal
|
|
251413
251528
|
*/
|
|
251414
251529
|
class PolishCubicEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.CubicEvaluator {
|
|
@@ -251438,9 +251553,11 @@ class PolishCubicEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
251438
251553
|
this.nominalRadius1 *= scaleFactor;
|
|
251439
251554
|
super.scaleInPlace(scaleFactor);
|
|
251440
251555
|
}
|
|
251441
|
-
/**
|
|
251442
|
-
clone() {
|
|
251443
|
-
|
|
251556
|
+
/** Return a deep copy of the evaluator. */
|
|
251557
|
+
clone() {
|
|
251558
|
+
return new PolishCubicEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM);
|
|
251559
|
+
}
|
|
251560
|
+
/** Member by member matchup. */
|
|
251444
251561
|
isAlmostEqual(other) {
|
|
251445
251562
|
if (other instanceof PolishCubicEvaluator) {
|
|
251446
251563
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)
|
|
@@ -251448,15 +251565,15 @@ class PolishCubicEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
251448
251565
|
}
|
|
251449
251566
|
return false;
|
|
251450
251567
|
}
|
|
251451
|
-
/** Compute the coefficient of x^4 in the x-to-distance series expansion */
|
|
251568
|
+
/** Compute the coefficient of x^4 in the x-to-distance series expansion. */
|
|
251452
251569
|
static computeX4SeriesCoefficient(length1, radius1) {
|
|
251453
251570
|
return 1.0 / (4.0 * length1 * length1 * radius1 * radius1);
|
|
251454
251571
|
}
|
|
251455
251572
|
/**
|
|
251456
251573
|
* Evaluate a series approximation of distance along the true curve.
|
|
251457
|
-
* @param x distance along x axis
|
|
251458
|
-
* @param radius1 nominal end radius
|
|
251459
|
-
* @param length1 nominal length along curve
|
|
251574
|
+
* @param x distance along x axis.
|
|
251575
|
+
* @param radius1 nominal end radius.
|
|
251576
|
+
* @param length1 nominal length along curve.
|
|
251460
251577
|
* @returns
|
|
251461
251578
|
*/
|
|
251462
251579
|
static xToApproximateDistance(x, radius1, length1) {
|
|
@@ -251470,9 +251587,9 @@ class PolishCubicEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
251470
251587
|
}
|
|
251471
251588
|
/**
|
|
251472
251589
|
* Evaluate the derivative of the x-to-distance series.
|
|
251473
|
-
* @param x distance along x axis
|
|
251474
|
-
* @param radius1 nominal end radius
|
|
251475
|
-
* @param length1 nominal length along curve
|
|
251590
|
+
* @param x distance along x axis.
|
|
251591
|
+
* @param radius1 nominal end radius.
|
|
251592
|
+
* @param length1 nominal length along curve.
|
|
251476
251593
|
* @returns
|
|
251477
251594
|
*/
|
|
251478
251595
|
static xToApproximateDistanceDerivative(x, radius1, length1) {
|
|
@@ -251481,13 +251598,13 @@ class PolishCubicEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
251481
251598
|
const ax2 = a4 * x * x;
|
|
251482
251599
|
const ax3 = ax2 * x;
|
|
251483
251600
|
const ax4 = ax3 * x;
|
|
251484
|
-
// derivative notes
|
|
251601
|
+
// derivative notes:
|
|
251485
251602
|
// take away leading x -- this reduces each power by 1
|
|
251486
251603
|
// multiply each coefficient by its original power:
|
|
251487
|
-
//
|
|
251488
|
-
// 1/72==>
|
|
251489
|
-
// 1/208==>13/208=1/16
|
|
251490
|
-
// 1/2176==>17/2176= 1/128
|
|
251604
|
+
// 0.1 ==> 0.5
|
|
251605
|
+
// 1/72 ==> 9/72 = 1/8
|
|
251606
|
+
// 1/208 ==> 13/208 = 1/16
|
|
251607
|
+
// 1/2176 ==> 17/2176 = 1/128
|
|
251491
251608
|
const ds = (1.0 + ax4 * (0.5 + ax4 * (-1.0 / 8.0 + ax4 * (1.0 / 16.0 - 5.0 * ax4 / 128.0))));
|
|
251492
251609
|
return ds;
|
|
251493
251610
|
}
|
|
@@ -251525,36 +251642,37 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
251525
251642
|
|
|
251526
251643
|
|
|
251527
251644
|
|
|
251528
|
-
|
|
251529
|
-
|
|
251645
|
+
/**
|
|
251646
|
+
* A true transition spiral is a curve defined by its curvature, with the curvature function symmetric about midpoint.
|
|
251530
251647
|
* * The symmetry condition creates a relationship among the following 4 quantities:
|
|
251531
251648
|
* ** curvature0 = curvature (i.e. 1/radius) at start
|
|
251532
251649
|
* ** curvature1 = curvature (i.e. 1/radius) at end
|
|
251533
251650
|
* ** sweepRadians = signed turning angle from start to end
|
|
251534
251651
|
* ** arcLength = length of curve
|
|
251535
|
-
* * The relationship is the equation
|
|
251652
|
+
* * The relationship is the equation:
|
|
251536
251653
|
* ** `sweepRadians = arcLength * average Curvature = arcLength * 0.5 * (curvature0 + curvature1)`
|
|
251537
|
-
* * That is, regardless of any curvature properties other than symmetry, specifying any 3 of the quantities fully
|
|
251654
|
+
* * That is, regardless of any curvature properties other than symmetry, specifying any 3 of the quantities fully
|
|
251655
|
+
* determines the remaining one.
|
|
251538
251656
|
* @public
|
|
251539
251657
|
*/
|
|
251540
251658
|
class TransitionConditionalProperties {
|
|
251541
|
-
/**
|
|
251659
|
+
/** Radius (or 0 at start). */
|
|
251542
251660
|
radius0;
|
|
251543
|
-
/**
|
|
251661
|
+
/** Radius (or 0) at end. */
|
|
251544
251662
|
radius1;
|
|
251545
|
-
/**
|
|
251663
|
+
/** Bearing at start, measured from x towards y. */
|
|
251546
251664
|
bearing0;
|
|
251547
|
-
/**
|
|
251665
|
+
/** Bearing at end, measured from x towards y. */
|
|
251548
251666
|
bearing1;
|
|
251549
|
-
/**
|
|
251667
|
+
/** Curve length. */
|
|
251550
251668
|
curveLength;
|
|
251551
251669
|
/**
|
|
251552
|
-
*
|
|
251553
|
-
* @param radius0 start radius or undefined
|
|
251554
|
-
* @param radius1 end radius or undefined
|
|
251555
|
-
* @param bearing0 start bearing or undefined
|
|
251556
|
-
* @param bearing1 end bearing or undefined
|
|
251557
|
-
* @param arcLength arc length or undefined
|
|
251670
|
+
* Capture numeric or undefined values.
|
|
251671
|
+
* @param radius0 start radius or undefined.
|
|
251672
|
+
* @param radius1 end radius or undefined.
|
|
251673
|
+
* @param bearing0 start bearing or undefined.
|
|
251674
|
+
* @param bearing1 end bearing or undefined.
|
|
251675
|
+
* @param arcLength arc length or undefined.
|
|
251558
251676
|
*/
|
|
251559
251677
|
constructor(radius0, radius1, bearing0, bearing1, arcLength) {
|
|
251560
251678
|
this.radius0 = radius0;
|
|
@@ -251563,7 +251681,7 @@ class TransitionConditionalProperties {
|
|
|
251563
251681
|
this.bearing1 = bearing1;
|
|
251564
251682
|
this.curveLength = arcLength;
|
|
251565
251683
|
}
|
|
251566
|
-
/**
|
|
251684
|
+
/** Return the number of defined values among the 5 properties. */
|
|
251567
251685
|
numDefinedProperties() {
|
|
251568
251686
|
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.defined01(this.radius0)
|
|
251569
251687
|
+ _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.defined01(this.radius1)
|
|
@@ -251571,21 +251689,22 @@ class TransitionConditionalProperties {
|
|
|
251571
251689
|
+ _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.defined01(this.bearing1)
|
|
251572
251690
|
+ _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.defined01(this.curveLength);
|
|
251573
251691
|
}
|
|
251574
|
-
/**
|
|
251692
|
+
/** Clone with all 5 properties (i.e., preserve undefined states). */
|
|
251575
251693
|
clone() {
|
|
251576
251694
|
return new TransitionConditionalProperties(this.radius0, this.radius1, this.bearing0 === undefined ? undefined : this.bearing0.clone(), this.bearing1 === undefined ? undefined : this.bearing1.clone(), this.curveLength);
|
|
251577
251695
|
}
|
|
251578
|
-
/** Return true if all
|
|
251696
|
+
/** Return true if all 5 properties are defined and agree equationally. */
|
|
251579
251697
|
getIsValidCompleteSet() {
|
|
251580
251698
|
if (this.curveLength !== undefined && this.bearing0 !== undefined && this.bearing1 !== undefined
|
|
251581
251699
|
&& this.radius0 !== undefined && this.radius1 !== undefined) {
|
|
251582
|
-
const
|
|
251583
|
-
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.curveLength,
|
|
251700
|
+
const arcLength = _TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_1__.TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(this.radius0, this.radius1, this.bearing1.radians - this.bearing0.radians);
|
|
251701
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.curveLength, arcLength);
|
|
251584
251702
|
}
|
|
251585
251703
|
return false;
|
|
251586
251704
|
}
|
|
251587
|
-
/**
|
|
251588
|
-
*
|
|
251705
|
+
/**
|
|
251706
|
+
* Examine which properties are defined and compute the (single) undefined.
|
|
251707
|
+
* @returns true if the input state had precisely one undefined member.
|
|
251589
251708
|
*/
|
|
251590
251709
|
tryResolveAnySingleUnknown() {
|
|
251591
251710
|
if (this.getIsValidCompleteSet())
|
|
@@ -251606,15 +251725,17 @@ class TransitionConditionalProperties {
|
|
|
251606
251725
|
}
|
|
251607
251726
|
return false;
|
|
251608
251727
|
}
|
|
251609
|
-
// at least one bearing is undefined
|
|
251728
|
+
// at least one bearing is undefined
|
|
251610
251729
|
if (this.curveLength === undefined || this.radius0 === undefined || this.radius1 === undefined)
|
|
251611
251730
|
return false;
|
|
251612
251731
|
if (this.bearing0) { // bearing 1 is undefined
|
|
251613
|
-
this.bearing1 = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(this.bearing0.radians +
|
|
251732
|
+
this.bearing1 = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(this.bearing0.radians +
|
|
251733
|
+
_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_1__.TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength));
|
|
251614
251734
|
return true;
|
|
251615
251735
|
}
|
|
251616
251736
|
if (this.bearing1) { // bearing 0 is undefined
|
|
251617
|
-
this.bearing0 = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(this.bearing1.radians -
|
|
251737
|
+
this.bearing0 = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(this.bearing1.radians -
|
|
251738
|
+
_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_1__.TransitionSpiral3d.radiusRadiusLengthToSweepRadians(this.radius0, this.radius1, this.curveLength));
|
|
251618
251739
|
return true;
|
|
251619
251740
|
}
|
|
251620
251741
|
return false;
|
|
@@ -251633,9 +251754,7 @@ class TransitionConditionalProperties {
|
|
|
251633
251754
|
return a.isAlmostEqualNoPeriodShift(b);
|
|
251634
251755
|
return false;
|
|
251635
251756
|
}
|
|
251636
|
-
/**
|
|
251637
|
-
* Test if this and other have matching numeric and undefined members.
|
|
251638
|
-
*/
|
|
251757
|
+
/** Test if `this` and `other` have matching numeric and undefined members. */
|
|
251639
251758
|
isAlmostEqual(other) {
|
|
251640
251759
|
if (!other)
|
|
251641
251760
|
return false;
|
|
@@ -251651,8 +251770,10 @@ class TransitionConditionalProperties {
|
|
|
251651
251770
|
return false;
|
|
251652
251771
|
return true;
|
|
251653
251772
|
}
|
|
251654
|
-
/** Apply a NONZERO scale factor to all distances. */
|
|
251773
|
+
/** Apply a NONZERO scale factor to all distances. If `a` is zero, do nothing. */
|
|
251655
251774
|
applyScaleFactor(a) {
|
|
251775
|
+
if (a === 0)
|
|
251776
|
+
return;
|
|
251656
251777
|
if (this.radius0 !== undefined)
|
|
251657
251778
|
this.radius0 *= a;
|
|
251658
251779
|
if (this.radius1 !== undefined)
|
|
@@ -251660,6 +251781,7 @@ class TransitionConditionalProperties {
|
|
|
251660
251781
|
if (this.curveLength !== undefined)
|
|
251661
251782
|
this.curveLength *= a;
|
|
251662
251783
|
}
|
|
251784
|
+
/** Test if `a` and `b` have matching numeric and undefined members. */
|
|
251663
251785
|
static areAlmostEqual(a, b) {
|
|
251664
251786
|
if (a === undefined)
|
|
251665
251787
|
return b === undefined;
|
|
@@ -251704,31 +251826,38 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
251704
251826
|
/**
|
|
251705
251827
|
* TransitionSpiral3d is a base class for multiple variants of spirals.
|
|
251706
251828
|
* * The menagerie of spiral types have 2 broad categories:
|
|
251707
|
-
* * IntegratedSpiral3d -- a spiral whose direct function for curvature versus distance must be integrated to
|
|
251708
|
-
*
|
|
251829
|
+
* * IntegratedSpiral3d -- a spiral whose direct function for curvature versus distance must be integrated to
|
|
251830
|
+
* determine x,y.
|
|
251831
|
+
* * The IntegratedSpiral3d types are enumerated in `IntegratedSpiralTypes`.
|
|
251709
251832
|
* * DirectSpiral3d -- a spiral implemented with direct calculation of x,y from fractional position along the spiral.
|
|
251710
|
-
* * The direct spiral types are enumerated in the `DirectSpiralType
|
|
251711
|
-
* * The method set for CurvePrimitive support includes a `handleTransitionSpiral(g: TransitionSpiral3d)` which receives
|
|
251833
|
+
* * The direct spiral types are enumerated in the `DirectSpiralType`.
|
|
251834
|
+
* * The method set for CurvePrimitive support includes a `handleTransitionSpiral(g: TransitionSpiral3d)` which receives
|
|
251835
|
+
* all the spiral types.
|
|
251712
251836
|
* * The spiral class may impose expectations that its inflection is at the origin, with tangent along the x axis.
|
|
251713
251837
|
* * This is generally necessary for direct spirals.
|
|
251714
251838
|
* * This is not necessary for integrated spirals.
|
|
251715
251839
|
* @public
|
|
251716
251840
|
*/
|
|
251717
251841
|
class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePrimitive {
|
|
251718
|
-
/**
|
|
251842
|
+
/** String name of spiral type. */
|
|
251719
251843
|
_spiralType;
|
|
251720
251844
|
/** Original defining properties. */
|
|
251721
251845
|
_designProperties;
|
|
251722
|
-
/**
|
|
251723
|
-
|
|
251846
|
+
/** Placement transform. */
|
|
251847
|
+
_localToWorld;
|
|
251848
|
+
/**
|
|
251849
|
+
* Fractional interval for the "active" part of a containing spiral.
|
|
251850
|
+
* (the radius, angle, and length conditions define a complete spiral, and some portion of it is "active")
|
|
251724
251851
|
*/
|
|
251725
251852
|
_activeFractionInterval;
|
|
251726
251853
|
/** Return (reference to) the active portion of the reference spiral. */
|
|
251727
|
-
get activeFractionInterval() {
|
|
251728
|
-
|
|
251729
|
-
|
|
251730
|
-
/** (
|
|
251731
|
-
get localToWorld() {
|
|
251854
|
+
get activeFractionInterval() {
|
|
251855
|
+
return this._activeFractionInterval;
|
|
251856
|
+
}
|
|
251857
|
+
/** (Reference to) placement transform. */
|
|
251858
|
+
get localToWorld() {
|
|
251859
|
+
return this._localToWorld;
|
|
251860
|
+
}
|
|
251732
251861
|
constructor(spiralType, localToWorld, activeFractionInterval, designProperties) {
|
|
251733
251862
|
super();
|
|
251734
251863
|
this._spiralType = spiralType ? spiralType : "unknownSpiralType";
|
|
@@ -251736,10 +251865,14 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
251736
251865
|
this._localToWorld = localToWorld;
|
|
251737
251866
|
this._activeFractionInterval = activeFractionInterval ? activeFractionInterval : _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_1__.Segment1d.create(0, 1);
|
|
251738
251867
|
}
|
|
251739
|
-
get spiralType() {
|
|
251740
|
-
|
|
251741
|
-
|
|
251742
|
-
/** Return 1/
|
|
251868
|
+
get spiralType() {
|
|
251869
|
+
return this._spiralType;
|
|
251870
|
+
}
|
|
251871
|
+
/** Return 1/r with convention that exact zero input returns 0 (straight line, zero curvature, infinite radius). */
|
|
251872
|
+
static radiusToCurvature(radius) {
|
|
251873
|
+
return (radius === 0.0) ? 0.0 : 1.0 / radius;
|
|
251874
|
+
}
|
|
251875
|
+
/** Return 1/k with convention that near-zero input returns 0 (straight line, zero curvature, infinite radius). */
|
|
251743
251876
|
static curvatureToRadius(curvature) {
|
|
251744
251877
|
if (Math.abs(curvature) < _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallAngleRadians)
|
|
251745
251878
|
return 0.0;
|
|
@@ -251754,10 +251887,10 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
251754
251887
|
spiralB.refreshComputedProperties();
|
|
251755
251888
|
return spiralB;
|
|
251756
251889
|
}
|
|
251757
|
-
/** Clone with a transform applied */
|
|
251890
|
+
/** Clone with a transform applied. */
|
|
251758
251891
|
cloneTransformed(transform) {
|
|
251759
251892
|
const result = this.clone();
|
|
251760
|
-
result.tryTransformInPlace(transform); //
|
|
251893
|
+
result.tryTransformInPlace(transform); // we're confident it will always work
|
|
251761
251894
|
return result;
|
|
251762
251895
|
}
|
|
251763
251896
|
/** Return the average of the start and end curvatures. */
|
|
@@ -251765,17 +251898,18 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
251765
251898
|
return 0.5 * (TransitionSpiral3d.radiusToCurvature(radiusLimits.x0) + TransitionSpiral3d.radiusToCurvature(radiusLimits.x1));
|
|
251766
251899
|
}
|
|
251767
251900
|
/**
|
|
251768
|
-
* Given two radii (or zeros for 0 curvature) return the average curvature
|
|
251769
|
-
* @param r0 start radius, or 0 for line
|
|
251770
|
-
* @param r1 end radius, or 0 for line
|
|
251901
|
+
* Given two radii (or zeros for 0 curvature) return the average curvature.
|
|
251902
|
+
* @param r0 start radius, or 0 for line.
|
|
251903
|
+
* @param r1 end radius, or 0 for line.
|
|
251771
251904
|
*/
|
|
251772
251905
|
static averageCurvatureR0R1(r0, r1) {
|
|
251773
251906
|
return 0.5 * (TransitionSpiral3d.radiusToCurvature(r0) + TransitionSpiral3d.radiusToCurvature(r1));
|
|
251774
251907
|
}
|
|
251775
251908
|
/**
|
|
251776
|
-
* Given two radii (or zeros for 0 curvature) return the
|
|
251777
|
-
* @param r0 start radius, or 0 for line
|
|
251778
|
-
* @param
|
|
251909
|
+
* Given two radii (or zeros for 0 curvature) return the curvature at the given fraction.
|
|
251910
|
+
* @param r0 start radius, or 0 for line.
|
|
251911
|
+
* @param fraction fractional position between the curvatures defined by r0 and r1.
|
|
251912
|
+
* @param r1 end radius, or 0 for line.
|
|
251779
251913
|
*/
|
|
251780
251914
|
static interpolateCurvatureR0R1(r0, fraction, r1) {
|
|
251781
251915
|
return _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(TransitionSpiral3d.radiusToCurvature(r0), fraction, TransitionSpiral3d.radiusToCurvature(r1));
|
|
@@ -251797,9 +251931,12 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
251797
251931
|
return TransitionSpiral3d.curvatureToRadius((2.0 * sweepRadians / arcLength) - TransitionSpiral3d.radiusToCurvature(radius1));
|
|
251798
251932
|
}
|
|
251799
251933
|
/** Return the original defining properties (if any) saved by the constructor. */
|
|
251800
|
-
get designProperties() {
|
|
251934
|
+
get designProperties() {
|
|
251935
|
+
return this._designProperties;
|
|
251936
|
+
}
|
|
251801
251937
|
/**
|
|
251802
|
-
* * If transformA is rigid with uniform scale, apply the rigid part of transformA to the localToWorld transform and
|
|
251938
|
+
* * If transformA is rigid with uniform scale, apply the rigid part of transformA to the localToWorld transform and
|
|
251939
|
+
* return the scale and rigid separation.
|
|
251803
251940
|
* * If not rigid, do nothing and return undefined.
|
|
251804
251941
|
* * Also apply the scale factor to the designProperties.
|
|
251805
251942
|
* @param transformA
|
|
@@ -251808,9 +251945,9 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
251808
251945
|
const rigidData = transformA.matrix.factorRigidWithSignedScale();
|
|
251809
251946
|
if (rigidData !== undefined) {
|
|
251810
251947
|
// [sQ a][R b] = [sQ*R sQb+a]
|
|
251811
|
-
// but we save it as [Q*R sQb+a] with spiral data scaled by s
|
|
251948
|
+
// but we save it as [Q*R sQb+a] with spiral data scaled by s
|
|
251812
251949
|
const transformC0 = transformA.multiplyTransformTransform(this.localToWorld);
|
|
251813
|
-
//
|
|
251950
|
+
// but pull the scale part out of the matrix
|
|
251814
251951
|
const matrixC = rigidData.rigidAxes.multiplyMatrixMatrix(this.localToWorld.matrix);
|
|
251815
251952
|
this._localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_3__.Transform.createOriginAndMatrix(transformC0.origin, matrixC);
|
|
251816
251953
|
if (this.designProperties)
|
|
@@ -251821,9 +251958,9 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
251821
251958
|
}
|
|
251822
251959
|
/**
|
|
251823
251960
|
* Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).
|
|
251824
|
-
* * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset
|
|
251825
|
-
*
|
|
251826
|
-
* @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object
|
|
251961
|
+
* * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset for an
|
|
251962
|
+
* aggregate instance (e.g., LineString3d, CurveChainWithDistanceIndex), use RegionOps.constructCurveXYOffset() instead.
|
|
251963
|
+
* @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object.
|
|
251827
251964
|
*/
|
|
251828
251965
|
constructOffsetXY(offsetDistanceOrOptions) {
|
|
251829
251966
|
const options = _OffsetOptions__WEBPACK_IMPORTED_MODULE_4__.OffsetOptions.create(offsetDistanceOrOptions);
|
|
@@ -251831,13 +251968,13 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
251831
251968
|
this.emitStrokableParts(handler, options.strokeOptions);
|
|
251832
251969
|
return handler.claimResult();
|
|
251833
251970
|
}
|
|
251834
|
-
/**
|
|
251971
|
+
/** Extend the range by the strokes of the spiral. */
|
|
251835
251972
|
extendRange(rangeToExtend, transform) {
|
|
251836
|
-
|
|
251837
|
-
rangeToExtend.extendRange(myRange);
|
|
251973
|
+
rangeToExtend.extendRange(this.rangeBetweenFractions(0.0, 1.0, transform));
|
|
251838
251974
|
}
|
|
251839
|
-
/**
|
|
251840
|
-
*
|
|
251975
|
+
/**
|
|
251976
|
+
* Return the range of spiral between fractions of the activeStrokes.
|
|
251977
|
+
* * Use activeStrokes point count times interval factor for initial evaluation count, but do at least 5.
|
|
251841
251978
|
*/
|
|
251842
251979
|
rangeBetweenFractions(fractionA, fractionB, transform) {
|
|
251843
251980
|
const strokes = this.activeStrokes;
|
|
@@ -251847,10 +251984,13 @@ class TransitionSpiral3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.Cu
|
|
|
251847
251984
|
count = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.clamp(5, count, 30);
|
|
251848
251985
|
return this.rangeBetweenFractionsByCount(fractionA, fractionB, count, transform, 0.5);
|
|
251849
251986
|
}
|
|
251850
|
-
/**
|
|
251987
|
+
/**
|
|
251988
|
+
* Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of
|
|
251989
|
+
* projection.
|
|
251851
251990
|
* @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.
|
|
251852
251991
|
* @param lowHigh optional receiver for output
|
|
251853
|
-
* @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the
|
|
251992
|
+
* @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the
|
|
251993
|
+
* end of the ray.
|
|
251854
251994
|
*/
|
|
251855
251995
|
projectedParameterRange(ray, lowHigh) {
|
|
251856
251996
|
return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_7__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
|
|
@@ -251894,8 +252034,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
251894
252034
|
* XYCurveEvaluator is an abstract with methods for evaluating X and Y parts of a curve parameterized by a fraction.
|
|
251895
252035
|
* * The required methods call for independent X and Y evaluation.
|
|
251896
252036
|
* * Base class methods package those (multiple) calls into point, ray, and plane structures.
|
|
251897
|
-
* *
|
|
251898
|
-
*
|
|
252037
|
+
* * An implementation that has evaluation substantial cost that can be shared among x,y parts or between
|
|
252038
|
+
* primary functions and derivatives might choose to implement the point and derivative methods directly.
|
|
251899
252039
|
* @internal
|
|
251900
252040
|
*/
|
|
251901
252041
|
class XYCurveEvaluator {
|
|
@@ -251903,11 +252043,17 @@ class XYCurveEvaluator {
|
|
|
251903
252043
|
fractionToPoint(fraction, result) {
|
|
251904
252044
|
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create(this.fractionToX(fraction), this.fractionToY(fraction), 0.0, result);
|
|
251905
252045
|
}
|
|
251906
|
-
/**
|
|
252046
|
+
/**
|
|
252047
|
+
* Evaluate both X and Y and their first derivatives at fractional coordinate, return bundled as origin and
|
|
252048
|
+
* (non-unit) direction vector.
|
|
252049
|
+
*/
|
|
251907
252050
|
fractionToPointAndDerivative(fraction, result) {
|
|
251908
252051
|
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);
|
|
251909
252052
|
}
|
|
251910
|
-
/**
|
|
252053
|
+
/**
|
|
252054
|
+
* Evaluate both X and Y and their second derivatives at fractional coordinate, return bundled as origin and
|
|
252055
|
+
* (non-unit) vectorU an vectorV.
|
|
252056
|
+
*/
|
|
251911
252057
|
fractionToPointAnd2Derivatives(fraction, result) {
|
|
251912
252058
|
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);
|
|
251913
252059
|
}
|
|
@@ -251920,12 +252066,13 @@ class XYCurveEvaluator {
|
|
|
251920
252066
|
const v = this.fractionToDY(fraction);
|
|
251921
252067
|
return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.hypotenuseXY(u, v);
|
|
251922
252068
|
}
|
|
251923
|
-
/** Initialize class level work arrays for 5 point Gaussian Quadrature. */
|
|
251924
|
-
// Class resources for integration . . .
|
|
251925
|
-
// These static variables are reused on calls to integrateFromStartFraction
|
|
251926
252069
|
static _gaussX;
|
|
251927
252070
|
static _gaussWeight;
|
|
251928
252071
|
static _gaussMapper;
|
|
252072
|
+
/**
|
|
252073
|
+
* Initialize class level work arrays for 5 point Gaussian quadrature.
|
|
252074
|
+
* * These static variables are reused on calls to [[integrateDistanceBetweenFractions]].
|
|
252075
|
+
*/
|
|
251929
252076
|
static initWorkSpace() {
|
|
251930
252077
|
XYCurveEvaluator._gaussX = new Float64Array(5);
|
|
251931
252078
|
XYCurveEvaluator._gaussWeight = new Float64Array(5);
|
|
@@ -251934,8 +252081,6 @@ class XYCurveEvaluator {
|
|
|
251934
252081
|
/**
|
|
251935
252082
|
* Integrate between nominal fractions with default gauss rule.
|
|
251936
252083
|
* * The caller is expected to choose nearby fractions so that the single gauss interval accuracy is good.
|
|
251937
|
-
* @param fraction0
|
|
251938
|
-
* @param fraction1
|
|
251939
252084
|
*/
|
|
251940
252085
|
integrateDistanceBetweenFractions(fraction0, fraction1) {
|
|
251941
252086
|
const gaussX = XYCurveEvaluator._gaussX;
|
|
@@ -251948,11 +252093,11 @@ class XYCurveEvaluator {
|
|
|
251948
252093
|
return sum;
|
|
251949
252094
|
}
|
|
251950
252095
|
/**
|
|
251951
|
-
* Inverse integrated distance
|
|
251952
|
-
* @param fraction0 start of fraction interval
|
|
251953
|
-
* @param fraction1 end of fraction interval
|
|
251954
|
-
* @param distance0 distance at start
|
|
251955
|
-
* @param distance1 distance at end
|
|
252096
|
+
* Inverse integrated distance.
|
|
252097
|
+
* @param fraction0 start of fraction interval.
|
|
252098
|
+
* @param fraction1 end of fraction interval.
|
|
252099
|
+
* @param distance0 distance at start.
|
|
252100
|
+
* @param distance1 distance at end.
|
|
251956
252101
|
* @param targetDistance intermediate distance.
|
|
251957
252102
|
*/
|
|
251958
252103
|
inverseDistanceFraction(fraction0, fraction1, distance0, distance1, targetDistance) {
|
|
@@ -251966,12 +252111,12 @@ class XYCurveEvaluator {
|
|
|
251966
252111
|
return undefined;
|
|
251967
252112
|
}
|
|
251968
252113
|
/**
|
|
251969
|
-
*
|
|
252114
|
+
* Get the point and its derivatives at a given fraction.
|
|
251970
252115
|
* @param fraction fractional position along x axis
|
|
251971
252116
|
* @param xy xy coordinates of point on the curve
|
|
251972
|
-
* @param d1xy
|
|
251973
|
-
* @param d2xy
|
|
251974
|
-
* @param d3xy
|
|
252117
|
+
* @param d1xy first derivative vector
|
|
252118
|
+
* @param d2xy second derivative vector
|
|
252119
|
+
* @param d3xy third derivative vector
|
|
251975
252120
|
*/
|
|
251976
252121
|
fractionToPointAnd3Derivatives(fraction, xy, d1xy, d2xy, d3xy) {
|
|
251977
252122
|
xy.set(this.fractionToX(fraction), this.fractionToY(fraction), 0);
|
|
@@ -338272,18 +338417,18 @@ class Settings {
|
|
|
338272
338417
|
}
|
|
338273
338418
|
}
|
|
338274
338419
|
toString() {
|
|
338275
|
-
return `Configurations:
|
|
338276
|
-
backend location: ${this.Backend.location},
|
|
338277
|
-
backend name: ${this.Backend.name},
|
|
338278
|
-
backend version: ${this.Backend.version},
|
|
338279
|
-
oidc client id: ${this.oidcClientId},
|
|
338280
|
-
oidc scopes: ${this.oidcScopes},
|
|
338281
|
-
applicationId: ${this.gprid},
|
|
338282
|
-
log level: ${this.logLevel},
|
|
338283
|
-
testing iModelTileRpcTests: ${this.runiModelTileRpcTests},
|
|
338284
|
-
testing PresentationRpcTest: ${this.runPresentationRpcTests},
|
|
338285
|
-
testing iModelReadRpcTests: ${this.runiModelReadRpcTests},
|
|
338286
|
-
testing DevToolsRpcTests: ${this.runDevToolsRpcTests},
|
|
338420
|
+
return `Configurations:
|
|
338421
|
+
backend location: ${this.Backend.location},
|
|
338422
|
+
backend name: ${this.Backend.name},
|
|
338423
|
+
backend version: ${this.Backend.version},
|
|
338424
|
+
oidc client id: ${this.oidcClientId},
|
|
338425
|
+
oidc scopes: ${this.oidcScopes},
|
|
338426
|
+
applicationId: ${this.gprid},
|
|
338427
|
+
log level: ${this.logLevel},
|
|
338428
|
+
testing iModelTileRpcTests: ${this.runiModelTileRpcTests},
|
|
338429
|
+
testing PresentationRpcTest: ${this.runPresentationRpcTests},
|
|
338430
|
+
testing iModelReadRpcTests: ${this.runiModelReadRpcTests},
|
|
338431
|
+
testing DevToolsRpcTests: ${this.runDevToolsRpcTests},
|
|
338287
338432
|
testing iModelWriteRpcTests: ${this.runiModelWriteRpcTests}`;
|
|
338288
338433
|
}
|
|
338289
338434
|
}
|
|
@@ -338508,7 +338653,7 @@ class TestContext {
|
|
|
338508
338653
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
338509
338654
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
338510
338655
|
await core_frontend_1.NoRenderApp.startup({
|
|
338511
|
-
applicationVersion: "5.3.0-dev.
|
|
338656
|
+
applicationVersion: "5.3.0-dev.18",
|
|
338512
338657
|
applicationId: this.settings.gprid,
|
|
338513
338658
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
|
|
338514
338659
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -351693,13 +351838,13 @@ class FavoritePropertiesManager {
|
|
|
351693
351838
|
if (missingClasses.size === 0) {
|
|
351694
351839
|
return baseClasses;
|
|
351695
351840
|
}
|
|
351696
|
-
const query = `
|
|
351697
|
-
SELECT (derivedSchema.Name || ':' || derivedClass.Name) AS "ClassFullName", (baseSchema.Name || ':' || baseClass.Name) AS "BaseClassFullName"
|
|
351698
|
-
FROM ECDbMeta.ClassHasAllBaseClasses baseClassRels
|
|
351699
|
-
INNER JOIN ECDbMeta.ECClassDef derivedClass ON derivedClass.ECInstanceId = baseClassRels.SourceECInstanceId
|
|
351700
|
-
INNER JOIN ECDbMeta.ECSchemaDef derivedSchema ON derivedSchema.ECInstanceId = derivedClass.Schema.Id
|
|
351701
|
-
INNER JOIN ECDbMeta.ECClassDef baseClass ON baseClass.ECInstanceId = baseClassRels.TargetECInstanceId
|
|
351702
|
-
INNER JOIN ECDbMeta.ECSchemaDef baseSchema ON baseSchema.ECInstanceId = baseClass.Schema.Id
|
|
351841
|
+
const query = `
|
|
351842
|
+
SELECT (derivedSchema.Name || ':' || derivedClass.Name) AS "ClassFullName", (baseSchema.Name || ':' || baseClass.Name) AS "BaseClassFullName"
|
|
351843
|
+
FROM ECDbMeta.ClassHasAllBaseClasses baseClassRels
|
|
351844
|
+
INNER JOIN ECDbMeta.ECClassDef derivedClass ON derivedClass.ECInstanceId = baseClassRels.SourceECInstanceId
|
|
351845
|
+
INNER JOIN ECDbMeta.ECSchemaDef derivedSchema ON derivedSchema.ECInstanceId = derivedClass.Schema.Id
|
|
351846
|
+
INNER JOIN ECDbMeta.ECClassDef baseClass ON baseClass.ECInstanceId = baseClassRels.TargetECInstanceId
|
|
351847
|
+
INNER JOIN ECDbMeta.ECSchemaDef baseSchema ON baseSchema.ECInstanceId = baseClass.Schema.Id
|
|
351703
351848
|
WHERE (derivedSchema.Name || ':' || derivedClass.Name) IN (${[...missingClasses].map((className) => `'${className}'`).join(",")})`;
|
|
351704
351849
|
const reader = imodel.createQueryReader(query, undefined, { rowFormat: core_common_1.QueryRowFormat.UseJsPropertyNames });
|
|
351705
351850
|
while (await reader.step()) {
|
|
@@ -363775,7 +363920,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
363775
363920
|
/***/ ((module) => {
|
|
363776
363921
|
|
|
363777
363922
|
"use strict";
|
|
363778
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.3.0-dev.
|
|
363923
|
+
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"}}');
|
|
363779
363924
|
|
|
363780
363925
|
/***/ }),
|
|
363781
363926
|
|