@itwin/ecschema-rpcinterface-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.
@@ -58217,13 +58217,13 @@ var CurrentImdlVersion;
58217
58217
  * 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
58218
58218
  * greater minor version than CurrentVersion.Minor, although some data may be skipped.
58219
58219
  */
58220
- CurrentImdlVersion[CurrentImdlVersion["Major"] = 31] = "Major";
58220
+ CurrentImdlVersion[CurrentImdlVersion["Major"] = 32] = "Major";
58221
58221
  /** The unsigned 16-bit minor version number. If the major version in the tile header is equal to CurrentVersion.Major, then this package can
58222
58222
  * read the tile content even if the minor version in the tile header is greater than this value, although some data may be skipped.
58223
58223
  */
58224
58224
  CurrentImdlVersion[CurrentImdlVersion["Minor"] = 0] = "Minor";
58225
58225
  /** The unsigned 32-bit version number derived from the 16-bit major and minor version numbers. */
58226
- CurrentImdlVersion[CurrentImdlVersion["Combined"] = 2031616] = "Combined";
58226
+ CurrentImdlVersion[CurrentImdlVersion["Combined"] = 2097152] = "Combined";
58227
58227
  })(CurrentImdlVersion || (CurrentImdlVersion = {}));
58228
58228
  /** Header embedded at the beginning of binary tile data in iMdl format describing its contents.
58229
58229
  * @internal
@@ -58500,6 +58500,19 @@ var Constants;
58500
58500
  (function (Constants) {
58501
58501
  Constants.minToleranceRatioMultiplier = 2;
58502
58502
  })(Constants || (Constants = {}));
58503
+ function compareEdgeOptions(a, b) {
58504
+ if (typeof a !== typeof b)
58505
+ return a ? 1 : -1;
58506
+ if (typeof a === "boolean") {
58507
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(typeof b === "boolean");
58508
+ return (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(a, b);
58509
+ }
58510
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(typeof b === "object");
58511
+ let cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(a.type, b.type);
58512
+ if (0 === cmp)
58513
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(a.smooth, b.smooth);
58514
+ return cmp;
58515
+ }
58503
58516
  /** @internal */
58504
58517
  var TileOptions;
58505
58518
  (function (TileOptions) {
@@ -58524,8 +58537,7 @@ var TileOptions;
58524
58537
  useLargerTiles: 0 !== (tree.flags & TreeFlags.UseLargerTiles),
58525
58538
  disableMagnification: false,
58526
58539
  alwaysSubdivideIncompleteTiles: false,
58527
- enableIndexedEdges: edgeOptions && edgeOptions.indexed,
58528
- generateAllPolyfaceEdges: edgeOptions && edgeOptions.smooth,
58540
+ edgeOptions,
58529
58541
  };
58530
58542
  }
58531
58543
  TileOptions.fromTreeIdAndContentId = fromTreeIdAndContentId;
@@ -58632,19 +58644,13 @@ class Parser {
58632
58644
  }
58633
58645
  parseEdges() {
58634
58646
  if ("E" !== this.cur())
58635
- return { indexed: false, smooth: false };
58647
+ return { type: "non-indexed", smooth: false };
58636
58648
  this.eat("E");
58637
58649
  this.eat(":");
58638
- const typeStr = this.cur();
58639
- this.eat(typeStr);
58650
+ const flag = this.cur();
58651
+ this.eat(flag);
58640
58652
  this.eat("_");
58641
- switch (typeStr) {
58642
- case "0": return false;
58643
- case "2": return { indexed: true, smooth: false };
58644
- case "3": return { indexed: false, smooth: true };
58645
- case "4": return { indexed: true, smooth: true };
58646
- default: this.reject();
58647
- }
58653
+ return "0" === flag ? false : edgeOptionsFromFlag(flag);
58648
58654
  }
58649
58655
  parseSectionCut() {
58650
58656
  if ("S" !== this.cur())
@@ -58674,8 +58680,10 @@ const defaultTileOptions = Object.freeze({
58674
58680
  useLargerTiles: true,
58675
58681
  disableMagnification: false,
58676
58682
  alwaysSubdivideIncompleteTiles: false,
58677
- enableIndexedEdges: true,
58678
- generateAllPolyfaceEdges: true,
58683
+ edgeOptions: {
58684
+ type: "compact",
58685
+ smooth: true,
58686
+ },
58679
58687
  });
58680
58688
  function contentFlagsFromId(id) {
58681
58689
  if (0 === id.length || "-" !== id[0])
@@ -58707,14 +58715,40 @@ function treeFlagsAndFormatVersionFromId(id) {
58707
58715
  function edgeOptionsFromTreeId(id) {
58708
58716
  const pos = id.indexOf("E:");
58709
58717
  if (pos <= 0)
58710
- return { indexed: false, smooth: false };
58711
- switch (id[pos + 2]) {
58712
- case "0": return { indexed: defaultTileOptions.enableIndexedEdges, smooth: defaultTileOptions.generateAllPolyfaceEdges };
58713
- case "2": return { indexed: true, smooth: false };
58714
- case "3": return { indexed: false, smooth: true };
58715
- case "4": return { indexed: true, smooth: true };
58718
+ return { type: "non-indexed", smooth: false };
58719
+ return edgeOptionsFromFlag(id[pos + 2]);
58720
+ }
58721
+ function edgeOptionsFromFlag(flag) {
58722
+ if ("0" === flag)
58723
+ return defaultTileOptions.edgeOptions;
58724
+ const smooth = flag !== "2" && flag !== "5";
58725
+ let type;
58726
+ switch (flag) {
58727
+ case "2":
58728
+ case "4":
58729
+ type = "indexed";
58730
+ break;
58731
+ case "3":
58732
+ type = "non-indexed";
58733
+ break;
58734
+ case "5":
58735
+ case "6":
58736
+ type = "compact";
58737
+ break;
58738
+ default:
58739
+ throw new Error("Invalid tree Id");
58740
+ }
58741
+ return { type, smooth };
58742
+ }
58743
+ function edgeOptionsToString(options) {
58744
+ if (!options)
58745
+ return "E:0_";
58746
+ switch (options.type) {
58747
+ case "non-indexed": return options.smooth ? "E:3_" : "";
58748
+ case "indexed": return options.smooth ? "E:4_" : "E:2_";
58749
+ case "compact": return options.smooth ? "E:6_" : "E:5_";
58750
+ default: throw new Error("Invalid tree Id");
58716
58751
  }
58717
- throw new Error("Invalid tree Id");
58718
58752
  }
58719
58753
  /** @internal */
58720
58754
  function getMaximumMajorTileFormatVersion(maxMajorVersion, formatVersion) {
@@ -58742,19 +58776,6 @@ var TreeFlags;
58742
58776
  TreeFlags[TreeFlags["OptimizeBRepProcessing"] = 4] = "OptimizeBRepProcessing";
58743
58777
  TreeFlags[TreeFlags["UseLargerTiles"] = 8] = "UseLargerTiles";
58744
58778
  })(TreeFlags || (TreeFlags = {}));
58745
- function compareEdgeOptions(a, b) {
58746
- if (typeof a !== typeof b)
58747
- return a ? 1 : -1;
58748
- if (typeof a === "boolean") {
58749
- (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(typeof b === "boolean");
58750
- return (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(a, b);
58751
- }
58752
- (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(typeof b === "object");
58753
- let cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(a.indexed, b.indexed);
58754
- if (0 === cmp)
58755
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(a.smooth, b.smooth);
58756
- return cmp;
58757
- }
58758
58779
  function animationIdToString(animationId) {
58759
58780
  return `A:${animationId}_`;
58760
58781
  }
@@ -58773,16 +58794,7 @@ function iModelTileTreeIdToString(modelId, treeId, options) {
58773
58794
  idStr = `${idStr}${animationIdToString(treeId.animationId)}`;
58774
58795
  else if (treeId.enforceDisplayPriority) // animation and priority are currently mutually exclusive
58775
58796
  flags |= TreeFlags.EnforceDisplayPriority;
58776
- let edges;
58777
- if (!treeId.edges) {
58778
- edges = "E:0_";
58779
- }
58780
- else {
58781
- if (!treeId.edges.smooth)
58782
- edges = treeId.edges.indexed ? "E:2_" : "";
58783
- else
58784
- edges = treeId.edges.indexed ? "E:4_" : "E:3_";
58785
- }
58797
+ const edges = edgeOptionsToString(treeId.edges);
58786
58798
  const sectionCut = treeId.sectionCut ? `S${treeId.sectionCut}s` : "";
58787
58799
  idStr = `${idStr}${edges}${sectionCut}`;
58788
58800
  }
@@ -95130,6 +95142,116 @@ function isGltf1Material(material) {
95130
95142
  }
95131
95143
 
95132
95144
 
95145
+ /***/ }),
95146
+
95147
+ /***/ "../../core/frontend/lib/esm/common/imdl/CompactEdges.js":
95148
+ /*!***************************************************************!*\
95149
+ !*** ../../core/frontend/lib/esm/common/imdl/CompactEdges.js ***!
95150
+ \***************************************************************/
95151
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
95152
+
95153
+ "use strict";
95154
+ __webpack_require__.r(__webpack_exports__);
95155
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
95156
+ /* harmony export */ "indexedEdgeParamsFromCompactEdges": () => (/* binding */ indexedEdgeParamsFromCompactEdges)
95157
+ /* harmony export */ });
95158
+ /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
95159
+ /* harmony import */ var _ImdlSchema__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ImdlSchema */ "../../core/frontend/lib/esm/common/imdl/ImdlSchema.js");
95160
+ /* harmony import */ var _render_primitives_EdgeParams__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../render/primitives/EdgeParams */ "../../core/frontend/lib/esm/common/render/primitives/EdgeParams.js");
95161
+ /* harmony import */ var _render_primitives_VertexIndices__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../render/primitives/VertexIndices */ "../../core/frontend/lib/esm/common/render/primitives/VertexIndices.js");
95162
+ /*---------------------------------------------------------------------------------------------
95163
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
95164
+ * See LICENSE.md in the project root for license terms and full copyright notice.
95165
+ *--------------------------------------------------------------------------------------------*/
95166
+ /** @packageDocumentation
95167
+ * @module Tiles
95168
+ */
95169
+
95170
+
95171
+
95172
+
95173
+ /** Iterate over the compact edges.
95174
+ * @note The same object is returned on each iteration, mutated in place.
95175
+ */
95176
+ function* compactEdgeIterator(visibilityFlags, vertexIndices, normalPairs) {
95177
+ let bitIndex = 0;
95178
+ let flagsIndex = 0;
95179
+ let normalIndex = 0;
95180
+ const output = { index0: 0, index1: 1 };
95181
+ for (let i = 0; i < vertexIndices.length; i++) {
95182
+ const visibility = (visibilityFlags[flagsIndex] >> bitIndex) & 3;
95183
+ bitIndex += 2;
95184
+ if (bitIndex === 8) {
95185
+ bitIndex = 0;
95186
+ flagsIndex++;
95187
+ }
95188
+ if (_ImdlSchema__WEBPACK_IMPORTED_MODULE_1__.ImdlEdgeVisibility.Hidden === visibility)
95189
+ continue;
95190
+ output.index0 = vertexIndices.decodeIndex(i);
95191
+ output.index1 = vertexIndices.decodeIndex(i % 3 === 2 ? i - 2 : i + 1);
95192
+ if (_ImdlSchema__WEBPACK_IMPORTED_MODULE_1__.ImdlEdgeVisibility.Silhouette === visibility) {
95193
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== normalPairs);
95194
+ output.normals = normalPairs[normalIndex++];
95195
+ }
95196
+ else {
95197
+ output.normals = undefined;
95198
+ }
95199
+ yield output;
95200
+ }
95201
+ }
95202
+ function setUint24(edgeTable, byteIndex, value) {
95203
+ edgeTable[byteIndex + 0] = value & 0x0000ff;
95204
+ edgeTable[byteIndex + 1] = (value & 0x00ff00) >>> 8;
95205
+ edgeTable[byteIndex + 2] = (value & 0xff0000) >>> 16;
95206
+ }
95207
+ /** Convert an [[ImdlCompactEdges]] to an [[IndexedEdgeParams]].
95208
+ * @internal
95209
+ */
95210
+ function indexedEdgeParamsFromCompactEdges(compact) {
95211
+ const numSilhouettes = compact.normalPairs?.length ?? 0;
95212
+ const numTotalEdges = compact.numVisibleEdges + numSilhouettes;
95213
+ if (numTotalEdges <= 0)
95214
+ return undefined;
95215
+ // Each edge is a quad consisting of six vertices. Each vertex is an identical 24-bit index into the lookup table.
95216
+ const indices = new _render_primitives_VertexIndices__WEBPACK_IMPORTED_MODULE_3__.VertexIndices(new Uint8Array(numTotalEdges * 6 * 3));
95217
+ for (let i = 0; i < numTotalEdges; i++)
95218
+ for (let j = 0; j < 6; j++)
95219
+ indices.setNthIndex(i * 6 + j, i);
95220
+ const { width, height, silhouettePadding, silhouetteStartByteIndex } = (0,_render_primitives_EdgeParams__WEBPACK_IMPORTED_MODULE_2__.calculateEdgeTableParams)(compact.numVisibleEdges, numSilhouettes, compact.maxEdgeTableDimension);
95221
+ const edgeTable = new Uint8Array(width * height * 4);
95222
+ let curVisibleIndex = 0;
95223
+ let curSilhouetteIndex = 0;
95224
+ for (const edge of compactEdgeIterator(compact.visibility, compact.vertexIndices, compact.normalPairs)) {
95225
+ if (undefined === edge.normals) {
95226
+ const index = curVisibleIndex++;
95227
+ const byteIndex = index * 6;
95228
+ setUint24(edgeTable, byteIndex, edge.index0);
95229
+ setUint24(edgeTable, byteIndex + 3, edge.index1);
95230
+ }
95231
+ else {
95232
+ const index = curSilhouetteIndex++;
95233
+ const byteIndex = silhouetteStartByteIndex + silhouettePadding + index * 10;
95234
+ setUint24(edgeTable, byteIndex, edge.index0);
95235
+ setUint24(edgeTable, byteIndex + 3, edge.index1);
95236
+ edgeTable[byteIndex + 6] = edge.normals & 0xff;
95237
+ edgeTable[byteIndex + 7] = (edge.normals & 0xff00) >>> 8;
95238
+ edgeTable[byteIndex + 8] = (edge.normals & 0xff0000) >>> 16;
95239
+ edgeTable[byteIndex + 9] = (edge.normals & 0xff000000) >>> 24;
95240
+ }
95241
+ }
95242
+ return {
95243
+ indices: indices.data,
95244
+ edges: {
95245
+ data: edgeTable,
95246
+ width,
95247
+ height,
95248
+ numSegments: compact.numVisibleEdges,
95249
+ silhouettePadding,
95250
+ },
95251
+ };
95252
+ }
95253
+
95254
+
95133
95255
  /***/ }),
95134
95256
 
95135
95257
  /***/ "../../core/frontend/lib/esm/common/imdl/ImdlModel.js":
@@ -95221,6 +95343,9 @@ function collectTransferables(document) {
95221
95343
 
95222
95344
  "use strict";
95223
95345
  __webpack_require__.r(__webpack_exports__);
95346
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
95347
+ /* harmony export */ "ImdlEdgeVisibility": () => (/* binding */ ImdlEdgeVisibility)
95348
+ /* harmony export */ });
95224
95349
  /*---------------------------------------------------------------------------------------------
95225
95350
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
95226
95351
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -95228,7 +95353,18 @@ __webpack_require__.r(__webpack_exports__);
95228
95353
  /** @packageDocumentation
95229
95354
  * @module Tiles
95230
95355
  */
95231
-
95356
+ /** As part of [[ImdlCompactEdges]], describes the visibility of an edge of a triangle.
95357
+ * @internal
95358
+ */
95359
+ var ImdlEdgeVisibility;
95360
+ (function (ImdlEdgeVisibility) {
95361
+ /** The edge is never visible. */
95362
+ ImdlEdgeVisibility[ImdlEdgeVisibility["Hidden"] = 0] = "Hidden";
95363
+ /** 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. */
95364
+ ImdlEdgeVisibility[ImdlEdgeVisibility["Silhouette"] = 1] = "Silhouette";
95365
+ /** The edge is always visible. */
95366
+ ImdlEdgeVisibility[ImdlEdgeVisibility["Visible"] = 2] = "Visible";
95367
+ })(ImdlEdgeVisibility || (ImdlEdgeVisibility = {}));
95232
95368
 
95233
95369
 
95234
95370
  /***/ }),
@@ -95258,6 +95394,7 @@ __webpack_require__.r(__webpack_exports__);
95258
95394
  /* harmony import */ var _render_primitives_VertexTableSplitter__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../render/primitives/VertexTableSplitter */ "../../core/frontend/lib/esm/common/render/primitives/VertexTableSplitter.js");
95259
95395
  /* harmony import */ var _render_AnimationNodeId__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../render/AnimationNodeId */ "../../core/frontend/lib/esm/common/render/AnimationNodeId.js");
95260
95396
  /* harmony import */ var _render_primitives_VertexIndices__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../render/primitives/VertexIndices */ "../../core/frontend/lib/esm/common/render/primitives/VertexIndices.js");
95397
+ /* harmony import */ var _CompactEdges__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./CompactEdges */ "../../core/frontend/lib/esm/common/imdl/CompactEdges.js");
95261
95398
  /*---------------------------------------------------------------------------------------------
95262
95399
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
95263
95400
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -95275,6 +95412,7 @@ __webpack_require__.r(__webpack_exports__);
95275
95412
 
95276
95413
 
95277
95414
 
95415
+
95278
95416
  /** Header preceding "glTF" data in iMdl tile. */
95279
95417
  class GltfHeader extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileHeader {
95280
95418
  get isValid() { return _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileFormat.Gltf === this.format; }
@@ -95777,13 +95915,28 @@ class Parser {
95777
95915
  },
95778
95916
  };
95779
95917
  }
95780
- parseEdges(imdl, displayParams) {
95918
+ parseCompactEdges(imdl, vertexIndices) {
95919
+ const visibility = this.findBuffer(imdl.visibility);
95920
+ if (!visibility)
95921
+ return undefined;
95922
+ const normals = undefined !== imdl.normalPairs ? this.findBuffer(imdl.normalPairs) : undefined;
95923
+ return (0,_CompactEdges__WEBPACK_IMPORTED_MODULE_10__.indexedEdgeParamsFromCompactEdges)({
95924
+ numVisibleEdges: imdl.numVisible,
95925
+ visibility,
95926
+ vertexIndices,
95927
+ normalPairs: normals ? new Uint32Array(normals.buffer, normals.byteOffset, normals.byteLength / 4) : undefined,
95928
+ maxEdgeTableDimension: this._options.maxVertexTableSize,
95929
+ });
95930
+ }
95931
+ parseEdges(imdl, displayParams, indices) {
95781
95932
  if (!imdl)
95782
95933
  return undefined;
95783
95934
  const segments = imdl.segments ? this.parseSegmentEdges(imdl.segments) : undefined;
95784
95935
  const silhouettes = imdl.silhouettes ? this.parseSilhouetteEdges(imdl.silhouettes) : undefined;
95785
- const indexed = imdl.indexed ? this.parseIndexedEdges(imdl.indexed) : undefined;
95786
95936
  const polylines = imdl.polylines ? this.parseTesselatedPolyline(imdl.polylines) : undefined;
95937
+ let indexed = imdl.indexed ? this.parseIndexedEdges(imdl.indexed) : undefined;
95938
+ if (!indexed && imdl.compact)
95939
+ indexed = this.parseCompactEdges(imdl.compact, new _render_primitives_VertexIndices__WEBPACK_IMPORTED_MODULE_9__.VertexIndices(indices));
95787
95940
  if (!segments && !silhouettes && !indexed && !polylines)
95788
95941
  return undefined;
95789
95942
  return {
@@ -95870,7 +96023,7 @@ class Parser {
95870
96023
  surface,
95871
96024
  isPlanar,
95872
96025
  auxChannels: this.parseAuxChannelTable(docPrimitive),
95873
- edges: this.parseEdges(docPrimitive.edges, displayParams),
96026
+ edges: this.parseEdges(docPrimitive.edges, displayParams, surface.indices),
95874
96027
  },
95875
96028
  };
95876
96029
  }
@@ -97907,6 +98060,7 @@ __webpack_require__.r(__webpack_exports__);
97907
98060
  /* harmony export */ "ImageryMapTile": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_125__.ImageryMapTile),
97908
98061
  /* harmony export */ "ImageryMapTileTree": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_125__.ImageryMapTileTree),
97909
98062
  /* harmony export */ "ImageryTileTreeState": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_125__.ImageryTileTreeState),
98063
+ /* harmony export */ "ImdlEdgeVisibility": () => (/* reexport safe */ _common_imdl_ImdlSchema__WEBPACK_IMPORTED_MODULE_15__.ImdlEdgeVisibility),
97910
98064
  /* harmony export */ "ImdlReader": () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_125__.ImdlReader),
97911
98065
  /* harmony export */ "IndexBuffer": () => (/* reexport safe */ _common_render_primitives_VertexTableSplitter__WEBPACK_IMPORTED_MODULE_29__.IndexBuffer),
97912
98066
  /* harmony export */ "InputCollector": () => (/* reexport safe */ _tools_Tool__WEBPACK_IMPORTED_MODULE_135__.InputCollector),
@@ -104399,7 +104553,7 @@ function createEdgeParams(meshArgs, maxWidth) {
104399
104553
  let segments;
104400
104554
  let silhouettes;
104401
104555
  let indexed;
104402
- if (_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.tileAdmin.enableIndexedEdges) {
104556
+ if ("non-indexed" !== _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.tileAdmin.edgeOptions.type) {
104403
104557
  indexed = buildIndexedEdges(args, !doJoints, maxWidth ?? _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.renderSystem.maxTextureSize);
104404
104558
  }
104405
104559
  else {
@@ -136352,7 +136506,7 @@ class GraphicsTile extends _internal__WEBPACK_IMPORTED_MODULE_4__.Tile {
136352
136506
  location: this.tree.iModelTransform.toJSON(),
136353
136507
  contentFlags: idProvider.contentFlags,
136354
136508
  omitEdges: !this.tree.edgeOptions,
136355
- edgeType: this.tree.edgeOptions && this.tree.edgeOptions.indexed ? 2 : 1,
136509
+ edgeType: this.tree.edgeOptions && "non-indexed" !== this.tree.edgeOptions.type ? 2 : 1,
136356
136510
  smoothPolyfaceEdges: this.tree.edgeOptions && this.tree.edgeOptions.smooth,
136357
136511
  clipToProjectExtents: true,
136358
136512
  sectionCut: this.tree.stringifiedSectionClip,
@@ -138736,6 +138890,7 @@ class IModelTileTree extends _internal__WEBPACK_IMPORTED_MODULE_6__.TileTree {
138736
138890
  * used by draw().
138737
138891
  */
138738
138892
  this._numStaticTilesSelected = 0;
138893
+ this.iModelTileTreeId = treeId;
138739
138894
  this.contentIdQualifier = params.contentIdQualifier;
138740
138895
  this.geometryGuid = params.geometryGuid;
138741
138896
  this.tileScreenSize = params.tileScreenSize;
@@ -143931,8 +144086,10 @@ class TileAdmin {
143931
144086
  this._defaultTileSizeModifier = (undefined !== options.defaultTileSizeModifier && options.defaultTileSizeModifier > 0) ? options.defaultTileSizeModifier : 1.0;
143932
144087
  this._retryInterval = undefined !== options.retryInterval ? options.retryInterval : 1000;
143933
144088
  this._enableInstancing = options.enableInstancing ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.enableInstancing;
143934
- this._enableIndexedEdges = options.enableIndexedEdges ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.enableIndexedEdges;
143935
- this._generateAllPolyfaceEdges = options.generateAllPolyfaceEdges ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.generateAllPolyfaceEdges;
144089
+ this.edgeOptions = {
144090
+ type: false === options.enableIndexedEdges ? "non-indexed" : "compact",
144091
+ smooth: options.generateAllPolyfaceEdges ?? true,
144092
+ };
143936
144093
  this.enableImprovedElision = options.enableImprovedElision ?? _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.defaultTileOptions.enableImprovedElision;
143937
144094
  this.enableFrontendScheduleScripts = options.enableFrontendScheduleScripts ?? false;
143938
144095
  this.decodeImdlInWorker = options.decodeImdlInWorker ?? true;
@@ -144024,18 +144181,6 @@ class TileAdmin {
144024
144181
  }
144025
144182
  /** @internal */
144026
144183
  get enableInstancing() { return this._enableInstancing; }
144027
- /** @internal */
144028
- get enableIndexedEdges() { return this._enableIndexedEdges; }
144029
- /** @internal */
144030
- get generateAllPolyfaceEdges() { return this._generateAllPolyfaceEdges; }
144031
- set generateAllPolyfaceEdges(val) { this._generateAllPolyfaceEdges = val; }
144032
- /** @internal */
144033
- get edgeOptions() {
144034
- return {
144035
- indexed: this.enableIndexedEdges,
144036
- smooth: this.generateAllPolyfaceEdges,
144037
- };
144038
- }
144039
144184
  /** 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),
144040
144185
  * return the maximum *major* format version to be used to request tile content from the backend.
144041
144186
  * @see [[TileAdmin.Props.maximumMajorTileFormatVersion]]
@@ -144350,7 +144495,7 @@ class TileAdmin {
144350
144495
  */
144351
144496
  async requestElementGraphics(iModel, requestProps) {
144352
144497
  if (true !== requestProps.omitEdges && undefined === requestProps.edgeType)
144353
- requestProps = { ...requestProps, edgeType: this.enableIndexedEdges ? 2 : 1 };
144498
+ requestProps = { ...requestProps, edgeType: "non-indexed" !== this.edgeOptions.type ? 2 : 1 };
144354
144499
  // For backwards compatibility, these options default to true in the backend. Explicitly set them to false in (newer) frontends if not supplied.
144355
144500
  if (undefined === requestProps.quantizePositions || undefined === requestProps.useAbsolutePositions) {
144356
144501
  requestProps = {
@@ -149603,18 +149748,25 @@ class ImageryMapLayerTreeSupplier {
149603
149748
  * This allows the ID to serve as a lookup key to find the corresponding TileTree.
149604
149749
  */
149605
149750
  compareTileTreeIds(lhs, rhs) {
149606
- let cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.settings.url, rhs.settings.url);
149751
+ let cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.settings.formatId, rhs.settings.formatId);
149607
149752
  if (0 === cmp) {
149608
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.settings.userName, rhs.settings.userName);
149753
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.settings.url, rhs.settings.url);
149609
149754
  if (0 === cmp) {
149610
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.settings.password, rhs.settings.password);
149755
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.settings.userName, rhs.settings.userName);
149611
149756
  if (0 === cmp) {
149612
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(lhs.settings.transparentBackground, rhs.settings.transparentBackground);
149757
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.settings.password, rhs.settings.password);
149613
149758
  if (0 === cmp) {
149614
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.settings.subLayers.length, rhs.settings.subLayers.length);
149759
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(lhs.settings.transparentBackground, rhs.settings.transparentBackground);
149615
149760
  if (0 === cmp) {
149616
- for (let i = 0; i < lhs.settings.subLayers.length && 0 === cmp; i++)
149617
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(lhs.settings.subLayers[i].visible, rhs.settings.subLayers[i].visible);
149761
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.settings.subLayers.length, rhs.settings.subLayers.length);
149762
+ if (0 === cmp) {
149763
+ for (let i = 0; i < lhs.settings.subLayers.length && 0 === cmp; i++) {
149764
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.settings.subLayers[i].name, rhs.settings.subLayers[i].name);
149765
+ if (0 === cmp) {
149766
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleans)(lhs.settings.subLayers[i].visible, rhs.settings.subLayers[i].visible);
149767
+ }
149768
+ }
149769
+ }
149618
149770
  }
149619
149771
  }
149620
149772
  }
@@ -180053,6 +180205,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePrimitive
180053
180205
  /**
180054
180206
  * Return a clone of this arc, projected to given z value.
180055
180207
  * * If `z` is omitted, the clone is at the z of the center.
180208
+ * * This function projects the arc into a plane parallel to xy-plane.
180056
180209
  * * Note that projection to fixed z can change circle into ellipse (and (rarely) ellipse to circle)
180057
180210
  */
180058
180211
  cloneAtZ(z) {
@@ -182067,10 +182220,12 @@ __webpack_require__.r(__webpack_exports__);
182067
182220
  * A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:
182068
182221
  * - `CurveChain` is a (non-instantiable) intermediate class for a sequence of `CurvePrimitive` joining head-to-tail.
182069
182222
  * The two instantiable forms of `CurveChain` are
182070
- * - `Path` - A chain not required to close, and not enclosing a planar area
182071
- * - `Loop` - A chain required to close from last to first so that a planar area is enclosed.
182072
- * - `ParityRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by parity rules
182073
- * - `UnionRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by union rules
182223
+ * - `Path` - A chain not required to close and not enclosing a planar area (so curves do not have to be on the
182224
+ * same plane).
182225
+ * - `Loop` - A chain required to close from last to first so that a planar area is enclosed (so curves have to
182226
+ * be on the same plane).
182227
+ * - `ParityRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by parity rules.
182228
+ * - `UnionRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by union rules.
182074
182229
  * - `BagOfCurves` -- a collection of `AnyCurve` with no implied structure.
182075
182230
  *
182076
182231
  * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.
@@ -182110,7 +182265,7 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
182110
182265
  * Return the max gap between adjacent primitives in Path and Loop collections.
182111
182266
  * * In a Path, gaps are computed between consecutive primitives.
182112
182267
  * * In a Loop, gaps are computed between consecutive primitives and between last and first.
182113
- * * gaps are NOT computed between consecutive CurvePrimitives in "unstructured" collections. The type is
182268
+ * * Gaps are NOT computed between consecutive CurvePrimitives in "unstructured" collections. The type is
182114
182269
  * "unstructured" so gaps should not be semantically meaningful.
182115
182270
  */
182116
182271
  maxGap() {
@@ -182132,11 +182287,15 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
182132
182287
  cloneTransformed(transform) {
182133
182288
  return _internalContexts_CloneCurvesContext__WEBPACK_IMPORTED_MODULE_7__.CloneCurvesContext.clone(this, transform);
182134
182289
  }
182135
- /** Create a deep copy with all linestrings expanded to multiple LineSegment3d. */
182290
+ /** Create a deep copy with all linestrings broken down into multiple LineSegment3d. */
182136
182291
  cloneWithExpandedLineStrings() {
182137
182292
  return _internalContexts_CloneWithExpandedLineStrings__WEBPACK_IMPORTED_MODULE_8__.CloneWithExpandedLineStrings.clone(this);
182138
182293
  }
182139
- /** Recurse through children to collect CurvePrimitive's in flat array. */
182294
+ /**
182295
+ * Push all CurvePrimitives contained in the instance onto the `results` array.
182296
+ * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives
182297
+ * of the Loop are pushed onto `results`.
182298
+ */
182140
182299
  collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings = false) {
182141
182300
  if (this.children) {
182142
182301
  for (const child of this.children) {
@@ -182148,10 +182307,12 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
182148
182307
  }
182149
182308
  }
182150
182309
  /**
182151
- * Return an array containing only the curve primitives.
182310
+ * Return an array containing all CurvePrimitives in the instance.
182311
+ * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives of
182312
+ * the Loop are pushed onto the returned array.
182152
182313
  * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without
182153
- * clearing the array.)
182154
- * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,
182314
+ * clearing the array).
182315
+ * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,
182155
182316
  * it recurses to its (otherwise hidden) children.
182156
182317
  */
182157
182318
  collectCurvePrimitives(collectorArray, smallestPossiblePrimitives = false, explodeLineStrings = false) {
@@ -182166,7 +182327,7 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
182166
182327
  * * `UnionRegion`
182167
182328
  */
182168
182329
  get isAnyRegionType() {
182169
- return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 5 || this.dgnBoundaryType() === 4;
182330
+ return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 4 || this.dgnBoundaryType() === 5;
182170
182331
  }
182171
182332
  /** Return true for a `Path`, i.e. a chain of curves joined head-to-tail */
182172
182333
  get isOpenPath() {
@@ -182174,12 +182335,16 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
182174
182335
  }
182175
182336
  /**
182176
182337
  * Return true for a single-loop planar region type, i.e. `Loop`.
182177
- * * This is _not- a test for physical closure of a `Path`
182338
+ * * This is NOT a test for physical closure of a `Path`.
182178
182339
  */
182179
182340
  get isClosedPath() {
182180
182341
  return this.dgnBoundaryType() === 2;
182181
182342
  }
182182
- /** Extend (increase) `rangeToExtend` as needed to include these curves (optionally transformed) */
182343
+ /**
182344
+ * Extend (increase) the given range as needed to encompass all curves in the curve collection.
182345
+ * @param rangeToExtend the given range.
182346
+ * @param transform if supplied, the range is extended with transformed curves.
182347
+ */
182183
182348
  extendRange(rangeToExtend, transform) {
182184
182349
  const children = this.children;
182185
182350
  if (children) {
@@ -182189,8 +182354,8 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
182189
182354
  }
182190
182355
  }
182191
182356
  /**
182192
- * * Find any curve primitive in the source.
182193
- * * Evaluate it at a fraction (which by default is an interior fraction)
182357
+ * Find any CurvePrimitive in the source and evaluate it at the given fraction.
182358
+ * * The first CurvePrimitive found is evaluated. Any other CurvePrimitives are ignored.
182194
182359
  * @param source containing `CurvePrimitive` or `CurveCollection`
182195
182360
  * @param fraction fraction to use in `curve.fractionToPoint(fraction)`
182196
182361
  */
@@ -182222,19 +182387,20 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
182222
182387
  }
182223
182388
  /**
182224
182389
  * Shared base class for use by both open and closed paths.
182225
- * - A `CurveChain` contains only curvePrimitives. No other paths, loops, or regions allowed.
182226
- * - A single entry in the chain can in fact contain multiple curve primitives if the entry itself is (for instance)
182227
- * `CurveChainWithDistanceIndex`
182228
- * which presents itself (through method interface) as a CurvePrimitive with well defined mappings from fraction
182229
- * to xyz, but in fact does all the
182230
- * calculations over multiple primitives.
182231
- * - The specific derived classes are `Path` and `Loop`
182232
- * - `CurveChain` is an intermediate class. It is not instantiable on its own.
182390
+ * * A `CurveChain` contains only CurvePrimitives. No other paths, loops, or regions allowed.
182391
+ * * The specific derived classes are `Path` and `Loop`
182392
+ * * `CurveChain` is an intermediate class. It is not instantiable on its own.
182393
+ * * The related class `CurveChainWithDistanceIndex` is a `CurvePrimitive` whose API presents well-defined mappings
182394
+ * from fraction to xyz over the entire chain, but in fact does all the calculations over multiple primitives.
182233
182395
  * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.
182234
182396
  * @public
182235
182397
  */
182236
182398
  class CurveChain extends CurveCollection {
182237
- constructor() { super(); this._curves = []; }
182399
+ /** Constructor */
182400
+ constructor() {
182401
+ super();
182402
+ this._curves = [];
182403
+ }
182238
182404
  /** Return the array of `CurvePrimitive` */
182239
182405
  get children() {
182240
182406
  if (this._curves === undefined)
@@ -182242,7 +182408,7 @@ class CurveChain extends CurveCollection {
182242
182408
  return this._curves;
182243
182409
  }
182244
182410
  /**
182245
- * Return the `[index]` curve primitive, optionally using `modulo` to map`index` to the cyclic indexing.
182411
+ * Return the curve primitive at the given `index`, optionally using `modulo` to map `index` to the cyclic indexing.
182246
182412
  * * In particular, `-1` is the final curve.
182247
182413
  * @param index cyclic index
182248
182414
  */
@@ -182250,8 +182416,7 @@ class CurveChain extends CurveCollection {
182250
182416
  const n = this.children.length;
182251
182417
  if (n === 0)
182252
182418
  return undefined;
182253
- /** Try simplest non-cyclic access first . . */
182254
- if (index >= 0 && index < n)
182419
+ if (index >= 0 && index < n) // try simplest non-cyclic access first
182255
182420
  return this.children[index];
182256
182421
  if (cyclic) {
182257
182422
  const index2 = _Geometry__WEBPACK_IMPORTED_MODULE_10__.Geometry.modulo(index, n);
@@ -182264,6 +182429,11 @@ class CurveChain extends CurveCollection {
182264
182429
  * @param options tolerance parameters controlling the stroking.
182265
182430
  */
182266
182431
  getPackedStrokes(options) {
182432
+ /**
182433
+ * The object returned by "cloneStroked" has the same type (Loop or Path) but instead of a chain of
182434
+ * CurvePrimitives as children, it has a single LineString3d child. "getPackedStrokes" just returns
182435
+ * the points of that LineString3d using "packedPoints".
182436
+ */
182267
182437
  const tree = this.cloneStroked(options);
182268
182438
  if (tree instanceof CurveChain) {
182269
182439
  const children = tree.children;
@@ -182275,16 +182445,6 @@ class CurveChain extends CurveCollection {
182275
182445
  }
182276
182446
  return undefined;
182277
182447
  }
182278
- /* EDL 01/20 Path, Loop, CurveChainWithDistanceIndex all implement this.
182279
- Reducing it to abstract.
182280
- Hypothetically, a derived class in the wild might be depending on this.
182281
- {
182282
- const strokes = LineString3d.create();
182283
- for (const curve of this.children)
182284
- curve.emitStrokes(strokes, options);
182285
- return strokes;
182286
- }
182287
- */
182288
182448
  /**
182289
182449
  * Add a child curve.
182290
182450
  * * Returns false if the given child is not a CurvePrimitive.
@@ -182317,7 +182477,7 @@ class CurveChain extends CurveCollection {
182317
182477
  this._curves.reverse();
182318
182478
  }
182319
182479
  /**
182320
- * Return the index where target is found in the array of children
182480
+ * Return the index where target is found in the array of children.
182321
182481
  * @param alsoSearchProxies whether to also check proxy curves of the children
182322
182482
  */
182323
182483
  childIndex(target, alsoSearchProxies) {
@@ -182336,7 +182496,7 @@ class CurveChain extends CurveCollection {
182336
182496
  }
182337
182497
  return undefined;
182338
182498
  }
182339
- /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive. */
182499
+ /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive. */
182340
182500
  primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(index, fraction, cyclic = false, result) {
182341
182501
  const primitive = this.cyclicCurvePrimitive(index, cyclic);
182342
182502
  if (primitive) {
@@ -185568,7 +185728,7 @@ var CurveIntervalRole;
185568
185728
  (function (CurveIntervalRole) {
185569
185729
  /** This point is an isolated point NOT at a primary vertex. */
185570
185730
  CurveIntervalRole[CurveIntervalRole["isolated"] = 0] = "isolated";
185571
- /** This point is an isolated vertex hit */
185731
+ /** This point is an isolated vertex hit */
185572
185732
  CurveIntervalRole[CurveIntervalRole["isolatedAtVertex"] = 1] = "isolatedAtVertex";
185573
185733
  /** This is the beginning of an interval */
185574
185734
  CurveIntervalRole[CurveIntervalRole["intervalStart"] = 10] = "intervalStart";
@@ -185583,11 +185743,11 @@ var CurveIntervalRole;
185583
185743
  */
185584
185744
  var CurveSearchStatus;
185585
185745
  (function (CurveSearchStatus) {
185586
- /** unimplemented or zero length curve */
185746
+ /** Unimplemented or zero length curve */
185587
185747
  CurveSearchStatus[CurveSearchStatus["error"] = 0] = "error";
185588
- /** complete success of search */
185748
+ /** Complete success of search */
185589
185749
  CurveSearchStatus[CurveSearchStatus["success"] = 1] = "success";
185590
- /** search ended prematurely (e.g. at incomplete distance moved) at start or end of curve */
185750
+ /** Search ended prematurely (e.g. at incomplete distance moved) at start or end of curve */
185591
185751
  CurveSearchStatus[CurveSearchStatus["stoppedAtBoundary"] = 2] = "stoppedAtBoundary";
185592
185752
  })(CurveSearchStatus || (CurveSearchStatus = {}));
185593
185753
  /**
@@ -185610,7 +185770,7 @@ function optionalVectorUpdate(source, result) {
185610
185770
  * @public
185611
185771
  */
185612
185772
  class CurveLocationDetail {
185613
- /** constructor */
185773
+ /** Constructor */
185614
185774
  constructor() {
185615
185775
  this.pointQ = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
185616
185776
  this.fraction = 0;
@@ -185708,8 +185868,10 @@ class CurveLocationDetail {
185708
185868
  return this.setFP(fraction, ray.origin, ray.direction, a);
185709
185869
  }
185710
185870
  /** Set the CurvePrimitive pointer, leaving all other properties untouched. */
185711
- setCurve(curve) { this.curve = curve; }
185712
- /** record the distance from the CurveLocationDetail's point to the parameter point. */
185871
+ setCurve(curve) {
185872
+ this.curve = curve;
185873
+ }
185874
+ /** Record the distance from the CurveLocationDetail's point to the parameter point. */
185713
185875
  setDistanceTo(point) {
185714
185876
  this.a = this.point.distance(point);
185715
185877
  }
@@ -186112,7 +186274,7 @@ class CurvePrimitive extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__.Geometr
186112
186274
  }
186113
186275
  /**
186114
186276
  * Returns a (high accuracy) range of the curve between fractional positions
186115
- * * Default implementation returns the range of the curve from clonePartialCurve
186277
+ * * Default implementation returns the range of the curve from clonePartialCurve.
186116
186278
  */
186117
186279
  rangeBetweenFractions(fraction0, fraction1, transform) {
186118
186280
  return this.rangeBetweenFractionsByClone(fraction0, fraction1, transform);
@@ -186141,6 +186303,7 @@ class CurvePrimitive extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__.Geometr
186141
186303
  * @param fraction0 start fraction for evaluation
186142
186304
  * @param fraction1 end fraction for evaluation
186143
186305
  * @param count number of points to evaluate
186306
+ * @param transform optional transform to be applied to the curve
186144
186307
  * @param extrapolationFactor if positive, evaluate again at interval midpoints and apply this fraction multiplier
186145
186308
  * to any increase in size.
186146
186309
  */
@@ -186228,8 +186391,8 @@ class CurvePrimitive extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__.Geometr
186228
186391
  * * `curveStartState` = `CurveSearchStatus.error`
186229
186392
  * @param startFraction fractional position where the move starts
186230
186393
  * @param signedDistance distance to move. Negative distance is backwards in the fraction space
186231
- * @param allowExtension if true, all the move to go beyond the startPoint or endpoint of the curve. If false, do not
186232
- * allow movement beyond the startPoint or endpoint
186394
+ * @param allowExtension if true, allow the move to go beyond the startPoint or endpoint of the curve. If false,
186395
+ * do not allow movement beyond the startPoint or endpoint
186233
186396
  * @param result optional result.
186234
186397
  * @returns A CurveLocationDetail annotated as above. Note that if the curve does not support the calculation, there is
186235
186398
  * still a result which contains the point at the input startFraction, with failure indicated in the `curveStartState`
@@ -186938,8 +187101,8 @@ __webpack_require__.r(__webpack_exports__);
186938
187101
  * * A 3d line segment represented by its start and end coordinates
186939
187102
  * * startPoint
186940
187103
  * * endPoint
186941
- * * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. either of these
186942
- * equivalent forms to map fraction `f` to a point `X(f)`
187104
+ * * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these
187105
+ * equivalent forms maps fraction `f` to a point `X(f)`:
186943
187106
  * ```
186944
187107
  * equation
186945
187108
  * X(f) = P_0 + f*(P_1 - P_0)\newline
@@ -186954,14 +187117,14 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
186954
187117
  }
186955
187118
  /**
186956
187119
  * Return REFERENCE to the start point of this segment.
186957
- * * (This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point
187120
+ * * This is distinct from the `CurvePrimitive` abstract method `startPoint()` which creates a returned point.
186958
187121
  */
186959
187122
  get point0Ref() {
186960
187123
  return this._point0;
186961
187124
  }
186962
187125
  /**
186963
187126
  * Return REFERENCE to the end point of this segment.
186964
- * * (This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point
187127
+ * * This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point.
186965
187128
  */
186966
187129
  get point1Ref() {
186967
187130
  return this._point1;
@@ -188361,7 +188524,7 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
188361
188524
  return ls;
188362
188525
  }
188363
188526
  /**
188364
- * Evaluate a curve at uniform fractions. Append the evaluations to this linestring.
188527
+ * Evaluate a curve at uniform fractions. Append the evaluations to this linestring.
188365
188528
  * @param curve primitive to evaluate.
188366
188529
  * @param numStrokes number of strokes (edges).
188367
188530
  * @param fraction0 starting fraction coordinate
@@ -191158,8 +191321,8 @@ var RegionBinaryOpType;
191158
191321
  * * `ParityRegion` -- a collection of loops, interpreted by parity rules.
191159
191322
  * The common "One outer loop and many Inner loops" is a parity region.
191160
191323
  * * `UnionRegion` -- a collection of `Loop` and `ParityRegion` objects understood as a (probably disjoint) union.
191161
- * * Most of the methods in this class ignore z-coordinates, so callers should ensure that input geometry has been
191162
- * rotated parallel to the xy-plane.
191324
+ * * **NOTE:** Most of the methods in this class ignore z-coordinates, so callers should ensure that input geometry has
191325
+ * been rotated parallel to the xy-plane.
191163
191326
  * @public
191164
191327
  */
191165
191328
  class RegionOps {
@@ -191409,34 +191572,29 @@ class RegionOps {
191409
191572
  return RegionOps.sortOuterAndHoleLoopsXY(allLoops);
191410
191573
  }
191411
191574
  /**
191412
- * Construct a wire (not area!!) that is offset from given polyline or polygon.
191413
- * * This is a simple wire offset, not an area.
191575
+ * Construct a wire that is offset from the given polyline or polygon.
191576
+ * * This is a simple wire offset, not an area offset.
191577
+ * * Since z-coordinates are ignored, for best results the input points should lie in (a plane parallel to)
191578
+ * the xy-plane.
191414
191579
  * * The construction algorithm attempts to eliminate some self-intersections within the offsets, but does not
191415
191580
  * guarantee a simple area offset.
191416
- * * The construction algorithm is subject to being changed, resulting in different (hopefully better)
191417
- * self-intersection behavior on the future.
191581
+ * * If offsetDistance is given as a number, default OffsetOptions are applied.
191582
+ * * See [[JointOptions]] class doc for offset construction rules.
191418
191583
  * @param points a single loop or path
191419
191584
  * @param wrap true to include wraparound
191420
- * @param offsetDistance distance of offset from wire. Positive is left.
191585
+ * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or JointOptions
191586
+ * object.
191421
191587
  */
191422
- static constructPolygonWireXYOffset(points, wrap, offsetDistance) {
191588
+ static constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions) {
191423
191589
  const context = new _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_17__.PolygonWireOffsetContext();
191424
- return context.constructPolygonWireXYOffset(points, wrap, offsetDistance);
191590
+ return context.constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions);
191425
191591
  }
191426
191592
  /**
191427
191593
  * Construct curves that are offset from a Path or Loop as viewed in xy-plane (ignoring z).
191428
191594
  * * The construction will remove "some" local effects of features smaller than the offset distance, but will
191429
191595
  * not detect self intersection among widely separated edges.
191430
191596
  * * If offsetDistance is given as a number, default OffsetOptions are applied.
191431
- * * When the offset needs to do an "outside" turn, the first applicable construction is applied:
191432
- * * If the turn is larger than `options.minArcDegrees`, a circular arc is constructed.
191433
- * * If the turn is less than or equal to `options.maxChamferTurnDegrees`, extend curves along tangent to
191434
- * single intersection point.
191435
- * * If the turn is larger than `options.maxChamferDegrees`, the turn is constructed as a sequence of straight
191436
- * lines that are:
191437
- * * outside the arc
191438
- * * have uniform turn angle less than `options.maxChamferDegrees`
191439
- * * each line segment (except first and last) touches the arc at its midpoint.
191597
+ * * See [[JointOptions]] class doc for offset construction rules.
191440
191598
  * @param curves base curves.
191441
191599
  * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
191442
191600
  */
@@ -192611,12 +192769,16 @@ class StrokeOptions {
192611
192769
  get needNormals() {
192612
192770
  return this._needNormals !== undefined ? this._needNormals : false;
192613
192771
  }
192614
- set needNormals(value) { this._needNormals = value; }
192772
+ set needNormals(value) {
192773
+ this._needNormals = value;
192774
+ }
192615
192775
  /** Whether twoSided is requested. */
192616
192776
  get needTwoSided() {
192617
192777
  return this._needTwoSided !== undefined ? this._needTwoSided : false;
192618
192778
  }
192619
- set needTwoSided(value) { this._needTwoSided = value; }
192779
+ set needTwoSided(value) {
192780
+ this._needTwoSided = value;
192781
+ }
192620
192782
  /** Ask if angleTol is specified */
192621
192783
  get hasAngleTol() {
192622
192784
  return this.angleTol !== undefined && Math.abs(this.angleTol.radians) > 0.0;
@@ -194335,7 +194497,7 @@ __webpack_require__.r(__webpack_exports__);
194335
194497
 
194336
194498
 
194337
194499
  /**
194338
- * Classification of contortions at a joint.
194500
+ * Classification of how the joint is constructed.
194339
194501
  * @internal
194340
194502
  */
194341
194503
  var JointMode;
@@ -194348,26 +194510,44 @@ var JointMode;
194348
194510
  JointMode[JointMode["Gap"] = 4] = "Gap";
194349
194511
  })(JointMode || (JointMode = {}));
194350
194512
  /**
194351
- * * Control parameters for joint construction.
194352
- * * Decision order is:
194353
- * * if turn angle is greater than minArcDegrees, make an arc.
194354
- * * if turn angle is less than or equal maxChamferTurnDegrees, extend curves along tangent to single intersection point.
194355
- * * if turn angle is greater than maxChamferTurnDegrees, construct multiple lines that are tangent to the turn circle "from the outside",
194356
- * with each equal turn less than maxChamferTurnDegrees.
194357
- * * otherwise make single edge.
194513
+ * Control parameters for joint construction.
194514
+ * * Define a "joint" as the common point between adjacent segments of the input curve.
194515
+ * * Define the "turn angle" at a joint to be the angle in [0,pi] between the first derivatives (tangents) of
194516
+ * the segments at the joint.
194517
+ * * When creating offsets, if an offset needs to do an "outside" turn, the first applicable construction is applied:
194518
+ * * If the turn angle is larger than `options.minArcDegrees`, a circular arc is constructed to offset the joint.
194519
+ * * If the turn angle is less than or equal to `options.maxChamferTurnDegrees`, extend curves along tangent to
194520
+ * single intersection point (to create a sharp corner).
194521
+ * * If the turn angle is larger than `options.maxChamferDegrees`, the joint is offset with a line string whose edges:
194522
+ * * lie outside the arc that would have been created by the first construction
194523
+ * * have uniform turn angle less than `options.maxChamferDegrees`
194524
+ * * touch the arc at their midpoint (except first and last edge).
194358
194525
  * @public
194359
194526
  */
194360
194527
  class JointOptions {
194361
- /** Construct JointOptions.
194528
+ /**
194529
+ * Construct JointOptions.
194362
194530
  * * leftOffsetDistance is required
194363
194531
  * * minArcDegrees and maxChamferDegrees are optional.
194364
194532
  */
194365
- constructor(leftOffsetDistance, minArcDegrees = 180, maxChamferDegrees = 90, preserveEllipticalArcs = false) {
194366
- /** smallest arc to construct.
194367
- * * If this control angle is large, arcs are never created.
194533
+ constructor(leftOffsetDistance, minArcDegrees = 180, maxChamferDegrees = 90, preserveEllipticalArcs = false, allowSharpestCorners = false) {
194534
+ /**
194535
+ * Smallest arc to construct.
194536
+ * * If this control angle is 180 degrees or more, arcs are never created.
194368
194537
  */
194369
194538
  this.minArcDegrees = 180.0;
194539
+ /** Largest turn angle at which to construct a sharp corner, or largest turn angle in a multi-segment chamfer. */
194370
194540
  this.maxChamferTurnDegrees = 90;
194541
+ /**
194542
+ * Whether to remove the internal turn angle upper bound for sharp corner construction.
194543
+ * * By default, a sharp corner is not created at a joint when the turn angle is too large, so as to avoid offsets whose
194544
+ * ranges blow up. Internally, this is implemented by applying an upper bound of 120 degrees to `maxChamferTurnDegrees`.
194545
+ * * When `allowSharpestCorners` is true, this internal upper bound is removed, allowing sharp corners for turn angles
194546
+ * up to `maxChamferTurnDegrees`.
194547
+ * * Thus, if you know your input turn angles are no greater than `maxChamferTurnDegrees`, you can create an offset
194548
+ * with sharp corners at each joint by setting `minArcDegrees` to 180 and `allowSharpestCorners` to true.
194549
+ */
194550
+ this.allowSharpestCorners = false;
194371
194551
  /** Offset distance, positive to left of base curve. */
194372
194552
  this.leftOffsetDistance = 0;
194373
194553
  /** Whether to offset elliptical arcs as elliptical arcs (true) or as B-spline curves (false, default). */
@@ -194376,10 +194556,11 @@ class JointOptions {
194376
194556
  this.minArcDegrees = minArcDegrees;
194377
194557
  this.maxChamferTurnDegrees = maxChamferDegrees;
194378
194558
  this.preserveEllipticalArcs = preserveEllipticalArcs;
194559
+ this.allowSharpestCorners = allowSharpestCorners;
194379
194560
  }
194380
194561
  /** Return a deep clone. */
194381
194562
  clone() {
194382
- return new JointOptions(this.leftOffsetDistance, this.minArcDegrees, this.maxChamferTurnDegrees, this.preserveEllipticalArcs);
194563
+ return new JointOptions(this.leftOffsetDistance, this.minArcDegrees, this.maxChamferTurnDegrees, this.preserveEllipticalArcs, this.allowSharpestCorners);
194383
194564
  }
194384
194565
  /** Copy values of input options */
194385
194566
  setFrom(other) {
@@ -194387,6 +194568,7 @@ class JointOptions {
194387
194568
  this.minArcDegrees = other.minArcDegrees;
194388
194569
  this.maxChamferTurnDegrees = other.maxChamferTurnDegrees;
194389
194570
  this.preserveEllipticalArcs = other.preserveEllipticalArcs;
194571
+ this.allowSharpestCorners = other.allowSharpestCorners;
194390
194572
  }
194391
194573
  /**
194392
194574
  * Parse a number or JointOptions up to JointOptions:
@@ -194397,17 +194579,22 @@ class JointOptions {
194397
194579
  static create(leftOffsetDistanceOrOptions) {
194398
194580
  if (leftOffsetDistanceOrOptions instanceof JointOptions)
194399
194581
  return leftOffsetDistanceOrOptions;
194400
- // if (Number.isFinite(leftOffsetDistanceOrOptions))
194401
194582
  return new JointOptions(leftOffsetDistanceOrOptions);
194402
194583
  }
194403
- /** return true if the options indicate this amount of turn should be handled with an arc. */
194584
+ /**
194585
+ /** Return true if the options indicate this amount of turn should be handled with an arc. */
194404
194586
  needArc(theta) {
194405
194587
  return Math.abs(theta.degrees) >= this.minArcDegrees;
194406
194588
  }
194407
- /** Test if turn by theta should be output as single point. */
194589
+ /** Return the number of corners needed to chamfer the given turn angle. */
194408
194590
  numChamferPoints(theta) {
194409
194591
  const degrees = Math.abs(theta.degrees);
194410
- const stepDegrees = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.clamp(this.maxChamferTurnDegrees, 10, 120);
194592
+ const minStepDegreesClamp = 10;
194593
+ let maxStepDegreesClamp = 120;
194594
+ if (this.allowSharpestCorners) {
194595
+ maxStepDegreesClamp = this.maxChamferTurnDegrees;
194596
+ }
194597
+ const stepDegrees = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.clamp(this.maxChamferTurnDegrees, minStepDegreesClamp, maxStepDegreesClamp);
194411
194598
  if (degrees <= stepDegrees)
194412
194599
  return 1;
194413
194600
  return Math.ceil(degrees / stepDegrees);
@@ -194423,17 +194610,41 @@ class OffsetOptions {
194423
194610
  this.jointOptions = JointOptions.create(offsetDistanceOrOptions);
194424
194611
  this.strokeOptions = (strokeOptions !== undefined) ? strokeOptions : _StrokeOptions__WEBPACK_IMPORTED_MODULE_1__.StrokeOptions.createForCurves();
194425
194612
  }
194426
- get minArcDegrees() { return this.jointOptions.minArcDegrees; }
194427
- set minArcDegrees(value) { this.jointOptions.minArcDegrees = value; }
194428
- get maxChamferTurnDegrees() { return this.jointOptions.maxChamferTurnDegrees; }
194429
- set maxChamferTurnDegrees(value) { this.jointOptions.maxChamferTurnDegrees = value; }
194430
- get leftOffsetDistance() { return this.jointOptions.leftOffsetDistance; }
194431
- set leftOffsetDistance(value) { this.jointOptions.leftOffsetDistance = value; }
194432
- get preserveEllipticalArcs() { return this.jointOptions.preserveEllipticalArcs; }
194433
- set preserveEllipticalArcs(value) { this.jointOptions.preserveEllipticalArcs = value; }
194434
- /** Convert variant input into OffsetOptions.
194613
+ get minArcDegrees() {
194614
+ return this.jointOptions.minArcDegrees;
194615
+ }
194616
+ set minArcDegrees(value) {
194617
+ this.jointOptions.minArcDegrees = value;
194618
+ }
194619
+ get maxChamferTurnDegrees() {
194620
+ return this.jointOptions.maxChamferTurnDegrees;
194621
+ }
194622
+ set maxChamferTurnDegrees(value) {
194623
+ this.jointOptions.maxChamferTurnDegrees = value;
194624
+ }
194625
+ get allowSharpestCorners() {
194626
+ return this.jointOptions.allowSharpestCorners;
194627
+ }
194628
+ set allowSharpestCorners(value) {
194629
+ this.jointOptions.allowSharpestCorners = value;
194630
+ }
194631
+ get leftOffsetDistance() {
194632
+ return this.jointOptions.leftOffsetDistance;
194633
+ }
194634
+ set leftOffsetDistance(value) {
194635
+ this.jointOptions.leftOffsetDistance = value;
194636
+ }
194637
+ get preserveEllipticalArcs() {
194638
+ return this.jointOptions.preserveEllipticalArcs;
194639
+ }
194640
+ set preserveEllipticalArcs(value) {
194641
+ this.jointOptions.preserveEllipticalArcs = value;
194642
+ }
194643
+ /**
194644
+ * Convert variant input into OffsetOptions.
194435
194645
  * * If a JointOptions is provided, it is captured.
194436
- * * If an OffsetOptions is provided, a reference to it is returned. */
194646
+ * * If an OffsetOptions is provided, a reference to it is returned.
194647
+ */
194437
194648
  static create(offsetDistanceOrOptions) {
194438
194649
  if (offsetDistanceOrOptions instanceof OffsetOptions)
194439
194650
  return offsetDistanceOrOptions;
@@ -194462,7 +194673,9 @@ class Joint {
194462
194673
  this.swingPoint = swingPoint;
194463
194674
  this.flexure = JointMode.Unknown;
194464
194675
  }
194465
- /** try to construct an arc transition from ray0 to ray1 with given center. */
194676
+ /**
194677
+ * Try to construct an arc transition from ray0 to ray1 with given center.
194678
+ */
194466
194679
  static constructArc(ray0, center, ray1) {
194467
194680
  if (center !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(ray0.origin.distance(center), ray1.origin.distance(center))) {
194468
194681
  const angle = ray0.direction.angleToXY(ray1.direction);
@@ -194507,6 +194720,7 @@ class Joint {
194507
194720
  destination.packedPoints.push(point);
194508
194721
  }
194509
194722
  }
194723
+ /** Append stroke points along the offset curve defined by the Joint chain to the destination line string. */
194510
194724
  static collectStrokesFromChain(start, destination, maxTest = 100) {
194511
194725
  let numOut = -2 * maxTest; // allow extra things to happen
194512
194726
  Joint.visitJointsOnChain(start, (joint) => {
@@ -194518,7 +194732,7 @@ class Joint {
194518
194732
  if (fA === 0.0 && fB === 1.0)
194519
194733
  curve1 = joint.curve1.clone();
194520
194734
  else if (fA < fB)
194521
- curve1 = joint.curve1.clonePartialCurve(fA, fB);
194735
+ curve1 = joint.curve1.clonePartialCurve(fA, fB); // trimming is done by clonePartialCurve
194522
194736
  if (curve1) {
194523
194737
  if (!joint.jointCurve) {
194524
194738
  this.addPoint(destination, curve1.startPoint());
@@ -194558,6 +194772,7 @@ class Joint {
194558
194772
  }
194559
194773
  }
194560
194774
  }
194775
+ /** Append CurvePrimitives along the offset curve defined by the Joint chain to the destination array. */
194561
194776
  static collectCurvesFromChain(start, destination, maxTest = 100) {
194562
194777
  if (start === undefined)
194563
194778
  return;
@@ -194572,13 +194787,13 @@ class Joint {
194572
194787
  if (fA === 0.0 && fB === 1.0)
194573
194788
  curve1 = joint.curve1.clone();
194574
194789
  else if (fA < fB)
194575
- curve1 = joint.curve1.clonePartialCurve(fA, fB);
194790
+ curve1 = joint.curve1.clonePartialCurve(fA, fB); // trimming is done by clonePartialCurve
194576
194791
  this.collectPrimitive(destination, curve1);
194577
194792
  }
194578
194793
  return numOut++ < maxTest;
194579
194794
  }, maxTest);
194580
194795
  }
194581
- /** Execute `joint.annotateJointMode()` at all joints on the chain. */
194796
+ /** Execute `joint.annotateJointMode()` at all joints on the chain to set some of the joints attributes. */
194582
194797
  static annotateChain(start, options, maxTest = 100) {
194583
194798
  if (start)
194584
194799
  Joint.visitJointsOnChain(start, (joint) => { joint.annotateJointMode(options); return true; }, maxTest);
@@ -194586,7 +194801,7 @@ class Joint {
194586
194801
  /**
194587
194802
  * Visit joints on a chain.
194588
194803
  * * terminate on `false` return from `callback`
194589
- * @param start first (and, for cyclic chain, final) Joint
194804
+ * @param start first (and, for cyclic chain, final) joint
194590
194805
  * @param callback function to call with each Joint as a single parameter.
194591
194806
  */
194592
194807
  static visitJointsOnChain(start, callback, maxTest = 100) {
@@ -194594,7 +194809,7 @@ class Joint {
194594
194809
  if (joint) {
194595
194810
  let numTest = 0;
194596
194811
  while (joint !== undefined) {
194597
- if (numTest++ >= maxTest + 5)
194812
+ if (numTest++ >= maxTest + 5) // allow extra things to happen
194598
194813
  return true;
194599
194814
  if (!callback(joint))
194600
194815
  return false;
@@ -194610,13 +194825,13 @@ class Joint {
194610
194825
  if (this.curve0 && this.curve1) {
194611
194826
  const ray0 = this.curve0.fractionToPointAndDerivative(1.0);
194612
194827
  const ray1 = this.curve1.fractionToPointAndDerivative(0.0);
194613
- const intersection = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_7__.Ray3d.closestApproachRay3dRay3d(ray0, ray1);
194828
+ const intersection = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_7__.Ray3d.closestApproachRay3dRay3d(ray0, ray1); // intersection of the 2 ray lines
194614
194829
  if (intersection.approachType === _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__.CurveCurveApproachType.Intersection) {
194615
194830
  if (intersection.detailA.fraction >= 0.0 && intersection.detailB.fraction <= 0.0) {
194616
194831
  this.fraction0 = 1.0;
194617
194832
  this.fraction1 = 0.0;
194618
194833
  this.flexure = JointMode.Extend;
194619
- const theta = ray0.getDirectionRef().angleToXY(ray1.getDirectionRef());
194834
+ const theta = ray0.getDirectionRef().angleToXY(ray1.getDirectionRef()); // angle between the 2 ray lines
194620
194835
  if (options.needArc(theta)) {
194621
194836
  const arc = Joint.constructArc(ray0, this.curve0.baseCurveEnd, ray1);
194622
194837
  if (arc) {
@@ -194624,13 +194839,12 @@ class Joint {
194624
194839
  return;
194625
194840
  }
194626
194841
  }
194627
- const numChamferPoints = options.numChamferPoints(theta);
194628
- if (numChamferPoints <= 1) {
194842
+ const numChamferPoints = options.numChamferPoints(theta); // how many interior points in the linestring
194843
+ if (numChamferPoints <= 1) { // create sharp corner
194629
194844
  this.jointCurve = _LineString3d__WEBPACK_IMPORTED_MODULE_6__.LineString3d.create(ray0.origin, intersection.detailA.point, ray1.origin);
194630
194845
  return;
194631
194846
  }
194632
- if (numChamferPoints > 1) {
194633
- // A nontrivial linestring ...
194847
+ if (numChamferPoints > 1) { // create chamfer corner (a line string)
194634
194848
  const radians0 = theta.radians;
194635
194849
  const numHalfStep = 2.0 * numChamferPoints;
194636
194850
  const halfStepRadians = radians0 / numHalfStep;
@@ -194650,19 +194864,20 @@ class Joint {
194650
194864
  }
194651
194865
  }
194652
194866
  }
194653
- // desperation appears ...
194867
+ // if there is no intersection between the 2 ray lines, fill the gap by a line segment
194654
194868
  this.flexure = JointMode.Gap;
194655
194869
  this.jointCurve = _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d.create(this.curve0.fractionToPoint(1.0), this.curve1.fractionToPoint(0.0));
194656
194870
  this.fraction0 = 1.0;
194657
194871
  this.fraction1 = 0.0;
194658
194872
  }
194659
194873
  }
194660
- // Select the index at which summed fraction difference is smallest.
194874
+ /** Select the index at which summed fraction difference is smallest */
194661
194875
  selectIntersectionIndexByFraction(fractionA, fractionB, intersections) {
194662
194876
  let index = -1;
194663
194877
  let aMin = Number.MAX_VALUE;
194664
194878
  for (let i = 0; i < intersections.length; i++) {
194665
- const a = Math.abs(intersections[i].detailA.fraction - fractionA) + Math.abs(intersections[i].detailB.fraction - fractionB);
194879
+ const a = Math.abs(intersections[i].detailA.fraction - fractionA)
194880
+ + Math.abs(intersections[i].detailB.fraction - fractionB);
194666
194881
  if (a < aMin) {
194667
194882
  aMin = a;
194668
194883
  index = i;
@@ -194671,42 +194886,42 @@ class Joint {
194671
194886
  return index;
194672
194887
  }
194673
194888
  /**
194674
- * Examine the adjacent geometry
194675
- * * set JointMode: one of Cap Extend, or Trim
194889
+ * Examine the adjacent geometry to set some of joint attributes:
194890
+ * * set JointMode: one of Cap, Extend, or Trim
194676
194891
  * * set fraction0 and fraction1 of intersection of curve0 and curve1
194892
+ * * set joint curve
194677
194893
  * * this REFERENCES curve0, curve1, fraction0, fraction1
194678
194894
  * * this does not reference nextJoint and previousJoint
194679
194895
  */
194680
194896
  annotateJointMode(options) {
194681
- if (this.curve0 && !this.curve1) {
194897
+ if (!this.curve0 && this.curve1) { // joint at the start of the chain
194682
194898
  this.flexure = JointMode.Cap;
194683
- this.fraction0 = 1.0;
194899
+ this.fraction1 = 0.0;
194684
194900
  }
194685
- else if (this.curve1 && !this.curve0) {
194901
+ else if (this.curve0 && !this.curve1) { // joint at the end of the chain
194686
194902
  this.flexure = JointMode.Cap;
194687
- this.fraction1 = 0.0;
194903
+ this.fraction0 = 1.0;
194688
194904
  }
194689
- else if (this.curve0 && this.curve1) {
194690
- // check for direct intersection -- occurs on offset of colinear base segments, and closed primitives
194691
- if (this.curve0.endPoint().isAlmostEqual(this.curve1.startPoint())) {
194905
+ else if (this.curve0 && this.curve1) { // joints at the middle of the chain
194906
+ if (this.curve0.endPoint().isAlmostEqual(this.curve1.startPoint())) { // joint between colinear segments
194692
194907
  this.fraction0 = 1.0;
194693
194908
  this.fraction1 = 0.0;
194694
194909
  this.flexure = JointMode.Trim;
194695
194910
  }
194696
- else if (this.curve0 instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d && this.curve1 instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d) {
194697
- const ray0 = this.curve0.fractionToPointAndDerivative(0.0); // And we know that is full length ray !
194698
- const ray1 = this.curve1.fractionToPointAndDerivative(0.0); // ditto
194699
- const intersection = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_7__.Ray3d.closestApproachRay3dRay3d(ray0, ray1);
194911
+ else if (this.curve0 instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d && this.curve1 instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d) { // pair of lines
194912
+ const ray0 = this.curve0.fractionToPointAndDerivative(0.0);
194913
+ const ray1 = this.curve1.fractionToPointAndDerivative(0.0);
194914
+ const intersection = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_7__.Ray3d.closestApproachRay3dRay3d(ray0, ray1); // intersection of the 2 ray lines
194700
194915
  if (intersection.approachType === _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__.CurveCurveApproachType.Intersection) {
194701
194916
  this.fraction0 = intersection.detailA.fraction;
194702
194917
  this.fraction1 = intersection.detailB.fraction;
194703
- if (this.fraction0 >= 1.0 && this.fraction1 <= 0.0) {
194918
+ if (this.fraction0 >= 1.0 && this.fraction1 <= 0.0) { // need to extend
194704
194919
  this.annotateExtension(options);
194705
194920
  }
194706
- else if (this.fraction0 < 1.0 && this.fraction1 > 0.0) {
194921
+ else if (this.fraction0 < 1.0 && this.fraction1 > 0.0) { // need to trim
194707
194922
  this.flexure = JointMode.Trim;
194708
194923
  }
194709
- else if (this.fraction0 > 1.0 && this.fraction1 > 1.0) {
194924
+ else if (this.fraction0 > 1.0 && this.fraction1 > 1.0) { // need to fill gap with a single line segment
194710
194925
  this.flexure = JointMode.Gap;
194711
194926
  this.jointCurve = _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d.create(this.curve0.fractionToPoint(1.0), this.curve1.fractionToPoint(0.0));
194712
194927
  this.fraction0 = 1.0;
@@ -194714,15 +194929,15 @@ class Joint {
194714
194929
  }
194715
194930
  }
194716
194931
  }
194717
- else { // generic pair of curves ...
194932
+ else { // generic pair of curves
194718
194933
  const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_9__.CurveCurve.intersectionXYPairs(this.curve0, false, this.curve1, false);
194719
194934
  const intersectionIndex = this.selectIntersectionIndexByFraction(1.0, 0.0, intersections);
194720
- if (intersectionIndex >= 0) {
194935
+ if (intersectionIndex >= 0) { // need to trim
194721
194936
  this.flexure = JointMode.Trim;
194722
194937
  this.fraction0 = intersections[intersectionIndex].detailA.fraction;
194723
194938
  this.fraction1 = intersections[intersectionIndex].detailB.fraction;
194724
194939
  }
194725
- else {
194940
+ else { // need to extend
194726
194941
  this.annotateExtension(options);
194727
194942
  }
194728
194943
  }
@@ -194730,7 +194945,8 @@ class Joint {
194730
194945
  }
194731
194946
  /**
194732
194947
  * * Examine the primitive trim fractions between each pair of joints.
194733
- * * If trim fractions indicate the primitive must disappear, replace the joint pair by a new joint pointing at surrounding primitives
194948
+ * * If trim fractions indicate the primitive must disappear, replace the joint pair by a new joint pointing at
194949
+ * surrounding primitives
194734
194950
  * @param start
194735
194951
  */
194736
194952
  static removeDegeneratePrimitives(start, options, maxTest) {
@@ -194765,8 +194981,7 @@ class Joint {
194765
194981
  }
194766
194982
  */
194767
194983
  const eliminateF = f0 >= f1 || f0 > 1.0;
194768
- const eliminateG = (g0 !== undefined && g0 > 1.0)
194769
- || (g0 !== undefined && g1 !== undefined && g0 >= g1);
194984
+ const eliminateG = (g0 !== undefined && g0 > 1.0) || (g0 !== undefined && g1 !== undefined && g0 >= g1);
194770
194985
  if (eliminateF && eliminateG) {
194771
194986
  const jointC = jointB.nextJoint;
194772
194987
  const newJoint = new Joint(jointA.curve0, jointC.curve1, undefined);
@@ -194822,9 +195037,8 @@ class Joint {
194822
195037
  * @internal
194823
195038
  */
194824
195039
  class PolygonWireOffsetContext {
194825
- /** construct a context. */
194826
- constructor() {
194827
- }
195040
+ /** Construct a context. */
195041
+ constructor() { }
194828
195042
  // Construct a single offset from base points
194829
195043
  static createOffsetSegment(basePointA, basePointB, distance) {
194830
195044
  _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(basePointA, basePointB, this._unitAlong);
@@ -194837,13 +195051,25 @@ class PolygonWireOffsetContext {
194837
195051
  return undefined;
194838
195052
  }
194839
195053
  /**
194840
- * Construct curves that are offset from a polygon.
194841
- * * The construction will remove "some" local effects of features smaller than the offset distance, but will not detect self intersection with far-away edges.
194842
- * @param points
194843
- * @param wrap
194844
- * @param offsetDistance
195054
+ * Construct a wire (not area) that is offset from given polyline or polygon (which must be in xy-plane or in
195055
+ * a plane parallel to xy-plane).
195056
+ * * This is a simple wire offset (in the form of a line string), not an area.
195057
+ * * If offsetDistance is given as a number, default OffsetOptions are applied.
195058
+ * * See [[JointOptions]] class doc for offset construction rules.
195059
+ * @param points a single loop or path
195060
+ * @param wrap true to offset the wraparound joint. Assumes first = last point.
195061
+ * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or JointOptions
195062
+ * object.
194845
195063
  */
194846
195064
  constructPolygonWireXYOffset(points, wrap, leftOffsetDistanceOrOptions) {
195065
+ /**
195066
+ * if "wrap = true", then first and last point in the points array must be close; otherwise
195067
+ * generated offset will be invalid.
195068
+ */
195069
+ if (wrap && !points[0].isAlmostEqual(points[points.length - 1])) {
195070
+ wrap = false;
195071
+ }
195072
+ /** create raw offsets as a linked list (joint0) */
194847
195073
  const options = JointOptions.create(leftOffsetDistanceOrOptions);
194848
195074
  const numPoints = points.length;
194849
195075
  let fragment0 = PolygonWireOffsetContext.createOffsetSegment(points[0], points[1], options.leftOffsetDistance);
@@ -194863,7 +195089,9 @@ class PolygonWireOffsetContext {
194863
195089
  newJoint = new Joint(fragment0, undefined, points[numPoints - 1]);
194864
195090
  Joint.link(previousJoint, newJoint);
194865
195091
  }
195092
+ /** annotateChain sets some of the joints attributes (including how to extend curves or fill the gap between curves) */
194866
195093
  Joint.annotateChain(joint0, options, numPoints);
195094
+ /** make limited passes through the Joint chain until no self-intersections are removed */
194867
195095
  for (let pass = 0; pass++ < 5;) {
194868
195096
  const state = Joint.removeDegeneratePrimitives(joint0, options, numPoints);
194869
195097
  joint0 = state.newStart;
@@ -194877,6 +195105,7 @@ class PolygonWireOffsetContext {
194877
195105
  */
194878
195106
  }
194879
195107
  // Joint.collectPrimitivesFromChain(joint0, result, numPoints);
195108
+ /** turn the Joint linked list into a CurveCollection (Loop or Path). trimming is done in collectStrokesFromChain */
194880
195109
  const chain = _LineString3d__WEBPACK_IMPORTED_MODULE_6__.LineString3d.create();
194881
195110
  Joint.collectStrokesFromChain(joint0, chain, numPoints);
194882
195111
  const n = chain.packedPoints.length;
@@ -194900,14 +195129,13 @@ PolygonWireOffsetContext._offsetB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTE
194900
195129
  */
194901
195130
  class CurveChainWireOffsetContext {
194902
195131
  /** construct a context. */
194903
- constructor() {
194904
- }
195132
+ constructor() { }
194905
195133
  /**
194906
195134
  * Annotate a CurvePrimitive with properties `baseCurveStart` and `baseCurveEnd`.
194907
- * * return cp
194908
- * @param cp primitive to annotate
195135
+ * @param cp curve primitive to annotate
194909
195136
  * @param startPoint optional start point
194910
195137
  * @param endPoint optional end point
195138
+ * @return the input CurvePrimitive with annotations
194911
195139
  */
194912
195140
  static applyBasePoints(cp, startPoint, endPoint) {
194913
195141
  if (cp !== undefined) {
@@ -194919,7 +195147,7 @@ class CurveChainWireOffsetContext {
194919
195147
  return cp;
194920
195148
  }
194921
195149
  /**
194922
- * Create the offset of a single primitive.
195150
+ * Create the offset of a single primitive as viewed in the xy-plane (ignoring z).
194923
195151
  * * each primitive may be labeled (as an `any` object) with start or end point of base curve:
194924
195152
  * * `(primitive as any).baseCurveStart: Point3d`
194925
195153
  * * `(primitive as any).baseCurveEnd: Point3d`
@@ -194943,15 +195171,10 @@ class CurveChainWireOffsetContext {
194943
195171
  }
194944
195172
  /**
194945
195173
  * Construct curves that are offset from a Path or Loop as viewed in xy-plane (ignoring z).
194946
- * * The construction will remove "some" local effects of features smaller than the offset distance, but will not detect self intersection among widely separated edges.
195174
+ * * The construction will remove "some" local effects of features smaller than the offset distance, but will
195175
+ * not detect self intersection among widely separated edges.
194947
195176
  * * If offsetDistance is given as a number, default OffsetOptions are applied.
194948
- * * When the offset needs to do an "outside" turn, the first applicable construction is applied:
194949
- * * If the turn is larger than `options.minArcDegrees`, a circular arc is constructed.
194950
- * * If the turn is less than or equal to `options.maxChamferTurnDegrees`, extend curves along tangent to single intersection point.
194951
- * * If the turn is larger than `options.maxChamferDegrees`, the turn is constructed as a sequence of straight lines that are:
194952
- * * outside the arc
194953
- * * have uniform turn angle less than `options.maxChamferDegrees`
194954
- * * each line segment (except first and last) touches the arc at its midpoint.
195177
+ * * See [[JointOptions]] class doc for offset construction rules.
194955
195178
  * @param curves base curves.
194956
195179
  * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
194957
195180
  */
@@ -194959,14 +195182,15 @@ class CurveChainWireOffsetContext {
194959
195182
  const wrap = curves instanceof _Loop__WEBPACK_IMPORTED_MODULE_10__.Loop;
194960
195183
  const offsetOptions = OffsetOptions.create(offsetDistanceOrOptions);
194961
195184
  const simpleOffsets = [];
194962
- // setup pass: get simple offsets of each primitive
195185
+ /** traverse primitives (children of curves) and create simple offsets of each primitive as an array */
194963
195186
  for (const c of curves.children) {
194964
195187
  const c1 = CurveChainWireOffsetContext.createSingleOffsetPrimitiveXY(c, offsetOptions);
194965
195188
  if (c1 === undefined) {
194966
195189
  // bad .. maybe arc to inside?
194967
195190
  }
194968
- else if (c1 instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__.CurvePrimitive)
195191
+ else if (c1 instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__.CurvePrimitive) {
194969
195192
  simpleOffsets.push(c1);
195193
+ }
194970
195194
  else if (Array.isArray(c1)) {
194971
195195
  for (const c2 of c1) {
194972
195196
  if (c2 instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__.CurvePrimitive)
@@ -194974,6 +195198,7 @@ class CurveChainWireOffsetContext {
194974
195198
  }
194975
195199
  }
194976
195200
  }
195201
+ /** create joints between array elements to make offsets as a linked list (joint0) */
194977
195202
  let fragment0;
194978
195203
  let newJoint;
194979
195204
  let previousJoint;
@@ -194992,8 +195217,10 @@ class CurveChainWireOffsetContext {
194992
195217
  }
194993
195218
  if (joint0 && previousJoint && curves instanceof _Loop__WEBPACK_IMPORTED_MODULE_10__.Loop)
194994
195219
  Joint.link(previousJoint, joint0);
195220
+ /** annotateChain sets some of the joints attributes (including how to extend curves or fill the gap between curves) */
194995
195221
  const numOffset = simpleOffsets.length;
194996
195222
  Joint.annotateChain(joint0, offsetOptions.jointOptions, numOffset);
195223
+ /** turn the Joint linked list into a CurveCollection. trimming is done in collectCurvesFromChain */
194997
195224
  const outputCurves = [];
194998
195225
  Joint.collectCurvesFromChain(joint0, outputCurves, numOffset);
194999
195226
  return _RegionOps__WEBPACK_IMPORTED_MODULE_13__.RegionOps.createLoopPathOrBagOfCurves(outputCurves, wrap, true);
@@ -207680,10 +207907,12 @@ __webpack_require__.r(__webpack_exports__);
207680
207907
  * * are NOT required to be unit vectors.
207681
207908
  * * are NOT required to be perpendicular vectors.
207682
207909
  * * The skewed, non-uniform scaling of the grid directions is the primary focus of this class.
207683
- * * Queries of altitude, velocity, normalX, normalY, and normalZ use the NORMALIZED cross product of vectorU and vectorV as plane normal.
207910
+ * * Queries of altitude, velocity, normalX, normalY, and normalZ use the NORMALIZED cross product of vectorU
207911
+ * and vectorV as plane normal.
207684
207912
  * * Hence these are cartesian distances.
207685
207913
  * * If numerous calls to these are expected, the repeated normalization may be a performance issue.
207686
- * * Using a [[Plane3dByOriginAndUnitNormal]] or the rigid transform returned by [[toRigidFrame]] would provide better performance.
207914
+ * * Using a [[Plane3dByOriginAndUnitNormal]] or the rigid transform returned by [[toRigidFrame]] would provide
207915
+ * better performance.
207687
207916
  * @public
207688
207917
  */
207689
207918
  class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
@@ -207693,7 +207922,7 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
207693
207922
  this.vectorU = vectorU;
207694
207923
  this.vectorV = vectorV;
207695
207924
  }
207696
- /** create a new plane from origin and 2 in-plane vectors. */
207925
+ /** Create a new plane from origin and 2 in-plane vectors. */
207697
207926
  static createOriginAndVectors(origin, vectorU, vectorV, result) {
207698
207927
  if (result) {
207699
207928
  result.origin.setFrom(origin);
@@ -207703,13 +207932,14 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
207703
207932
  }
207704
207933
  return new Plane3dByOriginAndVectors(origin.clone(), vectorU.clone(), vectorV.clone());
207705
207934
  }
207706
- /** clone to a new plane. */
207935
+ /** Clone to a new plane. */
207707
207936
  clone(result) {
207708
207937
  if (result !== undefined)
207709
207938
  result.setOriginAndVectors(this.origin, this.vectorU, this.vectorV);
207710
207939
  return new Plane3dByOriginAndVectors(this.origin.clone(), this.vectorU.clone(), this.vectorV.clone());
207711
207940
  }
207712
- /** create a new Plane3dByOriginAndVectors from a variety of plane types.
207941
+ /**
207942
+ * Create a new Plane3dByOriginAndVectors from a variety of plane types.
207713
207943
  * * The input is NOT captured.
207714
207944
  */
207715
207945
  static createFrom(source, result) {
@@ -207768,7 +207998,8 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
207768
207998
  this.vectorV.set(vx, vy, vz);
207769
207999
  return this;
207770
208000
  }
207771
- /** Set all origin and both vectors from coordinates in given origin and vectors.
208001
+ /**
208002
+ * Set all origin and both vectors from coordinates in given origin and vectors.
207772
208003
  * * Note that coordinates are copied out of the parameters -- the given parameters are NOT retained by reference.
207773
208004
  */
207774
208005
  setOriginAndVectors(origin, vectorU, vectorV) {
@@ -207783,7 +208014,8 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
207783
208014
  return result.setOriginAndVectorsXYZ(x0, y0, z0, ux, uy, uz, vx, vy, vz);
207784
208015
  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));
207785
208016
  }
207786
- /** Define a plane by three points in the plane.
208017
+ /**
208018
+ * Define a plane by three points in the plane.
207787
208019
  * @param origin origin for the parameterization.
207788
208020
  * @param targetU target point for the vectorU starting at the origin.
207789
208021
  * @param targetV target point for the vectorV originating at the origin.
@@ -207796,7 +208028,8 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
207796
208028
  static createXYPlane(result) {
207797
208029
  return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(0, 0, 0, 1, 0, 0, 0, 1, 0, result);
207798
208030
  }
207799
- /** create a plane from data presented as Float64Arrays.
208031
+ /**
208032
+ * Create a plane from data presented as Float64Arrays.
207800
208033
  * @param origin x,y,z of origin.
207801
208034
  * @param vectorU x,y,z of vectorU
207802
208035
  * @param vectorV x,y,z of vectorV
@@ -207804,7 +208037,8 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
207804
208037
  static createOriginAndVectorsArrays(origin, vectorU, vectorV, result) {
207805
208038
  return Plane3dByOriginAndVectors.createOriginAndVectorsXYZ(origin[0], origin[1], origin[2], vectorU[0], vectorU[1], vectorU[2], vectorV[0], vectorV[1], vectorV[2], result);
207806
208039
  }
207807
- /** create a plane from data presented as Float64Array with weights
208040
+ /**
208041
+ * Create a plane from data presented as Float64Array with weights
207808
208042
  * @param origin x,y,z,w of origin.
207809
208043
  * @param vectorU x,y,z,w of vectorU
207810
208044
  * @param vectorV x,y,z,w of vectorV
@@ -207868,7 +208102,7 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
207868
208102
  vectorV: this.vectorV.toJSON(),
207869
208103
  };
207870
208104
  }
207871
- /** create a new plane. See `setFromJSON` for layout example. */
208105
+ /** Create a new plane. See `setFromJSON` for layout example. */
207872
208106
  static fromJSON(json) {
207873
208107
  const result = Plane3dByOriginAndVectors.createXYPlane();
207874
208108
  result.setFromJSON(json);
@@ -207880,7 +208114,8 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
207880
208114
  && this.vectorU.isAlmostEqual(other.vectorU)
207881
208115
  && this.vectorV.isAlmostEqual(other.vectorV);
207882
208116
  }
207883
- /** Normalize both `vectorU` and `vectorV` in place. This does NOT make them perpendicular.
208117
+ /**
208118
+ * Normalize both `vectorU` and `vectorV` in place. This does NOT make them perpendicular.
207884
208119
  * * Return true if both succeeded.
207885
208120
  */
207886
208121
  normalizeInPlace() {
@@ -207888,9 +208123,7 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
207888
208123
  const okV = this.vectorV.normalizeInPlace();
207889
208124
  return okU && okV;
207890
208125
  }
207891
- /**
207892
- * Return (if possible) a unit normal to the plane.
207893
- */
208126
+ /** Return (if possible) a unit normal to the plane */
207894
208127
  getUnitNormal(result) {
207895
208128
  return this.vectorU.unitCrossProduct(this.vectorV, result);
207896
208129
  }
@@ -207907,9 +208140,7 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
207907
208140
  getAnyPointOnPlane(result) {
207908
208141
  return this.origin.clone(result);
207909
208142
  }
207910
- /**
207911
- * Return (if possible) a ray with origin at plane origin, direction as unit normal to the plane.
207912
- */
208143
+ /** Return (if possible) a ray with origin at plane origin, direction as unit normal to the plane */
207913
208144
  unitNormalRay(result) {
207914
208145
  if (!Plane3dByOriginAndVectors._workVector)
207915
208146
  Plane3dByOriginAndVectors._workVector = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create();
@@ -207929,27 +208160,24 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
207929
208160
  toRigidFrame(result) {
207930
208161
  return _Transform__WEBPACK_IMPORTED_MODULE_5__.Transform.createRigidFromOriginAndColumns(this.origin, this.vectorU, this.vectorV, _Geometry__WEBPACK_IMPORTED_MODULE_3__.AxisOrder.XYZ, result);
207931
208162
  }
207932
- /**
207933
- * Apply the transform to the origin and vectors in place.
207934
- */
208163
+ /** Apply the transform to the origin and vectors in place */
207935
208164
  transformInPlace(transform) {
207936
208165
  transform.multiplyPoint3d(this.origin, this.origin);
207937
208166
  transform.multiplyVector(this.vectorU, this.vectorU);
207938
208167
  transform.multiplyVector(this.vectorV, this.vectorV);
207939
208168
  }
207940
- // Implement PlaneAltitudeEvaluator methods . . .
207941
208169
  /**
207942
208170
  * Return x component of the (normalized!) {vectorU CROSS vectorV}.
207943
208171
  * Return 0 if the cross product is zero.
207944
- * */
208172
+ */
207945
208173
  normalX() {
207946
208174
  const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
207947
208175
  return unitNormal !== undefined ? unitNormal.x : 0.0;
207948
208176
  }
207949
208177
  /**
207950
- * Return y component of the (normalized!) {vectorU CROSS vectorV}.
207951
- * Return 0 if the cross product is zero.
207952
- * */
208178
+ * Return y component of the (normalized!) {vectorU CROSS vectorV}.
208179
+ * Return 0 if the cross product is zero.
208180
+ */
207953
208181
  normalY() {
207954
208182
  const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
207955
208183
  return unitNormal !== undefined ? unitNormal.y : 0.0;
@@ -207957,41 +208185,43 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
207957
208185
  /**
207958
208186
  * Return z component of the (normalized!) {vectorU CROSS vectorV}.
207959
208187
  * Return 0 if the cross product is zero.
207960
- * */
208188
+ */
207961
208189
  normalZ() {
207962
208190
  const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
207963
208191
  return unitNormal !== undefined ? unitNormal.z : 0.0;
207964
208192
  }
207965
- /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */
208193
+ /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */
207966
208194
  altitude(xyz) {
207967
208195
  const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
207968
208196
  if (unitNormal === undefined)
207969
208197
  return 0.0;
207970
208198
  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);
207971
208199
  }
207972
- /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */
208200
+ /** Return signed cartesian altitude perpendicular to the plane. This uses the normalized cross product as normal. */
207973
208201
  altitudeXYZ(x, y, z) {
207974
208202
  const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
207975
208203
  if (unitNormal === undefined)
207976
208204
  return 0.0;
207977
208205
  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);
207978
208206
  }
207979
- /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */
208207
+ /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */
207980
208208
  velocity(xyzVector) {
207981
208209
  const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
207982
208210
  if (unitNormal === undefined)
207983
208211
  return 0.0;
207984
208212
  return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYZXYZ(xyzVector.x, xyzVector.y, xyzVector.z, unitNormal.x, unitNormal.y, unitNormal.z);
207985
208213
  }
207986
- /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */
208214
+ /** Return signed projection of the input vector to the plane normal. This uses the normalized cross product as normal. */
207987
208215
  velocityXYZ(x, y, z) {
207988
208216
  const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
207989
208217
  if (unitNormal === undefined)
207990
208218
  return 0.0;
207991
208219
  return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYZXYZ(x, y, z, unitNormal.x, unitNormal.y, unitNormal.z);
207992
208220
  }
207993
- /** Return triple product of homogeneous difference {(xyzw - w * origin)} with vectorU and vectorV.
207994
- * * In the usual manner of homogeneous calculations, this is proportional to true cartesian distance from the plane but is not a physical distance.
208221
+ /**
208222
+ * Return triple product of homogeneous difference {(xyzw - w * origin)} with vectorU and vectorV.
208223
+ * * In the usual manner of homogeneous calculations, this is proportional to true cartesian distance from the
208224
+ * plane but is not a physical distance.
207995
208225
  */
207996
208226
  weightedAltitude(xyzw) {
207997
208227
  const w = xyzw.w;
@@ -214161,7 +214391,7 @@ class Range3d extends RangeBase {
214161
214391
  const coffs = transform.matrix.coffs;
214162
214392
  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);
214163
214393
  }
214164
- /** Multiply the point x,y,z by transform and use the coordinate to extend this range. */
214394
+ /** Multiply the point x,y,z by the inverse of the transform and use the coordinate to extend this range. */
214165
214395
  extendInverseTransformedXYZ(transform, x, y, z) {
214166
214396
  const origin = transform.origin;
214167
214397
  if (!transform.matrix.computeCachedInverse(true))
@@ -284650,7 +284880,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
284650
284880
  /***/ ((module) => {
284651
284881
 
284652
284882
  "use strict";
284653
- 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"}}]}}');
284883
+ 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"}}]}}');
284654
284884
 
284655
284885
  /***/ })
284656
284886