@itwin/rpcinterface-full-stack-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.
@@ -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
  }
@@ -228091,9 +228092,9 @@ __webpack_require__.r(__webpack_exports__);
228091
228092
  /** @packageDocumentation
228092
228093
  * @module CartesianGeometry
228093
228094
  */
228094
-
228095
228095
  /* eslint-disable @typescript-eslint/naming-convention, no-empty */
228096
228096
 
228097
+
228097
228098
  /**
228098
228099
  * Helper object to access members of a Point2d[] in geometric calculations.
228099
228100
  * * The collection holds only a reference to the actual array.
@@ -228113,6 +228114,7 @@ class Point2dArrayCarrier extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_
228113
228114
  }
228114
228115
  /**
228115
228116
  * Access by index, returning strongly typed Point2d
228117
+ * * This returns the xy value but NOT reference to the point in the "carried" array.
228116
228118
  * @param index index of point within the array
228117
228119
  * @param result caller-allocated destination
228118
228120
  * @returns undefined if the index is out of bounds
@@ -228232,11 +228234,20 @@ __webpack_require__.r(__webpack_exports__);
228232
228234
  * @public
228233
228235
  */
228234
228236
  class XY {
228235
- constructor(x = 0, y = 0) { this.x = x; this.y = y; }
228237
+ constructor(x = 0, y = 0) {
228238
+ this.x = x;
228239
+ this.y = y;
228240
+ }
228236
228241
  /** Set both x and y. */
228237
- set(x = 0, y = 0) { this.x = x; this.y = y; }
228242
+ set(x = 0, y = 0) {
228243
+ this.x = x;
228244
+ this.y = y;
228245
+ }
228238
228246
  /** Set both x and y to zero */
228239
- setZero() { this.x = 0; this.y = 0; }
228247
+ setZero() {
228248
+ this.x = 0;
228249
+ this.y = 0;
228250
+ }
228240
228251
  /** Set both x and y from other. */
228241
228252
  setFrom(other) {
228242
228253
  if (other) {
@@ -228249,16 +228260,30 @@ class XY {
228249
228260
  }
228250
228261
  }
228251
228262
  /** Freeze this instance so it is read-only */
228252
- freeze() { return Object.freeze(this); }
228263
+ freeze() {
228264
+ return Object.freeze(this);
228265
+ }
228253
228266
  /** Returns true if this and other have equal x,y parts within Geometry.smallMetricDistance. */
228254
- isAlmostEqual(other, tol) { 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); }
228267
+ isAlmostEqual(other, tol) {
228268
+ 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);
228269
+ }
228255
228270
  /** Returns true if this and other have equal x,y parts within Geometry.smallMetricDistance. */
228256
- isAlmostEqualXY(x, y, tol) { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.x, x, tol) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.y, y, tol); }
228271
+ isAlmostEqualXY(x, y, tol) {
228272
+ return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.x, x, tol) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.y, y, tol);
228273
+ }
228257
228274
  /** return a json array `[x,y]` */
228258
- toJSON() { return [this.x, this.y]; }
228275
+ toJSON() {
228276
+ return [this.x, this.y];
228277
+ }
228259
228278
  /** return a json object `{x: 1, y:2}` */
228260
- toJSONXY() { return { x: this.x, y: this.y }; }
228261
- /** Set x and y from a JSON source such as `[1,2]` or `{x:1, y:2}` */
228279
+ toJSONXY() {
228280
+ return { x: this.x, y: this.y };
228281
+ }
228282
+ /**
228283
+ * Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`
228284
+ * * If no JSON input is provided, 0 would be used as default values for x and y.
228285
+ * @param json the JSON input
228286
+ * */
228262
228287
  setFromJSON(json) {
228263
228288
  if (Array.isArray(json)) {
228264
228289
  this.set(json[0] || 0, json[1] || 0);
@@ -228274,39 +228299,76 @@ class XY {
228274
228299
  distance(other) {
228275
228300
  const xDist = other.x - this.x;
228276
228301
  const yDist = other.y - this.y;
228277
- return (Math.sqrt(xDist * xDist + yDist * yDist));
228302
+ return Math.sqrt(xDist * xDist + yDist * yDist);
228278
228303
  }
228279
228304
  /** Return squared distance from this point to other */
228280
228305
  distanceSquared(other) {
228281
228306
  const xDist = other.x - this.x;
228282
228307
  const yDist = other.y - this.y;
228283
- return (xDist * xDist + yDist * yDist);
228308
+ return xDist * xDist + yDist * yDist;
228284
228309
  }
228285
228310
  /** Return the largest absolute distance between corresponding components */
228286
228311
  maxDiff(other) {
228287
228312
  return Math.max(Math.abs(this.x - other.x), Math.abs(this.y - other.y));
228288
228313
  }
228314
+ /**
228315
+ * Return the x,y component corresponding to 0,1.
228316
+ */
228317
+ at(index) {
228318
+ if (index < 0.5)
228319
+ return this.x;
228320
+ return this.y;
228321
+ }
228322
+ /**
228323
+ * Set value at index 0 or 1.
228324
+ */
228325
+ setAt(index, value) {
228326
+ if (index < 0.5)
228327
+ this.x = value;
228328
+ else
228329
+ this.y = value;
228330
+ }
228331
+ /** Return the index (0,1) of the x,y component with largest absolute value */
228332
+ indexOfMaxAbs() {
228333
+ let index = 0;
228334
+ const a = Math.abs(this.x);
228335
+ const b = Math.abs(this.y);
228336
+ if (b > a) {
228337
+ index = 1;
228338
+ }
228339
+ return index;
228340
+ }
228289
228341
  /** returns true if the x,y components are both small by metric metric tolerance */
228290
228342
  get isAlmostZero() {
228291
228343
  return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(this.x) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(this.y);
228292
228344
  }
228293
228345
  /** Return the largest absolute value of any component */
228294
- maxAbs() { return Math.max(Math.abs(this.x), Math.abs(this.y)); }
228346
+ maxAbs() {
228347
+ return Math.max(Math.abs(this.x), Math.abs(this.y));
228348
+ }
228295
228349
  /** Return the magnitude of the vector */
228296
- magnitude() { return Math.sqrt(this.x * this.x + this.y * this.y); }
228350
+ magnitude() {
228351
+ return Math.sqrt(this.x * this.x + this.y * this.y);
228352
+ }
228297
228353
  /** Return the squared magnitude of the vector. */
228298
- magnitudeSquared() { return this.x * this.x + this.y * this.y; }
228354
+ magnitudeSquared() {
228355
+ return this.x * this.x + this.y * this.y;
228356
+ }
228299
228357
  /** returns true if the x,y components are exactly equal. */
228300
- isExactEqual(other) { return this.x === other.x && this.y === other.y; }
228358
+ isExactEqual(other) {
228359
+ return this.x === other.x && this.y === other.y;
228360
+ }
228301
228361
  /** returns true if x,y match `other` within metric tolerance */
228302
- isAlmostEqualMetric(other) { return this.maxDiff(other) <= _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance; }
228362
+ isAlmostEqualMetric(other, distanceTol = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
228363
+ return this.maxDiff(other) <= distanceTol;
228364
+ }
228303
228365
  /** Return a (full length) vector from this point to other */
228304
228366
  vectorTo(other, result) {
228305
228367
  return Vector2d.create(other.x - this.x, other.y - this.y, result);
228306
228368
  }
228307
228369
  /** Return a unit vector from this point to other */
228308
- unitVectorTo(target, result) {
228309
- return this.vectorTo(target, result).normalize(result);
228370
+ unitVectorTo(other, result) {
228371
+ return this.vectorTo(other, result).normalize(result);
228310
228372
  }
228311
228373
  /** cross product of vectors from origin to targets */
228312
228374
  static crossProductToPoints(origin, targetA, targetB) {
@@ -228318,9 +228380,13 @@ class XY {
228318
228380
  */
228319
228381
  class Point2d extends XY {
228320
228382
  /** Constructor for Point2d */
228321
- constructor(x = 0, y = 0) { super(x, y); }
228383
+ constructor(x = 0, y = 0) {
228384
+ super(x, y);
228385
+ }
228322
228386
  /** return a new Point2d with x,y coordinates from this. */
228323
- clone(result) { return Point2d.create(this.x, this.y, result); }
228387
+ clone(result) {
228388
+ return Point2d.create(this.x, this.y, result);
228389
+ }
228324
228390
  /**
228325
228391
  * Return a point (newly created unless result provided) with given x,y coordinates
228326
228392
  * @param x x coordinate
@@ -228335,8 +228401,16 @@ class Point2d extends XY {
228335
228401
  }
228336
228402
  return new Point2d(x, y);
228337
228403
  }
228338
- /** Convert JSON `[1,2]` or `{x:1, y:2}` to a Point2d instance */
228339
- static fromJSON(json) { const val = new Point2d(); val.setFromJSON(json); return val; }
228404
+ /**
228405
+ * Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`
228406
+ * * If no JSON input is provided, 0 would be used as default values for x and y.
228407
+ * @param json the JSON input
228408
+ * */
228409
+ static fromJSON(json) {
228410
+ const val = new Point2d();
228411
+ val.setFromJSON(json);
228412
+ return val;
228413
+ }
228340
228414
  /** Create (or optionally reuse) a Point2d from another object with fields x and y */
228341
228415
  static createFrom(xy, result) {
228342
228416
  if (xy)
@@ -228344,19 +228418,22 @@ class Point2d extends XY {
228344
228418
  return Point2d.create(0, 0, result);
228345
228419
  }
228346
228420
  /** Create a Point2d with both coordinates zero. */
228347
- static createZero(result) { return Point2d.create(0, 0, result); }
228348
- /** Starting at this point, move along vector by tangentFraction of the vector length, and to the left by leftFraction of
228349
- * the perpendicular vector length.
228421
+ static createZero(result) {
228422
+ return Point2d.create(0, 0, result);
228423
+ }
228424
+ /** Starting at this point, move along vector by tangentFraction of the vector length, and then
228425
+ * to the left by leftFraction of the perpendicular vector length.
228350
228426
  * @param tangentFraction distance to move along the vector, as a fraction of vector
228351
228427
  * @param leftFraction distance to move perpendicular to the vector, as a fraction of the rotated vector
228428
+ * @param vector the other vector
228352
228429
  */
228353
228430
  addForwardLeft(tangentFraction, leftFraction, vector) {
228354
228431
  const dx = vector.x;
228355
228432
  const dy = vector.y;
228356
228433
  return Point2d.create(this.x + tangentFraction * dx - leftFraction * dy, this.y + tangentFraction * dy + leftFraction * dx);
228357
228434
  }
228358
- /** Interpolate at tangentFraction between this instance and point. Move by leftFraction along the xy perpendicular
228359
- * of the vector between the points.
228435
+ /** Interpolate at tangentFraction between this instance and point, and then Move by leftFraction
228436
+ * along the xy perpendicular of the vector between the points.
228360
228437
  */
228361
228438
  forwardLeftInterpolate(tangentFraction, leftFraction, point) {
228362
228439
  const dx = point.x - this.x;
@@ -228404,10 +228481,13 @@ class Point2d extends XY {
228404
228481
  * @param targetB target of second vector
228405
228482
  */
228406
228483
  dotVectorsToTargets(targetA, targetB) {
228407
- return (targetA.x - this.x) * (targetB.x - this.x) +
228408
- (targetA.y - this.y) * (targetB.y - this.y);
228484
+ return (targetA.x - this.x) * (targetB.x - this.x) + (targetA.y - this.y) * (targetB.y - this.y);
228409
228485
  }
228410
- /** Returns the (scalar) cross product of two points/vectors, computed from origin to target1 and target2 */
228486
+ /**
228487
+ * Returns the (scalar) cross product of vector from this to targetA and vector from this to targetB
228488
+ * @param target1 target of first vector
228489
+ * @param target2 target of second vector
228490
+ */
228411
228491
  crossProductToPoints(target1, target2) {
228412
228492
  const x1 = target1.x - this.x;
228413
228493
  const y1 = target1.y - this.y;
@@ -228415,25 +228495,31 @@ class Point2d extends XY {
228415
228495
  const y2 = target2.y - this.y;
228416
228496
  return x1 * y2 - y1 * x2;
228417
228497
  }
228418
- /** Return the fractional coordinate of the projection of this instance x,y onto the line from startPoint to endPoint.
228498
+ /** Return the fractional coordinate of the projection of this instance x,y onto the
228499
+ * line from startPoint to endPoint.
228419
228500
  * @param startPoint start point of line
228420
228501
  * @param endPoint end point of line
228421
228502
  * @param defaultFraction fraction to return if startPoint and endPoint are equal.
228422
228503
  */
228423
- fractionOfProjectionToLine(startPoint, endPoint, defaultFraction) {
228504
+ fractionOfProjectionToLine(startPoint, endPoint, defaultFraction = 0) {
228424
228505
  const denominator = startPoint.distanceSquared(endPoint);
228425
228506
  if (denominator < _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistanceSquared)
228426
- return defaultFraction ? defaultFraction : 0;
228427
- return startPoint.dotVectorsToTargets(endPoint, this) / denominator;
228507
+ return defaultFraction;
228508
+ const numerator = startPoint.dotVectorsToTargets(endPoint, this);
228509
+ return numerator / denominator;
228428
228510
  }
228429
228511
  }
228430
228512
  /** 2D vector with `x`,`y` as properties
228431
228513
  * @public
228432
228514
  */
228433
228515
  class Vector2d extends XY {
228434
- constructor(x = 0, y = 0) { super(x, y); }
228516
+ constructor(x = 0, y = 0) {
228517
+ super(x, y);
228518
+ }
228435
228519
  /** Return a new Vector2d with the same x,y */
228436
- clone(result) { return Vector2d.create(this.x, this.y, result); }
228520
+ clone(result) {
228521
+ return Vector2d.create(this.x, this.y, result);
228522
+ }
228437
228523
  /** Return a new Vector2d with given x and y */
228438
228524
  static create(x = 0, y = 0, result) {
228439
228525
  if (result) {
@@ -228443,12 +228529,24 @@ class Vector2d extends XY {
228443
228529
  }
228444
228530
  return new Vector2d(x, y);
228445
228531
  }
228446
- /** Return a (new) Vector2d with components 1,0 */
228447
- static unitX(scale = 1) { return new Vector2d(scale, 0); }
228448
- /** Return a (new) Vector2d with components 0,1 */
228449
- static unitY(scale = 1) { return new Vector2d(0, scale); }
228532
+ /**
228533
+ * Return a (new) Vector2d with components scale,0
228534
+ * If scale is not given default value 1 is used.
228535
+ */
228536
+ static unitX(scale = 1) {
228537
+ return new Vector2d(scale, 0);
228538
+ }
228539
+ /**
228540
+ * Return a (new) Vector2d with components 0,scale
228541
+ * If scale is not given default value 1 is used.
228542
+ */
228543
+ static unitY(scale = 1) {
228544
+ return new Vector2d(0, scale);
228545
+ }
228450
228546
  /** Return a Vector2d with components 0,0 */
228451
- static createZero(result) { return Vector2d.create(0, 0, result); }
228547
+ static createZero(result) {
228548
+ return Vector2d.create(0, 0, result);
228549
+ }
228452
228550
  /** copy contents from another Point3d, Point2d, Vector2d, or Vector3d, or leading entries of Float64Array */
228453
228551
  static createFrom(data, result) {
228454
228552
  if (data instanceof Float64Array) {
@@ -228460,8 +228558,16 @@ class Vector2d extends XY {
228460
228558
  }
228461
228559
  return Vector2d.create(data.x, data.y, result);
228462
228560
  }
228463
- /** Return a new Vector2d from json structured as `[1,2]` or `{x:1,y:2}` */
228464
- static fromJSON(json) { const val = new Vector2d(); val.setFromJSON(json); return val; }
228561
+ /**
228562
+ * Set x and y from a JSON input such as `[1,2]` or `{x:1, y:2}`
228563
+ * * If no JSON input is provided, 0 would be used as default values for x and y.
228564
+ * @param json the JSON input
228565
+ * */
228566
+ static fromJSON(json) {
228567
+ const val = new Vector2d();
228568
+ val.setFromJSON(json);
228569
+ return val;
228570
+ }
228465
228571
  /** Return a new Vector2d from polar coordinates for radius and Angle from x axis */
228466
228572
  static createPolar(r, theta) {
228467
228573
  return Vector2d.create(r * theta.cos(), r * theta.sin());
@@ -228472,6 +228578,7 @@ class Vector2d extends XY {
228472
228578
  }
228473
228579
  /**
228474
228580
  * Return a vector that bisects the angle between two normals and extends to the intersection of two offset lines
228581
+ * * returns `undefined` if `unitPerpA = -unitPerpB` (i.e., are opposite)
228475
228582
  * @param unitPerpA unit perpendicular to incoming direction
228476
228583
  * @param unitPerpB unit perpendicular to outgoing direction
228477
228584
  * @param offset offset distance
@@ -228480,12 +228587,13 @@ class Vector2d extends XY {
228480
228587
  let bisector = unitPerpA.plus(unitPerpB);
228481
228588
  bisector = bisector.normalize();
228482
228589
  if (bisector) {
228483
- const c = offset * bisector.dotProduct(unitPerpA);
228590
+ const c = bisector.dotProduct(unitPerpA);
228591
+ bisector.scale(offset, bisector);
228484
228592
  return bisector.safeDivideOrNull(c);
228485
228593
  }
228486
228594
  return undefined;
228487
228595
  }
228488
- /** Return a (new or optionally reused) vector which is `this` divided by denominator
228596
+ /** Return a (new or optionally reused) vector which is `this` divided by `denominator`
228489
228597
  * * return undefined if denominator is zero.
228490
228598
  */
228491
228599
  safeDivideOrNull(denominator, result) {
@@ -228500,12 +228608,22 @@ class Vector2d extends XY {
228500
228608
  result = result ? result : new Vector2d();
228501
228609
  return this.safeDivideOrNull(mag, result);
228502
228610
  }
228503
- /** return the fractional projection of spaceVector onto this */
228611
+ /**
228612
+ * Return fractional projection of target vector onto this
228613
+ * * It's returning the signed projection magnitude divided by the target magnitude. In other words,
228614
+ * it's returning the length of the projection as a fraction of the target magnitude.
228615
+ * @param target the target vector
228616
+ * @param defaultFraction the returned value in case magnitude square of target vector is very small
228617
+ * */
228504
228618
  fractionOfProjectionToVector(target, defaultFraction) {
228505
- const numerator = this.dotProduct(target);
228619
+ /*
228620
+ * projection length is (this.target)/||target||
228621
+ * but here we return (this.target)/||target||^2
228622
+ */
228506
228623
  const denominator = target.magnitudeSquared();
228507
228624
  if (denominator < _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistanceSquared)
228508
228625
  return defaultFraction ? defaultFraction : 0;
228626
+ const numerator = this.dotProduct(target);
228509
228627
  return numerator / denominator;
228510
228628
  }
228511
228629
  /** Return a new vector with components negated from this instance. */
@@ -228518,7 +228636,7 @@ class Vector2d extends XY {
228518
228636
  /** Return a vector same length as this but rotated 90 degrees counter clockwise */
228519
228637
  rotate90CCWXY(result) {
228520
228638
  result = result ? result : new Vector2d();
228521
- // save x,y to allow aliasing ..
228639
+ // save x,y to allow aliasing ("this" can be passed to the function as "result")
228522
228640
  const xx = this.x;
228523
228641
  const yy = this.y;
228524
228642
  result.x = -yy;
@@ -228528,7 +228646,7 @@ class Vector2d extends XY {
228528
228646
  /** Return a vector same length as this but rotated 90 degrees clockwise */
228529
228647
  rotate90CWXY(result) {
228530
228648
  result = result ? result : new Vector2d();
228531
- // save x,y to allow aliasing ..
228649
+ // save x,y to allow aliasing ("this" can be passed to the function as "result")
228532
228650
  const xx = this.x;
228533
228651
  const yy = this.y;
228534
228652
  result.x = yy;
@@ -228540,6 +228658,7 @@ class Vector2d extends XY {
228540
228658
  result = result ? result : new Vector2d();
228541
228659
  const xx = this.x;
228542
228660
  const yy = this.y;
228661
+ // save x,y to allow aliasing ("this" can be passed to the function as "result")
228543
228662
  result.x = -yy;
228544
228663
  result.y = xx;
228545
228664
  const d2 = xx * xx + yy * yy;
@@ -228554,6 +228673,7 @@ class Vector2d extends XY {
228554
228673
  rotateXY(angle, result) {
228555
228674
  const s = angle.sin();
228556
228675
  const c = angle.cos();
228676
+ // save x,y to allow aliasing ("this" can be passed to the function as "result")
228557
228677
  const xx = this.x;
228558
228678
  const yy = this.y;
228559
228679
  result = result ? result : new Vector2d();
@@ -228561,18 +228681,26 @@ class Vector2d extends XY {
228561
228681
  result.y = xx * s + yy * c;
228562
228682
  return result;
228563
228683
  }
228564
- /** return the interpolation {this + fraction * (right - this)} */
228565
- interpolate(fraction, right, result) {
228684
+ /** Return a vector computed at fractional position between this vector and vectorB
228685
+ * @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`.
228686
+ * True fractions are "between", negatives are "before this", beyond 1 is "beyond vectorB".
228687
+ * @param vectorB second vector
228688
+ * @param result optional preallocated result.
228689
+ */
228690
+ interpolate(fraction, vectorB, result) {
228566
228691
  result = result ? result : new Vector2d();
228567
- /* For best last-bit behavior, if fraction is below 0.5, use this as base point. If above 0.5, use right as base point. */
228692
+ /*
228693
+ * For best last-bit behavior, if fraction is below 0.5, use this as base point.
228694
+ * If above 0.5, use vectorB as base point.
228695
+ */
228568
228696
  if (fraction <= 0.5) {
228569
- result.x = this.x + fraction * (right.x - this.x);
228570
- result.y = this.y + fraction * (right.y - this.y);
228697
+ result.x = this.x + fraction * (vectorB.x - this.x);
228698
+ result.y = this.y + fraction * (vectorB.y - this.y);
228571
228699
  }
228572
228700
  else {
228573
228701
  const t = fraction - 1.0;
228574
- result.x = right.x + t * (right.x - this.x);
228575
- result.y = right.y + t * (right.y - this.y);
228702
+ result.x = vectorB.x + t * (vectorB.x - this.x);
228703
+ result.y = vectorB.y + t * (vectorB.y - this.y);
228576
228704
  }
228577
228705
  return result;
228578
228706
  }
@@ -228626,16 +228754,19 @@ class Vector2d extends XY {
228626
228754
  return this.scale(length / mag, result);
228627
228755
  }
228628
228756
  /** return the dot product of this with vectorB */
228629
- dotProduct(vectorB) { return this.x * vectorB.x + this.y * vectorB.y; }
228757
+ dotProduct(vectorB) {
228758
+ return this.x * vectorB.x + this.y * vectorB.y;
228759
+ }
228630
228760
  /** dot product with vector from pointA to pointB */
228631
228761
  dotProductStartEnd(pointA, pointB) {
228632
- return this.x * (pointB.x - pointA.x)
228633
- + this.y * (pointB.y - pointA.y);
228762
+ return this.x * (pointB.x - pointA.x) + this.y * (pointB.y - pointA.y);
228634
228763
  }
228635
228764
  /** vector cross product {this CROSS vectorB} */
228636
- crossProduct(vectorB) { return this.x * vectorB.y - this.y * vectorB.x; }
228765
+ crossProduct(vectorB) {
228766
+ return this.x * vectorB.y - this.y * vectorB.x;
228767
+ }
228637
228768
  /**
228638
- * return the (radians as a simple number, not strongly typed Angle) signed angle from this to vectorB.
228769
+ * return the radians (as a simple number, not strongly typed Angle) signed angle from this to vectorB.
228639
228770
  * This is positive if the shortest turn is counterclockwise, negative if clockwise.
228640
228771
  */
228641
228772
  radiansTo(vectorB) {
@@ -228648,13 +228779,6 @@ class Vector2d extends XY {
228648
228779
  angleTo(vectorB) {
228649
228780
  return _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(this.radiansTo(vectorB));
228650
228781
  }
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
228782
  /**
228659
228783
  * Test if this vector is parallel to other.
228660
228784
  * * The input tolerances in `options`, if given, are considered to be squared for efficiency's sake,
@@ -228745,6 +228869,7 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
228745
228869
  }
228746
228870
  /**
228747
228871
  * Access by index, returning strongly typed Point3d
228872
+ * * This returns the xyz value but NOT reference to the point in the "carried" array.
228748
228873
  * @param index index of point within the array
228749
228874
  * @param result caller-allocated destination
228750
228875
  * @returns undefined if the index is out of bounds
@@ -228780,15 +228905,24 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
228780
228905
  }
228781
228906
  return undefined;
228782
228907
  }
228783
- /** access x of indexed point */
228908
+ /**
228909
+ * access x of indexed point
228910
+ * * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results
228911
+ * */
228784
228912
  getXAtUncheckedPointIndex(pointIndex) {
228785
228913
  return this.data[pointIndex].x;
228786
228914
  }
228787
- /** access y of indexed point */
228915
+ /**
228916
+ * access y of indexed point
228917
+ * * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results
228918
+ * */
228788
228919
  getYAtUncheckedPointIndex(pointIndex) {
228789
228920
  return this.data[pointIndex].y;
228790
228921
  }
228791
- /** access z of indexed point */
228922
+ /**
228923
+ * access z of indexed point
228924
+ * * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results
228925
+ * */
228792
228926
  getZAtUncheckedPointIndex(pointIndex) {
228793
228927
  return this.data[pointIndex].z;
228794
228928
  }
@@ -228856,7 +228990,7 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
228856
228990
  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
228991
  }
228858
228992
  /**
228859
- * Accumulate scale times the x,y,z values at index.
228993
+ * Accumulate scale times the x,y,z values at index to the sum.
228860
228994
  * No action if index is out of bounds.
228861
228995
  */
228862
228996
  accumulateScaledXYZ(index, scale, sum) {
@@ -228946,7 +229080,7 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
228946
229080
  }
228947
229081
  /** Adjust index into range by modulo with the length. */
228948
229082
  cyclicIndex(i) {
228949
- return (i % this.length);
229083
+ return (i % this.data.length);
228950
229084
  }
228951
229085
  }
228952
229086
 
@@ -228976,6 +229110,7 @@ __webpack_require__.r(__webpack_exports__);
228976
229110
  /** @packageDocumentation
228977
229111
  * @module CartesianGeometry
228978
229112
  */
229113
+ // cspell:word CWXY
228979
229114
 
228980
229115
 
228981
229116
 
@@ -229210,7 +229345,7 @@ class XYZ {
229210
229345
  return this.y;
229211
229346
  }
229212
229347
  /**
229213
- * Return the x,y, z component corresponding to 0,1,2.
229348
+ * Set value at index 0 or 1 or 2.
229214
229349
  */
229215
229350
  setAt(index, value) {
229216
229351
  if (index < 0.5)
@@ -229873,6 +230008,17 @@ class Vector3d extends XYZ {
229873
230008
  result.z = this.z;
229874
230009
  return result;
229875
230010
  }
230011
+ /** Return a vector same length as this but rotated 90 degrees clockwise */
230012
+ rotate90CWXY(result) {
230013
+ result = result ? result : new Vector3d();
230014
+ // save x,y to allow aliasing ("this" can be passed to the function as "result")
230015
+ const xx = this.x;
230016
+ const yy = this.y;
230017
+ result.x = yy;
230018
+ result.y = -xx;
230019
+ result.z = this.z;
230020
+ return result;
230021
+ }
229876
230022
  /**
229877
230023
  * Return a vector which is in the xy plane, perpendicular ot the xy part of this vector, and of unit length.
229878
230024
  * * If the xy part is 00, the return is the rotated (but not normalized) xy parts of this vector.
@@ -229882,6 +230028,7 @@ class Vector3d extends XYZ {
229882
230028
  result = result ? result : new Vector3d();
229883
230029
  const xx = this.x;
229884
230030
  const yy = this.y;
230031
+ // save x,y to allow aliasing ("this" can be passed to the function as "result")
229885
230032
  result.x = -yy;
229886
230033
  result.y = xx;
229887
230034
  result.z = 0.0;
@@ -229942,6 +230089,10 @@ class Vector3d extends XYZ {
229942
230089
  */
229943
230090
  interpolate(fraction, vectorB, result) {
229944
230091
  result = result ? result : new Vector3d();
230092
+ /*
230093
+ * For best last-bit behavior, if fraction is below 0.5, use this as base point.
230094
+ * If above 0.5, use vectorB as base point.
230095
+ */
229945
230096
  if (fraction <= 0.5) {
229946
230097
  result.x = this.x + fraction * (vectorB.x - this.x);
229947
230098
  result.y = this.y + fraction * (vectorB.y - this.y);
@@ -291959,7 +292110,7 @@ class TestContext {
291959
292110
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
291960
292111
  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
292112
  await core_frontend_1.NoRenderApp.startup({
291962
- applicationVersion: "3.5.0-dev.51",
292113
+ applicationVersion: "3.5.0-dev.53",
291963
292114
  applicationId: this.settings.gprid,
291964
292115
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
291965
292116
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -311028,7 +311179,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
311028
311179
  /***/ ((module) => {
311029
311180
 
311030
311181
  "use strict";
311031
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"3.5.0-dev.51","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.51","@itwin/core-bentley":"workspace:^3.5.0-dev.51","@itwin/core-common":"workspace:^3.5.0-dev.51","@itwin/core-geometry":"workspace:^3.5.0-dev.51","@itwin/core-orbitgt":"workspace:^3.5.0-dev.51","@itwin/core-quantity":"workspace:^3.5.0-dev.51","@itwin/webgl-compatibility":"workspace:^3.5.0-dev.51"},"//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"}}]}}');
311182
+ 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"}}]}}');
311032
311183
 
311033
311184
  /***/ }),
311034
311185