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

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
  }
@@ -139142,6 +139243,17 @@ function colorFromMaterial(material, isTransparent) {
139142
139243
  color = color.withTransparency(0);
139143
139244
  return color;
139144
139245
  }
139246
+ function trsMatrix(translation, rotation, scale, result) {
139247
+ // SPEC: To compose the local transformation matrix, TRS properties MUST be converted to matrices and postmultiplied in the T * R * S order;
139248
+ // first the scale is applied to the vertices, then the rotation, and then the translation.
139249
+ const scaleTf = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createRefs(undefined, scale ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createScale(scale[0], scale[1], scale[2]) : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.identity);
139250
+ const rotTf = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createRefs(undefined, rotation ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createFromQuaternion(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point4d.create(rotation[0], rotation[1], rotation[2], rotation[3])) : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.identity);
139251
+ rotTf.matrix.transposeInPlace(); // See comment on Matrix3d.createFromQuaternion
139252
+ const transTf = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createTranslation(translation ? new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d(translation[0], translation[1], translation[2]) : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero());
139253
+ const tf = scaleTf.multiplyTransformTransform(rotTf, result);
139254
+ transTf.multiplyTransformTransform(tf, tf);
139255
+ return tf;
139256
+ }
139145
139257
  class TransformStack {
139146
139258
  constructor(transform) {
139147
139259
  this._stack = [];
@@ -139162,14 +139274,7 @@ class TransformStack {
139162
139274
  nodeTransform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createOriginAndMatrix(origin, matrix);
139163
139275
  }
139164
139276
  else if (node.rotation || node.scale || node.translation) {
139165
- // SPEC: To compose the local transformation matrix, TRS properties MUST be converted to matrices and postmultiplied in the T * R * S order;
139166
- // first the scale is applied to the vertices, then the rotation, and then the translation.
139167
- const scale = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createRefs(undefined, node.scale ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createScale(node.scale[0], node.scale[1], node.scale[2]) : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.identity);
139168
- const rot = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createRefs(undefined, node.rotation ? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.createFromQuaternion(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point4d.create(node.rotation[0], node.rotation[1], node.rotation[2], node.rotation[3])) : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Matrix3d.identity);
139169
- rot.matrix.transposeInPlace(); // See comment on Matrix3d.createFromQuaternion
139170
- const trans = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createTranslation(node.translation ? new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d(node.translation[0], node.translation[1], node.translation[2]) : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero());
139171
- nodeTransform = scale.multiplyTransformTransform(rot);
139172
- trans.multiplyTransformTransform(nodeTransform, nodeTransform);
139277
+ nodeTransform = trsMatrix(node.translation, node.rotation, node.scale);
139173
139278
  }
139174
139279
  const top = this.transform;
139175
139280
  if (!top)
@@ -139222,6 +139327,9 @@ class GltfReader {
139222
139327
  traverseScene() {
139223
139328
  return this.traverseNodes(this._sceneNodes);
139224
139329
  }
139330
+ get viewFlagOverrides() {
139331
+ return undefined;
139332
+ }
139225
139333
  getTileTransform(transformToRoot, pseudoRtcBias) {
139226
139334
  let transform;
139227
139335
  if (this._returnToCenter || pseudoRtcBias || this._yAxisUp || transformToRoot) {
@@ -139265,18 +139373,19 @@ class GltfReader {
139265
139373
  renderGraphic = renderGraphicList[0];
139266
139374
  else
139267
139375
  renderGraphic = this._system.createGraphicList(renderGraphicList);
139268
- const transform = this.getTileTransform(transformToRoot, pseudoRtcBias);
139269
- let range = contentRange;
139270
- const invTransform = transform?.inverse();
139271
- if (invTransform)
139272
- range = invTransform.multiplyRange(contentRange);
139273
139376
  if (featureTable)
139274
- renderGraphic = this._system.createBatch(renderGraphic, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.PackedFeatureTable.pack(featureTable), range);
139275
- if (transform) {
139377
+ renderGraphic = this._system.createBatch(renderGraphic, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.PackedFeatureTable.pack(featureTable), contentRange);
139378
+ const transform = this.getTileTransform(transformToRoot, pseudoRtcBias);
139379
+ const viewFlagOverrides = this.viewFlagOverrides;
139380
+ if (transform || viewFlagOverrides) {
139276
139381
  const branch = new _render_GraphicBranch__WEBPACK_IMPORTED_MODULE_4__.GraphicBranch(true);
139382
+ if (viewFlagOverrides)
139383
+ branch.setViewFlagOverrides(viewFlagOverrides);
139277
139384
  branch.add(renderGraphic);
139278
- renderGraphic = this._system.createBranch(branch, transform);
139385
+ renderGraphic = this._system.createBranch(branch, transform ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity());
139279
139386
  }
139387
+ const invTransform = transform?.inverse();
139388
+ const range = invTransform ? invTransform.multiplyRange(contentRange) : contentRange;
139280
139389
  return {
139281
139390
  readStatus,
139282
139391
  isLeaf,
@@ -139323,12 +139432,76 @@ class GltfReader {
139323
139432
  mesh.normals.push(new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.OctEncodedNormal(normal));
139324
139433
  return mesh.getGraphics(this._system, instances);
139325
139434
  }
139326
- readNodeAndCreateGraphics(renderGraphicList, node, featureTable, transformStack, instances, pseudoRtcBias) {
139435
+ readInstanceAttributes(node, featureTable) {
139436
+ const ext = node.extensions?.EXT_mesh_gpu_instancing;
139437
+ if (!ext || !ext.attributes) {
139438
+ return undefined;
139439
+ }
139440
+ const translationsView = this.getBufferView(ext.attributes, "TRANSLATION");
139441
+ const translations = translationsView?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float);
139442
+ const rotations = this.getBufferView(ext.attributes, "ROTATION")?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float);
139443
+ const scales = this.getBufferView(ext.attributes, "SCALE")?.toBufferData(_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.Float);
139444
+ // All attributes must specify the same count, count must be greater than zero, and at least one attribute must be specified.
139445
+ const count = translations?.count ?? rotations?.count ?? scales?.count;
139446
+ if (!count || (rotations && rotations.count !== count) || (scales && scales.count !== count)) {
139447
+ return undefined;
139448
+ }
139449
+ const transformCenter = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point3d();
139450
+ const trMin = translationsView?.accessor.min;
139451
+ const trMax = translationsView?.accessor.max;
139452
+ if (trMin && trMax) {
139453
+ const half = (idx) => trMin[idx] + (trMax[idx] - trMin[idx]) / 2;
139454
+ transformCenter.set(half(0), half(1), half(2));
139455
+ }
139456
+ const getTranslation = (index) => {
139457
+ if (!translations) {
139458
+ return undefined;
139459
+ }
139460
+ index *= 3;
139461
+ return [
139462
+ translations.buffer[index + 0] - transformCenter.x,
139463
+ translations.buffer[index + 1] - transformCenter.y,
139464
+ translations.buffer[index + 2] - transformCenter.z,
139465
+ ];
139466
+ };
139467
+ const getRotation = (index) => {
139468
+ index *= 4;
139469
+ return rotations ? [rotations.buffer[index], rotations.buffer[index + 1], rotations.buffer[index + 2], rotations.buffer[index + 3]] : undefined;
139470
+ };
139471
+ const getScale = (index) => {
139472
+ index *= 3;
139473
+ return scales ? [scales.buffer[index], scales.buffer[index + 1], scales.buffer[index + 2]] : undefined;
139474
+ };
139475
+ const transforms = new Float32Array(3 * 4 * count);
139476
+ const transform = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
139477
+ for (let i = 0; i < count; i++) {
139478
+ const tf = trsMatrix(getTranslation(i), getRotation(i), getScale(i), transform);
139479
+ const idx = i * 3 * 4;
139480
+ transforms[idx + 0] = tf.matrix.coffs[0];
139481
+ transforms[idx + 1] = tf.matrix.coffs[1];
139482
+ transforms[idx + 2] = tf.matrix.coffs[2];
139483
+ transforms[idx + 3] = tf.origin.x;
139484
+ transforms[idx + 4] = tf.matrix.coffs[3];
139485
+ transforms[idx + 5] = tf.matrix.coffs[4];
139486
+ transforms[idx + 6] = tf.matrix.coffs[5];
139487
+ transforms[idx + 7] = tf.origin.y;
139488
+ transforms[idx + 8] = tf.matrix.coffs[6];
139489
+ transforms[idx + 9] = tf.matrix.coffs[7];
139490
+ transforms[idx + 10] = tf.matrix.coffs[8];
139491
+ transforms[idx + 11] = tf.origin.z;
139492
+ }
139493
+ // ###TODO? The extension currently provides no way of specifying per-instance feature Ids.
139494
+ // For now, assume that if the feature table contains exactly one feature, all the instances belong to that feature.
139495
+ const featureIds = featureTable && featureTable.isUniform ? new Uint8Array(3 * count) : undefined;
139496
+ return { count, transforms, transformCenter, featureIds };
139497
+ }
139498
+ readNodeAndCreateGraphics(renderGraphicList, node, featureTable, transformStack, batchInstances, pseudoRtcBias) {
139327
139499
  if (undefined === node)
139328
139500
  return _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileReadStatus.InvalidTileData;
139329
139501
  // IMPORTANT: Do not return without popping this node from the stack.
139330
139502
  transformStack.push(node);
139331
139503
  const thisTransform = transformStack.transform;
139504
+ const nodeInstances = !batchInstances && undefined !== node.mesh ? this.readInstanceAttributes(node, featureTable) : undefined;
139332
139505
  /**
139333
139506
  * This is a workaround for tiles generated by
139334
139507
  * context capture which have a large offset from the tileset origin that exceeds the
@@ -139343,16 +139516,16 @@ class GltfReader {
139343
139516
  for (const meshKey of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.getGltfNodeMeshIds)(node)) {
139344
139517
  const nodeMesh = this._meshes[meshKey];
139345
139518
  if (nodeMesh?.primitives) {
139346
- const meshes = this.readMeshPrimitives(node, featureTable, thisTransform, thisBias);
139519
+ const meshes = this.readMeshPrimitives(node, featureTable, thisTransform, thisBias, nodeInstances);
139347
139520
  let renderGraphic;
139348
139521
  if (0 !== meshes.length) {
139349
139522
  if (1 === meshes.length) {
139350
- renderGraphic = this.graphicFromMeshData(meshes[0], instances);
139523
+ renderGraphic = this.graphicFromMeshData(meshes[0], batchInstances ?? nodeInstances);
139351
139524
  }
139352
139525
  else {
139353
139526
  const thisList = [];
139354
139527
  for (const mesh of meshes) {
139355
- renderGraphic = this.graphicFromMeshData(mesh, instances);
139528
+ renderGraphic = this.graphicFromMeshData(mesh, batchInstances ?? nodeInstances);
139356
139529
  if (undefined !== renderGraphic)
139357
139530
  thisList.push(renderGraphic);
139358
139531
  }
@@ -139374,7 +139547,7 @@ class GltfReader {
139374
139547
  for (const childId of node.children) {
139375
139548
  const child = this._nodes[childId];
139376
139549
  if (child)
139377
- this.readNodeAndCreateGraphics(renderGraphicList, child, featureTable, transformStack, instances);
139550
+ this.readNodeAndCreateGraphics(renderGraphicList, child, featureTable, transformStack, batchInstances ?? nodeInstances);
139378
139551
  }
139379
139552
  }
139380
139553
  transformStack.pop();
@@ -139603,9 +139776,9 @@ class GltfReader {
139603
139776
  // DisplayParams doesn't want a separate texture mapping if the material already has one.
139604
139777
  textureMapping = undefined;
139605
139778
  }
139606
- return new _common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams(_common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams.Type.Mesh, color, color, 1, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.LinePixels.Solid, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FillFlags.Always, renderMaterial, undefined, hasBakedLighting, textureMapping);
139779
+ return new _common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams(_common_render_primitives_DisplayParams__WEBPACK_IMPORTED_MODULE_8__.DisplayParams.Type.Mesh, color, color, 1, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.LinePixels.Solid, _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.FillFlags.None, renderMaterial, undefined, hasBakedLighting, textureMapping);
139607
139780
  }
139608
- readMeshPrimitives(node, featureTable, thisTransform, thisBias) {
139781
+ readMeshPrimitives(node, featureTable, thisTransform, thisBias, instances) {
139609
139782
  const meshes = [];
139610
139783
  for (const meshKey of (0,_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.getGltfNodeMeshIds)(node)) {
139611
139784
  const nodeMesh = this._meshes[meshKey];
@@ -139615,9 +139788,30 @@ class GltfReader {
139615
139788
  if (mesh) {
139616
139789
  meshes.push(mesh);
139617
139790
  if (this._computedContentRange && mesh.pointRange) {
139618
- const invTransform = thisTransform?.inverse();
139619
- const meshRange = invTransform ? invTransform.multiplyRange(mesh.pointRange) : mesh.pointRange;
139620
- this._computedContentRange.extendRange(meshRange);
139791
+ const meshRange = thisTransform ? thisTransform.multiplyRange(mesh.pointRange) : mesh.pointRange;
139792
+ if (!instances) {
139793
+ this._computedContentRange.extendRange(meshRange);
139794
+ }
139795
+ else {
139796
+ const tfs = instances.transforms;
139797
+ const nodeRange = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range3d();
139798
+ const extendTransformedRange = (i, x, y, z) => {
139799
+ nodeRange.extendXYZ(tfs[i + 3] + tfs[i + 0] * x + tfs[i + 1] * y + tfs[i + 2] * z, tfs[i + 7] + tfs[i + 4] * x + tfs[i + 5] * y + tfs[i + 6] * z, tfs[i + 11] + tfs[i + 8] * x + tfs[i + 9] * y + tfs[i + 10] * z);
139800
+ };
139801
+ for (let i = 0; i < tfs.length; i += 3 * 4) {
139802
+ extendTransformedRange(i, meshRange.low.x, meshRange.low.y, meshRange.low.z);
139803
+ extendTransformedRange(i, meshRange.low.x, meshRange.low.y, meshRange.high.z);
139804
+ extendTransformedRange(i, meshRange.low.x, meshRange.high.y, meshRange.low.z);
139805
+ extendTransformedRange(i, meshRange.low.x, meshRange.high.y, meshRange.high.z);
139806
+ extendTransformedRange(i, meshRange.high.x, meshRange.low.y, meshRange.low.z);
139807
+ extendTransformedRange(i, meshRange.high.x, meshRange.low.y, meshRange.high.z);
139808
+ extendTransformedRange(i, meshRange.high.x, meshRange.high.y, meshRange.low.z);
139809
+ extendTransformedRange(i, meshRange.high.x, meshRange.high.y, meshRange.high.z);
139810
+ }
139811
+ nodeRange.low.addInPlace(instances.transformCenter);
139812
+ nodeRange.high.addInPlace(instances.transformCenter);
139813
+ this._computedContentRange.extendRange(nodeRange);
139814
+ }
139621
139815
  }
139622
139816
  }
139623
139817
  }
@@ -140352,6 +140546,12 @@ class GltfGraphicsReader extends GltfReader {
140352
140546
  this._featureTable.insert(new _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.Feature(pickableId));
140353
140547
  }
140354
140548
  }
140549
+ get viewFlagOverrides() {
140550
+ return {
140551
+ whiteOnWhiteReversal: false,
140552
+ renderMode: _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.RenderMode.SmoothShade,
140553
+ };
140554
+ }
140355
140555
  async read() {
140356
140556
  await this.resolveResources();
140357
140557
  return this.readGltfAndCreateGraphics(this._isLeaf, this._featureTable, this._contentRange, this._transform);
@@ -141730,12 +141930,39 @@ function createPatternGraphic(params, options) {
141730
141930
  return branch.isEmpty ? undefined : options.system.createGraphicBranch(branch, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity(), { clipVolume });
141731
141931
  }
141732
141932
  function createNodeGraphics(node, options) {
141933
+ if (undefined === node.groupId)
141934
+ return createPrimitivesNodeGraphics(node, options);
141733
141935
  const graphics = [];
141936
+ for (const child of node.nodes) {
141937
+ graphics.push(...createPrimitivesNodeGraphics(child, options));
141938
+ }
141939
+ if (graphics.length === 0)
141940
+ return graphics;
141941
+ const branch = new _render_GraphicBranch__WEBPACK_IMPORTED_MODULE_7__.GraphicBranch(true);
141942
+ branch.groupNodeId = node.groupId;
141943
+ branch.entries.push(...graphics);
141944
+ return [options.system.createBranch(branch, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity())];
141945
+ }
141946
+ function createPrimitivesNodeGraphics(node, options) {
141947
+ let graphics = [];
141734
141948
  for (const primitive of node.primitives) {
141735
141949
  const graphic = primitive.type === "pattern" ? createPatternGraphic(primitive.params, options) : createPrimitiveGraphic(primitive, options);
141736
141950
  if (graphic)
141737
141951
  graphics.push(graphic);
141738
141952
  }
141953
+ if (!graphics.length)
141954
+ return graphics;
141955
+ if (undefined !== node.layerId) {
141956
+ const layerGraphic = 1 === graphics.length ? graphics[0] : options.system.createGraphicList(graphics);
141957
+ graphics = [options.system.createGraphicLayer(layerGraphic, node.layerId)];
141958
+ }
141959
+ else if (undefined !== node.animationNodeId) {
141960
+ const branch = new _render_GraphicBranch__WEBPACK_IMPORTED_MODULE_7__.GraphicBranch(true);
141961
+ branch.animationId = node.animationId;
141962
+ branch.animationNodeId = node.animationNodeId;
141963
+ branch.entries.push(...graphics);
141964
+ graphics = [options.system.createBranch(branch, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity())];
141965
+ }
141739
141966
  return graphics;
141740
141967
  }
141741
141968
  /** @internal */
@@ -141750,23 +141977,7 @@ async function decodeImdlGraphics(options) {
141750
141977
  const system = options.system;
141751
141978
  const graphics = [];
141752
141979
  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
- }
141980
+ graphics.push(...createNodeGraphics(node, graphicsOptions));
141770
141981
  }
141771
141982
  switch (graphics.length) {
141772
141983
  case 0: return undefined;
@@ -141945,6 +142156,7 @@ async function readImdlContent(args) {
141945
142156
  maxVertexTableSize: _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.renderSystem.maxTextureSize,
141946
142157
  omitEdges: false === args.loadEdges,
141947
142158
  createUntransformedRootNode: args.containsTransformNodes,
142159
+ modelGroups: args.modelGroups,
141948
142160
  };
141949
142161
  const document = args.parseDocument ? (await args.parseDocument(parseOpts)) : (0,_common_imdl_ParseImdlDocument__WEBPACK_IMPORTED_MODULE_5__.parseImdlDocument)({ ...parseOpts, timeline: args.timeline });
141950
142162
  if (isCanceled())
@@ -147403,6 +147615,7 @@ class TileDrawArgs {
147403
147615
  this._appearanceProvider = params.appearanceProvider;
147404
147616
  this.hiddenLineSettings = params.hiddenLineSettings;
147405
147617
  this.animationTransformNodeId = params.animationTransformNodeId;
147618
+ this.groupNodeId = params.groupNodeId;
147406
147619
  this.boundingRange = params.boundingRange;
147407
147620
  this.maximumScreenSpaceError = params.maximumScreenSpaceError ?? 16; // 16 is Cesium's default.
147408
147621
  // Do not cull tiles based on clip volume if tiles outside clip are supposed to be drawn but in a different color.
@@ -147481,6 +147694,12 @@ class TileDrawArgs {
147481
147694
  let graphic = this.context.createGraphicBranch(graphics, this.location, opts);
147482
147695
  if (undefined !== this.animationTransformNodeId)
147483
147696
  graphic = this.context.renderSystem.createAnimationTransformNode(graphic, this.animationTransformNodeId);
147697
+ if (undefined !== this.groupNodeId) {
147698
+ const branch = new _render_GraphicBranch__WEBPACK_IMPORTED_MODULE_2__.GraphicBranch();
147699
+ branch.add(graphic);
147700
+ branch.groupNodeId = this.groupNodeId;
147701
+ graphic = this.context.createGraphicBranch(branch, _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Transform.identity);
147702
+ }
147484
147703
  return graphic;
147485
147704
  }
147486
147705
  /** Output graphics for all accumulated tiles. */
@@ -148705,12 +148924,17 @@ class TileTreeReference /* implements RenderMemory.Consumer */ {
148705
148924
  appearanceProvider: this.getAppearanceProvider(tree),
148706
148925
  hiddenLineSettings: this.getHiddenLineSettings(tree),
148707
148926
  animationTransformNodeId: this.getAnimationTransformNodeId(tree),
148927
+ groupNodeId: this.getGroupNodeId(tree),
148708
148928
  });
148709
148929
  }
148710
148930
  /** @internal */
148711
148931
  getAnimationTransformNodeId(_tree) {
148712
148932
  return undefined;
148713
148933
  }
148934
+ /** @internal */
148935
+ getGroupNodeId(_tree) {
148936
+ return undefined;
148937
+ }
148714
148938
  /** Supply transform from this tile tree reference's location to iModel coordinate space.
148715
148939
  * @returns undefined if the TileTree is not yet loaded.
148716
148940
  */
@@ -172310,7 +172534,9 @@ class Geometry {
172310
172534
  /**
172311
172535
  * Clone an array whose members have type `T`, which implements the clone method.
172312
172536
  * * If the clone method returns `undefined`, then `undefined` is forced into the cloned array.
172537
+ * @deprecated in 4.x. Use cloneArray.
172313
172538
  */
172539
+ // eslint-disable-next-line deprecation/deprecation
172314
172540
  static cloneMembers(array) {
172315
172541
  if (array === undefined)
172316
172542
  return undefined;
@@ -172320,6 +172546,18 @@ class Geometry {
172320
172546
  }
172321
172547
  return clonedArray;
172322
172548
  }
172549
+ /**
172550
+ * Clone an array whose members have the cloneable type `T`.
172551
+ */
172552
+ static cloneArray(array) {
172553
+ if (array === undefined)
172554
+ return undefined;
172555
+ const clonedArray = [];
172556
+ for (const element of array) {
172557
+ clonedArray.push(element.clone());
172558
+ }
172559
+ return clonedArray;
172560
+ }
172323
172561
  }
172324
172562
  /** Tolerance for small distances in metric coordinates. */
172325
172563
  Geometry.smallMetricDistance = 1.0e-6;
@@ -183243,7 +183481,7 @@ __webpack_require__.r(__webpack_exports__);
183243
183481
  /* harmony export */ "BSplineWrapMode": () => (/* reexport safe */ _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_108__.BSplineWrapMode),
183244
183482
  /* harmony export */ "BagOfCurves": () => (/* reexport safe */ _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_64__.BagOfCurves),
183245
183483
  /* 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),
183484
+ /* harmony export */ "BentleyGeometryFlatBuffer": () => (/* reexport safe */ _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_129__.BentleyGeometryFlatBuffer),
183247
183485
  /* harmony export */ "Bezier1dNd": () => (/* reexport safe */ _bspline_Bezier1dNd__WEBPACK_IMPORTED_MODULE_98__.Bezier1dNd),
183248
183486
  /* harmony export */ "BezierCoffs": () => (/* reexport safe */ _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_51__.BezierCoffs),
183249
183487
  /* harmony export */ "BezierCurve3d": () => (/* reexport safe */ _bspline_BezierCurve3d__WEBPACK_IMPORTED_MODULE_100__.BezierCurve3d),
@@ -183292,7 +183530,7 @@ __webpack_require__.r(__webpack_exports__);
183292
183530
  /* harmony export */ "CurveSearchStatus": () => (/* reexport safe */ _curve_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_66__.CurveSearchStatus),
183293
183531
  /* harmony export */ "CutLoop": () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.CutLoop),
183294
183532
  /* 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),
183533
+ /* harmony export */ "DeepCompare": () => (/* reexport safe */ _serialization_DeepCompare__WEBPACK_IMPORTED_MODULE_127__.DeepCompare),
183296
183534
  /* harmony export */ "Degree2PowerPolynomial": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.Degree2PowerPolynomial),
183297
183535
  /* harmony export */ "Degree3PowerPolynomial": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.Degree3PowerPolynomial),
183298
183536
  /* harmony export */ "Degree4PowerPolynomial": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.Degree4PowerPolynomial),
@@ -183302,6 +183540,7 @@ __webpack_require__.r(__webpack_exports__);
183302
183540
  /* harmony export */ "EllipsoidPatch": () => (/* reexport safe */ _geometry3d_Ellipsoid__WEBPACK_IMPORTED_MODULE_5__.EllipsoidPatch),
183303
183541
  /* harmony export */ "FacetFaceData": () => (/* reexport safe */ _polyface_FacetFaceData__WEBPACK_IMPORTED_MODULE_111__.FacetFaceData),
183304
183542
  /* harmony export */ "FacetIntersectOptions": () => (/* reexport safe */ _polyface_FacetLocationDetail__WEBPACK_IMPORTED_MODULE_113__.FacetIntersectOptions),
183543
+ /* harmony export */ "FacetLocationDetailPair": () => (/* reexport safe */ _polyface_FacetLocationDetail__WEBPACK_IMPORTED_MODULE_113__.FacetLocationDetailPair),
183305
183544
  /* harmony export */ "FrameBuilder": () => (/* reexport safe */ _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_6__.FrameBuilder),
183306
183545
  /* harmony export */ "GaussMapper": () => (/* reexport safe */ _numerics_Quadrature__WEBPACK_IMPORTED_MODULE_56__.GaussMapper),
183307
183546
  /* harmony export */ "GeodesicPathPoint": () => (/* reexport safe */ _geometry3d_Ellipsoid__WEBPACK_IMPORTED_MODULE_5__.GeodesicPathPoint),
@@ -183315,10 +183554,7 @@ __webpack_require__.r(__webpack_exports__);
183315
183554
  /* harmony export */ "GrowableFloat64Array": () => (/* reexport safe */ _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_10__.GrowableFloat64Array),
183316
183555
  /* harmony export */ "GrowableXYArray": () => (/* reexport safe */ _geometry3d_GrowableXYArray__WEBPACK_IMPORTED_MODULE_11__.GrowableXYArray),
183317
183556
  /* 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),
183557
+ /* harmony export */ "IModelJson": () => (/* reexport safe */ _serialization_IModelJsonSchema__WEBPACK_IMPORTED_MODULE_126__.IModelJson),
183322
183558
  /* harmony export */ "ImplicitLineXY": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.ImplicitLineXY),
183323
183559
  /* harmony export */ "IndexedCollectionInterval": () => (/* reexport safe */ _geometry3d_IndexedCollectionInterval__WEBPACK_IMPORTED_MODULE_13__.IndexedCollectionInterval),
183324
183560
  /* harmony export */ "IndexedPolyface": () => (/* reexport safe */ _polyface_Polyface__WEBPACK_IMPORTED_MODULE_112__.IndexedPolyface),
@@ -183337,6 +183573,7 @@ __webpack_require__.r(__webpack_exports__);
183337
183573
  /* harmony export */ "KnotVector": () => (/* reexport safe */ _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_108__.KnotVector),
183338
183574
  /* harmony export */ "LineSegment3d": () => (/* reexport safe */ _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_72__.LineSegment3d),
183339
183575
  /* harmony export */ "LineString3d": () => (/* reexport safe */ _curve_LineString3d__WEBPACK_IMPORTED_MODULE_73__.LineString3d),
183576
+ /* harmony export */ "LineString3dRangeTreeContext": () => (/* reexport safe */ _polyface_RangeTree_LineString3dRangeTreeContext__WEBPACK_IMPORTED_MODULE_122__.LineString3dRangeTreeContext),
183340
183577
  /* harmony export */ "LinearSweep": () => (/* reexport safe */ _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_90__.LinearSweep),
183341
183578
  /* harmony export */ "LongitudeLatitudeNumber": () => (/* reexport safe */ _geometry3d_LongitudeLatitudeAltitude__WEBPACK_IMPORTED_MODULE_2__.LongitudeLatitudeNumber),
183342
183579
  /* harmony export */ "Loop": () => (/* reexport safe */ _curve_Loop__WEBPACK_IMPORTED_MODULE_74__.Loop),
@@ -183372,6 +183609,7 @@ __webpack_require__.r(__webpack_exports__);
183372
183609
  /* harmony export */ "Point3dArray": () => (/* reexport safe */ _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_24__.Point3dArray),
183373
183610
  /* harmony export */ "Point3dArrayCarrier": () => (/* reexport safe */ _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_25__.Point3dArrayCarrier),
183374
183611
  /* harmony export */ "Point3dArrayPolygonOps": () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.Point3dArrayPolygonOps),
183612
+ /* harmony export */ "Point3dArrayRangeTreeContext": () => (/* reexport safe */ _polyface_RangeTree_Point3dArrayRangeTreeContext__WEBPACK_IMPORTED_MODULE_121__.Point3dArrayRangeTreeContext),
183375
183613
  /* harmony export */ "Point4d": () => (/* reexport safe */ _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_47__.Point4d),
183376
183614
  /* harmony export */ "Point4dArray": () => (/* reexport safe */ _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_24__.Point4dArray),
183377
183615
  /* harmony export */ "PointString3d": () => (/* reexport safe */ _curve_PointString3d__WEBPACK_IMPORTED_MODULE_80__.PointString3d),
@@ -183381,8 +183619,10 @@ __webpack_require__.r(__webpack_exports__);
183381
183619
  /* harmony export */ "PolyfaceClip": () => (/* reexport safe */ _polyface_PolyfaceClip__WEBPACK_IMPORTED_MODULE_120__.PolyfaceClip),
183382
183620
  /* harmony export */ "PolyfaceData": () => (/* reexport safe */ _polyface_PolyfaceData__WEBPACK_IMPORTED_MODULE_118__.PolyfaceData),
183383
183621
  /* harmony export */ "PolyfaceQuery": () => (/* reexport safe */ _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_119__.PolyfaceQuery),
183622
+ /* harmony export */ "PolyfaceRangeTreeContext": () => (/* reexport safe */ _polyface_RangeTree_PolyfaceRangeTreeContext__WEBPACK_IMPORTED_MODULE_123__.PolyfaceRangeTreeContext),
183384
183623
  /* harmony export */ "PolygonLocation": () => (/* reexport safe */ _Geometry__WEBPACK_IMPORTED_MODULE_36__.PolygonLocation),
183385
183624
  /* harmony export */ "PolygonLocationDetail": () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.PolygonLocationDetail),
183625
+ /* harmony export */ "PolygonLocationDetailPair": () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.PolygonLocationDetailPair),
183386
183626
  /* harmony export */ "PolygonOps": () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.PolygonOps),
183387
183627
  /* harmony export */ "PolylineOps": () => (/* reexport safe */ _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_26__.PolylineOps),
183388
183628
  /* harmony export */ "PowerPolynomial": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.PowerPolynomial),
@@ -183403,24 +183643,24 @@ __webpack_require__.r(__webpack_exports__);
183403
183643
  /* harmony export */ "RegionOps": () => (/* reexport safe */ _curve_RegionOps__WEBPACK_IMPORTED_MODULE_79__.RegionOps),
183404
183644
  /* harmony export */ "RotationalSweep": () => (/* reexport safe */ _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_91__.RotationalSweep),
183405
183645
  /* 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),
183646
+ /* harmony export */ "Sample": () => (/* reexport safe */ _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_128__.Sample),
183407
183647
  /* harmony export */ "Segment1d": () => (/* reexport safe */ _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_31__.Segment1d),
183408
183648
  /* harmony export */ "SineCosinePolynomial": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.SineCosinePolynomial),
183409
183649
  /* harmony export */ "SmallSystem": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.SmallSystem),
183410
183650
  /* harmony export */ "SmoothTransformBetweenFrusta": () => (/* reexport safe */ _geometry3d_FrustumAnimation__WEBPACK_IMPORTED_MODULE_7__.SmoothTransformBetweenFrusta),
183411
183651
  /* 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),
183652
+ /* harmony export */ "SpacePolygonTriangulation": () => (/* reexport safe */ _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_125__.SpacePolygonTriangulation),
183413
183653
  /* harmony export */ "Sphere": () => (/* reexport safe */ _solid_Sphere__WEBPACK_IMPORTED_MODULE_94__.Sphere),
183414
183654
  /* harmony export */ "SphereImplicit": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.SphereImplicit),
183415
183655
  /* harmony export */ "StandardViewIndex": () => (/* reexport safe */ _Geometry__WEBPACK_IMPORTED_MODULE_36__.StandardViewIndex),
183416
- /* harmony export */ "SteppedIndexFunctionFactory": () => (/* reexport safe */ _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_127__.SteppedIndexFunctionFactory),
183656
+ /* harmony export */ "SteppedIndexFunctionFactory": () => (/* reexport safe */ _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_128__.SteppedIndexFunctionFactory),
183417
183657
  /* harmony export */ "StringifiedClipVector": () => (/* reexport safe */ _clipping_ClipVector__WEBPACK_IMPORTED_MODULE_43__.StringifiedClipVector),
183418
183658
  /* harmony export */ "StrokeCountMap": () => (/* reexport safe */ _curve_Query_StrokeCountMap__WEBPACK_IMPORTED_MODULE_87__.StrokeCountMap),
183419
183659
  /* harmony export */ "StrokeOptions": () => (/* reexport safe */ _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_82__.StrokeOptions),
183420
183660
  /* harmony export */ "SweepContour": () => (/* reexport safe */ _solid_SweepContour__WEBPACK_IMPORTED_MODULE_95__.SweepContour),
183421
183661
  /* 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),
183662
+ /* harmony export */ "TaggedNumericConstants": () => (/* reexport safe */ _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_124__.TaggedNumericConstants),
183663
+ /* harmony export */ "TaggedNumericData": () => (/* reexport safe */ _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_124__.TaggedNumericData),
183424
183664
  /* harmony export */ "TorusImplicit": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.TorusImplicit),
183425
183665
  /* harmony export */ "TorusPipe": () => (/* reexport safe */ _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_96__.TorusPipe),
183426
183666
  /* harmony export */ "Transform": () => (/* reexport safe */ _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_32__.Transform),
@@ -183428,7 +183668,6 @@ __webpack_require__.r(__webpack_exports__);
183428
183668
  /* harmony export */ "TriDiagonalSystem": () => (/* reexport safe */ _numerics_TriDiagonalSystem__WEBPACK_IMPORTED_MODULE_58__.TriDiagonalSystem),
183429
183669
  /* harmony export */ "TriangleLocationDetail": () => (/* reexport safe */ _geometry3d_BarycentricTriangle__WEBPACK_IMPORTED_MODULE_3__.TriangleLocationDetail),
183430
183670
  /* 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
183671
  /* harmony export */ "TrigPolynomial": () => (/* reexport safe */ _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_55__.TrigPolynomial),
183433
183672
  /* harmony export */ "UVSelect": () => (/* reexport safe */ _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_106__.UVSelect),
183434
183673
  /* harmony export */ "UVSurfaceOps": () => (/* reexport safe */ _geometry3d_UVSurfaceOps__WEBPACK_IMPORTED_MODULE_33__.UVSurfaceOps),
@@ -183567,14 +183806,15 @@ __webpack_require__.r(__webpack_exports__);
183567
183806
  /* harmony import */ var _polyface_PolyfaceData__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(/*! ./polyface/PolyfaceData */ "../../core/geometry/lib/esm/polyface/PolyfaceData.js");
183568
183807
  /* harmony import */ var _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(/*! ./polyface/PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
183569
183808
  /* 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");
183809
+ /* harmony import */ var _polyface_RangeTree_Point3dArrayRangeTreeContext__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(/*! ./polyface/RangeTree/Point3dArrayRangeTreeContext */ "../../core/geometry/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js");
183810
+ /* harmony import */ var _polyface_RangeTree_LineString3dRangeTreeContext__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(/*! ./polyface/RangeTree/LineString3dRangeTreeContext */ "../../core/geometry/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js");
183811
+ /* harmony import */ var _polyface_RangeTree_PolyfaceRangeTreeContext__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(/*! ./polyface/RangeTree/PolyfaceRangeTreeContext */ "../../core/geometry/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js");
183812
+ /* harmony import */ var _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(/*! ./polyface/TaggedNumericData */ "../../core/geometry/lib/esm/polyface/TaggedNumericData.js");
183813
+ /* harmony import */ var _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(/*! ./topology/SpaceTriangulation */ "../../core/geometry/lib/esm/topology/SpaceTriangulation.js");
183814
+ /* harmony import */ var _serialization_IModelJsonSchema__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(/*! ./serialization/IModelJsonSchema */ "../../core/geometry/lib/esm/serialization/IModelJsonSchema.js");
183815
+ /* harmony import */ var _serialization_DeepCompare__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(/*! ./serialization/DeepCompare */ "../../core/geometry/lib/esm/serialization/DeepCompare.js");
183816
+ /* harmony import */ var _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(/*! ./serialization/GeometrySamples */ "../../core/geometry/lib/esm/serialization/GeometrySamples.js");
183817
+ /* harmony import */ var _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(/*! ./serialization/BentleyGeometryFlatBuffer */ "../../core/geometry/lib/esm/serialization/BentleyGeometryFlatBuffer.js");
183578
183818
  /*---------------------------------------------------------------------------------------------
183579
183819
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
183580
183820
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -183825,6 +184065,7 @@ __webpack_require__.r(__webpack_exports__);
183825
184065
 
183826
184066
 
183827
184067
 
184068
+
183828
184069
 
183829
184070
 
183830
184071
  /***/ }),
@@ -185708,7 +185949,7 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
185708
185949
  const distanceA = startFraction * this._totalLength;
185709
185950
  const distanceB = distanceA + signedDistance;
185710
185951
  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
185952
+ const childDetail = fragmentB.childCurve.moveSignedDistanceFromFraction(fragmentB.childFraction0, distanceB - fragmentB.chainDistance0, allowExtension, result?.childDetail); // local detail related to the child curve
185712
185953
  const endFraction = startFraction + (signedDistance / this._totalLength);
185713
185954
  const chainDetail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__.CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, endFraction, signedDistance, result); // global detail related to the curve chain
185714
185955
  chainDetail.childDetail = childDetail;
@@ -185819,8 +186060,8 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
185819
186060
  }
185820
186061
  /**
185821
186062
  * 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.
186063
+ * @param childDetail the local (fragment) detail, captured.
186064
+ * @returns newly allocated global (chain) detail with `childDetail` field pointing to the input, and `a` field copied from the input
185824
186065
  */
185825
186066
  computeChainDetail(childDetail) {
185826
186067
  if (!childDetail.curve)
@@ -186466,8 +186707,7 @@ __webpack_require__.r(__webpack_exports__);
186466
186707
  * @module Curve
186467
186708
  */
186468
186709
 
186469
- /** module Curve */
186470
- /** enumeration of condition for extending a curve beyond start or end point.
186710
+ /** Enumeration of condition for extending a curve beyond start or end point.
186471
186711
  * * Not all CurvePrimitives support these modes.
186472
186712
  * @public
186473
186713
  */
@@ -186484,10 +186724,12 @@ var CurveExtendMode;
186484
186724
  * @public
186485
186725
  */
186486
186726
  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.
186727
+ /**
186728
+ * Given an VariantCurveExtendParameter, isolate the particular CurveExtendMode in effect at an end.
186729
+ * * Return `CurveExtendMode.None` if `param === false`.
186730
+ * * Return `CurveExtendMode.OnCurve` if `param === true`.
186731
+ * * Return the param if it is a single CurveExtendMode.
186732
+ * * Return dereferenced array at entry `endIndex` if the param is an array of CurveExtendMode.
186491
186733
  */
186492
186734
  static resolveVariantCurveExtendParameterToCurveExtendMode(param, endIndex) {
186493
186735
  if (param === false)
@@ -187254,17 +187496,14 @@ var CurveSearchStatus;
187254
187496
  CurveSearchStatus[CurveSearchStatus["stoppedAtBoundary"] = 2] = "stoppedAtBoundary";
187255
187497
  })(CurveSearchStatus || (CurveSearchStatus = {}));
187256
187498
  /**
187257
- * Use to update a vector in case where source and prior result are both possibly undefined.
187499
+ * Use to update a cloneable object when source and/or prior result are possibly undefined.
187258
187500
  * * Any undefined source returns undefined.
187259
187501
  * * For defined source, reuse optional result if available.
187260
187502
  * @param source optional source
187261
187503
  * @param result optional result
187262
187504
  */
187263
- function optionalVectorUpdate(source, result) {
187264
- if (source) {
187265
- return source.clone(result);
187266
- }
187267
- return undefined;
187505
+ function optionalUpdate(source, result) {
187506
+ return source ? source.clone(result) : undefined;
187268
187507
  }
187269
187508
  /**
187270
187509
  * CurveLocationDetail carries point and parameter data about a point evaluated on a curve.
@@ -187331,10 +187570,11 @@ class CurveLocationDetail {
187331
187570
  result.curve = this.curve;
187332
187571
  result.fraction = this.fraction;
187333
187572
  result.fraction1 = this.fraction1;
187334
- result.point1 = this.point1;
187573
+ result.point1 = optionalUpdate(this.point1, result.point1);
187335
187574
  result.point.setFromPoint3d(this.point);
187336
- result.vectorInCurveLocationDetail = optionalVectorUpdate(this.vectorInCurveLocationDetail, result.vectorInCurveLocationDetail);
187575
+ result.vectorInCurveLocationDetail = optionalUpdate(this.vectorInCurveLocationDetail, result.vectorInCurveLocationDetail);
187337
187576
  result.a = this.a;
187577
+ result.childDetail = optionalUpdate(this.childDetail, result.childDetail);
187338
187578
  result.curveSearchStatus = this.curveSearchStatus;
187339
187579
  return result;
187340
187580
  }
@@ -187349,8 +187589,8 @@ class CurveLocationDetail {
187349
187589
  */
187350
187590
  setFP(fraction, point, vector, a = 0.0) {
187351
187591
  this.fraction = fraction;
187352
- this.point.setFrom(point);
187353
- this.vectorInCurveLocationDetail = optionalVectorUpdate(vector, this.vectorInCurveLocationDetail);
187592
+ this.point.setFromPoint3d(point);
187593
+ this.vectorInCurveLocationDetail = optionalUpdate(vector, this.vectorInCurveLocationDetail);
187354
187594
  this.a = a;
187355
187595
  }
187356
187596
  /**
@@ -187386,6 +187626,7 @@ class CurveLocationDetail {
187386
187626
  result.point.setFromPoint3d(point);
187387
187627
  result.vectorInCurveLocationDetail = undefined;
187388
187628
  result.a = 0.0;
187629
+ result.childDetail = undefined;
187389
187630
  result.curveSearchStatus = undefined;
187390
187631
  return result;
187391
187632
  }
@@ -187405,6 +187646,7 @@ class CurveLocationDetail {
187405
187646
  result.point.setFromPoint3d(point);
187406
187647
  result.vectorInCurveLocationDetail = undefined;
187407
187648
  result.a = distance;
187649
+ result.childDetail = undefined;
187408
187650
  result.curveSearchStatus = status;
187409
187651
  return result;
187410
187652
  }
@@ -187428,9 +187670,10 @@ class CurveLocationDetail {
187428
187670
  result = result ? result : new CurveLocationDetail();
187429
187671
  result.curve = curve;
187430
187672
  result.fraction = endFraction;
187431
- result.point = curve.fractionToPoint(endFraction, result.point);
187673
+ curve.fractionToPoint(endFraction, result.point);
187432
187674
  result.vectorInCurveLocationDetail = undefined;
187433
187675
  result.a = a;
187676
+ result.childDetail = undefined;
187434
187677
  result.curveSearchStatus = status;
187435
187678
  return result;
187436
187679
  }
@@ -187439,10 +187682,11 @@ class CurveLocationDetail {
187439
187682
  result = result ? result : new CurveLocationDetail();
187440
187683
  result.curve = curve;
187441
187684
  result.fraction = fraction;
187442
- result.point = curve.fractionToPoint(fraction);
187685
+ curve.fractionToPoint(fraction, result.point);
187443
187686
  result.vectorInCurveLocationDetail = undefined;
187444
- result.curveSearchStatus = undefined;
187445
187687
  result.a = 0.0;
187688
+ result.childDetail = undefined;
187689
+ result.curveSearchStatus = undefined;
187446
187690
  return result;
187447
187691
  }
187448
187692
  /** Create with CurvePrimitive pointer and fraction for evaluation. */
@@ -187451,10 +187695,11 @@ class CurveLocationDetail {
187451
187695
  result.curve = curve;
187452
187696
  result.fraction = fraction;
187453
187697
  const ray = curve.fractionToPointAndDerivative(fraction);
187454
- result.point = ray.origin;
187698
+ result.point.setFromPoint3d(ray.origin);
187455
187699
  result.vectorInCurveLocationDetail = ray.direction;
187456
- result.curveSearchStatus = undefined;
187457
187700
  result.a = 0.0;
187701
+ result.childDetail = undefined;
187702
+ result.curveSearchStatus = undefined;
187458
187703
  return result;
187459
187704
  }
187460
187705
  /** Create with CurvePrimitive pointer and 2 fractions for evaluation. */
@@ -187462,12 +187707,13 @@ class CurveLocationDetail {
187462
187707
  result = result ? result : new CurveLocationDetail();
187463
187708
  result.curve = curve;
187464
187709
  result.fraction = fraction0;
187465
- result.point = curve.fractionToPoint(fraction0);
187710
+ curve.fractionToPoint(fraction0, result.point);
187466
187711
  result.fraction1 = fraction1;
187467
- result.point1 = curve.fractionToPoint(fraction1);
187712
+ result.point1 = curve.fractionToPoint(fraction1, result.point1);
187468
187713
  result.vectorInCurveLocationDetail = undefined;
187469
- result.curveSearchStatus = undefined;
187470
187714
  result.a = 0.0;
187715
+ result.childDetail = undefined;
187716
+ result.curveSearchStatus = undefined;
187471
187717
  return result;
187472
187718
  }
187473
187719
  /** Create with CurvePrimitive pointer, fraction, and point coordinates. */
@@ -187478,6 +187724,7 @@ class CurveLocationDetail {
187478
187724
  result.point.setFromPoint3d(point);
187479
187725
  result.vectorInCurveLocationDetail = undefined;
187480
187726
  result.a = a;
187727
+ result.childDetail = undefined;
187481
187728
  result.curveSearchStatus = undefined;
187482
187729
  return result;
187483
187730
  }
@@ -188780,21 +189027,30 @@ __webpack_require__.r(__webpack_exports__);
188780
189027
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
188781
189028
  /* harmony export */ "LineSegment3d": () => (/* binding */ LineSegment3d)
188782
189029
  /* 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");
189030
+ /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
189031
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
189032
+ /* harmony import */ var _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndVectors */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndVectors.js");
189033
+ /* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
189034
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
189035
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
189036
+ /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
189037
+ /* harmony import */ var _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../numerics/BezierPolynomials */ "../../core/geometry/lib/esm/numerics/BezierPolynomials.js");
189038
+ /* harmony import */ var _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../numerics/Polynomials */ "../../core/geometry/lib/esm/numerics/Polynomials.js");
189039
+ /* harmony import */ var _CurveExtendMode__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./CurveExtendMode */ "../../core/geometry/lib/esm/curve/CurveExtendMode.js");
189040
+ /* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
189041
+ /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
189042
+ /* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
189043
+ /* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
188794
189044
  /*---------------------------------------------------------------------------------------------
188795
189045
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
188796
189046
  * See LICENSE.md in the project root for license terms and full copyright notice.
188797
189047
  *--------------------------------------------------------------------------------------------*/
189048
+ /** @packageDocumentation
189049
+ * @module Curve
189050
+ */
189051
+
189052
+
189053
+
188798
189054
 
188799
189055
 
188800
189056
 
@@ -188821,7 +189077,7 @@ __webpack_require__.r(__webpack_exports__);
188821
189077
  * ```
188822
189078
  * @public
188823
189079
  */
188824
- class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePrimitive {
189080
+ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive {
188825
189081
  /** Test if `other` is of class `LineSegment3d` */
188826
189082
  isSameGeometryClass(other) {
188827
189083
  return other instanceof LineSegment3d;
@@ -188889,7 +189145,7 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
188889
189145
  }
188890
189146
  /** Return the point and derivative vector at fractional position along the line segment. */
188891
189147
  fractionToPointAndDerivative(fraction, result) {
188892
- result = result ? result : _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_1__.Ray3d.createZero();
189148
+ result = result ? result : _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_2__.Ray3d.createZero();
188893
189149
  result.direction.setStartEnd(this._point0, this._point1);
188894
189150
  this._point0.interpolate(fraction, this._point1, result.origin);
188895
189151
  return result;
@@ -188901,7 +189157,7 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
188901
189157
  * * y axis is the second derivative, i.e. 000
188902
189158
  */
188903
189159
  fractionToPointAnd2Derivatives(fraction, result) {
188904
- result = result ? result : _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_2__.Plane3dByOriginAndVectors.createXYPlane();
189160
+ result = result ? result : _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_3__.Plane3dByOriginAndVectors.createXYPlane();
188905
189161
  result.vectorU.setStartEnd(this._point0, this._point1);
188906
189162
  result.vectorV.set(0, 0, 0);
188907
189163
  this._point0.interpolate(fraction, this._point1, result.origin);
@@ -188944,7 +189200,7 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
188944
189200
  result._point1.set(x1, y1, z);
188945
189201
  return result;
188946
189202
  }
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));
189203
+ 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
189204
  }
188949
189205
  /**
188950
189206
  * Create a LineSegment3d from xy coordinates of start and end, with common z.
@@ -188961,7 +189217,7 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
188961
189217
  result._point1.set(x1, y1, z1);
188962
189218
  return result;
188963
189219
  }
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));
189220
+ 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
189221
  }
188966
189222
  /** Return the point at fractional position along the line segment. */
188967
189223
  fractionToPoint(fraction, result) {
@@ -188984,19 +189240,118 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
188984
189240
  * @param spacePoint point in space
188985
189241
  * @param extend if false, only return points within the bounded line segment. If true, allow the point to be on
188986
189242
  * the unbounded line that contains the bounded segment.
189243
+ * @param result optional pre-allocated object to populate and return
189244
+ * @returns detail, with `a` field set to the distance from `spacePoint` to the closest point
188987
189245
  */
188988
189246
  closestPoint(spacePoint, extend, result) {
188989
189247
  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.
189248
+ fraction = _CurveExtendMode__WEBPACK_IMPORTED_MODULE_5__.CurveExtendOptions.correctFraction(extend, fraction);
189249
+ result = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.create(this, result);
188994
189250
  result.fraction = fraction;
188995
189251
  this._point0.interpolate(fraction, this._point1, result.point);
188996
189252
  result.vectorInCurveLocationDetail = undefined;
188997
189253
  result.a = result.point.distance(spacePoint);
188998
189254
  return result;
188999
189255
  }
189256
+ /**
189257
+ * Compute the closest approach between a pair of line segments.
189258
+ * * The approach distance is returned in the `a` fields of the details.
189259
+ * @param segmentA first line segment
189260
+ * @param extendA how to extend segmentA forward/backward
189261
+ * @param segmentB second line segment
189262
+ * @param extendB how to extend segmentB forward/backward
189263
+ * @param result optional pre-allocated object to populate and return
189264
+ * @returns pair of details, one per segment, each with `a` field set to the closest approach distance
189265
+ */
189266
+ static closestApproach(segmentA, extendA, segmentB, extendB, result) {
189267
+ const unboundedFractions = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_7__.Vector2d.create();
189268
+ if (result === undefined)
189269
+ result = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetailPair.createCapture(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.create(), _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.create());
189270
+ if (_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegment3dClosestApproachUnbounded(segmentA._point0, segmentA._point1, segmentB._point0, segmentB._point1, unboundedFractions)) {
189271
+ // There is a simple approach between the unbounded segments. Maybe its a really easy case ...
189272
+ const fractionA = _CurveExtendMode__WEBPACK_IMPORTED_MODULE_5__.CurveExtendOptions.correctFraction(extendA, unboundedFractions.x);
189273
+ const fractionB = _CurveExtendMode__WEBPACK_IMPORTED_MODULE_5__.CurveExtendOptions.correctFraction(extendB, unboundedFractions.y);
189274
+ // if neither fraction was corrected, just accept !!!
189275
+ if (fractionA === unboundedFractions.x && fractionB === unboundedFractions.y) {
189276
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveEvaluatedFraction(segmentA, fractionA, result.detailA);
189277
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveEvaluatedFraction(segmentB, fractionB, result.detailB);
189278
+ result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);
189279
+ return result;
189280
+ }
189281
+ // One or both of the fractions were clamped back to an endpoint.
189282
+ // Claim: (????!!!????) The only proximity candidates that matter are from clamped point onto the other.
189283
+ if (fractionA !== unboundedFractions.x && fractionB !== unboundedFractions.y) {
189284
+ // Fill in (in the result) both individual details with "projected" points and distance.
189285
+ // The "loser" will have its contents replaced.
189286
+ const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;
189287
+ const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;
189288
+ segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);
189289
+ segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);
189290
+ if (result.detailA.a <= result.detailB.a) {
189291
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveFractionPoint(segmentB, fractionB, clampedPointOnB, result.detailB);
189292
+ }
189293
+ else {
189294
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveFractionPoint(segmentA, fractionA, clampedPointOnA, result.detailA);
189295
+ }
189296
+ }
189297
+ else if (fractionB !== unboundedFractions.y) {
189298
+ // B (only) was clamped.
189299
+ const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;
189300
+ segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);
189301
+ result.detailB.setCurve(segmentB);
189302
+ result.detailB.point.setFrom(clampedPointOnB);
189303
+ result.detailB.fraction = fractionB;
189304
+ }
189305
+ else {
189306
+ // fractionA was clamped.
189307
+ const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;
189308
+ segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);
189309
+ result.detailA.setCurve(segmentA);
189310
+ result.detailA.point.setFrom(clampedPointOnA);
189311
+ result.detailA.fraction = fractionA;
189312
+ }
189313
+ result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);
189314
+ return result;
189315
+ }
189316
+ // (probably? certainly?) parallel (possibly coincident) lines.
189317
+ // run all 4 endpoint-to-other cases . . . reassemble carefully ...
189318
+ const resultSet = [
189319
+ segmentA.closestPoint(segmentB._point0, extendA),
189320
+ segmentA.closestPoint(segmentB._point1, extendA),
189321
+ segmentB.closestPoint(segmentA._point0, extendB),
189322
+ segmentB.closestPoint(segmentA._point1, extendB),
189323
+ ];
189324
+ let dMin = resultSet[0].a;
189325
+ let iMin = 0;
189326
+ for (let i = 1; i < 4; i++) {
189327
+ if (resultSet[i].a < dMin) {
189328
+ iMin = i;
189329
+ dMin = resultSet[i].a;
189330
+ }
189331
+ }
189332
+ if (iMin === 0) {
189333
+ resultSet[0].clone(result.detailA);
189334
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 0.0, result.detailB);
189335
+ result.detailB.a = result.detailA.a;
189336
+ }
189337
+ else if (iMin === 1) {
189338
+ resultSet[1].clone(result.detailA);
189339
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 1.0, result.detailB);
189340
+ result.detailB.a = result.detailA.a;
189341
+ }
189342
+ else if (iMin === 2) {
189343
+ resultSet[2].clone(result.detailB);
189344
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 0.0, result.detailA);
189345
+ result.detailA.a = result.detailB.a;
189346
+ }
189347
+ else {
189348
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(iMin === 3);
189349
+ resultSet[3].clone(result.detailB);
189350
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 1.0, result.detailA);
189351
+ result.detailA.a = result.detailB.a;
189352
+ }
189353
+ return result;
189354
+ }
189000
189355
  /** Swap the endpoint references. */
189001
189356
  reverseInPlace() {
189002
189357
  const a = this._point0;
@@ -189011,8 +189366,8 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
189011
189366
  }
189012
189367
  /** Test if both endpoints are in a plane (within tolerance) */
189013
189368
  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));
189369
+ return _Geometry__WEBPACK_IMPORTED_MODULE_9__.Geometry.isSmallMetricDistance(plane.altitude(this._point0))
189370
+ && _Geometry__WEBPACK_IMPORTED_MODULE_9__.Geometry.isSmallMetricDistance(plane.altitude(this._point1));
189016
189371
  }
189017
189372
  /**
189018
189373
  * Compute points of simple (transverse) with a plane.
@@ -189021,12 +189376,12 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
189021
189376
  appendPlaneIntersectionPoints(plane, result) {
189022
189377
  const h0 = plane.altitude(this._point0);
189023
189378
  const h1 = plane.altitude(this._point1);
189024
- const fraction = _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_7__.Order2Bezier.solveCoffs(h0, h1);
189379
+ const fraction = _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_10__.Order2Bezier.solveCoffs(h0, h1);
189025
189380
  let numIntersection = 0;
189026
189381
  if (fraction !== undefined) {
189027
189382
  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;
189383
+ const detail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveFractionPoint(this, fraction, this.fractionToPoint(fraction));
189384
+ detail.intervalRole = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveIntervalRole.isolated;
189030
189385
  result.push(detail);
189031
189386
  }
189032
189387
  return numIntersection;
@@ -189085,7 +189440,7 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
189085
189440
  }
189086
189441
  /** Create a new `LineSegment3d` with coordinates from json object. See `setFromJSON` for object layout description. */
189087
189442
  static fromJSON(json) {
189088
- const result = new LineSegment3d(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.createZero(), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create());
189443
+ const result = new LineSegment3d(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Point3d.createZero(), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Point3d.create());
189089
189444
  result.setFromJSON(json);
189090
189445
  return result;
189091
189446
  }
@@ -189149,7 +189504,7 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
189149
189504
  rangeBetweenFractions(fraction0, fraction1, transform) {
189150
189505
  // (This is cheap -- don't bother testing for fraction0===fraction1)
189151
189506
  if (!transform) {
189152
- const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_8__.Range3d.create();
189507
+ const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_11__.Range3d.create();
189153
189508
  range.extendInterpolated(this._point0, fraction0, this._point1);
189154
189509
  range.extendInterpolated(this._point0, fraction1, this._point1);
189155
189510
  return range;
@@ -189160,17 +189515,17 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
189160
189515
  transform.multiplyPoint3d(point0, point0);
189161
189516
  transform.multiplyPoint3d(point1, point1);
189162
189517
  }
189163
- return _geometry3d_Range__WEBPACK_IMPORTED_MODULE_8__.Range3d.create(point0, point1);
189518
+ return _geometry3d_Range__WEBPACK_IMPORTED_MODULE_11__.Range3d.create(point0, point1);
189164
189519
  }
189165
189520
  /**
189166
189521
  * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).
189167
189522
  * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object
189168
189523
  */
189169
189524
  constructOffsetXY(offsetDistanceOrOptions) {
189170
- const offsetVec = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Vector3d.createStartEnd(this._point0, this._point1);
189525
+ const offsetVec = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.createStartEnd(this._point0, this._point1);
189171
189526
  if (offsetVec.normalizeInPlace()) {
189172
189527
  offsetVec.rotate90CCWXY(offsetVec);
189173
- const offsetDist = _OffsetOptions__WEBPACK_IMPORTED_MODULE_9__.OffsetOptions.getOffsetDistance(offsetDistanceOrOptions);
189528
+ const offsetDist = _OffsetOptions__WEBPACK_IMPORTED_MODULE_12__.OffsetOptions.getOffsetDistance(offsetDistanceOrOptions);
189174
189529
  return LineSegment3d.create(this._point0.plusScaled(offsetVec, offsetDist), this._point1.plusScaled(offsetVec, offsetDist));
189175
189530
  }
189176
189531
  return undefined;
@@ -189184,7 +189539,7 @@ class LineSegment3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePr
189184
189539
  * end of the ray.
189185
189540
  */
189186
189541
  projectedParameterRange(ray, lowHigh) {
189187
- return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_10__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
189542
+ return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_13__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
189188
189543
  }
189189
189544
  }
189190
189545
 
@@ -189241,7 +189596,6 @@ __webpack_require__.r(__webpack_exports__);
189241
189596
 
189242
189597
 
189243
189598
 
189244
- /* eslint-disable @typescript-eslint/naming-convention, no-empty */
189245
189599
  /**
189246
189600
  * Starting with baseIndex and moving index by stepDirection:
189247
189601
  * If the vector from baseIndex to baseIndex +1 crossed with vectorA can be normalized, accumulate it (scaled) to normal.
@@ -189360,10 +189714,7 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
189360
189714
  result.addPoints(points);
189361
189715
  return result;
189362
189716
  }
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
- */
189717
+ /** Create a linestring, capturing the given GrowableXYZArray as the points. */
189367
189718
  static createCapture(points) {
189368
189719
  return new LineString3d(points);
189369
189720
  }
@@ -189387,7 +189738,7 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
189387
189738
  return result;
189388
189739
  }
189389
189740
  /**
189390
- * Add points to the linestring.
189741
+ * Add copies of points to the linestring.
189391
189742
  * Valid inputs are:
189392
189743
  * * a Point2d
189393
189744
  * * a point3d
@@ -189773,24 +190124,33 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
189773
190124
  return result;
189774
190125
  }
189775
190126
  /**
189776
- * Convert a segment index and local fraction to a global fraction.
190127
+ * Convert a segment index and local fraction to a global linestring fraction.
189777
190128
  * @param index index of segment being evaluated
189778
190129
  * @param localFraction local fraction in [0,1] within the segment
190130
+ * @param numSegment number N of segments in the linestring
189779
190131
  * @return global fraction f in [0,1] such that the segment is parameterized by index/N <= f <= (index+1)/N.
189780
190132
  */
189781
- segmentIndexAndLocalFractionToGlobalFraction(index, localFraction) {
189782
- const numSegment = this._points.length - 1;
190133
+ static mapLocalToGlobalFraction(index, localFraction, numSegment) {
189783
190134
  if (numSegment < 1)
189784
190135
  return 0.0;
189785
190136
  return (index + localFraction) / numSegment;
189786
190137
  }
190138
+ /**
190139
+ * Convert a segment index and local fraction to a global linestring fraction.
190140
+ * @param index index of segment being evaluated
190141
+ * @param localFraction local fraction in [0,1] within the segment
190142
+ * @return global fraction f in [0,1] such that the segment is parameterized by index/N <= f <= (index+1)/N.
190143
+ */
190144
+ segmentIndexAndLocalFractionToGlobalFraction(index, localFraction) {
190145
+ return LineString3d.mapLocalToGlobalFraction(index, localFraction, this._points.length - 1);
190146
+ }
189787
190147
  /**
189788
190148
  * Convert a global fraction to a segment index and local fraction.
189789
190149
  * @param globalFraction a fraction f in [0,1] in the linestring parameterization, where the i_th segment
189790
190150
  * (0 <= i < N) is parameterized by i/N <= f <= (i+1)/N.
190151
+ * @returns segment index and local fraction
189791
190152
  */
189792
- globalFractionToSegmentIndexAndLocalFraction(globalFraction) {
189793
- const numSegment = this._points.length - 1;
190153
+ static mapGlobalToLocalFraction(globalFraction, numSegment) {
189794
190154
  if (numSegment < 1)
189795
190155
  return { index: 0, fraction: 0.0 };
189796
190156
  const scaledGlobalFraction = globalFraction * numSegment;
@@ -189801,8 +190161,17 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
189801
190161
  segmentIndex = numSegment - 1;
189802
190162
  else // globalFraction in [0,1]
189803
190163
  segmentIndex = Math.floor(scaledGlobalFraction);
189804
- const localFraction = scaledGlobalFraction - segmentIndex;
189805
- return { index: segmentIndex, fraction: localFraction };
190164
+ return { index: segmentIndex, fraction: scaledGlobalFraction - segmentIndex };
190165
+ }
190166
+ /**
190167
+ * Convert a global linestring fraction to a segment index and local fraction.
190168
+ * @param globalFraction a fraction f in [0,1] in the linestring parameterization, where the i_th segment
190169
+ * (0 <= i < N) is parameterized by i/N <= f <= (i+1)/N.
190170
+ * @param numSegment number N of segments in the linestring
190171
+ * @returns segment index and local fraction
190172
+ */
190173
+ globalFractionToSegmentIndexAndLocalFraction(globalFraction) {
190174
+ return LineString3d.mapGlobalToLocalFraction(globalFraction, this._points.length - 1);
189806
190175
  }
189807
190176
  /** Return a frenet frame, using nearby points to estimate a plane. */
189808
190177
  fractionToFrenetFrame(fraction, result) {
@@ -189883,6 +190252,10 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
189883
190252
  numPoints() {
189884
190253
  return this._points.length;
189885
190254
  }
190255
+ /** Return the number of edges in this linestring. */
190256
+ numEdges() {
190257
+ return this._points.length > 0 ? this._points.length - 1 : 0;
190258
+ }
189886
190259
  /** Evaluate the end point of the linestring. */
189887
190260
  endPoint() {
189888
190261
  if (this._points.length === 0)
@@ -190468,9 +190841,9 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
190468
190841
  return result;
190469
190842
  }
190470
190843
  /** Return (if possible) a specific segment of the linestring */
190471
- getIndexedSegment(index) {
190844
+ getIndexedSegment(index, result) {
190472
190845
  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));
190846
+ return _LineSegment3d__WEBPACK_IMPORTED_MODULE_15__.LineSegment3d.create(this._points.getPoint3dAtCheckedPointIndex(index), this._points.getPoint3dAtCheckedPointIndex(index + 1), result);
190474
190847
  return undefined;
190475
190848
  }
190476
190849
  /** Returns true if first and last points are within metric tolerance. */
@@ -190580,6 +190953,26 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
190580
190953
  projectedParameterRange(ray, lowHigh) {
190581
190954
  return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_18__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
190582
190955
  }
190956
+ /**
190957
+ * Convert the segment detail to a linestring detail:
190958
+ * * `detail.childDetail` is set to a clone of the input segment detail (optionally populating pre-allocated `child` object).
190959
+ * * `childDetail.a` is set to `segmentIndex`.
190960
+ * * `detail.fraction` is set to the global linestring parameter.
190961
+ * * `detail.curve` is set to the parent linestring.
190962
+ * @param detail segment location detail, converted in place
190963
+ * @param segmentIndex index of segment in the linestring
190964
+ * @param numSegment linestring segment count
190965
+ * @param parent optional linestring primitive
190966
+ * @param child optional pre-allocated detail to use to clone the child data
190967
+ * @returns reference to input detail, with both linestring and segment data
190968
+ */
190969
+ static convertLocalToGlobalDetail(detail, segmentIndex, numSegment, parent, child) {
190970
+ detail.childDetail = detail.clone(child);
190971
+ detail.childDetail.a = segmentIndex;
190972
+ detail.fraction = this.mapLocalToGlobalFraction(segmentIndex, detail.fraction, numSegment);
190973
+ detail.curve = parent;
190974
+ return detail;
190975
+ }
190583
190976
  }
190584
190977
  LineString3d._workPointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
190585
190978
  LineString3d._workPointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
@@ -192174,10 +192567,10 @@ class PlanarSubdivision {
192174
192567
  * * no action if start and end points are identical.
192175
192568
  * @param graph containing graph.
192176
192569
  * @param p the curve
192177
- * @param fraction0 starting fraction
192178
192570
  * @param point0 start point
192179
- * @param fraction1 end fraction
192571
+ * @param fraction0 starting fraction
192180
192572
  * @param point1 end point
192573
+ * @param fraction1 end fraction
192181
192574
  * @returns end point and fraction, or start point and fraction if no action
192182
192575
  */
192183
192576
  static addHalfEdge(graph, p, point0, fraction0, point1, fraction1, mergeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
@@ -194009,25 +194402,25 @@ __webpack_require__.r(__webpack_exports__);
194009
194402
  /* harmony export */ "RegionGroupOpType": () => (/* binding */ RegionGroupOpType),
194010
194403
  /* harmony export */ "RegionOpsFaceToFaceSearch": () => (/* binding */ RegionOpsFaceToFaceSearch)
194011
194404
  /* harmony export */ });
194405
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
194406
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
194407
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
194408
+ /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
194012
194409
  /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
194013
194410
  /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
194014
194411
  /* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
194015
194412
  /* 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");
194413
+ /* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
194019
194414
  /* 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
194415
  /* 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
194416
  /* 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");
194417
+ /* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
194418
+ /* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
194419
+ /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
194420
+ /* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
194421
+ /* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
194422
+ /* harmony import */ var _RegionOps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
194423
+ /* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
194031
194424
  /*---------------------------------------------------------------------------------------------
194032
194425
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
194033
194426
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -207085,7 +207478,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
207085
207478
  this.pushXY(p.x, p.y);
207086
207479
  }
207087
207480
  }
207088
- /** Push points from variant sources.
207481
+ /** Push copies of points from variant sources.
207089
207482
  * Valid inputs are:
207090
207483
  * * Point2d
207091
207484
  * * Point3d
@@ -207794,7 +208187,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
207794
208187
  for (const p of points)
207795
208188
  this.push(p);
207796
208189
  }
207797
- /** Push points from variant sources.
208190
+ /** Push copies of points from variant sources.
207798
208191
  * Valid inputs are:
207799
208192
  * * Point2d
207800
208193
  * * Point3d
@@ -208998,6 +209391,19 @@ class IndexedXYZCollection {
208998
209391
  return undefined;
208999
209392
  return this.getPoint3dAtUncheckedPointIndex(this.length - 1, result);
209000
209393
  }
209394
+ /**
209395
+ * Test whether the indexed points are equal within tolerance.
209396
+ * @param index0 index of first point
209397
+ * @param index1 index of second point
209398
+ * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.
209399
+ */
209400
+ almostEqualIndexIndex(index0, index1, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
209401
+ if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)
209402
+ return undefined;
209403
+ return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.getXAtUncheckedPointIndex(index0), this.getXAtUncheckedPointIndex(index1), tolerance)
209404
+ && _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.getYAtUncheckedPointIndex(index0), this.getYAtUncheckedPointIndex(index1), tolerance)
209405
+ && _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.getZAtUncheckedPointIndex(index0), this.getZAtUncheckedPointIndex(index1), tolerance);
209406
+ }
209001
209407
  }
209002
209408
  /**
209003
209409
  * abstract base class extends IndexedXYZCollection, adding methods to push, peek, and pop, and rewrite.
@@ -216784,9 +217190,11 @@ __webpack_require__.r(__webpack_exports__);
216784
217190
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
216785
217191
  * See LICENSE.md in the project root for license terms and full copyright notice.
216786
217192
  *--------------------------------------------------------------------------------------------*/
217193
+ /** @packageDocumentation
217194
+ * @module CartesianGeometry
217195
+ */
216787
217196
 
216788
217197
 
216789
- /* eslint-disable @typescript-eslint/naming-convention, no-empty */
216790
217198
 
216791
217199
 
216792
217200
  //
@@ -216978,12 +217386,13 @@ __webpack_require__.r(__webpack_exports__);
216978
217386
  /* harmony export */ "IndexedXYZCollectionPolygonOps": () => (/* binding */ IndexedXYZCollectionPolygonOps),
216979
217387
  /* harmony export */ "Point3dArrayPolygonOps": () => (/* binding */ Point3dArrayPolygonOps),
216980
217388
  /* harmony export */ "PolygonLocationDetail": () => (/* binding */ PolygonLocationDetail),
217389
+ /* harmony export */ "PolygonLocationDetailPair": () => (/* binding */ PolygonLocationDetailPair),
216981
217390
  /* harmony export */ "PolygonOps": () => (/* binding */ PolygonOps)
216982
217391
  /* harmony export */ });
216983
217392
  /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
216984
217393
  /* 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");
217394
+ /* harmony import */ var _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geometry4d/Matrix4d */ "../../core/geometry/lib/esm/geometry4d/Matrix4d.js");
217395
+ /* harmony import */ var _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry4d/Point4d */ "../../core/geometry/lib/esm/geometry4d/Point4d.js");
216987
217396
  /* harmony import */ var _topology_XYParitySearchContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../topology/XYParitySearchContext */ "../../core/geometry/lib/esm/topology/XYParitySearchContext.js");
216988
217397
  /* harmony import */ var _FrameBuilder__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
216989
217398
  /* harmony import */ var _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
@@ -216993,6 +217402,7 @@ __webpack_require__.r(__webpack_exports__);
216993
217402
  /* harmony import */ var _Point2dVector2d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
216994
217403
  /* harmony import */ var _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
216995
217404
  /* harmony import */ var _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
217405
+ /* harmony import */ var _PolylineOps__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./PolylineOps */ "../../core/geometry/lib/esm/geometry3d/PolylineOps.js");
216996
217406
  /* harmony import */ var _Ray3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
216997
217407
  /* harmony import */ var _SortablePolygon__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./SortablePolygon */ "../../core/geometry/lib/esm/geometry3d/SortablePolygon.js");
216998
217408
  /*---------------------------------------------------------------------------------------------
@@ -217017,6 +217427,7 @@ __webpack_require__.r(__webpack_exports__);
217017
217427
 
217018
217428
 
217019
217429
 
217430
+
217020
217431
  /**
217021
217432
  * Carries data about a point in the plane of a polygon.
217022
217433
  * @public
@@ -217070,6 +217481,51 @@ class PolygonLocationDetail {
217070
217481
  this.code === _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonVertex || this.code === _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonEdgeInterior ||
217071
217482
  this.code === _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.InsidePolygonProjectsToVertex || this.code === _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.InsidePolygonProjectsToEdgeInterior;
217072
217483
  }
217484
+ /**
217485
+ * Set point, index, and fraction for an "at vertex" or "along edge" PolygonLocationDetail.
217486
+ * * Point is not captured; its coordinates are copied.
217487
+ */
217488
+ static createAtVertexOrEdge(point, index, fraction = 0) {
217489
+ const detail = new PolygonLocationDetail();
217490
+ detail.point.setFrom(point);
217491
+ detail.closestEdgeIndex = index;
217492
+ detail.closestEdgeParam = fraction;
217493
+ fraction = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.clamp(fraction, 0, 1);
217494
+ detail.code = (fraction > 0 && fraction < 1) ? _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonEdgeInterior : _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonVertex;
217495
+ return detail;
217496
+ }
217497
+ }
217498
+ /**
217499
+ * A pair of PolygonLocationDetail.
217500
+ * @public
217501
+ */
217502
+ class PolygonLocationDetailPair {
217503
+ /** Constructor, captures inputs */
217504
+ constructor(detailA, detailB) {
217505
+ this.detailA = detailA ? detailA : PolygonLocationDetail.create();
217506
+ this.detailB = detailB ? detailB : PolygonLocationDetail.create();
217507
+ }
217508
+ /** Create an instance by capturing inputs */
217509
+ static create(detailA, detailB, result) {
217510
+ if (!result)
217511
+ return new PolygonLocationDetailPair(detailA, detailB);
217512
+ result.detailA = detailA;
217513
+ result.detailB = detailB;
217514
+ return result;
217515
+ }
217516
+ /** Make a deep copy of this PolygonLocationDetailPair */
217517
+ clone(result) {
217518
+ result = result ? result : new PolygonLocationDetailPair();
217519
+ result.detailA.copyContentsFrom(this.detailA);
217520
+ result.detailB.copyContentsFrom(this.detailB);
217521
+ return result;
217522
+ }
217523
+ /** Swap the details of A, B */
217524
+ swapDetails() {
217525
+ const q = this.detailA;
217526
+ this.detailA = this.detailB;
217527
+ this.detailB = q;
217528
+ }
217073
217529
  }
217074
217530
  /**
217075
217531
  * Carrier for a loop extracted from clip operation, annotated for sorting
@@ -217791,13 +218247,14 @@ class PolygonOps {
217791
218247
  return sortedLoopsArray;
217792
218248
  }
217793
218249
  /** Compute the closest point on the polygon boundary to the given point.
218250
+ * * Compare to [[closestPoint]].
217794
218251
  * @param polygon points of the polygon, closure point optional
217795
218252
  * @param testPoint point p to project onto the polygon edges. Works best when p is in the plane of the polygon.
217796
218253
  * @param tolerance optional distance tolerance to determine point-vertex and point-edge coincidence.
217797
218254
  * @param result optional pre-allocated object to fill and return
217798
218255
  * @returns details d of the closest point `d.point`:
217799
218256
  * * `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`.
218257
+ * * `d.edgeIndex` and `d.edgeParam` specify the location of the closest point.
217801
218258
  * * `d.code` classifies the closest point as a vertex (`PolygonLocation.OnPolygonVertex`) or as a point on an edge (`PolygonLocation.OnPolygonEdgeInterior`).
217802
218259
  * * `d.a` is the distance from testPoint to the closest point.
217803
218260
  * * `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 +218307,7 @@ class PolygonOps {
217850
218307
  }
217851
218308
  if (distToStart2 < minDist2) {
217852
218309
  if (polygon.dotProductIndexIndexXYAndZ(iBase, iPrev, testPoint) <= 0.0) {
217853
- // update candidate (to edge start) only if previous edge was NOOP
218310
+ // update candidate (to edge start) only if testPoint projected beyond previous edge end
217854
218311
  polygon.getPoint3dAtUncheckedPointIndex(iBase, result.point);
217855
218312
  result.a = Math.sqrt(distToStart2);
217856
218313
  polygon.crossProductIndexIndexIndex(iBase, iPrev, iNext, result.v);
@@ -217914,6 +218371,41 @@ class PolygonOps {
217914
218371
  }
217915
218372
  return result;
217916
218373
  }
218374
+ /**
218375
+ * Compute the closest point on the polygon boundary or its interior to the given point.
218376
+ * * Compare to [[closestPointOnBoundary]].
218377
+ * @param polygon points of the polygon, closure point optional
218378
+ * @param testPoint point p to project onto the polygon edges. Works best when p is in the plane of the polygon.
218379
+ * @param tolerance optional distance tolerance for distinguishing boundary versus interior closest point.
218380
+ * @param result optional pre-allocated object to fill and return
218381
+ * @returns details d of the closest point `d.point`:
218382
+ * * `d.isValid()` returns true if and only if the polygon is nontrivial.
218383
+ * * `d.edgeIndex` and `d.edgeParam` specify the location of the (nearest) boundary point.
218384
+ * * `d.code` classifies the closest point: `PolygonLocation.OnPolygonVertex`, `PolygonLocation.OnPolygonEdgeInterior`, `PolygonLocation.InsidePolygonProjectsToVertex`, or `PolygonLocation.InsidePolygonProjectsToEdgeInterior`.
218385
+ * * `d.a` is the distance from testPoint to the closest point.
218386
+ */
218387
+ static closestPoint(polygon, testPoint, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, result) {
218388
+ if (!(polygon instanceof _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_5__.IndexedXYZCollection))
218389
+ return this.closestPoint(new _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_4__.Point3dArrayCarrier(polygon), testPoint, tolerance, result);
218390
+ if (!this.unitNormal(polygon, this._normal))
218391
+ return PolygonLocationDetail.create(result); // invalid
218392
+ 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);
218393
+ const planePoint = this._workXYZ = polygonPlane.projectPointToPlane(testPoint, this._workXYZ);
218394
+ result = this.closestPointOnBoundary(polygon, planePoint, tolerance, result);
218395
+ if (result.isValid) {
218396
+ const dot = result.v.dotProduct(this._normal);
218397
+ if (dot > 0.0) { // planePoint is inside, so return it instead of the closest boundary point
218398
+ result.point.setFrom(planePoint);
218399
+ if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonVertex === result.code)
218400
+ result.code = _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.InsidePolygonProjectsToVertex;
218401
+ else if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonEdgeInterior === result.code)
218402
+ result.code = _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.InsidePolygonProjectsToEdgeInterior;
218403
+ }
218404
+ result.a = testPoint.distance(result.point);
218405
+ result.v.setZero(); // not relevant
218406
+ }
218407
+ return result;
218408
+ }
217917
218409
  /** Compute the intersection of a line (parameterized as a ray) with the plane of this polygon.
217918
218410
  * @param polygon points of the polygon, closure point optional
217919
218411
  * @param ray infinite line to intersect, as a ray
@@ -217931,7 +218423,7 @@ class PolygonOps {
217931
218423
  if (!this.unitNormal(polygon, this._normal))
217932
218424
  return PolygonLocationDetail.create(result); // invalid
217933
218425
  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);
218426
+ const intersectionPoint = this._workXYZ = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero(this._workXYZ);
217935
218427
  const rayParam = ray.intersectionWithPlane(this._workPlane, intersectionPoint);
217936
218428
  if (undefined === rayParam)
217937
218429
  return PolygonLocationDetail.create(result);
@@ -218104,15 +218596,80 @@ class PolygonOps {
218104
218596
  coords[i] *= scale; // normalized
218105
218597
  return coords;
218106
218598
  }
218599
+ /**
218600
+ * Force the polygon to be closed.
218601
+ * * If first and last points are not within tolerance, push copy of first point
218602
+ * * If first and last points are within tolerance, set last point equal to first
218603
+ * @param polygon input polygon
218604
+ * @param tolerance closure distance tolerance
218605
+ */
218606
+ static forceClosure(polygon, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
218607
+ if (polygon.length >= 2) {
218608
+ if (polygon instanceof _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__.GrowableXYZArray) {
218609
+ polygon.forceClosure(tolerance);
218610
+ }
218611
+ else if (polygon[0].distance(polygon[polygon.length - 1]) > tolerance) {
218612
+ polygon.push(polygon[0].clone());
218613
+ }
218614
+ else {
218615
+ polygon[polygon.length - 1].setFromPoint3d(polygon[0]);
218616
+ }
218617
+ }
218618
+ }
218619
+ /**
218620
+ * Return a closed polygon, cloning only if necessary.
218621
+ * * If the first and last points are not identical, call [[forceClosure]] on a clone of the polygon and return it.
218622
+ * * If the first and last points are already identical, just return the input.
218623
+ * @param polygon input polygon
218624
+ * @param tolerance closure distance tolerance
218625
+ */
218626
+ static ensureClosed(polygon, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
218627
+ if (polygon.length >= 2) {
218628
+ let forceClosure = false;
218629
+ if (polygon instanceof _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_5__.IndexedXYZCollection)
218630
+ forceClosure = !polygon.almostEqualIndexIndex(0, polygon.length - 1, 0.0);
218631
+ else
218632
+ forceClosure = !polygon[0].isExactEqual(polygon[polygon.length - 1]);
218633
+ if (forceClosure) {
218634
+ const cloned = _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__.GrowableXYZArray.create(polygon);
218635
+ this.forceClosure(cloned, tolerance);
218636
+ polygon = cloned;
218637
+ }
218638
+ }
218639
+ return polygon;
218640
+ }
218641
+ /**
218642
+ * Find smallest distance between polygons.
218643
+ * * For efficiency, input polygons should include closure edge.
218644
+ * * If searching interiors for close approaches, the polygons are assumed to be convex.
218645
+ * @param polygonA first polygon
218646
+ * @param polygonB second polygon
218647
+ * @param dMax optional largest approach distance to consider
218648
+ * @param _searchInterior If true, include (convex) polygon interiors in computations (currently unimplemented).
218649
+ * If false (default): return closest approach between polygon boundaries only, using [[PolylineOps.closestApproach]].
218650
+ * @return pair of details, one per polygon. The `a` field of each detail stores the closest approach distance.
218651
+ */
218652
+ static closestApproach(polygonA, polygonB, dMax = Number.MAX_VALUE, _searchInterior = false) {
218653
+ // TODO: handle interior close approaches as well...
218654
+ let result;
218655
+ const polyA = this.ensureClosed(polygonA);
218656
+ const polyB = this.ensureClosed(polygonB);
218657
+ const cld = this._workCLDPair = _PolylineOps__WEBPACK_IMPORTED_MODULE_13__.PolylineOps.closestApproach(polyA, false, polyB, false, dMax, this._workCLDPair);
218658
+ if (cld && cld.detailA.childDetail && cld.detailB.childDetail) {
218659
+ 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));
218660
+ result.detailA.a = result.detailB.a = cld.detailA.a;
218661
+ }
218662
+ return result;
218663
+ }
218107
218664
  }
218108
218665
  /** These values are the integrated area moment products [xx,xy,xz, x]
218109
218666
  * for a right triangle in the first quadrant at the origin -- (0,0),(1,0),(0,1)
218110
218667
  */
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);
218668
+ 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
218669
  /** 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
218670
  * for a tetrahedron in the first quadrant at the origin -- (0,00),(1,0,0),(0,1,0),(0,0,1)
218114
218671
  */
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);
218672
+ 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
218673
  // statics for shared reuse.
218117
218674
  // many methods use these.
218118
218675
  // only use them in "leaf" methods that are certain not to call other users . . .
@@ -218121,9 +218678,9 @@ PolygonOps._vector1 = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.cre
218121
218678
  PolygonOps._vector2 = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
218122
218679
  PolygonOps._vectorOrigin = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
218123
218680
  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();
218681
+ PolygonOps._matrixA = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_14__.Matrix4d.createIdentity();
218682
+ PolygonOps._matrixB = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_14__.Matrix4d.createIdentity();
218683
+ PolygonOps._matrixC = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_14__.Matrix4d.createIdentity();
218127
218684
 
218128
218685
  /**
218129
218686
  * `IndexedXYZCollectionPolygonOps` class contains _static_ methods for typical operations on polygons carried as `IndexedXYZCollection`
@@ -218358,7 +218915,7 @@ class IndexedXYZCollectionPolygonOps {
218358
218915
  if (range.isNull)
218359
218916
  return undefined;
218360
218917
  const work = new _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__.GrowableXYZArray();
218361
- const plane = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_14__.Point4d.create();
218918
+ const plane = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_15__.Point4d.create();
218362
218919
  plane.set(0, 0, -1, range.high.z);
218363
218920
  this.clipConvexPolygonInPlace(plane, xyz, work, true);
218364
218921
  if (xyz.length === 0)
@@ -218777,9 +219334,13 @@ __webpack_require__.r(__webpack_exports__);
218777
219334
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
218778
219335
  /* harmony export */ "PolylineOps": () => (/* binding */ PolylineOps)
218779
219336
  /* harmony export */ });
219337
+ /* harmony import */ var _curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../curve/CurveExtendMode */ "../../core/geometry/lib/esm/curve/CurveExtendMode.js");
219338
+ /* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
219339
+ /* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
218780
219340
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
218781
219341
  /* harmony import */ var _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
218782
219342
  /* harmony import */ var _Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Plane3dByOriginAndUnitNormal */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js");
219343
+ /* harmony import */ var _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
218783
219344
  /* harmony import */ var _Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
218784
219345
  /* harmony import */ var _PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PolylineCompressionByEdgeOffset */ "../../core/geometry/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js");
218785
219346
  /* harmony import */ var _Range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
@@ -218796,6 +219357,10 @@ __webpack_require__.r(__webpack_exports__);
218796
219357
 
218797
219358
 
218798
219359
 
219360
+
219361
+
219362
+
219363
+
218799
219364
  // cspell:word Puecker
218800
219365
  /**
218801
219366
  * PolylineOps is a collection of static methods operating on polylines.
@@ -218978,7 +219543,7 @@ class PolylineOps {
218978
219543
  }
218979
219544
  }
218980
219545
  /**
218981
- * Remove closure points a polyline or array of polylines
219546
+ * Remove closure points of a polyline or array of polylines
218982
219547
  * @param data points.
218983
219548
  */
218984
219549
  static removeClosurePoint(data) {
@@ -219049,6 +219614,74 @@ class PolylineOps {
219049
219614
  }
219050
219615
  return bisectorPlanes.length > 1 ? bisectorPlanes : undefined;
219051
219616
  }
219617
+ /**
219618
+ * Find smallest distance between polylines.
219619
+ * * For polylines with many points, it is more efficient to use [[LineString3dRangeTreeContext.searchForClosestApproach]].
219620
+ * @param pointsA first polyline
219621
+ * @param extendA how to extend polylineA forward/backward
219622
+ * @param pointsB second polyline
219623
+ * @param extendB how to extend polylineB forward/backward
219624
+ * @param dMax largest approach distance to consider
219625
+ * @param result optional pre-allocated object to populate and return
219626
+ * @returns pair of details, one for each polyline, with field values:
219627
+ * * `a` is the closest approach distance
219628
+ * * `point` is the point of closest approach
219629
+ * * `fraction` is the global polyline fraction
219630
+ * * `childDetail.a` is the segment index
219631
+ * * `childDetail.fraction` is the local segment fraction
219632
+ */
219633
+ static closestApproach(pointsA, extendA, pointsB, extendB, dMax = Number.MAX_VALUE, result) {
219634
+ if (Array.isArray(pointsA))
219635
+ pointsA = new _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_6__.Point3dArrayCarrier(pointsA);
219636
+ if (Array.isArray(pointsB))
219637
+ pointsB = new _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_6__.Point3dArrayCarrier(pointsB);
219638
+ let dMin = dMax;
219639
+ let foundMin = false;
219640
+ const numSegmentA = pointsA.length - 1;
219641
+ const numSegmentB = pointsB.length - 1;
219642
+ const extendSegA = [_curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__.CurveExtendMode.None, _curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__.CurveExtendMode.None];
219643
+ const extendSegB = [_curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__.CurveExtendMode.None, _curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__.CurveExtendMode.None];
219644
+ // lambda to set extension for first and last segment of a polyline
219645
+ const convertExtend = (extendOut, extendIn, segmentIndex, numSegments) => {
219646
+ extendOut[0] = extendOut[1] = _curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__.CurveExtendMode.None;
219647
+ if (segmentIndex === 0)
219648
+ extendOut[0] = _curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendIn, 0);
219649
+ else if (segmentIndex === numSegments - 1)
219650
+ extendOut[1] = _curve_CurveExtendMode__WEBPACK_IMPORTED_MODULE_7__.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendIn, 1);
219651
+ };
219652
+ // lambda to extract LineSegment3d from polyline
219653
+ const fillSegment = (points, index, segment) => {
219654
+ if (segment === undefined)
219655
+ return _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_8__.LineSegment3d.createCapture(points.getPoint3dAtUncheckedPointIndex(index), points.getPoint3dAtUncheckedPointIndex(index + 1));
219656
+ points.getPoint3dAtUncheckedPointIndex(index, segment.point0Ref);
219657
+ points.getPoint3dAtUncheckedPointIndex(index + 1, segment.point1Ref);
219658
+ return segment;
219659
+ };
219660
+ // just test the segments
219661
+ for (let indexA = 0; indexA < numSegmentA; indexA++) {
219662
+ this._workSegmentA = fillSegment(pointsA, indexA, this._workSegmentA);
219663
+ convertExtend(extendSegA, extendA, indexA, numSegmentA);
219664
+ for (let indexB = 0; indexB < numSegmentB; indexB++) {
219665
+ this._workSegmentB = fillSegment(pointsB, indexB, this._workSegmentB);
219666
+ convertExtend(extendSegB, extendB, indexB, numSegmentB);
219667
+ if (undefined !== (this._workLocalDetailPair = _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_8__.LineSegment3d.closestApproach(this._workSegmentA, extendSegA, this._workSegmentB, extendSegB, this._workLocalDetailPair))) {
219668
+ const d = this._workLocalDetailPair.detailA.a;
219669
+ if (d < dMin) {
219670
+ const childDetailA = result?.detailA.childDetail; // save and reuse
219671
+ const childDetailB = result?.detailB.childDetail;
219672
+ result = this._workLocalDetailPair.clone(result); // overwrite previous result
219673
+ _curve_LineString3d__WEBPACK_IMPORTED_MODULE_9__.LineString3d.convertLocalToGlobalDetail(result.detailA, indexA, numSegmentA, undefined, childDetailA);
219674
+ _curve_LineString3d__WEBPACK_IMPORTED_MODULE_9__.LineString3d.convertLocalToGlobalDetail(result.detailB, indexB, numSegmentB, undefined, childDetailB);
219675
+ if (result.detailA.childDetail && result.detailB.childDetail)
219676
+ result.detailA.childDetail.curve = result.detailB.childDetail.curve = undefined; // no CurvePrimitives survive in output
219677
+ dMin = d;
219678
+ foundMin = true;
219679
+ }
219680
+ }
219681
+ }
219682
+ }
219683
+ return foundMin ? result : undefined;
219684
+ }
219052
219685
  }
219053
219686
 
219054
219687
 
@@ -222110,7 +222743,7 @@ class Transform {
222110
222743
  * @param other Transform to compare to.
222111
222744
  */
222112
222745
  isAlmostEqual(other) {
222113
- return this.origin.isAlmostEqual(other.origin) && this.matrix.isAlmostEqual(other.matrix);
222746
+ return this === other || this.origin.isAlmostEqual(other.origin) && this.matrix.isAlmostEqual(other.matrix);
222114
222747
  }
222115
222748
  /**
222116
222749
  * Test for near equality with `other` Transform. Comparison uses the `isAlmostEqual` methods on the `origin` part
@@ -229625,8 +230258,20 @@ class SmallSystem {
229625
230258
  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
230259
  }
229627
230260
  /**
229628
- * Return true if lines (a0,a1) to (b0, b1) have closest approach (go by each other) in 3d
230261
+ * Return true if the given rays have closest approach (go by each other) in 3d
229629
230262
  * Return the fractional (not xy) coordinates as x and y parts of a Point2d.
230263
+ * @param ax x-coordinate of the origin of the first ray
230264
+ * @param ay y-coordinate of the origin of the first ray
230265
+ * @param az z-coordinate of the origin of the first ray
230266
+ * @param au x-coordinate of the direction vector of the first ray
230267
+ * @param av y-coordinate of the direction vector of the first ray
230268
+ * @param aw z-coordinate of the direction vector of the first ray
230269
+ * @param bx x-coordinate of the origin of the second ray
230270
+ * @param by y-coordinate of the origin of the second ray
230271
+ * @param bz z-coordinate of the origin of the second ray
230272
+ * @param bu x-coordinate of the direction vector of the second ray
230273
+ * @param bv y-coordinate of the direction vector of the second ray
230274
+ * @param bw z-coordinate of the direction vector of the second ray
229630
230275
  * @param result point to receive fractional coordinates of intersection. result.x is fraction on line a. result.y is fraction on line b.
229631
230276
  */
229632
230277
  static ray3dXYZUVWClosestApproachUnbounded(ax, ay, az, au, av, aw, bx, by, bz, bu, bv, bw, result) {
@@ -231598,6 +232243,7 @@ __webpack_require__.r(__webpack_exports__);
231598
232243
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
231599
232244
  /* harmony export */ "ConvexFacetLocationDetail": () => (/* binding */ ConvexFacetLocationDetail),
231600
232245
  /* harmony export */ "FacetIntersectOptions": () => (/* binding */ FacetIntersectOptions),
232246
+ /* harmony export */ "FacetLocationDetailPair": () => (/* binding */ FacetLocationDetailPair),
231601
232247
  /* harmony export */ "NonConvexFacetLocationDetail": () => (/* binding */ NonConvexFacetLocationDetail),
231602
232248
  /* harmony export */ "TriangularFacetLocationDetail": () => (/* binding */ TriangularFacetLocationDetail)
231603
232249
  /* harmony export */ });
@@ -231631,6 +232277,21 @@ class FacetIntersectOptions {
231631
232277
  this.parameterTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallFraction;
231632
232278
  }
231633
232279
  }
232280
+ /**
232281
+ * A pair of FacetLocationDetail.
232282
+ * @public
232283
+ */
232284
+ class FacetLocationDetailPair {
232285
+ /** Constructor, captures inputs */
232286
+ constructor(detailA, detailB) {
232287
+ this.detailA = detailA;
232288
+ this.detailB = detailB;
232289
+ }
232290
+ /** Create a facet detail pair, capturing inputs. */
232291
+ static create(detailA, detailB) {
232292
+ return new FacetLocationDetailPair(detailA, detailB);
232293
+ }
232294
+ }
231634
232295
  /**
231635
232296
  * Implementation of `FacetLocationDetail` for a triangular facet.
231636
232297
  * @public
@@ -231651,17 +232312,23 @@ class TriangularFacetLocationDetail {
231651
232312
  this._color = undefined;
231652
232313
  }
231653
232314
  /** Create a detail.
232315
+ * @param detail optional, copied if given
231654
232316
  * @param result optional pre-allocated object to fill and return
231655
232317
  */
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!
232318
+ static create(facetIndex = -1, detail, result) {
232319
+ if (!result)
232320
+ result = new TriangularFacetLocationDetail();
232321
+ else
232322
+ result.invalidate(false); // shallow: detail might be owned by result!
231660
232323
  result._facetIndex = facetIndex;
231661
- if (undefined !== detail)
232324
+ if (undefined !== detail && result._detail !== detail)
231662
232325
  result._detail.copyContentsFrom(detail);
231663
232326
  return result;
231664
232327
  }
232328
+ /** Create a detail, capturing inputs. */
232329
+ static createCapture(facetIndex, detail) {
232330
+ return new TriangularFacetLocationDetail(facetIndex, detail);
232331
+ }
231665
232332
  /** Get the facet index. */
231666
232333
  get facetIndex() {
231667
232334
  return this._facetIndex;
@@ -231762,7 +232429,7 @@ class TriangularFacetLocationDetail {
231762
232429
  }
231763
232430
  }
231764
232431
  /**
231765
- * Implementation of `FacetLocationDetail` for a non-convex facet.
232432
+ * Implementation of `FacetLocationDetail` for a general facet, which may or may not be convex.
231766
232433
  * * Facet vertex data interpolation is not available.
231767
232434
  * @public
231768
232435
  */
@@ -231781,18 +232448,24 @@ class NonConvexFacetLocationDetail {
231781
232448
  this._detail.invalidate();
231782
232449
  }
231783
232450
  /** Create a detail.
232451
+ * @param detail optional, copied if given
231784
232452
  * @param result optional pre-allocated object to fill and return
231785
232453
  */
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!
232454
+ static create(facetIndex = -1, edgeCount = 0, detail, result) {
232455
+ if (!result)
232456
+ result = new NonConvexFacetLocationDetail();
232457
+ else
232458
+ result.invalidate(false); // shallow: detail might be owned by result!
231790
232459
  result._facetIndex = facetIndex;
231791
232460
  result._edgeCount = edgeCount;
231792
232461
  if (undefined !== detail && result._detail !== detail)
231793
232462
  result._detail.copyContentsFrom(detail);
231794
232463
  return result;
231795
232464
  }
232465
+ /** Create a detail, capturing inputs. */
232466
+ static createCapture(facetIndex, edgeCount, detail) {
232467
+ return new NonConvexFacetLocationDetail(facetIndex, edgeCount, detail);
232468
+ }
231796
232469
  /** Get the facet index. */
231797
232470
  get facetIndex() {
231798
232471
  return this._facetIndex;
@@ -231821,7 +232494,7 @@ class NonConvexFacetLocationDetail {
231821
232494
  get isValid() {
231822
232495
  return this._isValid && this._detail.isValid;
231823
232496
  }
231824
- /** Whether the facet is convex. */
232497
+ /** Whether the facet is convex. Always returns false, as convexity is unknown to this detail. */
231825
232498
  get isConvex() {
231826
232499
  return false;
231827
232500
  }
@@ -231891,13 +232564,20 @@ class ConvexFacetLocationDetail extends NonConvexFacetLocationDetail {
231891
232564
  this._barycentricCoordinates = undefined;
231892
232565
  }
231893
232566
  /** Create a detail.
232567
+ * @param detail optional, copied if given
231894
232568
  * @param result optional pre-allocated object to fill and return
231895
232569
  */
231896
- static create(facetIndex, edgeCount, detail, result) {
231897
- if (undefined === result)
231898
- return new ConvexFacetLocationDetail(facetIndex, edgeCount, detail);
232570
+ static create(facetIndex = -1, edgeCount = 0, detail, result) {
232571
+ if (!result)
232572
+ result = new ConvexFacetLocationDetail();
232573
+ else
232574
+ result.invalidate(false); // shallow: detail might be owned by result!
231899
232575
  return super.create(facetIndex, edgeCount, detail, result);
231900
232576
  }
232577
+ /** Create a detail, capturing inputs. */
232578
+ static createCapture(facetIndex, edgeCount, detail) {
232579
+ return new ConvexFacetLocationDetail(facetIndex, edgeCount, detail);
232580
+ }
231901
232581
  /** Whether the facet is convex. */
231902
232582
  get isConvex() {
231903
232583
  return true;
@@ -236940,6 +237620,22 @@ class PolyfaceQuery {
236940
237620
  const inertiaProducts = PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source, origin);
236941
237621
  return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
236942
237622
  }
237623
+ /** Determine whether all facets are convex.
237624
+ * @param source mesh to examine
237625
+ */
237626
+ static areFacetsConvex(source) {
237627
+ if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
237628
+ return this.areFacetsConvex(source.createVisitor(0));
237629
+ source.setNumWrap(0);
237630
+ source.reset();
237631
+ while (source.moveToNextFacet()) {
237632
+ if (source.pointCount > 3) {
237633
+ if (!_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.isConvex(source.point))
237634
+ return false;
237635
+ }
237636
+ }
237637
+ return true;
237638
+ }
236943
237639
  /**
236944
237640
  * Test for convex volume by dihedral angle tests on all edges.
236945
237641
  * * This tests if all dihedral angles are positive.
@@ -237547,6 +238243,8 @@ class PolyfaceQuery {
237547
238243
  * If not a polyface, visit all facets to find the largest index.
237548
238244
  */
237549
238245
  static visitorClientPointCount(visitor) {
238246
+ if (visitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
238247
+ return visitor.data.point.length;
237550
238248
  const polyface = visitor.clientPolyface();
237551
238249
  if (polyface !== undefined)
237552
238250
  return polyface.data.point.length;
@@ -237563,6 +238261,11 @@ class PolyfaceQuery {
237563
238261
  * If not a polyface, visit all facets to accumulate a count.
237564
238262
  */
237565
238263
  static visitorClientFacetCount(visitor) {
238264
+ if (visitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
238265
+ if (visitor.facetCount !== undefined)
238266
+ return visitor.facetCount;
238267
+ visitor = visitor.createVisitor(0);
238268
+ }
237566
238269
  const polyface = visitor.clientPolyface();
237567
238270
  if (polyface !== undefined && polyface.facetCount !== undefined)
237568
238271
  return polyface.facetCount;
@@ -238338,6 +239041,1307 @@ class RangeLengthData {
238338
239041
  }
238339
239042
 
238340
239043
 
239044
+ /***/ }),
239045
+
239046
+ /***/ "../../core/geometry/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js":
239047
+ /*!**************************************************************************************!*\
239048
+ !*** ../../core/geometry/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js ***!
239049
+ \**************************************************************************************/
239050
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
239051
+
239052
+ "use strict";
239053
+ __webpack_require__.r(__webpack_exports__);
239054
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
239055
+ /* harmony export */ "LineString3dRangeTreeContext": () => (/* binding */ LineString3dRangeTreeContext)
239056
+ /* harmony export */ });
239057
+ /* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
239058
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
239059
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
239060
+ /* harmony import */ var _RangeTreeNode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RangeTreeNode */ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeNode.js");
239061
+ /* harmony import */ var _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./RangeTreeSearchHandlers */ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js");
239062
+ /*---------------------------------------------------------------------------------------------
239063
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
239064
+ * See LICENSE.md in the project root for license terms and full copyright notice.
239065
+ *--------------------------------------------------------------------------------------------*/
239066
+ /** @packageDocumentation
239067
+ * @module RangeSearch
239068
+ */
239069
+
239070
+
239071
+
239072
+
239073
+
239074
+ /**
239075
+ * Handler class for searching a range tree containing the segments of a linestring.
239076
+ * * Facilitates multiple searches for closest point and close approach calculations.
239077
+ * @public
239078
+ */
239079
+ class LineString3dRangeTreeContext {
239080
+ /** Constructor: capture inputs, initialize debug counters */
239081
+ constructor(rangeTreeRoot, points) {
239082
+ this.lineString = points;
239083
+ this._rangeTreeRoot = rangeTreeRoot;
239084
+ this.numRangeTestTrue = 0;
239085
+ this.numRangeTestFalse = 0;
239086
+ this.numPointTest = 0;
239087
+ this.numSearch = 0;
239088
+ }
239089
+ /**
239090
+ * Create a range tree context for the polyline points:
239091
+ * * initialize with segment ranges
239092
+ * * appData are segment indices
239093
+ * @param linestring captured if LineString3d, otherwise copied
239094
+ * @param maxChildPerNode maximum children per range tree node (default 4)
239095
+ * @param maxAppDataPerLeaf maximum segment indices per leaf node (default 4)
239096
+ */
239097
+ static createCapture(points, maxChildPerNode = 4, maxAppDataPerLeaf = 4) {
239098
+ const linestring = points instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_0__.LineString3d ? points : _curve_LineString3d__WEBPACK_IMPORTED_MODULE_0__.LineString3d.createPoints(points);
239099
+ 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
239100
+ maxChildPerNode, maxAppDataPerLeaf);
239101
+ return rangeTreeRoot ? new LineString3dRangeTreeContext(rangeTreeRoot, linestring) : undefined;
239102
+ }
239103
+ /**
239104
+ * Search the range tree for closest point(s) to spacePoint.
239105
+ * @param spacePoint point to test
239106
+ * @param maxDist collect points at no more than this distance from spacePoint. If undefined, return only the closest point.
239107
+ * @return closest point detail(s) with detail.a set to the distance from spacePoint to detail.point
239108
+ */
239109
+ searchForClosestPoint(spacePoint, maxDist) {
239110
+ const handler = new _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_3__.SingleTreeSearchHandlerForClosestPointOnLineString3d(spacePoint, this, maxDist);
239111
+ this.numSearch++;
239112
+ // seed the search with a few segments -- this reduces early trips deep into ranges that are far from spacePoint.
239113
+ const numTest = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.clamp(Math.floor(this.lineString.numPoints() / 20), 2, 7);
239114
+ const testStep = Math.floor(this.lineString.numPoints() / numTest);
239115
+ handler.processAppData(0);
239116
+ handler.processAppData(this.lineString.numPoints() - 2);
239117
+ for (let i = testStep; i + 1 < this.lineString.numPoints(); i += testStep)
239118
+ handler.processAppData(i);
239119
+ this._rangeTreeRoot.searchTopDown(handler);
239120
+ return handler.searchState.savedItems.length <= 1 ? handler.getResult() : handler.getSavedItems();
239121
+ }
239122
+ /**
239123
+ * Search the range trees for closest approach(es) between the polylines.
239124
+ * @param contextA first polyline context
239125
+ * @param contextB second polyline context
239126
+ * @param maxDist collect close approaches separated by no more than this distance. If undefined, return only the closest approach.
239127
+ * @return closest approach detail pair(s), one per context, with detail.a set to the approach distance
239128
+ */
239129
+ static searchForClosestApproach(contextA, contextB, maxDist) {
239130
+ const handler = new _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_3__.TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach(contextA, contextB, maxDist);
239131
+ _RangeTreeNode__WEBPACK_IMPORTED_MODULE_1__.RangeTreeNode.searchTwoTreesTopDown(contextA._rangeTreeRoot, contextB._rangeTreeRoot, handler);
239132
+ return handler.searchState.savedItems.length <= 1 ? handler.getResult() : handler.getSavedItems();
239133
+ }
239134
+ }
239135
+
239136
+
239137
+ /***/ }),
239138
+
239139
+ /***/ "../../core/geometry/lib/esm/polyface/RangeTree/MinimumValueTester.js":
239140
+ /*!****************************************************************************!*\
239141
+ !*** ../../core/geometry/lib/esm/polyface/RangeTree/MinimumValueTester.js ***!
239142
+ \****************************************************************************/
239143
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
239144
+
239145
+ "use strict";
239146
+ __webpack_require__.r(__webpack_exports__);
239147
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
239148
+ /* harmony export */ "MinimumValueTester": () => (/* binding */ MinimumValueTester)
239149
+ /* harmony export */ });
239150
+ /*---------------------------------------------------------------------------------------------
239151
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
239152
+ * See LICENSE.md in the project root for license terms and full copyright notice.
239153
+ *--------------------------------------------------------------------------------------------*/
239154
+ /** @packageDocumentation
239155
+ * @module CartesianGeometry
239156
+ */
239157
+ /**
239158
+ * Data carrier for use when repeatedly testing items (of parameterized type T) to determine the one with a minimum associated value.
239159
+ * * Optionally pushes to arrays of items and values when the value does not exceed a given trigger.
239160
+ * * * The item at minimum value is still recorded, even if the minimum value exceeds the trigger value.
239161
+ * * When comparing a potential minimum value to an undefined value, the number is always accepted as the new minimum.
239162
+ * @internal
239163
+ */
239164
+ class MinimumValueTester {
239165
+ /**
239166
+ * Capture the given item with undefined item and value, and optional maxValueForSavingToArray.
239167
+ */
239168
+ constructor(maxValueForSavingToArray) {
239169
+ this.savedItems = [];
239170
+ this.savedValues = [];
239171
+ this.resetMinValueAndItem(undefined, undefined);
239172
+ this.resetTriggerValueForSavingToArray(maxValueForSavingToArray, false);
239173
+ }
239174
+ /**
239175
+ * Static method to create a tester.
239176
+ * @param maxValueForSavingToArray optional numeric value limiting items to save to the optional array.
239177
+ * @returns new tester.
239178
+ */
239179
+ static create(maxValueForSavingToArray) {
239180
+ return new MinimumValueTester(maxValueForSavingToArray);
239181
+ }
239182
+ /**
239183
+ * Install new minimum value and associated item, both possibly undefined.
239184
+ * * The existing arrays of saved items and values, and the trigger value, are unaffected.
239185
+ * @param item object to associate with the new minimum value
239186
+ * @param value new minimum value
239187
+ */
239188
+ resetMinValueAndItem(item = undefined, value = undefined) {
239189
+ this.itemAtMinValue = item;
239190
+ this.minValue = value;
239191
+ }
239192
+ /**
239193
+ * Set the trigger value.
239194
+ * @param value new trigger value
239195
+ * @param reinitializeArrays whether to clear the arrays of saved items and values
239196
+ */
239197
+ resetTriggerValueForSavingToArray(value, reinitializeArrays = false) {
239198
+ this.triggerForSavingToArray = value;
239199
+ if (reinitializeArrays) {
239200
+ this.savedItems = [];
239201
+ this.savedValues = [];
239202
+ }
239203
+ }
239204
+ /**
239205
+ * Test a new item with value.
239206
+ * * Push the new item and value to the saved arrays if both:
239207
+ * * `this.triggerForSavingToArray` is defined
239208
+ * * the new value is less than or equal to `this.triggerForSavingToArray`.
239209
+ * * Save the new item and value if either:
239210
+ * * `this.minValue` is undefined
239211
+ * * new value is less than `this.minValue`.
239212
+ * @param item item to be saved (captured!) if value conditions are met
239213
+ * @param value numeric value being minimized.
239214
+ * @returns true if and only if the input value is the new minimum value.
239215
+ */
239216
+ testAndSave(item, value) {
239217
+ if (this.doesValueTrigger(value)) {
239218
+ this.savedValues.push(value);
239219
+ this.savedItems.push(item);
239220
+ }
239221
+ if (this.isNewMinValue(value)) {
239222
+ this.minValue = value;
239223
+ this.itemAtMinValue = item;
239224
+ return true;
239225
+ }
239226
+ return false;
239227
+ }
239228
+ /** Whether the input value is small enough to be saved to this instance. */
239229
+ doesValueTrigger(value) {
239230
+ return this.triggerForSavingToArray !== undefined && value <= this.triggerForSavingToArray;
239231
+ }
239232
+ /** Whether the input value is smaller than the last recorded minimum value. */
239233
+ isNewMinValue(value) {
239234
+ return this.minValue === undefined || value < this.minValue;
239235
+ }
239236
+ /** Whether the input value is small enough to be the new minimum or to be saved to this instance. */
239237
+ isNewMinOrTrigger(value) {
239238
+ return this.isNewMinValue(value) || this.doesValueTrigger(value);
239239
+ }
239240
+ }
239241
+
239242
+
239243
+ /***/ }),
239244
+
239245
+ /***/ "../../core/geometry/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js":
239246
+ /*!**************************************************************************************!*\
239247
+ !*** ../../core/geometry/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js ***!
239248
+ \**************************************************************************************/
239249
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
239250
+
239251
+ "use strict";
239252
+ __webpack_require__.r(__webpack_exports__);
239253
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
239254
+ /* harmony export */ "Point3dArrayRangeTreeContext": () => (/* binding */ Point3dArrayRangeTreeContext)
239255
+ /* harmony export */ });
239256
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
239257
+ /* harmony import */ var _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RangeTreeNode */ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeNode.js");
239258
+ /* harmony import */ var _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RangeTreeSearchHandlers */ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js");
239259
+ /*---------------------------------------------------------------------------------------------
239260
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
239261
+ * See LICENSE.md in the project root for license terms and full copyright notice.
239262
+ *--------------------------------------------------------------------------------------------*/
239263
+ /** @packageDocumentation
239264
+ * @module RangeSearch
239265
+ */
239266
+
239267
+
239268
+
239269
+ /**
239270
+ * Handler class for searching a range tree containing unordered Point3d data.
239271
+ * * Facilitates multiple searches for closest point and close approach calculations.
239272
+ * @public
239273
+ */
239274
+ class Point3dArrayRangeTreeContext {
239275
+ /** Constructor: capture inputs, initialize debug counters */
239276
+ constructor(rangeTreeRoot, points) {
239277
+ this.points = points;
239278
+ this._rangeTreeRoot = rangeTreeRoot;
239279
+ this.numRangeTestTrue = 0;
239280
+ this.numRangeTestFalse = 0;
239281
+ this.numPointTest = 0;
239282
+ this.numSearch = 0;
239283
+ }
239284
+ /**
239285
+ * Create a range tree context with given points:
239286
+ * * initialize with single-point ranges
239287
+ * * appData are point indices
239288
+ * @param points captured
239289
+ * @param maxChildPerNode maximum children per range tree node (default 4)
239290
+ * @param maxAppDataPerLeaf maximum point indices per leaf node (default 4)
239291
+ */
239292
+ static createCapture(points, maxChildPerNode = 4, maxAppDataPerLeaf = 4) {
239293
+ 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);
239294
+ return rangeTreeRoot ? new Point3dArrayRangeTreeContext(rangeTreeRoot, points) : undefined;
239295
+ }
239296
+ /**
239297
+ * Search the range tree for closest point(s) to spacePoint.
239298
+ * @param spacePoint point to test
239299
+ * @param maxDist collect points at no more than this distance from spacePoint. If undefined, return only the closest point.
239300
+ * @return closest point detail(s) with following fields set:
239301
+ * * detail.point = the closest point
239302
+ * * detail.fraction = the index of the closest point in the points array
239303
+ * * detail.a = distance from spacePoint to closest point
239304
+ */
239305
+ searchForClosestPoint(spacePoint, maxDist) {
239306
+ const handler = new _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_2__.SingleTreeSearchHandlerForClosestPointInArray(spacePoint, this, maxDist);
239307
+ this.numSearch++;
239308
+ this._rangeTreeRoot.searchTopDown(handler);
239309
+ return handler.searchState.savedItems.length <= 1 ? handler.getResult() : handler.getSavedItems();
239310
+ }
239311
+ /**
239312
+ * Search the range trees for closest approach(es) between the point arrays.
239313
+ * @param contextA first point array context
239314
+ * @param contextB second point array context
239315
+ * @param maxDist collect close approaches separated by no more than this distance. If undefined, return only the closest approach.
239316
+ * @return closest approach detail pair(s), one per context, each with the following fields set:
239317
+ * * detail.point = the point at closest approach
239318
+ * * detail.fraction = the index of detail.point in the points array
239319
+ * * detail.a = the closest approach distance
239320
+ */
239321
+ static searchForClosestApproach(contextA, contextB, maxDist) {
239322
+ const handler = new _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_2__.TwoTreeSearchHandlerForPoint3dArrayPoint3dArrayCloseApproach(contextA, contextB, maxDist);
239323
+ _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__.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/PolyfaceRangeTreeContext.js":
239332
+ /*!**********************************************************************************!*\
239333
+ !*** ../../core/geometry/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.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 */ "PolyfaceRangeTreeContext": () => (/* binding */ PolyfaceRangeTreeContext)
239341
+ /* harmony export */ });
239342
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
239343
+ /* harmony import */ var _Polyface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
239344
+ /* harmony import */ var _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
239345
+ /* harmony import */ var _RangeTreeNode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RangeTreeNode */ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeNode.js");
239346
+ /* harmony import */ var _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./RangeTreeSearchHandlers */ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js");
239347
+ /*---------------------------------------------------------------------------------------------
239348
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
239349
+ * See LICENSE.md in the project root for license terms and full copyright notice.
239350
+ *--------------------------------------------------------------------------------------------*/
239351
+ /** @packageDocumentation
239352
+ * @module RangeSearch
239353
+ */
239354
+
239355
+
239356
+
239357
+
239358
+
239359
+ /**
239360
+ * Handler class for searching a range tree containing the facets of a polyface.
239361
+ * * Facilitates multiple searches for closest point and close approach calculations.
239362
+ * @public
239363
+ */
239364
+ class PolyfaceRangeTreeContext {
239365
+ /** Constructor: capture inputs, initialize debug counters */
239366
+ constructor(rangeTreeRoot, visitor, convexFacets = false) {
239367
+ this.visitor = visitor;
239368
+ this.convexFacets = convexFacets;
239369
+ this._rangeTreeRoot = rangeTreeRoot;
239370
+ this.numRangeTestTrue = 0;
239371
+ this.numRangeTestFalse = 0;
239372
+ this.numFacetTest = 0;
239373
+ this.numSearch = 0;
239374
+ }
239375
+ /**
239376
+ * Create a range tree context for the Polyface facets.
239377
+ * * This is a very simple construction that splits "right and left parts" of the facet sequence.
239378
+ * * Facets with any recognizable "left to right" or "top to bottom" sequencing will have very effective search structures.
239379
+ * @param visitor access to facets, captured if PolyfaceVisitor
239380
+ * @param maxChildPerNode maximum children per range tree node (default 4)
239381
+ * @param maxAppDataPerLeaf maximum facet indices per leaf node (default 4)
239382
+ * @param convexFacets whether all facets are known to be convex (cf. [[PolyfaceQuery.areFacetsConvex]]) (default false)
239383
+ */
239384
+ static createCapture(visitor, maxChildPerNode = 4, maxAppDataPerLeaf = 4, convexFacets = false) {
239385
+ if (visitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_0__.Polyface)
239386
+ return this.createCapture(visitor.createVisitor(0), maxChildPerNode, maxAppDataPerLeaf, convexFacets);
239387
+ const numFacet = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_1__.PolyfaceQuery.visitorClientFacetCount(visitor);
239388
+ const rangeTreeRoot = _RangeTreeNode__WEBPACK_IMPORTED_MODULE_2__.RangeTreeOps.createByIndexSplits((index) => { visitor.moveToReadIndex(index); return visitor.range(); }, (index) => { return index; }, numFacet, maxChildPerNode, maxAppDataPerLeaf);
239389
+ return rangeTreeRoot ? new PolyfaceRangeTreeContext(rangeTreeRoot, visitor, convexFacets) : undefined;
239390
+ }
239391
+ /**
239392
+ * Search the range tree for closest facet(s) to spacePoint.
239393
+ * @param spacePoint point to test
239394
+ * @param maxDist collect points at no more than this distance from spacePoint. If undefined, return only the closest point.
239395
+ * @param searchFacetInterior whether to include facet interiors in search. Default is false: just consider facet boundaries.
239396
+ * @return closest point detail(s) with detail.a set to the distance from spacePoint to detail.point
239397
+ */
239398
+ searchForClosestPoint(spacePoint, maxDist, searchFacetInterior = false) {
239399
+ const handler = new _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_3__.SingleTreeSearchHandlerForClosestPointOnPolyface(spacePoint, this, maxDist, searchFacetInterior);
239400
+ this.numSearch++;
239401
+ const numFacet = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_1__.PolyfaceQuery.visitorClientFacetCount(this.visitor);
239402
+ // seed the search with a few points -- this reduces early trips deep into early ranges that are far from spacePoint.
239403
+ const numTest = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.clamp(Math.floor(numFacet / 20), 2, 7);
239404
+ const testStep = Math.floor(numFacet / numTest);
239405
+ handler.processAppData(0);
239406
+ handler.processAppData(numFacet - 1);
239407
+ for (let i = testStep; i + 1 < numFacet; i += testStep)
239408
+ handler.processAppData(i);
239409
+ this._rangeTreeRoot.searchTopDown(handler);
239410
+ return handler.searchState.savedItems.length <= 1 ? handler.getResult() : handler.getSavedItems();
239411
+ }
239412
+ /**
239413
+ * Search the range trees for closest approach(es) between the polyfaces.
239414
+ * @param contextA first polyface context
239415
+ * @param contextB second polyface context
239416
+ * @param maxDist collect close approaches separated by no more than this distance. If undefined, return only the closest approach.
239417
+ * @param searchFacetInterior whether to include facet interiors in search (`context.convexFacets` must be true for both contexts). Default is false: just consider facet boundaries.
239418
+ * @return closest approach detail pair(s), one per context, with detail.a set to the approach distance
239419
+ */
239420
+ static searchForClosestApproach(contextA, contextB, maxDist, searchFacetInterior = false) {
239421
+ const handler = new _RangeTreeSearchHandlers__WEBPACK_IMPORTED_MODULE_3__.TwoTreeSearchHandlerForFacetFacetCloseApproach(contextA, contextB, maxDist, searchFacetInterior);
239422
+ _RangeTreeNode__WEBPACK_IMPORTED_MODULE_2__.RangeTreeNode.searchTwoTreesTopDown(contextA._rangeTreeRoot, contextB._rangeTreeRoot, handler);
239423
+ return handler.searchState.savedItems.length <= 1 ? handler.getResult() : handler.getSavedItems();
239424
+ }
239425
+ }
239426
+
239427
+
239428
+ /***/ }),
239429
+
239430
+ /***/ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeNode.js":
239431
+ /*!***********************************************************************!*\
239432
+ !*** ../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeNode.js ***!
239433
+ \***********************************************************************/
239434
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
239435
+
239436
+ "use strict";
239437
+ __webpack_require__.r(__webpack_exports__);
239438
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
239439
+ /* harmony export */ "RangeTreeNode": () => (/* binding */ RangeTreeNode),
239440
+ /* harmony export */ "RangeTreeOps": () => (/* binding */ RangeTreeOps),
239441
+ /* harmony export */ "SingleTreeSearchHandler": () => (/* binding */ SingleTreeSearchHandler),
239442
+ /* harmony export */ "TwoTreeDistanceMinimizationSearchHandler": () => (/* binding */ TwoTreeDistanceMinimizationSearchHandler),
239443
+ /* harmony export */ "TwoTreeSearchHandler": () => (/* binding */ TwoTreeSearchHandler)
239444
+ /* harmony export */ });
239445
+ /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
239446
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
239447
+ /*---------------------------------------------------------------------------------------------
239448
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
239449
+ * See LICENSE.md in the project root for license terms and full copyright notice.
239450
+ *--------------------------------------------------------------------------------------------*/
239451
+ /** @packageDocumentation
239452
+ * @module RangeSearch
239453
+ */
239454
+
239455
+
239456
+ /**
239457
+ * Map an (unchecked) integer to a parameterized type T, where the data argument can be either:
239458
+ * * an array of type T
239459
+ * * a function which takes an index and returns type T
239460
+ * @internal
239461
+ */
239462
+ function evaluateIndexToType(data, index) {
239463
+ if (Array.isArray(data))
239464
+ return data[index];
239465
+ return data(index);
239466
+ }
239467
+ /**
239468
+ * 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.
239469
+ * @internal
239470
+ */
239471
+ function getByIndex(index, data) {
239472
+ if (data !== undefined) {
239473
+ if (Array.isArray(data)) {
239474
+ if (index < data.length)
239475
+ return data[index];
239476
+ }
239477
+ else {
239478
+ return data;
239479
+ }
239480
+ }
239481
+ return undefined;
239482
+ }
239483
+ /**
239484
+ * 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.
239485
+ * @internal
239486
+ */
239487
+ function getFlexDataCount(data) {
239488
+ if (data !== undefined) {
239489
+ if (Array.isArray(data)) {
239490
+ return data.length;
239491
+ }
239492
+ else {
239493
+ return 1;
239494
+ }
239495
+ }
239496
+ return 0;
239497
+ }
239498
+ /**
239499
+ * Abstract class for handler objects called during traversal of a single range tree.
239500
+ * @internal
239501
+ */
239502
+ class SingleTreeSearchHandler {
239503
+ /**
239504
+ * Query to see if the active search has been aborted.
239505
+ * * Default implementation returns false so query runs to completion.
239506
+ * * Search processes check this after range tests and child processing.
239507
+ */
239508
+ // eslint-disable-next-line @itwin/prefer-get
239509
+ isAborted() { return false; }
239510
+ }
239511
+ /**
239512
+ * Abstract class for handler objects called during traversal of two range trees.
239513
+ * @internal
239514
+ */
239515
+ class TwoTreeSearchHandler {
239516
+ /**
239517
+ * Query to see if the active search has been aborted.
239518
+ * * Default implementation returns false so query runs to completion.
239519
+ * * Search processes check this after range tests and child processing.
239520
+ */
239521
+ // eslint-disable-next-line @itwin/prefer-get
239522
+ isAborted() { return false; }
239523
+ }
239524
+ /**
239525
+ * This class refines the TwoTreeSearchHandler with an implementation of `isRangePairActive` appropriate for computing the minimum distance between trees.
239526
+ * * The concrete class must implement `getCurrentDistance()` method to provide the best-so-far distance.
239527
+ * * The implementation of `isRangePairActive` returns true if the distance between ranges is less than or equal to the `getCurrentDistance()` value.
239528
+ * @internal
239529
+ */
239530
+ class TwoTreeDistanceMinimizationSearchHandler extends TwoTreeSearchHandler {
239531
+ /**
239532
+ * Method called to decide whether to process subtrees and immediate child appData items from a left tree node and right tree node.
239533
+ * @param leftRange range from a node in the left tree
239534
+ * @param rightRange range from a node in the right tree.
239535
+ * @returns true if the smallest distance from leftRange to rightRange is less than or equal to getCurrentDistance()
239536
+ */
239537
+ isRangePairActive(leftRange, rightRange) {
239538
+ const currentDistance = this.getCurrentDistance();
239539
+ const distanceBetweenRanges = leftRange.distanceToRange(rightRange);
239540
+ if (distanceBetweenRanges <= currentDistance) {
239541
+ return true;
239542
+ }
239543
+ return false;
239544
+ }
239545
+ }
239546
+ let numNodeCreated = 0;
239547
+ /**
239548
+ * * TREE STRUCTURE
239549
+ * * A RangeTreeNode is part of a range tree.
239550
+ * * TREE is used here in a strictly _structural_ sense, which has no broad promises about data members.
239551
+ * * Each RangeNode points to 0, 1 or many children.
239552
+ * * Each child has (but does not point back to) a single parent.
239553
+ * * The overall tree has a single root.
239554
+ * * Each node is effectively the root of the tree of its children.
239555
+ * * NON-TREE DATA MEMBERS
239556
+ * * Data members in each node (in addition to children) are
239557
+ * * _range = the union of ranges below in the heap
239558
+ * * _appData = application data associated with the node.
239559
+ * * Construction methods may place multiple _appData items in each node.
239560
+ * * In common use, only the leaves will have _appData. However, the class definitions allow _appData at all nodes, and search algorithms must include them.
239561
+ * * CONSTRUCTION
239562
+ * * The RangeTreeNode.createByIndexSplits method constructs the tree with simple right-left splits within an array of input items.
239563
+ * * The appData is placed entirely in the leaves.
239564
+ * * caller can specify:
239565
+ * * the number of _appData items per leaf
239566
+ * * the number of children per node within the tree.
239567
+ * * "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)
239568
+ * * faster search because lower nodes have smaller ranges that will be skipped by search algorithms.
239569
+ * * larger memory use because of more nodes
239570
+ * * For future construction methods:
239571
+ * * _appData "above the leaves" may allow nodes below to have smaller ranges, but add complexity to search.
239572
+ * @internal
239573
+ */
239574
+ class RangeTreeNode {
239575
+ /**
239576
+ * CONSTRUCTOR
239577
+ * CAPTURE (not copy)
239578
+ * * range = range for search algorithms
239579
+ * * appData = application data relevant to this node.
239580
+ * * children = child node reference(s).
239581
+ */
239582
+ constructor(range, appData, children) {
239583
+ this._range = range;
239584
+ this._appData = appData;
239585
+ this._children = children;
239586
+ this._id = numNodeCreated++;
239587
+ // const childIds: number[] = [];
239588
+ // if (Array.isArray(this._children))
239589
+ // for (const c of this._children) childIds.push(c._id);
239590
+ // else if (this._children instanceof RangeTreeNode)
239591
+ // childIds.push(this._children._id);
239592
+ // const numAppData = getFlexDataCount(appData);
239593
+ // console.log({ id: this._id, childIds, numAppData });
239594
+ }
239595
+ /** Simplest public create: capture the range, appData, and children. */
239596
+ static createCapture(range, appData, children) {
239597
+ return new RangeTreeNode(range, appData, children);
239598
+ }
239599
+ /** copy (not capture) from given data into the range in this RangeEntry */
239600
+ setRange(data) {
239601
+ this._range.setFrom(data);
239602
+ }
239603
+ /** return (a copy of) the range in this RangeEntry */
239604
+ getRange(data) {
239605
+ return this._range.clone(data);
239606
+ }
239607
+ /** return (a reference to) the range in this RangeEntry */
239608
+ getRangeRef() {
239609
+ return this._range;
239610
+ }
239611
+ /**
239612
+ * Access a child by index.
239613
+ * * If the child data is an array, this dereferences the array.
239614
+ * * If the child data is a singleton, treat it as index 0.
239615
+ * * return undefined if there are no children.
239616
+ * @param index index of item to access.
239617
+ */
239618
+ getChildByIndex(index) {
239619
+ return getByIndex(index, this._children);
239620
+ }
239621
+ /**
239622
+ * * Access an appData by index.
239623
+ * * If the appData data is an array, this dereferences the array.
239624
+ * * If the appData data is a singleton, treat it as if it is at index 0 in an array
239625
+ * * return undefined if there are no appData or for any index out of range.
239626
+ * @param index index of item to access.
239627
+ */
239628
+ getAppDataByIndex(index) {
239629
+ return getByIndex(index, this._appData);
239630
+ }
239631
+ /** Access the children or child (does not clone). */
239632
+ getAllChildren() {
239633
+ return this._children;
239634
+ }
239635
+ /** Access the appData array or singleton (does not clone). */
239636
+ getAllAppData() {
239637
+ return this._appData;
239638
+ }
239639
+ /**
239640
+ * Count the direct children in this node of the tree.
239641
+ * * This is not recursive. For a recursive count, use `RangeTreeOps.getRecursiveNodeCount`.
239642
+ */
239643
+ getNumChildren() {
239644
+ return getFlexDataCount(this._children);
239645
+ }
239646
+ /**
239647
+ * Count the appData items in this node of the tree.
239648
+ * * This is not recursive. For a recursive count, use `RangeTreeOps.getRecursiveAppDataCount`.
239649
+ */
239650
+ getNumAppData() {
239651
+ return getFlexDataCount(this._appData);
239652
+ }
239653
+ /**
239654
+ * Depth-first tree iteration, calling `announceNode` on each node.
239655
+ * @param announceNode callback that returns true to recurse into children
239656
+ */
239657
+ recurseIntoTree(announceNode) {
239658
+ const doChildren = announceNode(this);
239659
+ if (doChildren) {
239660
+ if (Array.isArray(this._children)) {
239661
+ for (const child of this._children)
239662
+ child.recurseIntoTree(announceNode);
239663
+ }
239664
+ else if (this._children !== undefined) {
239665
+ this._children.recurseIntoTree(announceNode);
239666
+ }
239667
+ }
239668
+ }
239669
+ /**
239670
+ * Depth-first tree iteration via handler.
239671
+ * * if handler decides the instance range is active, process appData, then recurse on children
239672
+ * * if handler decides to abort after processing an appData, skip processing rest of appData and children
239673
+ */
239674
+ searchTopDown(handler) {
239675
+ if (handler.isRangeActive(this._range)) {
239676
+ let itemToProcess;
239677
+ for (let i = 0; undefined !== (itemToProcess = this.getAppDataByIndex(i)); i++) {
239678
+ // console.log(itemToProcess);
239679
+ handler.processAppData(itemToProcess);
239680
+ if (handler.isAborted())
239681
+ return;
239682
+ }
239683
+ let child;
239684
+ for (let i = 0; undefined !== (child = this.getChildByIndex(i)); i++) {
239685
+ child.searchTopDown(handler);
239686
+ }
239687
+ }
239688
+ }
239689
+ /**
239690
+ * Apply the handler.processAppDataPair method to each pair of appData items from leftAppData and rightStack.
239691
+ * @param leftAppData singleton or array with data "from left"
239692
+ * @param rightStack stack of nodes to process from right path.
239693
+ * @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.
239694
+ * @param handler search handler
239695
+ */
239696
+ static processAppDataAndAppDataStack(leftAppData, rightStack, reverseArgs, handler) {
239697
+ if (leftAppData !== undefined) {
239698
+ let leftItem;
239699
+ let rightItem;
239700
+ // hmm.. we ASSUME that if the tip ranges passed, then all parent ranges would pass without further test.
239701
+ for (let rangeIndex = rightStack.length; rangeIndex-- > 0;) {
239702
+ const rightAppData = rightStack[rangeIndex]._appData;
239703
+ for (let rightIndex = 0; undefined !== (rightItem = getByIndex(rightIndex, rightAppData)); rightIndex++) {
239704
+ for (let leftIndex = 0; undefined !== (leftItem = getByIndex(leftIndex, leftAppData)); leftIndex++) {
239705
+ if (!reverseArgs)
239706
+ handler.processAppDataPair(leftItem, rightItem);
239707
+ else
239708
+ handler.processAppDataPair(rightItem, leftItem);
239709
+ if (handler.isAborted())
239710
+ return;
239711
+ }
239712
+ }
239713
+ }
239714
+ }
239715
+ }
239716
+ /**
239717
+ * Apply the handler.processAppDataPair method to each pair of appData items from leftAppData and rightAppData.
239718
+ * @param leftAppData singleton or array with data "from left"
239719
+ * @param rightAppData singleton or array with data "from right"
239720
+ * @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.
239721
+ * @param handler search handler
239722
+ */
239723
+ static processAppDataAndAppData(leftAppData, rightAppData, reverseArgs, handler) {
239724
+ if (leftAppData !== undefined && rightAppData !== undefined) {
239725
+ let leftItem;
239726
+ let rightItem;
239727
+ for (let rightIndex = 0; undefined !== (rightItem = getByIndex(rightIndex, rightAppData)); rightIndex++) {
239728
+ for (let leftIndex = 0; undefined !== (leftItem = getByIndex(leftIndex, leftAppData)); leftIndex++) {
239729
+ if (!reverseArgs)
239730
+ handler.processAppDataPair(leftItem, rightItem);
239731
+ else
239732
+ handler.processAppDataPair(rightItem, leftItem);
239733
+ if (handler.isAborted())
239734
+ return;
239735
+ }
239736
+ }
239737
+ }
239738
+ }
239739
+ /**
239740
+ * Push the tip node to stack(s).
239741
+ * @param tip new node (to be pushed)
239742
+ * @param fullPath complete path, which is always extended
239743
+ * @param partialPath partial path, which is only extended if the tip has _appData.
239744
+ */
239745
+ static pushPaths(tip, fullPath, partialPath) {
239746
+ fullPath.push(tip);
239747
+ if (tip._appData !== undefined) {
239748
+ partialPath.push(tip);
239749
+ }
239750
+ }
239751
+ /**
239752
+ * Pop the tip node from stack(s).
239753
+ * @param tip should match the fullPath tip.
239754
+ * @param fullPath complete path, which is always popped
239755
+ * @param partialPath partial path, which is only popped if the tip has _appData.
239756
+ */
239757
+ static popPaths(tip, fullPath, partialPath) {
239758
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(fullPath[fullPath.length - 1] === tip);
239759
+ fullPath.pop();
239760
+ if (tip._appData !== undefined) {
239761
+ partialPath.pop();
239762
+ }
239763
+ }
239764
+ /**
239765
+ * Process nodes from left and right trees of dual search.
239766
+ * * The separate stacks for nodes that have appData is for efficiency.
239767
+ * * 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.
239768
+ * @param leftTip tip node being explored on left
239769
+ * @param leftStack stack of prior left nodes
239770
+ * @param leftStackWithAppData stack of prior left nodes which have appData.
239771
+ * @param rightTip tip node being explored on right.
239772
+ * @param rightStack stack of prior right nodes.
239773
+ * @param rightStackWithAppData stack of prior right nodes which have appData.
239774
+ * @param handler search handler
239775
+ */
239776
+ static recursivePairSearch(leftTip, leftStack, leftStackWithAppData, rightTip, rightStack, rightStackWithAppData, handler) {
239777
+ // console.log({ leftId: leftTip._id, rightId: rightTip._id });
239778
+ const leftTipHasAppData = leftTip._appData !== undefined;
239779
+ const rightTipHasAppData = rightTip._appData !== undefined;
239780
+ let leftChild;
239781
+ let rightChild;
239782
+ // process immediate appData from each tip node with the entire prior path of the other side (each stack currently lacks the tip).
239783
+ if (leftTipHasAppData && rightStackWithAppData.length > 0) {
239784
+ this.processAppDataAndAppDataStack(leftTip._appData, rightStackWithAppData, false, handler);
239785
+ }
239786
+ if (leftStackWithAppData.length > 0 && rightTipHasAppData) {
239787
+ this.processAppDataAndAppDataStack(rightTip._appData, leftStackWithAppData, true, handler);
239788
+ }
239789
+ if (handler.isRangePairActive(leftTip._range, rightTip._range)) {
239790
+ this.processAppDataAndAppData(leftTip._appData, rightTip._appData, false, handler);
239791
+ if (leftTip._children !== undefined && rightTip._children !== undefined) {
239792
+ this.pushPaths(leftTip, leftStack, leftStackWithAppData);
239793
+ this.pushPaths(rightTip, rightStack, rightStackWithAppData);
239794
+ for (let leftIndex = 0; undefined !== (leftChild = getByIndex(leftIndex, leftTip._children)); leftIndex++) {
239795
+ for (let rightIndex = 0; undefined !== (rightChild = getByIndex(rightIndex, rightTip._children)); rightIndex++) {
239796
+ this.recursivePairSearch(leftChild, leftStack, leftStackWithAppData, rightChild, rightStack, rightStackWithAppData, handler);
239797
+ }
239798
+ }
239799
+ this.popPaths(leftTip, leftStack, leftStackWithAppData);
239800
+ this.popPaths(rightTip, rightStack, rightStackWithAppData);
239801
+ }
239802
+ else if (leftTip._children !== undefined) {
239803
+ this.leftRecursivePairSearch(leftTip, rightTip, rightStackWithAppData, false, handler);
239804
+ }
239805
+ else if (rightTip._children !== undefined) {
239806
+ this.leftRecursivePairSearch(rightTip, leftTip, leftStackWithAppData, true, handler);
239807
+ }
239808
+ }
239809
+ }
239810
+ /**
239811
+ * Recurse below the tip of leftTip, offering each level's appData to the appData of rightTip and rightStackWithAppData.
239812
+ * @param leftTip tip node being explored on left. Its appData is not processed.
239813
+ * @param rightTip tip node being explored on right. It has no children.
239814
+ * @param rightStackWithAppData stack of prior right nodes which have appData.
239815
+ * @param reverseArgs true if the caller is exchanging the sense of left and right
239816
+ * @param handler search handler
239817
+ */
239818
+ static leftRecursivePairSearch(leftTip, rightTip, rightStackWithAppData, reverseArgs, handler) {
239819
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(rightTip._children === undefined);
239820
+ // The (possibly deep) left children appData needs to be offered to the right path (including tip)
239821
+ // 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.
239822
+ let leftChild;
239823
+ for (let leftIndex = 0; undefined !== (leftChild = getByIndex(leftIndex, leftTip._children)); leftIndex++) {
239824
+ if (handler.isRangePairActive(leftChild._range, rightTip._range)) {
239825
+ this.processAppDataAndAppData(leftChild._appData, rightTip._appData, reverseArgs, handler);
239826
+ this.processAppDataAndAppDataStack(leftChild._appData, rightStackWithAppData, reverseArgs, handler);
239827
+ this.leftRecursivePairSearch(leftChild, rightTip, rightStackWithAppData, reverseArgs, handler);
239828
+ }
239829
+ }
239830
+ }
239831
+ /**
239832
+ * Recursive search down two trees, with range tests and child processing under control of a handler.
239833
+ * @param leftRoot root of left tree
239834
+ * @param rightRoot root of right tree
239835
+ * @param handler handler for range tests and child process
239836
+ */
239837
+ static searchTwoTreesTopDown(leftRoot, rightRoot, handler) {
239838
+ this.recursivePairSearch(leftRoot, [], [], rightRoot, [], [], handler);
239839
+ }
239840
+ }
239841
+ /**
239842
+ * Utilities for various operations on RangeTree
239843
+ * @internal
239844
+ */
239845
+ class RangeTreeOps {
239846
+ /** Count nodes in this tree. */
239847
+ static getRecursiveNodeCount(root) {
239848
+ let count = 0;
239849
+ root.recurseIntoTree((_node) => { count++; return true; });
239850
+ return count;
239851
+ }
239852
+ /** Count appData in this tree. */
239853
+ static getRecursiveAppDataCount(root) {
239854
+ let count = 0;
239855
+ root.recurseIntoTree((node) => { count += node.getNumAppData(); return true; });
239856
+ return count;
239857
+ }
239858
+ /**
239859
+ * Create a leaf referencing appData items indexed index0<=index<index1 and with combined range of the same indices
239860
+ * @param ranges access to ranges
239861
+ * @param appData access to AppDataType items
239862
+ * @param index0 first index for block of items
239863
+ * @param index1 upper limit index for block of items.
239864
+ * @param arrayLength one more than the largest range/appData index
239865
+ * @returns newly created node.
239866
+ */
239867
+ static createLeafInIndexRange(ranges, appData, index0, index1, arrayLength) {
239868
+ const appDataBlock = [];
239869
+ const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__.Range3d.createNull();
239870
+ index1 = Math.min(index1, arrayLength);
239871
+ // console.log({ case: "LEAF", index0, index1 });
239872
+ for (let i = index0; i < index1; i++) {
239873
+ appDataBlock.push(evaluateIndexToType(appData, i));
239874
+ range.extendRange(evaluateIndexToType(ranges, i));
239875
+ }
239876
+ return RangeTreeNode.createCapture(range, appDataBlock, undefined);
239877
+ }
239878
+ /**
239879
+ * Split the array entries appData[index0 <= i < index1] into blocks of at most maxChildPerNode * maxAppDataPerLeaf and assemble into a tree structure.
239880
+ * @param ranges access to ranges
239881
+ * @param appData access to AppDataType items
239882
+ * @param index0 start index of the block to access
239883
+ * @param index1 terminal index for the block (one after final)
239884
+ * @param arrayLength one more than the largest range/appData index
239885
+ * @param maxChildPerNode max number of child nodes in each interior node
239886
+ * @param maxAppDataPerLeaf max number of appData items in each leaf.
239887
+ * @returns
239888
+ */
239889
+ static createRecursiveByIndexSplits(ranges, appData, index0, index1, arrayLength, maxChildPerNode, maxAppDataPerLeaf) {
239890
+ if (index1 > arrayLength)
239891
+ index1 = arrayLength;
239892
+ const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__.Range3d.createNull();
239893
+ const children = [];
239894
+ const maxChildrenAppData = maxChildPerNode * maxAppDataPerLeaf;
239895
+ // console.log({ name: "createRecursive", index0, index1, maxChildrenAppData });
239896
+ if (index1 <= index0 + maxChildrenAppData) { // index range is small enough to hold the appData in leaf children
239897
+ // console.log({ case: "LEAF GROUP", index0, index1 });
239898
+ for (let indexA = index0 + maxAppDataPerLeaf; index0 < index1; index0 = indexA, indexA = Math.min(indexA + maxAppDataPerLeaf, index1)) {
239899
+ const leaf = RangeTreeOps.createLeafInIndexRange(ranges, appData, index0, indexA, arrayLength);
239900
+ if (leaf !== undefined) {
239901
+ range.extendRange(leaf.getRangeRef());
239902
+ children.push(leaf);
239903
+ }
239904
+ }
239905
+ }
239906
+ else { // split the appData among interior and leaf children
239907
+ // console.log({ case: "INTERIOR", index0, index1 });
239908
+ const numPerGulp = Math.ceil((index1 - index0) / maxChildPerNode);
239909
+ for (let indexA = index0 + numPerGulp; index0 < index1; index0 = indexA, indexA = Math.min(indexA + numPerGulp, index1)) {
239910
+ const child = this.createRecursiveByIndexSplits(ranges, appData, index0, indexA, arrayLength, maxChildPerNode, maxAppDataPerLeaf);
239911
+ if (child !== undefined) {
239912
+ range.extendRange(child.getRangeRef());
239913
+ children.push(child);
239914
+ }
239915
+ }
239916
+ }
239917
+ return (children.length > 0) ? RangeTreeNode.createCapture(range, undefined, children) : undefined;
239918
+ }
239919
+ /**
239920
+ * Create a range tree by simple left-right split of given ranges.
239921
+ * * Leaves carry the inputs in left-to-right order.
239922
+ * * Each leaf range is labeled by its corresponding object(s) in the appData array.
239923
+ * @param ranges access to ranges.
239924
+ * @param appData access to AppDataType items (for leaves).
239925
+ * @param arrayLength one more than the largest range/appData index
239926
+ * @param maxChildrenPerNode max number of child nodes allowed for each interior node.
239927
+ * @param maxAppDataPerLeaf max number of appData items allowed in each leaf.
239928
+ * @returns the root of the new tree, or undefined if array lengths differ or are zero.
239929
+ */
239930
+ static createByIndexSplits(ranges, appData, arrayLength, maxChildrenPerNode = 2, maxAppDataPerLeaf = 2) {
239931
+ // console.log();
239932
+ // const numData = getFlexDataCount(appData);
239933
+ // console.log({ numData });
239934
+ if (arrayLength <= 0
239935
+ || (Array.isArray(ranges) && ranges.length !== arrayLength)
239936
+ || (Array.isArray(appData) && appData.length !== arrayLength))
239937
+ return undefined;
239938
+ if (maxChildrenPerNode < 2)
239939
+ maxChildrenPerNode = 2;
239940
+ return RangeTreeOps.createRecursiveByIndexSplits(ranges, appData, 0, arrayLength, arrayLength, maxChildrenPerNode, maxAppDataPerLeaf);
239941
+ }
239942
+ }
239943
+
239944
+
239945
+ /***/ }),
239946
+
239947
+ /***/ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js":
239948
+ /*!*********************************************************************************!*\
239949
+ !*** ../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js ***!
239950
+ \*********************************************************************************/
239951
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
239952
+
239953
+ "use strict";
239954
+ __webpack_require__.r(__webpack_exports__);
239955
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
239956
+ /* harmony export */ "SingleTreeSearchHandlerForClosestPointInArray": () => (/* binding */ SingleTreeSearchHandlerForClosestPointInArray),
239957
+ /* harmony export */ "SingleTreeSearchHandlerForClosestPointOnLineString3d": () => (/* binding */ SingleTreeSearchHandlerForClosestPointOnLineString3d),
239958
+ /* harmony export */ "SingleTreeSearchHandlerForClosestPointOnPolyface": () => (/* binding */ SingleTreeSearchHandlerForClosestPointOnPolyface),
239959
+ /* harmony export */ "TwoTreeSearchHandlerForFacetFacetCloseApproach": () => (/* binding */ TwoTreeSearchHandlerForFacetFacetCloseApproach),
239960
+ /* harmony export */ "TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach": () => (/* binding */ TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach),
239961
+ /* harmony export */ "TwoTreeSearchHandlerForPoint3dArrayPoint3dArrayCloseApproach": () => (/* binding */ TwoTreeSearchHandlerForPoint3dArrayPoint3dArrayCloseApproach)
239962
+ /* harmony export */ });
239963
+ /* harmony import */ var _curve_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../curve/CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
239964
+ /* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
239965
+ /* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
239966
+ /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
239967
+ /* harmony import */ var _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../FacetLocationDetail */ "../../core/geometry/lib/esm/polyface/FacetLocationDetail.js");
239968
+ /* harmony import */ var _MinimumValueTester__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./MinimumValueTester */ "../../core/geometry/lib/esm/polyface/RangeTree/MinimumValueTester.js");
239969
+ /* harmony import */ var _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RangeTreeNode */ "../../core/geometry/lib/esm/polyface/RangeTree/RangeTreeNode.js");
239970
+ /*---------------------------------------------------------------------------------------------
239971
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
239972
+ * See LICENSE.md in the project root for license terms and full copyright notice.
239973
+ *--------------------------------------------------------------------------------------------*/
239974
+ /** @packageDocumentation
239975
+ * @module RangeSearch
239976
+ */
239977
+
239978
+
239979
+
239980
+
239981
+
239982
+
239983
+
239984
+ /**
239985
+ * Helper class for searching for the closest point in a set of points.
239986
+ * * Future optimization: avoid sqrt by using squared distance throughout (would require refactoring CurveLocationDetail).
239987
+ * @internal
239988
+ */
239989
+ class SingleTreeSearchHandlerForClosestPointInArray extends _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__.SingleTreeSearchHandler {
239990
+ /**
239991
+ * Constructor
239992
+ * @param spacePoint cloned
239993
+ * @param context captured
239994
+ * @param maxDist collect points at no more than this distance from spacePoint
239995
+ */
239996
+ constructor(spacePoint, context, maxDist) {
239997
+ super();
239998
+ this.context = context;
239999
+ if (maxDist !== undefined && maxDist < 0)
240000
+ maxDist = undefined;
240001
+ this.searchState = _MinimumValueTester__WEBPACK_IMPORTED_MODULE_1__.MinimumValueTester.create(maxDist);
240002
+ this.spacePoint = spacePoint.clone();
240003
+ }
240004
+ /** Return the current closest point */
240005
+ getResult() {
240006
+ if (this.searchState.minValue !== undefined && this.searchState.itemAtMinValue !== undefined) {
240007
+ const iPoint = this.searchState.itemAtMinValue;
240008
+ const cld = _curve_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__.CurveLocationDetail.createCurveFractionPoint(undefined, iPoint, this.context.points[iPoint]);
240009
+ cld.a = this.searchState.minValue;
240010
+ return cld;
240011
+ }
240012
+ return undefined;
240013
+ }
240014
+ /** Return the collected closest points (if collecting) */
240015
+ getSavedItems() {
240016
+ if (this.searchState.savedItems.length === 0)
240017
+ return undefined;
240018
+ const cldArray = [];
240019
+ for (let i = 0; i < this.searchState.savedItems.length; ++i) {
240020
+ const iPoint = this.searchState.savedItems[i];
240021
+ const cld = _curve_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__.CurveLocationDetail.createCurveFractionPoint(undefined, iPoint, this.context.points[iPoint]);
240022
+ cld.a = this.searchState.savedValues[i];
240023
+ cldArray.push(cld);
240024
+ }
240025
+ return cldArray;
240026
+ }
240027
+ /**
240028
+ * Return true if appData within the range should be offered to `processAppData`.
240029
+ * @param range range containing items to be tested.
240030
+ * @returns true if the spacePoint is within the range or close enough that a point in the range could be the closest.
240031
+ */
240032
+ isRangeActive(range) {
240033
+ const dMin = range.distanceToPoint(this.spacePoint);
240034
+ if (this.searchState.isNewMinValue(dMin)) {
240035
+ this.context.numRangeTestTrue++;
240036
+ return true;
240037
+ }
240038
+ this.context.numRangeTestFalse++;
240039
+ return false;
240040
+ }
240041
+ /** Test a point indexed in the range tree as candidate for "closest" */
240042
+ processAppData(candidateIndex) {
240043
+ const d = this.spacePoint.distance(this.context.points[candidateIndex]);
240044
+ this.context.numPointTest++;
240045
+ this.searchState.testAndSave(candidateIndex, d);
240046
+ }
240047
+ }
240048
+ /**
240049
+ * Helper class for searching for the closest approach between sets of points.
240050
+ * * Future optimization: avoid sqrt by using squared distance throughout (would require refactoring CurveLocationDetail).
240051
+ * @internal
240052
+ */
240053
+ class TwoTreeSearchHandlerForPoint3dArrayPoint3dArrayCloseApproach extends _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__.TwoTreeDistanceMinimizationSearchHandler {
240054
+ /**
240055
+ * Constructor
240056
+ * @param contextA captured
240057
+ * @param contextB captured
240058
+ * @param maxDist collect points at no more than this separation distance
240059
+ */
240060
+ constructor(contextA, contextB, maxDist) {
240061
+ super();
240062
+ this.contextA = contextA;
240063
+ this.contextB = contextB;
240064
+ if (maxDist !== undefined && maxDist < 0)
240065
+ maxDist = undefined;
240066
+ this.searchState = _MinimumValueTester__WEBPACK_IMPORTED_MODULE_1__.MinimumValueTester.create(maxDist);
240067
+ }
240068
+ /** Return the current closest approach */
240069
+ getResult() {
240070
+ if (this.searchState.minValue !== undefined) {
240071
+ return this.searchState.itemAtMinValue;
240072
+ }
240073
+ return undefined;
240074
+ }
240075
+ /** Return the collected close approaches (if collecting) */
240076
+ getSavedItems() {
240077
+ if (this.searchState.savedItems.length > 0) {
240078
+ return this.searchState.savedItems;
240079
+ }
240080
+ return undefined;
240081
+ }
240082
+ /** Get current min distance */
240083
+ getCurrentDistance() {
240084
+ const d = this.searchState.minValue;
240085
+ return d === undefined ? Number.MAX_VALUE : d;
240086
+ }
240087
+ /** Compute and test the distance between two points, given their indices. */
240088
+ processAppDataPair(indexA, indexB) {
240089
+ this.contextA.numPointTest++;
240090
+ const pointA = this.contextA.points[indexA];
240091
+ const pointB = this.contextB.points[indexB];
240092
+ const d = pointA.distance(pointB);
240093
+ if (this.searchState.isNewMinOrTrigger(d)) {
240094
+ 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));
240095
+ cldPair.detailA.a = cldPair.detailB.a = d;
240096
+ this.searchState.testAndSave(cldPair, d);
240097
+ }
240098
+ }
240099
+ }
240100
+ /**
240101
+ * Helper class for searching for the closest point in a linestring.
240102
+ * * Future optimization: avoid sqrt by using squared distance throughout (would require refactoring CurveLocationDetail).
240103
+ * @internal
240104
+ */
240105
+ class SingleTreeSearchHandlerForClosestPointOnLineString3d extends _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__.SingleTreeSearchHandler {
240106
+ /**
240107
+ * Constructor
240108
+ * @param spacePoint cloned
240109
+ * @param context captured
240110
+ * @param maxDist collect points at no more than this distance from spacePoint
240111
+ */
240112
+ constructor(spacePoint, context, maxDist) {
240113
+ super();
240114
+ this.context = context;
240115
+ if (maxDist !== undefined && maxDist < 0)
240116
+ maxDist = undefined;
240117
+ this.searchState = _MinimumValueTester__WEBPACK_IMPORTED_MODULE_1__.MinimumValueTester.create(maxDist);
240118
+ this.spacePoint = spacePoint.clone();
240119
+ }
240120
+ /** Return the current closest point */
240121
+ getResult() {
240122
+ if (this.searchState.minValue !== undefined && this.searchState.itemAtMinValue !== undefined) {
240123
+ return this.searchState.itemAtMinValue;
240124
+ }
240125
+ return undefined;
240126
+ }
240127
+ /** Return the collected closest points (if collecting) */
240128
+ getSavedItems() {
240129
+ if (this.searchState.savedItems.length > 0) {
240130
+ return this.searchState.savedItems;
240131
+ }
240132
+ return undefined;
240133
+ }
240134
+ /**
240135
+ * Return true if appData within the range should be offered to `processAppData`.
240136
+ * @param range range containing items to be tested.
240137
+ * @returns true if the spacePoint is within the range or close enough that a point in the range could be the closest.
240138
+ */
240139
+ isRangeActive(range) {
240140
+ const dMin = range.distanceToPoint(this.spacePoint);
240141
+ if (this.searchState.isNewMinValue(dMin)) {
240142
+ this.context.numRangeTestTrue++;
240143
+ return true;
240144
+ }
240145
+ this.context.numRangeTestFalse++;
240146
+ return false;
240147
+ }
240148
+ /** Test a segment indexed in the range tree as candidate for "closest" */
240149
+ processAppData(candidateIndex) {
240150
+ const segment = this._workSegment = this.context.lineString.getIndexedSegment(candidateIndex, this._workSegment);
240151
+ if (segment) {
240152
+ const cld = segment.closestPoint(this.spacePoint, false);
240153
+ _curve_LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d.convertLocalToGlobalDetail(cld, candidateIndex, this.context.lineString.numEdges(), this.context.lineString);
240154
+ this.context.numPointTest++;
240155
+ this.searchState.testAndSave(cld, cld.a);
240156
+ }
240157
+ }
240158
+ }
240159
+ /**
240160
+ * Helper class for searching for the closest approach between linestrings.
240161
+ * * Future optimization: avoid sqrt by using squared distance throughout (would require refactoring CurveLocationDetail).
240162
+ * @internal
240163
+ */
240164
+ class TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach extends _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__.TwoTreeDistanceMinimizationSearchHandler {
240165
+ /**
240166
+ * Constructor
240167
+ * @param contextA captured
240168
+ * @param contextB captured
240169
+ * @param maxDist collect points at no more than this separation distance
240170
+ */
240171
+ constructor(contextA, contextB, maxDist) {
240172
+ super();
240173
+ this.contextA = contextA;
240174
+ this.contextB = contextB;
240175
+ if (maxDist !== undefined && maxDist < 0)
240176
+ maxDist = undefined;
240177
+ this.searchState = _MinimumValueTester__WEBPACK_IMPORTED_MODULE_1__.MinimumValueTester.create(maxDist);
240178
+ }
240179
+ /**
240180
+ * Return the current closest approach.
240181
+ * * Details contain linestring *and* segment data, cf. [[LineString3d.convertLocalToGlobalDetail]]
240182
+ */
240183
+ getResult() {
240184
+ if (this.searchState.minValue !== undefined) {
240185
+ return this.searchState.itemAtMinValue;
240186
+ }
240187
+ return undefined;
240188
+ }
240189
+ /** Return the collected close approaches (if collecting) */
240190
+ getSavedItems() {
240191
+ if (this.searchState.savedItems.length > 0) {
240192
+ return this.searchState.savedItems;
240193
+ }
240194
+ return undefined;
240195
+ }
240196
+ /** Get current min distance */
240197
+ getCurrentDistance() {
240198
+ const d = this.searchState.minValue;
240199
+ return d === undefined ? Number.MAX_VALUE : d;
240200
+ }
240201
+ /** Compute and test the closest approach between two segments, given their indices. */
240202
+ processAppDataPair(indexA, indexB) {
240203
+ this.contextA.numPointTest++;
240204
+ const segA = TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach._workSegmentA =
240205
+ this.contextA.lineString.getIndexedSegment(indexA, TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach._workSegmentA);
240206
+ const segB = TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach._workSegmentB =
240207
+ this.contextB.lineString.getIndexedSegment(indexB, TwoTreeSearchHandlerForLineString3dLineString3dCloseApproach._workSegmentB);
240208
+ const cldPair = _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_4__.LineSegment3d.closestApproach(segA, false, segB, false);
240209
+ if (cldPair && this.searchState.isNewMinOrTrigger(cldPair.detailA.a)) {
240210
+ _curve_LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d.convertLocalToGlobalDetail(cldPair.detailA, indexA, this.contextA.lineString.numEdges(), this.contextA.lineString);
240211
+ _curve_LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d.convertLocalToGlobalDetail(cldPair.detailB, indexB, this.contextB.lineString.numEdges(), this.contextB.lineString);
240212
+ this.searchState.testAndSave(cldPair, cldPair.detailA.a);
240213
+ }
240214
+ }
240215
+ }
240216
+ /**
240217
+ * Helper class for searching for the closest point in a polyface.
240218
+ * * Future optimization: avoid sqrt by using squared distance throughout (would require refactoring FacetLocationDetail).
240219
+ * @internal
240220
+ */
240221
+ class SingleTreeSearchHandlerForClosestPointOnPolyface extends _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__.SingleTreeSearchHandler {
240222
+ /**
240223
+ * Constructor
240224
+ * @param spacePoint cloned
240225
+ * @param context captured
240226
+ * @param maxDist collect points at no more than this distance from spacePoint
240227
+ * @param searchFacetInterior true: search facet interior + boundary; false: just boundary
240228
+ */
240229
+ constructor(spacePoint, context, maxDist, searchFacetInterior = false) {
240230
+ super();
240231
+ this.context = context;
240232
+ if (maxDist !== undefined && maxDist < 0)
240233
+ maxDist = undefined;
240234
+ this.searchState = _MinimumValueTester__WEBPACK_IMPORTED_MODULE_1__.MinimumValueTester.create(maxDist);
240235
+ this.spacePoint = spacePoint.clone();
240236
+ this.searchFacetInterior = searchFacetInterior;
240237
+ }
240238
+ /** Return the current closest point */
240239
+ getResult() {
240240
+ if (this.searchState.minValue !== undefined && this.searchState.itemAtMinValue !== undefined) {
240241
+ return this.searchState.itemAtMinValue;
240242
+ }
240243
+ return undefined;
240244
+ }
240245
+ /** Return the collected closest points (if collecting) */
240246
+ getSavedItems() {
240247
+ if (this.searchState.savedItems.length > 0) {
240248
+ return this.searchState.savedItems;
240249
+ }
240250
+ return undefined;
240251
+ }
240252
+ /**
240253
+ * Return true if appData within the range should be offered to `processAppData`.
240254
+ * @param range range containing items to be tested.
240255
+ * @returns true if the spacePoint is within the range or close enough that a point in the range could be the closest.
240256
+ */
240257
+ isRangeActive(range) {
240258
+ const dMin = range.distanceToPoint(this.spacePoint);
240259
+ if (this.searchState.isNewMinValue(dMin)) {
240260
+ this.context.numRangeTestTrue++;
240261
+ return true;
240262
+ }
240263
+ this.context.numRangeTestFalse++;
240264
+ return false;
240265
+ }
240266
+ /** Test a facet indexed in the range tree as candidate for "closest" */
240267
+ processAppData(candidateIndex) {
240268
+ this.context.visitor.setNumWrap(0); // so edgeCount === pointCount; closure point unnecessary for closestPoint[OnBoundary]
240269
+ if (this.context.visitor.moveToReadIndex(candidateIndex)) {
240270
+ let pld;
240271
+ if (this.searchFacetInterior)
240272
+ pld = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_5__.PolygonOps.closestPoint(this.context.visitor.point, this.spacePoint);
240273
+ else
240274
+ pld = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_5__.PolygonOps.closestPointOnBoundary(this.context.visitor.point, this.spacePoint);
240275
+ this.context.numFacetTest++;
240276
+ if (pld && this.searchState.isNewMinOrTrigger(pld.a)) {
240277
+ const edgeCount = this.context.visitor.pointCount;
240278
+ const fld = this.context.convexFacets
240279
+ ? _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_6__.ConvexFacetLocationDetail.createCapture(this.context.visitor.currentReadIndex(), edgeCount, pld)
240280
+ : _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_6__.NonConvexFacetLocationDetail.createCapture(this.context.visitor.currentReadIndex(), edgeCount, pld);
240281
+ this.searchState.testAndSave(fld, pld.a);
240282
+ }
240283
+ }
240284
+ }
240285
+ }
240286
+ /**
240287
+ * Helper class for searching for the closest approach between polyfaces.
240288
+ * * Future optimization: avoid sqrt by using squared distance throughout (would require refactoring FacetLocationDetail).
240289
+ * @internal
240290
+ */
240291
+ class TwoTreeSearchHandlerForFacetFacetCloseApproach extends _RangeTreeNode__WEBPACK_IMPORTED_MODULE_0__.TwoTreeDistanceMinimizationSearchHandler {
240292
+ /** Constructor
240293
+ * @param contextA captured
240294
+ * @param contextB captured
240295
+ * @param maxDist collect points at no more than this separation distance
240296
+ * @param searchFacetInterior true: search facet interior + boundary; false: just boundary
240297
+ */
240298
+ constructor(contextA, contextB, maxDist, searchFacetInterior = false) {
240299
+ super();
240300
+ this.contextA = contextA;
240301
+ this.contextB = contextB;
240302
+ if (maxDist !== undefined && maxDist < 0)
240303
+ maxDist = undefined;
240304
+ this.searchState = _MinimumValueTester__WEBPACK_IMPORTED_MODULE_1__.MinimumValueTester.create(maxDist);
240305
+ this.searchFacetInterior = searchFacetInterior && contextA.convexFacets && contextB.convexFacets;
240306
+ }
240307
+ /** Return the facets with closest approach */
240308
+ getResult() {
240309
+ if (this.searchState.minValue !== undefined) {
240310
+ return this.searchState.itemAtMinValue;
240311
+ }
240312
+ return undefined;
240313
+ }
240314
+ /** Return the collected close approaches (if collecting) */
240315
+ getSavedItems() {
240316
+ if (this.searchState.savedItems.length > 0) {
240317
+ return this.searchState.savedItems;
240318
+ }
240319
+ return undefined;
240320
+ }
240321
+ /** Get current min distance */
240322
+ getCurrentDistance() {
240323
+ const d = this.searchState.minValue;
240324
+ return d === undefined ? Number.MAX_VALUE : d;
240325
+ }
240326
+ /** Compute and test the closest approach between two facets, given their indices. */
240327
+ processAppDataPair(indexA, indexB) {
240328
+ this.contextA.visitor.setNumWrap(1); // closed polygons are more efficient for PolygonOps.closestApproach
240329
+ this.contextB.visitor.setNumWrap(1);
240330
+ if (this.contextA.visitor.moveToReadIndex(indexA) && this.contextB.visitor.moveToReadIndex(indexB)) {
240331
+ // ASSUME: not worth sending in maxDist here...
240332
+ const pldPair = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_5__.PolygonOps.closestApproach(this.contextA.visitor.point, this.contextB.visitor.point, undefined, this.searchFacetInterior);
240333
+ this.contextA.numFacetTest++;
240334
+ if (pldPair && this.searchState.isNewMinOrTrigger(pldPair.detailA.a)) {
240335
+ const edgeCountA = this.contextA.visitor.pointCount - 1;
240336
+ const edgeCountB = this.contextB.visitor.pointCount - 1;
240337
+ 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));
240338
+ this.searchState.testAndSave(fldPair, fldPair.detailA.a);
240339
+ }
240340
+ }
240341
+ }
240342
+ }
240343
+
240344
+
238341
240345
  /***/ }),
238342
240346
 
238343
240347
  /***/ "../../core/geometry/lib/esm/polyface/TaggedNumericData.js":
@@ -248133,6 +250137,9 @@ class SteppedIndexFunctionFactory {
248133
250137
  * @internal
248134
250138
  */
248135
250139
  class FrankeSurface {
250140
+ constructor(scales) {
250141
+ this.scales = scales;
250142
+ }
248136
250143
  exp0(u, v) {
248137
250144
  return Math.exp(-0.25 * (u * u + v * v) + u + v - 2);
248138
250145
  }
@@ -248150,7 +250157,21 @@ class FrankeSurface {
248150
250157
  const f1 = 0.75 * this.exp1(u, v);
248151
250158
  const f2 = 0.5 * this.exp2(u, v);
248152
250159
  const f3 = -0.2 * this.exp3(u, v);
248153
- return f0 + f1 + f2 + f3;
250160
+ if (this.scales !== undefined) {
250161
+ const numScale = this.scales.length;
250162
+ let f = 0;
250163
+ if (numScale >= 1)
250164
+ f += this.scales[0] * f0;
250165
+ if (numScale >= 2)
250166
+ f += this.scales[1] * f1;
250167
+ if (numScale >= 3)
250168
+ f += this.scales[2] * f2;
250169
+ if (numScale >= 4)
250170
+ f += this.scales[3] * f3;
250171
+ return f;
250172
+ }
250173
+ else
250174
+ return f0 + f1 + f2 + f3;
248154
250175
  }
248155
250176
  du(u, v) {
248156
250177
  const du0 = -3.375 * (u - 2) * this.exp0(u, v);
@@ -250166,6 +252187,40 @@ class Sample {
250166
252187
  point0.push(point0[0].clone());
250167
252188
  return point0;
250168
252189
  }
252190
+ /**
252191
+ * Create a grid of lat-long points on a sphere.
252192
+ * * If pole latitudes appear in the evaluation, a single point (not a circle) is evaluated.
252193
+ * * Circles at various latitudes proceed south to north.
252194
+ * * If first and last angles of longitudeSweep match, that meridian is not duplicated.
252195
+ * * Longitudes can wrap freely.
252196
+ * @param transform local to world
252197
+ * @param numLatitudeStep number of latitude steps (poles count if they are in the sweeps)
252198
+ * @param numLongitudeStep number of longitude steps
252199
+ * @param latitudeSweep angle range for latitudes
252200
+ * @param longitudeSweep angle range for longitudes
252201
+ */
252202
+ 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)) {
252203
+ const points = [];
252204
+ const numJ = numLatitudeStep + 1;
252205
+ const jFractionStep = 1.0 / numJ;
252206
+ let numI = numLongitudeStep;
252207
+ const iFractionStep = 1.0 / numI;
252208
+ if (longitudeSweep.isFullCircle)
252209
+ numI--;
252210
+ for (let j = 0; j < numJ; j++) {
252211
+ const phi = latitudeSweep.fractionToRadians(jFractionStep * j);
252212
+ const sinPhi = Math.sin(phi);
252213
+ const cosPhi = Math.cos(phi);
252214
+ const numIThisCircle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_4__.Angle.isAlmostEqualRadiansAllowPeriodShift(phi, -90) ? 1 : numI;
252215
+ for (let i = 0; i < numIThisCircle; i++) {
252216
+ const theta = longitudeSweep.fractionToRadians(iFractionStep * i);
252217
+ const cosTheta = Math.cos(theta);
252218
+ const sinTheta = Math.sin(theta);
252219
+ points.push(transform.multiplyXYZ(cosTheta * cosPhi, sinTheta * cosPhi, sinPhi));
252220
+ }
252221
+ }
252222
+ return points;
252223
+ }
250169
252224
  /**
250170
252225
  * Return an array of points on a circular arc.
250171
252226
  * @param edgesPerQuadrant number of edges per 90 degrees
@@ -250273,14 +252328,36 @@ class Sample {
250273
252328
  return _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Point2d.createFrom(Sample.createRosePoint3d(theta, a));
250274
252329
  }
250275
252330
  /**
250276
- * Create a mesh surface from samples of a smooth function over [0,1]x[0,1].
252331
+ * Create a mesh surface from samples of a smooth real-valued function over [0,1]x[0,1] with multiple humps and dips.
252332
+ * * The facets are bilinear quads, so if planar facets are required, set `options.shouldTriangulate = true`.
250277
252333
  * @param size grid size; the number of intervals on each side of the unit square domain.
252334
+ * @param scales = array of 4 (four) numbers to scale the corresponding Franke exponential. If undefined, all scales are 1.
250278
252335
  */
250279
- static createMeshFromSmoothSurface(size, options) {
252336
+ static createMeshFromFrankeSurface(size, options, scales) {
250280
252337
  const builder = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_49__.PolyfaceBuilder.create(options);
250281
- builder.addUVGridBody(new FrankeSurface(), size, size);
252338
+ builder.addUVGridBody(new FrankeSurface(scales), size, size);
250282
252339
  return builder.claimPolyface(true);
250283
252340
  }
252341
+ /** Stroke a helix over the unit circle. Place in space via a transform.
252342
+ * The various columns of the transform become the critical measures for the (elliptic) helix:
252343
+ * The unit cylinder maps to an elliptic cylinder with x and y columns as 0 and 90 degree vectors.
252344
+ * the Helix pitch is equal to the length of the z axis in the transform.
252345
+ * The completeTurns parameter (which does NOT need to be an integer) is the local z of the last point
252346
+ */
252347
+ static createHelixPoints(completeTurns, numPoints, placement) {
252348
+ const points = [];
252349
+ if (numPoints < 2)
252350
+ numPoints = 2;
252351
+ const dThetaRadians = completeTurns * Math.PI * 2 / (numPoints - 1);
252352
+ const dz = completeTurns / (numPoints - 1);
252353
+ for (let i = 0; i < numPoints; i++) {
252354
+ const thetaRadians = dThetaRadians * i;
252355
+ points.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(Math.cos(thetaRadians), Math.sin(thetaRadians), i * dz));
252356
+ }
252357
+ if (placement)
252358
+ placement.multiplyPoint3dArrayInPlace(points);
252359
+ return points;
252360
+ }
250284
252361
  }
250285
252362
  /** Array with assorted Point2d samples */
250286
252363
  Sample.point2d = [
@@ -252997,7 +255074,7 @@ class LinearSweep extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrim
252997
255074
  }
252998
255075
  /**
252999
255076
  * Create a sweep of a starting contour.
253000
- * @param contour contour to be swept
255077
+ * @param contour contour to be swept, CAPTURED
253001
255078
  * @param direction sweep vector. The contour is swept the full length of the vector.
253002
255079
  * @param capped true to include end caps
253003
255080
  */
@@ -254970,7 +257047,7 @@ class HalfEdge {
254970
257047
  * * The two edges are joined as edgeMate pair.
254971
257048
  * * The two edges are a 2-half-edge face loop in both the faceSuccessor and facePredecessor directions.
254972
257049
  * * Properties x,y,z,i are inserted in each half edge.
254973
- * @returns the reference to the first half edge created.
257050
+ * @returns the reference to the first half edge created, set with "A" properties.
254974
257051
  */
254975
257052
  static createHalfEdgePairWithCoordinates(xA = 0, yA = 0, zA = 0, iA = 0, xB = 0, yB = 0, zB = 0, iB = 0, heArray) {
254976
257053
  const a = HalfEdge.createHalfEdgePair(heArray);
@@ -256008,8 +258085,9 @@ class HalfEdgeGraph {
256008
258085
  * * The two half edges are a 2-half-edge face loop in both the faceSuccessor and facePredecessor directions.
256009
258086
  * * The two half edges are added to the graph's HalfEdge set.
256010
258087
  * * 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.
258088
+ * @param iA `i` property of the first created HalfEdge
258089
+ * @param iB `i` property of the second created HalfEdge
258090
+ * @returns pointer to the first half edge created, with `i` property set to iA.
256013
258091
  */
256014
258092
  createEdgeIdId(iA = 0, iB = 0) {
256015
258093
  return HalfEdge.createHalfEdgePairWithCoordinates(0.0, 0.0, 0.0, iA, 0.0, 0.0, 0.0, iB, this.allHalfEdges);
@@ -256357,21 +258435,21 @@ class HalfEdgeGraphFromIndexedLoopsContext {
256357
258435
  * * For an edge with index pair [indexA, indexB]:
256358
258436
  * * if [indexB, indexA] has never appeared, a HalfEdge mated pair is created.
256359
258437
  * * One of that mated pair becomes a HalfEdge in this loop.
256360
- * * The other is "unmatched"
258438
+ * * The other is "unmatched" and gets the EXTERIOR mask.
256361
258439
  * * When announceMatedHalfEdges(halfEdge) is called:
256362
258440
  * * halfEdge and its mate are "new"
256363
258441
  * * all coordinates are zeros.
256364
- * * each contains (as its halfEdge.id property) one index of the [indexA,indexB] pair.
258442
+ * * each contains (as its `i` property) one index of the [indexA,indexB] pair.
256365
258443
  * * those coordinates and indices will never be referenced again by this construction sequence -- the caller is free to mutate them as needed.
256366
258444
  * * 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.
258445
+ * the "unmatched" HalfEdge is used in the loop being constructed, and its EXTERIOR mask is cleared.
258446
+ * @param indices Array of indices around the edge. This is accessed cyclically, so first and last indices should be different.
256369
258447
  * @param announceMatedHalfEdges optional function to be called as mated pairs are created. At the call,
256370
258448
  * the given HalfEdge and its mate will have a pair of successive indices from the array.
256371
258449
  */
256372
258450
  insertLoop(indices, announceMatedHalfEdges) {
256373
258451
  const n = indices.length;
256374
- if (n > 1) {
258452
+ if (n > 2) {
256375
258453
  let index0 = indices[indices.length - 1];
256376
258454
  this._halfEdgesAroundCurrentLoop.length = 0;
256377
258455
  for (const index1 of indices) {
@@ -286564,9 +288642,9 @@ const gBase64 = {
286564
288642
 
286565
288643
  /***/ }),
286566
288644
 
286567
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":
288645
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js":
286568
288646
  /*!******************************************************************************************************************************!*\
286569
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js ***!
288647
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js ***!
286570
288648
  \******************************************************************************************************************************/
286571
288649
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286572
288650
 
@@ -286583,9 +288661,9 @@ function _arrayLikeToArray(arr, len) {
286583
288661
 
286584
288662
  /***/ }),
286585
288663
 
286586
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js":
288664
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js":
286587
288665
  /*!****************************************************************************************************************************!*\
286588
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js ***!
288666
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js ***!
286589
288667
  \****************************************************************************************************************************/
286590
288668
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286591
288669
 
@@ -286600,9 +288678,9 @@ function _arrayWithHoles(arr) {
286600
288678
 
286601
288679
  /***/ }),
286602
288680
 
286603
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js":
288681
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js":
286604
288682
  /*!***********************************************************************************************************************************!*\
286605
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js ***!
288683
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js ***!
286606
288684
  \***********************************************************************************************************************************/
286607
288685
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286608
288686
 
@@ -286620,9 +288698,9 @@ function _assertThisInitialized(self) {
286620
288698
 
286621
288699
  /***/ }),
286622
288700
 
286623
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/classCallCheck.js":
288701
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/classCallCheck.js":
286624
288702
  /*!****************************************************************************************************************************!*\
286625
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/classCallCheck.js ***!
288703
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/classCallCheck.js ***!
286626
288704
  \****************************************************************************************************************************/
286627
288705
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286628
288706
 
@@ -286639,9 +288717,9 @@ function _classCallCheck(instance, Constructor) {
286639
288717
 
286640
288718
  /***/ }),
286641
288719
 
286642
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/createClass.js":
288720
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/createClass.js":
286643
288721
  /*!*************************************************************************************************************************!*\
286644
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/createClass.js ***!
288722
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/createClass.js ***!
286645
288723
  \*************************************************************************************************************************/
286646
288724
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286647
288725
 
@@ -286650,7 +288728,7 @@ __webpack_require__.r(__webpack_exports__);
286650
288728
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286651
288729
  /* harmony export */ "default": () => (/* binding */ _createClass)
286652
288730
  /* 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");
288731
+ /* 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
288732
 
286655
288733
  function _defineProperties(target, props) {
286656
288734
  for (var i = 0; i < props.length; i++) {
@@ -286672,9 +288750,9 @@ function _createClass(Constructor, protoProps, staticProps) {
286672
288750
 
286673
288751
  /***/ }),
286674
288752
 
286675
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/defineProperty.js":
288753
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/defineProperty.js":
286676
288754
  /*!****************************************************************************************************************************!*\
286677
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
288755
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
286678
288756
  \****************************************************************************************************************************/
286679
288757
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286680
288758
 
@@ -286683,7 +288761,7 @@ __webpack_require__.r(__webpack_exports__);
286683
288761
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286684
288762
  /* harmony export */ "default": () => (/* binding */ _defineProperty)
286685
288763
  /* 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");
288764
+ /* 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
288765
 
286688
288766
  function _defineProperty(obj, key, value) {
286689
288767
  key = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key);
@@ -286702,9 +288780,9 @@ function _defineProperty(obj, key, value) {
286702
288780
 
286703
288781
  /***/ }),
286704
288782
 
286705
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js":
288783
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js":
286706
288784
  /*!****************************************************************************************************************************!*\
286707
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js ***!
288785
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js ***!
286708
288786
  \****************************************************************************************************************************/
286709
288787
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286710
288788
 
@@ -286722,9 +288800,9 @@ function _getPrototypeOf(o) {
286722
288800
 
286723
288801
  /***/ }),
286724
288802
 
286725
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/inherits.js":
288803
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/inherits.js":
286726
288804
  /*!**********************************************************************************************************************!*\
286727
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/inherits.js ***!
288805
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/inherits.js ***!
286728
288806
  \**********************************************************************************************************************/
286729
288807
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286730
288808
 
@@ -286733,7 +288811,7 @@ __webpack_require__.r(__webpack_exports__);
286733
288811
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286734
288812
  /* harmony export */ "default": () => (/* binding */ _inherits)
286735
288813
  /* 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");
288814
+ /* 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
288815
 
286738
288816
  function _inherits(subClass, superClass) {
286739
288817
  if (typeof superClass !== "function" && superClass !== null) {
@@ -286754,9 +288832,9 @@ function _inherits(subClass, superClass) {
286754
288832
 
286755
288833
  /***/ }),
286756
288834
 
286757
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/iterableToArray.js":
288835
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/iterableToArray.js":
286758
288836
  /*!*****************************************************************************************************************************!*\
286759
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/iterableToArray.js ***!
288837
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/iterableToArray.js ***!
286760
288838
  \*****************************************************************************************************************************/
286761
288839
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286762
288840
 
@@ -286771,9 +288849,9 @@ function _iterableToArray(iter) {
286771
288849
 
286772
288850
  /***/ }),
286773
288851
 
286774
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js":
288852
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js":
286775
288853
  /*!*****************************************************************************************************************************!*\
286776
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js ***!
288854
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js ***!
286777
288855
  \*****************************************************************************************************************************/
286778
288856
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286779
288857
 
@@ -286788,9 +288866,9 @@ function _nonIterableRest() {
286788
288866
 
286789
288867
  /***/ }),
286790
288868
 
286791
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js":
288869
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js":
286792
288870
  /*!***************************************************************************************************************************************!*\
286793
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js ***!
288871
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js ***!
286794
288872
  \***************************************************************************************************************************************/
286795
288873
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286796
288874
 
@@ -286799,8 +288877,8 @@ __webpack_require__.r(__webpack_exports__);
286799
288877
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286800
288878
  /* harmony export */ "default": () => (/* binding */ _possibleConstructorReturn)
286801
288879
  /* 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");
288880
+ /* 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");
288881
+ /* 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
288882
 
286805
288883
 
286806
288884
  function _possibleConstructorReturn(self, call) {
@@ -286814,9 +288892,9 @@ function _possibleConstructorReturn(self, call) {
286814
288892
 
286815
288893
  /***/ }),
286816
288894
 
286817
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js":
288895
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js":
286818
288896
  /*!****************************************************************************************************************************!*\
286819
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js ***!
288897
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js ***!
286820
288898
  \****************************************************************************************************************************/
286821
288899
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286822
288900
 
@@ -286835,9 +288913,9 @@ function _setPrototypeOf(o, p) {
286835
288913
 
286836
288914
  /***/ }),
286837
288915
 
286838
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toArray.js":
288916
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toArray.js":
286839
288917
  /*!*********************************************************************************************************************!*\
286840
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toArray.js ***!
288918
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toArray.js ***!
286841
288919
  \*********************************************************************************************************************/
286842
288920
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286843
288921
 
@@ -286846,10 +288924,10 @@ __webpack_require__.r(__webpack_exports__);
286846
288924
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286847
288925
  /* harmony export */ "default": () => (/* binding */ _toArray)
286848
288926
  /* 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");
288927
+ /* 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");
288928
+ /* 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");
288929
+ /* 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");
288930
+ /* 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
288931
 
286854
288932
 
286855
288933
 
@@ -286860,57 +288938,57 @@ function _toArray(arr) {
286860
288938
 
286861
288939
  /***/ }),
286862
288940
 
286863
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toPrimitive.js":
288941
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toPrimitive.js":
286864
288942
  /*!*************************************************************************************************************************!*\
286865
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***!
288943
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***!
286866
288944
  \*************************************************************************************************************************/
286867
288945
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286868
288946
 
286869
288947
  "use strict";
286870
288948
  __webpack_require__.r(__webpack_exports__);
286871
288949
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286872
- /* harmony export */ "default": () => (/* binding */ _toPrimitive)
288950
+ /* harmony export */ "default": () => (/* binding */ toPrimitive)
286873
288951
  /* 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;
288952
+ /* 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");
288953
+
288954
+ function toPrimitive(t, r) {
288955
+ if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(t) || !t) return t;
288956
+ var e = t[Symbol.toPrimitive];
288957
+ if (void 0 !== e) {
288958
+ var i = e.call(t, r || "default");
288959
+ if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i)) return i;
286882
288960
  throw new TypeError("@@toPrimitive must return a primitive value.");
286883
288961
  }
286884
- return (hint === "string" ? String : Number)(input);
288962
+ return ("string" === r ? String : Number)(t);
286885
288963
  }
286886
288964
 
286887
288965
  /***/ }),
286888
288966
 
286889
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":
288967
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":
286890
288968
  /*!***************************************************************************************************************************!*\
286891
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***!
288969
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***!
286892
288970
  \***************************************************************************************************************************/
286893
288971
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286894
288972
 
286895
288973
  "use strict";
286896
288974
  __webpack_require__.r(__webpack_exports__);
286897
288975
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286898
- /* harmony export */ "default": () => (/* binding */ _toPropertyKey)
288976
+ /* harmony export */ "default": () => (/* binding */ toPropertyKey)
286899
288977
  /* 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");
288978
+ /* 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");
288979
+ /* 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
288980
 
286903
288981
 
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);
288982
+ function toPropertyKey(t) {
288983
+ var i = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__["default"])(t, "string");
288984
+ return "symbol" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i) ? i : String(i);
286907
288985
  }
286908
288986
 
286909
288987
  /***/ }),
286910
288988
 
286911
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/typeof.js":
288989
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/typeof.js":
286912
288990
  /*!********************************************************************************************************************!*\
286913
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/typeof.js ***!
288991
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/typeof.js ***!
286914
288992
  \********************************************************************************************************************/
286915
288993
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286916
288994
 
@@ -286931,9 +289009,9 @@ function _typeof(o) {
286931
289009
 
286932
289010
  /***/ }),
286933
289011
 
286934
- /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":
289012
+ /***/ "../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js":
286935
289013
  /*!****************************************************************************************************************************************!*\
286936
- !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.4/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js ***!
289014
+ !*** ../../common/temp/node_modules/.pnpm/@babel+runtime@7.23.8/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js ***!
286937
289015
  \****************************************************************************************************************************************/
286938
289016
  /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
286939
289017
 
@@ -286942,7 +289020,7 @@ __webpack_require__.r(__webpack_exports__);
286942
289020
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
286943
289021
  /* harmony export */ "default": () => (/* binding */ _unsupportedIterableToArray)
286944
289022
  /* 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");
289023
+ /* 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
289024
 
286947
289025
  function _unsupportedIterableToArray(o, minLen) {
286948
289026
  if (!o) return;
@@ -287440,15 +289518,15 @@ __webpack_require__.r(__webpack_exports__);
287440
289518
  /* harmony export */ "t": () => (/* binding */ t),
287441
289519
  /* harmony export */ "use": () => (/* binding */ use)
287442
289520
  /* 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");
289521
+ /* 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");
289522
+ /* 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");
289523
+ /* 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");
289524
+ /* 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");
289525
+ /* 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");
289526
+ /* 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");
289527
+ /* 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");
289528
+ /* 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");
289529
+ /* 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
289530
 
287453
289531
 
287454
289532
 
@@ -290276,7 +292354,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
290276
292354
  /***/ ((module) => {
290277
292355
 
290278
292356
  "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"}}');
292357
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.4.0-dev.25","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/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.25","@itwin/core-bentley":"workspace:^4.4.0-dev.25","@itwin/core-common":"workspace:^4.4.0-dev.25","@itwin/core-geometry":"workspace:^4.4.0-dev.25","@itwin/core-orbitgt":"workspace:^4.4.0-dev.25","@itwin/core-quantity":"workspace:^4.4.0-dev.25"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.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
292358
 
290281
292359
  /***/ })
290282
292360