@itwin/ecschema-rpcinterface-tests 3.5.0-dev.51 → 3.5.0-dev.53
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 +230 -79
- 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 +16 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_554f.bundled-tests.js","mappings":";;;;;;;;AAAA","sources":["file:///ignored|D:\\
|
|
1
|
+
{"version":3,"file":"_554f.bundled-tests.js","mappings":";;;;;;;;AAAA","sources":["file:///ignored|D:\\vsts_a\\3\\s\\common\\temp\\node_modules\\.pnpm\\@loaders.gl+worker-utils@3.2.10\\node_modules\\@loaders.gl\\worker-utils\\dist\\esm\\lib\\library-utils|../node/require-utils.node"],"names":[],"sourceRoot":""}
|
|
@@ -179494,6 +179494,7 @@ class ArcGisUtilities {
|
|
|
179494
179494
|
* @param latitude Latitude in degrees to use to compute scales (i.e 0 for Equator)
|
|
179495
179495
|
* @param tileSize Size of a tile in pixels (i.e 256)
|
|
179496
179496
|
* @param screenDpi Monitor resolution in dots per inch (i.e. typically 96dpi is used by Google Maps)
|
|
179497
|
+
*
|
|
179497
179498
|
* @returns An array containing resolution and scale values for each requested zoom level
|
|
179498
179499
|
*/
|
|
179499
179500
|
static computeZoomLevelsScales(startZoom = 0, endZoom = 20, latitude = 0, tileSize = 256, screenDpi = 96) {
|
|
@@ -179520,20 +179521,20 @@ class ArcGisUtilities {
|
|
|
179520
179521
|
* @param maxScale Maximum scale value that needs to be matched to a LOD level
|
|
179521
179522
|
* @returns minLod: LOD value matching minScale, maxLod: LOD value matching maxScale
|
|
179522
179523
|
*/
|
|
179523
|
-
static getZoomLevelsScales(defaultMaxLod, tileSize, minScale, maxScale) {
|
|
179524
|
+
static getZoomLevelsScales(defaultMaxLod, tileSize, minScale, maxScale, tolerance = 0) {
|
|
179524
179525
|
let minLod, maxLod;
|
|
179525
179526
|
const zoomScales = ArcGisUtilities.computeZoomLevelsScales(0, defaultMaxLod, 0 /* latitude 0 = Equator*/, tileSize);
|
|
179526
179527
|
if (zoomScales.length > 0) {
|
|
179527
179528
|
if (minScale) {
|
|
179528
179529
|
minLod = 0;
|
|
179529
179530
|
// We are looking for the largest scale value with a scale value smaller than minScale
|
|
179530
|
-
for (; minLod < zoomScales.length && zoomScales[minLod].scale > minScale; minLod++)
|
|
179531
|
+
for (; minLod < zoomScales.length && (zoomScales[minLod].scale > minScale && Math.abs(zoomScales[minLod].scale - minScale) > tolerance); minLod++)
|
|
179531
179532
|
;
|
|
179532
179533
|
}
|
|
179533
179534
|
if (maxScale) {
|
|
179534
179535
|
maxLod = defaultMaxLod;
|
|
179535
179536
|
// We are looking for the smallest scale value with a value greater than maxScale
|
|
179536
|
-
for (; maxLod >= 0 && zoomScales[maxLod].scale < maxScale; maxLod--)
|
|
179537
|
+
for (; maxLod >= 0 && zoomScales[maxLod].scale < maxScale && Math.abs(zoomScales[maxLod].scale - maxScale) > tolerance; maxLod--)
|
|
179537
179538
|
;
|
|
179538
179539
|
}
|
|
179539
179540
|
}
|
|
@@ -237438,9 +237439,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
237438
237439
|
/** @packageDocumentation
|
|
237439
237440
|
* @module CartesianGeometry
|
|
237440
237441
|
*/
|
|
237441
|
-
|
|
237442
237442
|
/* eslint-disable @typescript-eslint/naming-convention, no-empty */
|
|
237443
237443
|
|
|
237444
|
+
|
|
237444
237445
|
/**
|
|
237445
237446
|
* Helper object to access members of a Point2d[] in geometric calculations.
|
|
237446
237447
|
* * The collection holds only a reference to the actual array.
|
|
@@ -237460,6 +237461,7 @@ class Point2dArrayCarrier extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_
|
|
|
237460
237461
|
}
|
|
237461
237462
|
/**
|
|
237462
237463
|
* Access by index, returning strongly typed Point2d
|
|
237464
|
+
* * This returns the xy value but NOT reference to the point in the "carried" array.
|
|
237463
237465
|
* @param index index of point within the array
|
|
237464
237466
|
* @param result caller-allocated destination
|
|
237465
237467
|
* @returns undefined if the index is out of bounds
|
|
@@ -237579,11 +237581,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
237579
237581
|
* @public
|
|
237580
237582
|
*/
|
|
237581
237583
|
class XY {
|
|
237582
|
-
constructor(x = 0, y = 0) {
|
|
237584
|
+
constructor(x = 0, y = 0) {
|
|
237585
|
+
this.x = x;
|
|
237586
|
+
this.y = y;
|
|
237587
|
+
}
|
|
237583
237588
|
/** Set both x and y. */
|
|
237584
|
-
set(x = 0, y = 0) {
|
|
237589
|
+
set(x = 0, y = 0) {
|
|
237590
|
+
this.x = x;
|
|
237591
|
+
this.y = y;
|
|
237592
|
+
}
|
|
237585
237593
|
/** Set both x and y to zero */
|
|
237586
|
-
setZero() {
|
|
237594
|
+
setZero() {
|
|
237595
|
+
this.x = 0;
|
|
237596
|
+
this.y = 0;
|
|
237597
|
+
}
|
|
237587
237598
|
/** Set both x and y from other. */
|
|
237588
237599
|
setFrom(other) {
|
|
237589
237600
|
if (other) {
|
|
@@ -237596,16 +237607,30 @@ class XY {
|
|
|
237596
237607
|
}
|
|
237597
237608
|
}
|
|
237598
237609
|
/** Freeze this instance so it is read-only */
|
|
237599
|
-
freeze() {
|
|
237610
|
+
freeze() {
|
|
237611
|
+
return Object.freeze(this);
|
|
237612
|
+
}
|
|
237600
237613
|
/** Returns true if this and other have equal x,y parts within Geometry.smallMetricDistance. */
|
|
237601
|
-
isAlmostEqual(other, tol) {
|
|
237614
|
+
isAlmostEqual(other, tol) {
|
|
237615
|
+
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);
|
|
237616
|
+
}
|
|
237602
237617
|
/** Returns true if this and other have equal x,y parts within Geometry.smallMetricDistance. */
|
|
237603
|
-
isAlmostEqualXY(x, y, tol) {
|
|
237618
|
+
isAlmostEqualXY(x, y, tol) {
|
|
237619
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.x, x, tol) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.y, y, tol);
|
|
237620
|
+
}
|
|
237604
237621
|
/** return a json array `[x,y]` */
|
|
237605
|
-
toJSON() {
|
|
237622
|
+
toJSON() {
|
|
237623
|
+
return [this.x, this.y];
|
|
237624
|
+
}
|
|
237606
237625
|
/** return a json object `{x: 1, y:2}` */
|
|
237607
|
-
toJSONXY() {
|
|
237608
|
-
|
|
237626
|
+
toJSONXY() {
|
|
237627
|
+
return { x: this.x, y: this.y };
|
|
237628
|
+
}
|
|
237629
|
+
/**
|
|
237630
|
+
* Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`
|
|
237631
|
+
* * If no JSON input is provided, 0 would be used as default values for x and y.
|
|
237632
|
+
* @param json the JSON input
|
|
237633
|
+
* */
|
|
237609
237634
|
setFromJSON(json) {
|
|
237610
237635
|
if (Array.isArray(json)) {
|
|
237611
237636
|
this.set(json[0] || 0, json[1] || 0);
|
|
@@ -237621,39 +237646,76 @@ class XY {
|
|
|
237621
237646
|
distance(other) {
|
|
237622
237647
|
const xDist = other.x - this.x;
|
|
237623
237648
|
const yDist = other.y - this.y;
|
|
237624
|
-
return
|
|
237649
|
+
return Math.sqrt(xDist * xDist + yDist * yDist);
|
|
237625
237650
|
}
|
|
237626
237651
|
/** Return squared distance from this point to other */
|
|
237627
237652
|
distanceSquared(other) {
|
|
237628
237653
|
const xDist = other.x - this.x;
|
|
237629
237654
|
const yDist = other.y - this.y;
|
|
237630
|
-
return
|
|
237655
|
+
return xDist * xDist + yDist * yDist;
|
|
237631
237656
|
}
|
|
237632
237657
|
/** Return the largest absolute distance between corresponding components */
|
|
237633
237658
|
maxDiff(other) {
|
|
237634
237659
|
return Math.max(Math.abs(this.x - other.x), Math.abs(this.y - other.y));
|
|
237635
237660
|
}
|
|
237661
|
+
/**
|
|
237662
|
+
* Return the x,y component corresponding to 0,1.
|
|
237663
|
+
*/
|
|
237664
|
+
at(index) {
|
|
237665
|
+
if (index < 0.5)
|
|
237666
|
+
return this.x;
|
|
237667
|
+
return this.y;
|
|
237668
|
+
}
|
|
237669
|
+
/**
|
|
237670
|
+
* Set value at index 0 or 1.
|
|
237671
|
+
*/
|
|
237672
|
+
setAt(index, value) {
|
|
237673
|
+
if (index < 0.5)
|
|
237674
|
+
this.x = value;
|
|
237675
|
+
else
|
|
237676
|
+
this.y = value;
|
|
237677
|
+
}
|
|
237678
|
+
/** Return the index (0,1) of the x,y component with largest absolute value */
|
|
237679
|
+
indexOfMaxAbs() {
|
|
237680
|
+
let index = 0;
|
|
237681
|
+
const a = Math.abs(this.x);
|
|
237682
|
+
const b = Math.abs(this.y);
|
|
237683
|
+
if (b > a) {
|
|
237684
|
+
index = 1;
|
|
237685
|
+
}
|
|
237686
|
+
return index;
|
|
237687
|
+
}
|
|
237636
237688
|
/** returns true if the x,y components are both small by metric metric tolerance */
|
|
237637
237689
|
get isAlmostZero() {
|
|
237638
237690
|
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(this.x) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(this.y);
|
|
237639
237691
|
}
|
|
237640
237692
|
/** Return the largest absolute value of any component */
|
|
237641
|
-
maxAbs() {
|
|
237693
|
+
maxAbs() {
|
|
237694
|
+
return Math.max(Math.abs(this.x), Math.abs(this.y));
|
|
237695
|
+
}
|
|
237642
237696
|
/** Return the magnitude of the vector */
|
|
237643
|
-
magnitude() {
|
|
237697
|
+
magnitude() {
|
|
237698
|
+
return Math.sqrt(this.x * this.x + this.y * this.y);
|
|
237699
|
+
}
|
|
237644
237700
|
/** Return the squared magnitude of the vector. */
|
|
237645
|
-
magnitudeSquared() {
|
|
237701
|
+
magnitudeSquared() {
|
|
237702
|
+
return this.x * this.x + this.y * this.y;
|
|
237703
|
+
}
|
|
237646
237704
|
/** returns true if the x,y components are exactly equal. */
|
|
237647
|
-
isExactEqual(other) {
|
|
237705
|
+
isExactEqual(other) {
|
|
237706
|
+
return this.x === other.x && this.y === other.y;
|
|
237707
|
+
}
|
|
237648
237708
|
/** returns true if x,y match `other` within metric tolerance */
|
|
237649
|
-
isAlmostEqualMetric(other
|
|
237709
|
+
isAlmostEqualMetric(other, distanceTol = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
237710
|
+
return this.maxDiff(other) <= distanceTol;
|
|
237711
|
+
}
|
|
237650
237712
|
/** Return a (full length) vector from this point to other */
|
|
237651
237713
|
vectorTo(other, result) {
|
|
237652
237714
|
return Vector2d.create(other.x - this.x, other.y - this.y, result);
|
|
237653
237715
|
}
|
|
237654
237716
|
/** Return a unit vector from this point to other */
|
|
237655
|
-
unitVectorTo(
|
|
237656
|
-
return this.vectorTo(
|
|
237717
|
+
unitVectorTo(other, result) {
|
|
237718
|
+
return this.vectorTo(other, result).normalize(result);
|
|
237657
237719
|
}
|
|
237658
237720
|
/** cross product of vectors from origin to targets */
|
|
237659
237721
|
static crossProductToPoints(origin, targetA, targetB) {
|
|
@@ -237665,9 +237727,13 @@ class XY {
|
|
|
237665
237727
|
*/
|
|
237666
237728
|
class Point2d extends XY {
|
|
237667
237729
|
/** Constructor for Point2d */
|
|
237668
|
-
constructor(x = 0, y = 0) {
|
|
237730
|
+
constructor(x = 0, y = 0) {
|
|
237731
|
+
super(x, y);
|
|
237732
|
+
}
|
|
237669
237733
|
/** return a new Point2d with x,y coordinates from this. */
|
|
237670
|
-
clone(result) {
|
|
237734
|
+
clone(result) {
|
|
237735
|
+
return Point2d.create(this.x, this.y, result);
|
|
237736
|
+
}
|
|
237671
237737
|
/**
|
|
237672
237738
|
* Return a point (newly created unless result provided) with given x,y coordinates
|
|
237673
237739
|
* @param x x coordinate
|
|
@@ -237682,8 +237748,16 @@ class Point2d extends XY {
|
|
|
237682
237748
|
}
|
|
237683
237749
|
return new Point2d(x, y);
|
|
237684
237750
|
}
|
|
237685
|
-
/**
|
|
237686
|
-
|
|
237751
|
+
/**
|
|
237752
|
+
* Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`
|
|
237753
|
+
* * If no JSON input is provided, 0 would be used as default values for x and y.
|
|
237754
|
+
* @param json the JSON input
|
|
237755
|
+
* */
|
|
237756
|
+
static fromJSON(json) {
|
|
237757
|
+
const val = new Point2d();
|
|
237758
|
+
val.setFromJSON(json);
|
|
237759
|
+
return val;
|
|
237760
|
+
}
|
|
237687
237761
|
/** Create (or optionally reuse) a Point2d from another object with fields x and y */
|
|
237688
237762
|
static createFrom(xy, result) {
|
|
237689
237763
|
if (xy)
|
|
@@ -237691,19 +237765,22 @@ class Point2d extends XY {
|
|
|
237691
237765
|
return Point2d.create(0, 0, result);
|
|
237692
237766
|
}
|
|
237693
237767
|
/** Create a Point2d with both coordinates zero. */
|
|
237694
|
-
static createZero(result) {
|
|
237695
|
-
|
|
237696
|
-
|
|
237768
|
+
static createZero(result) {
|
|
237769
|
+
return Point2d.create(0, 0, result);
|
|
237770
|
+
}
|
|
237771
|
+
/** Starting at this point, move along vector by tangentFraction of the vector length, and then
|
|
237772
|
+
* to the left by leftFraction of the perpendicular vector length.
|
|
237697
237773
|
* @param tangentFraction distance to move along the vector, as a fraction of vector
|
|
237698
237774
|
* @param leftFraction distance to move perpendicular to the vector, as a fraction of the rotated vector
|
|
237775
|
+
* @param vector the other vector
|
|
237699
237776
|
*/
|
|
237700
237777
|
addForwardLeft(tangentFraction, leftFraction, vector) {
|
|
237701
237778
|
const dx = vector.x;
|
|
237702
237779
|
const dy = vector.y;
|
|
237703
237780
|
return Point2d.create(this.x + tangentFraction * dx - leftFraction * dy, this.y + tangentFraction * dy + leftFraction * dx);
|
|
237704
237781
|
}
|
|
237705
|
-
/** Interpolate at tangentFraction between this instance and point
|
|
237706
|
-
* of the vector between the points.
|
|
237782
|
+
/** Interpolate at tangentFraction between this instance and point, and then Move by leftFraction
|
|
237783
|
+
* along the xy perpendicular of the vector between the points.
|
|
237707
237784
|
*/
|
|
237708
237785
|
forwardLeftInterpolate(tangentFraction, leftFraction, point) {
|
|
237709
237786
|
const dx = point.x - this.x;
|
|
@@ -237751,10 +237828,13 @@ class Point2d extends XY {
|
|
|
237751
237828
|
* @param targetB target of second vector
|
|
237752
237829
|
*/
|
|
237753
237830
|
dotVectorsToTargets(targetA, targetB) {
|
|
237754
|
-
return (targetA.x - this.x) * (targetB.x - this.x) +
|
|
237755
|
-
(targetA.y - this.y) * (targetB.y - this.y);
|
|
237831
|
+
return (targetA.x - this.x) * (targetB.x - this.x) + (targetA.y - this.y) * (targetB.y - this.y);
|
|
237756
237832
|
}
|
|
237757
|
-
/**
|
|
237833
|
+
/**
|
|
237834
|
+
* Returns the (scalar) cross product of vector from this to targetA and vector from this to targetB
|
|
237835
|
+
* @param target1 target of first vector
|
|
237836
|
+
* @param target2 target of second vector
|
|
237837
|
+
*/
|
|
237758
237838
|
crossProductToPoints(target1, target2) {
|
|
237759
237839
|
const x1 = target1.x - this.x;
|
|
237760
237840
|
const y1 = target1.y - this.y;
|
|
@@ -237762,25 +237842,31 @@ class Point2d extends XY {
|
|
|
237762
237842
|
const y2 = target2.y - this.y;
|
|
237763
237843
|
return x1 * y2 - y1 * x2;
|
|
237764
237844
|
}
|
|
237765
|
-
/** Return the fractional coordinate of the projection of this instance x,y onto the
|
|
237845
|
+
/** Return the fractional coordinate of the projection of this instance x,y onto the
|
|
237846
|
+
* line from startPoint to endPoint.
|
|
237766
237847
|
* @param startPoint start point of line
|
|
237767
237848
|
* @param endPoint end point of line
|
|
237768
237849
|
* @param defaultFraction fraction to return if startPoint and endPoint are equal.
|
|
237769
237850
|
*/
|
|
237770
|
-
fractionOfProjectionToLine(startPoint, endPoint, defaultFraction) {
|
|
237851
|
+
fractionOfProjectionToLine(startPoint, endPoint, defaultFraction = 0) {
|
|
237771
237852
|
const denominator = startPoint.distanceSquared(endPoint);
|
|
237772
237853
|
if (denominator < _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistanceSquared)
|
|
237773
|
-
return defaultFraction
|
|
237774
|
-
|
|
237854
|
+
return defaultFraction;
|
|
237855
|
+
const numerator = startPoint.dotVectorsToTargets(endPoint, this);
|
|
237856
|
+
return numerator / denominator;
|
|
237775
237857
|
}
|
|
237776
237858
|
}
|
|
237777
237859
|
/** 2D vector with `x`,`y` as properties
|
|
237778
237860
|
* @public
|
|
237779
237861
|
*/
|
|
237780
237862
|
class Vector2d extends XY {
|
|
237781
|
-
constructor(x = 0, y = 0) {
|
|
237863
|
+
constructor(x = 0, y = 0) {
|
|
237864
|
+
super(x, y);
|
|
237865
|
+
}
|
|
237782
237866
|
/** Return a new Vector2d with the same x,y */
|
|
237783
|
-
clone(result) {
|
|
237867
|
+
clone(result) {
|
|
237868
|
+
return Vector2d.create(this.x, this.y, result);
|
|
237869
|
+
}
|
|
237784
237870
|
/** Return a new Vector2d with given x and y */
|
|
237785
237871
|
static create(x = 0, y = 0, result) {
|
|
237786
237872
|
if (result) {
|
|
@@ -237790,12 +237876,24 @@ class Vector2d extends XY {
|
|
|
237790
237876
|
}
|
|
237791
237877
|
return new Vector2d(x, y);
|
|
237792
237878
|
}
|
|
237793
|
-
/**
|
|
237794
|
-
|
|
237795
|
-
|
|
237796
|
-
|
|
237879
|
+
/**
|
|
237880
|
+
* Return a (new) Vector2d with components scale,0
|
|
237881
|
+
* If scale is not given default value 1 is used.
|
|
237882
|
+
*/
|
|
237883
|
+
static unitX(scale = 1) {
|
|
237884
|
+
return new Vector2d(scale, 0);
|
|
237885
|
+
}
|
|
237886
|
+
/**
|
|
237887
|
+
* Return a (new) Vector2d with components 0,scale
|
|
237888
|
+
* If scale is not given default value 1 is used.
|
|
237889
|
+
*/
|
|
237890
|
+
static unitY(scale = 1) {
|
|
237891
|
+
return new Vector2d(0, scale);
|
|
237892
|
+
}
|
|
237797
237893
|
/** Return a Vector2d with components 0,0 */
|
|
237798
|
-
static createZero(result) {
|
|
237894
|
+
static createZero(result) {
|
|
237895
|
+
return Vector2d.create(0, 0, result);
|
|
237896
|
+
}
|
|
237799
237897
|
/** copy contents from another Point3d, Point2d, Vector2d, or Vector3d, or leading entries of Float64Array */
|
|
237800
237898
|
static createFrom(data, result) {
|
|
237801
237899
|
if (data instanceof Float64Array) {
|
|
@@ -237807,8 +237905,16 @@ class Vector2d extends XY {
|
|
|
237807
237905
|
}
|
|
237808
237906
|
return Vector2d.create(data.x, data.y, result);
|
|
237809
237907
|
}
|
|
237810
|
-
/**
|
|
237811
|
-
|
|
237908
|
+
/**
|
|
237909
|
+
* Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`
|
|
237910
|
+
* * If no JSON input is provided, 0 would be used as default values for x and y.
|
|
237911
|
+
* @param json the JSON input
|
|
237912
|
+
* */
|
|
237913
|
+
static fromJSON(json) {
|
|
237914
|
+
const val = new Vector2d();
|
|
237915
|
+
val.setFromJSON(json);
|
|
237916
|
+
return val;
|
|
237917
|
+
}
|
|
237812
237918
|
/** Return a new Vector2d from polar coordinates for radius and Angle from x axis */
|
|
237813
237919
|
static createPolar(r, theta) {
|
|
237814
237920
|
return Vector2d.create(r * theta.cos(), r * theta.sin());
|
|
@@ -237819,6 +237925,7 @@ class Vector2d extends XY {
|
|
|
237819
237925
|
}
|
|
237820
237926
|
/**
|
|
237821
237927
|
* Return a vector that bisects the angle between two normals and extends to the intersection of two offset lines
|
|
237928
|
+
* * returns `undefined` if `unitPerpA = -unitPerpB` (i.e., are opposite)
|
|
237822
237929
|
* @param unitPerpA unit perpendicular to incoming direction
|
|
237823
237930
|
* @param unitPerpB unit perpendicular to outgoing direction
|
|
237824
237931
|
* @param offset offset distance
|
|
@@ -237827,12 +237934,13 @@ class Vector2d extends XY {
|
|
|
237827
237934
|
let bisector = unitPerpA.plus(unitPerpB);
|
|
237828
237935
|
bisector = bisector.normalize();
|
|
237829
237936
|
if (bisector) {
|
|
237830
|
-
const c =
|
|
237937
|
+
const c = bisector.dotProduct(unitPerpA);
|
|
237938
|
+
bisector.scale(offset, bisector);
|
|
237831
237939
|
return bisector.safeDivideOrNull(c);
|
|
237832
237940
|
}
|
|
237833
237941
|
return undefined;
|
|
237834
237942
|
}
|
|
237835
|
-
/** Return a (new or optionally reused) vector which is `this` divided by denominator
|
|
237943
|
+
/** Return a (new or optionally reused) vector which is `this` divided by `denominator`
|
|
237836
237944
|
* * return undefined if denominator is zero.
|
|
237837
237945
|
*/
|
|
237838
237946
|
safeDivideOrNull(denominator, result) {
|
|
@@ -237847,12 +237955,22 @@ class Vector2d extends XY {
|
|
|
237847
237955
|
result = result ? result : new Vector2d();
|
|
237848
237956
|
return this.safeDivideOrNull(mag, result);
|
|
237849
237957
|
}
|
|
237850
|
-
/**
|
|
237958
|
+
/**
|
|
237959
|
+
* Return fractional projection of target vector onto this
|
|
237960
|
+
* * It's returning the signed projection magnitude divided by the target magnitude. In other words,
|
|
237961
|
+
* it's returning the length of the projection as a fraction of the target magnitude.
|
|
237962
|
+
* @param target the target vector
|
|
237963
|
+
* @param defaultFraction the returned value in case magnitude square of target vector is very small
|
|
237964
|
+
* */
|
|
237851
237965
|
fractionOfProjectionToVector(target, defaultFraction) {
|
|
237852
|
-
|
|
237966
|
+
/*
|
|
237967
|
+
* projection length is (this.target)/||target||
|
|
237968
|
+
* but here we return (this.target)/||target||^2
|
|
237969
|
+
*/
|
|
237853
237970
|
const denominator = target.magnitudeSquared();
|
|
237854
237971
|
if (denominator < _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistanceSquared)
|
|
237855
237972
|
return defaultFraction ? defaultFraction : 0;
|
|
237973
|
+
const numerator = this.dotProduct(target);
|
|
237856
237974
|
return numerator / denominator;
|
|
237857
237975
|
}
|
|
237858
237976
|
/** Return a new vector with components negated from this instance. */
|
|
@@ -237865,7 +237983,7 @@ class Vector2d extends XY {
|
|
|
237865
237983
|
/** Return a vector same length as this but rotated 90 degrees counter clockwise */
|
|
237866
237984
|
rotate90CCWXY(result) {
|
|
237867
237985
|
result = result ? result : new Vector2d();
|
|
237868
|
-
// save x,y to allow aliasing
|
|
237986
|
+
// save x,y to allow aliasing ("this" can be passed to the function as "result")
|
|
237869
237987
|
const xx = this.x;
|
|
237870
237988
|
const yy = this.y;
|
|
237871
237989
|
result.x = -yy;
|
|
@@ -237875,7 +237993,7 @@ class Vector2d extends XY {
|
|
|
237875
237993
|
/** Return a vector same length as this but rotated 90 degrees clockwise */
|
|
237876
237994
|
rotate90CWXY(result) {
|
|
237877
237995
|
result = result ? result : new Vector2d();
|
|
237878
|
-
// save x,y to allow aliasing
|
|
237996
|
+
// save x,y to allow aliasing ("this" can be passed to the function as "result")
|
|
237879
237997
|
const xx = this.x;
|
|
237880
237998
|
const yy = this.y;
|
|
237881
237999
|
result.x = yy;
|
|
@@ -237887,6 +238005,7 @@ class Vector2d extends XY {
|
|
|
237887
238005
|
result = result ? result : new Vector2d();
|
|
237888
238006
|
const xx = this.x;
|
|
237889
238007
|
const yy = this.y;
|
|
238008
|
+
// save x,y to allow aliasing ("this" can be passed to the function as "result")
|
|
237890
238009
|
result.x = -yy;
|
|
237891
238010
|
result.y = xx;
|
|
237892
238011
|
const d2 = xx * xx + yy * yy;
|
|
@@ -237901,6 +238020,7 @@ class Vector2d extends XY {
|
|
|
237901
238020
|
rotateXY(angle, result) {
|
|
237902
238021
|
const s = angle.sin();
|
|
237903
238022
|
const c = angle.cos();
|
|
238023
|
+
// save x,y to allow aliasing ("this" can be passed to the function as "result")
|
|
237904
238024
|
const xx = this.x;
|
|
237905
238025
|
const yy = this.y;
|
|
237906
238026
|
result = result ? result : new Vector2d();
|
|
@@ -237908,18 +238028,26 @@ class Vector2d extends XY {
|
|
|
237908
238028
|
result.y = xx * s + yy * c;
|
|
237909
238029
|
return result;
|
|
237910
238030
|
}
|
|
237911
|
-
/**
|
|
237912
|
-
|
|
238031
|
+
/** Return a vector computed at fractional position between this vector and vectorB
|
|
238032
|
+
* @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`.
|
|
238033
|
+
* True fractions are "between", negatives are "before this", beyond 1 is "beyond vectorB".
|
|
238034
|
+
* @param vectorB second vector
|
|
238035
|
+
* @param result optional preallocated result.
|
|
238036
|
+
*/
|
|
238037
|
+
interpolate(fraction, vectorB, result) {
|
|
237913
238038
|
result = result ? result : new Vector2d();
|
|
237914
|
-
/*
|
|
238039
|
+
/*
|
|
238040
|
+
* For best last-bit behavior, if fraction is below 0.5, use this as base point.
|
|
238041
|
+
* If above 0.5, use vectorB as base point.
|
|
238042
|
+
*/
|
|
237915
238043
|
if (fraction <= 0.5) {
|
|
237916
|
-
result.x = this.x + fraction * (
|
|
237917
|
-
result.y = this.y + fraction * (
|
|
238044
|
+
result.x = this.x + fraction * (vectorB.x - this.x);
|
|
238045
|
+
result.y = this.y + fraction * (vectorB.y - this.y);
|
|
237918
238046
|
}
|
|
237919
238047
|
else {
|
|
237920
238048
|
const t = fraction - 1.0;
|
|
237921
|
-
result.x =
|
|
237922
|
-
result.y =
|
|
238049
|
+
result.x = vectorB.x + t * (vectorB.x - this.x);
|
|
238050
|
+
result.y = vectorB.y + t * (vectorB.y - this.y);
|
|
237923
238051
|
}
|
|
237924
238052
|
return result;
|
|
237925
238053
|
}
|
|
@@ -237973,16 +238101,19 @@ class Vector2d extends XY {
|
|
|
237973
238101
|
return this.scale(length / mag, result);
|
|
237974
238102
|
}
|
|
237975
238103
|
/** return the dot product of this with vectorB */
|
|
237976
|
-
dotProduct(vectorB) {
|
|
238104
|
+
dotProduct(vectorB) {
|
|
238105
|
+
return this.x * vectorB.x + this.y * vectorB.y;
|
|
238106
|
+
}
|
|
237977
238107
|
/** dot product with vector from pointA to pointB */
|
|
237978
238108
|
dotProductStartEnd(pointA, pointB) {
|
|
237979
|
-
return this.x * (pointB.x - pointA.x)
|
|
237980
|
-
+ this.y * (pointB.y - pointA.y);
|
|
238109
|
+
return this.x * (pointB.x - pointA.x) + this.y * (pointB.y - pointA.y);
|
|
237981
238110
|
}
|
|
237982
238111
|
/** vector cross product {this CROSS vectorB} */
|
|
237983
|
-
crossProduct(vectorB) {
|
|
238112
|
+
crossProduct(vectorB) {
|
|
238113
|
+
return this.x * vectorB.y - this.y * vectorB.x;
|
|
238114
|
+
}
|
|
237984
238115
|
/**
|
|
237985
|
-
* return the
|
|
238116
|
+
* return the radians (as a simple number, not strongly typed Angle) signed angle from this to vectorB.
|
|
237986
238117
|
* This is positive if the shortest turn is counterclockwise, negative if clockwise.
|
|
237987
238118
|
*/
|
|
237988
238119
|
radiansTo(vectorB) {
|
|
@@ -237995,13 +238126,6 @@ class Vector2d extends XY {
|
|
|
237995
238126
|
angleTo(vectorB) {
|
|
237996
238127
|
return _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(this.radiansTo(vectorB));
|
|
237997
238128
|
}
|
|
237998
|
-
/* smallerUnorientedAngleTo(vectorB: Vector2d): Angle { }
|
|
237999
|
-
signedAngleTo(vectorB: Vector2d, upVector: Vector2d): Angle { }
|
|
238000
|
-
planarAngleTo(vectorB: Vector2d, planeNormal: Vector2d): Angle { }
|
|
238001
|
-
// sectors
|
|
238002
|
-
isInSmallerSector(vectorA: Vector2d, vectorB: Vector2d): boolean { }
|
|
238003
|
-
isInCCWSector(vectorA: Vector2d, vectorB: Vector2d, upVector: Vector2d): boolean { }
|
|
238004
|
-
*/
|
|
238005
238129
|
/**
|
|
238006
238130
|
* Test if this vector is parallel to other.
|
|
238007
238131
|
* * The input tolerances in `options`, if given, are considered to be squared for efficiency's sake,
|
|
@@ -238092,6 +238216,7 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
|
|
|
238092
238216
|
}
|
|
238093
238217
|
/**
|
|
238094
238218
|
* Access by index, returning strongly typed Point3d
|
|
238219
|
+
* * This returns the xyz value but NOT reference to the point in the "carried" array.
|
|
238095
238220
|
* @param index index of point within the array
|
|
238096
238221
|
* @param result caller-allocated destination
|
|
238097
238222
|
* @returns undefined if the index is out of bounds
|
|
@@ -238127,15 +238252,24 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
|
|
|
238127
238252
|
}
|
|
238128
238253
|
return undefined;
|
|
238129
238254
|
}
|
|
238130
|
-
/**
|
|
238255
|
+
/**
|
|
238256
|
+
* access x of indexed point
|
|
238257
|
+
* * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results
|
|
238258
|
+
* */
|
|
238131
238259
|
getXAtUncheckedPointIndex(pointIndex) {
|
|
238132
238260
|
return this.data[pointIndex].x;
|
|
238133
238261
|
}
|
|
238134
|
-
/**
|
|
238262
|
+
/**
|
|
238263
|
+
* access y of indexed point
|
|
238264
|
+
* * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results
|
|
238265
|
+
* */
|
|
238135
238266
|
getYAtUncheckedPointIndex(pointIndex) {
|
|
238136
238267
|
return this.data[pointIndex].y;
|
|
238137
238268
|
}
|
|
238138
|
-
/**
|
|
238269
|
+
/**
|
|
238270
|
+
* access z of indexed point
|
|
238271
|
+
* * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results
|
|
238272
|
+
* */
|
|
238139
238273
|
getZAtUncheckedPointIndex(pointIndex) {
|
|
238140
238274
|
return this.data[pointIndex].z;
|
|
238141
238275
|
}
|
|
@@ -238203,7 +238337,7 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
|
|
|
238203
238337
|
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);
|
|
238204
238338
|
}
|
|
238205
238339
|
/**
|
|
238206
|
-
* Accumulate scale times the x,y,z values at index.
|
|
238340
|
+
* Accumulate scale times the x,y,z values at index to the sum.
|
|
238207
238341
|
* No action if index is out of bounds.
|
|
238208
238342
|
*/
|
|
238209
238343
|
accumulateScaledXYZ(index, scale, sum) {
|
|
@@ -238293,7 +238427,7 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
|
|
|
238293
238427
|
}
|
|
238294
238428
|
/** Adjust index into range by modulo with the length. */
|
|
238295
238429
|
cyclicIndex(i) {
|
|
238296
|
-
return (i % this.length);
|
|
238430
|
+
return (i % this.data.length);
|
|
238297
238431
|
}
|
|
238298
238432
|
}
|
|
238299
238433
|
|
|
@@ -238323,6 +238457,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
238323
238457
|
/** @packageDocumentation
|
|
238324
238458
|
* @module CartesianGeometry
|
|
238325
238459
|
*/
|
|
238460
|
+
// cspell:word CWXY
|
|
238326
238461
|
|
|
238327
238462
|
|
|
238328
238463
|
|
|
@@ -238557,7 +238692,7 @@ class XYZ {
|
|
|
238557
238692
|
return this.y;
|
|
238558
238693
|
}
|
|
238559
238694
|
/**
|
|
238560
|
-
*
|
|
238695
|
+
* Set value at index 0 or 1 or 2.
|
|
238561
238696
|
*/
|
|
238562
238697
|
setAt(index, value) {
|
|
238563
238698
|
if (index < 0.5)
|
|
@@ -239220,6 +239355,17 @@ class Vector3d extends XYZ {
|
|
|
239220
239355
|
result.z = this.z;
|
|
239221
239356
|
return result;
|
|
239222
239357
|
}
|
|
239358
|
+
/** Return a vector same length as this but rotated 90 degrees clockwise */
|
|
239359
|
+
rotate90CWXY(result) {
|
|
239360
|
+
result = result ? result : new Vector3d();
|
|
239361
|
+
// save x,y to allow aliasing ("this" can be passed to the function as "result")
|
|
239362
|
+
const xx = this.x;
|
|
239363
|
+
const yy = this.y;
|
|
239364
|
+
result.x = yy;
|
|
239365
|
+
result.y = -xx;
|
|
239366
|
+
result.z = this.z;
|
|
239367
|
+
return result;
|
|
239368
|
+
}
|
|
239223
239369
|
/**
|
|
239224
239370
|
* Return a vector which is in the xy plane, perpendicular ot the xy part of this vector, and of unit length.
|
|
239225
239371
|
* * If the xy part is 00, the return is the rotated (but not normalized) xy parts of this vector.
|
|
@@ -239229,6 +239375,7 @@ class Vector3d extends XYZ {
|
|
|
239229
239375
|
result = result ? result : new Vector3d();
|
|
239230
239376
|
const xx = this.x;
|
|
239231
239377
|
const yy = this.y;
|
|
239378
|
+
// save x,y to allow aliasing ("this" can be passed to the function as "result")
|
|
239232
239379
|
result.x = -yy;
|
|
239233
239380
|
result.y = xx;
|
|
239234
239381
|
result.z = 0.0;
|
|
@@ -239289,6 +239436,10 @@ class Vector3d extends XYZ {
|
|
|
239289
239436
|
*/
|
|
239290
239437
|
interpolate(fraction, vectorB, result) {
|
|
239291
239438
|
result = result ? result : new Vector3d();
|
|
239439
|
+
/*
|
|
239440
|
+
* For best last-bit behavior, if fraction is below 0.5, use this as base point.
|
|
239441
|
+
* If above 0.5, use vectorB as base point.
|
|
239442
|
+
*/
|
|
239292
239443
|
if (fraction <= 0.5) {
|
|
239293
239444
|
result.x = this.x + fraction * (vectorB.x - this.x);
|
|
239294
239445
|
result.y = this.y + fraction * (vectorB.y - this.y);
|
|
@@ -310706,7 +310857,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
|
310706
310857
|
/***/ ((module) => {
|
|
310707
310858
|
|
|
310708
310859
|
"use strict";
|
|
310709
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"3.5.0-dev.
|
|
310860
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"3.5.0-dev.53","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.53","@itwin/core-bentley":"workspace:^3.5.0-dev.53","@itwin/core-common":"workspace:^3.5.0-dev.53","@itwin/core-geometry":"workspace:^3.5.0-dev.53","@itwin/core-orbitgt":"workspace:^3.5.0-dev.53","@itwin/core-quantity":"workspace:^3.5.0-dev.53","@itwin/webgl-compatibility":"workspace:^3.5.0-dev.53"},"//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"}}]}}');
|
|
310710
310861
|
|
|
310711
310862
|
/***/ })
|
|
310712
310863
|
|