@itwin/rpcinterface-full-stack-tests 3.5.0-dev.52 → 3.5.0-dev.57
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/dist/_554f.bundled-tests.js.map +1 -1
- package/lib/dist/bundled-tests.js +338 -139
- 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/object-storage.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_itwin_object-storage-azure_1_4_0_node_modules_itwin_obj-3576c6.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_2_10_node_modules_loaders_gl_draco_d-13469a.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_reflect-metadata_0_1_13_node_modules_reflect-metadata_R-610cb3.bundled-tests.js.map +1 -1
- package/package.json +14 -14
|
@@ -170147,6 +170147,7 @@ class ArcGisUtilities {
|
|
|
170147
170147
|
* @param latitude Latitude in degrees to use to compute scales (i.e 0 for Equator)
|
|
170148
170148
|
* @param tileSize Size of a tile in pixels (i.e 256)
|
|
170149
170149
|
* @param screenDpi Monitor resolution in dots per inch (i.e. typically 96dpi is used by Google Maps)
|
|
170150
|
+
*
|
|
170150
170151
|
* @returns An array containing resolution and scale values for each requested zoom level
|
|
170151
170152
|
*/
|
|
170152
170153
|
static computeZoomLevelsScales(startZoom = 0, endZoom = 20, latitude = 0, tileSize = 256, screenDpi = 96) {
|
|
@@ -170173,20 +170174,20 @@ class ArcGisUtilities {
|
|
|
170173
170174
|
* @param maxScale Maximum scale value that needs to be matched to a LOD level
|
|
170174
170175
|
* @returns minLod: LOD value matching minScale, maxLod: LOD value matching maxScale
|
|
170175
170176
|
*/
|
|
170176
|
-
static getZoomLevelsScales(defaultMaxLod, tileSize, minScale, maxScale) {
|
|
170177
|
+
static getZoomLevelsScales(defaultMaxLod, tileSize, minScale, maxScale, tolerance = 0) {
|
|
170177
170178
|
let minLod, maxLod;
|
|
170178
170179
|
const zoomScales = ArcGisUtilities.computeZoomLevelsScales(0, defaultMaxLod, 0 /* latitude 0 = Equator*/, tileSize);
|
|
170179
170180
|
if (zoomScales.length > 0) {
|
|
170180
170181
|
if (minScale) {
|
|
170181
170182
|
minLod = 0;
|
|
170182
170183
|
// We are looking for the largest scale value with a scale value smaller than minScale
|
|
170183
|
-
for (; minLod < zoomScales.length && zoomScales[minLod].scale > minScale; minLod++)
|
|
170184
|
+
for (; minLod < zoomScales.length && (zoomScales[minLod].scale > minScale && Math.abs(zoomScales[minLod].scale - minScale) > tolerance); minLod++)
|
|
170184
170185
|
;
|
|
170185
170186
|
}
|
|
170186
170187
|
if (maxScale) {
|
|
170187
170188
|
maxLod = defaultMaxLod;
|
|
170188
170189
|
// We are looking for the smallest scale value with a value greater than maxScale
|
|
170189
|
-
for (; maxLod >= 0 && zoomScales[maxLod].scale < maxScale; maxLod--)
|
|
170190
|
+
for (; maxLod >= 0 && zoomScales[maxLod].scale < maxScale && Math.abs(zoomScales[maxLod].scale - maxScale) > tolerance; maxLod--)
|
|
170190
170191
|
;
|
|
170191
170192
|
}
|
|
170192
170193
|
}
|
|
@@ -183568,7 +183569,7 @@ class Tool {
|
|
|
183568
183569
|
}
|
|
183569
183570
|
static getLocalizedKey(name) {
|
|
183570
183571
|
const key = `tools.${this.toolId}.${name}`;
|
|
183571
|
-
const val = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.localization.
|
|
183572
|
+
const val = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.localization.getLocalizedString(key, { ns: this.namespace });
|
|
183572
183573
|
return key === val ? undefined : val; // if translation for key doesn't exist, `translate` returns the key as the result
|
|
183573
183574
|
}
|
|
183574
183575
|
/**
|
|
@@ -191488,8 +191489,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
191488
191489
|
/* harmony import */ var _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry4d/Point4d */ "../../core/geometry/lib/esm/geometry4d/Point4d.js");
|
|
191489
191490
|
/* harmony import */ var _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../numerics/BezierPolynomials */ "../../core/geometry/lib/esm/numerics/BezierPolynomials.js");
|
|
191490
191491
|
/* harmony import */ var _Bezier1dNd__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Bezier1dNd */ "../../core/geometry/lib/esm/bspline/Bezier1dNd.js");
|
|
191491
|
-
/* harmony import */ var
|
|
191492
|
-
/* harmony import */ var
|
|
191492
|
+
/* harmony import */ var _BezierCurve3d__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./BezierCurve3d */ "../../core/geometry/lib/esm/bspline/BezierCurve3d.js");
|
|
191493
|
+
/* harmony import */ var _BezierCurve3dH__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./BezierCurve3dH */ "../../core/geometry/lib/esm/bspline/BezierCurve3dH.js");
|
|
191493
191494
|
/* harmony import */ var _BSpline1dNd__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BSpline1dNd */ "../../core/geometry/lib/esm/bspline/BSpline1dNd.js");
|
|
191494
191495
|
/* harmony import */ var _BSplineCurveOps__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./BSplineCurveOps */ "../../core/geometry/lib/esm/bspline/BSplineCurveOps.js");
|
|
191495
191496
|
/* harmony import */ var _KnotVector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./KnotVector */ "../../core/geometry/lib/esm/bspline/KnotVector.js");
|
|
@@ -191813,7 +191814,7 @@ class BSplineCurve3d extends BSplineCurve3dBase {
|
|
|
191813
191814
|
}
|
|
191814
191815
|
initializeWorkBezier() {
|
|
191815
191816
|
if (this._workBezier === undefined)
|
|
191816
|
-
this._workBezier =
|
|
191817
|
+
this._workBezier = _BezierCurve3d__WEBPACK_IMPORTED_MODULE_12__.BezierCurve3d.createOrder(this.order);
|
|
191817
191818
|
return this._workBezier;
|
|
191818
191819
|
}
|
|
191819
191820
|
/** test of `other` is an instance of BSplineCurve3d */
|
|
@@ -191854,7 +191855,7 @@ class BSplineCurve3d extends BSplineCurve3dBase {
|
|
|
191854
191855
|
/** Create a bspline with uniform knots. */
|
|
191855
191856
|
static createUniformKnots(poles, order) {
|
|
191856
191857
|
const numPoles = poles instanceof Float64Array ? poles.length / 3 : poles.length;
|
|
191857
|
-
if (order <
|
|
191858
|
+
if (order < 2 || numPoles < order)
|
|
191858
191859
|
return undefined;
|
|
191859
191860
|
const knots = _KnotVector__WEBPACK_IMPORTED_MODULE_3__.KnotVector.createUniformClamped(numPoles, order - 1, 0.0, 1.0);
|
|
191860
191861
|
const curve = new BSplineCurve3d(numPoles, order, knots);
|
|
@@ -191876,11 +191877,32 @@ class BSplineCurve3d extends BSplineCurve3dBase {
|
|
|
191876
191877
|
return curve;
|
|
191877
191878
|
}
|
|
191878
191879
|
/** Create a smoothly closed B-spline curve with uniform knots.
|
|
191879
|
-
* Note that the curve does not start at the first pole
|
|
191880
|
+
* Note that the curve does not start at the first pole!
|
|
191880
191881
|
*/
|
|
191881
191882
|
static createPeriodicUniformKnots(poles, order) {
|
|
191882
|
-
|
|
191883
|
-
|
|
191883
|
+
if (order < 2)
|
|
191884
|
+
return undefined;
|
|
191885
|
+
let numPoles = poles instanceof Float64Array ? poles.length / 3 : poles.length;
|
|
191886
|
+
const startPoint = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_14__.Point3d.createZero();
|
|
191887
|
+
const endPoint = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_14__.Point3d.createZero();
|
|
191888
|
+
let hasClosurePoint = false;
|
|
191889
|
+
do {
|
|
191890
|
+
if (poles instanceof Float64Array) {
|
|
191891
|
+
startPoint.set(poles[0], poles[1], poles[2]);
|
|
191892
|
+
endPoint.set(poles[3 * numPoles - 3], poles[3 * numPoles - 2], poles[3 * numPoles - 1]);
|
|
191893
|
+
}
|
|
191894
|
+
else if (poles instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray) {
|
|
191895
|
+
startPoint.set(poles.float64Data()[0], poles.float64Data()[1], poles.float64Data()[2]);
|
|
191896
|
+
endPoint.set(poles.float64Data()[3 * numPoles - 3], poles.float64Data()[3 * numPoles - 2], poles.float64Data()[3 * numPoles - 1]);
|
|
191897
|
+
}
|
|
191898
|
+
else {
|
|
191899
|
+
startPoint.setFromPoint3d(poles[0]);
|
|
191900
|
+
endPoint.setFromPoint3d(poles[numPoles - 1]);
|
|
191901
|
+
}
|
|
191902
|
+
if (hasClosurePoint = startPoint.isAlmostEqual(endPoint))
|
|
191903
|
+
--numPoles; // remove wraparound pole if found
|
|
191904
|
+
} while (hasClosurePoint && numPoles > 1);
|
|
191905
|
+
if (numPoles < order)
|
|
191884
191906
|
return undefined;
|
|
191885
191907
|
const degree = order - 1;
|
|
191886
191908
|
const numIntervals = numPoles;
|
|
@@ -191901,10 +191923,10 @@ class BSplineCurve3d extends BSplineCurve3dBase {
|
|
|
191901
191923
|
}
|
|
191902
191924
|
else {
|
|
191903
191925
|
let i = 0;
|
|
191904
|
-
for (
|
|
191905
|
-
curve._bcurve.packedData[i++] =
|
|
191906
|
-
curve._bcurve.packedData[i++] =
|
|
191907
|
-
curve._bcurve.packedData[i++] =
|
|
191926
|
+
for (let j = 0; j < numPoles; j++) {
|
|
191927
|
+
curve._bcurve.packedData[i++] = poles[j].x;
|
|
191928
|
+
curve._bcurve.packedData[i++] = poles[j].y;
|
|
191929
|
+
curve._bcurve.packedData[i++] = poles[j].z;
|
|
191908
191930
|
}
|
|
191909
191931
|
for (let j = 0; j < degree; j++) {
|
|
191910
191932
|
curve._bcurve.packedData[i++] = poles[j].x;
|
|
@@ -191945,7 +191967,7 @@ class BSplineCurve3d extends BSplineCurve3dBase {
|
|
|
191945
191967
|
const numKnots = knotArray.length;
|
|
191946
191968
|
// shift knots-of-interest limits for overclamped case ...
|
|
191947
191969
|
const skipFirstAndLast = (numPoles + order === numKnots);
|
|
191948
|
-
if (order <
|
|
191970
|
+
if (order < 2 || numPoles < order)
|
|
191949
191971
|
return undefined;
|
|
191950
191972
|
const knots = _KnotVector__WEBPACK_IMPORTED_MODULE_3__.KnotVector.create(knotArray, order - 1, skipFirstAndLast);
|
|
191951
191973
|
const curve = new BSplineCurve3d(numPoles, order, knots);
|
|
@@ -192045,7 +192067,7 @@ class BSplineCurve3d extends BSplineCurve3dBase {
|
|
|
192045
192067
|
const numSpan = this.numSpan;
|
|
192046
192068
|
let numStroke = 0;
|
|
192047
192069
|
for (let spanIndex = 0; spanIndex < numSpan; spanIndex++) {
|
|
192048
|
-
const bezier = this.
|
|
192070
|
+
const bezier = this.getSaturatedBezierSpan3d(spanIndex, workBezier);
|
|
192049
192071
|
if (bezier)
|
|
192050
192072
|
numStroke += bezier.computeStrokeCountForOptions(options);
|
|
192051
192073
|
}
|
|
@@ -192062,7 +192084,7 @@ class BSplineCurve3d extends BSplineCurve3dBase {
|
|
|
192062
192084
|
const numSpan = this.numSpan;
|
|
192063
192085
|
const myData = _curve_Query_StrokeCountMap__WEBPACK_IMPORTED_MODULE_19__.StrokeCountMap.createWithCurvePrimitiveAndOptionalParent(this, parentStrokeMap, []);
|
|
192064
192086
|
for (let spanIndex = 0; spanIndex < numSpan; spanIndex++) {
|
|
192065
|
-
const bezier = this.
|
|
192087
|
+
const bezier = this.getSaturatedBezierSpan3d(spanIndex, workBezier);
|
|
192066
192088
|
if (bezier) {
|
|
192067
192089
|
const segmentLength = workBezier.curveLength();
|
|
192068
192090
|
const numStrokeOnSegment = workBezier.computeStrokeCountForOptions(options);
|
|
@@ -192076,7 +192098,7 @@ class BSplineCurve3d extends BSplineCurve3dBase {
|
|
|
192076
192098
|
const workBezier = this.initializeWorkBezier();
|
|
192077
192099
|
const numSpan = this.numSpan;
|
|
192078
192100
|
for (let spanIndex = 0; spanIndex < numSpan; spanIndex++) {
|
|
192079
|
-
const bezier = this.
|
|
192101
|
+
const bezier = this.getSaturatedBezierSpan3d(spanIndex, workBezier);
|
|
192080
192102
|
if (bezier)
|
|
192081
192103
|
bezier.emitStrokes(dest, options);
|
|
192082
192104
|
}
|
|
@@ -192115,8 +192137,8 @@ class BSplineCurve3d extends BSplineCurve3dBase {
|
|
|
192115
192137
|
if (spanIndex < 0 || spanIndex >= this.numSpan)
|
|
192116
192138
|
return undefined;
|
|
192117
192139
|
const order = this.order;
|
|
192118
|
-
if (result === undefined || !(result instanceof
|
|
192119
|
-
result =
|
|
192140
|
+
if (result === undefined || !(result instanceof _BezierCurve3d__WEBPACK_IMPORTED_MODULE_12__.BezierCurve3d) || result.order !== order)
|
|
192141
|
+
result = _BezierCurve3d__WEBPACK_IMPORTED_MODULE_12__.BezierCurve3d.createOrder(order);
|
|
192120
192142
|
const bezier = result;
|
|
192121
192143
|
bezier.loadSpanPoles(this._bcurve.packedData, spanIndex);
|
|
192122
192144
|
if (bezier.saturateInPlace(this._bcurve.knots, spanIndex))
|
|
@@ -192132,8 +192154,8 @@ class BSplineCurve3d extends BSplineCurve3dBase {
|
|
|
192132
192154
|
if (spanIndex < 0 || spanIndex >= this.numSpan)
|
|
192133
192155
|
return undefined;
|
|
192134
192156
|
const order = this.order;
|
|
192135
|
-
if (result === undefined || !(result instanceof
|
|
192136
|
-
result =
|
|
192157
|
+
if (result === undefined || !(result instanceof _BezierCurve3dH__WEBPACK_IMPORTED_MODULE_20__.BezierCurve3dH) || result.order !== order)
|
|
192158
|
+
result = _BezierCurve3dH__WEBPACK_IMPORTED_MODULE_20__.BezierCurve3dH.createOrder(order);
|
|
192137
192159
|
const bezier = result;
|
|
192138
192160
|
bezier.loadSpan3dPolesWithWeight(this._bcurve.packedData, spanIndex, 1.0);
|
|
192139
192161
|
if (bezier.saturateInPlace(this._bcurve.knots, spanIndex))
|
|
@@ -195744,7 +195766,10 @@ class InterpolationCurve3d extends _curve_ProxyCurve__WEBPACK_IMPORTED_MODULE_4_
|
|
|
195744
195766
|
this._options = properties;
|
|
195745
195767
|
}
|
|
195746
195768
|
dispatchToGeometryHandler(handler) {
|
|
195747
|
-
|
|
195769
|
+
let result = handler.handleInterpolationCurve3d(this);
|
|
195770
|
+
if (undefined === result) // if handler doesn't specialize on interpolation curves, default to proxy
|
|
195771
|
+
result = this._proxyCurve.dispatchToGeometryHandler(handler);
|
|
195772
|
+
return result;
|
|
195748
195773
|
}
|
|
195749
195774
|
/**
|
|
195750
195775
|
* Create an [[InterpolationCurve3d]] based on points, knots, and other properties in the [[InterpolationCurve3dProps]] or [[InterpolationCurve3dOptions]].
|
|
@@ -202539,7 +202564,10 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePrimitive
|
|
|
202539
202564
|
getPlaneAltitudeSineCosinePolynomial(plane, result) {
|
|
202540
202565
|
if (!result)
|
|
202541
202566
|
result = new _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_5__.SineCosinePolynomial(0, 0, 0);
|
|
202542
|
-
|
|
202567
|
+
// altitude function of angle t, given plane with origin o and unit normal n:
|
|
202568
|
+
// A(t) = (c + u cos(t) + v sin(t)) . n = (c-o).n + u.n cos(t) + v.n sin(t)
|
|
202569
|
+
// Note the different functions for computing dot product against a point vs. a vector!
|
|
202570
|
+
result.set(plane.altitude(this._center), plane.velocityXYZ(this._matrix.coffs[0], this._matrix.coffs[3], this._matrix.coffs[6]), plane.velocityXYZ(this._matrix.coffs[1], this._matrix.coffs[4], this._matrix.coffs[7]));
|
|
202543
202571
|
return result;
|
|
202544
202572
|
}
|
|
202545
202573
|
/**
|
|
@@ -212965,8 +212993,9 @@ class RegionOps {
|
|
|
212965
212993
|
* @param distanceTolerance optional absolute distance tolerance
|
|
212966
212994
|
*/
|
|
212967
212995
|
static computeXYAreaTolerance(range, distanceTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
|
|
212968
|
-
// if A = bh and e is distance tolerance, then A' := (b+e)(h+e) = A + e(b+h+e), so A'-A = e(b+h+e).
|
|
212969
|
-
|
|
212996
|
+
// if A = bh and e is distance tolerance, then A' := (b+e/2)(h+e/2) = A + e/2(b+h+e/2), so A'-A = e/2(b+h+e/2).
|
|
212997
|
+
const halfDistTol = 0.5 * distanceTolerance;
|
|
212998
|
+
return halfDistTol * (range.xLength() + range.yLength() + halfDistTol);
|
|
212970
212999
|
}
|
|
212971
213000
|
/**
|
|
212972
213001
|
* Return an xy area for a loop, parity region, or union region.
|
|
@@ -213570,10 +213599,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
213570
213599
|
/* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
213571
213600
|
/* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
213572
213601
|
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
213573
|
-
/* harmony import */ var
|
|
213574
|
-
/* harmony import */ var
|
|
213602
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
213603
|
+
/* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
|
|
213575
213604
|
/* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
213576
|
-
/* harmony import */ var
|
|
213605
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
213577
213606
|
/*---------------------------------------------------------------------------------------------
|
|
213578
213607
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
213579
213608
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -214007,9 +214036,8 @@ class RegionBooleanContext {
|
|
|
214007
214036
|
const rangeB = this.groupB.range();
|
|
214008
214037
|
const rangeAB = rangeA.union(rangeB);
|
|
214009
214038
|
const areaTol = _RegionOps__WEBPACK_IMPORTED_MODULE_1__.RegionOps.computeXYAreaTolerance(rangeAB);
|
|
214010
|
-
const direction = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_12__.Vector3d.create(1.0, -0.12328974132467);
|
|
214011
214039
|
let margin = 0.1;
|
|
214012
|
-
this._workSegment =
|
|
214040
|
+
this._workSegment = _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_12__.PlaneAltitudeRangeContext.findExtremePointsInDirection(rangeAB.corners(), RegionBooleanContext._bridgeDirection, this._workSegment);
|
|
214013
214041
|
if (this._workSegment)
|
|
214014
214042
|
margin *= this._workSegment.point0Ref.distanceXY(this._workSegment.point1Ref); // how much further to extend each bridge ray
|
|
214015
214043
|
const maxPoints = [];
|
|
@@ -214017,7 +214045,7 @@ class RegionBooleanContext {
|
|
|
214017
214045
|
const area = _RegionOps__WEBPACK_IMPORTED_MODULE_1__.RegionOps.computeXYArea(region);
|
|
214018
214046
|
if (area === undefined || Math.abs(area) < areaTol)
|
|
214019
214047
|
return; // avoid bridging trivial faces
|
|
214020
|
-
this._workSegment =
|
|
214048
|
+
this._workSegment = _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_12__.PlaneAltitudeRangeContext.findExtremePointsInDirection(region, RegionBooleanContext._bridgeDirection, this._workSegment);
|
|
214021
214049
|
if (this._workSegment)
|
|
214022
214050
|
maxPoints.push(this._workSegment.point1Ref);
|
|
214023
214051
|
};
|
|
@@ -214032,8 +214060,7 @@ class RegionBooleanContext {
|
|
|
214032
214060
|
}
|
|
214033
214061
|
}
|
|
214034
214062
|
}
|
|
214035
|
-
const ray =
|
|
214036
|
-
direction.normalizeInPlace();
|
|
214063
|
+
const ray = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_13__.Ray3d.createZero();
|
|
214037
214064
|
for (const p of maxPoints) {
|
|
214038
214065
|
// Make a line from...
|
|
214039
214066
|
// 1) exactly the max point of the loops to
|
|
@@ -214041,8 +214068,8 @@ class RegionBooleanContext {
|
|
|
214041
214068
|
// If p came from some inner loop this will...
|
|
214042
214069
|
// 1) create a bridge from the inner loop through any containing loops (always)
|
|
214043
214070
|
// 2) avoid crossing any containing loop at a vertex. (with high probability, but not absolutely always)
|
|
214044
|
-
const bridgeLength = margin +
|
|
214045
|
-
const outside =
|
|
214071
|
+
const bridgeLength = margin + _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_13__.Ray3d.create(p, RegionBooleanContext._bridgeDirection, ray).intersectionWithRange3d(rangeAB).high;
|
|
214072
|
+
const outside = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_14__.Point3d.createAdd2Scaled(p, 1.0, RegionBooleanContext._bridgeDirection, bridgeLength);
|
|
214046
214073
|
const bridgeLine = _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.createXYXY(p.x, p.y, outside.x, outside.y);
|
|
214047
214074
|
this.extraGeometry.addMember(bridgeLine, true);
|
|
214048
214075
|
}
|
|
@@ -214200,6 +214227,7 @@ class RegionBooleanContext {
|
|
|
214200
214227
|
return true;
|
|
214201
214228
|
}
|
|
214202
214229
|
}
|
|
214230
|
+
RegionBooleanContext._bridgeDirection = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_14__.Vector3d.createNormalized(1.0, -0.12328974132467); // magic unit direction to minimize vertex hits
|
|
214203
214231
|
/** return xy area between a (part of a) curve and the x axis through a reference point.
|
|
214204
214232
|
* If detail is undefined or does not have both start and end fractions, just do trapezoid area
|
|
214205
214233
|
*/
|
|
@@ -215823,16 +215851,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
215823
215851
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
215824
215852
|
/* harmony export */ "PlaneAltitudeRangeContext": () => (/* binding */ PlaneAltitudeRangeContext)
|
|
215825
215853
|
/* harmony export */ });
|
|
215826
|
-
/* harmony import */ var
|
|
215854
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
215855
|
+
/* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
215827
215856
|
/* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
|
|
215828
|
-
/* harmony import */ var
|
|
215829
|
-
/* harmony import */ var
|
|
215830
|
-
/* harmony import */ var
|
|
215857
|
+
/* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
|
|
215858
|
+
/* harmony import */ var _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../geometry3d/Plane3dByOriginAndUnitNormal */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js");
|
|
215859
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
215831
215860
|
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
215832
|
-
/* harmony import */ var
|
|
215833
|
-
/* harmony import */ var
|
|
215834
|
-
/* harmony import */ var
|
|
215835
|
-
/* harmony import */ var
|
|
215861
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
215862
|
+
/* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
215863
|
+
/* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
215864
|
+
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
215865
|
+
/* harmony import */ var _StrokeOptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
|
|
215836
215866
|
/*---------------------------------------------------------------------------------------------
|
|
215837
215867
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
215838
215868
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -215847,6 +215877,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
215847
215877
|
|
|
215848
215878
|
|
|
215849
215879
|
|
|
215880
|
+
|
|
215881
|
+
|
|
215850
215882
|
/**
|
|
215851
215883
|
* Accumulator context for searching for extrema of geometry along a plane.
|
|
215852
215884
|
* @internal
|
|
@@ -215888,16 +215920,25 @@ class PlaneAltitudeRangeContext extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
215888
215920
|
handleLineString3d(lineString) {
|
|
215889
215921
|
this.announcePoints(lineString.packedPoints);
|
|
215890
215922
|
}
|
|
215923
|
+
initStrokeOptions() {
|
|
215924
|
+
// TODO: compute the exact extrema; until then stroke aggressively
|
|
215925
|
+
if (undefined === this._strokeOptions) {
|
|
215926
|
+
this._strokeOptions = new _StrokeOptions__WEBPACK_IMPORTED_MODULE_2__.StrokeOptions();
|
|
215927
|
+
this._strokeOptions.angleTol = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(1);
|
|
215928
|
+
}
|
|
215929
|
+
}
|
|
215891
215930
|
handleBSplineCurve3d(bcurve) {
|
|
215892
215931
|
// ugh. The point MUST be on the curve -- usual excess-range of poles is not ok.
|
|
215893
|
-
|
|
215894
|
-
|
|
215932
|
+
this.initStrokeOptions();
|
|
215933
|
+
const ls = _LineString3d__WEBPACK_IMPORTED_MODULE_4__.LineString3d.create();
|
|
215934
|
+
bcurve.emitStrokes(ls, this._strokeOptions);
|
|
215895
215935
|
this.handleLineString3d(ls);
|
|
215896
215936
|
}
|
|
215897
215937
|
handleBSplineCurve3dH(bcurve) {
|
|
215898
215938
|
// ugh. The point MUST be on the curve -- usual excess-range of poles is not ok.
|
|
215899
|
-
|
|
215900
|
-
|
|
215939
|
+
this.initStrokeOptions();
|
|
215940
|
+
const ls = _LineString3d__WEBPACK_IMPORTED_MODULE_4__.LineString3d.create();
|
|
215941
|
+
bcurve.emitStrokes(ls, this._strokeOptions);
|
|
215901
215942
|
this.handleLineString3d(ls);
|
|
215902
215943
|
}
|
|
215903
215944
|
handleArc3d(g) {
|
|
@@ -215912,15 +215953,15 @@ class PlaneAltitudeRangeContext extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
215912
215953
|
this.announcePoint((this._workPoint = g.endPoint(this._workPoint)));
|
|
215913
215954
|
}
|
|
215914
215955
|
static findExtremesInDirection(geometry, direction) {
|
|
215915
|
-
const origin = direction instanceof
|
|
215916
|
-
const vector = direction instanceof
|
|
215917
|
-
const plane =
|
|
215956
|
+
const origin = direction instanceof _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_5__.Ray3d ? direction.origin : _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.createZero();
|
|
215957
|
+
const vector = direction instanceof _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_5__.Ray3d ? direction.direction : direction;
|
|
215958
|
+
const plane = _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_7__.Plane3dByOriginAndUnitNormal.create(origin, vector); // vector is normalized, so altitudes are distances
|
|
215918
215959
|
if (plane) {
|
|
215919
215960
|
const context = new PlaneAltitudeRangeContext(plane);
|
|
215920
|
-
if (geometry instanceof
|
|
215961
|
+
if (geometry instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_8__.GeometryQuery) {
|
|
215921
215962
|
geometry.dispatchToGeometryHandler(context);
|
|
215922
215963
|
}
|
|
215923
|
-
else if (geometry instanceof
|
|
215964
|
+
else if (geometry instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_9__.GrowableXYZArray) {
|
|
215924
215965
|
context.announcePoints(geometry);
|
|
215925
215966
|
}
|
|
215926
215967
|
else {
|
|
@@ -215940,7 +215981,7 @@ class PlaneAltitudeRangeContext extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
215940
215981
|
static findExtremePointsInDirection(geometry, direction, lowHigh) {
|
|
215941
215982
|
const context = this.findExtremesInDirection(geometry, direction);
|
|
215942
215983
|
if (context && context.highPoint && context.lowPoint)
|
|
215943
|
-
return
|
|
215984
|
+
return _LineSegment3d__WEBPACK_IMPORTED_MODULE_10__.LineSegment3d.create(context.lowPoint, context.highPoint, lowHigh);
|
|
215944
215985
|
return undefined;
|
|
215945
215986
|
}
|
|
215946
215987
|
/** Compute altitudes for the geometry (via dispatch) over the plane defined by the given direction,
|
|
@@ -215963,8 +216004,8 @@ class PlaneAltitudeRangeContext extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
215963
216004
|
static findExtremeFractionsAlongDirection(geometry, direction, lowHigh) {
|
|
215964
216005
|
const range = this.findExtremeAltitudesInDirection(geometry, direction, lowHigh);
|
|
215965
216006
|
if (undefined !== range) {
|
|
215966
|
-
const mag = (direction instanceof
|
|
215967
|
-
const scaleToFraction =
|
|
216007
|
+
const mag = (direction instanceof _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d) ? direction.magnitude() : direction.direction.magnitude();
|
|
216008
|
+
const scaleToFraction = _Geometry__WEBPACK_IMPORTED_MODULE_11__.Geometry.conditionalDivideCoordinate(1.0, mag);
|
|
215968
216009
|
if (undefined !== scaleToFraction) {
|
|
215969
216010
|
range.low *= scaleToFraction;
|
|
215970
216011
|
range.high *= scaleToFraction;
|
|
@@ -228091,9 +228132,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
228091
228132
|
/** @packageDocumentation
|
|
228092
228133
|
* @module CartesianGeometry
|
|
228093
228134
|
*/
|
|
228094
|
-
|
|
228095
228135
|
/* eslint-disable @typescript-eslint/naming-convention, no-empty */
|
|
228096
228136
|
|
|
228137
|
+
|
|
228097
228138
|
/**
|
|
228098
228139
|
* Helper object to access members of a Point2d[] in geometric calculations.
|
|
228099
228140
|
* * The collection holds only a reference to the actual array.
|
|
@@ -228113,6 +228154,7 @@ class Point2dArrayCarrier extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_
|
|
|
228113
228154
|
}
|
|
228114
228155
|
/**
|
|
228115
228156
|
* Access by index, returning strongly typed Point2d
|
|
228157
|
+
* * This returns the xy value but NOT reference to the point in the "carried" array.
|
|
228116
228158
|
* @param index index of point within the array
|
|
228117
228159
|
* @param result caller-allocated destination
|
|
228118
228160
|
* @returns undefined if the index is out of bounds
|
|
@@ -228232,11 +228274,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
228232
228274
|
* @public
|
|
228233
228275
|
*/
|
|
228234
228276
|
class XY {
|
|
228235
|
-
constructor(x = 0, y = 0) {
|
|
228277
|
+
constructor(x = 0, y = 0) {
|
|
228278
|
+
this.x = x;
|
|
228279
|
+
this.y = y;
|
|
228280
|
+
}
|
|
228236
228281
|
/** Set both x and y. */
|
|
228237
|
-
set(x = 0, y = 0) {
|
|
228282
|
+
set(x = 0, y = 0) {
|
|
228283
|
+
this.x = x;
|
|
228284
|
+
this.y = y;
|
|
228285
|
+
}
|
|
228238
228286
|
/** Set both x and y to zero */
|
|
228239
|
-
setZero() {
|
|
228287
|
+
setZero() {
|
|
228288
|
+
this.x = 0;
|
|
228289
|
+
this.y = 0;
|
|
228290
|
+
}
|
|
228240
228291
|
/** Set both x and y from other. */
|
|
228241
228292
|
setFrom(other) {
|
|
228242
228293
|
if (other) {
|
|
@@ -228249,16 +228300,30 @@ class XY {
|
|
|
228249
228300
|
}
|
|
228250
228301
|
}
|
|
228251
228302
|
/** Freeze this instance so it is read-only */
|
|
228252
|
-
freeze() {
|
|
228303
|
+
freeze() {
|
|
228304
|
+
return Object.freeze(this);
|
|
228305
|
+
}
|
|
228253
228306
|
/** Returns true if this and other have equal x,y parts within Geometry.smallMetricDistance. */
|
|
228254
|
-
isAlmostEqual(other, tol) {
|
|
228307
|
+
isAlmostEqual(other, tol) {
|
|
228308
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.x, other.x, tol) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.y, other.y, tol);
|
|
228309
|
+
}
|
|
228255
228310
|
/** Returns true if this and other have equal x,y parts within Geometry.smallMetricDistance. */
|
|
228256
|
-
isAlmostEqualXY(x, y, tol) {
|
|
228311
|
+
isAlmostEqualXY(x, y, tol) {
|
|
228312
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.x, x, tol) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.y, y, tol);
|
|
228313
|
+
}
|
|
228257
228314
|
/** return a json array `[x,y]` */
|
|
228258
|
-
toJSON() {
|
|
228315
|
+
toJSON() {
|
|
228316
|
+
return [this.x, this.y];
|
|
228317
|
+
}
|
|
228259
228318
|
/** return a json object `{x: 1, y:2}` */
|
|
228260
|
-
toJSONXY() {
|
|
228261
|
-
|
|
228319
|
+
toJSONXY() {
|
|
228320
|
+
return { x: this.x, y: this.y };
|
|
228321
|
+
}
|
|
228322
|
+
/**
|
|
228323
|
+
* Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`
|
|
228324
|
+
* * If no JSON input is provided, 0 would be used as default values for x and y.
|
|
228325
|
+
* @param json the JSON input
|
|
228326
|
+
* */
|
|
228262
228327
|
setFromJSON(json) {
|
|
228263
228328
|
if (Array.isArray(json)) {
|
|
228264
228329
|
this.set(json[0] || 0, json[1] || 0);
|
|
@@ -228274,39 +228339,76 @@ class XY {
|
|
|
228274
228339
|
distance(other) {
|
|
228275
228340
|
const xDist = other.x - this.x;
|
|
228276
228341
|
const yDist = other.y - this.y;
|
|
228277
|
-
return
|
|
228342
|
+
return Math.sqrt(xDist * xDist + yDist * yDist);
|
|
228278
228343
|
}
|
|
228279
228344
|
/** Return squared distance from this point to other */
|
|
228280
228345
|
distanceSquared(other) {
|
|
228281
228346
|
const xDist = other.x - this.x;
|
|
228282
228347
|
const yDist = other.y - this.y;
|
|
228283
|
-
return
|
|
228348
|
+
return xDist * xDist + yDist * yDist;
|
|
228284
228349
|
}
|
|
228285
228350
|
/** Return the largest absolute distance between corresponding components */
|
|
228286
228351
|
maxDiff(other) {
|
|
228287
228352
|
return Math.max(Math.abs(this.x - other.x), Math.abs(this.y - other.y));
|
|
228288
228353
|
}
|
|
228354
|
+
/**
|
|
228355
|
+
* Return the x,y component corresponding to 0,1.
|
|
228356
|
+
*/
|
|
228357
|
+
at(index) {
|
|
228358
|
+
if (index < 0.5)
|
|
228359
|
+
return this.x;
|
|
228360
|
+
return this.y;
|
|
228361
|
+
}
|
|
228362
|
+
/**
|
|
228363
|
+
* Set value at index 0 or 1.
|
|
228364
|
+
*/
|
|
228365
|
+
setAt(index, value) {
|
|
228366
|
+
if (index < 0.5)
|
|
228367
|
+
this.x = value;
|
|
228368
|
+
else
|
|
228369
|
+
this.y = value;
|
|
228370
|
+
}
|
|
228371
|
+
/** Return the index (0,1) of the x,y component with largest absolute value */
|
|
228372
|
+
indexOfMaxAbs() {
|
|
228373
|
+
let index = 0;
|
|
228374
|
+
const a = Math.abs(this.x);
|
|
228375
|
+
const b = Math.abs(this.y);
|
|
228376
|
+
if (b > a) {
|
|
228377
|
+
index = 1;
|
|
228378
|
+
}
|
|
228379
|
+
return index;
|
|
228380
|
+
}
|
|
228289
228381
|
/** returns true if the x,y components are both small by metric metric tolerance */
|
|
228290
228382
|
get isAlmostZero() {
|
|
228291
228383
|
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(this.x) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(this.y);
|
|
228292
228384
|
}
|
|
228293
228385
|
/** Return the largest absolute value of any component */
|
|
228294
|
-
maxAbs() {
|
|
228386
|
+
maxAbs() {
|
|
228387
|
+
return Math.max(Math.abs(this.x), Math.abs(this.y));
|
|
228388
|
+
}
|
|
228295
228389
|
/** Return the magnitude of the vector */
|
|
228296
|
-
magnitude() {
|
|
228390
|
+
magnitude() {
|
|
228391
|
+
return Math.sqrt(this.x * this.x + this.y * this.y);
|
|
228392
|
+
}
|
|
228297
228393
|
/** Return the squared magnitude of the vector. */
|
|
228298
|
-
magnitudeSquared() {
|
|
228394
|
+
magnitudeSquared() {
|
|
228395
|
+
return this.x * this.x + this.y * this.y;
|
|
228396
|
+
}
|
|
228299
228397
|
/** returns true if the x,y components are exactly equal. */
|
|
228300
|
-
isExactEqual(other) {
|
|
228398
|
+
isExactEqual(other) {
|
|
228399
|
+
return this.x === other.x && this.y === other.y;
|
|
228400
|
+
}
|
|
228301
228401
|
/** returns true if x,y match `other` within metric tolerance */
|
|
228302
|
-
isAlmostEqualMetric(other
|
|
228402
|
+
isAlmostEqualMetric(other, distanceTol = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
228403
|
+
return this.maxDiff(other) <= distanceTol;
|
|
228404
|
+
}
|
|
228303
228405
|
/** Return a (full length) vector from this point to other */
|
|
228304
228406
|
vectorTo(other, result) {
|
|
228305
228407
|
return Vector2d.create(other.x - this.x, other.y - this.y, result);
|
|
228306
228408
|
}
|
|
228307
228409
|
/** Return a unit vector from this point to other */
|
|
228308
|
-
unitVectorTo(
|
|
228309
|
-
return this.vectorTo(
|
|
228410
|
+
unitVectorTo(other, result) {
|
|
228411
|
+
return this.vectorTo(other, result).normalize(result);
|
|
228310
228412
|
}
|
|
228311
228413
|
/** cross product of vectors from origin to targets */
|
|
228312
228414
|
static crossProductToPoints(origin, targetA, targetB) {
|
|
@@ -228318,9 +228420,13 @@ class XY {
|
|
|
228318
228420
|
*/
|
|
228319
228421
|
class Point2d extends XY {
|
|
228320
228422
|
/** Constructor for Point2d */
|
|
228321
|
-
constructor(x = 0, y = 0) {
|
|
228423
|
+
constructor(x = 0, y = 0) {
|
|
228424
|
+
super(x, y);
|
|
228425
|
+
}
|
|
228322
228426
|
/** return a new Point2d with x,y coordinates from this. */
|
|
228323
|
-
clone(result) {
|
|
228427
|
+
clone(result) {
|
|
228428
|
+
return Point2d.create(this.x, this.y, result);
|
|
228429
|
+
}
|
|
228324
228430
|
/**
|
|
228325
228431
|
* Return a point (newly created unless result provided) with given x,y coordinates
|
|
228326
228432
|
* @param x x coordinate
|
|
@@ -228335,8 +228441,16 @@ class Point2d extends XY {
|
|
|
228335
228441
|
}
|
|
228336
228442
|
return new Point2d(x, y);
|
|
228337
228443
|
}
|
|
228338
|
-
/**
|
|
228339
|
-
|
|
228444
|
+
/**
|
|
228445
|
+
* Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`
|
|
228446
|
+
* * If no JSON input is provided, 0 would be used as default values for x and y.
|
|
228447
|
+
* @param json the JSON input
|
|
228448
|
+
* */
|
|
228449
|
+
static fromJSON(json) {
|
|
228450
|
+
const val = new Point2d();
|
|
228451
|
+
val.setFromJSON(json);
|
|
228452
|
+
return val;
|
|
228453
|
+
}
|
|
228340
228454
|
/** Create (or optionally reuse) a Point2d from another object with fields x and y */
|
|
228341
228455
|
static createFrom(xy, result) {
|
|
228342
228456
|
if (xy)
|
|
@@ -228344,19 +228458,22 @@ class Point2d extends XY {
|
|
|
228344
228458
|
return Point2d.create(0, 0, result);
|
|
228345
228459
|
}
|
|
228346
228460
|
/** Create a Point2d with both coordinates zero. */
|
|
228347
|
-
static createZero(result) {
|
|
228348
|
-
|
|
228349
|
-
|
|
228461
|
+
static createZero(result) {
|
|
228462
|
+
return Point2d.create(0, 0, result);
|
|
228463
|
+
}
|
|
228464
|
+
/** Starting at this point, move along vector by tangentFraction of the vector length, and then
|
|
228465
|
+
* to the left by leftFraction of the perpendicular vector length.
|
|
228350
228466
|
* @param tangentFraction distance to move along the vector, as a fraction of vector
|
|
228351
228467
|
* @param leftFraction distance to move perpendicular to the vector, as a fraction of the rotated vector
|
|
228468
|
+
* @param vector the other vector
|
|
228352
228469
|
*/
|
|
228353
228470
|
addForwardLeft(tangentFraction, leftFraction, vector) {
|
|
228354
228471
|
const dx = vector.x;
|
|
228355
228472
|
const dy = vector.y;
|
|
228356
228473
|
return Point2d.create(this.x + tangentFraction * dx - leftFraction * dy, this.y + tangentFraction * dy + leftFraction * dx);
|
|
228357
228474
|
}
|
|
228358
|
-
/** Interpolate at tangentFraction between this instance and point
|
|
228359
|
-
* of the vector between the points.
|
|
228475
|
+
/** Interpolate at tangentFraction between this instance and point, and then Move by leftFraction
|
|
228476
|
+
* along the xy perpendicular of the vector between the points.
|
|
228360
228477
|
*/
|
|
228361
228478
|
forwardLeftInterpolate(tangentFraction, leftFraction, point) {
|
|
228362
228479
|
const dx = point.x - this.x;
|
|
@@ -228404,10 +228521,13 @@ class Point2d extends XY {
|
|
|
228404
228521
|
* @param targetB target of second vector
|
|
228405
228522
|
*/
|
|
228406
228523
|
dotVectorsToTargets(targetA, targetB) {
|
|
228407
|
-
return (targetA.x - this.x) * (targetB.x - this.x) +
|
|
228408
|
-
(targetA.y - this.y) * (targetB.y - this.y);
|
|
228524
|
+
return (targetA.x - this.x) * (targetB.x - this.x) + (targetA.y - this.y) * (targetB.y - this.y);
|
|
228409
228525
|
}
|
|
228410
|
-
/**
|
|
228526
|
+
/**
|
|
228527
|
+
* Returns the (scalar) cross product of vector from this to targetA and vector from this to targetB
|
|
228528
|
+
* @param target1 target of first vector
|
|
228529
|
+
* @param target2 target of second vector
|
|
228530
|
+
*/
|
|
228411
228531
|
crossProductToPoints(target1, target2) {
|
|
228412
228532
|
const x1 = target1.x - this.x;
|
|
228413
228533
|
const y1 = target1.y - this.y;
|
|
@@ -228415,25 +228535,31 @@ class Point2d extends XY {
|
|
|
228415
228535
|
const y2 = target2.y - this.y;
|
|
228416
228536
|
return x1 * y2 - y1 * x2;
|
|
228417
228537
|
}
|
|
228418
|
-
/** Return the fractional coordinate of the projection of this instance x,y onto the
|
|
228538
|
+
/** Return the fractional coordinate of the projection of this instance x,y onto the
|
|
228539
|
+
* line from startPoint to endPoint.
|
|
228419
228540
|
* @param startPoint start point of line
|
|
228420
228541
|
* @param endPoint end point of line
|
|
228421
228542
|
* @param defaultFraction fraction to return if startPoint and endPoint are equal.
|
|
228422
228543
|
*/
|
|
228423
|
-
fractionOfProjectionToLine(startPoint, endPoint, defaultFraction) {
|
|
228544
|
+
fractionOfProjectionToLine(startPoint, endPoint, defaultFraction = 0) {
|
|
228424
228545
|
const denominator = startPoint.distanceSquared(endPoint);
|
|
228425
228546
|
if (denominator < _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistanceSquared)
|
|
228426
|
-
return defaultFraction
|
|
228427
|
-
|
|
228547
|
+
return defaultFraction;
|
|
228548
|
+
const numerator = startPoint.dotVectorsToTargets(endPoint, this);
|
|
228549
|
+
return numerator / denominator;
|
|
228428
228550
|
}
|
|
228429
228551
|
}
|
|
228430
228552
|
/** 2D vector with `x`,`y` as properties
|
|
228431
228553
|
* @public
|
|
228432
228554
|
*/
|
|
228433
228555
|
class Vector2d extends XY {
|
|
228434
|
-
constructor(x = 0, y = 0) {
|
|
228556
|
+
constructor(x = 0, y = 0) {
|
|
228557
|
+
super(x, y);
|
|
228558
|
+
}
|
|
228435
228559
|
/** Return a new Vector2d with the same x,y */
|
|
228436
|
-
clone(result) {
|
|
228560
|
+
clone(result) {
|
|
228561
|
+
return Vector2d.create(this.x, this.y, result);
|
|
228562
|
+
}
|
|
228437
228563
|
/** Return a new Vector2d with given x and y */
|
|
228438
228564
|
static create(x = 0, y = 0, result) {
|
|
228439
228565
|
if (result) {
|
|
@@ -228443,12 +228569,24 @@ class Vector2d extends XY {
|
|
|
228443
228569
|
}
|
|
228444
228570
|
return new Vector2d(x, y);
|
|
228445
228571
|
}
|
|
228446
|
-
/**
|
|
228447
|
-
|
|
228448
|
-
|
|
228449
|
-
|
|
228572
|
+
/**
|
|
228573
|
+
* Return a (new) Vector2d with components scale,0
|
|
228574
|
+
* If scale is not given default value 1 is used.
|
|
228575
|
+
*/
|
|
228576
|
+
static unitX(scale = 1) {
|
|
228577
|
+
return new Vector2d(scale, 0);
|
|
228578
|
+
}
|
|
228579
|
+
/**
|
|
228580
|
+
* Return a (new) Vector2d with components 0,scale
|
|
228581
|
+
* If scale is not given default value 1 is used.
|
|
228582
|
+
*/
|
|
228583
|
+
static unitY(scale = 1) {
|
|
228584
|
+
return new Vector2d(0, scale);
|
|
228585
|
+
}
|
|
228450
228586
|
/** Return a Vector2d with components 0,0 */
|
|
228451
|
-
static createZero(result) {
|
|
228587
|
+
static createZero(result) {
|
|
228588
|
+
return Vector2d.create(0, 0, result);
|
|
228589
|
+
}
|
|
228452
228590
|
/** copy contents from another Point3d, Point2d, Vector2d, or Vector3d, or leading entries of Float64Array */
|
|
228453
228591
|
static createFrom(data, result) {
|
|
228454
228592
|
if (data instanceof Float64Array) {
|
|
@@ -228460,8 +228598,16 @@ class Vector2d extends XY {
|
|
|
228460
228598
|
}
|
|
228461
228599
|
return Vector2d.create(data.x, data.y, result);
|
|
228462
228600
|
}
|
|
228463
|
-
/**
|
|
228464
|
-
|
|
228601
|
+
/**
|
|
228602
|
+
* Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`
|
|
228603
|
+
* * If no JSON input is provided, 0 would be used as default values for x and y.
|
|
228604
|
+
* @param json the JSON input
|
|
228605
|
+
* */
|
|
228606
|
+
static fromJSON(json) {
|
|
228607
|
+
const val = new Vector2d();
|
|
228608
|
+
val.setFromJSON(json);
|
|
228609
|
+
return val;
|
|
228610
|
+
}
|
|
228465
228611
|
/** Return a new Vector2d from polar coordinates for radius and Angle from x axis */
|
|
228466
228612
|
static createPolar(r, theta) {
|
|
228467
228613
|
return Vector2d.create(r * theta.cos(), r * theta.sin());
|
|
@@ -228472,6 +228618,7 @@ class Vector2d extends XY {
|
|
|
228472
228618
|
}
|
|
228473
228619
|
/**
|
|
228474
228620
|
* Return a vector that bisects the angle between two normals and extends to the intersection of two offset lines
|
|
228621
|
+
* * returns `undefined` if `unitPerpA = -unitPerpB` (i.e., are opposite)
|
|
228475
228622
|
* @param unitPerpA unit perpendicular to incoming direction
|
|
228476
228623
|
* @param unitPerpB unit perpendicular to outgoing direction
|
|
228477
228624
|
* @param offset offset distance
|
|
@@ -228480,12 +228627,13 @@ class Vector2d extends XY {
|
|
|
228480
228627
|
let bisector = unitPerpA.plus(unitPerpB);
|
|
228481
228628
|
bisector = bisector.normalize();
|
|
228482
228629
|
if (bisector) {
|
|
228483
|
-
const c =
|
|
228630
|
+
const c = bisector.dotProduct(unitPerpA);
|
|
228631
|
+
bisector.scale(offset, bisector);
|
|
228484
228632
|
return bisector.safeDivideOrNull(c);
|
|
228485
228633
|
}
|
|
228486
228634
|
return undefined;
|
|
228487
228635
|
}
|
|
228488
|
-
/** Return a (new or optionally reused) vector which is `this` divided by denominator
|
|
228636
|
+
/** Return a (new or optionally reused) vector which is `this` divided by `denominator`
|
|
228489
228637
|
* * return undefined if denominator is zero.
|
|
228490
228638
|
*/
|
|
228491
228639
|
safeDivideOrNull(denominator, result) {
|
|
@@ -228500,12 +228648,22 @@ class Vector2d extends XY {
|
|
|
228500
228648
|
result = result ? result : new Vector2d();
|
|
228501
228649
|
return this.safeDivideOrNull(mag, result);
|
|
228502
228650
|
}
|
|
228503
|
-
/**
|
|
228651
|
+
/**
|
|
228652
|
+
* Return fractional projection of target vector onto this
|
|
228653
|
+
* * It's returning the signed projection magnitude divided by the target magnitude. In other words,
|
|
228654
|
+
* it's returning the length of the projection as a fraction of the target magnitude.
|
|
228655
|
+
* @param target the target vector
|
|
228656
|
+
* @param defaultFraction the returned value in case magnitude square of target vector is very small
|
|
228657
|
+
* */
|
|
228504
228658
|
fractionOfProjectionToVector(target, defaultFraction) {
|
|
228505
|
-
|
|
228659
|
+
/*
|
|
228660
|
+
* projection length is (this.target)/||target||
|
|
228661
|
+
* but here we return (this.target)/||target||^2
|
|
228662
|
+
*/
|
|
228506
228663
|
const denominator = target.magnitudeSquared();
|
|
228507
228664
|
if (denominator < _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistanceSquared)
|
|
228508
228665
|
return defaultFraction ? defaultFraction : 0;
|
|
228666
|
+
const numerator = this.dotProduct(target);
|
|
228509
228667
|
return numerator / denominator;
|
|
228510
228668
|
}
|
|
228511
228669
|
/** Return a new vector with components negated from this instance. */
|
|
@@ -228518,7 +228676,7 @@ class Vector2d extends XY {
|
|
|
228518
228676
|
/** Return a vector same length as this but rotated 90 degrees counter clockwise */
|
|
228519
228677
|
rotate90CCWXY(result) {
|
|
228520
228678
|
result = result ? result : new Vector2d();
|
|
228521
|
-
// save x,y to allow aliasing
|
|
228679
|
+
// save x,y to allow aliasing ("this" can be passed to the function as "result")
|
|
228522
228680
|
const xx = this.x;
|
|
228523
228681
|
const yy = this.y;
|
|
228524
228682
|
result.x = -yy;
|
|
@@ -228528,7 +228686,7 @@ class Vector2d extends XY {
|
|
|
228528
228686
|
/** Return a vector same length as this but rotated 90 degrees clockwise */
|
|
228529
228687
|
rotate90CWXY(result) {
|
|
228530
228688
|
result = result ? result : new Vector2d();
|
|
228531
|
-
// save x,y to allow aliasing
|
|
228689
|
+
// save x,y to allow aliasing ("this" can be passed to the function as "result")
|
|
228532
228690
|
const xx = this.x;
|
|
228533
228691
|
const yy = this.y;
|
|
228534
228692
|
result.x = yy;
|
|
@@ -228540,6 +228698,7 @@ class Vector2d extends XY {
|
|
|
228540
228698
|
result = result ? result : new Vector2d();
|
|
228541
228699
|
const xx = this.x;
|
|
228542
228700
|
const yy = this.y;
|
|
228701
|
+
// save x,y to allow aliasing ("this" can be passed to the function as "result")
|
|
228543
228702
|
result.x = -yy;
|
|
228544
228703
|
result.y = xx;
|
|
228545
228704
|
const d2 = xx * xx + yy * yy;
|
|
@@ -228554,6 +228713,7 @@ class Vector2d extends XY {
|
|
|
228554
228713
|
rotateXY(angle, result) {
|
|
228555
228714
|
const s = angle.sin();
|
|
228556
228715
|
const c = angle.cos();
|
|
228716
|
+
// save x,y to allow aliasing ("this" can be passed to the function as "result")
|
|
228557
228717
|
const xx = this.x;
|
|
228558
228718
|
const yy = this.y;
|
|
228559
228719
|
result = result ? result : new Vector2d();
|
|
@@ -228561,18 +228721,26 @@ class Vector2d extends XY {
|
|
|
228561
228721
|
result.y = xx * s + yy * c;
|
|
228562
228722
|
return result;
|
|
228563
228723
|
}
|
|
228564
|
-
/**
|
|
228565
|
-
|
|
228724
|
+
/** Return a vector computed at fractional position between this vector and vectorB
|
|
228725
|
+
* @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`.
|
|
228726
|
+
* True fractions are "between", negatives are "before this", beyond 1 is "beyond vectorB".
|
|
228727
|
+
* @param vectorB second vector
|
|
228728
|
+
* @param result optional preallocated result.
|
|
228729
|
+
*/
|
|
228730
|
+
interpolate(fraction, vectorB, result) {
|
|
228566
228731
|
result = result ? result : new Vector2d();
|
|
228567
|
-
/*
|
|
228732
|
+
/*
|
|
228733
|
+
* For best last-bit behavior, if fraction is below 0.5, use this as base point.
|
|
228734
|
+
* If above 0.5, use vectorB as base point.
|
|
228735
|
+
*/
|
|
228568
228736
|
if (fraction <= 0.5) {
|
|
228569
|
-
result.x = this.x + fraction * (
|
|
228570
|
-
result.y = this.y + fraction * (
|
|
228737
|
+
result.x = this.x + fraction * (vectorB.x - this.x);
|
|
228738
|
+
result.y = this.y + fraction * (vectorB.y - this.y);
|
|
228571
228739
|
}
|
|
228572
228740
|
else {
|
|
228573
228741
|
const t = fraction - 1.0;
|
|
228574
|
-
result.x =
|
|
228575
|
-
result.y =
|
|
228742
|
+
result.x = vectorB.x + t * (vectorB.x - this.x);
|
|
228743
|
+
result.y = vectorB.y + t * (vectorB.y - this.y);
|
|
228576
228744
|
}
|
|
228577
228745
|
return result;
|
|
228578
228746
|
}
|
|
@@ -228626,16 +228794,19 @@ class Vector2d extends XY {
|
|
|
228626
228794
|
return this.scale(length / mag, result);
|
|
228627
228795
|
}
|
|
228628
228796
|
/** return the dot product of this with vectorB */
|
|
228629
|
-
dotProduct(vectorB) {
|
|
228797
|
+
dotProduct(vectorB) {
|
|
228798
|
+
return this.x * vectorB.x + this.y * vectorB.y;
|
|
228799
|
+
}
|
|
228630
228800
|
/** dot product with vector from pointA to pointB */
|
|
228631
228801
|
dotProductStartEnd(pointA, pointB) {
|
|
228632
|
-
return this.x * (pointB.x - pointA.x)
|
|
228633
|
-
+ this.y * (pointB.y - pointA.y);
|
|
228802
|
+
return this.x * (pointB.x - pointA.x) + this.y * (pointB.y - pointA.y);
|
|
228634
228803
|
}
|
|
228635
228804
|
/** vector cross product {this CROSS vectorB} */
|
|
228636
|
-
crossProduct(vectorB) {
|
|
228805
|
+
crossProduct(vectorB) {
|
|
228806
|
+
return this.x * vectorB.y - this.y * vectorB.x;
|
|
228807
|
+
}
|
|
228637
228808
|
/**
|
|
228638
|
-
* return the
|
|
228809
|
+
* return the radians (as a simple number, not strongly typed Angle) signed angle from this to vectorB.
|
|
228639
228810
|
* This is positive if the shortest turn is counterclockwise, negative if clockwise.
|
|
228640
228811
|
*/
|
|
228641
228812
|
radiansTo(vectorB) {
|
|
@@ -228648,13 +228819,6 @@ class Vector2d extends XY {
|
|
|
228648
228819
|
angleTo(vectorB) {
|
|
228649
228820
|
return _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(this.radiansTo(vectorB));
|
|
228650
228821
|
}
|
|
228651
|
-
/* smallerUnorientedAngleTo(vectorB: Vector2d): Angle { }
|
|
228652
|
-
signedAngleTo(vectorB: Vector2d, upVector: Vector2d): Angle { }
|
|
228653
|
-
planarAngleTo(vectorB: Vector2d, planeNormal: Vector2d): Angle { }
|
|
228654
|
-
// sectors
|
|
228655
|
-
isInSmallerSector(vectorA: Vector2d, vectorB: Vector2d): boolean { }
|
|
228656
|
-
isInCCWSector(vectorA: Vector2d, vectorB: Vector2d, upVector: Vector2d): boolean { }
|
|
228657
|
-
*/
|
|
228658
228822
|
/**
|
|
228659
228823
|
* Test if this vector is parallel to other.
|
|
228660
228824
|
* * The input tolerances in `options`, if given, are considered to be squared for efficiency's sake,
|
|
@@ -228745,6 +228909,7 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
|
|
|
228745
228909
|
}
|
|
228746
228910
|
/**
|
|
228747
228911
|
* Access by index, returning strongly typed Point3d
|
|
228912
|
+
* * This returns the xyz value but NOT reference to the point in the "carried" array.
|
|
228748
228913
|
* @param index index of point within the array
|
|
228749
228914
|
* @param result caller-allocated destination
|
|
228750
228915
|
* @returns undefined if the index is out of bounds
|
|
@@ -228780,15 +228945,24 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
|
|
|
228780
228945
|
}
|
|
228781
228946
|
return undefined;
|
|
228782
228947
|
}
|
|
228783
|
-
/**
|
|
228948
|
+
/**
|
|
228949
|
+
* access x of indexed point
|
|
228950
|
+
* * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results
|
|
228951
|
+
* */
|
|
228784
228952
|
getXAtUncheckedPointIndex(pointIndex) {
|
|
228785
228953
|
return this.data[pointIndex].x;
|
|
228786
228954
|
}
|
|
228787
|
-
/**
|
|
228955
|
+
/**
|
|
228956
|
+
* access y of indexed point
|
|
228957
|
+
* * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results
|
|
228958
|
+
* */
|
|
228788
228959
|
getYAtUncheckedPointIndex(pointIndex) {
|
|
228789
228960
|
return this.data[pointIndex].y;
|
|
228790
228961
|
}
|
|
228791
|
-
/**
|
|
228962
|
+
/**
|
|
228963
|
+
* access z of indexed point
|
|
228964
|
+
* * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results
|
|
228965
|
+
* */
|
|
228792
228966
|
getZAtUncheckedPointIndex(pointIndex) {
|
|
228793
228967
|
return this.data[pointIndex].z;
|
|
228794
228968
|
}
|
|
@@ -228856,7 +229030,7 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
|
|
|
228856
229030
|
result.addCrossProductToTargetsInPlace(data[originIndex].x, data[originIndex].y, data[originIndex].z, data[indexA].x, data[indexA].y, data[indexA].z, data[indexB].x, data[indexB].y, data[indexB].z);
|
|
228857
229031
|
}
|
|
228858
229032
|
/**
|
|
228859
|
-
* Accumulate scale times the x,y,z values at index.
|
|
229033
|
+
* Accumulate scale times the x,y,z values at index to the sum.
|
|
228860
229034
|
* No action if index is out of bounds.
|
|
228861
229035
|
*/
|
|
228862
229036
|
accumulateScaledXYZ(index, scale, sum) {
|
|
@@ -228946,7 +229120,7 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
|
|
|
228946
229120
|
}
|
|
228947
229121
|
/** Adjust index into range by modulo with the length. */
|
|
228948
229122
|
cyclicIndex(i) {
|
|
228949
|
-
return (i % this.length);
|
|
229123
|
+
return (i % this.data.length);
|
|
228950
229124
|
}
|
|
228951
229125
|
}
|
|
228952
229126
|
|
|
@@ -228976,6 +229150,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
228976
229150
|
/** @packageDocumentation
|
|
228977
229151
|
* @module CartesianGeometry
|
|
228978
229152
|
*/
|
|
229153
|
+
// cspell:word CWXY
|
|
228979
229154
|
|
|
228980
229155
|
|
|
228981
229156
|
|
|
@@ -229210,7 +229385,7 @@ class XYZ {
|
|
|
229210
229385
|
return this.y;
|
|
229211
229386
|
}
|
|
229212
229387
|
/**
|
|
229213
|
-
*
|
|
229388
|
+
* Set value at index 0 or 1 or 2.
|
|
229214
229389
|
*/
|
|
229215
229390
|
setAt(index, value) {
|
|
229216
229391
|
if (index < 0.5)
|
|
@@ -229834,6 +230009,19 @@ class Vector3d extends XYZ {
|
|
|
229834
230009
|
this.z *= a;
|
|
229835
230010
|
return true;
|
|
229836
230011
|
}
|
|
230012
|
+
/** Create a normalized vector from the inputs.
|
|
230013
|
+
* @param result optional result
|
|
230014
|
+
* @returns undefined if and only if normalization fails
|
|
230015
|
+
*/
|
|
230016
|
+
static createNormalized(x = 0, y = 0, z = 0, result) {
|
|
230017
|
+
if (undefined === result)
|
|
230018
|
+
result = Vector3d.create(x, y, z);
|
|
230019
|
+
else
|
|
230020
|
+
result.set(x, y, z);
|
|
230021
|
+
if (result.normalizeInPlace())
|
|
230022
|
+
return result;
|
|
230023
|
+
return undefined;
|
|
230024
|
+
}
|
|
229837
230025
|
/**
|
|
229838
230026
|
* Return fractional projection of target vector onto this
|
|
229839
230027
|
* * It's returning the signed projection magnitude divided by the target magnitude. In other words,
|
|
@@ -229873,6 +230061,17 @@ class Vector3d extends XYZ {
|
|
|
229873
230061
|
result.z = this.z;
|
|
229874
230062
|
return result;
|
|
229875
230063
|
}
|
|
230064
|
+
/** Return a vector same length as this but rotated 90 degrees clockwise */
|
|
230065
|
+
rotate90CWXY(result) {
|
|
230066
|
+
result = result ? result : new Vector3d();
|
|
230067
|
+
// save x,y to allow aliasing ("this" can be passed to the function as "result")
|
|
230068
|
+
const xx = this.x;
|
|
230069
|
+
const yy = this.y;
|
|
230070
|
+
result.x = yy;
|
|
230071
|
+
result.y = -xx;
|
|
230072
|
+
result.z = this.z;
|
|
230073
|
+
return result;
|
|
230074
|
+
}
|
|
229876
230075
|
/**
|
|
229877
230076
|
* Return a vector which is in the xy plane, perpendicular ot the xy part of this vector, and of unit length.
|
|
229878
230077
|
* * If the xy part is 00, the return is the rotated (but not normalized) xy parts of this vector.
|
|
@@ -229882,6 +230081,7 @@ class Vector3d extends XYZ {
|
|
|
229882
230081
|
result = result ? result : new Vector3d();
|
|
229883
230082
|
const xx = this.x;
|
|
229884
230083
|
const yy = this.y;
|
|
230084
|
+
// save x,y to allow aliasing ("this" can be passed to the function as "result")
|
|
229885
230085
|
result.x = -yy;
|
|
229886
230086
|
result.y = xx;
|
|
229887
230087
|
result.z = 0.0;
|
|
@@ -229942,6 +230142,10 @@ class Vector3d extends XYZ {
|
|
|
229942
230142
|
*/
|
|
229943
230143
|
interpolate(fraction, vectorB, result) {
|
|
229944
230144
|
result = result ? result : new Vector3d();
|
|
230145
|
+
/*
|
|
230146
|
+
* For best last-bit behavior, if fraction is below 0.5, use this as base point.
|
|
230147
|
+
* If above 0.5, use vectorB as base point.
|
|
230148
|
+
*/
|
|
229945
230149
|
if (fraction <= 0.5) {
|
|
229946
230150
|
result.x = this.x + fraction * (vectorB.x - this.x);
|
|
229947
230151
|
result.y = this.y + fraction * (vectorB.y - this.y);
|
|
@@ -291959,7 +292163,7 @@ class TestContext {
|
|
|
291959
292163
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
291960
292164
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${(_a = process.env.IMJS_URL_PREFIX) !== null && _a !== void 0 ? _a : ""}api.bentley.com/imodels` } });
|
|
291961
292165
|
await core_frontend_1.NoRenderApp.startup({
|
|
291962
|
-
applicationVersion: "3.5.0-dev.
|
|
292166
|
+
applicationVersion: "3.5.0-dev.57",
|
|
291963
292167
|
applicationId: this.settings.gprid,
|
|
291964
292168
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
|
|
291965
292169
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -292096,7 +292300,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
292096
292300
|
/* harmony export */ "NodeKey": () => (/* reexport safe */ _presentation_common_hierarchy_Key__WEBPACK_IMPORTED_MODULE_31__.NodeKey),
|
|
292097
292301
|
/* harmony export */ "NodePathElement": () => (/* reexport safe */ _presentation_common_hierarchy_NodePathElement__WEBPACK_IMPORTED_MODULE_33__.NodePathElement),
|
|
292098
292302
|
/* harmony export */ "NodePathFilteringData": () => (/* reexport safe */ _presentation_common_hierarchy_NodePathElement__WEBPACK_IMPORTED_MODULE_33__.NodePathFilteringData),
|
|
292099
|
-
/* harmony export */ "PRESENTATION_COMMON_ROOT": () => (/* reexport safe */ _presentation_common_Utils__WEBPACK_IMPORTED_MODULE_11__.PRESENTATION_COMMON_ROOT),
|
|
292100
292303
|
/* harmony export */ "PRESENTATION_IPC_CHANNEL_NAME": () => (/* reexport safe */ _presentation_common_PresentationIpcInterface__WEBPACK_IMPORTED_MODULE_12__.PRESENTATION_IPC_CHANNEL_NAME),
|
|
292101
292304
|
/* harmony export */ "PartialHierarchyModification": () => (/* reexport safe */ _presentation_common_Update__WEBPACK_IMPORTED_MODULE_10__.PartialHierarchyModification),
|
|
292102
292305
|
/* harmony export */ "PresentationError": () => (/* reexport safe */ _presentation_common_Error__WEBPACK_IMPORTED_MODULE_3__.PresentationError),
|
|
@@ -294473,11 +294676,9 @@ var HierarchyCompareInfo;
|
|
|
294473
294676
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
294474
294677
|
|
|
294475
294678
|
"use strict";
|
|
294476
|
-
var __dirname = "/";
|
|
294477
294679
|
__webpack_require__.r(__webpack_exports__);
|
|
294478
294680
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
294479
294681
|
/* harmony export */ "DEFAULT_KEYS_BATCH_SIZE": () => (/* binding */ DEFAULT_KEYS_BATCH_SIZE),
|
|
294480
|
-
/* harmony export */ "PRESENTATION_COMMON_ROOT": () => (/* binding */ PRESENTATION_COMMON_ROOT),
|
|
294481
294682
|
/* harmony export */ "getInstancesCount": () => (/* binding */ getInstancesCount)
|
|
294482
294683
|
/* harmony export */ });
|
|
294483
294684
|
/* harmony import */ var _hierarchy_Key__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hierarchy/Key */ "../../presentation/common/lib/esm/presentation-common/hierarchy/Key.js");
|
|
@@ -294520,8 +294721,6 @@ const getInstancesCount = (keys) => {
|
|
|
294520
294721
|
* @public
|
|
294521
294722
|
*/
|
|
294522
294723
|
const DEFAULT_KEYS_BATCH_SIZE = 5000;
|
|
294523
|
-
/** @internal */
|
|
294524
|
-
const PRESENTATION_COMMON_ROOT = __dirname;
|
|
294525
294724
|
|
|
294526
294725
|
|
|
294527
294726
|
/***/ }),
|
|
@@ -311028,7 +311227,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
|
311028
311227
|
/***/ ((module) => {
|
|
311029
311228
|
|
|
311030
311229
|
"use strict";
|
|
311031
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"3.5.0-dev.
|
|
311230
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"3.5.0-dev.57","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","build:ci":"npm run -s build && npm run -s build:esm","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 ES2020 --outDir lib/esm","clean":"rimraf 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","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/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-eslintrc -c \\"../../tools/eslint-plugin/dist/configs/extension-exports-config.js\\" \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core/tree/master/core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^3.5.0-dev.57","@itwin/core-bentley":"workspace:^3.5.0-dev.57","@itwin/core-common":"workspace:^3.5.0-dev.57","@itwin/core-geometry":"workspace:^3.5.0-dev.57","@itwin/core-orbitgt":"workspace:^3.5.0-dev.57","@itwin/core-quantity":"workspace:^3.5.0-dev.57","@itwin/webgl-compatibility":"workspace:^3.5.0-dev.57"},"//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/certa":"workspace:*","@itwin/eslint-plugin":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/deep-assign":"^0.1.0","@types/lodash":"^4.14.0","@types/mocha":"^8.2.2","@types/node":"18.11.5","@types/qs":"^6.5.0","@types/semver":"7.3.10","@types/superagent":"^4.1.14","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^7.11.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~4.4.0","webpack":"^5.64.4"},"//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/object-storage-azure":"~1.4.0","@itwin/cloud-agnostic-core":"~1.4.0","@itwin/object-storage-core":"~1.4.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","deep-assign":"^2.0.0","fuse.js":"^3.3.0","lodash":"^4.17.10","qs":"^6.5.1","semver":"^7.3.5","superagent":"7.1.3","wms-capabilities":"0.4.0","xml-js":"~1.6.11","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
|
|
311032
311231
|
|
|
311033
311232
|
/***/ }),
|
|
311034
311233
|
|