@itwin/rpcinterface-full-stack-tests 4.1.0-dev.25 → 4.1.0-dev.27

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.
@@ -60962,13 +60962,13 @@ var CurrentImdlVersion;
60962
60962
  * front-end is not capable of reading the tile content. Otherwise, this front-end can read the tile content even if the header specifies a
60963
60963
  * greater minor version than CurrentVersion.Minor, although some data may be skipped.
60964
60964
  */
60965
- CurrentImdlVersion[CurrentImdlVersion["Major"] = 31] = "Major";
60965
+ CurrentImdlVersion[CurrentImdlVersion["Major"] = 32] = "Major";
60966
60966
  /** The unsigned 16-bit minor version number. If the major version in the tile header is equal to CurrentVersion.Major, then this package can
60967
60967
  * read the tile content even if the minor version in the tile header is greater than this value, although some data may be skipped.
60968
60968
  */
60969
60969
  CurrentImdlVersion[CurrentImdlVersion["Minor"] = 0] = "Minor";
60970
60970
  /** The unsigned 32-bit version number derived from the 16-bit major and minor version numbers. */
60971
- CurrentImdlVersion[CurrentImdlVersion["Combined"] = 2031616] = "Combined";
60971
+ CurrentImdlVersion[CurrentImdlVersion["Combined"] = 2097152] = "Combined";
60972
60972
  })(CurrentImdlVersion || (CurrentImdlVersion = {}));
60973
60973
  /** Header embedded at the beginning of binary tile data in iMdl format describing its contents.
60974
60974
  * @internal
@@ -61245,6 +61245,19 @@ var Constants;
61245
61245
  (function (Constants) {
61246
61246
  Constants.minToleranceRatioMultiplier = 2;
61247
61247
  })(Constants || (Constants = {}));
61248
+ function compareEdgeOptions(a, b) {
61249
+ if (typeof a !== typeof b)
61250
+ return a ? 1 : -1;
61251
+ if (typeof a === "boolean") {
61252
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(typeof b === "boolean");
61253
+ return (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(a, b);
61254
+ }
61255
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(typeof b === "object");
61256
+ let cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(a.type, b.type);
61257
+ if (0 === cmp)
61258
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(a.smooth, b.smooth);
61259
+ return cmp;
61260
+ }
61248
61261
  /** @internal */
61249
61262
  var TileOptions;
61250
61263
  (function (TileOptions) {
@@ -61269,8 +61282,7 @@ var TileOptions;
61269
61282
  useLargerTiles: 0 !== (tree.flags & TreeFlags.UseLargerTiles),
61270
61283
  disableMagnification: false,
61271
61284
  alwaysSubdivideIncompleteTiles: false,
61272
- enableIndexedEdges: edgeOptions && edgeOptions.indexed,
61273
- generateAllPolyfaceEdges: edgeOptions && edgeOptions.smooth,
61285
+ edgeOptions,
61274
61286
  };
61275
61287
  }
61276
61288
  TileOptions.fromTreeIdAndContentId = fromTreeIdAndContentId;
@@ -61377,19 +61389,13 @@ class Parser {
61377
61389
  }
61378
61390
  parseEdges() {
61379
61391
  if ("E" !== this.cur())
61380
- return { indexed: false, smooth: false };
61392
+ return { type: "non-indexed", smooth: false };
61381
61393
  this.eat("E");
61382
61394
  this.eat(":");
61383
- const typeStr = this.cur();
61384
- this.eat(typeStr);
61395
+ const flag = this.cur();
61396
+ this.eat(flag);
61385
61397
  this.eat("_");
61386
- switch (typeStr) {
61387
- case "0": return false;
61388
- case "2": return { indexed: true, smooth: false };
61389
- case "3": return { indexed: false, smooth: true };
61390
- case "4": return { indexed: true, smooth: true };
61391
- default: this.reject();
61392
- }
61398
+ return "0" === flag ? false : edgeOptionsFromFlag(flag);
61393
61399
  }
61394
61400
  parseSectionCut() {
61395
61401
  if ("S" !== this.cur())
@@ -61419,8 +61425,10 @@ const defaultTileOptions = Object.freeze({
61419
61425
  useLargerTiles: true,
61420
61426
  disableMagnification: false,
61421
61427
  alwaysSubdivideIncompleteTiles: false,
61422
- enableIndexedEdges: true,
61423
- generateAllPolyfaceEdges: true,
61428
+ edgeOptions: {
61429
+ type: "compact",
61430
+ smooth: true,
61431
+ },
61424
61432
  });
61425
61433
  function contentFlagsFromId(id) {
61426
61434
  if (0 === id.length || "-" !== id[0])
@@ -61452,14 +61460,40 @@ function treeFlagsAndFormatVersionFromId(id) {
61452
61460
  function edgeOptionsFromTreeId(id) {
61453
61461
  const pos = id.indexOf("E:");
61454
61462
  if (pos <= 0)
61455
- return { indexed: false, smooth: false };
61456
- switch (id[pos + 2]) {
61457
- case "0": return { indexed: defaultTileOptions.enableIndexedEdges, smooth: defaultTileOptions.generateAllPolyfaceEdges };
61458
- case "2": return { indexed: true, smooth: false };
61459
- case "3": return { indexed: false, smooth: true };
61460
- case "4": return { indexed: true, smooth: true };
61463
+ return { type: "non-indexed", smooth: false };
61464
+ return edgeOptionsFromFlag(id[pos + 2]);
61465
+ }
61466
+ function edgeOptionsFromFlag(flag) {
61467
+ if ("0" === flag)
61468
+ return defaultTileOptions.edgeOptions;
61469
+ const smooth = flag !== "2" && flag !== "5";
61470
+ let type;
61471
+ switch (flag) {
61472
+ case "2":
61473
+ case "4":
61474
+ type = "indexed";
61475
+ break;
61476
+ case "3":
61477
+ type = "non-indexed";
61478
+ break;
61479
+ case "5":
61480
+ case "6":
61481
+ type = "compact";
61482
+ break;
61483
+ default:
61484
+ throw new Error("Invalid tree Id");
61485
+ }
61486
+ return { type, smooth };
61487
+ }
61488
+ function edgeOptionsToString(options) {
61489
+ if (!options)
61490
+ return "E:0_";
61491
+ switch (options.type) {
61492
+ case "non-indexed": return options.smooth ? "E:3_" : "";
61493
+ case "indexed": return options.smooth ? "E:4_" : "E:2_";
61494
+ case "compact": return options.smooth ? "E:6_" : "E:5_";
61495
+ default: throw new Error("Invalid tree Id");
61461
61496
  }
61462
- throw new Error("Invalid tree Id");
61463
61497
  }
61464
61498
  /** @internal */
61465
61499
  function getMaximumMajorTileFormatVersion(maxMajorVersion, formatVersion) {
@@ -61487,19 +61521,6 @@ var TreeFlags;
61487
61521
  TreeFlags[TreeFlags["OptimizeBRepProcessing"] = 4] = "OptimizeBRepProcessing";
61488
61522
  TreeFlags[TreeFlags["UseLargerTiles"] = 8] = "UseLargerTiles";
61489
61523
  })(TreeFlags || (TreeFlags = {}));
61490
- function compareEdgeOptions(a, b) {
61491
- if (typeof a !== typeof b)
61492
- return a ? 1 : -1;
61493
- if (typeof a === "boolean") {
61494
- (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(typeof b === "boolean");
61495
- return (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(a, b);
61496
- }
61497
- (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(typeof b === "object");
61498
- let cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(a.indexed, b.indexed);
61499
- if (0 === cmp)
61500
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(a.smooth, b.smooth);
61501
- return cmp;
61502
- }
61503
61524
  function animationIdToString(animationId) {
61504
61525
  return `A:${animationId}_`;
61505
61526
  }
@@ -61518,16 +61539,7 @@ function iModelTileTreeIdToString(modelId, treeId, options) {
61518
61539
  idStr = `${idStr}${animationIdToString(treeId.animationId)}`;
61519
61540
  else if (treeId.enforceDisplayPriority) // animation and priority are currently mutually exclusive
61520
61541
  flags |= TreeFlags.EnforceDisplayPriority;
61521
- let edges;
61522
- if (!treeId.edges) {
61523
- edges = "E:0_";
61524
- }
61525
- else {
61526
- if (!treeId.edges.smooth)
61527
- edges = treeId.edges.indexed ? "E:2_" : "";
61528
- else
61529
- edges = treeId.edges.indexed ? "E:4_" : "E:3_";
61530
- }
61542
+ const edges = edgeOptionsToString(treeId.edges);
61531
61543
  const sectionCut = treeId.sectionCut ? `S${treeId.sectionCut}s` : "";
61532
61544
  idStr = `${idStr}${edges}${sectionCut}`;
61533
61545
  }
@@ -97706,6 +97718,116 @@ function isGltf1Material(material) {
97706
97718
  }
97707
97719
 
97708
97720
 
97721
+ /***/ }),
97722
+
97723
+ /***/ "../../core/frontend/lib/esm/common/imdl/CompactEdges.js":
97724
+ /*!***************************************************************!*\
97725
+ !*** ../../core/frontend/lib/esm/common/imdl/CompactEdges.js ***!
97726
+ \***************************************************************/
97727
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
97728
+
97729
+ "use strict";
97730
+ __webpack_require__.r(__webpack_exports__);
97731
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
97732
+ /* harmony export */ "indexedEdgeParamsFromCompactEdges": () => (/* binding */ indexedEdgeParamsFromCompactEdges)
97733
+ /* harmony export */ });
97734
+ /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
97735
+ /* harmony import */ var _ImdlSchema__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ImdlSchema */ "../../core/frontend/lib/esm/common/imdl/ImdlSchema.js");
97736
+ /* harmony import */ var _render_primitives_EdgeParams__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../render/primitives/EdgeParams */ "../../core/frontend/lib/esm/common/render/primitives/EdgeParams.js");
97737
+ /* harmony import */ var _render_primitives_VertexIndices__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../render/primitives/VertexIndices */ "../../core/frontend/lib/esm/common/render/primitives/VertexIndices.js");
97738
+ /*---------------------------------------------------------------------------------------------
97739
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
97740
+ * See LICENSE.md in the project root for license terms and full copyright notice.
97741
+ *--------------------------------------------------------------------------------------------*/
97742
+ /** @packageDocumentation
97743
+ * @module Tiles
97744
+ */
97745
+
97746
+
97747
+
97748
+
97749
+ /** Iterate over the compact edges.
97750
+ * @note The same object is returned on each iteration, mutated in place.
97751
+ */
97752
+ function* compactEdgeIterator(visibilityFlags, vertexIndices, normalPairs) {
97753
+ let bitIndex = 0;
97754
+ let flagsIndex = 0;
97755
+ let normalIndex = 0;
97756
+ const output = { index0: 0, index1: 1 };
97757
+ for (let i = 0; i < vertexIndices.length; i++) {
97758
+ const visibility = (visibilityFlags[flagsIndex] >> bitIndex) & 3;
97759
+ bitIndex += 2;
97760
+ if (bitIndex === 8) {
97761
+ bitIndex = 0;
97762
+ flagsIndex++;
97763
+ }
97764
+ if (_ImdlSchema__WEBPACK_IMPORTED_MODULE_1__.ImdlEdgeVisibility.Hidden === visibility)
97765
+ continue;
97766
+ output.index0 = vertexIndices.decodeIndex(i);
97767
+ output.index1 = vertexIndices.decodeIndex(i % 3 === 2 ? i - 2 : i + 1);
97768
+ if (_ImdlSchema__WEBPACK_IMPORTED_MODULE_1__.ImdlEdgeVisibility.Silhouette === visibility) {
97769
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== normalPairs);
97770
+ output.normals = normalPairs[normalIndex++];
97771
+ }
97772
+ else {
97773
+ output.normals = undefined;
97774
+ }
97775
+ yield output;
97776
+ }
97777
+ }
97778
+ function setUint24(edgeTable, byteIndex, value) {
97779
+ edgeTable[byteIndex + 0] = value & 0x0000ff;
97780
+ edgeTable[byteIndex + 1] = (value & 0x00ff00) >>> 8;
97781
+ edgeTable[byteIndex + 2] = (value & 0xff0000) >>> 16;
97782
+ }
97783
+ /** Convert an [[ImdlCompactEdges]] to an [[IndexedEdgeParams]].
97784
+ * @internal
97785
+ */
97786
+ function indexedEdgeParamsFromCompactEdges(compact) {
97787
+ const numSilhouettes = compact.normalPairs?.length ?? 0;
97788
+ const numTotalEdges = compact.numVisibleEdges + numSilhouettes;
97789
+ if (numTotalEdges <= 0)
97790
+ return undefined;
97791
+ // Each edge is a quad consisting of six vertices. Each vertex is an identical 24-bit index into the lookup table.
97792
+ const indices = new _render_primitives_VertexIndices__WEBPACK_IMPORTED_MODULE_3__.VertexIndices(new Uint8Array(numTotalEdges * 6 * 3));
97793
+ for (let i = 0; i < numTotalEdges; i++)
97794
+ for (let j = 0; j < 6; j++)
97795
+ indices.setNthIndex(i * 6 + j, i);
97796
+ const { width, height, silhouettePadding, silhouetteStartByteIndex } = (0,_render_primitives_EdgeParams__WEBPACK_IMPORTED_MODULE_2__.calculateEdgeTableParams)(compact.numVisibleEdges, numSilhouettes, compact.maxEdgeTableDimension);
97797
+ const edgeTable = new Uint8Array(width * height * 4);
97798
+ let curVisibleIndex = 0;
97799
+ let curSilhouetteIndex = 0;
97800
+ for (const edge of compactEdgeIterator(compact.visibility, compact.vertexIndices, compact.normalPairs)) {
97801
+ if (undefined === edge.normals) {
97802
+ const index = curVisibleIndex++;
97803
+ const byteIndex = index * 6;
97804
+ setUint24(edgeTable, byteIndex, edge.index0);
97805
+ setUint24(edgeTable, byteIndex + 3, edge.index1);
97806
+ }
97807
+ else {
97808
+ const index = curSilhouetteIndex++;
97809
+ const byteIndex = silhouetteStartByteIndex + silhouettePadding + index * 10;
97810
+ setUint24(edgeTable, byteIndex, edge.index0);
97811
+ setUint24(edgeTable, byteIndex + 3, edge.index1);
97812
+ edgeTable[byteIndex + 6] = edge.normals & 0xff;
97813
+ edgeTable[byteIndex + 7] = (edge.normals & 0xff00) >>> 8;
97814
+ edgeTable[byteIndex + 8] = (edge.normals & 0xff0000) >>> 16;
97815
+ edgeTable[byteIndex + 9] = (edge.normals & 0xff000000) >>> 24;
97816
+ }
97817
+ }
97818
+ return {
97819
+ indices: indices.data,
97820
+ edges: {
97821
+ data: edgeTable,
97822
+ width,
97823
+ height,
97824
+ numSegments: compact.numVisibleEdges,
97825
+ silhouettePadding,
97826
+ },
97827
+ };
97828
+ }
97829
+
97830
+
97709
97831
  /***/ }),
97710
97832
 
97711
97833
  /***/ "../../core/frontend/lib/esm/common/imdl/ImdlModel.js":
@@ -97797,6 +97919,9 @@ function collectTransferables(document) {
97797
97919
 
97798
97920
  "use strict";
97799
97921
  __webpack_require__.r(__webpack_exports__);
97922
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
97923
+ /* harmony export */ "ImdlEdgeVisibility": () => (/* binding */ ImdlEdgeVisibility)
97924
+ /* harmony export */ });
97800
97925
  /*---------------------------------------------------------------------------------------------
97801
97926
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
97802
97927
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -97804,7 +97929,18 @@ __webpack_require__.r(__webpack_exports__);
97804
97929
  /** @packageDocumentation
97805
97930
  * @module Tiles
97806
97931
  */
97807
-
97932
+ /** As part of [[ImdlCompactEdges]], describes the visibility of an edge of a triangle.
97933
+ * @internal
97934
+ */
97935
+ var ImdlEdgeVisibility;
97936
+ (function (ImdlEdgeVisibility) {
97937
+ /** The edge is never visible. */
97938
+ ImdlEdgeVisibility[ImdlEdgeVisibility["Hidden"] = 0] = "Hidden";
97939
+ /** The edge is shared between two adjacent triangles. It is visible only if one triangle is facing away from the viewer and the other is facing toward the viewer. */
97940
+ ImdlEdgeVisibility[ImdlEdgeVisibility["Silhouette"] = 1] = "Silhouette";
97941
+ /** The edge is always visible. */
97942
+ ImdlEdgeVisibility[ImdlEdgeVisibility["Visible"] = 2] = "Visible";
97943
+ })(ImdlEdgeVisibility || (ImdlEdgeVisibility = {}));
97808
97944
 
97809
97945
 
97810
97946
  /***/ }),
@@ -97834,6 +97970,7 @@ __webpack_require__.r(__webpack_exports__);
97834
97970
  /* harmony import */ var _render_primitives_VertexTableSplitter__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../render/primitives/VertexTableSplitter */ "../../core/frontend/lib/esm/common/render/primitives/VertexTableSplitter.js");
97835
97971
  /* harmony import */ var _render_AnimationNodeId__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../render/AnimationNodeId */ "../../core/frontend/lib/esm/common/render/AnimationNodeId.js");
97836
97972
  /* harmony import */ var _render_primitives_VertexIndices__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../render/primitives/VertexIndices */ "../../core/frontend/lib/esm/common/render/primitives/VertexIndices.js");
97973
+ /* harmony import */ var _CompactEdges__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./CompactEdges */ "../../core/frontend/lib/esm/common/imdl/CompactEdges.js");
97837
97974
  /*---------------------------------------------------------------------------------------------
97838
97975
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
97839
97976
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -97851,6 +97988,7 @@ __webpack_require__.r(__webpack_exports__);
97851
97988
 
97852
97989
 
97853
97990
 
97991
+
97854
97992
  /** Header preceding "glTF" data in iMdl tile. */
97855
97993
  class GltfHeader extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileHeader {
97856
97994
  get isValid() { return _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileFormat.Gltf === this.format; }
@@ -98353,13 +98491,28 @@ class Parser {
98353
98491
  },
98354
98492
  };
98355
98493
  }
98356
- parseEdges(imdl, displayParams) {
98494
+ parseCompactEdges(imdl, vertexIndices) {
98495
+ const visibility = this.findBuffer(imdl.visibility);
98496
+ if (!visibility)
98497
+ return undefined;
98498
+ const normals = undefined !== imdl.normalPairs ? this.findBuffer(imdl.normalPairs) : undefined;
98499
+ return (0,_CompactEdges__WEBPACK_IMPORTED_MODULE_10__.indexedEdgeParamsFromCompactEdges)({
98500
+ numVisibleEdges: imdl.numVisible,
98501
+ visibility,
98502
+ vertexIndices,
98503
+ normalPairs: normals ? new Uint32Array(normals.buffer, normals.byteOffset, normals.byteLength / 4) : undefined,
98504
+ maxEdgeTableDimension: this._options.maxVertexTableSize,
98505
+ });
98506
+ }
98507
+ parseEdges(imdl, displayParams, indices) {
98357
98508
  if (!imdl)
98358
98509
  return undefined;
98359
98510
  const segments = imdl.segments ? this.parseSegmentEdges(imdl.segments) : undefined;
98360
98511
  const silhouettes = imdl.silhouettes ? this.parseSilhouetteEdges(imdl.silhouettes) : undefined;
98361
- const indexed = imdl.indexed ? this.parseIndexedEdges(imdl.indexed) : undefined;
98362
98512
  const polylines = imdl.polylines ? this.parseTesselatedPolyline(imdl.polylines) : undefined;
98513
+ let indexed = imdl.indexed ? this.parseIndexedEdges(imdl.indexed) : undefined;
98514
+ if (!indexed && imdl.compact)
98515
+ indexed = this.parseCompactEdges(imdl.compact, new _render_primitives_VertexIndices__WEBPACK_IMPORTED_MODULE_9__.VertexIndices(indices));
98363
98516
  if (!segments && !silhouettes && !indexed && !polylines)
98364
98517
  return undefined;
98365
98518
  return {
@@ -98446,7 +98599,7 @@ class Parser {
98446
98599
  surface,
98447
98600
  isPlanar,
98448
98601
  auxChannels: this.parseAuxChannelTable(docPrimitive),
98449
- edges: this.parseEdges(docPrimitive.edges, displayParams),
98602
+ edges: this.parseEdges(docPrimitive.edges, displayParams, surface.indices),
98450
98603
  },
98451
98604
  };
98452
98605
  }
@@ -100483,6 +100636,7 @@ __webpack_require__.r(__webpack_exports__);
100483
100636
  /* harmony export */ "ImageryMapTile": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_125__.ImageryMapTile),
100484
100637
  /* harmony export */ "ImageryMapTileTree": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_125__.ImageryMapTileTree),
100485
100638
  /* harmony export */ "ImageryTileTreeState": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_125__.ImageryTileTreeState),
100639
+ /* harmony export */ "ImdlEdgeVisibility": () => (/* reexport safe */ _common_imdl_ImdlSchema__WEBPACK_IMPORTED_MODULE_15__.ImdlEdgeVisibility),
100486
100640
  /* harmony export */ "ImdlReader": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_125__.ImdlReader),
100487
100641
  /* harmony export */ "IndexBuffer": () => (/* reexport safe */ _common_render_primitives_VertexTableSplitter__WEBPACK_IMPORTED_MODULE_29__.IndexBuffer),
100488
100642
  /* harmony export */ "InputCollector": () => (/* reexport safe */ _tools_Tool__WEBPACK_IMPORTED_MODULE_135__.InputCollector),
@@ -106975,7 +107129,7 @@ function createEdgeParams(meshArgs, maxWidth) {
106975
107129
  let segments;
106976
107130
  let silhouettes;
106977
107131
  let indexed;
106978
- if (_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.tileAdmin.enableIndexedEdges) {
107132
+ if ("non-indexed" !== _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.tileAdmin.edgeOptions.type) {
106979
107133
  indexed = buildIndexedEdges(args, !doJoints, maxWidth ?? _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.renderSystem.maxTextureSize);
106980
107134
  }
106981
107135
  else {
@@ -138928,7 +139082,7 @@ class GraphicsTile extends _internal__WEBPACK_IMPORTED_MODULE_4__.Tile {
138928
139082
  location: this.tree.iModelTransform.toJSON(),
138929
139083
  contentFlags: idProvider.contentFlags,
138930
139084
  omitEdges: !this.tree.edgeOptions,
138931
- edgeType: this.tree.edgeOptions && this.tree.edgeOptions.indexed ? 2 : 1,
139085
+ edgeType: this.tree.edgeOptions && "non-indexed" !== this.tree.edgeOptions.type ? 2 : 1,
138932
139086
  smoothPolyfaceEdges: this.tree.edgeOptions && this.tree.edgeOptions.smooth,
138933
139087
  clipToProjectExtents: true,
138934
139088
  sectionCut: this.tree.stringifiedSectionClip,
@@ -141312,6 +141466,7 @@ class IModelTileTree extends _internal__WEBPACK_IMPORTED_MODULE_6__.TileTree {
141312
141466
  * used by draw().
141313
141467
  */
141314
141468
  this._numStaticTilesSelected = 0;
141469
+ this.iModelTileTreeId = treeId;
141315
141470
  this.contentIdQualifier = params.contentIdQualifier;
141316
141471
  this.geometryGuid = params.geometryGuid;
141317
141472
  this.tileScreenSize = params.tileScreenSize;
@@ -146507,8 +146662,10 @@ class TileAdmin {
146507
146662
  this._defaultTileSizeModifier = (undefined !== options.defaultTileSizeModifier && options.defaultTileSizeModifier > 0) ? options.defaultTileSizeModifier : 1.0;
146508
146663
  this._retryInterval = undefined !== options.retryInterval ? options.retryInterval : 1000;
146509
146664
  this._enableInstancing = options.enableInstancing ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.enableInstancing;
146510
- this._enableIndexedEdges = options.enableIndexedEdges ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.enableIndexedEdges;
146511
- this._generateAllPolyfaceEdges = options.generateAllPolyfaceEdges ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.generateAllPolyfaceEdges;
146665
+ this.edgeOptions = {
146666
+ type: false === options.enableIndexedEdges ? "non-indexed" : "compact",
146667
+ smooth: options.generateAllPolyfaceEdges ?? true,
146668
+ };
146512
146669
  this.enableImprovedElision = options.enableImprovedElision ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.enableImprovedElision;
146513
146670
  this.enableFrontendScheduleScripts = options.enableFrontendScheduleScripts ?? false;
146514
146671
  this.decodeImdlInWorker = options.decodeImdlInWorker ?? true;
@@ -146600,18 +146757,6 @@ class TileAdmin {
146600
146757
  }
146601
146758
  /** @internal */
146602
146759
  get enableInstancing() { return this._enableInstancing; }
146603
- /** @internal */
146604
- get enableIndexedEdges() { return this._enableIndexedEdges; }
146605
- /** @internal */
146606
- get generateAllPolyfaceEdges() { return this._generateAllPolyfaceEdges; }
146607
- set generateAllPolyfaceEdges(val) { this._generateAllPolyfaceEdges = val; }
146608
- /** @internal */
146609
- get edgeOptions() {
146610
- return {
146611
- indexed: this.enableIndexedEdges,
146612
- smooth: this.generateAllPolyfaceEdges,
146613
- };
146614
- }
146615
146760
  /** Given a numeric combined major+minor tile format version (typically obtained from a request to the backend to query the maximum tile format version it supports),
146616
146761
  * return the maximum *major* format version to be used to request tile content from the backend.
146617
146762
  * @see [[TileAdmin.Props.maximumMajorTileFormatVersion]]
@@ -146926,7 +147071,7 @@ class TileAdmin {
146926
147071
  */
146927
147072
  async requestElementGraphics(iModel, requestProps) {
146928
147073
  if (true !== requestProps.omitEdges && undefined === requestProps.edgeType)
146929
- requestProps = { ...requestProps, edgeType: this.enableIndexedEdges ? 2 : 1 };
147074
+ requestProps = { ...requestProps, edgeType: "non-indexed" !== this.edgeOptions.type ? 2 : 1 };
146930
147075
  // For backwards compatibility, these options default to true in the backend. Explicitly set them to false in (newer) frontends if not supplied.
146931
147076
  if (undefined === requestProps.quantizePositions || undefined === requestProps.useAbsolutePositions) {
146932
147077
  requestProps = {
@@ -152179,18 +152324,25 @@ class ImageryMapLayerTreeSupplier {
152179
152324
  * This allows the ID to serve as a lookup key to find the corresponding TileTree.
152180
152325
  */
152181
152326
  compareTileTreeIds(lhs, rhs) {
152182
- let cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.settings.url, rhs.settings.url);
152327
+ let cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.settings.formatId, rhs.settings.formatId);
152183
152328
  if (0 === cmp) {
152184
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.settings.userName, rhs.settings.userName);
152329
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.settings.url, rhs.settings.url);
152185
152330
  if (0 === cmp) {
152186
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.settings.password, rhs.settings.password);
152331
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.settings.userName, rhs.settings.userName);
152187
152332
  if (0 === cmp) {
152188
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(lhs.settings.transparentBackground, rhs.settings.transparentBackground);
152333
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.settings.password, rhs.settings.password);
152189
152334
  if (0 === cmp) {
152190
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.settings.subLayers.length, rhs.settings.subLayers.length);
152335
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(lhs.settings.transparentBackground, rhs.settings.transparentBackground);
152191
152336
  if (0 === cmp) {
152192
- for (let i = 0; i < lhs.settings.subLayers.length && 0 === cmp; i++)
152193
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(lhs.settings.subLayers[i].visible, rhs.settings.subLayers[i].visible);
152337
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.settings.subLayers.length, rhs.settings.subLayers.length);
152338
+ if (0 === cmp) {
152339
+ for (let i = 0; i < lhs.settings.subLayers.length && 0 === cmp; i++) {
152340
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.settings.subLayers[i].name, rhs.settings.subLayers[i].name);
152341
+ if (0 === cmp) {
152342
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(lhs.settings.subLayers[i].visible, rhs.settings.subLayers[i].visible);
152343
+ }
152344
+ }
152345
+ }
152194
152346
  }
152195
152347
  }
152196
152348
  }
@@ -182629,6 +182781,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePrimitive
182629
182781
  /**
182630
182782
  * Return a clone of this arc, projected to given z value.
182631
182783
  * * If `z` is omitted, the clone is at the z of the center.
182784
+ * * This function projects the arc into a plane parallel to xy-plane.
182632
182785
  * * Note that projection to fixed z can change circle into ellipse (and (rarely) ellipse to circle)
182633
182786
  */
182634
182787
  cloneAtZ(z) {
@@ -184643,10 +184796,12 @@ __webpack_require__.r(__webpack_exports__);
184643
184796
  * A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:
184644
184797
  * - `CurveChain` is a (non-instantiable) intermediate class for a sequence of `CurvePrimitive` joining head-to-tail.
184645
184798
  * The two instantiable forms of `CurveChain` are
184646
- * - `Path` - A chain not required to close, and not enclosing a planar area
184647
- * - `Loop` - A chain required to close from last to first so that a planar area is enclosed.
184648
- * - `ParityRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by parity rules
184649
- * - `UnionRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by union rules
184799
+ * - `Path` - A chain not required to close and not enclosing a planar area (so curves do not have to be on the
184800
+ * same plane).
184801
+ * - `Loop` - A chain required to close from last to first so that a planar area is enclosed (so curves have to
184802
+ * be on the same plane).
184803
+ * - `ParityRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by parity rules.
184804
+ * - `UnionRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by union rules.
184650
184805
  * - `BagOfCurves` -- a collection of `AnyCurve` with no implied structure.
184651
184806
  *
184652
184807
  * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.
@@ -184686,7 +184841,7 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
184686
184841
  * Return the max gap between adjacent primitives in Path and Loop collections.
184687
184842
  * * In a Path, gaps are computed between consecutive primitives.
184688
184843
  * * In a Loop, gaps are computed between consecutive primitives and between last and first.
184689
- * * gaps are NOT computed between consecutive CurvePrimitives in "unstructured" collections. The type is
184844
+ * * Gaps are NOT computed between consecutive CurvePrimitives in "unstructured" collections. The type is
184690
184845
  * "unstructured" so gaps should not be semantically meaningful.
184691
184846
  */
184692
184847
  maxGap() {
@@ -184708,11 +184863,15 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
184708
184863
  cloneTransformed(transform) {
184709
184864
  return _internalContexts_CloneCurvesContext__WEBPACK_IMPORTED_MODULE_7__.CloneCurvesContext.clone(this, transform);
184710
184865
  }
184711
- /** Create a deep copy with all linestrings expanded to multiple LineSegment3d. */
184866
+ /** Create a deep copy with all linestrings broken down into multiple LineSegment3d. */
184712
184867
  cloneWithExpandedLineStrings() {
184713
184868
  return _internalContexts_CloneWithExpandedLineStrings__WEBPACK_IMPORTED_MODULE_8__.CloneWithExpandedLineStrings.clone(this);
184714
184869
  }
184715
- /** Recurse through children to collect CurvePrimitive's in flat array. */
184870
+ /**
184871
+ * Push all CurvePrimitives contained in the instance onto the `results` array.
184872
+ * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives
184873
+ * of the Loop are pushed onto `results`.
184874
+ */
184716
184875
  collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings = false) {
184717
184876
  if (this.children) {
184718
184877
  for (const child of this.children) {
@@ -184724,10 +184883,12 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
184724
184883
  }
184725
184884
  }
184726
184885
  /**
184727
- * Return an array containing only the curve primitives.
184886
+ * Return an array containing all CurvePrimitives in the instance.
184887
+ * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives of
184888
+ * the Loop are pushed onto the returned array.
184728
184889
  * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without
184729
- * clearing the array.)
184730
- * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,
184890
+ * clearing the array).
184891
+ * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,
184731
184892
  * it recurses to its (otherwise hidden) children.
184732
184893
  */
184733
184894
  collectCurvePrimitives(collectorArray, smallestPossiblePrimitives = false, explodeLineStrings = false) {
@@ -184742,7 +184903,7 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
184742
184903
  * * `UnionRegion`
184743
184904
  */
184744
184905
  get isAnyRegionType() {
184745
- return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 5 || this.dgnBoundaryType() === 4;
184906
+ return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 4 || this.dgnBoundaryType() === 5;
184746
184907
  }
184747
184908
  /** Return true for a `Path`, i.e. a chain of curves joined head-to-tail */
184748
184909
  get isOpenPath() {
@@ -184750,12 +184911,16 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
184750
184911
  }
184751
184912
  /**
184752
184913
  * Return true for a single-loop planar region type, i.e. `Loop`.
184753
- * * This is _not- a test for physical closure of a `Path`
184914
+ * * This is NOT a test for physical closure of a `Path`.
184754
184915
  */
184755
184916
  get isClosedPath() {
184756
184917
  return this.dgnBoundaryType() === 2;
184757
184918
  }
184758
- /** Extend (increase) `rangeToExtend` as needed to include these curves (optionally transformed) */
184919
+ /**
184920
+ * Extend (increase) the given range as needed to encompass all curves in the curve collection.
184921
+ * @param rangeToExtend the given range.
184922
+ * @param transform if supplied, the range is extended with transformed curves.
184923
+ */
184759
184924
  extendRange(rangeToExtend, transform) {
184760
184925
  const children = this.children;
184761
184926
  if (children) {
@@ -184765,8 +184930,8 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
184765
184930
  }
184766
184931
  }
184767
184932
  /**
184768
- * * Find any curve primitive in the source.
184769
- * * Evaluate it at a fraction (which by default is an interior fraction)
184933
+ * Find any CurvePrimitive in the source and evaluate it at the given fraction.
184934
+ * * The first CurvePrimitive found is evaluated. Any other CurvePrimitives are ignored.
184770
184935
  * @param source containing `CurvePrimitive` or `CurveCollection`
184771
184936
  * @param fraction fraction to use in `curve.fractionToPoint(fraction)`
184772
184937
  */
@@ -184798,19 +184963,20 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
184798
184963
  }
184799
184964
  /**
184800
184965
  * Shared base class for use by both open and closed paths.
184801
- * - A `CurveChain` contains only curvePrimitives. No other paths, loops, or regions allowed.
184802
- * - A single entry in the chain can in fact contain multiple curve primitives if the entry itself is (for instance)
184803
- * `CurveChainWithDistanceIndex`
184804
- * which presents itself (through method interface) as a CurvePrimitive with well defined mappings from fraction
184805
- * to xyz, but in fact does all the
184806
- * calculations over multiple primitives.
184807
- * - The specific derived classes are `Path` and `Loop`
184808
- * - `CurveChain` is an intermediate class. It is not instantiable on its own.
184966
+ * * A `CurveChain` contains only CurvePrimitives. No other paths, loops, or regions allowed.
184967
+ * * The specific derived classes are `Path` and `Loop`
184968
+ * * `CurveChain` is an intermediate class. It is not instantiable on its own.
184969
+ * * The related class `CurveChainWithDistanceIndex` is a `CurvePrimitive` whose API presents well-defined mappings
184970
+ * from fraction to xyz over the entire chain, but in fact does all the calculations over multiple primitives.
184809
184971
  * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.
184810
184972
  * @public
184811
184973
  */
184812
184974
  class CurveChain extends CurveCollection {
184813
- constructor() { super(); this._curves = []; }
184975
+ /** Constructor */
184976
+ constructor() {
184977
+ super();
184978
+ this._curves = [];
184979
+ }
184814
184980
  /** Return the array of `CurvePrimitive` */
184815
184981
  get children() {
184816
184982
  if (this._curves === undefined)
@@ -184818,7 +184984,7 @@ class CurveChain extends CurveCollection {
184818
184984
  return this._curves;
184819
184985
  }
184820
184986
  /**
184821
- * Return the `[index]` curve primitive, optionally using `modulo` to map`index` to the cyclic indexing.
184987
+ * Return the curve primitive at the given `index`, optionally using `modulo` to map `index` to the cyclic indexing.
184822
184988
  * * In particular, `-1` is the final curve.
184823
184989
  * @param index cyclic index
184824
184990
  */
@@ -184826,8 +184992,7 @@ class CurveChain extends CurveCollection {
184826
184992
  const n = this.children.length;
184827
184993
  if (n === 0)
184828
184994
  return undefined;
184829
- /** Try simplest non-cyclic access first . . */
184830
- if (index >= 0 && index < n)
184995
+ if (index >= 0 && index < n) // try simplest non-cyclic access first
184831
184996
  return this.children[index];
184832
184997
  if (cyclic) {
184833
184998
  const index2 = _Geometry__WEBPACK_IMPORTED_MODULE_10__.Geometry.modulo(index, n);
@@ -184840,6 +185005,11 @@ class CurveChain extends CurveCollection {
184840
185005
  * @param options tolerance parameters controlling the stroking.
184841
185006
  */
184842
185007
  getPackedStrokes(options) {
185008
+ /**
185009
+ * The object returned by "cloneStroked" has the same type (Loop or Path) but instead of a chain of
185010
+ * CurvePrimitives as children, it has a single LineString3d child. "getPackedStrokes" just returns
185011
+ * the points of that LineString3d using "packedPoints".
185012
+ */
184843
185013
  const tree = this.cloneStroked(options);
184844
185014
  if (tree instanceof CurveChain) {
184845
185015
  const children = tree.children;
@@ -184851,16 +185021,6 @@ class CurveChain extends CurveCollection {
184851
185021
  }
184852
185022
  return undefined;
184853
185023
  }
184854
- /* EDL 01/20 Path, Loop, CurveChainWithDistanceIndex all implement this.
184855
- Reducing it to abstract.
184856
- Hypothetically, a derived class in the wild might be depending on this.
184857
- {
184858
- const strokes = LineString3d.create();
184859
- for (const curve of this.children)
184860
- curve.emitStrokes(strokes, options);
184861
- return strokes;
184862
- }
184863
- */
184864
185024
  /**
184865
185025
  * Add a child curve.
184866
185026
  * * Returns false if the given child is not a CurvePrimitive.
@@ -184893,7 +185053,7 @@ class CurveChain extends CurveCollection {
184893
185053
  this._curves.reverse();
184894
185054
  }
184895
185055
  /**
184896
- * Return the index where target is found in the array of children
185056
+ * Return the index where target is found in the array of children.
184897
185057
  * @param alsoSearchProxies whether to also check proxy curves of the children
184898
185058
  */
184899
185059
  childIndex(target, alsoSearchProxies) {
@@ -184912,7 +185072,7 @@ class CurveChain extends CurveCollection {
184912
185072
  }
184913
185073
  return undefined;
184914
185074
  }
184915
- /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive. */
185075
+ /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive. */
184916
185076
  primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(index, fraction, cyclic = false, result) {
184917
185077
  const primitive = this.cyclicCurvePrimitive(index, cyclic);
184918
185078
  if (primitive) {
@@ -188144,7 +188304,7 @@ var CurveIntervalRole;
188144
188304
  (function (CurveIntervalRole) {
188145
188305
  /** This point is an isolated point NOT at a primary vertex. */
188146
188306
  CurveIntervalRole[CurveIntervalRole["isolated"] = 0] = "isolated";
188147
- /** This point is an isolated vertex hit */
188307
+ /** This point is an isolated vertex hit */
188148
188308
  CurveIntervalRole[CurveIntervalRole["isolatedAtVertex"] = 1] = "isolatedAtVertex";
188149
188309
  /** This is the beginning of an interval */
188150
188310
  CurveIntervalRole[CurveIntervalRole["intervalStart"] = 10] = "intervalStart";
@@ -188159,11 +188319,11 @@ var CurveIntervalRole;
188159
188319
  */
188160
188320
  var CurveSearchStatus;
188161
188321
  (function (CurveSearchStatus) {
188162
- /** unimplemented or zero length curve */
188322
+ /** Unimplemented or zero length curve */
188163
188323
  CurveSearchStatus[CurveSearchStatus["error"] = 0] = "error";
188164
- /** complete success of search */
188324
+ /** Complete success of search */
188165
188325
  CurveSearchStatus[CurveSearchStatus["success"] = 1] = "success";
188166
- /** search ended prematurely (e.g. at incomplete distance moved) at start or end of curve */
188326
+ /** Search ended prematurely (e.g. at incomplete distance moved) at start or end of curve */
188167
188327
  CurveSearchStatus[CurveSearchStatus["stoppedAtBoundary"] = 2] = "stoppedAtBoundary";
188168
188328
  })(CurveSearchStatus || (CurveSearchStatus = {}));
188169
188329
  /**
@@ -188186,7 +188346,7 @@ function optionalVectorUpdate(source, result) {
188186
188346
  * @public
188187
188347
  */
188188
188348
  class CurveLocationDetail {
188189
- /** constructor */
188349
+ /** Constructor */
188190
188350
  constructor() {
188191
188351
  this.pointQ = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
188192
188352
  this.fraction = 0;
@@ -188284,8 +188444,10 @@ class CurveLocationDetail {
188284
188444
  return this.setFP(fraction, ray.origin, ray.direction, a);
188285
188445
  }
188286
188446
  /** Set the CurvePrimitive pointer, leaving all other properties untouched. */
188287
- setCurve(curve) { this.curve = curve; }
188288
- /** record the distance from the CurveLocationDetail's point to the parameter point. */
188447
+ setCurve(curve) {
188448
+ this.curve = curve;
188449
+ }
188450
+ /** Record the distance from the CurveLocationDetail's point to the parameter point. */
188289
188451
  setDistanceTo(point) {
188290
188452
  this.a = this.point.distance(point);
188291
188453
  }
@@ -188688,7 +188850,7 @@ class CurvePrimitive extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__.Geometr
188688
188850
  }
188689
188851
  /**
188690
188852
  * Returns a (high accuracy) range of the curve between fractional positions
188691
- * * Default implementation returns the range of the curve from clonePartialCurve
188853
+ * * Default implementation returns the range of the curve from clonePartialCurve.
188692
188854
  */
188693
188855
  rangeBetweenFractions(fraction0, fraction1, transform) {
188694
188856
  return this.rangeBetweenFractionsByClone(fraction0, fraction1, transform);
@@ -188717,6 +188879,7 @@ class CurvePrimitive extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__.Geometr
188717
188879
  * @param fraction0 start fraction for evaluation
188718
188880
  * @param fraction1 end fraction for evaluation
188719
188881
  * @param count number of points to evaluate
188882
+ * @param transform optional transform to be applied to the curve
188720
188883
  * @param extrapolationFactor if positive, evaluate again at interval midpoints and apply this fraction multiplier
188721
188884
  * to any increase in size.
188722
188885
  */
@@ -188804,8 +188967,8 @@ class CurvePrimitive extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__.Geometr
188804
188967
  * * `curveStartState` = `CurveSearchStatus.error`
188805
188968
  * @param startFraction fractional position where the move starts
188806
188969
  * @param signedDistance distance to move. Negative distance is backwards in the fraction space
188807
- * @param allowExtension if true, all the move to go beyond the startPoint or endpoint of the curve. If false, do not
188808
- * allow movement beyond the startPoint or endpoint
188970
+ * @param allowExtension if true, allow the move to go beyond the startPoint or endpoint of the curve. If false,
188971
+ * do not allow movement beyond the startPoint or endpoint
188809
188972
  * @param result optional result.
188810
188973
  * @returns A CurveLocationDetail annotated as above. Note that if the curve does not support the calculation, there is
188811
188974
  * still a result which contains the point at the input startFraction, with failure indicated in the `curveStartState`
@@ -189514,8 +189677,8 @@ __webpack_require__.r(__webpack_exports__);
189514
189677
  * * A 3d line segment represented by its start and end coordinates
189515
189678
  * * startPoint
189516
189679
  * * endPoint
189517
- * * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. either of these
189518
- * equivalent forms to map fraction `f` to a point `X(f)`
189680
+ * * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these
189681
+ * equivalent forms maps fraction `f` to a point `X(f)`:
189519
189682
  * ```
189520
189683
  * equation
189521
189684
  * X(f) = P_0 + f*(P_1 - P_0)\newline
@@ -189530,14 +189693,14 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
189530
189693
  }
189531
189694
  /**
189532
189695
  * Return REFERENCE to the start point of this segment.
189533
- * * (This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point
189696
+ * * This is distinct from the `CurvePrimitive` abstract method `startPoint()` which creates a returned point.
189534
189697
  */
189535
189698
  get point0Ref() {
189536
189699
  return this._point0;
189537
189700
  }
189538
189701
  /**
189539
189702
  * Return REFERENCE to the end point of this segment.
189540
- * * (This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point
189703
+ * * This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point.
189541
189704
  */
189542
189705
  get point1Ref() {
189543
189706
  return this._point1;
@@ -190937,7 +191100,7 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
190937
191100
  return ls;
190938
191101
  }
190939
191102
  /**
190940
- * Evaluate a curve at uniform fractions. Append the evaluations to this linestring.
191103
+ * Evaluate a curve at uniform fractions. Append the evaluations to this linestring.
190941
191104
  * @param curve primitive to evaluate.
190942
191105
  * @param numStrokes number of strokes (edges).
190943
191106
  * @param fraction0 starting fraction coordinate
@@ -193734,8 +193897,8 @@ var RegionBinaryOpType;
193734
193897
  * * `ParityRegion` -- a collection of loops, interpreted by parity rules.
193735
193898
  * The common "One outer loop and many Inner loops" is a parity region.
193736
193899
  * * `UnionRegion` -- a collection of `Loop` and `ParityRegion` objects understood as a (probably disjoint) union.
193737
- * * Most of the methods in this class ignore z-coordinates, so callers should ensure that input geometry has been
193738
- * rotated parallel to the xy-plane.
193900
+ * * **NOTE:** Most of the methods in this class ignore z-coordinates, so callers should ensure that input geometry has
193901
+ * been rotated parallel to the xy-plane.
193739
193902
  * @public
193740
193903
  */
193741
193904
  class RegionOps {
@@ -193985,34 +194148,29 @@ class RegionOps {
193985
194148
  return RegionOps.sortOuterAndHoleLoopsXY(allLoops);
193986
194149
  }
193987
194150
  /**
193988
- * Construct a wire (not area!!) that is offset from given polyline or polygon.
193989
- * * This is a simple wire offset, not an area.
194151
+ * Construct a wire that is offset from the given polyline or polygon.
194152
+ * * This is a simple wire offset, not an area offset.
194153
+ * * Since z-coordinates are ignored, for best results the input points should lie in (a plane parallel to)
194154
+ * the xy-plane.
193990
194155
  * * The construction algorithm attempts to eliminate some self-intersections within the offsets, but does not
193991
194156
  * guarantee a simple area offset.
193992
- * * The construction algorithm is subject to being changed, resulting in different (hopefully better)
193993
- * self-intersection behavior on the future.
194157
+ * * If offsetDistance is given as a number, default OffsetOptions are applied.
194158
+ * * See [[JointOptions]] class doc for offset construction rules.
193994
194159
  * @param points a single loop or path
193995
194160
  * @param wrap true to include wraparound
193996
- * @param offsetDistance distance of offset from wire. Positive is left.
194161
+ * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or JointOptions
194162
+ * object.
193997
194163
  */
193998
- static constructPolygonWireXYOffset(points, wrap, offsetDistance) {
194164
+ static constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions) {
193999
194165
  const context = new _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_17__.PolygonWireOffsetContext();
194000
- return context.constructPolygonWireXYOffset(points, wrap, offsetDistance);
194166
+ return context.constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions);
194001
194167
  }
194002
194168
  /**
194003
194169
  * Construct curves that are offset from a Path or Loop as viewed in xy-plane (ignoring z).
194004
194170
  * * The construction will remove "some" local effects of features smaller than the offset distance, but will
194005
194171
  * not detect self intersection among widely separated edges.
194006
194172
  * * If offsetDistance is given as a number, default OffsetOptions are applied.
194007
- * * When the offset needs to do an "outside" turn, the first applicable construction is applied:
194008
- * * If the turn is larger than `options.minArcDegrees`, a circular arc is constructed.
194009
- * * If the turn is less than or equal to `options.maxChamferTurnDegrees`, extend curves along tangent to
194010
- * single intersection point.
194011
- * * If the turn is larger than `options.maxChamferDegrees`, the turn is constructed as a sequence of straight
194012
- * lines that are:
194013
- * * outside the arc
194014
- * * have uniform turn angle less than `options.maxChamferDegrees`
194015
- * * each line segment (except first and last) touches the arc at its midpoint.
194173
+ * * See [[JointOptions]] class doc for offset construction rules.
194016
194174
  * @param curves base curves.
194017
194175
  * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
194018
194176
  */
@@ -195187,12 +195345,16 @@ class StrokeOptions {
195187
195345
  get needNormals() {
195188
195346
  return this._needNormals !== undefined ? this._needNormals : false;
195189
195347
  }
195190
- set needNormals(value) { this._needNormals = value; }
195348
+ set needNormals(value) {
195349
+ this._needNormals = value;
195350
+ }
195191
195351
  /** Whether twoSided is requested. */
195192
195352
  get needTwoSided() {
195193
195353
  return this._needTwoSided !== undefined ? this._needTwoSided : false;
195194
195354
  }
195195
- set needTwoSided(value) { this._needTwoSided = value; }
195355
+ set needTwoSided(value) {
195356
+ this._needTwoSided = value;
195357
+ }
195196
195358
  /** Ask if angleTol is specified */
195197
195359
  get hasAngleTol() {
195198
195360
  return this.angleTol !== undefined && Math.abs(this.angleTol.radians) > 0.0;
@@ -196911,7 +197073,7 @@ __webpack_require__.r(__webpack_exports__);
196911
197073
 
196912
197074
 
196913
197075
  /**
196914
- * Classification of contortions at a joint.
197076
+ * Classification of how the joint is constructed.
196915
197077
  * @internal
196916
197078
  */
196917
197079
  var JointMode;
@@ -196924,26 +197086,44 @@ var JointMode;
196924
197086
  JointMode[JointMode["Gap"] = 4] = "Gap";
196925
197087
  })(JointMode || (JointMode = {}));
196926
197088
  /**
196927
- * * Control parameters for joint construction.
196928
- * * Decision order is:
196929
- * * if turn angle is greater than minArcDegrees, make an arc.
196930
- * * if turn angle is less than or equal maxChamferTurnDegrees, extend curves along tangent to single intersection point.
196931
- * * if turn angle is greater than maxChamferTurnDegrees, construct multiple lines that are tangent to the turn circle "from the outside",
196932
- * with each equal turn less than maxChamferTurnDegrees.
196933
- * * otherwise make single edge.
197089
+ * Control parameters for joint construction.
197090
+ * * Define a "joint" as the common point between adjacent segments of the input curve.
197091
+ * * Define the "turn angle" at a joint to be the angle in [0,pi] between the first derivatives (tangents) of
197092
+ * the segments at the joint.
197093
+ * * When creating offsets, if an offset needs to do an "outside" turn, the first applicable construction is applied:
197094
+ * * If the turn angle is larger than `options.minArcDegrees`, a circular arc is constructed to offset the joint.
197095
+ * * If the turn angle is less than or equal to `options.maxChamferTurnDegrees`, extend curves along tangent to
197096
+ * single intersection point (to create a sharp corner).
197097
+ * * If the turn angle is larger than `options.maxChamferDegrees`, the joint is offset with a line string whose edges:
197098
+ * * lie outside the arc that would have been created by the first construction
197099
+ * * have uniform turn angle less than `options.maxChamferDegrees`
197100
+ * * touch the arc at their midpoint (except first and last edge).
196934
197101
  * @public
196935
197102
  */
196936
197103
  class JointOptions {
196937
- /** Construct JointOptions.
197104
+ /**
197105
+ * Construct JointOptions.
196938
197106
  * * leftOffsetDistance is required
196939
197107
  * * minArcDegrees and maxChamferDegrees are optional.
196940
197108
  */
196941
- constructor(leftOffsetDistance, minArcDegrees = 180, maxChamferDegrees = 90, preserveEllipticalArcs = false) {
196942
- /** smallest arc to construct.
196943
- * * If this control angle is large, arcs are never created.
197109
+ constructor(leftOffsetDistance, minArcDegrees = 180, maxChamferDegrees = 90, preserveEllipticalArcs = false, allowSharpestCorners = false) {
197110
+ /**
197111
+ * Smallest arc to construct.
197112
+ * * If this control angle is 180 degrees or more, arcs are never created.
196944
197113
  */
196945
197114
  this.minArcDegrees = 180.0;
197115
+ /** Largest turn angle at which to construct a sharp corner, or largest turn angle in a multi-segment chamfer. */
196946
197116
  this.maxChamferTurnDegrees = 90;
197117
+ /**
197118
+ * Whether to remove the internal turn angle upper bound for sharp corner construction.
197119
+ * * By default, a sharp corner is not created at a joint when the turn angle is too large, so as to avoid offsets whose
197120
+ * ranges blow up. Internally, this is implemented by applying an upper bound of 120 degrees to `maxChamferTurnDegrees`.
197121
+ * * When `allowSharpestCorners` is true, this internal upper bound is removed, allowing sharp corners for turn angles
197122
+ * up to `maxChamferTurnDegrees`.
197123
+ * * Thus, if you know your input turn angles are no greater than `maxChamferTurnDegrees`, you can create an offset
197124
+ * with sharp corners at each joint by setting `minArcDegrees` to 180 and `allowSharpestCorners` to true.
197125
+ */
197126
+ this.allowSharpestCorners = false;
196947
197127
  /** Offset distance, positive to left of base curve. */
196948
197128
  this.leftOffsetDistance = 0;
196949
197129
  /** Whether to offset elliptical arcs as elliptical arcs (true) or as B-spline curves (false, default). */
@@ -196952,10 +197132,11 @@ class JointOptions {
196952
197132
  this.minArcDegrees = minArcDegrees;
196953
197133
  this.maxChamferTurnDegrees = maxChamferDegrees;
196954
197134
  this.preserveEllipticalArcs = preserveEllipticalArcs;
197135
+ this.allowSharpestCorners = allowSharpestCorners;
196955
197136
  }
196956
197137
  /** Return a deep clone. */
196957
197138
  clone() {
196958
- return new JointOptions(this.leftOffsetDistance, this.minArcDegrees, this.maxChamferTurnDegrees, this.preserveEllipticalArcs);
197139
+ return new JointOptions(this.leftOffsetDistance, this.minArcDegrees, this.maxChamferTurnDegrees, this.preserveEllipticalArcs, this.allowSharpestCorners);
196959
197140
  }
196960
197141
  /** Copy values of input options */
196961
197142
  setFrom(other) {
@@ -196963,6 +197144,7 @@ class JointOptions {
196963
197144
  this.minArcDegrees = other.minArcDegrees;
196964
197145
  this.maxChamferTurnDegrees = other.maxChamferTurnDegrees;
196965
197146
  this.preserveEllipticalArcs = other.preserveEllipticalArcs;
197147
+ this.allowSharpestCorners = other.allowSharpestCorners;
196966
197148
  }
196967
197149
  /**
196968
197150
  * Parse a number or JointOptions up to JointOptions:
@@ -196973,17 +197155,22 @@ class JointOptions {
196973
197155
  static create(leftOffsetDistanceOrOptions) {
196974
197156
  if (leftOffsetDistanceOrOptions instanceof JointOptions)
196975
197157
  return leftOffsetDistanceOrOptions;
196976
- // if (Number.isFinite(leftOffsetDistanceOrOptions))
196977
197158
  return new JointOptions(leftOffsetDistanceOrOptions);
196978
197159
  }
196979
- /** return true if the options indicate this amount of turn should be handled with an arc. */
197160
+ /**
197161
+ /** Return true if the options indicate this amount of turn should be handled with an arc. */
196980
197162
  needArc(theta) {
196981
197163
  return Math.abs(theta.degrees) >= this.minArcDegrees;
196982
197164
  }
196983
- /** Test if turn by theta should be output as single point. */
197165
+ /** Return the number of corners needed to chamfer the given turn angle. */
196984
197166
  numChamferPoints(theta) {
196985
197167
  const degrees = Math.abs(theta.degrees);
196986
- const stepDegrees = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.clamp(this.maxChamferTurnDegrees, 10, 120);
197168
+ const minStepDegreesClamp = 10;
197169
+ let maxStepDegreesClamp = 120;
197170
+ if (this.allowSharpestCorners) {
197171
+ maxStepDegreesClamp = this.maxChamferTurnDegrees;
197172
+ }
197173
+ const stepDegrees = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.clamp(this.maxChamferTurnDegrees, minStepDegreesClamp, maxStepDegreesClamp);
196987
197174
  if (degrees <= stepDegrees)
196988
197175
  return 1;
196989
197176
  return Math.ceil(degrees / stepDegrees);
@@ -196999,17 +197186,41 @@ class OffsetOptions {
196999
197186
  this.jointOptions = JointOptions.create(offsetDistanceOrOptions);
197000
197187
  this.strokeOptions = (strokeOptions !== undefined) ? strokeOptions : _StrokeOptions__WEBPACK_IMPORTED_MODULE_1__.StrokeOptions.createForCurves();
197001
197188
  }
197002
- get minArcDegrees() { return this.jointOptions.minArcDegrees; }
197003
- set minArcDegrees(value) { this.jointOptions.minArcDegrees = value; }
197004
- get maxChamferTurnDegrees() { return this.jointOptions.maxChamferTurnDegrees; }
197005
- set maxChamferTurnDegrees(value) { this.jointOptions.maxChamferTurnDegrees = value; }
197006
- get leftOffsetDistance() { return this.jointOptions.leftOffsetDistance; }
197007
- set leftOffsetDistance(value) { this.jointOptions.leftOffsetDistance = value; }
197008
- get preserveEllipticalArcs() { return this.jointOptions.preserveEllipticalArcs; }
197009
- set preserveEllipticalArcs(value) { this.jointOptions.preserveEllipticalArcs = value; }
197010
- /** Convert variant input into OffsetOptions.
197189
+ get minArcDegrees() {
197190
+ return this.jointOptions.minArcDegrees;
197191
+ }
197192
+ set minArcDegrees(value) {
197193
+ this.jointOptions.minArcDegrees = value;
197194
+ }
197195
+ get maxChamferTurnDegrees() {
197196
+ return this.jointOptions.maxChamferTurnDegrees;
197197
+ }
197198
+ set maxChamferTurnDegrees(value) {
197199
+ this.jointOptions.maxChamferTurnDegrees = value;
197200
+ }
197201
+ get allowSharpestCorners() {
197202
+ return this.jointOptions.allowSharpestCorners;
197203
+ }
197204
+ set allowSharpestCorners(value) {
197205
+ this.jointOptions.allowSharpestCorners = value;
197206
+ }
197207
+ get leftOffsetDistance() {
197208
+ return this.jointOptions.leftOffsetDistance;
197209
+ }
197210
+ set leftOffsetDistance(value) {
197211
+ this.jointOptions.leftOffsetDistance = value;
197212
+ }
197213
+ get preserveEllipticalArcs() {
197214
+ return this.jointOptions.preserveEllipticalArcs;
197215
+ }
197216
+ set preserveEllipticalArcs(value) {
197217
+ this.jointOptions.preserveEllipticalArcs = value;
197218
+ }
197219
+ /**
197220
+ * Convert variant input into OffsetOptions.
197011
197221
  * * If a JointOptions is provided, it is captured.
197012
- * * If an OffsetOptions is provided, a reference to it is returned. */
197222
+ * * If an OffsetOptions is provided, a reference to it is returned.
197223
+ */
197013
197224
  static create(offsetDistanceOrOptions) {
197014
197225
  if (offsetDistanceOrOptions instanceof OffsetOptions)
197015
197226
  return offsetDistanceOrOptions;
@@ -197038,7 +197249,9 @@ class Joint {
197038
197249
  this.swingPoint = swingPoint;
197039
197250
  this.flexure = JointMode.Unknown;
197040
197251
  }
197041
- /** try to construct an arc transition from ray0 to ray1 with given center. */
197252
+ /**
197253
+ * Try to construct an arc transition from ray0 to ray1 with given center.
197254
+ */
197042
197255
  static constructArc(ray0, center, ray1) {
197043
197256
  if (center !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(ray0.origin.distance(center), ray1.origin.distance(center))) {
197044
197257
  const angle = ray0.direction.angleToXY(ray1.direction);
@@ -197083,6 +197296,7 @@ class Joint {
197083
197296
  destination.packedPoints.push(point);
197084
197297
  }
197085
197298
  }
197299
+ /** Append stroke points along the offset curve defined by the Joint chain to the destination line string. */
197086
197300
  static collectStrokesFromChain(start, destination, maxTest = 100) {
197087
197301
  let numOut = -2 * maxTest; // allow extra things to happen
197088
197302
  Joint.visitJointsOnChain(start, (joint) => {
@@ -197094,7 +197308,7 @@ class Joint {
197094
197308
  if (fA === 0.0 && fB === 1.0)
197095
197309
  curve1 = joint.curve1.clone();
197096
197310
  else if (fA < fB)
197097
- curve1 = joint.curve1.clonePartialCurve(fA, fB);
197311
+ curve1 = joint.curve1.clonePartialCurve(fA, fB); // trimming is done by clonePartialCurve
197098
197312
  if (curve1) {
197099
197313
  if (!joint.jointCurve) {
197100
197314
  this.addPoint(destination, curve1.startPoint());
@@ -197134,6 +197348,7 @@ class Joint {
197134
197348
  }
197135
197349
  }
197136
197350
  }
197351
+ /** Append CurvePrimitives along the offset curve defined by the Joint chain to the destination array. */
197137
197352
  static collectCurvesFromChain(start, destination, maxTest = 100) {
197138
197353
  if (start === undefined)
197139
197354
  return;
@@ -197148,13 +197363,13 @@ class Joint {
197148
197363
  if (fA === 0.0 && fB === 1.0)
197149
197364
  curve1 = joint.curve1.clone();
197150
197365
  else if (fA < fB)
197151
- curve1 = joint.curve1.clonePartialCurve(fA, fB);
197366
+ curve1 = joint.curve1.clonePartialCurve(fA, fB); // trimming is done by clonePartialCurve
197152
197367
  this.collectPrimitive(destination, curve1);
197153
197368
  }
197154
197369
  return numOut++ < maxTest;
197155
197370
  }, maxTest);
197156
197371
  }
197157
- /** Execute `joint.annotateJointMode()` at all joints on the chain. */
197372
+ /** Execute `joint.annotateJointMode()` at all joints on the chain to set some of the joints attributes. */
197158
197373
  static annotateChain(start, options, maxTest = 100) {
197159
197374
  if (start)
197160
197375
  Joint.visitJointsOnChain(start, (joint) => { joint.annotateJointMode(options); return true; }, maxTest);
@@ -197162,7 +197377,7 @@ class Joint {
197162
197377
  /**
197163
197378
  * Visit joints on a chain.
197164
197379
  * * terminate on `false` return from `callback`
197165
- * @param start first (and, for cyclic chain, final) Joint
197380
+ * @param start first (and, for cyclic chain, final) joint
197166
197381
  * @param callback function to call with each Joint as a single parameter.
197167
197382
  */
197168
197383
  static visitJointsOnChain(start, callback, maxTest = 100) {
@@ -197170,7 +197385,7 @@ class Joint {
197170
197385
  if (joint) {
197171
197386
  let numTest = 0;
197172
197387
  while (joint !== undefined) {
197173
- if (numTest++ >= maxTest + 5)
197388
+ if (numTest++ >= maxTest + 5) // allow extra things to happen
197174
197389
  return true;
197175
197390
  if (!callback(joint))
197176
197391
  return false;
@@ -197186,13 +197401,13 @@ class Joint {
197186
197401
  if (this.curve0 && this.curve1) {
197187
197402
  const ray0 = this.curve0.fractionToPointAndDerivative(1.0);
197188
197403
  const ray1 = this.curve1.fractionToPointAndDerivative(0.0);
197189
- const intersection = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_7__.Ray3d.closestApproachRay3dRay3d(ray0, ray1);
197404
+ const intersection = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_7__.Ray3d.closestApproachRay3dRay3d(ray0, ray1); // intersection of the 2 ray lines
197190
197405
  if (intersection.approachType === _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__.CurveCurveApproachType.Intersection) {
197191
197406
  if (intersection.detailA.fraction >= 0.0 && intersection.detailB.fraction <= 0.0) {
197192
197407
  this.fraction0 = 1.0;
197193
197408
  this.fraction1 = 0.0;
197194
197409
  this.flexure = JointMode.Extend;
197195
- const theta = ray0.getDirectionRef().angleToXY(ray1.getDirectionRef());
197410
+ const theta = ray0.getDirectionRef().angleToXY(ray1.getDirectionRef()); // angle between the 2 ray lines
197196
197411
  if (options.needArc(theta)) {
197197
197412
  const arc = Joint.constructArc(ray0, this.curve0.baseCurveEnd, ray1);
197198
197413
  if (arc) {
@@ -197200,13 +197415,12 @@ class Joint {
197200
197415
  return;
197201
197416
  }
197202
197417
  }
197203
- const numChamferPoints = options.numChamferPoints(theta);
197204
- if (numChamferPoints <= 1) {
197418
+ const numChamferPoints = options.numChamferPoints(theta); // how many interior points in the linestring
197419
+ if (numChamferPoints <= 1) { // create sharp corner
197205
197420
  this.jointCurve = _LineString3d__WEBPACK_IMPORTED_MODULE_6__.LineString3d.create(ray0.origin, intersection.detailA.point, ray1.origin);
197206
197421
  return;
197207
197422
  }
197208
- if (numChamferPoints > 1) {
197209
- // A nontrivial linestring ...
197423
+ if (numChamferPoints > 1) { // create chamfer corner (a line string)
197210
197424
  const radians0 = theta.radians;
197211
197425
  const numHalfStep = 2.0 * numChamferPoints;
197212
197426
  const halfStepRadians = radians0 / numHalfStep;
@@ -197226,19 +197440,20 @@ class Joint {
197226
197440
  }
197227
197441
  }
197228
197442
  }
197229
- // desperation appears ...
197443
+ // if there is no intersection between the 2 ray lines, fill the gap by a line segment
197230
197444
  this.flexure = JointMode.Gap;
197231
197445
  this.jointCurve = _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d.create(this.curve0.fractionToPoint(1.0), this.curve1.fractionToPoint(0.0));
197232
197446
  this.fraction0 = 1.0;
197233
197447
  this.fraction1 = 0.0;
197234
197448
  }
197235
197449
  }
197236
- // Select the index at which summed fraction difference is smallest.
197450
+ /** Select the index at which summed fraction difference is smallest */
197237
197451
  selectIntersectionIndexByFraction(fractionA, fractionB, intersections) {
197238
197452
  let index = -1;
197239
197453
  let aMin = Number.MAX_VALUE;
197240
197454
  for (let i = 0; i < intersections.length; i++) {
197241
- const a = Math.abs(intersections[i].detailA.fraction - fractionA) + Math.abs(intersections[i].detailB.fraction - fractionB);
197455
+ const a = Math.abs(intersections[i].detailA.fraction - fractionA)
197456
+ + Math.abs(intersections[i].detailB.fraction - fractionB);
197242
197457
  if (a < aMin) {
197243
197458
  aMin = a;
197244
197459
  index = i;
@@ -197247,42 +197462,42 @@ class Joint {
197247
197462
  return index;
197248
197463
  }
197249
197464
  /**
197250
- * Examine the adjacent geometry
197251
- * * set JointMode: one of Cap Extend, or Trim
197465
+ * Examine the adjacent geometry to set some of joint attributes:
197466
+ * * set JointMode: one of Cap, Extend, or Trim
197252
197467
  * * set fraction0 and fraction1 of intersection of curve0 and curve1
197468
+ * * set joint curve
197253
197469
  * * this REFERENCES curve0, curve1, fraction0, fraction1
197254
197470
  * * this does not reference nextJoint and previousJoint
197255
197471
  */
197256
197472
  annotateJointMode(options) {
197257
- if (this.curve0 && !this.curve1) {
197473
+ if (!this.curve0 && this.curve1) { // joint at the start of the chain
197258
197474
  this.flexure = JointMode.Cap;
197259
- this.fraction0 = 1.0;
197475
+ this.fraction1 = 0.0;
197260
197476
  }
197261
- else if (this.curve1 && !this.curve0) {
197477
+ else if (this.curve0 && !this.curve1) { // joint at the end of the chain
197262
197478
  this.flexure = JointMode.Cap;
197263
- this.fraction1 = 0.0;
197479
+ this.fraction0 = 1.0;
197264
197480
  }
197265
- else if (this.curve0 && this.curve1) {
197266
- // check for direct intersection -- occurs on offset of colinear base segments, and closed primitives
197267
- if (this.curve0.endPoint().isAlmostEqual(this.curve1.startPoint())) {
197481
+ else if (this.curve0 && this.curve1) { // joints at the middle of the chain
197482
+ if (this.curve0.endPoint().isAlmostEqual(this.curve1.startPoint())) { // joint between colinear segments
197268
197483
  this.fraction0 = 1.0;
197269
197484
  this.fraction1 = 0.0;
197270
197485
  this.flexure = JointMode.Trim;
197271
197486
  }
197272
- else if (this.curve0 instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d && this.curve1 instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d) {
197273
- const ray0 = this.curve0.fractionToPointAndDerivative(0.0); // And we know that is full length ray !
197274
- const ray1 = this.curve1.fractionToPointAndDerivative(0.0); // ditto
197275
- const intersection = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_7__.Ray3d.closestApproachRay3dRay3d(ray0, ray1);
197487
+ else if (this.curve0 instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d && this.curve1 instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d) { // pair of lines
197488
+ const ray0 = this.curve0.fractionToPointAndDerivative(0.0);
197489
+ const ray1 = this.curve1.fractionToPointAndDerivative(0.0);
197490
+ const intersection = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_7__.Ray3d.closestApproachRay3dRay3d(ray0, ray1); // intersection of the 2 ray lines
197276
197491
  if (intersection.approachType === _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__.CurveCurveApproachType.Intersection) {
197277
197492
  this.fraction0 = intersection.detailA.fraction;
197278
197493
  this.fraction1 = intersection.detailB.fraction;
197279
- if (this.fraction0 >= 1.0 && this.fraction1 <= 0.0) {
197494
+ if (this.fraction0 >= 1.0 && this.fraction1 <= 0.0) { // need to extend
197280
197495
  this.annotateExtension(options);
197281
197496
  }
197282
- else if (this.fraction0 < 1.0 && this.fraction1 > 0.0) {
197497
+ else if (this.fraction0 < 1.0 && this.fraction1 > 0.0) { // need to trim
197283
197498
  this.flexure = JointMode.Trim;
197284
197499
  }
197285
- else if (this.fraction0 > 1.0 && this.fraction1 > 1.0) {
197500
+ else if (this.fraction0 > 1.0 && this.fraction1 > 1.0) { // need to fill gap with a single line segment
197286
197501
  this.flexure = JointMode.Gap;
197287
197502
  this.jointCurve = _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d.create(this.curve0.fractionToPoint(1.0), this.curve1.fractionToPoint(0.0));
197288
197503
  this.fraction0 = 1.0;
@@ -197290,15 +197505,15 @@ class Joint {
197290
197505
  }
197291
197506
  }
197292
197507
  }
197293
- else { // generic pair of curves ...
197508
+ else { // generic pair of curves
197294
197509
  const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_9__.CurveCurve.intersectionXYPairs(this.curve0, false, this.curve1, false);
197295
197510
  const intersectionIndex = this.selectIntersectionIndexByFraction(1.0, 0.0, intersections);
197296
- if (intersectionIndex >= 0) {
197511
+ if (intersectionIndex >= 0) { // need to trim
197297
197512
  this.flexure = JointMode.Trim;
197298
197513
  this.fraction0 = intersections[intersectionIndex].detailA.fraction;
197299
197514
  this.fraction1 = intersections[intersectionIndex].detailB.fraction;
197300
197515
  }
197301
- else {
197516
+ else { // need to extend
197302
197517
  this.annotateExtension(options);
197303
197518
  }
197304
197519
  }
@@ -197306,7 +197521,8 @@ class Joint {
197306
197521
  }
197307
197522
  /**
197308
197523
  * * Examine the primitive trim fractions between each pair of joints.
197309
- * * If trim fractions indicate the primitive must disappear, replace the joint pair by a new joint pointing at surrounding primitives
197524
+ * * If trim fractions indicate the primitive must disappear, replace the joint pair by a new joint pointing at
197525
+ * surrounding primitives
197310
197526
  * @param start
197311
197527
  */
197312
197528
  static removeDegeneratePrimitives(start, options, maxTest) {
@@ -197341,8 +197557,7 @@ class Joint {
197341
197557
  }
197342
197558
  */
197343
197559
  const eliminateF = f0 >= f1 || f0 > 1.0;
197344
- const eliminateG = (g0 !== undefined && g0 > 1.0)
197345
- || (g0 !== undefined && g1 !== undefined && g0 >= g1);
197560
+ const eliminateG = (g0 !== undefined && g0 > 1.0) || (g0 !== undefined && g1 !== undefined && g0 >= g1);
197346
197561
  if (eliminateF && eliminateG) {
197347
197562
  const jointC = jointB.nextJoint;
197348
197563
  const newJoint = new Joint(jointA.curve0, jointC.curve1, undefined);
@@ -197398,9 +197613,8 @@ class Joint {
197398
197613
  * @internal
197399
197614
  */
197400
197615
  class PolygonWireOffsetContext {
197401
- /** construct a context. */
197402
- constructor() {
197403
- }
197616
+ /** Construct a context. */
197617
+ constructor() { }
197404
197618
  // Construct a single offset from base points
197405
197619
  static createOffsetSegment(basePointA, basePointB, distance) {
197406
197620
  _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(basePointA, basePointB, this._unitAlong);
@@ -197413,13 +197627,25 @@ class PolygonWireOffsetContext {
197413
197627
  return undefined;
197414
197628
  }
197415
197629
  /**
197416
- * Construct curves that are offset from a polygon.
197417
- * * The construction will remove "some" local effects of features smaller than the offset distance, but will not detect self intersection with far-away edges.
197418
- * @param points
197419
- * @param wrap
197420
- * @param offsetDistance
197630
+ * Construct a wire (not area) that is offset from given polyline or polygon (which must be in xy-plane or in
197631
+ * a plane parallel to xy-plane).
197632
+ * * This is a simple wire offset (in the form of a line string), not an area.
197633
+ * * If offsetDistance is given as a number, default OffsetOptions are applied.
197634
+ * * See [[JointOptions]] class doc for offset construction rules.
197635
+ * @param points a single loop or path
197636
+ * @param wrap true to offset the wraparound joint. Assumes first = last point.
197637
+ * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or JointOptions
197638
+ * object.
197421
197639
  */
197422
197640
  constructPolygonWireXYOffset(points, wrap, leftOffsetDistanceOrOptions) {
197641
+ /**
197642
+ * if "wrap = true", then first and last point in the points array must be close; otherwise
197643
+ * generated offset will be invalid.
197644
+ */
197645
+ if (wrap && !points[0].isAlmostEqual(points[points.length - 1])) {
197646
+ wrap = false;
197647
+ }
197648
+ /** create raw offsets as a linked list (joint0) */
197423
197649
  const options = JointOptions.create(leftOffsetDistanceOrOptions);
197424
197650
  const numPoints = points.length;
197425
197651
  let fragment0 = PolygonWireOffsetContext.createOffsetSegment(points[0], points[1], options.leftOffsetDistance);
@@ -197439,7 +197665,9 @@ class PolygonWireOffsetContext {
197439
197665
  newJoint = new Joint(fragment0, undefined, points[numPoints - 1]);
197440
197666
  Joint.link(previousJoint, newJoint);
197441
197667
  }
197668
+ /** annotateChain sets some of the joints attributes (including how to extend curves or fill the gap between curves) */
197442
197669
  Joint.annotateChain(joint0, options, numPoints);
197670
+ /** make limited passes through the Joint chain until no self-intersections are removed */
197443
197671
  for (let pass = 0; pass++ < 5;) {
197444
197672
  const state = Joint.removeDegeneratePrimitives(joint0, options, numPoints);
197445
197673
  joint0 = state.newStart;
@@ -197453,6 +197681,7 @@ class PolygonWireOffsetContext {
197453
197681
  */
197454
197682
  }
197455
197683
  // Joint.collectPrimitivesFromChain(joint0, result, numPoints);
197684
+ /** turn the Joint linked list into a CurveCollection (Loop or Path). trimming is done in collectStrokesFromChain */
197456
197685
  const chain = _LineString3d__WEBPACK_IMPORTED_MODULE_6__.LineString3d.create();
197457
197686
  Joint.collectStrokesFromChain(joint0, chain, numPoints);
197458
197687
  const n = chain.packedPoints.length;
@@ -197476,14 +197705,13 @@ PolygonWireOffsetContext._offsetB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTE
197476
197705
  */
197477
197706
  class CurveChainWireOffsetContext {
197478
197707
  /** construct a context. */
197479
- constructor() {
197480
- }
197708
+ constructor() { }
197481
197709
  /**
197482
197710
  * Annotate a CurvePrimitive with properties `baseCurveStart` and `baseCurveEnd`.
197483
- * * return cp
197484
- * @param cp primitive to annotate
197711
+ * @param cp curve primitive to annotate
197485
197712
  * @param startPoint optional start point
197486
197713
  * @param endPoint optional end point
197714
+ * @return the input CurvePrimitive with annotations
197487
197715
  */
197488
197716
  static applyBasePoints(cp, startPoint, endPoint) {
197489
197717
  if (cp !== undefined) {
@@ -197495,7 +197723,7 @@ class CurveChainWireOffsetContext {
197495
197723
  return cp;
197496
197724
  }
197497
197725
  /**
197498
- * Create the offset of a single primitive.
197726
+ * Create the offset of a single primitive as viewed in the xy-plane (ignoring z).
197499
197727
  * * each primitive may be labeled (as an `any` object) with start or end point of base curve:
197500
197728
  * * `(primitive as any).baseCurveStart: Point3d`
197501
197729
  * * `(primitive as any).baseCurveEnd: Point3d`
@@ -197519,15 +197747,10 @@ class CurveChainWireOffsetContext {
197519
197747
  }
197520
197748
  /**
197521
197749
  * Construct curves that are offset from a Path or Loop as viewed in xy-plane (ignoring z).
197522
- * * The construction will remove "some" local effects of features smaller than the offset distance, but will not detect self intersection among widely separated edges.
197750
+ * * The construction will remove "some" local effects of features smaller than the offset distance, but will
197751
+ * not detect self intersection among widely separated edges.
197523
197752
  * * If offsetDistance is given as a number, default OffsetOptions are applied.
197524
- * * When the offset needs to do an "outside" turn, the first applicable construction is applied:
197525
- * * If the turn is larger than `options.minArcDegrees`, a circular arc is constructed.
197526
- * * If the turn is less than or equal to `options.maxChamferTurnDegrees`, extend curves along tangent to single intersection point.
197527
- * * If the turn is larger than `options.maxChamferDegrees`, the turn is constructed as a sequence of straight lines that are:
197528
- * * outside the arc
197529
- * * have uniform turn angle less than `options.maxChamferDegrees`
197530
- * * each line segment (except first and last) touches the arc at its midpoint.
197753
+ * * See [[JointOptions]] class doc for offset construction rules.
197531
197754
  * @param curves base curves.
197532
197755
  * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
197533
197756
  */
@@ -197535,14 +197758,15 @@ class CurveChainWireOffsetContext {
197535
197758
  const wrap = curves instanceof _Loop__WEBPACK_IMPORTED_MODULE_10__.Loop;
197536
197759
  const offsetOptions = OffsetOptions.create(offsetDistanceOrOptions);
197537
197760
  const simpleOffsets = [];
197538
- // setup pass: get simple offsets of each primitive
197761
+ /** traverse primitives (children of curves) and create simple offsets of each primitive as an array */
197539
197762
  for (const c of curves.children) {
197540
197763
  const c1 = CurveChainWireOffsetContext.createSingleOffsetPrimitiveXY(c, offsetOptions);
197541
197764
  if (c1 === undefined) {
197542
197765
  // bad .. maybe arc to inside?
197543
197766
  }
197544
- else if (c1 instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__.CurvePrimitive)
197767
+ else if (c1 instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__.CurvePrimitive) {
197545
197768
  simpleOffsets.push(c1);
197769
+ }
197546
197770
  else if (Array.isArray(c1)) {
197547
197771
  for (const c2 of c1) {
197548
197772
  if (c2 instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__.CurvePrimitive)
@@ -197550,6 +197774,7 @@ class CurveChainWireOffsetContext {
197550
197774
  }
197551
197775
  }
197552
197776
  }
197777
+ /** create joints between array elements to make offsets as a linked list (joint0) */
197553
197778
  let fragment0;
197554
197779
  let newJoint;
197555
197780
  let previousJoint;
@@ -197568,8 +197793,10 @@ class CurveChainWireOffsetContext {
197568
197793
  }
197569
197794
  if (joint0 && previousJoint && curves instanceof _Loop__WEBPACK_IMPORTED_MODULE_10__.Loop)
197570
197795
  Joint.link(previousJoint, joint0);
197796
+ /** annotateChain sets some of the joints attributes (including how to extend curves or fill the gap between curves) */
197571
197797
  const numOffset = simpleOffsets.length;
197572
197798
  Joint.annotateChain(joint0, offsetOptions.jointOptions, numOffset);
197799
+ /** turn the Joint linked list into a CurveCollection. trimming is done in collectCurvesFromChain */
197573
197800
  const outputCurves = [];
197574
197801
  Joint.collectCurvesFromChain(joint0, outputCurves, numOffset);
197575
197802
  return _RegionOps__WEBPACK_IMPORTED_MODULE_13__.RegionOps.createLoopPathOrBagOfCurves(outputCurves, wrap, true);
@@ -210256,10 +210483,12 @@ __webpack_require__.r(__webpack_exports__);
210256
210483
  * * are NOT required to be unit vectors.
210257
210484
  * * are NOT required to be perpendicular vectors.
210258
210485
  * * The skewed, non-uniform scaling of the grid directions is the primary focus of this class.
210259
- * * Queries of altitude, velocity, normalX, normalY, and normalZ use the NORMALIZED cross product of vectorU and vectorV as plane normal.
210486
+ * * Queries of altitude, velocity, normalX, normalY, and normalZ use the NORMALIZED cross product of vectorU
210487
+ * and vectorV as plane normal.
210260
210488
  * * Hence these are cartesian distances.
210261
210489
  * * If numerous calls to these are expected, the repeated normalization may be a performance issue.
210262
- * * Using a [[Plane3dByOriginAndUnitNormal]] or the rigid transform returned by [[toRigidFrame]] would provide better performance.
210490
+ * * Using a [[Plane3dByOriginAndUnitNormal]] or the rigid transform returned by [[toRigidFrame]] would provide
210491
+ * better performance.
210263
210492
  * @public
210264
210493
  */
210265
210494
  class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
@@ -210269,7 +210498,7 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
210269
210498
  this.vectorU = vectorU;
210270
210499
  this.vectorV = vectorV;
210271
210500
  }
210272
- /** create a new plane from origin and 2 in-plane vectors. */
210501
+ /** Create a new plane from origin and 2 in-plane vectors. */
210273
210502
  static createOriginAndVectors(origin, vectorU, vectorV, result) {
210274
210503
  if (result) {
210275
210504
  result.origin.setFrom(origin);
@@ -210279,13 +210508,14 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
210279
210508
  }
210280
210509
  return new Plane3dByOriginAndVectors(origin.clone(), vectorU.clone(), vectorV.clone());
210281
210510
  }
210282
- /** clone to a new plane. */
210511
+ /** Clone to a new plane. */
210283
210512
  clone(result) {
210284
210513
  if (result !== undefined)
210285
210514
  result.setOriginAndVectors(this.origin, this.vectorU, this.vectorV);
210286
210515
  return new Plane3dByOriginAndVectors(this.origin.clone(), this.vectorU.clone(), this.vectorV.clone());
210287
210516
  }
210288
- /** create a new Plane3dByOriginAndVectors from a variety of plane types.
210517
+ /**
210518
+ * Create a new Plane3dByOriginAndVectors from a variety of plane types.
210289
210519
  * * The input is NOT captured.
210290
210520
  */
210291
210521
  static createFrom(source, result) {
@@ -210344,7 +210574,8 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
210344
210574
  this.vectorV.set(vx, vy, vz);
210345
210575
  return this;
210346
210576
  }
210347
- /** Set all origin and both vectors from coordinates in given origin and vectors.
210577
+ /**
210578
+ * Set all origin and both vectors from coordinates in given origin and vectors.
210348
210579
  * * Note that coordinates are copied out of the parameters -- the given parameters are NOT retained by reference.
210349
210580
  */
210350
210581
  setOriginAndVectors(origin, vectorU, vectorV) {
@@ -210359,7 +210590,8 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
210359
210590
  return result.setOriginAndVectorsXYZ(x0, y0, z0, ux, uy, uz, vx, vy, vz);
210360
210591
  return new Plane3dByOriginAndVectors(_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x0, y0, z0), _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(ux, uy, uz), _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(vx, vy, vz));
210361
210592
  }
210362
- /** Define a plane by three points in the plane.
210593
+ /**
210594
+ * Define a plane by three points in the plane.
210363
210595
  * @param origin origin for the parameterization.
210364
210596
  * @param targetU target point for the vectorU starting at the origin.
210365
210597
  * @param targetV target point for the vectorV originating at the origin.
@@ -210372,7 +210604,8 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
210372
210604
  static createXYPlane(result) {
210373
210605
  return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(0, 0, 0, 1, 0, 0, 0, 1, 0, result);
210374
210606
  }
210375
- /** create a plane from data presented as Float64Arrays.
210607
+ /**
210608
+ * Create a plane from data presented as Float64Arrays.
210376
210609
  * @param origin x,y,z of origin.
210377
210610
  * @param vectorU x,y,z of vectorU
210378
210611
  * @param vectorV x,y,z of vectorV
@@ -210380,7 +210613,8 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
210380
210613
  static createOriginAndVectorsArrays(origin, vectorU, vectorV, result) {
210381
210614
  return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(origin[0], origin[1], origin[2], vectorU[0], vectorU[1], vectorU[2], vectorV[0], vectorV[1], vectorV[2], result);
210382
210615
  }
210383
- /** create a plane from data presented as Float64Array with weights
210616
+ /**
210617
+ * Create a plane from data presented as Float64Array with weights
210384
210618
  * @param origin x,y,z,w of origin.
210385
210619
  * @param vectorU x,y,z,w of vectorU
210386
210620
  * @param vectorV x,y,z,w of vectorV
@@ -210444,7 +210678,7 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
210444
210678
  vectorV: this.vectorV.toJSON(),
210445
210679
  };
210446
210680
  }
210447
- /** create a new plane. See `setFromJSON` for layout example. */
210681
+ /** Create a new plane. See `setFromJSON` for layout example. */
210448
210682
  static fromJSON(json) {
210449
210683
  const result = Plane3dByOriginAndVectors.createXYPlane();
210450
210684
  result.setFromJSON(json);
@@ -210456,7 +210690,8 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
210456
210690
  && this.vectorU.isAlmostEqual(other.vectorU)
210457
210691
  && this.vectorV.isAlmostEqual(other.vectorV);
210458
210692
  }
210459
- /** Normalize both `vectorU` and `vectorV` in place. This does NOT make them perpendicular.
210693
+ /**
210694
+ * Normalize both `vectorU` and `vectorV` in place. This does NOT make them perpendicular.
210460
210695
  * * Return true if both succeeded.
210461
210696
  */
210462
210697
  normalizeInPlace() {
@@ -210464,9 +210699,7 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
210464
210699
  const okV = this.vectorV.normalizeInPlace();
210465
210700
  return okU && okV;
210466
210701
  }
210467
- /**
210468
- * Return (if possible) a unit normal to the plane.
210469
- */
210702
+ /** Return (if possible) a unit normal to the plane */
210470
210703
  getUnitNormal(result) {
210471
210704
  return this.vectorU.unitCrossProduct(this.vectorV, result);
210472
210705
  }
@@ -210483,9 +210716,7 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
210483
210716
  getAnyPointOnPlane(result) {
210484
210717
  return this.origin.clone(result);
210485
210718
  }
210486
- /**
210487
- * Return (if possible) a ray with origin at plane origin, direction as unit normal to the plane.
210488
- */
210719
+ /** Return (if possible) a ray with origin at plane origin, direction as unit normal to the plane */
210489
210720
  unitNormalRay(result) {
210490
210721
  if (!Plane3dByOriginAndVectors._workVector)
210491
210722
  Plane3dByOriginAndVectors._workVector = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create();
@@ -210505,27 +210736,24 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
210505
210736
  toRigidFrame(result) {
210506
210737
  return _Transform__WEBPACK_IMPORTED_MODULE_5__.Transform.createRigidFromOriginAndColumns(this.origin, this.vectorU, this.vectorV, _Geometry__WEBPACK_IMPORTED_MODULE_3__.AxisOrder.XYZ, result);
210507
210738
  }
210508
- /**
210509
- * Apply the transform to the origin and vectors in place.
210510
- */
210739
+ /** Apply the transform to the origin and vectors in place */
210511
210740
  transformInPlace(transform) {
210512
210741
  transform.multiplyPoint3d(this.origin, this.origin);
210513
210742
  transform.multiplyVector(this.vectorU, this.vectorU);
210514
210743
  transform.multiplyVector(this.vectorV, this.vectorV);
210515
210744
  }
210516
- // Implement PlaneAltitudeEvaluator methods . . .
210517
210745
  /**
210518
210746
  * Return x component of the (normalized!) {vectorU CROSS vectorV}.
210519
210747
  * Return 0 if the cross product is zero.
210520
- * */
210748
+ */
210521
210749
  normalX() {
210522
210750
  const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
210523
210751
  return unitNormal !== undefined ? unitNormal.x : 0.0;
210524
210752
  }
210525
210753
  /**
210526
- * Return y component of the (normalized!) {vectorU CROSS vectorV}.
210527
- * Return 0 if the cross product is zero.
210528
- * */
210754
+ * Return y component of the (normalized!) {vectorU CROSS vectorV}.
210755
+ * Return 0 if the cross product is zero.
210756
+ */
210529
210757
  normalY() {
210530
210758
  const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
210531
210759
  return unitNormal !== undefined ? unitNormal.y : 0.0;
@@ -210533,41 +210761,43 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
210533
210761
  /**
210534
210762
  * Return z component of the (normalized!) {vectorU CROSS vectorV}.
210535
210763
  * Return 0 if the cross product is zero.
210536
- * */
210764
+ */
210537
210765
  normalZ() {
210538
210766
  const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
210539
210767
  return unitNormal !== undefined ? unitNormal.z : 0.0;
210540
210768
  }
210541
- /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */
210769
+ /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */
210542
210770
  altitude(xyz) {
210543
210771
  const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
210544
210772
  if (unitNormal === undefined)
210545
210773
  return 0.0;
210546
210774
  return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYZXYZ((xyz.x - this.origin.x), (xyz.y - this.origin.y), (xyz.z - this.origin.z), unitNormal.x, unitNormal.y, unitNormal.z);
210547
210775
  }
210548
- /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */
210776
+ /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */
210549
210777
  altitudeXYZ(x, y, z) {
210550
210778
  const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
210551
210779
  if (unitNormal === undefined)
210552
210780
  return 0.0;
210553
210781
  return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYZXYZ((x - this.origin.x), (y - this.origin.y), (z - this.origin.z), unitNormal.x, unitNormal.y, unitNormal.z);
210554
210782
  }
210555
- /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */
210783
+ /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */
210556
210784
  velocity(xyzVector) {
210557
210785
  const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
210558
210786
  if (unitNormal === undefined)
210559
210787
  return 0.0;
210560
210788
  return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYZXYZ(xyzVector.x, xyzVector.y, xyzVector.z, unitNormal.x, unitNormal.y, unitNormal.z);
210561
210789
  }
210562
- /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */
210790
+ /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */
210563
210791
  velocityXYZ(x, y, z) {
210564
210792
  const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
210565
210793
  if (unitNormal === undefined)
210566
210794
  return 0.0;
210567
210795
  return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYZXYZ(x, y, z, unitNormal.x, unitNormal.y, unitNormal.z);
210568
210796
  }
210569
- /** Return triple product of homogeneous difference {(xyzw - w * origin)} with vectorU and vectorV.
210570
- * * In the usual manner of homogeneous calculations, this is proportional to true cartesian distance from the plane but is not a physical distance.
210797
+ /**
210798
+ * Return triple product of homogeneous difference {(xyzw - w * origin)} with vectorU and vectorV.
210799
+ * * In the usual manner of homogeneous calculations, this is proportional to true cartesian distance from the
210800
+ * plane but is not a physical distance.
210571
210801
  */
210572
210802
  weightedAltitude(xyzw) {
210573
210803
  const w = xyzw.w;
@@ -216737,7 +216967,7 @@ class Range3d extends RangeBase {
216737
216967
  const coffs = transform.matrix.coffs;
216738
216968
  this.extendXYZW(origin.x * w + coffs[0] * x + coffs[1] * y + coffs[2] * z, origin.y * w + coffs[3] * x + coffs[4] * y + coffs[5] * z, origin.z * w + coffs[6] * x + coffs[7] * y + coffs[8] * z, w);
216739
216969
  }
216740
- /** Multiply the point x,y,z by transform and use the coordinate to extend this range. */
216970
+ /** Multiply the point x,y,z by the inverse of the transform and use the coordinate to extend this range. */
216741
216971
  extendInverseTransformedXYZ(transform, x, y, z) {
216742
216972
  const origin = transform.origin;
216743
216973
  if (!transform.matrix.computeCachedInverse(true))
@@ -276918,7 +277148,7 @@ class TestContext {
276918
277148
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
276919
277149
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
276920
277150
  await core_frontend_1.NoRenderApp.startup({
276921
- applicationVersion: "4.1.0-dev.25",
277151
+ applicationVersion: "4.1.0-dev.27",
276922
277152
  applicationId: this.settings.gprid,
276923
277153
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
276924
277154
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -296292,7 +296522,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
296292
296522
  /***/ ((module) => {
296293
296523
 
296294
296524
  "use strict";
296295
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.1.0-dev.25","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","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","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","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 \\"./node_modules/@itwin/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 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.1.0-dev.25","@itwin/core-bentley":"workspace:^4.1.0-dev.25","@itwin/core-common":"workspace:^4.1.0-dev.25","@itwin/core-geometry":"workspace:^4.1.0-dev.25","@itwin/core-orbitgt":"workspace:^4.1.0-dev.25","@itwin/core-quantity":"workspace:^4.1.0-dev.25"},"//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":"^4.0.0-dev.33","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@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":"^8.36.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":"~5.0.2","webpack":"^5.76.0"},"//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.5.0","@itwin/cloud-agnostic-core":"^1.5.0","@itwin/object-storage-core":"^1.5.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0","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"}}]}}');
296525
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.1.0-dev.27","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","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","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","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 \\"./node_modules/@itwin/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 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.1.0-dev.27","@itwin/core-bentley":"workspace:^4.1.0-dev.27","@itwin/core-common":"workspace:^4.1.0-dev.27","@itwin/core-geometry":"workspace:^4.1.0-dev.27","@itwin/core-orbitgt":"workspace:^4.1.0-dev.27","@itwin/core-quantity":"workspace:^4.1.0-dev.27"},"//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":"^4.0.0-dev.33","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@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":"^8.36.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":"~5.0.2","webpack":"^5.76.0"},"//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.5.0","@itwin/cloud-agnostic-core":"^1.5.0","@itwin/object-storage-core":"^1.5.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0","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"}}]}}');
296296
296526
 
296297
296527
  /***/ }),
296298
296528