@itwin/ecschema-rpcinterface-tests 4.4.0-dev.21 → 4.4.0-dev.24

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.
@@ -21,10 +21,10 @@
21
21
 
22
22
  /***/ }),
23
23
 
24
- /***/ "../../common/temp/node_modules/.pnpm/@itwin+certa@3.7.17/node_modules/@itwin/certa/lib/utils/CallbackUtils.js":
25
- /*!*********************************************************************************************************************!*\
26
- !*** ../../common/temp/node_modules/.pnpm/@itwin+certa@3.7.17/node_modules/@itwin/certa/lib/utils/CallbackUtils.js ***!
27
- \*********************************************************************************************************************/
24
+ /***/ "../../common/temp/node_modules/.pnpm/@itwin+certa@3.8.0/node_modules/@itwin/certa/lib/utils/CallbackUtils.js":
25
+ /*!********************************************************************************************************************!*\
26
+ !*** ../../common/temp/node_modules/.pnpm/@itwin+certa@3.8.0/node_modules/@itwin/certa/lib/utils/CallbackUtils.js ***!
27
+ \********************************************************************************************************************/
28
28
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
29
29
 
30
30
  "use strict";
@@ -3183,7 +3183,7 @@ exports.getAccessTokenFromBackend = exports.getTokenCallbackName = void 0;
3183
3183
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3184
3184
  * See LICENSE.md in the project root for license terms and full copyright notice.
3185
3185
  *--------------------------------------------------------------------------------------------*/
3186
- const CallbackUtils_1 = __webpack_require__(/*! @itwin/certa/lib/utils/CallbackUtils */ "../../common/temp/node_modules/.pnpm/@itwin+certa@3.7.17/node_modules/@itwin/certa/lib/utils/CallbackUtils.js");
3186
+ const CallbackUtils_1 = __webpack_require__(/*! @itwin/certa/lib/utils/CallbackUtils */ "../../common/temp/node_modules/.pnpm/@itwin+certa@3.8.0/node_modules/@itwin/certa/lib/utils/CallbackUtils.js");
3187
3187
  // Shared by both the frontend and backend side of the tests
3188
3188
  exports.getTokenCallbackName = "getToken";
3189
3189
  async function getAccessTokenFromBackend(user, oidcConfig) {
@@ -19281,8 +19281,8 @@ __webpack_require__.r(__webpack_exports__);
19281
19281
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
19282
19282
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
19283
19283
  /* harmony export */ });
19284
- /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
19285
- /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/createClass.js");
19284
+ /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
19285
+ /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/createClass.js");
19286
19286
 
19287
19287
 
19288
19288
 
@@ -27598,6 +27598,7 @@ __webpack_require__.r(__webpack_exports__);
27598
27598
  /**
27599
27599
  * Mirrors the SpanKind enum from [@opentelemetry/api](https://open-telemetry.github.io/opentelemetry-js/enums/_opentelemetry_api.SpanKind.html)
27600
27600
  * @public
27601
+ * @deprecated in 4.4 - OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.
27601
27602
  */
27602
27603
  var SpanKind;
27603
27604
  (function (SpanKind) {
@@ -27653,9 +27654,11 @@ function* getFlatEntries(obj, path = "") {
27653
27654
  function flattenObject(obj) {
27654
27655
  return Object.fromEntries(getFlatEntries(obj));
27655
27656
  }
27657
+ /* eslint-disable deprecation/deprecation -- lots of self-references here... */
27656
27658
  /**
27657
27659
  * Enables OpenTelemetry tracing in addition to traditional logging.
27658
27660
  * @public
27661
+ * @deprecated in 4.4 - OpenTelemetry Tracing helpers will become internal in a future release. Apps should use `@opentelemetry/api` directly.
27659
27662
  */
27660
27663
  class Tracing {
27661
27664
  /**
@@ -27687,6 +27690,14 @@ class Tracing {
27687
27690
  }
27688
27691
  });
27689
27692
  }
27693
+ /**
27694
+ * Adds a span event describing a runtime exception, as advised in OpenTelemetry documentation
27695
+ * @param e error (exception) object
27696
+ * @internal
27697
+ */
27698
+ static recordException(e) {
27699
+ Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.recordException(e);
27700
+ }
27690
27701
  /**
27691
27702
  * Enable logging to OpenTelemetry. [[Tracing.withSpan]] will be enabled, all log entries will be attached to active span as span events.
27692
27703
  * [IModelHost.startup]($backend) will call this automatically if the `enableOpenTelemetry` option is enabled and it succeeds in requiring `@opentelemetry/api`.
@@ -27736,6 +27747,7 @@ class Tracing {
27736
27747
  Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.setAttributes(attributes);
27737
27748
  }
27738
27749
  }
27750
+ /* eslint-enable deprecation/deprecation */
27739
27751
 
27740
27752
 
27741
27753
  /***/ }),
@@ -35093,6 +35105,11 @@ class PackedFeatureTable {
35093
35105
  result.modelId.upper = this.batchModelIdPair.upper;
35094
35106
  return result;
35095
35107
  }
35108
+ getModelIdPair(_featureIndex, out) {
35109
+ out.lower = this.batchModelIdPair.lower;
35110
+ out.upper = this.batchModelIdPair.upper;
35111
+ return out;
35112
+ }
35096
35113
  /** Returns the element ID of the Feature associated with the specified index, or undefined if the index is out of range. */
35097
35114
  findElementId(featureIndex) {
35098
35115
  if (featureIndex >= this.numFeatures)
@@ -35246,6 +35263,10 @@ class MultiModelPackedFeatureTable {
35246
35263
  getElementIdPair(featureIndex, out) {
35247
35264
  return this._features.getElementIdPair(featureIndex, out);
35248
35265
  }
35266
+ getModelIdPair(featureIndex, out) {
35267
+ this._models.getModelIdPair(featureIndex, out);
35268
+ return out;
35269
+ }
35249
35270
  findElementId(featureIndex) {
35250
35271
  return this._features.findElementId(featureIndex);
35251
35272
  }
@@ -39228,6 +39249,12 @@ class PlanProjectionSettings {
39228
39249
  props.enforceDisplayPriority = changedProps.enforceDisplayPriority;
39229
39250
  return new PlanProjectionSettings(props);
39230
39251
  }
39252
+ /** Return true if these settings are equivalent to the specified settings. */
39253
+ equals(other) {
39254
+ if (this === other)
39255
+ return true;
39256
+ return this.elevation === other.elevation && this.transparency === other.transparency && this.overlay === other.overlay && this.enforceDisplayPriority === other.enforceDisplayPriority;
39257
+ }
39231
39258
  }
39232
39259
 
39233
39260
 
@@ -56186,7 +56213,7 @@ class RpcInvocation {
56186
56213
  // this catch block is intentionally placed inside `runActivity` to attach the right logging metadata and use the correct openTelemetry span.
56187
56214
  if (!(error instanceof _RpcControl__WEBPACK_IMPORTED_MODULE_6__.RpcPendingResponse)) {
56188
56215
  _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logError(_CommonLoggerCategory__WEBPACK_IMPORTED_MODULE_1__.CommonLoggerCategory.RpcInterfaceBackend, "Error in RPC operation", { error: _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorProps(error) });
56189
- _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Tracing.setAttributes({ error: true });
56216
+ _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Tracing.recordException(error);
56190
56217
  }
56191
56218
  throw error;
56192
56219
  }));
@@ -92839,6 +92866,7 @@ class Viewport {
92839
92866
  invalidateScene() {
92840
92867
  this._sceneValid = false;
92841
92868
  this._timePointValid = false;
92869
+ this.onSceneInvalidated.raiseEvent(this);
92842
92870
  this.invalidateDecorations();
92843
92871
  }
92844
92872
  /** Mark the viewport's "render plan" as having changed, so that the next call to [[renderFrame]] will recreate it.
@@ -93459,6 +93487,11 @@ class Viewport {
93459
93487
  * @beta
93460
93488
  */
93461
93489
  this.onMapLayerScaleRangeVisibilityChanged = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
93490
+ /** Event invoked every time [[invalidateScene]] is called.
93491
+ * @note This event will be raised **very** frequently. Avoid doing significant work inside of your event listener.
93492
+ * @beta
93493
+ */
93494
+ this.onSceneInvalidated = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
93462
93495
  /** @internal */
93463
93496
  this._hasMissingTiles = false;
93464
93497
  /** A function executed by `setView()` when `this._view` changes. */
@@ -97290,9 +97323,17 @@ function collectTransferables(document) {
97290
97323
  break;
97291
97324
  }
97292
97325
  };
97293
- for (const node of document.nodes)
97294
- for (const primitive of node.primitives)
97295
- addPrimitive(primitive);
97326
+ for (const node of document.nodes) {
97327
+ if (undefined !== node.groupId) {
97328
+ for (const primNode of node.nodes)
97329
+ for (const primitive of primNode.primitives)
97330
+ addPrimitive(primitive);
97331
+ }
97332
+ else {
97333
+ for (const primitive of node.primitives)
97334
+ addPrimitive(primitive);
97335
+ }
97336
+ }
97296
97337
  for (const primitives of document.patterns.values())
97297
97338
  for (const primitive of primitives)
97298
97339
  addPrimitive(primitive);
@@ -97579,7 +97620,8 @@ class Parser {
97579
97620
  y: this._document.rtcCenter[1] ?? 0,
97580
97621
  z: this._document.rtcCenter[2] ?? 0,
97581
97622
  } : undefined;
97582
- const nodes = this.parseNodes(featureTable);
97623
+ const primitiveNodes = this.parseNodes(featureTable);
97624
+ const nodes = this.groupPrimitiveNodes(primitiveNodes, featureTable);
97583
97625
  return {
97584
97626
  featureTable,
97585
97627
  nodes,
@@ -97698,8 +97740,12 @@ class Parser {
97698
97740
  const docPrimitives = docMesh.primitives;
97699
97741
  if (!docPrimitives)
97700
97742
  return;
97743
+ const primitives = docPrimitives.map((x) => this.parseNodePrimitive(x)).filter((x) => x !== undefined);
97744
+ if (primitives.length === 0)
97745
+ return;
97701
97746
  const nodesById = new Map();
97702
97747
  const getNode = (nodeId) => {
97748
+ nodeId = nodeId ?? _render_AnimationNodeId__WEBPACK_IMPORTED_MODULE_8__.AnimationNodeId.Untransformed;
97703
97749
  let node = nodesById.get(nodeId);
97704
97750
  if (!node) {
97705
97751
  node = {
@@ -97722,6 +97768,9 @@ class Parser {
97722
97768
  const nodeId = featureTable.getAnimationNodeId(featureIndex);
97723
97769
  return 0 !== nodeId && discreteNodeIds.has(nodeId) ? nodeId : 0;
97724
97770
  };
97771
+ this.splitPrimitives(primitives, featureTable, computeNodeId, getNode);
97772
+ }
97773
+ splitPrimitives(primitives, featureTable, computeNodeId, getPrimitivesNode) {
97725
97774
  const splitArgs = {
97726
97775
  maxDimension: this._options.maxVertexTableSize,
97727
97776
  computeNodeId,
@@ -97735,15 +97784,13 @@ class Parser {
97735
97784
  const material = (typeof imdl.material === "string") ? this.materialFromJson(imdl.material) : Material.create(toMaterialParams(imdl.material));
97736
97785
  return material ? { isAtlas: false, material } : undefined;
97737
97786
  };
97738
- for (const docPrimitive of docPrimitives) {
97739
- const primitive = this.parseNodePrimitive(docPrimitive);
97740
- if (!primitive)
97741
- continue;
97787
+ for (const primitive of primitives) {
97742
97788
  switch (primitive.type) {
97743
- case "pattern":
97744
- // ###TODO animated area patterns
97745
- getNode(_render_AnimationNodeId__WEBPACK_IMPORTED_MODULE_8__.AnimationNodeId.Untransformed).primitives.push(primitive);
97789
+ case "pattern": {
97790
+ // ###TODO splitting area patterns
97791
+ getPrimitivesNode(undefined).primitives.push(primitive);
97746
97792
  break;
97793
+ }
97747
97794
  case "mesh": {
97748
97795
  const mesh = primitive.params;
97749
97796
  const texMap = mesh.surface.textureMapping;
@@ -97780,8 +97827,9 @@ class Parser {
97780
97827
  }
97781
97828
  }
97782
97829
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(p.surface.textureMapping === undefined || p.surface.textureMapping.texture instanceof Texture);
97783
- getNode(nodeId).primitives.push({
97830
+ getPrimitivesNode(nodeId).primitives.push({
97784
97831
  type: "mesh",
97832
+ modifier: primitive.modifier,
97785
97833
  params: {
97786
97834
  vertices: fromVertexTable(p.vertices),
97787
97835
  surface: {
@@ -97809,8 +97857,9 @@ class Parser {
97809
97857
  };
97810
97858
  const split = (0,_render_primitives_VertexTableSplitter__WEBPACK_IMPORTED_MODULE_7__.splitPointStringParams)({ ...splitArgs, params });
97811
97859
  for (const [nodeId, p] of split) {
97812
- getNode(nodeId).primitives.push({
97860
+ getPrimitivesNode(nodeId).primitives.push({
97813
97861
  type: "point",
97862
+ modifier: primitive.modifier,
97814
97863
  params: {
97815
97864
  vertices: fromVertexTable(p.vertices),
97816
97865
  indices: p.indices.data,
@@ -97832,8 +97881,9 @@ class Parser {
97832
97881
  };
97833
97882
  const split = (0,_render_primitives_VertexTableSplitter__WEBPACK_IMPORTED_MODULE_7__.splitPolylineParams)({ ...splitArgs, params });
97834
97883
  for (const [nodeId, p] of split) {
97835
- getNode(nodeId).primitives.push({
97884
+ getPrimitivesNode(nodeId).primitives.push({
97836
97885
  type: "polyline",
97886
+ modifier: primitive.modifier,
97837
97887
  params: {
97838
97888
  ...p,
97839
97889
  vertices: fromVertexTable(p.vertices),
@@ -97850,6 +97900,52 @@ class Parser {
97850
97900
  }
97851
97901
  }
97852
97902
  }
97903
+ groupPrimitiveNodes(inputNodes, imdlFeatureTable) {
97904
+ const modelGroups = this._options.modelGroups;
97905
+ if (!modelGroups?.length)
97906
+ return inputNodes;
97907
+ const groupNodes = [];
97908
+ let orphanNode;
97909
+ const getGroupNode = (groupId) => {
97910
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(groupId <= modelGroups.length);
97911
+ if (groupId === modelGroups.length) {
97912
+ // This would happen if:
97913
+ // - The tile contains geometry from a model not present in modelGroups (should never occur); or
97914
+ // - The tile contains an area pattern (we haven't yet implemented splitting for them).
97915
+ // In either case, orphaned geometry will end up getting discarded.
97916
+ return orphanNode ?? (orphanNode = { groupId, nodes: [] });
97917
+ }
97918
+ let groupNode = groupNodes[groupId];
97919
+ if (!groupNode)
97920
+ groupNodes[groupId] = groupNode = { groupId, nodes: [] };
97921
+ return groupNode;
97922
+ };
97923
+ const featureTable = convertFeatureTable(imdlFeatureTable, this._options.batchModelId);
97924
+ const modelIdPair = { lower: 0, upper: 0 };
97925
+ const computeNodeId = (featureIndex) => {
97926
+ featureTable.getModelIdPair(featureIndex, modelIdPair);
97927
+ const modelId = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.fromUint32PairObject(modelIdPair);
97928
+ for (let i = 0; i < modelGroups.length; i++) {
97929
+ if (modelGroups[i].has(modelId))
97930
+ return i;
97931
+ }
97932
+ return modelGroups.length;
97933
+ };
97934
+ for (const inputNode of inputNodes) {
97935
+ // Indexed by model group index.
97936
+ const splitNodes = [];
97937
+ const getSplitNode = (groupIndex) => {
97938
+ groupIndex = groupIndex ?? modelGroups.length;
97939
+ if (!splitNodes[groupIndex]) {
97940
+ const splitNode = splitNodes[groupIndex] = { ...inputNode, primitives: [] };
97941
+ getGroupNode(groupIndex).nodes.push(splitNode);
97942
+ }
97943
+ return splitNodes[groupIndex];
97944
+ };
97945
+ this.splitPrimitives(inputNode.primitives, featureTable, computeNodeId, getSplitNode);
97946
+ }
97947
+ return groupNodes.filter((x) => undefined !== x);
97948
+ }
97853
97949
  parseTesselatedPolyline(json) {
97854
97950
  const indices = this.findBuffer(json.indices);
97855
97951
  const prevIndices = this.findBuffer(json.prevIndices);
@@ -110554,6 +110650,7 @@ class BranchState {
110554
110650
  get secondaryClassifiers() { return this._opts.secondaryClassifiers; }
110555
110651
  get realityModelDisplaySettings() { return this._opts.realityModelDisplaySettings; }
110556
110652
  get viewAttachmentId() { return this._opts.viewAttachmentId; }
110653
+ get groupNodeId() { return this._opts.groupNodeId; }
110557
110654
  get symbologyOverrides() {
110558
110655
  return this._opts.symbologyOverrides;
110559
110656
  }
@@ -110584,6 +110681,7 @@ class BranchState {
110584
110681
  appearanceProvider: branch.appearanceProvider ?? (branch.branch.symbologyOverrides ? undefined : prev.appearanceProvider),
110585
110682
  realityModelDisplaySettings: branch.branch.realityModelDisplaySettings ?? prev.realityModelDisplaySettings,
110586
110683
  viewAttachmentId: branch.viewAttachmentId ?? prev.viewAttachmentId,
110684
+ groupNodeId: branch.branch.groupNodeId ?? prev.groupNodeId,
110587
110685
  });
110588
110686
  }
110589
110687
  getFeatureAppearance(overrides, elemLo, elemHi, subcatLo, subcatHi, geomClass, modelLo, modelHi, type, animationNodeId) {
@@ -115004,6 +115102,9 @@ class Branch extends Graphic {
115004
115102
  this.branch.collectStatistics(stats);
115005
115103
  }
115006
115104
  shouldAddCommands(commands) {
115105
+ const group = commands.target.currentBranch.groupNodeId;
115106
+ if (undefined !== group && undefined !== this.branch.groupNodeId && this.branch.groupNodeId !== group)
115107
+ return false;
115007
115108
  const nodeId = commands.target.getAnimationTransformNodeId(this.branch.animationNodeId);
115008
115109
  return undefined === nodeId || nodeId === commands.target.currentAnimationTransformNodeId;
115009
115110
  }
@@ -141730,12 +141831,39 @@ function createPatternGraphic(params, options) {
141730
141831
  return branch.isEmpty ? undefined : options.system.createGraphicBranch(branch, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity(), { clipVolume });
141731
141832
  }
141732
141833
  function createNodeGraphics(node, options) {
141834
+ if (undefined === node.groupId)
141835
+ return createPrimitivesNodeGraphics(node, options);
141733
141836
  const graphics = [];
141837
+ for (const child of node.nodes) {
141838
+ graphics.push(...createPrimitivesNodeGraphics(child, options));
141839
+ }
141840
+ if (graphics.length === 0)
141841
+ return graphics;
141842
+ const branch = new _render_GraphicBranch__WEBPACK_IMPORTED_MODULE_7__.GraphicBranch(true);
141843
+ branch.groupNodeId = node.groupId;
141844
+ branch.entries.push(...graphics);
141845
+ return [options.system.createBranch(branch, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity())];
141846
+ }
141847
+ function createPrimitivesNodeGraphics(node, options) {
141848
+ let graphics = [];
141734
141849
  for (const primitive of node.primitives) {
141735
141850
  const graphic = primitive.type === "pattern" ? createPatternGraphic(primitive.params, options) : createPrimitiveGraphic(primitive, options);
141736
141851
  if (graphic)
141737
141852
  graphics.push(graphic);
141738
141853
  }
141854
+ if (!graphics.length)
141855
+ return graphics;
141856
+ if (undefined !== node.layerId) {
141857
+ const layerGraphic = 1 === graphics.length ? graphics[0] : options.system.createGraphicList(graphics);
141858
+ graphics = [options.system.createGraphicLayer(layerGraphic, node.layerId)];
141859
+ }
141860
+ else if (undefined !== node.animationNodeId) {
141861
+ const branch = new _render_GraphicBranch__WEBPACK_IMPORTED_MODULE_7__.GraphicBranch(true);
141862
+ branch.animationId = node.animationId;
141863
+ branch.animationNodeId = node.animationNodeId;
141864
+ branch.entries.push(...graphics);
141865
+ graphics = [options.system.createBranch(branch, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity())];
141866
+ }
141739
141867
  return graphics;
141740
141868
  }
141741
141869
  /** @internal */
@@ -141750,23 +141878,7 @@ async function decodeImdlGraphics(options) {
141750
141878
  const system = options.system;
141751
141879
  const graphics = [];
141752
141880
  for (const node of options.document.nodes) {
141753
- const nodeGraphics = createNodeGraphics(node, graphicsOptions);
141754
- if (nodeGraphics.length === 0)
141755
- continue;
141756
- if (undefined !== node.layerId) {
141757
- const layerGraphic = 1 === nodeGraphics.length ? nodeGraphics[0] : system.createGraphicList(nodeGraphics);
141758
- graphics.push(system.createGraphicLayer(layerGraphic, node.layerId));
141759
- }
141760
- else if (undefined !== node.animationNodeId) {
141761
- const branch = new _render_GraphicBranch__WEBPACK_IMPORTED_MODULE_7__.GraphicBranch(true);
141762
- branch.animationId = node.animationId;
141763
- branch.animationNodeId = node.animationNodeId;
141764
- branch.entries.push(...nodeGraphics);
141765
- graphics.push(system.createBranch(branch, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity()));
141766
- }
141767
- else {
141768
- graphics.push(...nodeGraphics);
141769
- }
141881
+ graphics.push(...createNodeGraphics(node, graphicsOptions));
141770
141882
  }
141771
141883
  switch (graphics.length) {
141772
141884
  case 0: return undefined;
@@ -141945,6 +142057,7 @@ async function readImdlContent(args) {
141945
142057
  maxVertexTableSize: _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.renderSystem.maxTextureSize,
141946
142058
  omitEdges: false === args.loadEdges,
141947
142059
  createUntransformedRootNode: args.containsTransformNodes,
142060
+ modelGroups: args.modelGroups,
141948
142061
  };
141949
142062
  const document = args.parseDocument ? (await args.parseDocument(parseOpts)) : (0,_common_imdl_ParseImdlDocument__WEBPACK_IMPORTED_MODULE_5__.parseImdlDocument)({ ...parseOpts, timeline: args.timeline });
141950
142063
  if (isCanceled())
@@ -147403,6 +147516,7 @@ class TileDrawArgs {
147403
147516
  this._appearanceProvider = params.appearanceProvider;
147404
147517
  this.hiddenLineSettings = params.hiddenLineSettings;
147405
147518
  this.animationTransformNodeId = params.animationTransformNodeId;
147519
+ this.groupNodeId = params.groupNodeId;
147406
147520
  this.boundingRange = params.boundingRange;
147407
147521
  this.maximumScreenSpaceError = params.maximumScreenSpaceError ?? 16; // 16 is Cesium's default.
147408
147522
  // Do not cull tiles based on clip volume if tiles outside clip are supposed to be drawn but in a different color.
@@ -147481,6 +147595,12 @@ class TileDrawArgs {
147481
147595
  let graphic = this.context.createGraphicBranch(graphics, this.location, opts);
147482
147596
  if (undefined !== this.animationTransformNodeId)
147483
147597
  graphic = this.context.renderSystem.createAnimationTransformNode(graphic, this.animationTransformNodeId);
147598
+ if (undefined !== this.groupNodeId) {
147599
+ const branch = new _render_GraphicBranch__WEBPACK_IMPORTED_MODULE_2__.GraphicBranch();
147600
+ branch.add(graphic);
147601
+ branch.groupNodeId = this.groupNodeId;
147602
+ graphic = this.context.createGraphicBranch(branch, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Transform.identity);
147603
+ }
147484
147604
  return graphic;
147485
147605
  }
147486
147606
  /** Output graphics for all accumulated tiles. */
@@ -148705,12 +148825,17 @@ class TileTreeReference /* implements RenderMemory.Consumer */ {
148705
148825
  appearanceProvider: this.getAppearanceProvider(tree),
148706
148826
  hiddenLineSettings: this.getHiddenLineSettings(tree),
148707
148827
  animationTransformNodeId: this.getAnimationTransformNodeId(tree),
148828
+ groupNodeId: this.getGroupNodeId(tree),
148708
148829
  });
148709
148830
  }
148710
148831
  /** @internal */
148711
148832
  getAnimationTransformNodeId(_tree) {
148712
148833
  return undefined;
148713
148834
  }
148835
+ /** @internal */
148836
+ getGroupNodeId(_tree) {
148837
+ return undefined;
148838
+ }
148714
148839
  /** Supply transform from this tile tree reference's location to iModel coordinate space.
148715
148840
  * @returns undefined if the TileTree is not yet loaded.
148716
148841
  */
@@ -172310,7 +172435,9 @@ class Geometry {
172310
172435
  /**
172311
172436
  * Clone an array whose members have type `T`, which implements the clone method.
172312
172437
  * * If the clone method returns `undefined`, then `undefined` is forced into the cloned array.
172438
+ * @deprecated in 4.x. Use cloneArray.
172313
172439
  */
172440
+ // eslint-disable-next-line deprecation/deprecation
172314
172441
  static cloneMembers(array) {
172315
172442
  if (array === undefined)
172316
172443
  return undefined;
@@ -172320,6 +172447,18 @@ class Geometry {
172320
172447
  }
172321
172448
  return clonedArray;
172322
172449
  }
172450
+ /**
172451
+ * Clone an array whose members have the cloneable type `T`.
172452
+ */
172453
+ static cloneArray(array) {
172454
+ if (array === undefined)
172455
+ return undefined;
172456
+ const clonedArray = [];
172457
+ for (const element of array) {
172458
+ clonedArray.push(element.clone());
172459
+ }
172460
+ return clonedArray;
172461
+ }
172323
172462
  }
172324
172463
  /** Tolerance for small distances in metric coordinates. */
172325
172464
  Geometry.smallMetricDistance = 1.0e-6;
@@ -183243,7 +183382,7 @@ __webpack_require__.r(__webpack_exports__);
183243
183382
  /* harmony export */ "BSplineWrapMode": () => (/* reexport safe */ _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_108__.BSplineWrapMode),
183244
183383
  /* harmony export */ "BagOfCurves": () => (/* reexport safe */ _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_64__.BagOfCurves),
183245
183384
  /* harmony export */ "BarycentricTriangle": () => (/* reexport safe */ _geometry3d_BarycentricTriangle__WEBPACK_IMPORTED_MODULE_3__.BarycentricTriangle),
183246
- /* harmony export */ "BentleyGeometryFlatBuffer": () => (/* reexport safe */ _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_128__.BentleyGeometryFlatBuffer),
183385
+ /* harmony export */ "BentleyGeometryFlatBuffer": () => (/* reexport safe */ _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_129__.BentleyGeometryFlatBuffer),
183247
183386
  /* harmony export */ "Bezier1dNd": () => (/* reexport safe */ _bspline_Bezier1dNd__WEBPACK_IMPORTED_MODULE_98__.Bezier1dNd),
183248
183387
  /* harmony export */ "BezierCoffs": () => (/* reexport safe */ _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_51__.BezierCoffs),
183249
183388
  /* harmony export */ "BezierCurve3d": () => (/* reexport safe */ _bspline_BezierCurve3d__WEBPACK_IMPORTED_MODULE_100__.BezierCurve3d),
@@ -183292,7 +183431,7 @@ __webpack_require__.r(__webpack_exports__);
183292
183431
  /* harmony export */ "CurveSearchStatus": () => (/* reexport safe */ _curve_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_66__.CurveSearchStatus),
183293
183432
  /* harmony export */ "CutLoop": () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.CutLoop),
183294
183433
  /* harmony export */ "CutLoopMergeContext": () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.CutLoopMergeContext),
183295
- /* harmony export */ "DeepCompare": () => (/* reexport safe */ _serialization_DeepCompare__WEBPACK_IMPORTED_MODULE_126__.DeepCompare),
183434
+ /* harmony export */ "DeepCompare": () => (/* reexport safe */ _serialization_DeepCompare__WEBPACK_IMPORTED_MODULE_127__.DeepCompare),
183296
183435
  /* harmony export */ "Degree2PowerPolynomial": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.Degree2PowerPolynomial),
183297
183436
  /* harmony export */ "Degree3PowerPolynomial": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.Degree3PowerPolynomial),
183298
183437
  /* harmony export */ "Degree4PowerPolynomial": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.Degree4PowerPolynomial),
@@ -183302,6 +183441,7 @@ __webpack_require__.r(__webpack_exports__);
183302
183441
  /* harmony export */ "EllipsoidPatch": () => (/* reexport safe */ _geometry3d_Ellipsoid__WEBPACK_IMPORTED_MODULE_5__.EllipsoidPatch),
183303
183442
  /* harmony export */ "FacetFaceData": () => (/* reexport safe */ _polyface_FacetFaceData__WEBPACK_IMPORTED_MODULE_111__.FacetFaceData),
183304
183443
  /* harmony export */ "FacetIntersectOptions": () => (/* reexport safe */ _polyface_FacetLocationDetail__WEBPACK_IMPORTED_MODULE_113__.FacetIntersectOptions),
183444
+ /* harmony export */ "FacetLocationDetailPair": () => (/* reexport safe */ _polyface_FacetLocationDetail__WEBPACK_IMPORTED_MODULE_113__.FacetLocationDetailPair),
183305
183445
  /* harmony export */ "FrameBuilder": () => (/* reexport safe */ _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_6__.FrameBuilder),
183306
183446
  /* harmony export */ "GaussMapper": () => (/* reexport safe */ _numerics_Quadrature__WEBPACK_IMPORTED_MODULE_56__.GaussMapper),
183307
183447
  /* harmony export */ "GeodesicPathPoint": () => (/* reexport safe */ _geometry3d_Ellipsoid__WEBPACK_IMPORTED_MODULE_5__.GeodesicPathPoint),
@@ -183315,10 +183455,7 @@ __webpack_require__.r(__webpack_exports__);
183315
183455
  /* harmony export */ "GrowableFloat64Array": () => (/* reexport safe */ _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_10__.GrowableFloat64Array),
183316
183456
  /* harmony export */ "GrowableXYArray": () => (/* reexport safe */ _geometry3d_GrowableXYArray__WEBPACK_IMPORTED_MODULE_11__.GrowableXYArray),
183317
183457
  /* harmony export */ "GrowableXYZArray": () => (/* reexport safe */ _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_12__.GrowableXYZArray),
183318
- /* harmony export */ "HalfEdge": () => (/* reexport safe */ _topology_Graph__WEBPACK_IMPORTED_MODULE_122__.HalfEdge),
183319
- /* harmony export */ "HalfEdgeGraph": () => (/* reexport safe */ _topology_Graph__WEBPACK_IMPORTED_MODULE_122__.HalfEdgeGraph),
183320
- /* harmony export */ "HalfEdgeMask": () => (/* reexport safe */ _topology_Graph__WEBPACK_IMPORTED_MODULE_122__.HalfEdgeMask),
183321
- /* harmony export */ "IModelJson": () => (/* reexport safe */ _serialization_IModelJsonSchema__WEBPACK_IMPORTED_MODULE_125__.IModelJson),
183458
+ /* harmony export */ "IModelJson": () => (/* reexport safe */ _serialization_IModelJsonSchema__WEBPACK_IMPORTED_MODULE_126__.IModelJson),
183322
183459
  /* harmony export */ "ImplicitLineXY": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.ImplicitLineXY),
183323
183460
  /* harmony export */ "IndexedCollectionInterval": () => (/* reexport safe */ _geometry3d_IndexedCollectionInterval__WEBPACK_IMPORTED_MODULE_13__.IndexedCollectionInterval),
183324
183461
  /* harmony export */ "IndexedPolyface": () => (/* reexport safe */ _polyface_Polyface__WEBPACK_IMPORTED_MODULE_112__.IndexedPolyface),
@@ -183337,6 +183474,7 @@ __webpack_require__.r(__webpack_exports__);
183337
183474
  /* harmony export */ "KnotVector": () => (/* reexport safe */ _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_108__.KnotVector),
183338
183475
  /* harmony export */ "LineSegment3d": () => (/* reexport safe */ _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_72__.LineSegment3d),
183339
183476
  /* harmony export */ "LineString3d": () => (/* reexport safe */ _curve_LineString3d__WEBPACK_IMPORTED_MODULE_73__.LineString3d),
183477
+ /* harmony export */ "LineString3dRangeTreeContext": () => (/* reexport safe */ _polyface_RangeTree_LineString3dRangeTreeContext__WEBPACK_IMPORTED_MODULE_122__.LineString3dRangeTreeContext),
183340
183478
  /* harmony export */ "LinearSweep": () => (/* reexport safe */ _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_90__.LinearSweep),
183341
183479
  /* harmony export */ "LongitudeLatitudeNumber": () => (/* reexport safe */ _geometry3d_LongitudeLatitudeAltitude__WEBPACK_IMPORTED_MODULE_2__.LongitudeLatitudeNumber),
183342
183480
  /* harmony export */ "Loop": () => (/* reexport safe */ _curve_Loop__WEBPACK_IMPORTED_MODULE_74__.Loop),
@@ -183372,6 +183510,7 @@ __webpack_require__.r(__webpack_exports__);
183372
183510
  /* harmony export */ "Point3dArray": () => (/* reexport safe */ _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_24__.Point3dArray),
183373
183511
  /* harmony export */ "Point3dArrayCarrier": () => (/* reexport safe */ _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_25__.Point3dArrayCarrier),
183374
183512
  /* harmony export */ "Point3dArrayPolygonOps": () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.Point3dArrayPolygonOps),
183513
+ /* harmony export */ "Point3dArrayRangeTreeContext": () => (/* reexport safe */ _polyface_RangeTree_Point3dArrayRangeTreeContext__WEBPACK_IMPORTED_MODULE_121__.Point3dArrayRangeTreeContext),
183375
183514
  /* harmony export */ "Point4d": () => (/* reexport safe */ _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_47__.Point4d),
183376
183515
  /* harmony export */ "Point4dArray": () => (/* reexport safe */ _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_24__.Point4dArray),
183377
183516
  /* harmony export */ "PointString3d": () => (/* reexport safe */ _curve_PointString3d__WEBPACK_IMPORTED_MODULE_80__.PointString3d),
@@ -183381,8 +183520,10 @@ __webpack_require__.r(__webpack_exports__);
183381
183520
  /* harmony export */ "PolyfaceClip": () => (/* reexport safe */ _polyface_PolyfaceClip__WEBPACK_IMPORTED_MODULE_120__.PolyfaceClip),
183382
183521
  /* harmony export */ "PolyfaceData": () => (/* reexport safe */ _polyface_PolyfaceData__WEBPACK_IMPORTED_MODULE_118__.PolyfaceData),
183383
183522
  /* harmony export */ "PolyfaceQuery": () => (/* reexport safe */ _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_119__.PolyfaceQuery),
183523
+ /* harmony export */ "PolyfaceRangeTreeContext": () => (/* reexport safe */ _polyface_RangeTree_PolyfaceRangeTreeContext__WEBPACK_IMPORTED_MODULE_123__.PolyfaceRangeTreeContext),
183384
183524
  /* harmony export */ "PolygonLocation": () => (/* reexport safe */ _Geometry__WEBPACK_IMPORTED_MODULE_36__.PolygonLocation),
183385
183525
  /* harmony export */ "PolygonLocationDetail": () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.PolygonLocationDetail),
183526
+ /* harmony export */ "PolygonLocationDetailPair": () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.PolygonLocationDetailPair),
183386
183527
  /* harmony export */ "PolygonOps": () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.PolygonOps),
183387
183528
  /* harmony export */ "PolylineOps": () => (/* reexport safe */ _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_26__.PolylineOps),
183388
183529
  /* harmony export */ "PowerPolynomial": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.PowerPolynomial),
@@ -183403,24 +183544,24 @@ __webpack_require__.r(__webpack_exports__);
183403
183544
  /* harmony export */ "RegionOps": () => (/* reexport safe */ _curve_RegionOps__WEBPACK_IMPORTED_MODULE_79__.RegionOps),
183404
183545
  /* harmony export */ "RotationalSweep": () => (/* reexport safe */ _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_91__.RotationalSweep),
183405
183546
  /* harmony export */ "RuledSweep": () => (/* reexport safe */ _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_92__.RuledSweep),
183406
- /* harmony export */ "Sample": () => (/* reexport safe */ _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_127__.Sample),
183547
+ /* harmony export */ "Sample": () => (/* reexport safe */ _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_128__.Sample),
183407
183548
  /* harmony export */ "Segment1d": () => (/* reexport safe */ _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_31__.Segment1d),
183408
183549
  /* harmony export */ "SineCosinePolynomial": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.SineCosinePolynomial),
183409
183550
  /* harmony export */ "SmallSystem": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.SmallSystem),
183410
183551
  /* harmony export */ "SmoothTransformBetweenFrusta": () => (/* reexport safe */ _geometry3d_FrustumAnimation__WEBPACK_IMPORTED_MODULE_7__.SmoothTransformBetweenFrusta),
183411
183552
  /* harmony export */ "SolidPrimitive": () => (/* reexport safe */ _solid_SolidPrimitive__WEBPACK_IMPORTED_MODULE_93__.SolidPrimitive),
183412
- /* harmony export */ "SpacePolygonTriangulation": () => (/* reexport safe */ _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_124__.SpacePolygonTriangulation),
183553
+ /* harmony export */ "SpacePolygonTriangulation": () => (/* reexport safe */ _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_125__.SpacePolygonTriangulation),
183413
183554
  /* harmony export */ "Sphere": () => (/* reexport safe */ _solid_Sphere__WEBPACK_IMPORTED_MODULE_94__.Sphere),
183414
183555
  /* harmony export */ "SphereImplicit": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.SphereImplicit),
183415
183556
  /* harmony export */ "StandardViewIndex": () => (/* reexport safe */ _Geometry__WEBPACK_IMPORTED_MODULE_36__.StandardViewIndex),
183416
- /* harmony export */ "SteppedIndexFunctionFactory": () => (/* reexport safe */ _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_127__.SteppedIndexFunctionFactory),
183557
+ /* harmony export */ "SteppedIndexFunctionFactory": () => (/* reexport safe */ _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_128__.SteppedIndexFunctionFactory),
183417
183558
  /* harmony export */ "StringifiedClipVector": () => (/* reexport safe */ _clipping_ClipVector__WEBPACK_IMPORTED_MODULE_43__.StringifiedClipVector),
183418
183559
  /* harmony export */ "StrokeCountMap": () => (/* reexport safe */ _curve_Query_StrokeCountMap__WEBPACK_IMPORTED_MODULE_87__.StrokeCountMap),
183419
183560
  /* harmony export */ "StrokeOptions": () => (/* reexport safe */ _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_82__.StrokeOptions),
183420
183561
  /* harmony export */ "SweepContour": () => (/* reexport safe */ _solid_SweepContour__WEBPACK_IMPORTED_MODULE_95__.SweepContour),
183421
183562
  /* harmony export */ "SweepLineStringToFacetsOptions": () => (/* reexport safe */ _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_119__.SweepLineStringToFacetsOptions),
183422
- /* harmony export */ "TaggedNumericConstants": () => (/* reexport safe */ _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_121__.TaggedNumericConstants),
183423
- /* harmony export */ "TaggedNumericData": () => (/* reexport safe */ _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_121__.TaggedNumericData),
183563
+ /* harmony export */ "TaggedNumericConstants": () => (/* reexport safe */ _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_124__.TaggedNumericConstants),
183564
+ /* harmony export */ "TaggedNumericData": () => (/* reexport safe */ _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_124__.TaggedNumericData),
183424
183565
  /* harmony export */ "TorusImplicit": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.TorusImplicit),
183425
183566
  /* harmony export */ "TorusPipe": () => (/* reexport safe */ _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_96__.TorusPipe),
183426
183567
  /* harmony export */ "Transform": () => (/* reexport safe */ _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_32__.Transform),
@@ -183428,7 +183569,6 @@ __webpack_require__.r(__webpack_exports__);
183428
183569
  /* harmony export */ "TriDiagonalSystem": () => (/* reexport safe */ _numerics_TriDiagonalSystem__WEBPACK_IMPORTED_MODULE_58__.TriDiagonalSystem),
183429
183570
  /* harmony export */ "TriangleLocationDetail": () => (/* reexport safe */ _geometry3d_BarycentricTriangle__WEBPACK_IMPORTED_MODULE_3__.TriangleLocationDetail),
183430
183571
  /* harmony export */ "TriangularFacetLocationDetail": () => (/* reexport safe */ _polyface_FacetLocationDetail__WEBPACK_IMPORTED_MODULE_113__.TriangularFacetLocationDetail),
183431
- /* harmony export */ "Triangulator": () => (/* reexport safe */ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_123__.Triangulator),
183432
183572
  /* harmony export */ "TrigPolynomial": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.TrigPolynomial),
183433
183573
  /* harmony export */ "UVSelect": () => (/* reexport safe */ _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_106__.UVSelect),
183434
183574
  /* harmony export */ "UVSurfaceOps": () => (/* reexport safe */ _geometry3d_UVSurfaceOps__WEBPACK_IMPORTED_MODULE_33__.UVSurfaceOps),
@@ -183567,14 +183707,15 @@ __webpack_require__.r(__webpack_exports__);
183567
183707
  /* harmony import */ var _polyface_PolyfaceData__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(/*! ./polyface/PolyfaceData */ "../../core/geometry/lib/esm/polyface/PolyfaceData.js");
183568
183708
  /* harmony import */ var _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(/*! ./polyface/PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
183569
183709
  /* harmony import */ var _polyface_PolyfaceClip__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(/*! ./polyface/PolyfaceClip */ "../../core/geometry/lib/esm/polyface/PolyfaceClip.js");
183570
- /* harmony import */ var _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(/*! ./polyface/TaggedNumericData */ "../../core/geometry/lib/esm/polyface/TaggedNumericData.js");
183571
- /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(/*! ./topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
183572
- /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(/*! ./topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
183573
- /* harmony import */ var _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(/*! ./topology/SpaceTriangulation */ "../../core/geometry/lib/esm/topology/SpaceTriangulation.js");
183574
- /* harmony import */ var _serialization_IModelJsonSchema__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(/*! ./serialization/IModelJsonSchema */ "../../core/geometry/lib/esm/serialization/IModelJsonSchema.js");
183575
- /* harmony import */ var _serialization_DeepCompare__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(/*! ./serialization/DeepCompare */ "../../core/geometry/lib/esm/serialization/DeepCompare.js");
183576
- /* harmony import */ var _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(/*! ./serialization/GeometrySamples */ "../../core/geometry/lib/esm/serialization/GeometrySamples.js");
183577
- /* harmony import */ var _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(/*! ./serialization/BentleyGeometryFlatBuffer */ "../../core/geometry/lib/esm/serialization/BentleyGeometryFlatBuffer.js");
183710
+ /* harmony import */ var _polyface_RangeTree_Point3dArrayRangeTreeContext__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(/*! ./polyface/RangeTree/Point3dArrayRangeTreeContext */ "../../core/geometry/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js");
183711
+ /* harmony import */ var _polyface_RangeTree_LineString3dRangeTreeContext__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(/*! ./polyface/RangeTree/LineString3dRangeTreeContext */ "../../core/geometry/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js");
183712
+ /* harmony import */ var _polyface_RangeTree_PolyfaceRangeTreeContext__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(/*! ./polyface/RangeTree/PolyfaceRangeTreeContext */ "../../core/geometry/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js");
183713
+ /* harmony import */ var _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(/*! ./polyface/TaggedNumericData */ "../../core/geometry/lib/esm/polyface/TaggedNumericData.js");
183714
+ /* harmony import */ var _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(/*! ./topology/SpaceTriangulation */ "../../core/geometry/lib/esm/topology/SpaceTriangulation.js");
183715
+ /* harmony import */ var _serialization_IModelJsonSchema__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(/*! ./serialization/IModelJsonSchema */ "../../core/geometry/lib/esm/serialization/IModelJsonSchema.js");
183716
+ /* harmony import */ var _serialization_DeepCompare__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(/*! ./serialization/DeepCompare */ "../../core/geometry/lib/esm/serialization/DeepCompare.js");
183717
+ /* harmony import */ var _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(/*! ./serialization/GeometrySamples */ "../../core/geometry/lib/esm/serialization/GeometrySamples.js");
183718
+ /* harmony import */ var _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(/*! ./serialization/BentleyGeometryFlatBuffer */ "../../core/geometry/lib/esm/serialization/BentleyGeometryFlatBuffer.js");
183578
183719
  /*---------------------------------------------------------------------------------------------
183579
183720
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
183580
183721
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -183825,6 +183966,7 @@ __webpack_require__.r(__webpack_exports__);
183825
183966
 
183826
183967
 
183827
183968
 
183969
+
183828
183970
 
183829
183971
 
183830
183972
  /***/ }),
@@ -185708,7 +185850,7 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
185708
185850
  const distanceA = startFraction * this._totalLength;
185709
185851
  const distanceB = distanceA + signedDistance;
185710
185852
  const fragmentB = this.chainDistanceToFragment(distanceB, true);
185711
- const childDetail = fragmentB.childCurve.moveSignedDistanceFromFraction(fragmentB.childFraction0, distanceB - fragmentB.chainDistance0, allowExtension, result); // local detail related to the child curve
185853
+ const childDetail = fragmentB.childCurve.moveSignedDistanceFromFraction(fragmentB.childFraction0, distanceB - fragmentB.chainDistance0, allowExtension, result?.childDetail); // local detail related to the child curve
185712
185854
  const endFraction = startFraction + (signedDistance / this._totalLength);
185713
185855
  const chainDetail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__.CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, endFraction, signedDistance, result); // global detail related to the curve chain
185714
185856
  chainDetail.childDetail = childDetail;
@@ -185819,8 +185961,8 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
185819
185961
  }
185820
185962
  /**
185821
185963
  * Compute the global chain detail corresponding to a local child detail.
185822
- * @param childDetail the local detail, with respect to a child of this chain.
185823
- * @returns the global detail, with respect to this chain.
185964
+ * @param childDetail the local (fragment) detail, captured.
185965
+ * @returns newly allocated global (chain) detail with `childDetail` field pointing to the input, and `a` field copied from the input
185824
185966
  */
185825
185967
  computeChainDetail(childDetail) {
185826
185968
  if (!childDetail.curve)
@@ -186466,8 +186608,7 @@ __webpack_require__.r(__webpack_exports__);
186466
186608
  * @module Curve
186467
186609
  */
186468
186610
 
186469
- /** module Curve */
186470
- /** enumeration of condition for extending a curve beyond start or end point.
186611
+ /** Enumeration of condition for extending a curve beyond start or end point.
186471
186612
  * * Not all CurvePrimitives support these modes.
186472
186613
  * @public
186473
186614
  */
@@ -186484,10 +186625,12 @@ var CurveExtendMode;
186484
186625
  * @public
186485
186626
  */
186486
186627
  class CurveExtendOptions {
186487
- /** Given an ExtendParameter, isolate the particular CurveExtendOptions in effect at an end.
186488
- * * Return undefined if `param === false`
186489
- * * return the (strongly typed) pointer to the param if it is a single CurveExtendOptions.
186490
- * * Return dereferenced array entry 0 or 1 if the param is an array of CurveExtendOptions.
186628
+ /**
186629
+ * Given an VariantCurveExtendParameter, isolate the particular CurveExtendMode in effect at an end.
186630
+ * * Return `CurveExtendMode.None` if `param === false`.
186631
+ * * Return `CurveExtendMode.OnCurve` if `param === true`.
186632
+ * * Return the param if it is a single CurveExtendMode.
186633
+ * * Return dereferenced array at entry `endIndex` if the param is an array of CurveExtendMode.
186491
186634
  */
186492
186635
  static resolveVariantCurveExtendParameterToCurveExtendMode(param, endIndex) {
186493
186636
  if (param === false)
@@ -187254,17 +187397,14 @@ var CurveSearchStatus;
187254
187397
  CurveSearchStatus[CurveSearchStatus["stoppedAtBoundary"] = 2] = "stoppedAtBoundary";
187255
187398
  })(CurveSearchStatus || (CurveSearchStatus = {}));
187256
187399
  /**
187257
- * Use to update a vector in case where source and prior result are both possibly undefined.
187400
+ * Use to update a cloneable object when source and/or prior result are possibly undefined.
187258
187401
  * * Any undefined source returns undefined.
187259
187402
  * * For defined source, reuse optional result if available.
187260
187403
  * @param source optional source
187261
187404
  * @param result optional result
187262
187405
  */
187263
- function optionalVectorUpdate(source, result) {
187264
- if (source) {
187265
- return source.clone(result);
187266
- }
187267
- return undefined;
187406
+ function optionalUpdate(source, result) {
187407
+ return source ? source.clone(result) : undefined;
187268
187408
  }
187269
187409
  /**
187270
187410
  * CurveLocationDetail carries point and parameter data about a point evaluated on a curve.
@@ -187331,10 +187471,11 @@ class CurveLocationDetail {
187331
187471
  result.curve = this.curve;
187332
187472
  result.fraction = this.fraction;
187333
187473
  result.fraction1 = this.fraction1;
187334
- result.point1 = this.point1;
187474
+ result.point1 = optionalUpdate(this.point1, result.point1);
187335
187475
  result.point.setFromPoint3d(this.point);
187336
- result.vectorInCurveLocationDetail = optionalVectorUpdate(this.vectorInCurveLocationDetail, result.vectorInCurveLocationDetail);
187476
+ result.vectorInCurveLocationDetail = optionalUpdate(this.vectorInCurveLocationDetail, result.vectorInCurveLocationDetail);
187337
187477
  result.a = this.a;
187478
+ result.childDetail = optionalUpdate(this.childDetail, result.childDetail);
187338
187479
  result.curveSearchStatus = this.curveSearchStatus;
187339
187480
  return result;
187340
187481
  }
@@ -187349,8 +187490,8 @@ class CurveLocationDetail {
187349
187490
  */
187350
187491
  setFP(fraction, point, vector, a = 0.0) {
187351
187492
  this.fraction = fraction;
187352
- this.point.setFrom(point);
187353
- this.vectorInCurveLocationDetail = optionalVectorUpdate(vector, this.vectorInCurveLocationDetail);
187493
+ this.point.setFromPoint3d(point);
187494
+ this.vectorInCurveLocationDetail = optionalUpdate(vector, this.vectorInCurveLocationDetail);
187354
187495
  this.a = a;
187355
187496
  }
187356
187497
  /**
@@ -187386,6 +187527,7 @@ class CurveLocationDetail {
187386
187527
  result.point.setFromPoint3d(point);
187387
187528
  result.vectorInCurveLocationDetail = undefined;
187388
187529
  result.a = 0.0;
187530
+ result.childDetail = undefined;
187389
187531
  result.curveSearchStatus = undefined;
187390
187532
  return result;
187391
187533
  }
@@ -187405,6 +187547,7 @@ class CurveLocationDetail {
187405
187547
  result.point.setFromPoint3d(point);
187406
187548
  result.vectorInCurveLocationDetail = undefined;
187407
187549
  result.a = distance;
187550
+ result.childDetail = undefined;
187408
187551
  result.curveSearchStatus = status;
187409
187552
  return result;
187410
187553
  }
@@ -187428,9 +187571,10 @@ class CurveLocationDetail {
187428
187571
  result = result ? result : new CurveLocationDetail();
187429
187572
  result.curve = curve;
187430
187573
  result.fraction = endFraction;
187431
- result.point = curve.fractionToPoint(endFraction, result.point);
187574
+ curve.fractionToPoint(endFraction, result.point);
187432
187575
  result.vectorInCurveLocationDetail = undefined;
187433
187576
  result.a = a;
187577
+ result.childDetail = undefined;
187434
187578
  result.curveSearchStatus = status;
187435
187579
  return result;
187436
187580
  }
@@ -187439,10 +187583,11 @@ class CurveLocationDetail {
187439
187583
  result = result ? result : new CurveLocationDetail();
187440
187584
  result.curve = curve;
187441
187585
  result.fraction = fraction;
187442
- result.point = curve.fractionToPoint(fraction);
187586
+ curve.fractionToPoint(fraction, result.point);
187443
187587
  result.vectorInCurveLocationDetail = undefined;
187444
- result.curveSearchStatus = undefined;
187445
187588
  result.a = 0.0;
187589
+ result.childDetail = undefined;
187590
+ result.curveSearchStatus = undefined;
187446
187591
  return result;
187447
187592
  }
187448
187593
  /** Create with CurvePrimitive pointer and fraction for evaluation. */
@@ -187451,10 +187596,11 @@ class CurveLocationDetail {
187451
187596
  result.curve = curve;
187452
187597
  result.fraction = fraction;
187453
187598
  const ray = curve.fractionToPointAndDerivative(fraction);
187454
- result.point = ray.origin;
187599
+ result.point.setFromPoint3d(ray.origin);
187455
187600
  result.vectorInCurveLocationDetail = ray.direction;
187456
- result.curveSearchStatus = undefined;
187457
187601
  result.a = 0.0;
187602
+ result.childDetail = undefined;
187603
+ result.curveSearchStatus = undefined;
187458
187604
  return result;
187459
187605
  }
187460
187606
  /** Create with CurvePrimitive pointer and 2 fractions for evaluation. */
@@ -187462,12 +187608,13 @@ class CurveLocationDetail {
187462
187608
  result = result ? result : new CurveLocationDetail();
187463
187609
  result.curve = curve;
187464
187610
  result.fraction = fraction0;
187465
- result.point = curve.fractionToPoint(fraction0);
187611
+ curve.fractionToPoint(fraction0, result.point);
187466
187612
  result.fraction1 = fraction1;
187467
- result.point1 = curve.fractionToPoint(fraction1);
187613
+ result.point1 = curve.fractionToPoint(fraction1, result.point1);
187468
187614
  result.vectorInCurveLocationDetail = undefined;
187469
- result.curveSearchStatus = undefined;
187470
187615
  result.a = 0.0;
187616
+ result.childDetail = undefined;
187617
+ result.curveSearchStatus = undefined;
187471
187618
  return result;
187472
187619
  }
187473
187620
  /** Create with CurvePrimitive pointer, fraction, and point coordinates. */
@@ -187478,6 +187625,7 @@ class CurveLocationDetail {
187478
187625
  result.point.setFromPoint3d(point);
187479
187626
  result.vectorInCurveLocationDetail = undefined;
187480
187627
  result.a = a;
187628
+ result.childDetail = undefined;
187481
187629
  result.curveSearchStatus = undefined;
187482
187630
  return result;
187483
187631
  }
@@ -188780,21 +188928,30 @@ __webpack_require__.r(__webpack_exports__);
188780
188928
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
188781
188929
  /* harmony export */ "LineSegment3d": () => (/* binding */ LineSegment3d)
188782
188930
  /* harmony export */ });
188783
- /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
188784
- /* harmony import */ var _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndVectors */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndVectors.js");
188785
- /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
188786
- /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
188787
- /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
188788
- /* harmony import */ var _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../numerics/BezierPolynomials */ "../../core/geometry/lib/esm/numerics/BezierPolynomials.js");
188789
- /* harmony import */ var _CurveExtendMode__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CurveExtendMode */ "../../core/geometry/lib/esm/curve/CurveExtendMode.js");
188790
- /* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
188791
- /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
188792
- /* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
188793
- /* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
188931
+ /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
188932
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
188933
+ /* harmony import */ var _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndVectors */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndVectors.js");
188934
+ /* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
188935
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
188936
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
188937
+ /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
188938
+ /* harmony import */ var _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../numerics/BezierPolynomials */ "../../core/geometry/lib/esm/numerics/BezierPolynomials.js");
188939
+ /* harmony import */ var _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../numerics/Polynomials */ "../../core/geometry/lib/esm/numerics/Polynomials.js");
188940
+ /* harmony import */ var _CurveExtendMode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./CurveExtendMode */ "../../core/geometry/lib/esm/curve/CurveExtendMode.js");
188941
+ /* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
188942
+ /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
188943
+ /* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
188944
+ /* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
188794
188945
  /*---------------------------------------------------------------------------------------------
188795
188946
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
188796
188947
  * See LICENSE.md in the project root for license terms and full copyright notice.
188797
188948
  *--------------------------------------------------------------------------------------------*/
188949
+ /** @packageDocumentation
188950
+ * @module Curve
188951
+ */
188952
+
188953
+
188954
+
188798
188955
 
188799
188956
 
188800
188957
 
@@ -188821,7 +188978,7 @@ __webpack_require__.r(__webpack_exports__);
188821
188978
  * ```
188822
188979
  * @public
188823
188980
  */
188824
- class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePrimitive {
188981
+ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive {
188825
188982
  /** Test if `other` is of class `LineSegment3d` */
188826
188983
  isSameGeometryClass(other) {
188827
188984
  return other instanceof LineSegment3d;
@@ -188889,7 +189046,7 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
188889
189046
  }
188890
189047
  /** Return the point and derivative vector at fractional position along the line segment. */
188891
189048
  fractionToPointAndDerivative(fraction, result) {
188892
- result = result ? result : _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_1__.Ray3d.createZero();
189049
+ result = result ? result : _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_2__.Ray3d.createZero();
188893
189050
  result.direction.setStartEnd(this._point0, this._point1);
188894
189051
  this._point0.interpolate(fraction, this._point1, result.origin);
188895
189052
  return result;
@@ -188901,7 +189058,7 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
188901
189058
  * * y axis is the second derivative, i.e. 000
188902
189059
  */
188903
189060
  fractionToPointAnd2Derivatives(fraction, result) {
188904
- result = result ? result : _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_2__.Plane3dByOriginAndVectors.createXYPlane();
189061
+ result = result ? result : _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_3__.Plane3dByOriginAndVectors.createXYPlane();
188905
189062
  result.vectorU.setStartEnd(this._point0, this._point1);
188906
189063
  result.vectorV.set(0, 0, 0);
188907
189064
  this._point0.interpolate(fraction, this._point1, result.origin);
@@ -188944,7 +189101,7 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
188944
189101
  result._point1.set(x1, y1, z);
188945
189102
  return result;
188946
189103
  }
188947
- return new LineSegment3d(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(x0, y0, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(x1, y1, z));
189104
+ return new LineSegment3d(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Point3d.create(x0, y0, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Point3d.create(x1, y1, z));
188948
189105
  }
188949
189106
  /**
188950
189107
  * Create a LineSegment3d from xy coordinates of start and end, with common z.
@@ -188961,7 +189118,7 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
188961
189118
  result._point1.set(x1, y1, z1);
188962
189119
  return result;
188963
189120
  }
188964
- return new LineSegment3d(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(x0, y0, z0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(x1, y1, z1));
189121
+ return new LineSegment3d(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Point3d.create(x0, y0, z0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Point3d.create(x1, y1, z1));
188965
189122
  }
188966
189123
  /** Return the point at fractional position along the line segment. */
188967
189124
  fractionToPoint(fraction, result) {
@@ -188984,19 +189141,118 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
188984
189141
  * @param spacePoint point in space
188985
189142
  * @param extend if false, only return points within the bounded line segment. If true, allow the point to be on
188986
189143
  * the unbounded line that contains the bounded segment.
189144
+ * @param result optional pre-allocated object to populate and return
189145
+ * @returns detail, with `a` field set to the distance from `spacePoint` to the closest point
188987
189146
  */
188988
189147
  closestPoint(spacePoint, extend, result) {
188989
189148
  let fraction = spacePoint.fractionOfProjectionToLine(this._point0, this._point1, 0.0);
188990
- fraction = _CurveExtendMode__WEBPACK_IMPORTED_MODULE_4__.CurveExtendOptions.correctFraction(extend, fraction);
188991
- result = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_5__.CurveLocationDetail.create(this, result);
188992
- // remark: This can be done by result.setFP (fraction, thePoint, undefined, a)
188993
- // but that creates a temporary point.
189149
+ fraction = _CurveExtendMode__WEBPACK_IMPORTED_MODULE_5__.CurveExtendOptions.correctFraction(extend, fraction);
189150
+ result = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.create(this, result);
188994
189151
  result.fraction = fraction;
188995
189152
  this._point0.interpolate(fraction, this._point1, result.point);
188996
189153
  result.vectorInCurveLocationDetail = undefined;
188997
189154
  result.a = result.point.distance(spacePoint);
188998
189155
  return result;
188999
189156
  }
189157
+ /**
189158
+ * Compute the closest approach between a pair of line segments.
189159
+ * * The approach distance is returned in the `a` fields of the details.
189160
+ * @param segmentA first line segment
189161
+ * @param extendA how to extend segmentA forward/backward
189162
+ * @param segmentB second line segment
189163
+ * @param extendB how to extend segmentB forward/backward
189164
+ * @param result optional pre-allocated object to populate and return
189165
+ * @returns pair of details, one per segment, each with `a` field set to the closest approach distance
189166
+ */
189167
+ static closestApproach(segmentA, extendA, segmentB, extendB, result) {
189168
+ const unboundedFractions = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_7__.Vector2d.create();
189169
+ if (result === undefined)
189170
+ result = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetailPair.createCapture(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.create(), _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.create());
189171
+ if (_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegment3dClosestApproachUnbounded(segmentA._point0, segmentA._point1, segmentB._point0, segmentB._point1, unboundedFractions)) {
189172
+ // There is a simple approach between the unbounded segments. Maybe its a really easy case ...
189173
+ const fractionA = _CurveExtendMode__WEBPACK_IMPORTED_MODULE_5__.CurveExtendOptions.correctFraction(extendA, unboundedFractions.x);
189174
+ const fractionB = _CurveExtendMode__WEBPACK_IMPORTED_MODULE_5__.CurveExtendOptions.correctFraction(extendB, unboundedFractions.y);
189175
+ // if neither fraction was corrected, just accept !!!
189176
+ if (fractionA === unboundedFractions.x && fractionB === unboundedFractions.y) {
189177
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveEvaluatedFraction(segmentA, fractionA, result.detailA);
189178
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveEvaluatedFraction(segmentB, fractionB, result.detailB);
189179
+ result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);
189180
+ return result;
189181
+ }
189182
+ // One or both of the fractions were clamped back to an endpoint.
189183
+ // Claim: (????!!!????) The only proximity candidates that matter are from clamped point onto the other.
189184
+ if (fractionA !== unboundedFractions.x && fractionB !== unboundedFractions.y) {
189185
+ // Fill in (in the result) both individual details with "projected" points and distance.
189186
+ // The "loser" will have its contents replaced.
189187
+ const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;
189188
+ const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;
189189
+ segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);
189190
+ segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);
189191
+ if (result.detailA.a <= result.detailB.a) {
189192
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveFractionPoint(segmentB, fractionB, clampedPointOnB, result.detailB);
189193
+ }
189194
+ else {
189195
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveFractionPoint(segmentA, fractionA, clampedPointOnA, result.detailA);
189196
+ }
189197
+ }
189198
+ else if (fractionB !== unboundedFractions.y) {
189199
+ // B (only) was clamped.
189200
+ const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;
189201
+ segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);
189202
+ result.detailB.setCurve(segmentB);
189203
+ result.detailB.point.setFrom(clampedPointOnB);
189204
+ result.detailB.fraction = fractionB;
189205
+ }
189206
+ else {
189207
+ // fractionA was clamped.
189208
+ const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;
189209
+ segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);
189210
+ result.detailA.setCurve(segmentA);
189211
+ result.detailA.point.setFrom(clampedPointOnA);
189212
+ result.detailA.fraction = fractionA;
189213
+ }
189214
+ result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);
189215
+ return result;
189216
+ }
189217
+ // (probably? certainly?) parallel (possibly coincident) lines.
189218
+ // run all 4 endpoint-to-other cases . . . reassemble carefully ...
189219
+ const resultSet = [
189220
+ segmentA.closestPoint(segmentB._point0, extendA),
189221
+ segmentA.closestPoint(segmentB._point1, extendA),
189222
+ segmentB.closestPoint(segmentA._point0, extendB),
189223
+ segmentB.closestPoint(segmentA._point1, extendB),
189224
+ ];
189225
+ let dMin = resultSet[0].a;
189226
+ let iMin = 0;
189227
+ for (let i = 1; i < 4; i++) {
189228
+ if (resultSet[i].a < dMin) {
189229
+ iMin = i;
189230
+ dMin = resultSet[i].a;
189231
+ }
189232
+ }
189233
+ if (iMin === 0) {
189234
+ resultSet[0].clone(result.detailA);
189235
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 0.0, result.detailB);
189236
+ result.detailB.a = result.detailA.a;
189237
+ }
189238
+ else if (iMin === 1) {
189239
+ resultSet[1].clone(result.detailA);
189240
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 1.0, result.detailB);
189241
+ result.detailB.a = result.detailA.a;
189242
+ }
189243
+ else if (iMin === 2) {
189244
+ resultSet[2].clone(result.detailB);
189245
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 0.0, result.detailA);
189246
+ result.detailA.a = result.detailB.a;
189247
+ }
189248
+ else {
189249
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(iMin === 3);
189250
+ resultSet[3].clone(result.detailB);
189251
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 1.0, result.detailA);
189252
+ result.detailA.a = result.detailB.a;
189253
+ }
189254
+ return result;
189255
+ }
189000
189256
  /** Swap the endpoint references. */
189001
189257
  reverseInPlace() {
189002
189258
  const a = this._point0;
@@ -189011,8 +189267,8 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
189011
189267
  }
189012
189268
  /** Test if both endpoints are in a plane (within tolerance) */
189013
189269
  isInPlane(plane) {
189014
- return _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.isSmallMetricDistance(plane.altitude(this._point0))
189015
- && _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.isSmallMetricDistance(plane.altitude(this._point1));
189270
+ return _Geometry__WEBPACK_IMPORTED_MODULE_9__.Geometry.isSmallMetricDistance(plane.altitude(this._point0))
189271
+ && _Geometry__WEBPACK_IMPORTED_MODULE_9__.Geometry.isSmallMetricDistance(plane.altitude(this._point1));
189016
189272
  }
189017
189273
  /**
189018
189274
  * Compute points of simple (transverse) with a plane.
@@ -189021,12 +189277,12 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
189021
189277
  appendPlaneIntersectionPoints(plane, result) {
189022
189278
  const h0 = plane.altitude(this._point0);
189023
189279
  const h1 = plane.altitude(this._point1);
189024
- const fraction = _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_7__.Order2Bezier.solveCoffs(h0, h1);
189280
+ const fraction = _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_10__.Order2Bezier.solveCoffs(h0, h1);
189025
189281
  let numIntersection = 0;
189026
189282
  if (fraction !== undefined) {
189027
189283
  numIntersection++;
189028
- const detail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_5__.CurveLocationDetail.createCurveFractionPoint(this, fraction, this.fractionToPoint(fraction));
189029
- detail.intervalRole = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_5__.CurveIntervalRole.isolated;
189284
+ const detail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveFractionPoint(this, fraction, this.fractionToPoint(fraction));
189285
+ detail.intervalRole = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveIntervalRole.isolated;
189030
189286
  result.push(detail);
189031
189287
  }
189032
189288
  return numIntersection;
@@ -189085,7 +189341,7 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
189085
189341
  }
189086
189342
  /** Create a new `LineSegment3d` with coordinates from json object. See `setFromJSON` for object layout description. */
189087
189343
  static fromJSON(json) {
189088
- const result = new LineSegment3d(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.createZero(), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create());
189344
+ const result = new LineSegment3d(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Point3d.createZero(), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Point3d.create());
189089
189345
  result.setFromJSON(json);
189090
189346
  return result;
189091
189347
  }
@@ -189149,7 +189405,7 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
189149
189405
  rangeBetweenFractions(fraction0, fraction1, transform) {
189150
189406
  // (This is cheap -- don't bother testing for fraction0===fraction1)
189151
189407
  if (!transform) {
189152
- const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_8__.Range3d.create();
189408
+ const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_11__.Range3d.create();
189153
189409
  range.extendInterpolated(this._point0, fraction0, this._point1);
189154
189410
  range.extendInterpolated(this._point0, fraction1, this._point1);
189155
189411
  return range;
@@ -189160,17 +189416,17 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
189160
189416
  transform.multiplyPoint3d(point0, point0);
189161
189417
  transform.multiplyPoint3d(point1, point1);
189162
189418
  }
189163
- return _geometry3d_Range__WEBPACK_IMPORTED_MODULE_8__.Range3d.create(point0, point1);
189419
+ return _geometry3d_Range__WEBPACK_IMPORTED_MODULE_11__.Range3d.create(point0, point1);
189164
189420
  }
189165
189421
  /**
189166
189422
  * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).
189167
189423
  * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object
189168
189424
  */
189169
189425
  constructOffsetXY(offsetDistanceOrOptions) {
189170
- const offsetVec = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Vector3d.createStartEnd(this._point0, this._point1);
189426
+ const offsetVec = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.createStartEnd(this._point0, this._point1);
189171
189427
  if (offsetVec.normalizeInPlace()) {
189172
189428
  offsetVec.rotate90CCWXY(offsetVec);
189173
- const offsetDist = _OffsetOptions__WEBPACK_IMPORTED_MODULE_9__.OffsetOptions.getOffsetDistance(offsetDistanceOrOptions);
189429
+ const offsetDist = _OffsetOptions__WEBPACK_IMPORTED_MODULE_12__.OffsetOptions.getOffsetDistance(offsetDistanceOrOptions);
189174
189430
  return LineSegment3d.create(this._point0.plusScaled(offsetVec, offsetDist), this._point1.plusScaled(offsetVec, offsetDist));
189175
189431
  }
189176
189432
  return undefined;
@@ -189184,7 +189440,7 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
189184
189440
  * end of the ray.
189185
189441
  */
189186
189442
  projectedParameterRange(ray, lowHigh) {
189187
- return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_10__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
189443
+ return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_13__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
189188
189444
  }
189189
189445
  }
189190
189446
 
@@ -189241,7 +189497,6 @@ __webpack_require__.r(__webpack_exports__);
189241
189497
 
189242
189498
 
189243
189499
 
189244
- /* eslint-disable @typescript-eslint/naming-convention, no-empty */
189245
189500
  /**
189246
189501
  * Starting with baseIndex and moving index by stepDirection:
189247
189502
  * If the vector from baseIndex to baseIndex +1 crossed with vectorA can be normalized, accumulate it (scaled) to normal.
@@ -189360,10 +189615,7 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
189360
189615
  result.addPoints(points);
189361
189616
  return result;
189362
189617
  }
189363
- /**
189364
- * Create a linestring, capturing the given GrowableXYZArray as the points.
189365
- * Point3d, Point2d, `[1,2,3]', array of any of those, or GrowableXYZArray
189366
- */
189618
+ /** Create a linestring, capturing the given GrowableXYZArray as the points. */
189367
189619
  static createCapture(points) {
189368
189620
  return new LineString3d(points);
189369
189621
  }
@@ -189387,7 +189639,7 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
189387
189639
  return result;
189388
189640
  }
189389
189641
  /**
189390
- * Add points to the linestring.
189642
+ * Add copies of points to the linestring.
189391
189643
  * Valid inputs are:
189392
189644
  * * a Point2d
189393
189645
  * * a point3d
@@ -189773,24 +190025,33 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
189773
190025
  return result;
189774
190026
  }
189775
190027
  /**
189776
- * Convert a segment index and local fraction to a global fraction.
190028
+ * Convert a segment index and local fraction to a global linestring fraction.
189777
190029
  * @param index index of segment being evaluated
189778
190030
  * @param localFraction local fraction in [0,1] within the segment
190031
+ * @param numSegment number N of segments in the linestring
189779
190032
  * @return global fraction f in [0,1] such that the segment is parameterized by index/N <= f <= (index+1)/N.
189780
190033
  */
189781
- segmentIndexAndLocalFractionToGlobalFraction(index, localFraction) {
189782
- const numSegment = this._points.length - 1;
190034
+ static mapLocalToGlobalFraction(index, localFraction, numSegment) {
189783
190035
  if (numSegment < 1)
189784
190036
  return 0.0;
189785
190037
  return (index + localFraction) / numSegment;
189786
190038
  }
190039
+ /**
190040
+ * Convert a segment index and local fraction to a global linestring fraction.
190041
+ * @param index index of segment being evaluated
190042
+ * @param localFraction local fraction in [0,1] within the segment
190043
+ * @return global fraction f in [0,1] such that the segment is parameterized by index/N <= f <= (index+1)/N.
190044
+ */
190045
+ segmentIndexAndLocalFractionToGlobalFraction(index, localFraction) {
190046
+ return LineString3d.mapLocalToGlobalFraction(index, localFraction, this._points.length - 1);
190047
+ }
189787
190048
  /**
189788
190049
  * Convert a global fraction to a segment index and local fraction.
189789
190050
  * @param globalFraction a fraction f in [0,1] in the linestring parameterization, where the i_th segment
189790
190051
  * (0 <= i < N) is parameterized by i/N <= f <= (i+1)/N.
190052
+ * @returns segment index and local fraction
189791
190053
  */
189792
- globalFractionToSegmentIndexAndLocalFraction(globalFraction) {
189793
- const numSegment = this._points.length - 1;
190054
+ static mapGlobalToLocalFraction(globalFraction, numSegment) {
189794
190055
  if (numSegment < 1)
189795
190056
  return { index: 0, fraction: 0.0 };
189796
190057
  const scaledGlobalFraction = globalFraction * numSegment;
@@ -189801,8 +190062,17 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
189801
190062
  segmentIndex = numSegment - 1;
189802
190063
  else // globalFraction in [0,1]
189803
190064
  segmentIndex = Math.floor(scaledGlobalFraction);
189804
- const localFraction = scaledGlobalFraction - segmentIndex;
189805
- return { index: segmentIndex, fraction: localFraction };
190065
+ return { index: segmentIndex, fraction: scaledGlobalFraction - segmentIndex };
190066
+ }
190067
+ /**
190068
+ * Convert a global linestring fraction to a segment index and local fraction.
190069
+ * @param globalFraction a fraction f in [0,1] in the linestring parameterization, where the i_th segment
190070
+ * (0 <= i < N) is parameterized by i/N <= f <= (i+1)/N.
190071
+ * @param numSegment number N of segments in the linestring
190072
+ * @returns segment index and local fraction
190073
+ */
190074
+ globalFractionToSegmentIndexAndLocalFraction(globalFraction) {
190075
+ return LineString3d.mapGlobalToLocalFraction(globalFraction, this._points.length - 1);
189806
190076
  }
189807
190077
  /** Return a frenet frame, using nearby points to estimate a plane. */
189808
190078
  fractionToFrenetFrame(fraction, result) {
@@ -189883,6 +190153,10 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
189883
190153
  numPoints() {
189884
190154
  return this._points.length;
189885
190155
  }
190156
+ /** Return the number of edges in this linestring. */
190157
+ numEdges() {
190158
+ return this._points.length > 0 ? this._points.length - 1 : 0;
190159
+ }
189886
190160
  /** Evaluate the end point of the linestring. */
189887
190161
  endPoint() {
189888
190162
  if (this._points.length === 0)
@@ -190468,9 +190742,9 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
190468
190742
  return result;
190469
190743
  }
190470
190744
  /** Return (if possible) a specific segment of the linestring */
190471
- getIndexedSegment(index) {
190745
+ getIndexedSegment(index, result) {
190472
190746
  if (index >= 0 && index + 1 < this._points.length)
190473
- return _LineSegment3d__WEBPACK_IMPORTED_MODULE_15__.LineSegment3d.create(this._points.getPoint3dAtCheckedPointIndex(index), this._points.getPoint3dAtCheckedPointIndex(index + 1));
190747
+ return _LineSegment3d__WEBPACK_IMPORTED_MODULE_15__.LineSegment3d.create(this._points.getPoint3dAtCheckedPointIndex(index), this._points.getPoint3dAtCheckedPointIndex(index + 1), result);
190474
190748
  return undefined;
190475
190749
  }
190476
190750
  /** Returns true if first and last points are within metric tolerance. */
@@ -190580,6 +190854,26 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
190580
190854
  projectedParameterRange(ray, lowHigh) {
190581
190855
  return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_18__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
190582
190856
  }
190857
+ /**
190858
+ * Convert the segment detail to a linestring detail:
190859
+ * * `detail.childDetail` is set to a clone of the input segment detail (optionally populating pre-allocated `child` object).
190860
+ * * `childDetail.a` is set to `segmentIndex`.
190861
+ * * `detail.fraction` is set to the global linestring parameter.
190862
+ * * `detail.curve` is set to the parent linestring.
190863
+ * @param detail segment location detail, converted in place
190864
+ * @param segmentIndex index of segment in the linestring
190865
+ * @param numSegment linestring segment count
190866
+ * @param parent optional linestring primitive
190867
+ * @param child optional pre-allocated detail to use to clone the child data
190868
+ * @returns reference to input detail, with both linestring and segment data
190869
+ */
190870
+ static convertLocalToGlobalDetail(detail, segmentIndex, numSegment, parent, child) {
190871
+ detail.childDetail = detail.clone(child);
190872
+ detail.childDetail.a = segmentIndex;
190873
+ detail.fraction = this.mapLocalToGlobalFraction(segmentIndex, detail.fraction, numSegment);
190874
+ detail.curve = parent;
190875
+ return detail;
190876
+ }
190583
190877
  }
190584
190878
  LineString3d._workPointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
190585
190879
  LineString3d._workPointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
@@ -192174,10 +192468,10 @@ class PlanarSubdivision {
192174
192468
  * * no action if start and end points are identical.
192175
192469
  * @param graph containing graph.
192176
192470
  * @param p the curve
192177
- * @param fraction0 starting fraction
192178
192471
  * @param point0 start point
192179
- * @param fraction1 end fraction
192472
+ * @param fraction0 starting fraction
192180
192473
  * @param point1 end point
192474
+ * @param fraction1 end fraction
192181
192475
  * @returns end point and fraction, or start point and fraction if no action
192182
192476
  */
192183
192477
  static addHalfEdge(graph, p, point0, fraction0, point1, fraction1, mergeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
@@ -194009,25 +194303,25 @@ __webpack_require__.r(__webpack_exports__);
194009
194303
  /* harmony export */ "RegionGroupOpType": () => (/* binding */ RegionGroupOpType),
194010
194304
  /* harmony export */ "RegionOpsFaceToFaceSearch": () => (/* binding */ RegionOpsFaceToFaceSearch)
194011
194305
  /* harmony export */ });
194306
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
194307
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
194308
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
194309
+ /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
194012
194310
  /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
194013
194311
  /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
194014
194312
  /* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
194015
194313
  /* harmony import */ var _topology_RegularizeFace__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../topology/RegularizeFace */ "../../core/geometry/lib/esm/topology/RegularizeFace.js");
194016
- /* harmony import */ var _RegionOps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
194017
- /* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
194018
- /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
194314
+ /* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
194019
194315
  /* harmony import */ var _CurveCurve__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./CurveCurve */ "../../core/geometry/lib/esm/curve/CurveCurve.js");
194020
- /* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
194021
- /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
194022
- /* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
194023
194316
  /* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
194024
- /* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
194025
- /* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
194026
- /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
194027
- /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
194028
- /* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
194029
194317
  /* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
194030
- /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
194318
+ /* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
194319
+ /* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
194320
+ /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
194321
+ /* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
194322
+ /* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
194323
+ /* harmony import */ var _RegionOps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
194324
+ /* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
194031
194325
  /*---------------------------------------------------------------------------------------------
194032
194326
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
194033
194327
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -207085,7 +207379,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
207085
207379
  this.pushXY(p.x, p.y);
207086
207380
  }
207087
207381
  }
207088
- /** Push points from variant sources.
207382
+ /** Push copies of points from variant sources.
207089
207383
  * Valid inputs are:
207090
207384
  * * Point2d
207091
207385
  * * Point3d
@@ -207794,7 +208088,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
207794
208088
  for (const p of points)
207795
208089
  this.push(p);
207796
208090
  }
207797
- /** Push points from variant sources.
208091
+ /** Push copies of points from variant sources.
207798
208092
  * Valid inputs are:
207799
208093
  * * Point2d
207800
208094
  * * Point3d
@@ -208998,6 +209292,19 @@ class IndexedXYZCollection {
208998
209292
  return undefined;
208999
209293
  return this.getPoint3dAtUncheckedPointIndex(this.length - 1, result);
209000
209294
  }
209295
+ /**
209296
+ * Test whether the indexed points are equal within tolerance.
209297
+ * @param index0 index of first point
209298
+ * @param index1 index of second point
209299
+ * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.
209300
+ */
209301
+ almostEqualIndexIndex(index0, index1, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
209302
+ if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)
209303
+ return undefined;
209304
+ return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.getXAtUncheckedPointIndex(index0), this.getXAtUncheckedPointIndex(index1), tolerance)
209305
+ && _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.getYAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1), tolerance)
209306
+ && _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.getZAtUncheckedPointIndex(index0), this.getZAtUncheckedPointIndex(index1), tolerance);
209307
+ }
209001
209308
  }
209002
209309
  /**
209003
209310
  * abstract base class extends IndexedXYZCollection, adding methods to push, peek, and pop, and rewrite.
@@ -216784,9 +217091,11 @@ __webpack_require__.r(__webpack_exports__);
216784
217091
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
216785
217092
  * See LICENSE.md in the project root for license terms and full copyright notice.
216786
217093
  *--------------------------------------------------------------------------------------------*/
217094
+ /** @packageDocumentation
217095
+ * @module CartesianGeometry
217096
+ */
216787
217097
 
216788
217098
 
216789
- /* eslint-disable @typescript-eslint/naming-convention, no-empty */
216790
217099
 
216791
217100
 
216792
217101
  //
@@ -216978,12 +217287,13 @@ __webpack_require__.r(__webpack_exports__);
216978
217287
  /* harmony export */ "IndexedXYZCollectionPolygonOps": () => (/* binding */ IndexedXYZCollectionPolygonOps),
216979
217288
  /* harmony export */ "Point3dArrayPolygonOps": () => (/* binding */ Point3dArrayPolygonOps),
216980
217289
  /* harmony export */ "PolygonLocationDetail": () => (/* binding */ PolygonLocationDetail),
217290
+ /* harmony export */ "PolygonLocationDetailPair": () => (/* binding */ PolygonLocationDetailPair),
216981
217291
  /* harmony export */ "PolygonOps": () => (/* binding */ PolygonOps)
216982
217292
  /* harmony export */ });
216983
217293
  /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
216984
217294
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
216985
- /* harmony import */ var _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../geometry4d/Matrix4d */ "../../core/geometry/lib/esm/geometry4d/Matrix4d.js");
216986
- /* harmony import */ var _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geometry4d/Point4d */ "../../core/geometry/lib/esm/geometry4d/Point4d.js");
217295
+ /* harmony import */ var _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geometry4d/Matrix4d */ "../../core/geometry/lib/esm/geometry4d/Matrix4d.js");
217296
+ /* harmony import */ var _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry4d/Point4d */ "../../core/geometry/lib/esm/geometry4d/Point4d.js");
216987
217297
  /* harmony import */ var _topology_XYParitySearchContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../topology/XYParitySearchContext */ "../../core/geometry/lib/esm/topology/XYParitySearchContext.js");
216988
217298
  /* harmony import */ var _FrameBuilder__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
216989
217299
  /* harmony import */ var _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
@@ -216993,6 +217303,7 @@ __webpack_require__.r(__webpack_exports__);
216993
217303
  /* harmony import */ var _Point2dVector2d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
216994
217304
  /* harmony import */ var _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
216995
217305
  /* harmony import */ var _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
217306
+ /* harmony import */ var _PolylineOps__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./PolylineOps */ "../../core/geometry/lib/esm/geometry3d/PolylineOps.js");
216996
217307
  /* harmony import */ var _Ray3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
216997
217308
  /* harmony import */ var _SortablePolygon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./SortablePolygon */ "../../core/geometry/lib/esm/geometry3d/SortablePolygon.js");
216998
217309
  /*---------------------------------------------------------------------------------------------
@@ -217017,6 +217328,7 @@ __webpack_require__.r(__webpack_exports__);
217017
217328
 
217018
217329
 
217019
217330
 
217331
+
217020
217332
  /**
217021
217333
  * Carries data about a point in the plane of a polygon.
217022
217334
  * @public
@@ -217070,6 +217382,51 @@ class PolygonLocationDetail {
217070
217382
  this.code === _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonVertex || this.code === _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonEdgeInterior ||
217071
217383
  this.code === _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.InsidePolygonProjectsToVertex || this.code === _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.InsidePolygonProjectsToEdgeInterior;
217072
217384
  }
217385
+ /**
217386
+ * Set point, index, and fraction for an "at vertex" or "along edge" PolygonLocationDetail.
217387
+ * * Point is not captured; its coordinates are copied.
217388
+ */
217389
+ static createAtVertexOrEdge(point, index, fraction = 0) {
217390
+ const detail = new PolygonLocationDetail();
217391
+ detail.point.setFrom(point);
217392
+ detail.closestEdgeIndex = index;
217393
+ detail.closestEdgeParam = fraction;
217394
+ fraction = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.clamp(fraction, 0, 1);
217395
+ detail.code = (fraction > 0 && fraction < 1) ? _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonEdgeInterior : _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonVertex;
217396
+ return detail;
217397
+ }
217398
+ }
217399
+ /**
217400
+ * A pair of PolygonLocationDetail.
217401
+ * @public
217402
+ */
217403
+ class PolygonLocationDetailPair {
217404
+ /** Constructor, captures inputs */
217405
+ constructor(detailA, detailB) {
217406
+ this.detailA = detailA ? detailA : PolygonLocationDetail.create();
217407
+ this.detailB = detailB ? detailB : PolygonLocationDetail.create();
217408
+ }
217409
+ /** Create an instance by capturing inputs */
217410
+ static create(detailA, detailB, result) {
217411
+ if (!result)
217412
+ return new PolygonLocationDetailPair(detailA, detailB);
217413
+ result.detailA = detailA;
217414
+ result.detailB = detailB;
217415
+ return result;
217416
+ }
217417
+ /** Make a deep copy of this PolygonLocationDetailPair */
217418
+ clone(result) {
217419
+ result = result ? result : new PolygonLocationDetailPair();
217420
+ result.detailA.copyContentsFrom(this.detailA);
217421
+ result.detailB.copyContentsFrom(this.detailB);
217422
+ return result;
217423
+ }
217424
+ /** Swap the details of A, B */
217425
+ swapDetails() {
217426
+ const q = this.detailA;
217427
+ this.detailA = this.detailB;
217428
+ this.detailB = q;
217429
+ }
217073
217430
  }
217074
217431
  /**
217075
217432
  * Carrier for a loop extracted from clip operation, annotated for sorting
@@ -217791,13 +218148,14 @@ class PolygonOps {
217791
218148
  return sortedLoopsArray;
217792
218149
  }
217793
218150
  /** Compute the closest point on the polygon boundary to the given point.
218151
+ * * Compare to [[closestPoint]].
217794
218152
  * @param polygon points of the polygon, closure point optional
217795
218153
  * @param testPoint point p to project onto the polygon edges. Works best when p is in the plane of the polygon.
217796
218154
  * @param tolerance optional distance tolerance to determine point-vertex and point-edge coincidence.
217797
218155
  * @param result optional pre-allocated object to fill and return
217798
218156
  * @returns details d of the closest point `d.point`:
217799
218157
  * * `d.isValid()` returns true if and only if the polygon is nontrivial.
217800
- * * `d.edgeIndex` and `d.edgeParam` specify the location of the closest point, within `distTol`.
218158
+ * * `d.edgeIndex` and `d.edgeParam` specify the location of the closest point.
217801
218159
  * * `d.code` classifies the closest point as a vertex (`PolygonLocation.OnPolygonVertex`) or as a point on an edge (`PolygonLocation.OnPolygonEdgeInterior`).
217802
218160
  * * `d.a` is the distance from testPoint to the closest point.
217803
218161
  * * `d.v` can be used to classify p (if p and polygon are coplanar): if n is the polygon normal then `d.v.dotProduct(n)` is +/-/0 if and only if p is inside/outside/on the polygon.
@@ -217850,7 +218208,7 @@ class PolygonOps {
217850
218208
  }
217851
218209
  if (distToStart2 < minDist2) {
217852
218210
  if (polygon.dotProductIndexIndexXYAndZ(iBase, iPrev, testPoint) <= 0.0) {
217853
- // update candidate (to edge start) only if previous edge was NOOP
218211
+ // update candidate (to edge start) only if testPoint projected beyond previous edge end
217854
218212
  polygon.getPoint3dAtUncheckedPointIndex(iBase, result.point);
217855
218213
  result.a = Math.sqrt(distToStart2);
217856
218214
  polygon.crossProductIndexIndexIndex(iBase, iPrev, iNext, result.v);
@@ -217914,6 +218272,41 @@ class PolygonOps {
217914
218272
  }
217915
218273
  return result;
217916
218274
  }
218275
+ /**
218276
+ * Compute the closest point on the polygon boundary or its interior to the given point.
218277
+ * * Compare to [[closestPointOnBoundary]].
218278
+ * @param polygon points of the polygon, closure point optional
218279
+ * @param testPoint point p to project onto the polygon edges. Works best when p is in the plane of the polygon.
218280
+ * @param tolerance optional distance tolerance for distinguishing boundary versus interior closest point.
218281
+ * @param result optional pre-allocated object to fill and return
218282
+ * @returns details d of the closest point `d.point`:
218283
+ * * `d.isValid()` returns true if and only if the polygon is nontrivial.
218284
+ * * `d.edgeIndex` and `d.edgeParam` specify the location of the (nearest) boundary point.
218285
+ * * `d.code` classifies the closest point: `PolygonLocation.OnPolygonVertex`, `PolygonLocation.OnPolygonEdgeInterior`, `PolygonLocation.InsidePolygonProjectsToVertex`, or `PolygonLocation.InsidePolygonProjectsToEdgeInterior`.
218286
+ * * `d.a` is the distance from testPoint to the closest point.
218287
+ */
218288
+ static closestPoint(polygon, testPoint, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, result) {
218289
+ if (!(polygon instanceof _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_5__.IndexedXYZCollection))
218290
+ return this.closestPoint(new _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_4__.Point3dArrayCarrier(polygon), testPoint, tolerance, result);
218291
+ if (!this.unitNormal(polygon, this._normal))
218292
+ return PolygonLocationDetail.create(result); // invalid
218293
+ const polygonPlane = this._workPlane = _Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_11__.Plane3dByOriginAndUnitNormal.createXYZUVW(polygon.getXAtUncheckedPointIndex(0), polygon.getYAtUncheckedPointIndex(0), polygon.getZAtUncheckedPointIndex(0), this._normal.x, this._normal.y, this._normal.z, this._workPlane);
218294
+ const planePoint = this._workXYZ = polygonPlane.projectPointToPlane(testPoint, this._workXYZ);
218295
+ result = this.closestPointOnBoundary(polygon, planePoint, tolerance, result);
218296
+ if (result.isValid) {
218297
+ const dot = result.v.dotProduct(this._normal);
218298
+ if (dot > 0.0) { // planePoint is inside, so return it instead of the closest boundary point
218299
+ result.point.setFrom(planePoint);
218300
+ if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonVertex === result.code)
218301
+ result.code = _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.InsidePolygonProjectsToVertex;
218302
+ else if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonEdgeInterior === result.code)
218303
+ result.code = _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.InsidePolygonProjectsToEdgeInterior;
218304
+ }
218305
+ result.a = testPoint.distance(result.point);
218306
+ result.v.setZero(); // not relevant
218307
+ }
218308
+ return result;
218309
+ }
217917
218310
  /** Compute the intersection of a line (parameterized as a ray) with the plane of this polygon.
217918
218311
  * @param polygon points of the polygon, closure point optional
217919
218312
  * @param ray infinite line to intersect, as a ray
@@ -217931,7 +218324,7 @@ class PolygonOps {
217931
218324
  if (!this.unitNormal(polygon, this._normal))
217932
218325
  return PolygonLocationDetail.create(result); // invalid
217933
218326
  this._workPlane = _Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_11__.Plane3dByOriginAndUnitNormal.createXYZUVW(polygon.getXAtUncheckedPointIndex(0), polygon.getYAtUncheckedPointIndex(0), polygon.getZAtUncheckedPointIndex(0), this._normal.x, this._normal.y, this._normal.z, this._workPlane);
217934
- const intersectionPoint = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero(this._workXYZ);
218327
+ const intersectionPoint = this._workXYZ = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero(this._workXYZ);
217935
218328
  const rayParam = ray.intersectionWithPlane(this._workPlane, intersectionPoint);
217936
218329
  if (undefined === rayParam)
217937
218330
  return PolygonLocationDetail.create(result);
@@ -218104,15 +218497,80 @@ class PolygonOps {
218104
218497
  coords[i] *= scale; // normalized
218105
218498
  return coords;
218106
218499
  }
218500
+ /**
218501
+ * Force the polygon to be closed.
218502
+ * * If first and last points are not within tolerance, push copy of first point
218503
+ * * If first and last points are within tolerance, set last point equal to first
218504
+ * @param polygon input polygon
218505
+ * @param tolerance closure distance tolerance
218506
+ */
218507
+ static forceClosure(polygon, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
218508
+ if (polygon.length >= 2) {
218509
+ if (polygon instanceof _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__.GrowableXYZArray) {
218510
+ polygon.forceClosure(tolerance);
218511
+ }
218512
+ else if (polygon[0].distance(polygon[polygon.length - 1]) > tolerance) {
218513
+ polygon.push(polygon[0].clone());
218514
+ }
218515
+ else {
218516
+ polygon[polygon.length - 1].setFromPoint3d(polygon[0]);
218517
+ }
218518
+ }
218519
+ }
218520
+ /**
218521
+ * Return a closed polygon, cloning only if necessary.
218522
+ * * If the first and last points are not identical, call [[forceClosure]] on a clone of the polygon and return it.
218523
+ * * If the first and last points are already identical, just return the input.
218524
+ * @param polygon input polygon
218525
+ * @param tolerance closure distance tolerance
218526
+ */
218527
+ static ensureClosed(polygon, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
218528
+ if (polygon.length >= 2) {
218529
+ let forceClosure = false;
218530
+ if (polygon instanceof _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_5__.IndexedXYZCollection)
218531
+ forceClosure = !polygon.almostEqualIndexIndex(0, polygon.length - 1, 0.0);
218532
+ else
218533
+ forceClosure = !polygon[0].isExactEqual(polygon[polygon.length - 1]);
218534
+ if (forceClosure) {
218535
+ const cloned = _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__.GrowableXYZArray.create(polygon);
218536
+ this.forceClosure(cloned, tolerance);
218537
+ polygon = cloned;
218538
+ }
218539
+ }
218540
+ return polygon;
218541
+ }
218542
+ /**
218543
+ * Find smallest distance between polygons.
218544
+ * * For efficiency, input polygons should include closure edge.
218545
+ * * If searching interiors for close approaches, the polygons are assumed to be convex.
218546
+ * @param polygonA first polygon
218547
+ * @param polygonB second polygon
218548
+ * @param dMax optional largest approach distance to consider
218549
+ * @param _searchInterior If true, include (convex) polygon interiors in computations (currently unimplemented).
218550
+ * If false (default): return closest approach between polygon boundaries only, using [[PolylineOps.closestApproach]].
218551
+ * @return pair of details, one per polygon. The `a` field of each detail stores the closest approach distance.
218552
+ */
218553
+ static closestApproach(polygonA, polygonB, dMax = Number.MAX_VALUE, _searchInterior = false) {
218554
+ // TODO: handle interior close approaches as well...
218555
+ let result;
218556
+ const polyA = this.ensureClosed(polygonA);
218557
+ const polyB = this.ensureClosed(polygonB);
218558
+ const cld = this._workCLDPair = _PolylineOps__WEBPACK_IMPORTED_MODULE_13__.PolylineOps.closestApproach(polyA, false, polyB, false, dMax, this._workCLDPair);
218559
+ if (cld && cld.detailA.childDetail && cld.detailB.childDetail) {
218560
+ result = PolygonLocationDetailPair.create(PolygonLocationDetail.createAtVertexOrEdge(cld.detailA.point, cld.detailA.childDetail.a, cld.detailA.childDetail.fraction), PolygonLocationDetail.createAtVertexOrEdge(cld.detailB.point, cld.detailB.childDetail.a, cld.detailB.childDetail.fraction));
218561
+ result.detailA.a = result.detailB.a = cld.detailA.a;
218562
+ }
218563
+ return result;
218564
+ }
218107
218565
  }
218108
218566
  /** These values are the integrated area moment products [xx,xy,xz, x]
218109
218567
  * for a right triangle in the first quadrant at the origin -- (0,0),(1,0),(0,1)
218110
218568
  */
218111
- PolygonOps._triangleMomentWeights = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_13__.Matrix4d.createRowValues(2.0 / 24.0, 1.0 / 24.0, 0, 4.0 / 24.0, 1.0 / 24.0, 2.0 / 24.0, 0, 4.0 / 24.0, 0, 0, 0, 0, 4.0 / 24.0, 4.0 / 24.0, 0, 12.0 / 24.0);
218569
+ PolygonOps._triangleMomentWeights = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_14__.Matrix4d.createRowValues(2.0 / 24.0, 1.0 / 24.0, 0, 4.0 / 24.0, 1.0 / 24.0, 2.0 / 24.0, 0, 4.0 / 24.0, 0, 0, 0, 0, 4.0 / 24.0, 4.0 / 24.0, 0, 12.0 / 24.0);
218112
218570
  /** These values are the integrated volume moment products [xx,xy,xz, x, yx,yy,yz,y, zx,zy,zz,z,x,y,z,1]
218113
218571
  * for a tetrahedron in the first quadrant at the origin -- (0,00),(1,0,0),(0,1,0),(0,0,1)
218114
218572
  */
218115
- PolygonOps._tetrahedralMomentWeights = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_13__.Matrix4d.createRowValues(1.0 / 60.0, 1.0 / 120, 1.0 / 120, 1.0 / 24.0, 1.0 / 120, 1.0 / 60.0, 1.0 / 120, 1.0 / 24.0, 1.0 / 120, 1.0 / 120, 1.0 / 60.0, 1.0 / 24.0, 1.0 / 24.0, 1.0 / 24.0, 1.0 / 24.0, 1.0 / 6.0);
218573
+ PolygonOps._tetrahedralMomentWeights = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_14__.Matrix4d.createRowValues(1.0 / 60.0, 1.0 / 120, 1.0 / 120, 1.0 / 24.0, 1.0 / 120, 1.0 / 60.0, 1.0 / 120, 1.0 / 24.0, 1.0 / 120, 1.0 / 120, 1.0 / 60.0, 1.0 / 24.0, 1.0 / 24.0, 1.0 / 24.0, 1.0 / 24.0, 1.0 / 6.0);
218116
218574
  // statics for shared reuse.
218117
218575
  // many methods use these.
218118
218576
  // only use them in "leaf" methods that are certain not to call other users . . .
@@ -218121,9 +218579,9 @@ PolygonOps._vector1 = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.cre
218121
218579
  PolygonOps._vector2 = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
218122
218580
  PolygonOps._vectorOrigin = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
218123
218581
  PolygonOps._normal = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
218124
- PolygonOps._matrixA = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_13__.Matrix4d.createIdentity();
218125
- PolygonOps._matrixB = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_13__.Matrix4d.createIdentity();
218126
- PolygonOps._matrixC = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_13__.Matrix4d.createIdentity();
218582
+ PolygonOps._matrixA = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_14__.Matrix4d.createIdentity();
218583
+ PolygonOps._matrixB = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_14__.Matrix4d.createIdentity();
218584
+ PolygonOps._matrixC = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_14__.Matrix4d.createIdentity();
218127
218585
 
218128
218586
  /**
218129
218587
  * `IndexedXYZCollectionPolygonOps` class contains _static_ methods for typical operations on polygons carried as `IndexedXYZCollection`
@@ -218358,7 +218816,7 @@ class IndexedXYZCollectionPolygonOps {
218358
218816
  if (range.isNull)
218359
218817
  return undefined;
218360
218818
  const work = new _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__.GrowableXYZArray();
218361
- const plane = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_14__.Point4d.create();
218819
+ const plane = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_15__.Point4d.create();
218362
218820
  plane.set(0, 0, -1, range.high.z);
218363
218821
  this.clipConvexPolygonInPlace(plane, xyz, work, true);
218364
218822
  if (xyz.length === 0)
@@ -218777,9 +219235,13 @@ __webpack_require__.r(__webpack_exports__);
218777
219235
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
218778
219236
  /* harmony export */ "PolylineOps": () => (/* binding */ PolylineOps)
218779
219237
  /* harmony export */ });
219238
+ /* harmony import */ var _curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../curve/CurveExtendMode */ "../../core/geometry/lib/esm/curve/CurveExtendMode.js");
219239
+ /* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
219240
+ /* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
218780
219241
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
218781
219242
  /* harmony import */ var _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
218782
219243
  /* harmony import */ var _Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Plane3dByOriginAndUnitNormal */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js");
219244
+ /* harmony import */ var _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
218783
219245
  /* harmony import */ var _Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
218784
219246
  /* harmony import */ var _PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PolylineCompressionByEdgeOffset */ "../../core/geometry/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js");
218785
219247
  /* harmony import */ var _Range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
@@ -218796,6 +219258,10 @@ __webpack_require__.r(__webpack_exports__);
218796
219258
 
218797
219259
 
218798
219260
 
219261
+
219262
+
219263
+
219264
+
218799
219265
  // cspell:word Puecker
218800
219266
  /**
218801
219267
  * PolylineOps is a collection of static methods operating on polylines.
@@ -218978,7 +219444,7 @@ class PolylineOps {
218978
219444
  }
218979
219445
  }
218980
219446
  /**
218981
- * Remove closure points a polyline or array of polylines
219447
+ * Remove closure points of a polyline or array of polylines
218982
219448
  * @param data points.
218983
219449
  */
218984
219450
  static removeClosurePoint(data) {
@@ -219049,6 +219515,74 @@ class PolylineOps {
219049
219515
  }
219050
219516
  return bisectorPlanes.length > 1 ? bisectorPlanes : undefined;
219051
219517
  }
219518
+ /**
219519
+ * Find smallest distance between polylines.
219520
+ * * For polylines with many points, it is more efficient to use [[LineString3dRangeTreeContext.searchForClosestApproach]].
219521
+ * @param pointsA first polyline
219522
+ * @param extendA how to extend polylineA forward/backward
219523
+ * @param pointsB second polyline
219524
+ * @param extendB how to extend polylineB forward/backward
219525
+ * @param dMax largest approach distance to consider
219526
+ * @param result optional pre-allocated object to populate and return
219527
+ * @returns pair of details, one for each polyline, with field values:
219528
+ * * `a` is the closest approach distance
219529
+ * * `point` is the point of closest approach
219530
+ * * `fraction` is the global polyline fraction
219531
+ * * `childDetail.a` is the segment index
219532
+ * * `childDetail.fraction` is the local segment fraction
219533
+ */
219534
+ static closestApproach(pointsA, extendA, pointsB, extendB, dMax = Number.MAX_VALUE, result) {
219535
+ if (Array.isArray(pointsA))
219536
+ pointsA = new _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_6__.Point3dArrayCarrier(pointsA);
219537
+ if (Array.isArray(pointsB))
219538
+ pointsB = new _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_6__.Point3dArrayCarrier(pointsB);
219539
+ let dMin = dMax;
219540
+ let foundMin = false;
219541
+ const numSegmentA = pointsA.length - 1;
219542
+ const numSegmentB = pointsB.length - 1;
219543
+ const extendSegA = [_curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__.CurveExtendMode.None, _curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__.CurveExtendMode.None];
219544
+ const extendSegB = [_curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__.CurveExtendMode.None, _curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__.CurveExtendMode.None];
219545
+ // lambda to set extension for first and last segment of a polyline
219546
+ const convertExtend = (extendOut, extendIn, segmentIndex, numSegments) => {
219547
+ extendOut[0] = extendOut[1] = _curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__.CurveExtendMode.None;
219548
+ if (segmentIndex === 0)
219549
+ extendOut[0] = _curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendIn, 0);
219550
+ else if (segmentIndex === numSegments - 1)
219551
+ extendOut[1] = _curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendIn, 1);
219552
+ };
219553
+ // lambda to extract LineSegment3d from polyline
219554
+ const fillSegment = (points, index, segment) => {
219555
+ if (segment === undefined)
219556
+ return _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_8__.LineSegment3d.createCapture(points.getPoint3dAtUncheckedPointIndex(index), points.getPoint3dAtUncheckedPointIndex(index + 1));
219557
+ points.getPoint3dAtUncheckedPointIndex(index, segment.point0Ref);
219558
+ points.getPoint3dAtUncheckedPointIndex(index + 1, segment.point1Ref);
219559
+ return segment;
219560
+ };
219561
+ // just test the segments
219562
+ for (let indexA = 0; indexA < numSegmentA; indexA++) {
219563
+ this._workSegmentA = fillSegment(pointsA, indexA, this._workSegmentA);
219564
+ convertExtend(extendSegA, extendA, indexA, numSegmentA);
219565
+ for (let indexB = 0; indexB < numSegmentB; indexB++) {
219566
+ this._workSegmentB = fillSegment(pointsB, indexB, this._workSegmentB);
219567
+ convertExtend(extendSegB, extendB, indexB, numSegmentB);
219568
+ if (undefined !== (this._workLocalDetailPair = _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_8__.LineSegment3d.closestApproach(this._workSegmentA, extendSegA, this._workSegmentB, extendSegB, this._workLocalDetailPair))) {
219569
+ const d = this._workLocalDetailPair.detailA.a;
219570
+ if (d < dMin) {
219571
+ const childDetailA = result?.detailA.childDetail; // save and reuse
219572
+ const childDetailB = result?.detailB.childDetail;
219573
+ result = this._workLocalDetailPair.clone(result); // overwrite previous result
219574
+ _curve_LineString3d__WEBPACK_IMPORTED_MODULE_9__.LineString3d.convertLocalToGlobalDetail(result.detailA, indexA, numSegmentA, undefined, childDetailA);
219575
+ _curve_LineString3d__WEBPACK_IMPORTED_MODULE_9__.LineString3d.convertLocalToGlobalDetail(result.detailB, indexB, numSegmentB, undefined, childDetailB);
219576
+ if (result.detailA.childDetail && result.detailB.childDetail)
219577
+ result.detailA.childDetail.curve = result.detailB.childDetail.curve = undefined; // no CurvePrimitives survive in output
219578
+ dMin = d;
219579
+ foundMin = true;
219580
+ }
219581
+ }
219582
+ }
219583
+ }
219584
+ return foundMin ? result : undefined;
219585
+ }
219052
219586
  }
219053
219587
 
219054
219588
 
@@ -222110,7 +222644,7 @@ class Transform {
222110
222644
  * @param other Transform to compare to.
222111
222645
  */
222112
222646
  isAlmostEqual(other) {
222113
- return this.origin.isAlmostEqual(other.origin) && this.matrix.isAlmostEqual(other.matrix);
222647
+ return this === other || this.origin.isAlmostEqual(other.origin) && this.matrix.isAlmostEqual(other.matrix);
222114
222648
  }
222115
222649
  /**
222116
222650
  * Test for near equality with `other` Transform. Comparison uses the `isAlmostEqual` methods on the `origin` part
@@ -229625,8 +230159,20 @@ class SmallSystem {
229625
230159
  return this.ray3dXYZUVWClosestApproachUnbounded(a0.x, a0.y, a0.z, a1.x - a0.x, a1.y - a0.y, a1.z - a0.z, b0.x, b0.y, b0.z, b1.x - b0.x, b1.y - b0.y, b1.z - b0.z, result);
229626
230160
  }
229627
230161
  /**
229628
- * Return true if lines (a0,a1) to (b0, b1) have closest approach (go by each other) in 3d
230162
+ * Return true if the given rays have closest approach (go by each other) in 3d
229629
230163
  * Return the fractional (not xy) coordinates as x and y parts of a Point2d.
230164
+ * @param ax x-coordinate of the origin of the first ray
230165
+ * @param ay y-coordinate of the origin of the first ray
230166
+ * @param az z-coordinate of the origin of the first ray
230167
+ * @param au x-coordinate of the direction vector of the first ray
230168
+ * @param av y-coordinate of the direction vector of the first ray
230169
+ * @param aw z-coordinate of the direction vector of the first ray
230170
+ * @param bx x-coordinate of the origin of the second ray
230171
+ * @param by y-coordinate of the origin of the second ray
230172
+ * @param bz z-coordinate of the origin of the second ray
230173
+ * @param bu x-coordinate of the direction vector of the second ray
230174
+ * @param bv y-coordinate of the direction vector of the second ray
230175
+ * @param bw z-coordinate of the direction vector of the second ray
229630
230176
  * @param result point to receive fractional coordinates of intersection. result.x is fraction on line a. result.y is fraction on line b.
229631
230177
  */
229632
230178
  static ray3dXYZUVWClosestApproachUnbounded(ax, ay, az, au, av, aw, bx, by, bz, bu, bv, bw, result) {
@@ -231598,6 +232144,7 @@ __webpack_require__.r(__webpack_exports__);
231598
232144
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
231599
232145
  /* harmony export */ "ConvexFacetLocationDetail": () => (/* binding */ ConvexFacetLocationDetail),
231600
232146
  /* harmony export */ "FacetIntersectOptions": () => (/* binding */ FacetIntersectOptions),
232147
+ /* harmony export */ "FacetLocationDetailPair": () => (/* binding */ FacetLocationDetailPair),
231601
232148
  /* harmony export */ "NonConvexFacetLocationDetail": () => (/* binding */ NonConvexFacetLocationDetail),
231602
232149
  /* harmony export */ "TriangularFacetLocationDetail": () => (/* binding */ TriangularFacetLocationDetail)
231603
232150
  /* harmony export */ });
@@ -231631,6 +232178,21 @@ class FacetIntersectOptions {
231631
232178
  this.parameterTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallFraction;
231632
232179
  }
231633
232180
  }
232181
+ /**
232182
+ * A pair of FacetLocationDetail.
232183
+ * @public
232184
+ */
232185
+ class FacetLocationDetailPair {
232186
+ /** Constructor, captures inputs */
232187
+ constructor(detailA, detailB) {
232188
+ this.detailA = detailA;
232189
+ this.detailB = detailB;
232190
+ }
232191
+ /** Create a facet detail pair, capturing inputs. */
232192
+ static create(detailA, detailB) {
232193
+ return new FacetLocationDetailPair(detailA, detailB);
232194
+ }
232195
+ }
231634
232196
  /**
231635
232197
  * Implementation of `FacetLocationDetail` for a triangular facet.
231636
232198
  * @public
@@ -231651,17 +232213,23 @@ class TriangularFacetLocationDetail {
231651
232213
  this._color = undefined;
231652
232214
  }
231653
232215
  /** Create a detail.
232216
+ * @param detail optional, copied if given
231654
232217
  * @param result optional pre-allocated object to fill and return
231655
232218
  */
231656
- static create(facetIndex, detail, result) {
231657
- if (undefined === result)
231658
- return new TriangularFacetLocationDetail(facetIndex, detail);
231659
- result.invalidate(false); // detail might be owned by result!
232219
+ static create(facetIndex = -1, detail, result) {
232220
+ if (!result)
232221
+ result = new TriangularFacetLocationDetail();
232222
+ else
232223
+ result.invalidate(false); // shallow: detail might be owned by result!
231660
232224
  result._facetIndex = facetIndex;
231661
- if (undefined !== detail)
232225
+ if (undefined !== detail && result._detail !== detail)
231662
232226
  result._detail.copyContentsFrom(detail);
231663
232227
  return result;
231664
232228
  }
232229
+ /** Create a detail, capturing inputs. */
232230
+ static createCapture(facetIndex, detail) {
232231
+ return new TriangularFacetLocationDetail(facetIndex, detail);
232232
+ }
231665
232233
  /** Get the facet index. */
231666
232234
  get facetIndex() {
231667
232235
  return this._facetIndex;
@@ -231762,7 +232330,7 @@ class TriangularFacetLocationDetail {
231762
232330
  }
231763
232331
  }
231764
232332
  /**
231765
- * Implementation of `FacetLocationDetail` for a non-convex facet.
232333
+ * Implementation of `FacetLocationDetail` for a general facet, which may or may not be convex.
231766
232334
  * * Facet vertex data interpolation is not available.
231767
232335
  * @public
231768
232336
  */
@@ -231781,18 +232349,24 @@ class NonConvexFacetLocationDetail {
231781
232349
  this._detail.invalidate();
231782
232350
  }
231783
232351
  /** Create a detail.
232352
+ * @param detail optional, copied if given
231784
232353
  * @param result optional pre-allocated object to fill and return
231785
232354
  */
231786
- static create(facetIndex, edgeCount, detail, result) {
231787
- if (undefined === result)
231788
- return new NonConvexFacetLocationDetail(facetIndex, edgeCount, detail);
231789
- result.invalidate(false); // detail might be owned by result!
232355
+ static create(facetIndex = -1, edgeCount = 0, detail, result) {
232356
+ if (!result)
232357
+ result = new NonConvexFacetLocationDetail();
232358
+ else
232359
+ result.invalidate(false); // shallow: detail might be owned by result!
231790
232360
  result._facetIndex = facetIndex;
231791
232361
  result._edgeCount = edgeCount;
231792
232362
  if (undefined !== detail && result._detail !== detail)
231793
232363
  result._detail.copyContentsFrom(detail);
231794
232364
  return result;
231795
232365
  }
232366
+ /** Create a detail, capturing inputs. */
232367
+ static createCapture(facetIndex, edgeCount, detail) {
232368
+ return new NonConvexFacetLocationDetail(facetIndex, edgeCount, detail);
232369
+ }
231796
232370
  /** Get the facet index. */
231797
232371
  get facetIndex() {
231798
232372
  return this._facetIndex;
@@ -231821,7 +232395,7 @@ class NonConvexFacetLocationDetail {
231821
232395
  get isValid() {
231822
232396
  return this._isValid && this._detail.isValid;
231823
232397
  }
231824
- /** Whether the facet is convex. */
232398
+ /** Whether the facet is convex. Always returns false, as convexity is unknown to this detail. */
231825
232399
  get isConvex() {
231826
232400
  return false;
231827
232401
  }
@@ -231891,13 +232465,20 @@ class ConvexFacetLocationDetail extends NonConvexFacetLocationDetail {
231891
232465
  this._barycentricCoordinates = undefined;
231892
232466
  }
231893
232467
  /** Create a detail.
232468
+ * @param detail optional, copied if given
231894
232469
  * @param result optional pre-allocated object to fill and return
231895
232470
  */
231896
- static create(facetIndex, edgeCount, detail, result) {
231897
- if (undefined === result)
231898
- return new ConvexFacetLocationDetail(facetIndex, edgeCount, detail);
232471
+ static create(facetIndex = -1, edgeCount = 0, detail, result) {
232472
+ if (!result)
232473
+ result = new ConvexFacetLocationDetail();
232474
+ else
232475
+ result.invalidate(false); // shallow: detail might be owned by result!
231899
232476
  return super.create(facetIndex, edgeCount, detail, result);
231900
232477
  }
232478
+ /** Create a detail, capturing inputs. */
232479
+ static createCapture(facetIndex, edgeCount, detail) {
232480
+ return new ConvexFacetLocationDetail(facetIndex, edgeCount, detail);
232481
+ }
231901
232482
  /** Whether the facet is convex. */
231902
232483
  get isConvex() {
231903
232484
  return true;
@@ -236940,6 +237521,22 @@ class PolyfaceQuery {
236940
237521
  const inertiaProducts = PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source, origin);
236941
237522
  return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
236942
237523
  }
237524
+ /** Determine whether all facets are convex.
237525
+ * @param source mesh to examine
237526
+ */
237527
+ static areFacetsConvex(source) {
237528
+ if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
237529
+ return this.areFacetsConvex(source.createVisitor(0));
237530
+ source.setNumWrap(0);
237531
+ source.reset();
237532
+ while (source.moveToNextFacet()) {
237533
+ if (source.pointCount > 3) {
237534
+ if (!_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.isConvex(source.point))
237535
+ return false;
237536
+ }
237537
+ }
237538
+ return true;
237539
+ }
236943
237540
  /**
236944
237541
  * Test for convex volume by dihedral angle tests on all edges.
236945
237542
  * * This tests if all dihedral angles are positive.
@@ -237547,6 +238144,8 @@ class PolyfaceQuery {
237547
238144
  * If not a polyface, visit all facets to find the largest index.
237548
238145
  */
237549
238146
  static visitorClientPointCount(visitor) {
238147
+ if (visitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
238148
+ return visitor.data.point.length;
237550
238149
  const polyface = visitor.clientPolyface();
237551
238150
  if (polyface !== undefined)
237552
238151
  return polyface.data.point.length;
@@ -237563,6 +238162,11 @@ class PolyfaceQuery {
237563
238162
  * If not a polyface, visit all facets to accumulate a count.
237564
238163
  */
237565
238164
  static visitorClientFacetCount(visitor) {
238165
+ if (visitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
238166
+ if (visitor.facetCount !== undefined)
238167
+ return visitor.facetCount;
238168
+ visitor = visitor.createVisitor(0);
238169
+ }
237566
238170
  const polyface = visitor.clientPolyface();
237567
238171
  if (polyface !== undefined && polyface.facetCount !== undefined)
237568
238172
  return polyface.facetCount;
@@ -238338,6 +238942,1307 @@ class RangeLengthData {
238338
238942
  }
238339
238943
 
238340
238944
 
238945
+ /***/ }),
238946
+
238947
+ /***/ "../../core/geometry/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js":
238948
+ /*!**************************************************************************************!*\
238949
+ !*** ../../core/geometry/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js ***!
238950
+ \**************************************************************************************/
238951
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
238952
+
238953
+ "use strict";
238954
+ __webpack_require__.r(__webpack_exports__);
238955
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
238956
+ /* harmony export */ "LineString3dRangeTreeContext": () => (/* binding */ LineString3dRangeTreeContext)
238957
+ /* harmony export */ });
238958
+ /* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
238959
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
238960
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
238961
+ /* harmony import */ var _RangeTreeNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RangeTreeNode */ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeNode.js");
238962
+ /* harmony import */ var _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./RangeTreeSearchHandlers */ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js");
238963
+ /*---------------------------------------------------------------------------------------------
238964
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
238965
+ * See LICENSE.md in the project root for license terms and full copyright notice.
238966
+ *--------------------------------------------------------------------------------------------*/
238967
+ /** @packageDocumentation
238968
+ * @module RangeSearch
238969
+ */
238970
+
238971
+
238972
+
238973
+
238974
+
238975
+ /**
238976
+ * Handler class for searching a range tree containing the segments of a linestring.
238977
+ * * Facilitates multiple searches for closest point and close approach calculations.
238978
+ * @public
238979
+ */
238980
+ class LineString3dRangeTreeContext {
238981
+ /** Constructor: capture inputs, initialize debug counters */
238982
+ constructor(rangeTreeRoot, points) {
238983
+ this.lineString = points;
238984
+ this._rangeTreeRoot = rangeTreeRoot;
238985
+ this.numRangeTestTrue = 0;
238986
+ this.numRangeTestFalse = 0;
238987
+ this.numPointTest = 0;
238988
+ this.numSearch = 0;
238989
+ }
238990
+ /**
238991
+ * Create a range tree context for the polyline points:
238992
+ * * initialize with segment ranges
238993
+ * * appData are segment indices
238994
+ * @param linestring captured if LineString3d, otherwise copied
238995
+ * @param maxChildPerNode maximum children per range tree node (default 4)
238996
+ * @param maxAppDataPerLeaf maximum segment indices per leaf node (default 4)
238997
+ */
238998
+ static createCapture(points, maxChildPerNode = 4, maxAppDataPerLeaf = 4) {
238999
+ const linestring = points instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_0__.LineString3d ? points : _curve_LineString3d__WEBPACK_IMPORTED_MODULE_0__.LineString3d.createPoints(points);
239000
+ const rangeTreeRoot = _RangeTreeNode__WEBPACK_IMPORTED_MODULE_1__.RangeTreeOps.createByIndexSplits(((index) => { return _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__.Range3d.create(linestring.pointAt(index), linestring.pointAt(index + 1)); }), ((index) => { return index; }), linestring.numPoints() - 1, // number of segments
239001
+ maxChildPerNode, maxAppDataPerLeaf);
239002
+ return rangeTreeRoot ? new LineString3dRangeTreeContext(rangeTreeRoot, linestring) : undefined;
239003
+ }
239004
+ /**
239005
+ * Search the range tree for closest point(s) to spacePoint.
239006
+ * @param spacePoint point to test
239007
+ * @param maxDist collect points at no more than this distance from spacePoint. If undefined, return only the closest point.
239008
+ * @return closest point detail(s) with detail.a set to the distance from spacePoint to detail.point
239009
+ */
239010
+ searchForClosestPoint(spacePoint, maxDist) {
239011
+ const handler = new _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_3__.SingleTreeSearchHandlerForClosestPointOnLineString3d(spacePoint, this, maxDist);
239012
+ this.numSearch++;
239013
+ // seed the search with a few segments -- this reduces early trips deep into ranges that are far from spacePoint.
239014
+ const numTest = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.clamp(Math.floor(this.lineString.numPoints() / 20), 2, 7);
239015
+ const testStep = Math.floor(this.lineString.numPoints() / numTest);
239016
+ handler.processAppData(0);
239017
+ handler.processAppData(this.lineString.numPoints() - 2);
239018
+ for (let i = testStep; i + 1 < this.lineString.numPoints(); i += testStep)
239019
+ handler.processAppData(i);
239020
+ this._rangeTreeRoot.searchTopDown(handler);
239021
+ return handler.searchState.savedItems.length <= 1 ? handler.getResult() : handler.getSavedItems();
239022
+ }
239023
+ /**
239024
+ * Search the range trees for closest approach(es) between the polylines.
239025
+ * @param contextA first polyline context
239026
+ * @param contextB second polyline context
239027
+ * @param maxDist collect close approaches separated by no more than this distance. If undefined, return only the closest approach.
239028
+ * @return closest approach detail pair(s), one per context, with detail.a set to the approach distance
239029
+ */
239030
+ static searchForClosestApproach(contextA, contextB, maxDist) {
239031
+ const handler = new _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_3__.TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach(contextA, contextB, maxDist);
239032
+ _RangeTreeNode__WEBPACK_IMPORTED_MODULE_1__.RangeTreeNode.searchTwoTreesTopDown(contextA._rangeTreeRoot, contextB._rangeTreeRoot, handler);
239033
+ return handler.searchState.savedItems.length <= 1 ? handler.getResult() : handler.getSavedItems();
239034
+ }
239035
+ }
239036
+
239037
+
239038
+ /***/ }),
239039
+
239040
+ /***/ "../../core/geometry/lib/esm/polyface/RangeTree/MinimumValueTester.js":
239041
+ /*!****************************************************************************!*\
239042
+ !*** ../../core/geometry/lib/esm/polyface/RangeTree/MinimumValueTester.js ***!
239043
+ \****************************************************************************/
239044
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
239045
+
239046
+ "use strict";
239047
+ __webpack_require__.r(__webpack_exports__);
239048
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
239049
+ /* harmony export */ "MinimumValueTester": () => (/* binding */ MinimumValueTester)
239050
+ /* harmony export */ });
239051
+ /*---------------------------------------------------------------------------------------------
239052
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
239053
+ * See LICENSE.md in the project root for license terms and full copyright notice.
239054
+ *--------------------------------------------------------------------------------------------*/
239055
+ /** @packageDocumentation
239056
+ * @module CartesianGeometry
239057
+ */
239058
+ /**
239059
+ * Data carrier for use when repeatedly testing items (of parameterized type T) to determine the one with a minimum associated value.
239060
+ * * Optionally pushes to arrays of items and values when the value does not exceed a given trigger.
239061
+ * * * The item at minimum value is still recorded, even if the minimum value exceeds the trigger value.
239062
+ * * When comparing a potential minimum value to an undefined value, the number is always accepted as the new minimum.
239063
+ * @internal
239064
+ */
239065
+ class MinimumValueTester {
239066
+ /**
239067
+ * Capture the given item with undefined item and value, and optional maxValueForSavingToArray.
239068
+ */
239069
+ constructor(maxValueForSavingToArray) {
239070
+ this.savedItems = [];
239071
+ this.savedValues = [];
239072
+ this.resetMinValueAndItem(undefined, undefined);
239073
+ this.resetTriggerValueForSavingToArray(maxValueForSavingToArray, false);
239074
+ }
239075
+ /**
239076
+ * Static method to create a tester.
239077
+ * @param maxValueForSavingToArray optional numeric value limiting items to save to the optional array.
239078
+ * @returns new tester.
239079
+ */
239080
+ static create(maxValueForSavingToArray) {
239081
+ return new MinimumValueTester(maxValueForSavingToArray);
239082
+ }
239083
+ /**
239084
+ * Install new minimum value and associated item, both possibly undefined.
239085
+ * * The existing arrays of saved items and values, and the trigger value, are unaffected.
239086
+ * @param item object to associate with the new minimum value
239087
+ * @param value new minimum value
239088
+ */
239089
+ resetMinValueAndItem(item = undefined, value = undefined) {
239090
+ this.itemAtMinValue = item;
239091
+ this.minValue = value;
239092
+ }
239093
+ /**
239094
+ * Set the trigger value.
239095
+ * @param value new trigger value
239096
+ * @param reinitializeArrays whether to clear the arrays of saved items and values
239097
+ */
239098
+ resetTriggerValueForSavingToArray(value, reinitializeArrays = false) {
239099
+ this.triggerForSavingToArray = value;
239100
+ if (reinitializeArrays) {
239101
+ this.savedItems = [];
239102
+ this.savedValues = [];
239103
+ }
239104
+ }
239105
+ /**
239106
+ * Test a new item with value.
239107
+ * * Push the new item and value to the saved arrays if both:
239108
+ * * `this.triggerForSavingToArray` is defined
239109
+ * * the new value is less than or equal to `this.triggerForSavingToArray`.
239110
+ * * Save the new item and value if either:
239111
+ * * `this.minValue` is undefined
239112
+ * * new value is less than `this.minValue`.
239113
+ * @param item item to be saved (captured!) if value conditions are met
239114
+ * @param value numeric value being minimized.
239115
+ * @returns true if and only if the input value is the new minimum value.
239116
+ */
239117
+ testAndSave(item, value) {
239118
+ if (this.doesValueTrigger(value)) {
239119
+ this.savedValues.push(value);
239120
+ this.savedItems.push(item);
239121
+ }
239122
+ if (this.isNewMinValue(value)) {
239123
+ this.minValue = value;
239124
+ this.itemAtMinValue = item;
239125
+ return true;
239126
+ }
239127
+ return false;
239128
+ }
239129
+ /** Whether the input value is small enough to be saved to this instance. */
239130
+ doesValueTrigger(value) {
239131
+ return this.triggerForSavingToArray !== undefined && value <= this.triggerForSavingToArray;
239132
+ }
239133
+ /** Whether the input value is smaller than the last recorded minimum value. */
239134
+ isNewMinValue(value) {
239135
+ return this.minValue === undefined || value < this.minValue;
239136
+ }
239137
+ /** Whether the input value is small enough to be the new minimum or to be saved to this instance. */
239138
+ isNewMinOrTrigger(value) {
239139
+ return this.isNewMinValue(value) || this.doesValueTrigger(value);
239140
+ }
239141
+ }
239142
+
239143
+
239144
+ /***/ }),
239145
+
239146
+ /***/ "../../core/geometry/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js":
239147
+ /*!**************************************************************************************!*\
239148
+ !*** ../../core/geometry/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js ***!
239149
+ \**************************************************************************************/
239150
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
239151
+
239152
+ "use strict";
239153
+ __webpack_require__.r(__webpack_exports__);
239154
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
239155
+ /* harmony export */ "Point3dArrayRangeTreeContext": () => (/* binding */ Point3dArrayRangeTreeContext)
239156
+ /* harmony export */ });
239157
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
239158
+ /* harmony import */ var _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RangeTreeNode */ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeNode.js");
239159
+ /* harmony import */ var _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RangeTreeSearchHandlers */ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js");
239160
+ /*---------------------------------------------------------------------------------------------
239161
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
239162
+ * See LICENSE.md in the project root for license terms and full copyright notice.
239163
+ *--------------------------------------------------------------------------------------------*/
239164
+ /** @packageDocumentation
239165
+ * @module RangeSearch
239166
+ */
239167
+
239168
+
239169
+
239170
+ /**
239171
+ * Handler class for searching a range tree containing unordered Point3d data.
239172
+ * * Facilitates multiple searches for closest point and close approach calculations.
239173
+ * @public
239174
+ */
239175
+ class Point3dArrayRangeTreeContext {
239176
+ /** Constructor: capture inputs, initialize debug counters */
239177
+ constructor(rangeTreeRoot, points) {
239178
+ this.points = points;
239179
+ this._rangeTreeRoot = rangeTreeRoot;
239180
+ this.numRangeTestTrue = 0;
239181
+ this.numRangeTestFalse = 0;
239182
+ this.numPointTest = 0;
239183
+ this.numSearch = 0;
239184
+ }
239185
+ /**
239186
+ * Create a range tree context with given points:
239187
+ * * initialize with single-point ranges
239188
+ * * appData are point indices
239189
+ * @param points captured
239190
+ * @param maxChildPerNode maximum children per range tree node (default 4)
239191
+ * @param maxAppDataPerLeaf maximum point indices per leaf node (default 4)
239192
+ */
239193
+ static createCapture(points, maxChildPerNode = 4, maxAppDataPerLeaf = 4) {
239194
+ const rangeTreeRoot = _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__.RangeTreeOps.createByIndexSplits(((index) => { return _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__.Range3d.create(points[index]); }), ((index) => { return index; }), points.length, maxChildPerNode, maxAppDataPerLeaf);
239195
+ return rangeTreeRoot ? new Point3dArrayRangeTreeContext(rangeTreeRoot, points) : undefined;
239196
+ }
239197
+ /**
239198
+ * Search the range tree for closest point(s) to spacePoint.
239199
+ * @param spacePoint point to test
239200
+ * @param maxDist collect points at no more than this distance from spacePoint. If undefined, return only the closest point.
239201
+ * @return closest point detail(s) with following fields set:
239202
+ * * detail.point = the closest point
239203
+ * * detail.fraction = the index of the closest point in the points array
239204
+ * * detail.a = distance from spacePoint to closest point
239205
+ */
239206
+ searchForClosestPoint(spacePoint, maxDist) {
239207
+ const handler = new _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_2__.SingleTreeSearchHandlerForClosestPointInArray(spacePoint, this, maxDist);
239208
+ this.numSearch++;
239209
+ this._rangeTreeRoot.searchTopDown(handler);
239210
+ return handler.searchState.savedItems.length <= 1 ? handler.getResult() : handler.getSavedItems();
239211
+ }
239212
+ /**
239213
+ * Search the range trees for closest approach(es) between the point arrays.
239214
+ * @param contextA first point array context
239215
+ * @param contextB second point array context
239216
+ * @param maxDist collect close approaches separated by no more than this distance. If undefined, return only the closest approach.
239217
+ * @return closest approach detail pair(s), one per context, each with the following fields set:
239218
+ * * detail.point = the point at closest approach
239219
+ * * detail.fraction = the index of detail.point in the points array
239220
+ * * detail.a = the closest approach distance
239221
+ */
239222
+ static searchForClosestApproach(contextA, contextB, maxDist) {
239223
+ const handler = new _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_2__.TwoTreeSearchHandlerForPoint3dArrayPoint3dArrayCloseApproach(contextA, contextB, maxDist);
239224
+ _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__.RangeTreeNode.searchTwoTreesTopDown(contextA._rangeTreeRoot, contextB._rangeTreeRoot, handler);
239225
+ return handler.searchState.savedItems.length <= 1 ? handler.getResult() : handler.getSavedItems();
239226
+ }
239227
+ }
239228
+
239229
+
239230
+ /***/ }),
239231
+
239232
+ /***/ "../../core/geometry/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js":
239233
+ /*!**********************************************************************************!*\
239234
+ !*** ../../core/geometry/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js ***!
239235
+ \**********************************************************************************/
239236
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
239237
+
239238
+ "use strict";
239239
+ __webpack_require__.r(__webpack_exports__);
239240
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
239241
+ /* harmony export */ "PolyfaceRangeTreeContext": () => (/* binding */ PolyfaceRangeTreeContext)
239242
+ /* harmony export */ });
239243
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
239244
+ /* harmony import */ var _Polyface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
239245
+ /* harmony import */ var _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
239246
+ /* harmony import */ var _RangeTreeNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RangeTreeNode */ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeNode.js");
239247
+ /* harmony import */ var _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./RangeTreeSearchHandlers */ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js");
239248
+ /*---------------------------------------------------------------------------------------------
239249
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
239250
+ * See LICENSE.md in the project root for license terms and full copyright notice.
239251
+ *--------------------------------------------------------------------------------------------*/
239252
+ /** @packageDocumentation
239253
+ * @module RangeSearch
239254
+ */
239255
+
239256
+
239257
+
239258
+
239259
+
239260
+ /**
239261
+ * Handler class for searching a range tree containing the facets of a polyface.
239262
+ * * Facilitates multiple searches for closest point and close approach calculations.
239263
+ * @public
239264
+ */
239265
+ class PolyfaceRangeTreeContext {
239266
+ /** Constructor: capture inputs, initialize debug counters */
239267
+ constructor(rangeTreeRoot, visitor, convexFacets = false) {
239268
+ this.visitor = visitor;
239269
+ this.convexFacets = convexFacets;
239270
+ this._rangeTreeRoot = rangeTreeRoot;
239271
+ this.numRangeTestTrue = 0;
239272
+ this.numRangeTestFalse = 0;
239273
+ this.numFacetTest = 0;
239274
+ this.numSearch = 0;
239275
+ }
239276
+ /**
239277
+ * Create a range tree context for the Polyface facets.
239278
+ * * This is a very simple construction that splits "right and left parts" of the facet sequence.
239279
+ * * Facets with any recognizable "left to right" or "top to bottom" sequencing will have very effective search structures.
239280
+ * @param visitor access to facets, captured if PolyfaceVisitor
239281
+ * @param maxChildPerNode maximum children per range tree node (default 4)
239282
+ * @param maxAppDataPerLeaf maximum facet indices per leaf node (default 4)
239283
+ * @param convexFacets whether all facets are known to be convex (cf. [[PolyfaceQuery.areFacetsConvex]]) (default false)
239284
+ */
239285
+ static createCapture(visitor, maxChildPerNode = 4, maxAppDataPerLeaf = 4, convexFacets = false) {
239286
+ if (visitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_0__.Polyface)
239287
+ return this.createCapture(visitor.createVisitor(0), maxChildPerNode, maxAppDataPerLeaf, convexFacets);
239288
+ const numFacet = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_1__.PolyfaceQuery.visitorClientFacetCount(visitor);
239289
+ const rangeTreeRoot = _RangeTreeNode__WEBPACK_IMPORTED_MODULE_2__.RangeTreeOps.createByIndexSplits((index) => { visitor.moveToReadIndex(index); return visitor.range(); }, (index) => { return index; }, numFacet, maxChildPerNode, maxAppDataPerLeaf);
239290
+ return rangeTreeRoot ? new PolyfaceRangeTreeContext(rangeTreeRoot, visitor, convexFacets) : undefined;
239291
+ }
239292
+ /**
239293
+ * Search the range tree for closest facet(s) to spacePoint.
239294
+ * @param spacePoint point to test
239295
+ * @param maxDist collect points at no more than this distance from spacePoint. If undefined, return only the closest point.
239296
+ * @param searchFacetInterior whether to include facet interiors in search. Default is false: just consider facet boundaries.
239297
+ * @return closest point detail(s) with detail.a set to the distance from spacePoint to detail.point
239298
+ */
239299
+ searchForClosestPoint(spacePoint, maxDist, searchFacetInterior = false) {
239300
+ const handler = new _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_3__.SingleTreeSearchHandlerForClosestPointOnPolyface(spacePoint, this, maxDist, searchFacetInterior);
239301
+ this.numSearch++;
239302
+ const numFacet = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_1__.PolyfaceQuery.visitorClientFacetCount(this.visitor);
239303
+ // seed the search with a few points -- this reduces early trips deep into early ranges that are far from spacePoint.
239304
+ const numTest = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.clamp(Math.floor(numFacet / 20), 2, 7);
239305
+ const testStep = Math.floor(numFacet / numTest);
239306
+ handler.processAppData(0);
239307
+ handler.processAppData(numFacet - 1);
239308
+ for (let i = testStep; i + 1 < numFacet; i += testStep)
239309
+ handler.processAppData(i);
239310
+ this._rangeTreeRoot.searchTopDown(handler);
239311
+ return handler.searchState.savedItems.length <= 1 ? handler.getResult() : handler.getSavedItems();
239312
+ }
239313
+ /**
239314
+ * Search the range trees for closest approach(es) between the polyfaces.
239315
+ * @param contextA first polyface context
239316
+ * @param contextB second polyface context
239317
+ * @param maxDist collect close approaches separated by no more than this distance. If undefined, return only the closest approach.
239318
+ * @param searchFacetInterior whether to include facet interiors in search (`context.convexFacets` must be true for both contexts). Default is false: just consider facet boundaries.
239319
+ * @return closest approach detail pair(s), one per context, with detail.a set to the approach distance
239320
+ */
239321
+ static searchForClosestApproach(contextA, contextB, maxDist, searchFacetInterior = false) {
239322
+ const handler = new _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_3__.TwoTreeSearchHandlerForFacetFacetCloseApproach(contextA, contextB, maxDist, searchFacetInterior);
239323
+ _RangeTreeNode__WEBPACK_IMPORTED_MODULE_2__.RangeTreeNode.searchTwoTreesTopDown(contextA._rangeTreeRoot, contextB._rangeTreeRoot, handler);
239324
+ return handler.searchState.savedItems.length <= 1 ? handler.getResult() : handler.getSavedItems();
239325
+ }
239326
+ }
239327
+
239328
+
239329
+ /***/ }),
239330
+
239331
+ /***/ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeNode.js":
239332
+ /*!***********************************************************************!*\
239333
+ !*** ../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeNode.js ***!
239334
+ \***********************************************************************/
239335
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
239336
+
239337
+ "use strict";
239338
+ __webpack_require__.r(__webpack_exports__);
239339
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
239340
+ /* harmony export */ "RangeTreeNode": () => (/* binding */ RangeTreeNode),
239341
+ /* harmony export */ "RangeTreeOps": () => (/* binding */ RangeTreeOps),
239342
+ /* harmony export */ "SingleTreeSearchHandler": () => (/* binding */ SingleTreeSearchHandler),
239343
+ /* harmony export */ "TwoTreeDistanceMinimizationSearchHandler": () => (/* binding */ TwoTreeDistanceMinimizationSearchHandler),
239344
+ /* harmony export */ "TwoTreeSearchHandler": () => (/* binding */ TwoTreeSearchHandler)
239345
+ /* harmony export */ });
239346
+ /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
239347
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
239348
+ /*---------------------------------------------------------------------------------------------
239349
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
239350
+ * See LICENSE.md in the project root for license terms and full copyright notice.
239351
+ *--------------------------------------------------------------------------------------------*/
239352
+ /** @packageDocumentation
239353
+ * @module RangeSearch
239354
+ */
239355
+
239356
+
239357
+ /**
239358
+ * Map an (unchecked) integer to a parameterized type T, where the data argument can be either:
239359
+ * * an array of type T
239360
+ * * a function which takes an index and returns type T
239361
+ * @internal
239362
+ */
239363
+ function evaluateIndexToType(data, index) {
239364
+ if (Array.isArray(data))
239365
+ return data[index];
239366
+ return data(index);
239367
+ }
239368
+ /**
239369
+ * Get data by index from a source that may be undefined, an array of item of type T, or a singleton of the item type.
239370
+ * @internal
239371
+ */
239372
+ function getByIndex(index, data) {
239373
+ if (data !== undefined) {
239374
+ if (Array.isArray(data)) {
239375
+ if (index < data.length)
239376
+ return data[index];
239377
+ }
239378
+ else {
239379
+ return data;
239380
+ }
239381
+ }
239382
+ return undefined;
239383
+ }
239384
+ /**
239385
+ * Return the number of items in an object that can be undefined, an array of item of type T, or a singleton of the item type.
239386
+ * @internal
239387
+ */
239388
+ function getFlexDataCount(data) {
239389
+ if (data !== undefined) {
239390
+ if (Array.isArray(data)) {
239391
+ return data.length;
239392
+ }
239393
+ else {
239394
+ return 1;
239395
+ }
239396
+ }
239397
+ return 0;
239398
+ }
239399
+ /**
239400
+ * Abstract class for handler objects called during traversal of a single range tree.
239401
+ * @internal
239402
+ */
239403
+ class SingleTreeSearchHandler {
239404
+ /**
239405
+ * Query to see if the active search has been aborted.
239406
+ * * Default implementation returns false so query runs to completion.
239407
+ * * Search processes check this after range tests and child processing.
239408
+ */
239409
+ // eslint-disable-next-line @itwin/prefer-get
239410
+ isAborted() { return false; }
239411
+ }
239412
+ /**
239413
+ * Abstract class for handler objects called during traversal of two range trees.
239414
+ * @internal
239415
+ */
239416
+ class TwoTreeSearchHandler {
239417
+ /**
239418
+ * Query to see if the active search has been aborted.
239419
+ * * Default implementation returns false so query runs to completion.
239420
+ * * Search processes check this after range tests and child processing.
239421
+ */
239422
+ // eslint-disable-next-line @itwin/prefer-get
239423
+ isAborted() { return false; }
239424
+ }
239425
+ /**
239426
+ * This class refines the TwoTreeSearchHandler with an implementation of `isRangePairActive` appropriate for computing the minimum distance between trees.
239427
+ * * The concrete class must implement `getCurrentDistance()` method to provide the best-so-far distance.
239428
+ * * The implementation of `isRangePairActive` returns true if the distance between ranges is less than or equal to the `getCurrentDistance()` value.
239429
+ * @internal
239430
+ */
239431
+ class TwoTreeDistanceMinimizationSearchHandler extends TwoTreeSearchHandler {
239432
+ /**
239433
+ * Method called to decide whether to process subtrees and immediate child appData items from a left tree node and right tree node.
239434
+ * @param leftRange range from a node in the left tree
239435
+ * @param rightRange range from a node in the right tree.
239436
+ * @returns true if the smallest distance from leftRange to rightRange is less than or equal to getCurrentDistance()
239437
+ */
239438
+ isRangePairActive(leftRange, rightRange) {
239439
+ const currentDistance = this.getCurrentDistance();
239440
+ const distanceBetweenRanges = leftRange.distanceToRange(rightRange);
239441
+ if (distanceBetweenRanges <= currentDistance) {
239442
+ return true;
239443
+ }
239444
+ return false;
239445
+ }
239446
+ }
239447
+ let numNodeCreated = 0;
239448
+ /**
239449
+ * * TREE STRUCTURE
239450
+ * * A RangeTreeNode is part of a range tree.
239451
+ * * TREE is used here in a strictly _structural_ sense, which has no broad promises about data members.
239452
+ * * Each RangeNode points to 0, 1 or many children.
239453
+ * * Each child has (but does not point back to) a single parent.
239454
+ * * The overall tree has a single root.
239455
+ * * Each node is effectively the root of the tree of its children.
239456
+ * * NON-TREE DATA MEMBERS
239457
+ * * Data members in each node (in addition to children) are
239458
+ * * _range = the union of ranges below in the heap
239459
+ * * _appData = application data associated with the node.
239460
+ * * Construction methods may place multiple _appData items in each node.
239461
+ * * In common use, only the leaves will have _appData. However, the class definitions allow _appData at all nodes, and search algorithms must include them.
239462
+ * * CONSTRUCTION
239463
+ * * The RangeTreeNode.createByIndexSplits method constructs the tree with simple right-left splits within an array of input items.
239464
+ * * The appData is placed entirely in the leaves.
239465
+ * * caller can specify:
239466
+ * * the number of _appData items per leaf
239467
+ * * the number of children per node within the tree.
239468
+ * * "deep" trees (2 children per node and one appData per leaf) may have (compared to shallow trees with many children per node and many appData per leaf)
239469
+ * * faster search because lower nodes have smaller ranges that will be skipped by search algorithms.
239470
+ * * larger memory use because of more nodes
239471
+ * * For future construction methods:
239472
+ * * _appData "above the leaves" may allow nodes below to have smaller ranges, but add complexity to search.
239473
+ * @internal
239474
+ */
239475
+ class RangeTreeNode {
239476
+ /**
239477
+ * CONSTRUCTOR
239478
+ * CAPTURE (not copy)
239479
+ * * range = range for search algorithms
239480
+ * * appData = application data relevant to this node.
239481
+ * * children = child node reference(s).
239482
+ */
239483
+ constructor(range, appData, children) {
239484
+ this._range = range;
239485
+ this._appData = appData;
239486
+ this._children = children;
239487
+ this._id = numNodeCreated++;
239488
+ // const childIds: number[] = [];
239489
+ // if (Array.isArray(this._children))
239490
+ // for (const c of this._children) childIds.push(c._id);
239491
+ // else if (this._children instanceof RangeTreeNode)
239492
+ // childIds.push(this._children._id);
239493
+ // const numAppData = getFlexDataCount(appData);
239494
+ // console.log({ id: this._id, childIds, numAppData });
239495
+ }
239496
+ /** Simplest public create: capture the range, appData, and children. */
239497
+ static createCapture(range, appData, children) {
239498
+ return new RangeTreeNode(range, appData, children);
239499
+ }
239500
+ /** copy (not capture) from given data into the range in this RangeEntry */
239501
+ setRange(data) {
239502
+ this._range.setFrom(data);
239503
+ }
239504
+ /** return (a copy of) the range in this RangeEntry */
239505
+ getRange(data) {
239506
+ return this._range.clone(data);
239507
+ }
239508
+ /** return (a reference to) the range in this RangeEntry */
239509
+ getRangeRef() {
239510
+ return this._range;
239511
+ }
239512
+ /**
239513
+ * Access a child by index.
239514
+ * * If the child data is an array, this dereferences the array.
239515
+ * * If the child data is a singleton, treat it as index 0.
239516
+ * * return undefined if there are no children.
239517
+ * @param index index of item to access.
239518
+ */
239519
+ getChildByIndex(index) {
239520
+ return getByIndex(index, this._children);
239521
+ }
239522
+ /**
239523
+ * * Access an appData by index.
239524
+ * * If the appData data is an array, this dereferences the array.
239525
+ * * If the appData data is a singleton, treat it as if it is at index 0 in an array
239526
+ * * return undefined if there are no appData or for any index out of range.
239527
+ * @param index index of item to access.
239528
+ */
239529
+ getAppDataByIndex(index) {
239530
+ return getByIndex(index, this._appData);
239531
+ }
239532
+ /** Access the children or child (does not clone). */
239533
+ getAllChildren() {
239534
+ return this._children;
239535
+ }
239536
+ /** Access the appData array or singleton (does not clone). */
239537
+ getAllAppData() {
239538
+ return this._appData;
239539
+ }
239540
+ /**
239541
+ * Count the direct children in this node of the tree.
239542
+ * * This is not recursive. For a recursive count, use `RangeTreeOps.getRecursiveNodeCount`.
239543
+ */
239544
+ getNumChildren() {
239545
+ return getFlexDataCount(this._children);
239546
+ }
239547
+ /**
239548
+ * Count the appData items in this node of the tree.
239549
+ * * This is not recursive. For a recursive count, use `RangeTreeOps.getRecursiveAppDataCount`.
239550
+ */
239551
+ getNumAppData() {
239552
+ return getFlexDataCount(this._appData);
239553
+ }
239554
+ /**
239555
+ * Depth-first tree iteration, calling `announceNode` on each node.
239556
+ * @param announceNode callback that returns true to recurse into children
239557
+ */
239558
+ recurseIntoTree(announceNode) {
239559
+ const doChildren = announceNode(this);
239560
+ if (doChildren) {
239561
+ if (Array.isArray(this._children)) {
239562
+ for (const child of this._children)
239563
+ child.recurseIntoTree(announceNode);
239564
+ }
239565
+ else if (this._children !== undefined) {
239566
+ this._children.recurseIntoTree(announceNode);
239567
+ }
239568
+ }
239569
+ }
239570
+ /**
239571
+ * Depth-first tree iteration via handler.
239572
+ * * if handler decides the instance range is active, process appData, then recurse on children
239573
+ * * if handler decides to abort after processing an appData, skip processing rest of appData and children
239574
+ */
239575
+ searchTopDown(handler) {
239576
+ if (handler.isRangeActive(this._range)) {
239577
+ let itemToProcess;
239578
+ for (let i = 0; undefined !== (itemToProcess = this.getAppDataByIndex(i)); i++) {
239579
+ // console.log(itemToProcess);
239580
+ handler.processAppData(itemToProcess);
239581
+ if (handler.isAborted())
239582
+ return;
239583
+ }
239584
+ let child;
239585
+ for (let i = 0; undefined !== (child = this.getChildByIndex(i)); i++) {
239586
+ child.searchTopDown(handler);
239587
+ }
239588
+ }
239589
+ }
239590
+ /**
239591
+ * Apply the handler.processAppDataPair method to each pair of appData items from leftAppData and rightStack.
239592
+ * @param leftAppData singleton or array with data "from left"
239593
+ * @param rightStack stack of nodes to process from right path.
239594
+ * @param reverseArgs true if the caller is exchanging the sense of left and right and this should be undone in the actual call to handler.processAppDataPair.
239595
+ * @param handler search handler
239596
+ */
239597
+ static processAppDataAndAppDataStack(leftAppData, rightStack, reverseArgs, handler) {
239598
+ if (leftAppData !== undefined) {
239599
+ let leftItem;
239600
+ let rightItem;
239601
+ // hmm.. we ASSUME that if the tip ranges passed, then all parent ranges would pass without further test.
239602
+ for (let rangeIndex = rightStack.length; rangeIndex-- > 0;) {
239603
+ const rightAppData = rightStack[rangeIndex]._appData;
239604
+ for (let rightIndex = 0; undefined !== (rightItem = getByIndex(rightIndex, rightAppData)); rightIndex++) {
239605
+ for (let leftIndex = 0; undefined !== (leftItem = getByIndex(leftIndex, leftAppData)); leftIndex++) {
239606
+ if (!reverseArgs)
239607
+ handler.processAppDataPair(leftItem, rightItem);
239608
+ else
239609
+ handler.processAppDataPair(rightItem, leftItem);
239610
+ if (handler.isAborted())
239611
+ return;
239612
+ }
239613
+ }
239614
+ }
239615
+ }
239616
+ }
239617
+ /**
239618
+ * Apply the handler.processAppDataPair method to each pair of appData items from leftAppData and rightAppData.
239619
+ * @param leftAppData singleton or array with data "from left"
239620
+ * @param rightAppData singleton or array with data "from right"
239621
+ * @param reverseArgs true if the caller is exchanging the sense of left and right and this should be undone in the actual call to handler.processAppDataPair.
239622
+ * @param handler search handler
239623
+ */
239624
+ static processAppDataAndAppData(leftAppData, rightAppData, reverseArgs, handler) {
239625
+ if (leftAppData !== undefined && rightAppData !== undefined) {
239626
+ let leftItem;
239627
+ let rightItem;
239628
+ for (let rightIndex = 0; undefined !== (rightItem = getByIndex(rightIndex, rightAppData)); rightIndex++) {
239629
+ for (let leftIndex = 0; undefined !== (leftItem = getByIndex(leftIndex, leftAppData)); leftIndex++) {
239630
+ if (!reverseArgs)
239631
+ handler.processAppDataPair(leftItem, rightItem);
239632
+ else
239633
+ handler.processAppDataPair(rightItem, leftItem);
239634
+ if (handler.isAborted())
239635
+ return;
239636
+ }
239637
+ }
239638
+ }
239639
+ }
239640
+ /**
239641
+ * Push the tip node to stack(s).
239642
+ * @param tip new node (to be pushed)
239643
+ * @param fullPath complete path, which is always extended
239644
+ * @param partialPath partial path, which is only extended if the tip has _appData.
239645
+ */
239646
+ static pushPaths(tip, fullPath, partialPath) {
239647
+ fullPath.push(tip);
239648
+ if (tip._appData !== undefined) {
239649
+ partialPath.push(tip);
239650
+ }
239651
+ }
239652
+ /**
239653
+ * Pop the tip node from stack(s).
239654
+ * @param tip should match the fullPath tip.
239655
+ * @param fullPath complete path, which is always popped
239656
+ * @param partialPath partial path, which is only popped if the tip has _appData.
239657
+ */
239658
+ static popPaths(tip, fullPath, partialPath) {
239659
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(fullPath[fullPath.length - 1] === tip);
239660
+ fullPath.pop();
239661
+ if (tip._appData !== undefined) {
239662
+ partialPath.pop();
239663
+ }
239664
+ }
239665
+ /**
239666
+ * Process nodes from left and right trees of dual search.
239667
+ * * The separate stacks for nodes that have appData is for efficiency.
239668
+ * * If data is entirely in the leaves (or just in a few nodes), the stacks will all be empty (or very small) and no time will be wasted looking up the stacks for appData to process with the other tip.
239669
+ * @param leftTip tip node being explored on left
239670
+ * @param leftStack stack of prior left nodes
239671
+ * @param leftStackWithAppData stack of prior left nodes which have appData.
239672
+ * @param rightTip tip node being explored on right.
239673
+ * @param rightStack stack of prior right nodes.
239674
+ * @param rightStackWithAppData stack of prior right nodes which have appData.
239675
+ * @param handler search handler
239676
+ */
239677
+ static recursivePairSearch(leftTip, leftStack, leftStackWithAppData, rightTip, rightStack, rightStackWithAppData, handler) {
239678
+ // console.log({ leftId: leftTip._id, rightId: rightTip._id });
239679
+ const leftTipHasAppData = leftTip._appData !== undefined;
239680
+ const rightTipHasAppData = rightTip._appData !== undefined;
239681
+ let leftChild;
239682
+ let rightChild;
239683
+ // process immediate appData from each tip node with the entire prior path of the other side (each stack currently lacks the tip).
239684
+ if (leftTipHasAppData && rightStackWithAppData.length > 0) {
239685
+ this.processAppDataAndAppDataStack(leftTip._appData, rightStackWithAppData, false, handler);
239686
+ }
239687
+ if (leftStackWithAppData.length > 0 && rightTipHasAppData) {
239688
+ this.processAppDataAndAppDataStack(rightTip._appData, leftStackWithAppData, true, handler);
239689
+ }
239690
+ if (handler.isRangePairActive(leftTip._range, rightTip._range)) {
239691
+ this.processAppDataAndAppData(leftTip._appData, rightTip._appData, false, handler);
239692
+ if (leftTip._children !== undefined && rightTip._children !== undefined) {
239693
+ this.pushPaths(leftTip, leftStack, leftStackWithAppData);
239694
+ this.pushPaths(rightTip, rightStack, rightStackWithAppData);
239695
+ for (let leftIndex = 0; undefined !== (leftChild = getByIndex(leftIndex, leftTip._children)); leftIndex++) {
239696
+ for (let rightIndex = 0; undefined !== (rightChild = getByIndex(rightIndex, rightTip._children)); rightIndex++) {
239697
+ this.recursivePairSearch(leftChild, leftStack, leftStackWithAppData, rightChild, rightStack, rightStackWithAppData, handler);
239698
+ }
239699
+ }
239700
+ this.popPaths(leftTip, leftStack, leftStackWithAppData);
239701
+ this.popPaths(rightTip, rightStack, rightStackWithAppData);
239702
+ }
239703
+ else if (leftTip._children !== undefined) {
239704
+ this.leftRecursivePairSearch(leftTip, rightTip, rightStackWithAppData, false, handler);
239705
+ }
239706
+ else if (rightTip._children !== undefined) {
239707
+ this.leftRecursivePairSearch(rightTip, leftTip, leftStackWithAppData, true, handler);
239708
+ }
239709
+ }
239710
+ }
239711
+ /**
239712
+ * Recurse below the tip of leftTip, offering each level's appData to the appData of rightTip and rightStackWithAppData.
239713
+ * @param leftTip tip node being explored on left. Its appData is not processed.
239714
+ * @param rightTip tip node being explored on right. It has no children.
239715
+ * @param rightStackWithAppData stack of prior right nodes which have appData.
239716
+ * @param reverseArgs true if the caller is exchanging the sense of left and right
239717
+ * @param handler search handler
239718
+ */
239719
+ static leftRecursivePairSearch(leftTip, rightTip, rightStackWithAppData, reverseArgs, handler) {
239720
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(rightTip._children === undefined);
239721
+ // The (possibly deep) left children appData needs to be offered to the right path (including tip)
239722
+ // Note that there are no stack push/pop operations -- the right stack is already reaching to leaf level, so there are no range or appData nodes to add.
239723
+ let leftChild;
239724
+ for (let leftIndex = 0; undefined !== (leftChild = getByIndex(leftIndex, leftTip._children)); leftIndex++) {
239725
+ if (handler.isRangePairActive(leftChild._range, rightTip._range)) {
239726
+ this.processAppDataAndAppData(leftChild._appData, rightTip._appData, reverseArgs, handler);
239727
+ this.processAppDataAndAppDataStack(leftChild._appData, rightStackWithAppData, reverseArgs, handler);
239728
+ this.leftRecursivePairSearch(leftChild, rightTip, rightStackWithAppData, reverseArgs, handler);
239729
+ }
239730
+ }
239731
+ }
239732
+ /**
239733
+ * Recursive search down two trees, with range tests and child processing under control of a handler.
239734
+ * @param leftRoot root of left tree
239735
+ * @param rightRoot root of right tree
239736
+ * @param handler handler for range tests and child process
239737
+ */
239738
+ static searchTwoTreesTopDown(leftRoot, rightRoot, handler) {
239739
+ this.recursivePairSearch(leftRoot, [], [], rightRoot, [], [], handler);
239740
+ }
239741
+ }
239742
+ /**
239743
+ * Utilities for various operations on RangeTree
239744
+ * @internal
239745
+ */
239746
+ class RangeTreeOps {
239747
+ /** Count nodes in this tree. */
239748
+ static getRecursiveNodeCount(root) {
239749
+ let count = 0;
239750
+ root.recurseIntoTree((_node) => { count++; return true; });
239751
+ return count;
239752
+ }
239753
+ /** Count appData in this tree. */
239754
+ static getRecursiveAppDataCount(root) {
239755
+ let count = 0;
239756
+ root.recurseIntoTree((node) => { count += node.getNumAppData(); return true; });
239757
+ return count;
239758
+ }
239759
+ /**
239760
+ * Create a leaf referencing appData items indexed index0<=index<index1 and with combined range of the same indices
239761
+ * @param ranges access to ranges
239762
+ * @param appData access to AppDataType items
239763
+ * @param index0 first index for block of items
239764
+ * @param index1 upper limit index for block of items.
239765
+ * @param arrayLength one more than the largest range/appData index
239766
+ * @returns newly created node.
239767
+ */
239768
+ static createLeafInIndexRange(ranges, appData, index0, index1, arrayLength) {
239769
+ const appDataBlock = [];
239770
+ const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__.Range3d.createNull();
239771
+ index1 = Math.min(index1, arrayLength);
239772
+ // console.log({ case: "LEAF", index0, index1 });
239773
+ for (let i = index0; i < index1; i++) {
239774
+ appDataBlock.push(evaluateIndexToType(appData, i));
239775
+ range.extendRange(evaluateIndexToType(ranges, i));
239776
+ }
239777
+ return RangeTreeNode.createCapture(range, appDataBlock, undefined);
239778
+ }
239779
+ /**
239780
+ * Split the array entries appData[index0 <= i < index1] into blocks of at most maxChildPerNode * maxAppDataPerLeaf and assemble into a tree structure.
239781
+ * @param ranges access to ranges
239782
+ * @param appData access to AppDataType items
239783
+ * @param index0 start index of the block to access
239784
+ * @param index1 terminal index for the block (one after final)
239785
+ * @param arrayLength one more than the largest range/appData index
239786
+ * @param maxChildPerNode max number of child nodes in each interior node
239787
+ * @param maxAppDataPerLeaf max number of appData items in each leaf.
239788
+ * @returns
239789
+ */
239790
+ static createRecursiveByIndexSplits(ranges, appData, index0, index1, arrayLength, maxChildPerNode, maxAppDataPerLeaf) {
239791
+ if (index1 > arrayLength)
239792
+ index1 = arrayLength;
239793
+ const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__.Range3d.createNull();
239794
+ const children = [];
239795
+ const maxChildrenAppData = maxChildPerNode * maxAppDataPerLeaf;
239796
+ // console.log({ name: "createRecursive", index0, index1, maxChildrenAppData });
239797
+ if (index1 <= index0 + maxChildrenAppData) { // index range is small enough to hold the appData in leaf children
239798
+ // console.log({ case: "LEAF GROUP", index0, index1 });
239799
+ for (let indexA = index0 + maxAppDataPerLeaf; index0 < index1; index0 = indexA, indexA = Math.min(indexA + maxAppDataPerLeaf, index1)) {
239800
+ const leaf = RangeTreeOps.createLeafInIndexRange(ranges, appData, index0, indexA, arrayLength);
239801
+ if (leaf !== undefined) {
239802
+ range.extendRange(leaf.getRangeRef());
239803
+ children.push(leaf);
239804
+ }
239805
+ }
239806
+ }
239807
+ else { // split the appData among interior and leaf children
239808
+ // console.log({ case: "INTERIOR", index0, index1 });
239809
+ const numPerGulp = Math.ceil((index1 - index0) / maxChildPerNode);
239810
+ for (let indexA = index0 + numPerGulp; index0 < index1; index0 = indexA, indexA = Math.min(indexA + numPerGulp, index1)) {
239811
+ const child = this.createRecursiveByIndexSplits(ranges, appData, index0, indexA, arrayLength, maxChildPerNode, maxAppDataPerLeaf);
239812
+ if (child !== undefined) {
239813
+ range.extendRange(child.getRangeRef());
239814
+ children.push(child);
239815
+ }
239816
+ }
239817
+ }
239818
+ return (children.length > 0) ? RangeTreeNode.createCapture(range, undefined, children) : undefined;
239819
+ }
239820
+ /**
239821
+ * Create a range tree by simple left-right split of given ranges.
239822
+ * * Leaves carry the inputs in left-to-right order.
239823
+ * * Each leaf range is labeled by its corresponding object(s) in the appData array.
239824
+ * @param ranges access to ranges.
239825
+ * @param appData access to AppDataType items (for leaves).
239826
+ * @param arrayLength one more than the largest range/appData index
239827
+ * @param maxChildrenPerNode max number of child nodes allowed for each interior node.
239828
+ * @param maxAppDataPerLeaf max number of appData items allowed in each leaf.
239829
+ * @returns the root of the new tree, or undefined if array lengths differ or are zero.
239830
+ */
239831
+ static createByIndexSplits(ranges, appData, arrayLength, maxChildrenPerNode = 2, maxAppDataPerLeaf = 2) {
239832
+ // console.log();
239833
+ // const numData = getFlexDataCount(appData);
239834
+ // console.log({ numData });
239835
+ if (arrayLength <= 0
239836
+ || (Array.isArray(ranges) && ranges.length !== arrayLength)
239837
+ || (Array.isArray(appData) && appData.length !== arrayLength))
239838
+ return undefined;
239839
+ if (maxChildrenPerNode < 2)
239840
+ maxChildrenPerNode = 2;
239841
+ return RangeTreeOps.createRecursiveByIndexSplits(ranges, appData, 0, arrayLength, arrayLength, maxChildrenPerNode, maxAppDataPerLeaf);
239842
+ }
239843
+ }
239844
+
239845
+
239846
+ /***/ }),
239847
+
239848
+ /***/ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js":
239849
+ /*!*********************************************************************************!*\
239850
+ !*** ../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js ***!
239851
+ \*********************************************************************************/
239852
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
239853
+
239854
+ "use strict";
239855
+ __webpack_require__.r(__webpack_exports__);
239856
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
239857
+ /* harmony export */ "SingleTreeSearchHandlerForClosestPointInArray": () => (/* binding */ SingleTreeSearchHandlerForClosestPointInArray),
239858
+ /* harmony export */ "SingleTreeSearchHandlerForClosestPointOnLineString3d": () => (/* binding */ SingleTreeSearchHandlerForClosestPointOnLineString3d),
239859
+ /* harmony export */ "SingleTreeSearchHandlerForClosestPointOnPolyface": () => (/* binding */ SingleTreeSearchHandlerForClosestPointOnPolyface),
239860
+ /* harmony export */ "TwoTreeSearchHandlerForFacetFacetCloseApproach": () => (/* binding */ TwoTreeSearchHandlerForFacetFacetCloseApproach),
239861
+ /* harmony export */ "TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach": () => (/* binding */ TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach),
239862
+ /* harmony export */ "TwoTreeSearchHandlerForPoint3dArrayPoint3dArrayCloseApproach": () => (/* binding */ TwoTreeSearchHandlerForPoint3dArrayPoint3dArrayCloseApproach)
239863
+ /* harmony export */ });
239864
+ /* harmony import */ var _curve_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../curve/CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
239865
+ /* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
239866
+ /* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
239867
+ /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
239868
+ /* harmony import */ var _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../FacetLocationDetail */ "../../core/geometry/lib/esm/polyface/FacetLocationDetail.js");
239869
+ /* harmony import */ var _MinimumValueTester__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./MinimumValueTester */ "../../core/geometry/lib/esm/polyface/RangeTree/MinimumValueTester.js");
239870
+ /* harmony import */ var _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RangeTreeNode */ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeNode.js");
239871
+ /*---------------------------------------------------------------------------------------------
239872
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
239873
+ * See LICENSE.md in the project root for license terms and full copyright notice.
239874
+ *--------------------------------------------------------------------------------------------*/
239875
+ /** @packageDocumentation
239876
+ * @module RangeSearch
239877
+ */
239878
+
239879
+
239880
+
239881
+
239882
+
239883
+
239884
+
239885
+ /**
239886
+ * Helper class for searching for the closest point in a set of points.
239887
+ * * Future optimization: avoid sqrt by using squared distance throughout (would require refactoring CurveLocationDetail).
239888
+ * @internal
239889
+ */
239890
+ class SingleTreeSearchHandlerForClosestPointInArray extends _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__.SingleTreeSearchHandler {
239891
+ /**
239892
+ * Constructor
239893
+ * @param spacePoint cloned
239894
+ * @param context captured
239895
+ * @param maxDist collect points at no more than this distance from spacePoint
239896
+ */
239897
+ constructor(spacePoint, context, maxDist) {
239898
+ super();
239899
+ this.context = context;
239900
+ if (maxDist !== undefined && maxDist < 0)
239901
+ maxDist = undefined;
239902
+ this.searchState = _MinimumValueTester__WEBPACK_IMPORTED_MODULE_1__.MinimumValueTester.create(maxDist);
239903
+ this.spacePoint = spacePoint.clone();
239904
+ }
239905
+ /** Return the current closest point */
239906
+ getResult() {
239907
+ if (this.searchState.minValue !== undefined && this.searchState.itemAtMinValue !== undefined) {
239908
+ const iPoint = this.searchState.itemAtMinValue;
239909
+ const cld = _curve_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__.CurveLocationDetail.createCurveFractionPoint(undefined, iPoint, this.context.points[iPoint]);
239910
+ cld.a = this.searchState.minValue;
239911
+ return cld;
239912
+ }
239913
+ return undefined;
239914
+ }
239915
+ /** Return the collected closest points (if collecting) */
239916
+ getSavedItems() {
239917
+ if (this.searchState.savedItems.length === 0)
239918
+ return undefined;
239919
+ const cldArray = [];
239920
+ for (let i = 0; i < this.searchState.savedItems.length; ++i) {
239921
+ const iPoint = this.searchState.savedItems[i];
239922
+ const cld = _curve_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__.CurveLocationDetail.createCurveFractionPoint(undefined, iPoint, this.context.points[iPoint]);
239923
+ cld.a = this.searchState.savedValues[i];
239924
+ cldArray.push(cld);
239925
+ }
239926
+ return cldArray;
239927
+ }
239928
+ /**
239929
+ * Return true if appData within the range should be offered to `processAppData`.
239930
+ * @param range range containing items to be tested.
239931
+ * @returns true if the spacePoint is within the range or close enough that a point in the range could be the closest.
239932
+ */
239933
+ isRangeActive(range) {
239934
+ const dMin = range.distanceToPoint(this.spacePoint);
239935
+ if (this.searchState.isNewMinValue(dMin)) {
239936
+ this.context.numRangeTestTrue++;
239937
+ return true;
239938
+ }
239939
+ this.context.numRangeTestFalse++;
239940
+ return false;
239941
+ }
239942
+ /** Test a point indexed in the range tree as candidate for "closest" */
239943
+ processAppData(candidateIndex) {
239944
+ const d = this.spacePoint.distance(this.context.points[candidateIndex]);
239945
+ this.context.numPointTest++;
239946
+ this.searchState.testAndSave(candidateIndex, d);
239947
+ }
239948
+ }
239949
+ /**
239950
+ * Helper class for searching for the closest approach between sets of points.
239951
+ * * Future optimization: avoid sqrt by using squared distance throughout (would require refactoring CurveLocationDetail).
239952
+ * @internal
239953
+ */
239954
+ class TwoTreeSearchHandlerForPoint3dArrayPoint3dArrayCloseApproach extends _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__.TwoTreeDistanceMinimizationSearchHandler {
239955
+ /**
239956
+ * Constructor
239957
+ * @param contextA captured
239958
+ * @param contextB captured
239959
+ * @param maxDist collect points at no more than this separation distance
239960
+ */
239961
+ constructor(contextA, contextB, maxDist) {
239962
+ super();
239963
+ this.contextA = contextA;
239964
+ this.contextB = contextB;
239965
+ if (maxDist !== undefined && maxDist < 0)
239966
+ maxDist = undefined;
239967
+ this.searchState = _MinimumValueTester__WEBPACK_IMPORTED_MODULE_1__.MinimumValueTester.create(maxDist);
239968
+ }
239969
+ /** Return the current closest approach */
239970
+ getResult() {
239971
+ if (this.searchState.minValue !== undefined) {
239972
+ return this.searchState.itemAtMinValue;
239973
+ }
239974
+ return undefined;
239975
+ }
239976
+ /** Return the collected close approaches (if collecting) */
239977
+ getSavedItems() {
239978
+ if (this.searchState.savedItems.length > 0) {
239979
+ return this.searchState.savedItems;
239980
+ }
239981
+ return undefined;
239982
+ }
239983
+ /** Get current min distance */
239984
+ getCurrentDistance() {
239985
+ const d = this.searchState.minValue;
239986
+ return d === undefined ? Number.MAX_VALUE : d;
239987
+ }
239988
+ /** Compute and test the distance between two points, given their indices. */
239989
+ processAppDataPair(indexA, indexB) {
239990
+ this.contextA.numPointTest++;
239991
+ const pointA = this.contextA.points[indexA];
239992
+ const pointB = this.contextB.points[indexB];
239993
+ const d = pointA.distance(pointB);
239994
+ if (this.searchState.isNewMinOrTrigger(d)) {
239995
+ const cldPair = _curve_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__.CurveLocationDetailPair.createCapture(_curve_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__.CurveLocationDetail.createCurveFractionPoint(undefined, indexA, pointA), _curve_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__.CurveLocationDetail.createCurveFractionPoint(undefined, indexB, pointB));
239996
+ cldPair.detailA.a = cldPair.detailB.a = d;
239997
+ this.searchState.testAndSave(cldPair, d);
239998
+ }
239999
+ }
240000
+ }
240001
+ /**
240002
+ * Helper class for searching for the closest point in a linestring.
240003
+ * * Future optimization: avoid sqrt by using squared distance throughout (would require refactoring CurveLocationDetail).
240004
+ * @internal
240005
+ */
240006
+ class SingleTreeSearchHandlerForClosestPointOnLineString3d extends _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__.SingleTreeSearchHandler {
240007
+ /**
240008
+ * Constructor
240009
+ * @param spacePoint cloned
240010
+ * @param context captured
240011
+ * @param maxDist collect points at no more than this distance from spacePoint
240012
+ */
240013
+ constructor(spacePoint, context, maxDist) {
240014
+ super();
240015
+ this.context = context;
240016
+ if (maxDist !== undefined && maxDist < 0)
240017
+ maxDist = undefined;
240018
+ this.searchState = _MinimumValueTester__WEBPACK_IMPORTED_MODULE_1__.MinimumValueTester.create(maxDist);
240019
+ this.spacePoint = spacePoint.clone();
240020
+ }
240021
+ /** Return the current closest point */
240022
+ getResult() {
240023
+ if (this.searchState.minValue !== undefined && this.searchState.itemAtMinValue !== undefined) {
240024
+ return this.searchState.itemAtMinValue;
240025
+ }
240026
+ return undefined;
240027
+ }
240028
+ /** Return the collected closest points (if collecting) */
240029
+ getSavedItems() {
240030
+ if (this.searchState.savedItems.length > 0) {
240031
+ return this.searchState.savedItems;
240032
+ }
240033
+ return undefined;
240034
+ }
240035
+ /**
240036
+ * Return true if appData within the range should be offered to `processAppData`.
240037
+ * @param range range containing items to be tested.
240038
+ * @returns true if the spacePoint is within the range or close enough that a point in the range could be the closest.
240039
+ */
240040
+ isRangeActive(range) {
240041
+ const dMin = range.distanceToPoint(this.spacePoint);
240042
+ if (this.searchState.isNewMinValue(dMin)) {
240043
+ this.context.numRangeTestTrue++;
240044
+ return true;
240045
+ }
240046
+ this.context.numRangeTestFalse++;
240047
+ return false;
240048
+ }
240049
+ /** Test a segment indexed in the range tree as candidate for "closest" */
240050
+ processAppData(candidateIndex) {
240051
+ const segment = this._workSegment = this.context.lineString.getIndexedSegment(candidateIndex, this._workSegment);
240052
+ if (segment) {
240053
+ const cld = segment.closestPoint(this.spacePoint, false);
240054
+ _curve_LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d.convertLocalToGlobalDetail(cld, candidateIndex, this.context.lineString.numEdges(), this.context.lineString);
240055
+ this.context.numPointTest++;
240056
+ this.searchState.testAndSave(cld, cld.a);
240057
+ }
240058
+ }
240059
+ }
240060
+ /**
240061
+ * Helper class for searching for the closest approach between linestrings.
240062
+ * * Future optimization: avoid sqrt by using squared distance throughout (would require refactoring CurveLocationDetail).
240063
+ * @internal
240064
+ */
240065
+ class TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach extends _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__.TwoTreeDistanceMinimizationSearchHandler {
240066
+ /**
240067
+ * Constructor
240068
+ * @param contextA captured
240069
+ * @param contextB captured
240070
+ * @param maxDist collect points at no more than this separation distance
240071
+ */
240072
+ constructor(contextA, contextB, maxDist) {
240073
+ super();
240074
+ this.contextA = contextA;
240075
+ this.contextB = contextB;
240076
+ if (maxDist !== undefined && maxDist < 0)
240077
+ maxDist = undefined;
240078
+ this.searchState = _MinimumValueTester__WEBPACK_IMPORTED_MODULE_1__.MinimumValueTester.create(maxDist);
240079
+ }
240080
+ /**
240081
+ * Return the current closest approach.
240082
+ * * Details contain linestring *and* segment data, cf. [[LineString3d.convertLocalToGlobalDetail]]
240083
+ */
240084
+ getResult() {
240085
+ if (this.searchState.minValue !== undefined) {
240086
+ return this.searchState.itemAtMinValue;
240087
+ }
240088
+ return undefined;
240089
+ }
240090
+ /** Return the collected close approaches (if collecting) */
240091
+ getSavedItems() {
240092
+ if (this.searchState.savedItems.length > 0) {
240093
+ return this.searchState.savedItems;
240094
+ }
240095
+ return undefined;
240096
+ }
240097
+ /** Get current min distance */
240098
+ getCurrentDistance() {
240099
+ const d = this.searchState.minValue;
240100
+ return d === undefined ? Number.MAX_VALUE : d;
240101
+ }
240102
+ /** Compute and test the closest approach between two segments, given their indices. */
240103
+ processAppDataPair(indexA, indexB) {
240104
+ this.contextA.numPointTest++;
240105
+ const segA = TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach._workSegmentA =
240106
+ this.contextA.lineString.getIndexedSegment(indexA, TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach._workSegmentA);
240107
+ const segB = TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach._workSegmentB =
240108
+ this.contextB.lineString.getIndexedSegment(indexB, TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach._workSegmentB);
240109
+ const cldPair = _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_4__.LineSegment3d.closestApproach(segA, false, segB, false);
240110
+ if (cldPair && this.searchState.isNewMinOrTrigger(cldPair.detailA.a)) {
240111
+ _curve_LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d.convertLocalToGlobalDetail(cldPair.detailA, indexA, this.contextA.lineString.numEdges(), this.contextA.lineString);
240112
+ _curve_LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d.convertLocalToGlobalDetail(cldPair.detailB, indexB, this.contextB.lineString.numEdges(), this.contextB.lineString);
240113
+ this.searchState.testAndSave(cldPair, cldPair.detailA.a);
240114
+ }
240115
+ }
240116
+ }
240117
+ /**
240118
+ * Helper class for searching for the closest point in a polyface.
240119
+ * * Future optimization: avoid sqrt by using squared distance throughout (would require refactoring FacetLocationDetail).
240120
+ * @internal
240121
+ */
240122
+ class SingleTreeSearchHandlerForClosestPointOnPolyface extends _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__.SingleTreeSearchHandler {
240123
+ /**
240124
+ * Constructor
240125
+ * @param spacePoint cloned
240126
+ * @param context captured
240127
+ * @param maxDist collect points at no more than this distance from spacePoint
240128
+ * @param searchFacetInterior true: search facet interior + boundary; false: just boundary
240129
+ */
240130
+ constructor(spacePoint, context, maxDist, searchFacetInterior = false) {
240131
+ super();
240132
+ this.context = context;
240133
+ if (maxDist !== undefined && maxDist < 0)
240134
+ maxDist = undefined;
240135
+ this.searchState = _MinimumValueTester__WEBPACK_IMPORTED_MODULE_1__.MinimumValueTester.create(maxDist);
240136
+ this.spacePoint = spacePoint.clone();
240137
+ this.searchFacetInterior = searchFacetInterior;
240138
+ }
240139
+ /** Return the current closest point */
240140
+ getResult() {
240141
+ if (this.searchState.minValue !== undefined && this.searchState.itemAtMinValue !== undefined) {
240142
+ return this.searchState.itemAtMinValue;
240143
+ }
240144
+ return undefined;
240145
+ }
240146
+ /** Return the collected closest points (if collecting) */
240147
+ getSavedItems() {
240148
+ if (this.searchState.savedItems.length > 0) {
240149
+ return this.searchState.savedItems;
240150
+ }
240151
+ return undefined;
240152
+ }
240153
+ /**
240154
+ * Return true if appData within the range should be offered to `processAppData`.
240155
+ * @param range range containing items to be tested.
240156
+ * @returns true if the spacePoint is within the range or close enough that a point in the range could be the closest.
240157
+ */
240158
+ isRangeActive(range) {
240159
+ const dMin = range.distanceToPoint(this.spacePoint);
240160
+ if (this.searchState.isNewMinValue(dMin)) {
240161
+ this.context.numRangeTestTrue++;
240162
+ return true;
240163
+ }
240164
+ this.context.numRangeTestFalse++;
240165
+ return false;
240166
+ }
240167
+ /** Test a facet indexed in the range tree as candidate for "closest" */
240168
+ processAppData(candidateIndex) {
240169
+ this.context.visitor.setNumWrap(0); // so edgeCount === pointCount; closure point unnecessary for closestPoint[OnBoundary]
240170
+ if (this.context.visitor.moveToReadIndex(candidateIndex)) {
240171
+ let pld;
240172
+ if (this.searchFacetInterior)
240173
+ pld = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_5__.PolygonOps.closestPoint(this.context.visitor.point, this.spacePoint);
240174
+ else
240175
+ pld = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_5__.PolygonOps.closestPointOnBoundary(this.context.visitor.point, this.spacePoint);
240176
+ this.context.numFacetTest++;
240177
+ if (pld && this.searchState.isNewMinOrTrigger(pld.a)) {
240178
+ const edgeCount = this.context.visitor.pointCount;
240179
+ const fld = this.context.convexFacets
240180
+ ? _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_6__.ConvexFacetLocationDetail.createCapture(this.context.visitor.currentReadIndex(), edgeCount, pld)
240181
+ : _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_6__.NonConvexFacetLocationDetail.createCapture(this.context.visitor.currentReadIndex(), edgeCount, pld);
240182
+ this.searchState.testAndSave(fld, pld.a);
240183
+ }
240184
+ }
240185
+ }
240186
+ }
240187
+ /**
240188
+ * Helper class for searching for the closest approach between polyfaces.
240189
+ * * Future optimization: avoid sqrt by using squared distance throughout (would require refactoring FacetLocationDetail).
240190
+ * @internal
240191
+ */
240192
+ class TwoTreeSearchHandlerForFacetFacetCloseApproach extends _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__.TwoTreeDistanceMinimizationSearchHandler {
240193
+ /** Constructor
240194
+ * @param contextA captured
240195
+ * @param contextB captured
240196
+ * @param maxDist collect points at no more than this separation distance
240197
+ * @param searchFacetInterior true: search facet interior + boundary; false: just boundary
240198
+ */
240199
+ constructor(contextA, contextB, maxDist, searchFacetInterior = false) {
240200
+ super();
240201
+ this.contextA = contextA;
240202
+ this.contextB = contextB;
240203
+ if (maxDist !== undefined && maxDist < 0)
240204
+ maxDist = undefined;
240205
+ this.searchState = _MinimumValueTester__WEBPACK_IMPORTED_MODULE_1__.MinimumValueTester.create(maxDist);
240206
+ this.searchFacetInterior = searchFacetInterior && contextA.convexFacets && contextB.convexFacets;
240207
+ }
240208
+ /** Return the facets with closest approach */
240209
+ getResult() {
240210
+ if (this.searchState.minValue !== undefined) {
240211
+ return this.searchState.itemAtMinValue;
240212
+ }
240213
+ return undefined;
240214
+ }
240215
+ /** Return the collected close approaches (if collecting) */
240216
+ getSavedItems() {
240217
+ if (this.searchState.savedItems.length > 0) {
240218
+ return this.searchState.savedItems;
240219
+ }
240220
+ return undefined;
240221
+ }
240222
+ /** Get current min distance */
240223
+ getCurrentDistance() {
240224
+ const d = this.searchState.minValue;
240225
+ return d === undefined ? Number.MAX_VALUE : d;
240226
+ }
240227
+ /** Compute and test the closest approach between two facets, given their indices. */
240228
+ processAppDataPair(indexA, indexB) {
240229
+ this.contextA.visitor.setNumWrap(1); // closed polygons are more efficient for PolygonOps.closestApproach
240230
+ this.contextB.visitor.setNumWrap(1);
240231
+ if (this.contextA.visitor.moveToReadIndex(indexA) && this.contextB.visitor.moveToReadIndex(indexB)) {
240232
+ // ASSUME: not worth sending in maxDist here...
240233
+ const pldPair = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_5__.PolygonOps.closestApproach(this.contextA.visitor.point, this.contextB.visitor.point, undefined, this.searchFacetInterior);
240234
+ this.contextA.numFacetTest++;
240235
+ if (pldPair && this.searchState.isNewMinOrTrigger(pldPair.detailA.a)) {
240236
+ const edgeCountA = this.contextA.visitor.pointCount - 1;
240237
+ const edgeCountB = this.contextB.visitor.pointCount - 1;
240238
+ const fldPair = _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_6__.FacetLocationDetailPair.create(this.contextA.convexFacets ? _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_6__.ConvexFacetLocationDetail.createCapture(indexA, edgeCountA, pldPair.detailA) : _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_6__.NonConvexFacetLocationDetail.createCapture(indexA, edgeCountA, pldPair.detailA), this.contextB.convexFacets ? _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_6__.ConvexFacetLocationDetail.createCapture(indexB, edgeCountB, pldPair.detailB) : _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_6__.NonConvexFacetLocationDetail.createCapture(indexB, edgeCountB, pldPair.detailB));
240239
+ this.searchState.testAndSave(fldPair, fldPair.detailA.a);
240240
+ }
240241
+ }
240242
+ }
240243
+ }
240244
+
240245
+
238341
240246
  /***/ }),
238342
240247
 
238343
240248
  /***/ "../../core/geometry/lib/esm/polyface/TaggedNumericData.js":
@@ -248133,6 +250038,9 @@ class SteppedIndexFunctionFactory {
248133
250038
  * @internal
248134
250039
  */
248135
250040
  class FrankeSurface {
250041
+ constructor(scales) {
250042
+ this.scales = scales;
250043
+ }
248136
250044
  exp0(u, v) {
248137
250045
  return Math.exp(-0.25 * (u * u + v * v) + u + v - 2);
248138
250046
  }
@@ -248150,7 +250058,21 @@ class FrankeSurface {
248150
250058
  const f1 = 0.75 * this.exp1(u, v);
248151
250059
  const f2 = 0.5 * this.exp2(u, v);
248152
250060
  const f3 = -0.2 * this.exp3(u, v);
248153
- return f0 + f1 + f2 + f3;
250061
+ if (this.scales !== undefined) {
250062
+ const numScale = this.scales.length;
250063
+ let f = 0;
250064
+ if (numScale >= 1)
250065
+ f += this.scales[0] * f0;
250066
+ if (numScale >= 2)
250067
+ f += this.scales[1] * f1;
250068
+ if (numScale >= 3)
250069
+ f += this.scales[2] * f2;
250070
+ if (numScale >= 4)
250071
+ f += this.scales[3] * f3;
250072
+ return f;
250073
+ }
250074
+ else
250075
+ return f0 + f1 + f2 + f3;
248154
250076
  }
248155
250077
  du(u, v) {
248156
250078
  const du0 = -3.375 * (u - 2) * this.exp0(u, v);
@@ -250166,6 +252088,40 @@ class Sample {
250166
252088
  point0.push(point0[0].clone());
250167
252089
  return point0;
250168
252090
  }
252091
+ /**
252092
+ * Create a grid of lat-long points on a sphere.
252093
+ * * If pole latitudes appear in the evaluation, a single point (not a circle) is evaluated.
252094
+ * * Circles at various latitudes proceed south to north.
252095
+ * * If first and last angles of longitudeSweep match, that meridian is not duplicated.
252096
+ * * Longitudes can wrap freely.
252097
+ * @param transform local to world
252098
+ * @param numLatitudeStep number of latitude steps (poles count if they are in the sweeps)
252099
+ * @param numLongitudeStep number of longitude steps
252100
+ * @param latitudeSweep angle range for latitudes
252101
+ * @param longitudeSweep angle range for longitudes
252102
+ */
252103
+ static createGridPointsOnEllipsoid(transform, numLatitudeStep, numLongitudeStep, latitudeSweep = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(-90, 90), longitudeSweep = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(0, 360)) {
252104
+ const points = [];
252105
+ const numJ = numLatitudeStep + 1;
252106
+ const jFractionStep = 1.0 / numJ;
252107
+ let numI = numLongitudeStep;
252108
+ const iFractionStep = 1.0 / numI;
252109
+ if (longitudeSweep.isFullCircle)
252110
+ numI--;
252111
+ for (let j = 0; j < numJ; j++) {
252112
+ const phi = latitudeSweep.fractionToRadians(jFractionStep * j);
252113
+ const sinPhi = Math.sin(phi);
252114
+ const cosPhi = Math.cos(phi);
252115
+ const numIThisCircle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_4__.Angle.isAlmostEqualRadiansAllowPeriodShift(phi, -90) ? 1 : numI;
252116
+ for (let i = 0; i < numIThisCircle; i++) {
252117
+ const theta = longitudeSweep.fractionToRadians(iFractionStep * i);
252118
+ const cosTheta = Math.cos(theta);
252119
+ const sinTheta = Math.sin(theta);
252120
+ points.push(transform.multiplyXYZ(cosTheta * cosPhi, sinTheta * cosPhi, sinPhi));
252121
+ }
252122
+ }
252123
+ return points;
252124
+ }
250169
252125
  /**
250170
252126
  * Return an array of points on a circular arc.
250171
252127
  * @param edgesPerQuadrant number of edges per 90 degrees
@@ -250273,14 +252229,36 @@ class Sample {
250273
252229
  return _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Point2d.createFrom(Sample.createRosePoint3d(theta, a));
250274
252230
  }
250275
252231
  /**
250276
- * Create a mesh surface from samples of a smooth function over [0,1]x[0,1].
252232
+ * Create a mesh surface from samples of a smooth real-valued function over [0,1]x[0,1] with multiple humps and dips.
252233
+ * * The facets are bilinear quads, so if planar facets are required, set `options.shouldTriangulate = true`.
250277
252234
  * @param size grid size; the number of intervals on each side of the unit square domain.
252235
+ * @param scales = array of 4 (four) numbers to scale the corresponding Franke exponential. If undefined, all scales are 1.
250278
252236
  */
250279
- static createMeshFromSmoothSurface(size, options) {
252237
+ static createMeshFromFrankeSurface(size, options, scales) {
250280
252238
  const builder = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_49__.PolyfaceBuilder.create(options);
250281
- builder.addUVGridBody(new FrankeSurface(), size, size);
252239
+ builder.addUVGridBody(new FrankeSurface(scales), size, size);
250282
252240
  return builder.claimPolyface(true);
250283
252241
  }
252242
+ /** Stroke a helix over the unit circle. Place in space via a transform.
252243
+ * The various columns of the transform become the critical measures for the (elliptic) helix:
252244
+ * The unit cylinder maps to an elliptic cylinder with x and y columns as 0 and 90 degree vectors.
252245
+ * the Helix pitch is equal to the length of the z axis in the transform.
252246
+ * The completeTurns parameter (which does NOT need to be an integer) is the local z of the last point
252247
+ */
252248
+ static createHelixPoints(completeTurns, numPoints, placement) {
252249
+ const points = [];
252250
+ if (numPoints < 2)
252251
+ numPoints = 2;
252252
+ const dThetaRadians = completeTurns * Math.PI * 2 / (numPoints - 1);
252253
+ const dz = completeTurns / (numPoints - 1);
252254
+ for (let i = 0; i < numPoints; i++) {
252255
+ const thetaRadians = dThetaRadians * i;
252256
+ points.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(Math.cos(thetaRadians), Math.sin(thetaRadians), i * dz));
252257
+ }
252258
+ if (placement)
252259
+ placement.multiplyPoint3dArrayInPlace(points);
252260
+ return points;
252261
+ }
250284
252262
  }
250285
252263
  /** Array with assorted Point2d samples */
250286
252264
  Sample.point2d = [
@@ -252997,7 +254975,7 @@ class LinearSweep extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrim
252997
254975
  }
252998
254976
  /**
252999
254977
  * Create a sweep of a starting contour.
253000
- * @param contour contour to be swept
254978
+ * @param contour contour to be swept, CAPTURED
253001
254979
  * @param direction sweep vector. The contour is swept the full length of the vector.
253002
254980
  * @param capped true to include end caps
253003
254981
  */
@@ -254970,7 +256948,7 @@ class HalfEdge {
254970
256948
  * * The two edges are joined as edgeMate pair.
254971
256949
  * * The two edges are a 2-half-edge face loop in both the faceSuccessor and facePredecessor directions.
254972
256950
  * * Properties x,y,z,i are inserted in each half edge.
254973
- * @returns the reference to the first half edge created.
256951
+ * @returns the reference to the first half edge created, set with "A" properties.
254974
256952
  */
254975
256953
  static createHalfEdgePairWithCoordinates(xA = 0, yA = 0, zA = 0, iA = 0, xB = 0, yB = 0, zB = 0, iB = 0, heArray) {
254976
256954
  const a = HalfEdge.createHalfEdgePair(heArray);
@@ -256008,8 +257986,9 @@ class HalfEdgeGraph {
256008
257986
  * * The two half edges are a 2-half-edge face loop in both the faceSuccessor and facePredecessor directions.
256009
257987
  * * The two half edges are added to the graph's HalfEdge set.
256010
257988
  * * Coordinates are set to zero.
256011
- * * IDs are installed in the two half edges.
256012
- * @returns pointer to the first half edge created, with ID set to iA.
257989
+ * @param iA `i` property of the first created HalfEdge
257990
+ * @param iB `i` property of the second created HalfEdge
257991
+ * @returns pointer to the first half edge created, with `i` property set to iA.
256013
257992
  */
256014
257993
  createEdgeIdId(iA = 0, iB = 0) {
256015
257994
  return HalfEdge.createHalfEdgePairWithCoordinates(0.0, 0.0, 0.0, iA, 0.0, 0.0, 0.0, iB, this.allHalfEdges);
@@ -256357,21 +258336,21 @@ class HalfEdgeGraphFromIndexedLoopsContext {
256357
258336
  * * For an edge with index pair [indexA, indexB]:
256358
258337
  * * if [indexB, indexA] has never appeared, a HalfEdge mated pair is created.
256359
258338
  * * One of that mated pair becomes a HalfEdge in this loop.
256360
- * * The other is "unmatched"
258339
+ * * The other is "unmatched" and gets the EXTERIOR mask.
256361
258340
  * * When announceMatedHalfEdges(halfEdge) is called:
256362
258341
  * * halfEdge and its mate are "new"
256363
258342
  * * all coordinates are zeros.
256364
- * * each contains (as its halfEdge.id property) one index of the [indexA,indexB] pair.
258343
+ * * each contains (as its `i` property) one index of the [indexA,indexB] pair.
256365
258344
  * * those coordinates and indices will never be referenced again by this construction sequence -- the caller is free to mutate them as needed.
256366
258345
  * * if [indexB, indexA] appeared previously (and its outer HalfEdge was left "unmatched"),
256367
- * the "unmatched" HalfEdge is used in the loop being constructed.
256368
- * @param indices Array of indices around the edge. This is accessed cyclically.
258346
+ * the "unmatched" HalfEdge is used in the loop being constructed, and its EXTERIOR mask is cleared.
258347
+ * @param indices Array of indices around the edge. This is accessed cyclically, so first and last indices should be different.
256369
258348
  * @param announceMatedHalfEdges optional function to be called as mated pairs are created. At the call,
256370
258349
  * the given HalfEdge and its mate will have a pair of successive indices from the array.
256371
258350
  */
256372
258351
  insertLoop(indices, announceMatedHalfEdges) {
256373
258352
  const n = indices.length;
256374
- if (n > 1) {
258353
+ if (n > 2) {
256375
258354
  let index0 = indices[indices.length - 1];
256376
258355
  this._halfEdgesAroundCurrentLoop.length = 0;
256377
258356
  for (const index1 of indices) {
@@ -286564,9 +288543,9 @@ const gBase64 = {
286564
288543
 
286565
288544
  /***/ }),
286566
288545
 
286567
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":
288546
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":
286568
288547
  /*!******************************************************************************************************************************!*\
286569
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js ***!
288548
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js ***!
286570
288549
  \******************************************************************************************************************************/
286571
288550
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286572
288551
 
@@ -286583,9 +288562,9 @@ function _arrayLikeToArray(arr, len) {
286583
288562
 
286584
288563
  /***/ }),
286585
288564
 
286586
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js":
288565
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js":
286587
288566
  /*!****************************************************************************************************************************!*\
286588
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js ***!
288567
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js ***!
286589
288568
  \****************************************************************************************************************************/
286590
288569
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286591
288570
 
@@ -286600,9 +288579,9 @@ function _arrayWithHoles(arr) {
286600
288579
 
286601
288580
  /***/ }),
286602
288581
 
286603
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js":
288582
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js":
286604
288583
  /*!***********************************************************************************************************************************!*\
286605
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js ***!
288584
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js ***!
286606
288585
  \***********************************************************************************************************************************/
286607
288586
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286608
288587
 
@@ -286620,9 +288599,9 @@ function _assertThisInitialized(self) {
286620
288599
 
286621
288600
  /***/ }),
286622
288601
 
286623
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/classCallCheck.js":
288602
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/classCallCheck.js":
286624
288603
  /*!****************************************************************************************************************************!*\
286625
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/classCallCheck.js ***!
288604
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/classCallCheck.js ***!
286626
288605
  \****************************************************************************************************************************/
286627
288606
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286628
288607
 
@@ -286639,9 +288618,9 @@ function _classCallCheck(instance, Constructor) {
286639
288618
 
286640
288619
  /***/ }),
286641
288620
 
286642
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/createClass.js":
288621
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/createClass.js":
286643
288622
  /*!*************************************************************************************************************************!*\
286644
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/createClass.js ***!
288623
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/createClass.js ***!
286645
288624
  \*************************************************************************************************************************/
286646
288625
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286647
288626
 
@@ -286650,7 +288629,7 @@ __webpack_require__.r(__webpack_exports__);
286650
288629
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286651
288630
  /* harmony export */ "default": () => (/* binding */ _createClass)
286652
288631
  /* harmony export */ });
286653
- /* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");
288632
+ /* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");
286654
288633
 
286655
288634
  function _defineProperties(target, props) {
286656
288635
  for (var i = 0; i < props.length; i++) {
@@ -286672,9 +288651,9 @@ function _createClass(Constructor, protoProps, staticProps) {
286672
288651
 
286673
288652
  /***/ }),
286674
288653
 
286675
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/defineProperty.js":
288654
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/defineProperty.js":
286676
288655
  /*!****************************************************************************************************************************!*\
286677
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
288656
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
286678
288657
  \****************************************************************************************************************************/
286679
288658
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286680
288659
 
@@ -286683,7 +288662,7 @@ __webpack_require__.r(__webpack_exports__);
286683
288662
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286684
288663
  /* harmony export */ "default": () => (/* binding */ _defineProperty)
286685
288664
  /* harmony export */ });
286686
- /* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");
288665
+ /* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");
286687
288666
 
286688
288667
  function _defineProperty(obj, key, value) {
286689
288668
  key = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key);
@@ -286702,9 +288681,9 @@ function _defineProperty(obj, key, value) {
286702
288681
 
286703
288682
  /***/ }),
286704
288683
 
286705
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js":
288684
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js":
286706
288685
  /*!****************************************************************************************************************************!*\
286707
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js ***!
288686
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js ***!
286708
288687
  \****************************************************************************************************************************/
286709
288688
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286710
288689
 
@@ -286722,9 +288701,9 @@ function _getPrototypeOf(o) {
286722
288701
 
286723
288702
  /***/ }),
286724
288703
 
286725
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/inherits.js":
288704
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/inherits.js":
286726
288705
  /*!**********************************************************************************************************************!*\
286727
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/inherits.js ***!
288706
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/inherits.js ***!
286728
288707
  \**********************************************************************************************************************/
286729
288708
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286730
288709
 
@@ -286733,7 +288712,7 @@ __webpack_require__.r(__webpack_exports__);
286733
288712
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286734
288713
  /* harmony export */ "default": () => (/* binding */ _inherits)
286735
288714
  /* harmony export */ });
286736
- /* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setPrototypeOf.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js");
288715
+ /* harmony import */ var _setPrototypeOf_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setPrototypeOf.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js");
286737
288716
 
286738
288717
  function _inherits(subClass, superClass) {
286739
288718
  if (typeof superClass !== "function" && superClass !== null) {
@@ -286754,9 +288733,9 @@ function _inherits(subClass, superClass) {
286754
288733
 
286755
288734
  /***/ }),
286756
288735
 
286757
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/iterableToArray.js":
288736
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/iterableToArray.js":
286758
288737
  /*!*****************************************************************************************************************************!*\
286759
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/iterableToArray.js ***!
288738
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/iterableToArray.js ***!
286760
288739
  \*****************************************************************************************************************************/
286761
288740
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286762
288741
 
@@ -286771,9 +288750,9 @@ function _iterableToArray(iter) {
286771
288750
 
286772
288751
  /***/ }),
286773
288752
 
286774
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js":
288753
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js":
286775
288754
  /*!*****************************************************************************************************************************!*\
286776
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js ***!
288755
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js ***!
286777
288756
  \*****************************************************************************************************************************/
286778
288757
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286779
288758
 
@@ -286788,9 +288767,9 @@ function _nonIterableRest() {
286788
288767
 
286789
288768
  /***/ }),
286790
288769
 
286791
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js":
288770
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js":
286792
288771
  /*!***************************************************************************************************************************************!*\
286793
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js ***!
288772
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js ***!
286794
288773
  \***************************************************************************************************************************************/
286795
288774
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286796
288775
 
@@ -286799,8 +288778,8 @@ __webpack_require__.r(__webpack_exports__);
286799
288778
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286800
288779
  /* harmony export */ "default": () => (/* binding */ _possibleConstructorReturn)
286801
288780
  /* harmony export */ });
286802
- /* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/typeof.js");
286803
- /* harmony import */ var _assertThisInitialized_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assertThisInitialized.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
288781
+ /* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/typeof.js");
288782
+ /* harmony import */ var _assertThisInitialized_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./assertThisInitialized.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
286804
288783
 
286805
288784
 
286806
288785
  function _possibleConstructorReturn(self, call) {
@@ -286814,9 +288793,9 @@ function _possibleConstructorReturn(self, call) {
286814
288793
 
286815
288794
  /***/ }),
286816
288795
 
286817
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js":
288796
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js":
286818
288797
  /*!****************************************************************************************************************************!*\
286819
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js ***!
288798
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js ***!
286820
288799
  \****************************************************************************************************************************/
286821
288800
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286822
288801
 
@@ -286835,9 +288814,9 @@ function _setPrototypeOf(o, p) {
286835
288814
 
286836
288815
  /***/ }),
286837
288816
 
286838
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toArray.js":
288817
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toArray.js":
286839
288818
  /*!*********************************************************************************************************************!*\
286840
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toArray.js ***!
288819
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toArray.js ***!
286841
288820
  \*********************************************************************************************************************/
286842
288821
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286843
288822
 
@@ -286846,10 +288825,10 @@ __webpack_require__.r(__webpack_exports__);
286846
288825
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286847
288826
  /* harmony export */ "default": () => (/* binding */ _toArray)
286848
288827
  /* harmony export */ });
286849
- /* harmony import */ var _arrayWithHoles_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithHoles.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js");
286850
- /* harmony import */ var _iterableToArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArray.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/iterableToArray.js");
286851
- /* harmony import */ var _unsupportedIterableToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js");
286852
- /* harmony import */ var _nonIterableRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./nonIterableRest.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js");
288828
+ /* harmony import */ var _arrayWithHoles_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayWithHoles.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js");
288829
+ /* harmony import */ var _iterableToArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./iterableToArray.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/iterableToArray.js");
288830
+ /* harmony import */ var _unsupportedIterableToArray_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js");
288831
+ /* harmony import */ var _nonIterableRest_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./nonIterableRest.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js");
286853
288832
 
286854
288833
 
286855
288834
 
@@ -286860,57 +288839,57 @@ function _toArray(arr) {
286860
288839
 
286861
288840
  /***/ }),
286862
288841
 
286863
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toPrimitive.js":
288842
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toPrimitive.js":
286864
288843
  /*!*************************************************************************************************************************!*\
286865
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***!
288844
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***!
286866
288845
  \*************************************************************************************************************************/
286867
288846
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286868
288847
 
286869
288848
  "use strict";
286870
288849
  __webpack_require__.r(__webpack_exports__);
286871
288850
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286872
- /* harmony export */ "default": () => (/* binding */ _toPrimitive)
288851
+ /* harmony export */ "default": () => (/* binding */ toPrimitive)
286873
288852
  /* harmony export */ });
286874
- /* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/typeof.js");
286875
-
286876
- function _toPrimitive(input, hint) {
286877
- if ((0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(input) !== "object" || input === null) return input;
286878
- var prim = input[Symbol.toPrimitive];
286879
- if (prim !== undefined) {
286880
- var res = prim.call(input, hint || "default");
286881
- if ((0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(res) !== "object") return res;
288853
+ /* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/typeof.js");
288854
+
288855
+ function toPrimitive(t, r) {
288856
+ if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(t) || !t) return t;
288857
+ var e = t[Symbol.toPrimitive];
288858
+ if (void 0 !== e) {
288859
+ var i = e.call(t, r || "default");
288860
+ if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i)) return i;
286882
288861
  throw new TypeError("@@toPrimitive must return a primitive value.");
286883
288862
  }
286884
- return (hint === "string" ? String : Number)(input);
288863
+ return ("string" === r ? String : Number)(t);
286885
288864
  }
286886
288865
 
286887
288866
  /***/ }),
286888
288867
 
286889
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":
288868
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":
286890
288869
  /*!***************************************************************************************************************************!*\
286891
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***!
288870
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***!
286892
288871
  \***************************************************************************************************************************/
286893
288872
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286894
288873
 
286895
288874
  "use strict";
286896
288875
  __webpack_require__.r(__webpack_exports__);
286897
288876
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286898
- /* harmony export */ "default": () => (/* binding */ _toPropertyKey)
288877
+ /* harmony export */ "default": () => (/* binding */ toPropertyKey)
286899
288878
  /* harmony export */ });
286900
- /* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/typeof.js");
286901
- /* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toPrimitive.js");
288879
+ /* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/typeof.js");
288880
+ /* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toPrimitive.js");
286902
288881
 
286903
288882
 
286904
- function _toPropertyKey(arg) {
286905
- var key = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__["default"])(arg, "string");
286906
- return (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key) === "symbol" ? key : String(key);
288883
+ function toPropertyKey(t) {
288884
+ var i = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__["default"])(t, "string");
288885
+ return "symbol" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i) ? i : String(i);
286907
288886
  }
286908
288887
 
286909
288888
  /***/ }),
286910
288889
 
286911
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/typeof.js":
288890
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/typeof.js":
286912
288891
  /*!********************************************************************************************************************!*\
286913
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/typeof.js ***!
288892
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/typeof.js ***!
286914
288893
  \********************************************************************************************************************/
286915
288894
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286916
288895
 
@@ -286931,9 +288910,9 @@ function _typeof(o) {
286931
288910
 
286932
288911
  /***/ }),
286933
288912
 
286934
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":
288913
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":
286935
288914
  /*!****************************************************************************************************************************************!*\
286936
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js ***!
288915
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js ***!
286937
288916
  \****************************************************************************************************************************************/
286938
288917
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286939
288918
 
@@ -286942,7 +288921,7 @@ __webpack_require__.r(__webpack_exports__);
286942
288921
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286943
288922
  /* harmony export */ "default": () => (/* binding */ _unsupportedIterableToArray)
286944
288923
  /* harmony export */ });
286945
- /* harmony import */ var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayLikeToArray.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");
288924
+ /* harmony import */ var _arrayLikeToArray_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arrayLikeToArray.js */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js");
286946
288925
 
286947
288926
  function _unsupportedIterableToArray(o, minLen) {
286948
288927
  if (!o) return;
@@ -287440,15 +289419,15 @@ __webpack_require__.r(__webpack_exports__);
287440
289419
  /* harmony export */ "t": () => (/* binding */ t),
287441
289420
  /* harmony export */ "use": () => (/* binding */ use)
287442
289421
  /* harmony export */ });
287443
- /* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/typeof.js");
287444
- /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
287445
- /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/createClass.js");
287446
- /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
287447
- /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/inherits.js");
287448
- /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
287449
- /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
287450
- /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/defineProperty.js");
287451
- /* harmony import */ var _babel_runtime_helpers_esm_toArray__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toArray */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toArray.js");
289422
+ /* harmony import */ var _babel_runtime_helpers_esm_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/typeof */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/typeof.js");
289423
+ /* harmony import */ var _babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/esm/classCallCheck */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/classCallCheck.js");
289424
+ /* harmony import */ var _babel_runtime_helpers_esm_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/esm/createClass */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/createClass.js");
289425
+ /* harmony import */ var _babel_runtime_helpers_esm_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/esm/assertThisInitialized */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js");
289426
+ /* harmony import */ var _babel_runtime_helpers_esm_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/esm/inherits */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/inherits.js");
289427
+ /* harmony import */ var _babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/esm/possibleConstructorReturn */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js");
289428
+ /* harmony import */ var _babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/esm/getPrototypeOf */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js");
289429
+ /* harmony import */ var _babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/esm/defineProperty */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/defineProperty.js");
289430
+ /* harmony import */ var _babel_runtime_helpers_esm_toArray__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/esm/toArray */ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toArray.js");
287452
289431
 
287453
289432
 
287454
289433
 
@@ -290276,7 +292255,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
290276
292255
  /***/ ((module) => {
290277
292256
 
290278
292257
  "use strict";
290279
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.4.0-dev.21","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/**/*,**/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 -c extraction.eslint.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.4.0-dev.21","@itwin/core-bentley":"workspace:^4.4.0-dev.21","@itwin/core-common":"workspace:^4.4.0-dev.21","@itwin/core-geometry":"workspace:^4.4.0-dev.21","@itwin/core-orbitgt":"workspace:^4.4.0-dev.21","@itwin/core-quantity":"workspace:^4.4.0-dev.21"},"//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.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.0.2","typemoq":"^2.1.0","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/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.2.2","@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"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
292258
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.4.0-dev.24","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/**/*,**/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 -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -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.4.0-dev.24","@itwin/core-bentley":"workspace:^4.4.0-dev.24","@itwin/core-common":"workspace:^4.4.0-dev.24","@itwin/core-geometry":"workspace:^4.4.0-dev.24","@itwin/core-orbitgt":"workspace:^4.4.0-dev.24","@itwin/core-quantity":"workspace:^4.4.0-dev.24"},"//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.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.0.2","typemoq":"^2.1.0","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/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.2.2","@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"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
290280
292259
 
290281
292260
  /***/ })
290282
292261