@itwin/rpcinterface-full-stack-tests 5.1.0-dev.1 → 5.1.0-dev.4

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.
@@ -68621,6 +68621,20 @@ var RenderSchedule;
68621
68621
  get maxBatchId() {
68622
68622
  return this._maxBatchId ?? (this._maxBatchId = this.modelTimelines.reduce((accum, timeline) => Math.max(accum, timeline.maxBatchId), 0));
68623
68623
  }
68624
+ /**
68625
+ * Replaces all elementIds in a ScriptProps object with an empty string. Returns modified ScriptProps.
68626
+ * @param scheduleScript The script props to modify.
68627
+ * @internal */
68628
+ static removeScheduleScriptElementIds(scheduleScript) {
68629
+ scheduleScript.forEach((modelTimeline) => {
68630
+ modelTimeline.elementTimelines.forEach((elementTimeline) => {
68631
+ if (elementTimeline.elementIds) {
68632
+ elementTimeline.elementIds = "";
68633
+ }
68634
+ });
68635
+ });
68636
+ return scheduleScript;
68637
+ }
68624
68638
  }
68625
68639
  RenderSchedule.Script = Script;
68626
68640
  /** A reference to a [[RenderSchedule.Script]], optionally identifying the source of the script.
@@ -101522,6 +101536,174 @@ class SchemaGraph {
101522
101536
  }
101523
101537
 
101524
101538
 
101539
+ /***/ }),
101540
+
101541
+ /***/ "../../core/ecschema-rpc/common/lib/esm/ECSchemaRpcInterface.js":
101542
+ /*!**********************************************************************!*\
101543
+ !*** ../../core/ecschema-rpc/common/lib/esm/ECSchemaRpcInterface.js ***!
101544
+ \**********************************************************************/
101545
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
101546
+
101547
+ "use strict";
101548
+ __webpack_require__.r(__webpack_exports__);
101549
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
101550
+ /* harmony export */ ECSchemaRpcInterface: () => (/* binding */ ECSchemaRpcInterface)
101551
+ /* harmony export */ });
101552
+ /* harmony import */ var _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-common */ "../../core/common/lib/esm/core-common.js");
101553
+ var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
101554
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
101555
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
101556
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
101557
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
101558
+ };
101559
+ /*---------------------------------------------------------------------------------------------
101560
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
101561
+ * See LICENSE.md in the project root for license terms and full copyright notice.
101562
+ *--------------------------------------------------------------------------------------------*/
101563
+
101564
+ /***
101565
+ * Defines an RPC interface to get schema information from a given iModel context.
101566
+ * Method @see getSchemaNames will return the names of schemas that live in this iModel.
101567
+ * The actual schemas can be downloaded using @see getSchemaJSON to get the schema as JSON props.
101568
+ * @internal
101569
+ */
101570
+ class ECSchemaRpcInterface extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcInterface {
101571
+ /** The version of the RPC Interface. */
101572
+ static version = "2.0.0";
101573
+ static interfaceName = "ECSchemaRpcInterface";
101574
+ static interfaceVersion = ECSchemaRpcInterface.version;
101575
+ /**
101576
+ * Returns the RPC client instance for the frontend.
101577
+ * @returns A client to communicate with the RPC Interface.
101578
+ */
101579
+ static getClient() {
101580
+ return _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcManager.getClientForInterface(ECSchemaRpcInterface);
101581
+ }
101582
+ /**
101583
+ * Returns an array of SchemaKeyProps that exists in the current iModel context. The client can call
101584
+ * SchemaKey.fromJson() to parse the props to a SchemaKey.
101585
+ * @param tokenProps The iModelToken props that hold the information which iModel is used.
101586
+ * @returns An array of SchemaKeyProps.
101587
+ */
101588
+ async getSchemaKeys(_tokenProps) {
101589
+ return this.forward.apply(this, [arguments]);
101590
+ }
101591
+ /**
101592
+ * Gets the schema JSON for the current iModel context and returns the schema as a SchemaProps which
101593
+ * the client can call Schema.fromJson() to return a Schema.
101594
+ * @param tokenProps The iModelToken props that hold the information which iModel is used.
101595
+ * @param schemaName The name of the schema that shall be returned.
101596
+ * @returns The SchemaProps.
101597
+ */
101598
+ async getSchemaJSON(_tokenProps, _schemaName) {
101599
+ return this.forward.apply(this, [arguments]);
101600
+ }
101601
+ }
101602
+ __decorate([
101603
+ _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.allowResponseCaching(_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcResponseCacheControl.Immutable)
101604
+ ], ECSchemaRpcInterface.prototype, "getSchemaKeys", null);
101605
+ __decorate([
101606
+ _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.allowResponseCaching(_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcResponseCacheControl.Immutable)
101607
+ ], ECSchemaRpcInterface.prototype, "getSchemaJSON", null);
101608
+
101609
+
101610
+ /***/ }),
101611
+
101612
+ /***/ "../../core/ecschema-rpc/common/lib/esm/ECSchemaRpcLocater.js":
101613
+ /*!********************************************************************!*\
101614
+ !*** ../../core/ecschema-rpc/common/lib/esm/ECSchemaRpcLocater.js ***!
101615
+ \********************************************************************/
101616
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
101617
+
101618
+ "use strict";
101619
+ __webpack_require__.r(__webpack_exports__);
101620
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
101621
+ /* harmony export */ ECSchemaRpcLocater: () => (/* binding */ ECSchemaRpcLocater)
101622
+ /* harmony export */ });
101623
+ /* harmony import */ var _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/ecschema-metadata */ "../../core/ecschema-metadata/lib/esm/ecschema-metadata.js");
101624
+ /* harmony import */ var _ECSchemaRpcInterface__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ECSchemaRpcInterface */ "../../core/ecschema-rpc/common/lib/esm/ECSchemaRpcInterface.js");
101625
+ /*---------------------------------------------------------------------------------------------
101626
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
101627
+ * See LICENSE.md in the project root for license terms and full copyright notice.
101628
+ *--------------------------------------------------------------------------------------------*/
101629
+
101630
+
101631
+ /**
101632
+ * Defines a schema locater that retrieves schemas using an RPC interface.
101633
+ * @public @preview
101634
+ */
101635
+ class ECSchemaRpcLocater {
101636
+ /** @internal */
101637
+ token;
101638
+ constructor(token) { this.token = token; }
101639
+ /**
101640
+ * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.
101641
+ * @param schemaKey Key to look up
101642
+ * @param matchType How to match key against candidate schemas
101643
+ * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
101644
+ */
101645
+ async getSchema(schemaKey, matchType, context) {
101646
+ await this.getSchemaInfo(schemaKey, matchType, context);
101647
+ const schema = await context.getCachedSchema(schemaKey, matchType);
101648
+ return schema;
101649
+ }
101650
+ /**
101651
+ * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.
101652
+ * The fully loaded schema can be accessed via the schema context using the getCachedSchema method.
101653
+ * @param schemaKey The SchemaKey describing the schema to get from the cache.
101654
+ * @param matchType The match type to use when locating the schema
101655
+ */
101656
+ async getSchemaInfo(schemaKey, matchType, context) {
101657
+ const schemaJson = await _ECSchemaRpcInterface__WEBPACK_IMPORTED_MODULE_1__.ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name);
101658
+ const schemaInfo = await _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__.Schema.startLoadingFromJson(schemaJson, context || new _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__.SchemaContext());
101659
+ if (schemaInfo !== undefined && schemaInfo.schemaKey.matches(schemaKey, matchType)) {
101660
+ return schemaInfo;
101661
+ }
101662
+ return undefined;
101663
+ }
101664
+ /**
101665
+ * Attempts to get a schema from the schema rpc locater. Yields undefined if no matching schema is found.
101666
+ * @param schemaKey Key to look up
101667
+ * @param matchType How to match key against candidate schemas
101668
+ * @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
101669
+ */
101670
+ getSchemaSync(schemaKey, matchType, context) {
101671
+ const schemaJson = _ECSchemaRpcInterface__WEBPACK_IMPORTED_MODULE_1__.ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name).then((props) => {
101672
+ return props;
101673
+ });
101674
+ const schema = _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__.Schema.fromJsonSync(schemaJson, context || new _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__.SchemaContext());
101675
+ if (schema !== undefined && schema.schemaKey.matches(schemaKey, matchType)) {
101676
+ return schema;
101677
+ }
101678
+ return undefined;
101679
+ }
101680
+ }
101681
+
101682
+
101683
+ /***/ }),
101684
+
101685
+ /***/ "../../core/ecschema-rpc/common/lib/esm/ecschema-rpc-interface.js":
101686
+ /*!************************************************************************!*\
101687
+ !*** ../../core/ecschema-rpc/common/lib/esm/ecschema-rpc-interface.js ***!
101688
+ \************************************************************************/
101689
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
101690
+
101691
+ "use strict";
101692
+ __webpack_require__.r(__webpack_exports__);
101693
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
101694
+ /* harmony export */ ECSchemaRpcInterface: () => (/* reexport safe */ _ECSchemaRpcInterface__WEBPACK_IMPORTED_MODULE_0__.ECSchemaRpcInterface),
101695
+ /* harmony export */ ECSchemaRpcLocater: () => (/* reexport safe */ _ECSchemaRpcLocater__WEBPACK_IMPORTED_MODULE_1__.ECSchemaRpcLocater)
101696
+ /* harmony export */ });
101697
+ /* harmony import */ var _ECSchemaRpcInterface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ECSchemaRpcInterface */ "../../core/ecschema-rpc/common/lib/esm/ECSchemaRpcInterface.js");
101698
+ /* harmony import */ var _ECSchemaRpcLocater__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ECSchemaRpcLocater */ "../../core/ecschema-rpc/common/lib/esm/ECSchemaRpcLocater.js");
101699
+ /*---------------------------------------------------------------------------------------------
101700
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
101701
+ * See LICENSE.md in the project root for license terms and full copyright notice.
101702
+ *--------------------------------------------------------------------------------------------*/
101703
+
101704
+
101705
+
101706
+
101525
101707
  /***/ }),
101526
101708
 
101527
101709
  /***/ "../../core/frontend/lib/esm/AccuDraw.js":
@@ -113608,6 +113790,8 @@ __webpack_require__.r(__webpack_exports__);
113608
113790
  /* harmony import */ var _ViewState__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ViewState */ "../../core/frontend/lib/esm/ViewState.js");
113609
113791
  /* harmony import */ var _common_internal_Symbols__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./common/internal/Symbols */ "../../core/frontend/lib/esm/common/internal/Symbols.js");
113610
113792
  /* harmony import */ var _IpcApp__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./IpcApp */ "../../core/frontend/lib/esm/IpcApp.js");
113793
+ /* harmony import */ var _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @itwin/ecschema-metadata */ "../../core/ecschema-metadata/lib/esm/ecschema-metadata.js");
113794
+ /* harmony import */ var _itwin_ecschema_rpcinterface_common__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @itwin/ecschema-rpcinterface-common */ "../../core/ecschema-rpc/common/lib/esm/ecschema-rpc-interface.js");
113611
113795
  /*---------------------------------------------------------------------------------------------
113612
113796
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
113613
113797
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -113630,6 +113814,8 @@ __webpack_require__.r(__webpack_exports__);
113630
113814
 
113631
113815
 
113632
113816
 
113817
+
113818
+
113633
113819
  const loggerCategory = _common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_3__.FrontendLoggerCategory.IModelConnection;
113634
113820
  /** A connection to a [IModelDb]($backend) hosted on the backend.
113635
113821
  * @public
@@ -113712,6 +113898,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
113712
113898
  * @deprecated in 5.0.0. If you need font Ids on the front-end for some reason, write an Ipc method that queries [IModelDb.fonts]($backend).
113713
113899
  */
113714
113900
  fontMap; // eslint-disable-line @typescript-eslint/no-deprecated
113901
+ _schemaContext;
113715
113902
  /** Load the FontMap for this IModelConnection.
113716
113903
  * @returns Returns a Promise<FontMap> that is fulfilled when the FontMap member of this IModelConnection is valid.
113717
113904
  * @deprecated in 5.0.0. If you need font Ids on the front-end for some reason, write an Ipc method that queries [IModelDb.fonts]($backend).
@@ -114100,6 +114287,24 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
114100
114287
  }
114101
114288
  return ("number" === typeof this._projectCenterAltitude) ? this._projectCenterAltitude : undefined;
114102
114289
  }
114290
+ /**
114291
+ * Gets the context that allows accessing the metadata (see `@itwin/ecschema-metadata` package) of this iModel.
114292
+ * The context is created lazily when this property is accessed for the first time, with an `ECSchemaRpcLocater` registered as a fallback locater, enabling users to register their own locater that'd take more priority.
114293
+ * This means to correctly access schema context, client-side applications must register `ECSchemaRpcInterface` following instructions for [RPC configuration]($docs/learning/rpcinterface/#client-side-configuration).
114294
+ * Server-side applications would also [configure RPC]($docs/learning/rpcinterface/#server-side-configuration) as needed.
114295
+ *
114296
+ * @note While a `BlankConnection` returns a valid `schemaContext`, it has an invalid locater registered by default, and will throw an error when trying to call it's methods.
114297
+ * @beta
114298
+ */
114299
+ get schemaContext() {
114300
+ if (this._schemaContext === undefined) {
114301
+ const context = new _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_15__.SchemaContext();
114302
+ const locater = new _itwin_ecschema_rpcinterface_common__WEBPACK_IMPORTED_MODULE_16__.ECSchemaRpcLocater(this._getRpcProps());
114303
+ context.addFallbackLocater(locater);
114304
+ this._schemaContext = context;
114305
+ }
114306
+ return this._schemaContext;
114307
+ }
114103
114308
  }
114104
114309
  /** A connection that exists without an iModel. Useful for connecting to Reality Data services.
114105
114310
  * @note This class exists because our display system requires an IModelConnection type even if only reality data is drawn.
@@ -137627,12 +137832,7 @@ __webpack_require__.r(__webpack_exports__);
137627
137832
  * @internal
137628
137833
  */
137629
137834
  async function loadScript(jsUrl) {
137630
- // const module = await import(/* webpackIgnore: true */jsUrl);
137631
- // Webpack gives a warning:
137632
- // "Critical dependency: the request of a dependency is an expression"
137633
- // Because tsc transpiles "await import" to "require" (when compiled to is CommonJS).
137634
- // So use FunctionConstructor to avoid tsc.
137635
- const module = await Function("x", "return import(x)")(jsUrl);
137835
+ const module = await __webpack_require__("../../core/frontend/lib/esm/extension/providers lazy recursive")(jsUrl);
137636
137836
  return execute(module);
137637
137837
  }
137638
137838
  /** attempts to execute an extension module */
@@ -147425,7 +147625,7 @@ class MeshGraphic extends _Graphic__WEBPACK_IMPORTED_MODULE_2__.Graphic {
147425
147625
  }
147426
147626
  unionRange(range) {
147427
147627
  if (this._instances)
147428
- range.extendRange(range);
147628
+ range.extendRange(this._instances.range);
147429
147629
  else
147430
147630
  range.extendRange(this._meshRange);
147431
147631
  }
@@ -170568,6 +170768,7 @@ class GraphicsCollectorDrawArgs extends _tile_internal__WEBPACK_IMPORTED_MODULE_
170568
170768
  return undefined;
170569
170769
  return new GraphicsCollectorDrawArgs(planes, worldToViewMap, collector, args);
170570
170770
  }
170771
+ get shouldCollectClassifierGraphics() { return false; }
170571
170772
  }
170572
170773
 
170573
170774
 
@@ -170838,6 +171039,7 @@ class IModelTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_4__.Tile {
170838
171039
  if (format !== _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileFormat.IModel)
170839
171040
  return content;
170840
171041
  const sizeMultiplier = this.hasSizeMultiplier ? this.sizeMultiplier : undefined;
171042
+ const ecefTransform = this.tree.iModel.isGeoLocated ? this.tree.iModel.getEcefTransform() : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
170841
171043
  try {
170842
171044
  content = await this.iModelTree.decoder.decode({
170843
171045
  stream: streamBuffer,
@@ -170846,7 +171048,7 @@ class IModelTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_4__.Tile {
170846
171048
  isCanceled,
170847
171049
  sizeMultiplier,
170848
171050
  tileData: {
170849
- ecefTransform: this.tree.iModel.ecefLocation?.getTransform() ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity(),
171051
+ ecefTransform,
170850
171052
  range: this.range,
170851
171053
  layerClassifiers: this.tree.layerHandler?.layerClassifiers,
170852
171054
  },
@@ -171555,7 +171757,8 @@ class IModelTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_6__.TileTre
171555
171757
  draw(args) {
171556
171758
  const tiles = this.selectTiles(args);
171557
171759
  this._rootTile.draw(args, tiles, this._numStaticTilesSelected);
171558
- this._layerHandler.collectClassifierGraphics(args, tiles);
171760
+ if (args.shouldCollectClassifierGraphics)
171761
+ this._layerHandler.collectClassifierGraphics(args, tiles);
171559
171762
  }
171560
171763
  prune() {
171561
171764
  const olderThan = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.now().minus(this.expirationTime);
@@ -172687,14 +172890,12 @@ class LayerTileTreeReferenceHandler {
172687
172890
  removals.push(context.viewport.displayStyle.settings.onMapImageryChanged.addListener((imagery) => {
172688
172891
  this.setBaseLayerSettings(imagery.backgroundBase);
172689
172892
  this.setLayerSettings(imagery.backgroundLayers);
172690
- this.clearLayers();
172691
172893
  }));
172692
172894
  }
172693
172895
  removals.push(context.viewport.onChangeView.addListener((vp, previousViewState) => {
172694
172896
  if ((0,_tile_internal__WEBPACK_IMPORTED_MODULE_1__.compareMapLayer)(previousViewState, vp.view)) {
172695
172897
  this.setBaseLayerSettings(mapImagery.backgroundBase);
172696
172898
  this.setLayerSettings(mapImagery.backgroundLayers);
172697
- this.clearLayers();
172698
172899
  }
172699
172900
  }));
172700
172901
  }
@@ -175362,8 +175563,9 @@ class RealityTileLoader {
175362
175563
  isCanceled = () => !tile.isLoading;
175363
175564
  const { is3d, yAxisUp, iModel, modelId } = tile.realityRoot;
175364
175565
  let reader;
175566
+ const ecefTransform = tile.tree.iModel.isGeoLocated ? tile.tree.iModel.getEcefTransform() : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
175365
175567
  const tileData = {
175366
- ecefTransform: tile.tree.iModel.ecefLocation?.getTransform() ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity(),
175568
+ ecefTransform,
175367
175569
  range: tile.range,
175368
175570
  layerClassifiers: tile.tree.layerHandler?.layerClassifiers,
175369
175571
  };
@@ -186678,7 +186880,7 @@ class RealityTileTree extends _internal__WEBPACK_IMPORTED_MODULE_6__.TileTree {
186678
186880
  sortIndices = selectedTiles.map((_x, i) => i);
186679
186881
  sortIndices.sort((a, b) => selectedTiles[a].depth - selectedTiles[b].depth);
186680
186882
  }
186681
- if (!(args instanceof _internal__WEBPACK_IMPORTED_MODULE_6__.GraphicsCollectorDrawArgs))
186883
+ if (args.shouldCollectClassifierGraphics)
186682
186884
  this.collectClassifierGraphics(args, selectedTiles);
186683
186885
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(selectedTiles.length === displayedTileDescendants.length);
186684
186886
  for (let i = 0; i < selectedTiles.length; i++) {
@@ -188832,6 +189034,8 @@ class TileDrawArgs {
188832
189034
  processSelectedTiles(_tiles) { }
188833
189035
  /* @internal */
188834
189036
  get maxRealityTreeSelectionCount() { return undefined; }
189037
+ /* @internal */
189038
+ get shouldCollectClassifierGraphics() { return true; }
188835
189039
  }
188836
189040
 
188837
189041
 
@@ -233452,15 +233656,15 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
233452
233656
  _activeMomentData;
233453
233657
  _point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
233454
233658
  _point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
233455
- /** Accumulate (independent) integrations over
233456
- * * origin to chord of the arc.
233457
- * * origin to the "cap" between the chord and arc.
233659
+ /**
233660
+ * Accumulate (independent) integrations over:
233661
+ * * The area between the arc and the chord connecting its endpoints.
233662
+ * * The triangle with vertices: origin, arc start, arc end.
233458
233663
  */
233459
233664
  handleArc3d(arc) {
233460
233665
  const momentData = this._activeMomentData;
233461
233666
  const sweepRadians = arc.sweep.sweepRadians;
233462
233667
  const alphaRadians = sweepRadians * 0.5;
233463
- // from https://apps.dtic.mil/dtic/tr/fulltext/u2/274936.pdf page 71 for radius = 1
233464
233668
  let s = Math.sin(alphaRadians);
233465
233669
  let c = Math.cos(alphaRadians);
233466
233670
  let s1 = Math.sin(sweepRadians);
@@ -233487,12 +233691,12 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
233487
233691
  const pointC = arc.fractionToPoint(1.0);
233488
233692
  momentData.accumulateTriangleMomentsXY(undefined, pointB, pointC);
233489
233693
  }
233490
- /** Accumulate integrals over the (triangular) areas from the origin to each line segment */
233694
+ /** Accumulate integrals over the (triangular) areas from the origin to each line segment. */
233491
233695
  handleLineString3d(ls) {
233492
233696
  const momentData = this._activeMomentData;
233493
233697
  momentData.accumulateTriangleToLineStringMomentsXY(undefined, ls.packedPoints);
233494
233698
  }
233495
- /** Accumulate integrals over the (triangular) area from the origin to this line segment */
233699
+ /** Accumulate integrals over the (triangular) area from the origin to this line segment. */
233496
233700
  handleLineSegment3d(segment) {
233497
233701
  const momentData = this._activeMomentData;
233498
233702
  segment.startPoint(this._point0);
@@ -233508,15 +233712,7 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
233508
233712
  this._activeMomentData = undefined;
233509
233713
  return momentData;
233510
233714
  }
233511
- /**
233512
- * ASSUMPTIONS FOR ORIENTATION AND CONTAINMENT ISSUES
233513
- * * Largest area is outer
233514
- * * All others are interior (and not overlapping)
233515
- * Hence
233516
- * * Outer area sign must be positive -- negate all integrations as needed
233517
- * * Outer area signs must be positive -- negate all integrations as needed
233518
- * @param region
233519
- */
233715
+ /** Accumulate integrals from origin to the components of the parity region. */
233520
233716
  handleParityRegion(region) {
233521
233717
  const allChildMoments = [];
233522
233718
  let maxAbsArea = 0.0;
@@ -233548,7 +233744,7 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
233548
233744
  }
233549
233745
  return undefined;
233550
233746
  }
233551
- /** Accumulate (as simple addition) products over each component of the union region. */
233747
+ /** Accumulate integrals from origin to the components of the union region. */
233552
233748
  handleUnionRegion(region) {
233553
233749
  const summedMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__.MomentData.create();
233554
233750
  for (const child of region.children) {
@@ -233570,9 +233766,9 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
233570
233766
  this._strokeOptions = options;
233571
233767
  return options;
233572
233768
  }
233573
- /** Single curve primitive (not loop . . .).
233574
- * * stroke the curve
233575
- * * accumulate stroke array.
233769
+ /**
233770
+ * Handle a single curve primitive (not loop).
233771
+ * * Stroke the curve and accumulate stroke array.
233576
233772
  */
233577
233773
  handleCurvePrimitive(cp) {
233578
233774
  const strokes = _LineString3d__WEBPACK_IMPORTED_MODULE_6__.LineString3d.create();
@@ -233580,12 +233776,18 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
233580
233776
  cp.emitStrokes(strokes, options);
233581
233777
  this.handleLineString3d(strokes);
233582
233778
  }
233583
- /** handle strongly typed BSplineCurve3d as generic curve primitive */
233584
- handleBSplineCurve3d(g) { return this.handleCurvePrimitive(g); }
233585
- /** handle strongly typed BSplineCurve3dH as generic curve primitive */
233586
- handleBSplineCurve3dH(g) { return this.handleCurvePrimitive(g); }
233587
- /** handle strongly typed TransitionSpiral as generic curve primitive */
233588
- handleTransitionSpiral(g) { return this.handleCurvePrimitive(g); }
233779
+ /** Handle strongly typed BSplineCurve3d as generic curve primitive. */
233780
+ handleBSplineCurve3d(g) {
233781
+ return this.handleCurvePrimitive(g);
233782
+ }
233783
+ /** Handle strongly typed BSplineCurve3dH as generic curve primitive. */
233784
+ handleBSplineCurve3dH(g) {
233785
+ return this.handleCurvePrimitive(g);
233786
+ }
233787
+ /** Handle strongly typed TransitionSpiral as generic curve primitive. */
233788
+ handleTransitionSpiral(g) {
233789
+ return this.handleCurvePrimitive(g);
233790
+ }
233589
233791
  }
233590
233792
 
233591
233793
 
@@ -233605,41 +233807,43 @@ __webpack_require__.r(__webpack_exports__);
233605
233807
  /* harmony export */ RegionOps: () => (/* binding */ RegionOps)
233606
233808
  /* harmony export */ });
233607
233809
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
233608
- /* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
233609
- /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
233610
- /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
233611
- /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
233612
- /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
233613
- /* harmony import */ var _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../geometry3d/PolylineCompressionByEdgeOffset */ "../../core/geometry/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js");
233614
- /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
233615
- /* harmony import */ var _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/SortablePolygon */ "../../core/geometry/lib/esm/geometry3d/SortablePolygon.js");
233616
- /* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
233810
+ /* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
233811
+ /* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
233812
+ /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
233813
+ /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
233814
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
233815
+ /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
233816
+ /* harmony import */ var _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/PolylineCompressionByEdgeOffset */ "../../core/geometry/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js");
233817
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
233818
+ /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
233819
+ /* harmony import */ var _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../geometry3d/SortablePolygon */ "../../core/geometry/lib/esm/geometry3d/SortablePolygon.js");
233820
+ /* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
233617
233821
  /* harmony import */ var _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry4d/MomentData */ "../../core/geometry/lib/esm/geometry4d/MomentData.js");
233618
- /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
233619
- /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
233620
- /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
233621
- /* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
233622
- /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
233623
- /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
233624
- /* harmony import */ var _CurveCurve__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./CurveCurve */ "../../core/geometry/lib/esm/curve/CurveCurve.js");
233625
- /* harmony import */ var _CurveOps__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
233626
- /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
233822
+ /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
233823
+ /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
233824
+ /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
233825
+ /* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
233826
+ /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
233827
+ /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
233828
+ /* harmony import */ var _CurveCurve__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./CurveCurve */ "../../core/geometry/lib/esm/curve/CurveCurve.js");
233829
+ /* harmony import */ var _CurveOps__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
233830
+ /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
233627
233831
  /* harmony import */ var _CurveWireMomentsXYZ__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CurveWireMomentsXYZ */ "../../core/geometry/lib/esm/curve/CurveWireMomentsXYZ.js");
233628
- /* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
233629
- /* harmony import */ var _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./internalContexts/ChainCollectorContext */ "../../core/geometry/lib/esm/curve/internalContexts/ChainCollectorContext.js");
233630
- /* harmony import */ var _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./internalContexts/PolygonOffsetContext */ "../../core/geometry/lib/esm/curve/internalContexts/PolygonOffsetContext.js");
233631
- /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
233632
- /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
233633
- /* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
233634
- /* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
233635
- /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
233636
- /* harmony import */ var _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./Query/ConsolidateAdjacentPrimitivesContext */ "../../core/geometry/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js");
233637
- /* harmony import */ var _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./Query/CurveSplitContext */ "../../core/geometry/lib/esm/curve/Query/CurveSplitContext.js");
233638
- /* harmony import */ var _Query_InOutTests__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Query/InOutTests */ "../../core/geometry/lib/esm/curve/Query/InOutTests.js");
233639
- /* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
233832
+ /* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
233833
+ /* harmony import */ var _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./internalContexts/ChainCollectorContext */ "../../core/geometry/lib/esm/curve/internalContexts/ChainCollectorContext.js");
233834
+ /* harmony import */ var _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./internalContexts/PolygonOffsetContext */ "../../core/geometry/lib/esm/curve/internalContexts/PolygonOffsetContext.js");
233835
+ /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
233836
+ /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
233837
+ /* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
233838
+ /* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
233839
+ /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
233840
+ /* harmony import */ var _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./Query/ConsolidateAdjacentPrimitivesContext */ "../../core/geometry/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js");
233841
+ /* harmony import */ var _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./Query/CurveSplitContext */ "../../core/geometry/lib/esm/curve/Query/CurveSplitContext.js");
233842
+ /* harmony import */ var _Query_InOutTests__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Query/InOutTests */ "../../core/geometry/lib/esm/curve/Query/InOutTests.js");
233843
+ /* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
233640
233844
  /* harmony import */ var _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RegionMomentsXY */ "../../core/geometry/lib/esm/curve/RegionMomentsXY.js");
233641
- /* harmony import */ var _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./RegionOpsClassificationSweeps */ "../../core/geometry/lib/esm/curve/RegionOpsClassificationSweeps.js");
233642
- /* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
233845
+ /* harmony import */ var _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./RegionOpsClassificationSweeps */ "../../core/geometry/lib/esm/curve/RegionOpsClassificationSweeps.js");
233846
+ /* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
233643
233847
  /*---------------------------------------------------------------------------------------------
233644
233848
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
233645
233849
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -233680,6 +233884,8 @@ __webpack_require__.r(__webpack_exports__);
233680
233884
 
233681
233885
 
233682
233886
 
233887
+
233888
+
233683
233889
 
233684
233890
 
233685
233891
 
@@ -233709,13 +233915,16 @@ var RegionBinaryOpType;
233709
233915
  class RegionOps {
233710
233916
  /**
233711
233917
  * Return moment sums for a loop, parity region, or union region.
233918
+ * * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
233712
233919
  * * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
233713
- * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
233714
- * @param root any Loop, ParityRegion, or UnionRegion.
233920
+ * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes(rawMomentData.origin, rawMomentData.sums);`
233921
+ * * `rawMomentData.origin` is the centroid of `region`.
233922
+ * * `rawMomentData.sums.weight()` is the signed area of `region`.
233923
+ * @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
233715
233924
  */
233716
- static computeXYAreaMoments(root) {
233925
+ static computeXYAreaMoments(region) {
233717
233926
  const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__.RegionMomentsXY();
233718
- const result = root.dispatchToGeometryHandler(handler);
233927
+ const result = region.dispatchToGeometryHandler(handler);
233719
233928
  if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__.MomentData) {
233720
233929
  result.shiftOriginAndSumsToCentroidOfSums();
233721
233930
  return result;
@@ -233724,8 +233933,8 @@ class RegionOps {
233724
233933
  }
233725
233934
  /**
233726
233935
  * Return an area tolerance for a given xy-range and optional distance tolerance.
233727
- * @param range range of planar region to tolerance
233728
- * @param distanceTolerance optional absolute distance tolerance
233936
+ * @param range range of planar region to tolerance.
233937
+ * @param distanceTolerance optional absolute distance tolerance.
233729
233938
  */
233730
233939
  static computeXYAreaTolerance(range, distanceTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
233731
233940
  // if A = bh and e is distance tolerance, then A' := (b+e/2)(h+e/2) = A + e/2(b+h+e/2), so A'-A = e/2(b+h+e/2).
@@ -233734,12 +233943,13 @@ class RegionOps {
233734
233943
  }
233735
233944
  /**
233736
233945
  * Return a (signed) xy area for a region.
233946
+ * * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
233737
233947
  * * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
233738
- * @param root any Loop, ParityRegion, or UnionRegion.
233948
+ * @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
233739
233949
  */
233740
- static computeXYArea(root) {
233950
+ static computeXYArea(region) {
233741
233951
  const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__.RegionMomentsXY();
233742
- const result = root.dispatchToGeometryHandler(handler);
233952
+ const result = region.dispatchToGeometryHandler(handler);
233743
233953
  if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__.MomentData) {
233744
233954
  return result.quantitySum;
233745
233955
  }
@@ -233747,49 +233957,88 @@ class RegionOps {
233747
233957
  }
233748
233958
  /**
233749
233959
  * Return MomentData with the sums of wire moments.
233960
+ * * The input curve should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
233750
233961
  * * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
233751
- * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
233752
- * @param root any CurveCollection or CurvePrimitive.
233962
+ * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
233963
+ * * `rawMomentData.origin` is the wire centroid of `curve`.
233964
+ * * `rawMomentData.sums.weight()` is the signed length of `curve`.
233965
+ * @param curve any [[CurveCollection]] or [[CurvePrimitive]].
233753
233966
  */
233754
- static computeXYZWireMomentSums(root) {
233967
+ static computeXYZWireMomentSums(curve) {
233755
233968
  const handler = new _CurveWireMomentsXYZ__WEBPACK_IMPORTED_MODULE_3__.CurveWireMomentsXYZ();
233756
- handler.visitLeaves(root);
233969
+ handler.visitLeaves(curve);
233757
233970
  const result = handler.momentData;
233758
233971
  result.shiftOriginAndSumsToCentroidOfSums();
233759
233972
  return result;
233760
233973
  }
233974
+ /**
233975
+ * Return a [[Ray3d]] with:
233976
+ * * `origin` is the centroid of the region,
233977
+ * * `direction` is a unit vector perpendicular to the region plane,
233978
+ * * `a` is the region area.
233979
+ * @param region the region to process. Can lie in any plane.
233980
+ * @param result optional pre-allocated result to populate and return.
233981
+ */
233982
+ static centroidAreaNormal(region, result) {
233983
+ const localToWorld = _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_4__.FrameBuilder.createRightHandedFrame(undefined, region);
233984
+ if (!localToWorld)
233985
+ return undefined;
233986
+ const normal = localToWorld.matrix.columnZ(result?.direction);
233987
+ const regionIsXY = normal.isParallelTo(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Vector3d.unitZ(), true);
233988
+ let regionXY = region;
233989
+ if (!regionIsXY) { // rotate the region to be parallel to the xy-plane
233990
+ regionXY = region.cloneTransformed(localToWorld.inverse());
233991
+ if (!regionXY)
233992
+ return undefined;
233993
+ }
233994
+ const momentData = RegionOps.computeXYAreaMoments(regionXY);
233995
+ if (!momentData)
233996
+ return undefined;
233997
+ const centroid = momentData.origin.clone(result?.origin);
233998
+ if (!regionIsXY) // rotate centroid back (area is unchanged)
233999
+ localToWorld.multiplyPoint3d(centroid, centroid);
234000
+ let area = momentData.sums.weight();
234001
+ if (area < 0.0) {
234002
+ area = -area;
234003
+ normal.scale(-1.0, normal);
234004
+ }
234005
+ if (!result)
234006
+ result = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__.Ray3d.createCapture(centroid, normal);
234007
+ result.a = area;
234008
+ return result;
234009
+ }
233761
234010
  /**
233762
234011
  * Create loops in the graph.
233763
234012
  * @internal
233764
234013
  */
233765
234014
  static addLoopsToGraph(graph, data, announceIsolatedLoop) {
233766
- if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop) {
234015
+ if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop) {
233767
234016
  const points = data.getPackedStrokes();
233768
234017
  if (points)
233769
234018
  this.addLoopsToGraph(graph, points, announceIsolatedLoop);
233770
234019
  }
233771
- else if (data instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_5__.ParityRegion) {
234020
+ else if (data instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
233772
234021
  for (const child of data.children) {
233773
234022
  const points = child.getPackedStrokes();
233774
234023
  if (points)
233775
234024
  this.addLoopsToGraph(graph, points, announceIsolatedLoop);
233776
234025
  }
233777
234026
  }
233778
- else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
233779
- const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
234027
+ else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
234028
+ const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
233780
234029
  if (loopSeed !== undefined)
233781
234030
  announceIsolatedLoop(graph, loopSeed);
233782
234031
  }
233783
234032
  else if (Array.isArray(data)) {
233784
234033
  if (data.length > 0) {
233785
- if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__.Point3d.isAnyImmediatePointType(data[0])) {
233786
- const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
234034
+ if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.isAnyImmediatePointType(data[0])) {
234035
+ const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
233787
234036
  if (loopSeed !== undefined)
233788
234037
  announceIsolatedLoop(graph, loopSeed);
233789
234038
  }
233790
- else if (data[0] instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
234039
+ else if (data[0] instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
233791
234040
  for (const loop of data) {
233792
- const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.directCreateFaceLoopFromCoordinates(graph, loop);
234041
+ const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, loop);
233793
234042
  if (loopSeed !== undefined)
233794
234043
  announceIsolatedLoop(graph, loopSeed);
233795
234044
  }
@@ -233829,10 +234078,10 @@ class RegionOps {
233829
234078
  static finishGraphToPolyface(graph, triangulate) {
233830
234079
  if (graph) {
233831
234080
  if (triangulate) {
233832
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.triangulateAllPositiveAreaFaces(graph);
233833
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.flipTriangles(graph);
234081
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.triangulateAllPositiveAreaFaces(graph);
234082
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
233834
234083
  }
233835
- return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_9__.PolyfaceBuilder.graphToPolyface(graph);
234084
+ return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__.PolyfaceBuilder.graphToPolyface(graph);
233836
234085
  }
233837
234086
  return undefined;
233838
234087
  }
@@ -233846,7 +234095,7 @@ class RegionOps {
233846
234095
  * @param triangulate whether to triangulate the result
233847
234096
  */
233848
234097
  static polygonXYAreaIntersectLoopsToPolyface(loopsA, loopsB, triangulate = false) {
233849
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && inB), this._graphCheckPointFunction);
234098
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && inB), this._graphCheckPointFunction);
233850
234099
  return this.finishGraphToPolyface(graph, triangulate);
233851
234100
  }
233852
234101
  /**
@@ -233859,7 +234108,7 @@ class RegionOps {
233859
234108
  * @param triangulate whether to triangulate the result
233860
234109
  */
233861
234110
  static polygonXYAreaUnionLoopsToPolyface(loopsA, loopsB, triangulate = false) {
233862
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA || inB), this._graphCheckPointFunction);
234111
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA || inB), this._graphCheckPointFunction);
233863
234112
  return this.finishGraphToPolyface(graph, triangulate);
233864
234113
  }
233865
234114
  /**
@@ -233872,7 +234121,7 @@ class RegionOps {
233872
234121
  * @param triangulate whether to triangulate the result
233873
234122
  */
233874
234123
  static polygonXYAreaDifferenceLoopsToPolyface(loopsA, loopsB, triangulate = false) {
233875
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && !inB), this._graphCheckPointFunction);
234124
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && !inB), this._graphCheckPointFunction);
233876
234125
  return this.finishGraphToPolyface(graph, triangulate);
233877
234126
  }
233878
234127
  /**
@@ -233889,8 +234138,8 @@ class RegionOps {
233889
234138
  static regionBooleanXY(loopsA, loopsB, operation, mergeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
233890
234139
  // Always return UnionRegion for now. But keep return type as AnyRegion:
233891
234140
  // in the future, we might return the *simplest* region type.
233892
- const result = _UnionRegion__WEBPACK_IMPORTED_MODULE_11__.UnionRegion.create();
233893
- const context = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionBooleanContext.create(_RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union);
234141
+ const result = _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion.create();
234142
+ const context = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionBooleanContext.create(_RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union);
233894
234143
  context.addMembers(loopsA, loopsB);
233895
234144
  context.annotateAndMergeCurvesInGraph(mergeTolerance);
233896
234145
  const range = context.groupA.range().union(context.groupB.range());
@@ -233902,7 +234151,7 @@ class RegionOps {
233902
234151
  if (Math.abs(area) < areaTol)
233903
234152
  return;
233904
234153
  if (faceType === 1) {
233905
- const loop = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__.PlanarSubdivision.createLoopInFace(face);
234154
+ const loop = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.createLoopInFace(face);
233906
234155
  if (loop)
233907
234156
  result.tryAddChild(loop);
233908
234157
  }
@@ -233922,7 +234171,7 @@ class RegionOps {
233922
234171
  * @param triangulate whether to triangulate the result
233923
234172
  */
233924
234173
  static polygonBooleanXYToPolyface(inputA, operation, inputB, triangulate = false) {
233925
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doBinaryBooleanBetweenMultiLoopInputs(inputA, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union, operation, inputB, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union, true);
234174
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doBinaryBooleanBetweenMultiLoopInputs(inputA, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, operation, inputB, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, true);
233926
234175
  return this.finishGraphToPolyface(graph, triangulate);
233927
234176
  }
233928
234177
  /**
@@ -233937,18 +234186,18 @@ class RegionOps {
233937
234186
  * @param inputB second set of loops
233938
234187
  */
233939
234188
  static polygonBooleanXYToLoops(inputA, operation, inputB) {
233940
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doBinaryBooleanBetweenMultiLoopInputs(inputA, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union, operation, inputB, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union, true);
234189
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doBinaryBooleanBetweenMultiLoopInputs(inputA, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, operation, inputB, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, true);
233941
234190
  if (!graph)
233942
234191
  return undefined;
233943
- const loopEdges = _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_13__.HalfEdgeGraphSearch.collectExtendedBoundaryLoopsInGraph(graph, _topology_Graph__WEBPACK_IMPORTED_MODULE_14__.HalfEdgeMask.EXTERIOR);
234192
+ const loopEdges = _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_15__.HalfEdgeGraphSearch.collectExtendedBoundaryLoopsInGraph(graph, _topology_Graph__WEBPACK_IMPORTED_MODULE_16__.HalfEdgeMask.EXTERIOR);
233944
234193
  const allLoops = [];
233945
234194
  for (const graphLoop of loopEdges) {
233946
- const points = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray();
234195
+ const points = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray();
233947
234196
  for (const edge of graphLoop)
233948
234197
  points.pushXYZ(edge.x, edge.y, edge.z);
233949
234198
  points.pushWrap(1);
233950
- const loop = _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.create();
233951
- loop.tryAddChild(_LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d.createCapture(points));
234199
+ const loop = _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.create();
234200
+ loop.tryAddChild(_LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d.createCapture(points));
233952
234201
  allLoops.push(loop);
233953
234202
  }
233954
234203
  return RegionOps.sortOuterAndHoleLoopsXY(allLoops);
@@ -233966,7 +234215,7 @@ class RegionOps {
233966
234215
  * object.
233967
234216
  */
233968
234217
  static constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions) {
233969
- const context = new _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_17__.PolygonWireOffsetContext();
234218
+ const context = new _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_19__.PolygonWireOffsetContext();
233970
234219
  return context.constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions);
233971
234220
  }
233972
234221
  /**
@@ -233978,8 +234227,8 @@ class RegionOps {
233978
234227
  * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
233979
234228
  */
233980
234229
  static constructCurveXYOffset(curves, offsetDistanceOrOptions) {
233981
- const offsetOptions = _OffsetOptions__WEBPACK_IMPORTED_MODULE_18__.OffsetOptions.create(offsetDistanceOrOptions);
233982
- return _CurveOps__WEBPACK_IMPORTED_MODULE_19__.CurveOps.constructCurveXYOffset(curves, offsetOptions);
234230
+ const offsetOptions = _OffsetOptions__WEBPACK_IMPORTED_MODULE_20__.OffsetOptions.create(offsetDistanceOrOptions);
234231
+ return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.constructCurveXYOffset(curves, offsetOptions);
233983
234232
  }
233984
234233
  /**
233985
234234
  * Test if point (x,y) is IN, OUT or ON a region.
@@ -233989,7 +234238,7 @@ class RegionOps {
233989
234238
  * @param y y coordinate of point to test
233990
234239
  */
233991
234240
  static testPointInOnOutRegionXY(curves, x, y) {
233992
- return _Query_InOutTests__WEBPACK_IMPORTED_MODULE_20__.PointInOnOutContext.testPointInOnOutRegionXY(curves, x, y);
234241
+ return _Query_InOutTests__WEBPACK_IMPORTED_MODULE_22__.PointInOnOutContext.testPointInOnOutRegionXY(curves, x, y);
233993
234242
  }
233994
234243
  /**
233995
234244
  * Create curve collection of subtype determined by gaps between the input curves.
@@ -234013,11 +234262,11 @@ class RegionOps {
234013
234262
  maxGap = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.maxXY(maxGap, curves[i].endPoint().distance(curves[i + 1].startPoint()));
234014
234263
  let collection;
234015
234264
  if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(maxGap)) {
234016
- collection = wrap ? _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.create() : _Path__WEBPACK_IMPORTED_MODULE_21__.Path.create();
234265
+ collection = wrap ? _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.create() : _Path__WEBPACK_IMPORTED_MODULE_23__.Path.create();
234017
234266
  isPath = true;
234018
234267
  }
234019
234268
  else {
234020
- collection = _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.BagOfCurves.create();
234269
+ collection = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.BagOfCurves.create();
234021
234270
  }
234022
234271
  for (const c of curves)
234023
234272
  collection.tryAddChild(c);
@@ -234043,7 +234292,7 @@ class RegionOps {
234043
234292
  * @param cutterCurves input curves to intersect with `curvesToCut`
234044
234293
  */
234045
234294
  static cloneCurvesWithXYSplits(curvesToCut, cutterCurves) {
234046
- return _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_23__.CurveSplitContext.cloneCurvesWithXYSplits(curvesToCut, cutterCurves);
234295
+ return _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_25__.CurveSplitContext.cloneCurvesWithXYSplits(curvesToCut, cutterCurves);
234047
234296
  }
234048
234297
  /**
234049
234298
  * Create paths assembled from many curves.
@@ -234054,11 +234303,11 @@ class RegionOps {
234054
234303
  static splitToPathsBetweenBreaks(source, makeClones) {
234055
234304
  if (source === undefined)
234056
234305
  return undefined;
234057
- if (source instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__.CurvePrimitive)
234306
+ if (source instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive)
234058
234307
  return source;
234059
234308
  // source is a collection . ..
234060
234309
  const primitives = source.collectCurvePrimitives();
234061
- const chainCollector = new _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_25__.ChainCollectorContext(makeClones);
234310
+ const chainCollector = new _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_27__.ChainCollectorContext(makeClones);
234062
234311
  for (const primitive of primitives) {
234063
234312
  chainCollector.announceCurvePrimitive(primitive);
234064
234313
  }
@@ -234074,7 +234323,7 @@ class RegionOps {
234074
234323
  * @returns object with named chains, insideOffsets, outsideOffsets
234075
234324
  */
234076
234325
  static collectInsideAndOutsideOffsets(fragments, offsetDistance, gapTolerance) {
234077
- return _CurveOps__WEBPACK_IMPORTED_MODULE_19__.CurveOps.collectInsideAndOutsideXYOffsets(fragments, offsetDistance, gapTolerance);
234326
+ return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.collectInsideAndOutsideXYOffsets(fragments, offsetDistance, gapTolerance);
234078
234327
  }
234079
234328
  /**
234080
234329
  * Restructure curve fragments as Paths and Loops.
@@ -234083,7 +234332,7 @@ class RegionOps {
234083
234332
  * @returns chains, possibly wrapped in a [[BagOfCurves]].
234084
234333
  */
234085
234334
  static collectChains(fragments, gapTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
234086
- return _CurveOps__WEBPACK_IMPORTED_MODULE_19__.CurveOps.collectChains(fragments, gapTolerance);
234335
+ return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.collectChains(fragments, gapTolerance);
234087
234336
  }
234088
234337
  /**
234089
234338
  * Find all intersections among curves in `curvesToCut` against the boundaries of `region` and return fragments
@@ -234095,17 +234344,17 @@ class RegionOps {
234095
234344
  const result = { insideParts: [], outsideParts: [], coincidentParts: [] };
234096
234345
  const pathWithIntersectionMarkup = RegionOps.cloneCurvesWithXYSplits(curvesToCut, region);
234097
234346
  const splitPaths = RegionOps.splitToPathsBetweenBreaks(pathWithIntersectionMarkup, true);
234098
- if (splitPaths instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection) {
234347
+ if (splitPaths instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection) {
234099
234348
  for (const child of splitPaths.children) {
234100
- const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(child);
234349
+ const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(child);
234101
234350
  if (pointOnChild) {
234102
234351
  const inOnOut = RegionOps.testPointInOnOutRegionXY(region, pointOnChild.point.x, pointOnChild.point.y);
234103
234352
  pushToInOnOutArrays(child, inOnOut, result.outsideParts, result.coincidentParts, result.insideParts);
234104
234353
  }
234105
234354
  }
234106
234355
  }
234107
- else if (splitPaths instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__.CurvePrimitive) {
234108
- const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(splitPaths);
234356
+ else if (splitPaths instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive) {
234357
+ const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(splitPaths);
234109
234358
  if (pointOnChild) {
234110
234359
  const inOnOut = RegionOps.testPointInOnOutRegionXY(region, pointOnChild.point.x, pointOnChild.point.y);
234111
234360
  pushToInOnOutArrays(splitPaths, inOnOut, result.outsideParts, result.coincidentParts, result.insideParts);
@@ -234129,10 +234378,10 @@ class RegionOps {
234129
234378
  * normal in z column. If not a rectangle, return undefined.
234130
234379
  */
234131
234380
  static rectangleEdgeTransform(data, requireClosurePoint = true) {
234132
- if (data instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
234381
+ if (data instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
234133
234382
  return this.rectangleEdgeTransform(data.packedPoints);
234134
234383
  }
234135
- else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
234384
+ else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
234136
234385
  let dataToUse;
234137
234386
  if (requireClosurePoint && data.length === 5) {
234138
234387
  if (!_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(data.distanceIndexIndex(0, 4)))
@@ -234146,8 +234395,8 @@ class RegionOps {
234146
234395
  return undefined;
234147
234396
  }
234148
234397
  else {
234149
- dataToUse = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray.create(data);
234150
- _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_26__.PolylineCompressionContext.compressInPlaceByShortEdgeLength(dataToUse, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
234398
+ dataToUse = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(data);
234399
+ _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_28__.PolylineCompressionContext.compressInPlaceByShortEdgeLength(dataToUse, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
234151
234400
  if (dataToUse.length < (requireClosurePoint ? 5 : 4))
234152
234401
  return undefined;
234153
234402
  }
@@ -234158,19 +234407,19 @@ class RegionOps {
234158
234407
  if (normalVector.normalizeInPlace()
234159
234408
  && vector12.isAlmostEqual(vector03)
234160
234409
  && vector01.isPerpendicularTo(vector03)) {
234161
- return _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_27__.Transform.createOriginAndMatrixColumns(dataToUse.getPoint3dAtUncheckedPointIndex(0), vector01, vector03, normalVector);
234410
+ return _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_29__.Transform.createOriginAndMatrixColumns(dataToUse.getPoint3dAtUncheckedPointIndex(0), vector01, vector03, normalVector);
234162
234411
  }
234163
234412
  }
234164
234413
  else if (Array.isArray(data)) {
234165
- return this.rectangleEdgeTransform(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_28__.Point3dArrayCarrier(data), requireClosurePoint);
234414
+ return this.rectangleEdgeTransform(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__.Point3dArrayCarrier(data), requireClosurePoint);
234166
234415
  }
234167
- else if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
234416
+ else if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
234168
234417
  return this.rectangleEdgeTransform(data.children[0].packedPoints, true);
234169
234418
  }
234170
- else if (data instanceof _Path__WEBPACK_IMPORTED_MODULE_21__.Path && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
234419
+ else if (data instanceof _Path__WEBPACK_IMPORTED_MODULE_23__.Path && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
234171
234420
  return this.rectangleEdgeTransform(data.children[0].packedPoints, requireClosurePoint);
234172
234421
  }
234173
- else if (data instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveChain) {
234422
+ else if (data instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveChain) {
234174
234423
  if (!data.checkForNonLinearPrimitives()) {
234175
234424
  // const linestring = LineString3d.create();
234176
234425
  const strokes = data.getPackedStrokes();
@@ -234194,7 +234443,7 @@ class RegionOps {
234194
234443
  * @param options options for tolerance and selective simplification.
234195
234444
  */
234196
234445
  static consolidateAdjacentPrimitives(curves, options) {
234197
- const context = new _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_29__.ConsolidateAdjacentCurvePrimitivesContext(options);
234446
+ const context = new _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_31__.ConsolidateAdjacentCurvePrimitivesContext(options);
234198
234447
  curves.dispatchToGeometryHandler(context);
234199
234448
  }
234200
234449
  /**
@@ -234212,14 +234461,14 @@ class RegionOps {
234212
234461
  static sortOuterAndHoleLoopsXY(loops) {
234213
234462
  const loopAndArea = [];
234214
234463
  for (const candidate of loops) {
234215
- if (candidate instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop)
234216
- _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__.SortablePolygon.pushLoop(loopAndArea, candidate);
234217
- else if (candidate instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
234218
- const loop = _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.createPolygon(candidate);
234219
- _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__.SortablePolygon.pushLoop(loopAndArea, loop);
234464
+ if (candidate instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop)
234465
+ _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.pushLoop(loopAndArea, candidate);
234466
+ else if (candidate instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
234467
+ const loop = _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.createPolygon(candidate);
234468
+ _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.pushLoop(loopAndArea, loop);
234220
234469
  }
234221
234470
  }
234222
- return _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__.SortablePolygon.sortAsAnyRegion(loopAndArea);
234471
+ return _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.sortAsAnyRegion(loopAndArea);
234223
234472
  }
234224
234473
  /**
234225
234474
  * Find all xy-areas bounded by the unstructured, possibly intersecting curves.
@@ -234245,9 +234494,9 @@ class RegionOps {
234245
234494
  const primitives = RegionOps.collectCurvePrimitives(curvesAndRegions, undefined, true, true);
234246
234495
  const range = this.curveArrayRange(primitives);
234247
234496
  const areaTol = this.computeXYAreaTolerance(range, tolerance);
234248
- const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_31__.CurveCurve.allIntersectionsAmongPrimitivesXY(primitives, tolerance);
234249
- const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__.PlanarSubdivision.assembleHalfEdgeGraph(primitives, intersections, tolerance);
234250
- return _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__.PlanarSubdivision.collectSignedLoopSetsInHalfEdgeGraph(graph, areaTol);
234497
+ const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_33__.CurveCurve.allIntersectionsAmongPrimitivesXY(primitives, tolerance);
234498
+ const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.assembleHalfEdgeGraph(primitives, intersections, tolerance);
234499
+ return _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.collectSignedLoopSetsInHalfEdgeGraph(graph, areaTol);
234251
234500
  }
234252
234501
  /**
234253
234502
  * Collect all `CurvePrimitives` in loosely typed input.
@@ -234262,10 +234511,10 @@ class RegionOps {
234262
234511
  */
234263
234512
  static collectCurvePrimitives(candidates, collectorArray, smallestPossiblePrimitives = false, explodeLinestrings = false) {
234264
234513
  const results = collectorArray === undefined ? [] : collectorArray;
234265
- if (candidates instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__.CurvePrimitive) {
234514
+ if (candidates instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive) {
234266
234515
  candidates.collectCurvePrimitives(results, smallestPossiblePrimitives, explodeLinestrings);
234267
234516
  }
234268
- else if (candidates instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection) {
234517
+ else if (candidates instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection) {
234269
234518
  candidates.collectCurvePrimitives(results, smallestPossiblePrimitives, explodeLinestrings);
234270
234519
  }
234271
234520
  else if (Array.isArray(candidates)) {
@@ -234284,7 +234533,7 @@ class RegionOps {
234284
234533
  static expandLineStrings(candidates) {
234285
234534
  const result = [];
234286
234535
  for (const c of candidates) {
234287
- if (c instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
234536
+ if (c instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
234288
234537
  for (let i = 0; i + 1 < c.packedPoints.length; i++) {
234289
234538
  const q = c.getIndexedSegment(i);
234290
234539
  if (q !== undefined)
@@ -234303,16 +234552,16 @@ class RegionOps {
234303
234552
  * @param worldToLocal transform to apply to data before computing its range
234304
234553
  */
234305
234554
  static curveArrayRange(data, worldToLocal) {
234306
- const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_32__.Range3d.create();
234307
- if (data instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_33__.GeometryQuery)
234555
+ const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_34__.Range3d.create();
234556
+ if (data instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_35__.GeometryQuery)
234308
234557
  data.extendRange(range, worldToLocal);
234309
234558
  else if (Array.isArray(data)) {
234310
234559
  for (const c of data) {
234311
- if (c instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_33__.GeometryQuery)
234560
+ if (c instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_35__.GeometryQuery)
234312
234561
  c.extendRange(range, worldToLocal);
234313
- else if (c instanceof _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__.Point3d)
234562
+ else if (c instanceof _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d)
234314
234563
  range.extendPoint(c, worldToLocal);
234315
- else if (c instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray)
234564
+ else if (c instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray)
234316
234565
  range.extendRange(c.getRange(worldToLocal));
234317
234566
  else if (Array.isArray(c))
234318
234567
  range.extendRange(this.curveArrayRange(c, worldToLocal));
@@ -234331,37 +234580,37 @@ class RegionOps {
234331
234580
  if (polygons.length === 0)
234332
234581
  return undefined;
234333
234582
  const firstEntry = polygons[0];
234334
- if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__.Point3d.isAnyImmediatePointType(firstEntry)) {
234335
- graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
234583
+ if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.isAnyImmediatePointType(firstEntry)) {
234584
+ graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
234336
234585
  }
234337
234586
  else if (polygons.length > 1) {
234338
234587
  let writablePolygons;
234339
- if (firstEntry instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedReadWriteXYZCollection) {
234588
+ if (firstEntry instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedReadWriteXYZCollection) {
234340
234589
  writablePolygons = polygons;
234341
234590
  }
234342
234591
  else {
234343
234592
  writablePolygons = [];
234344
234593
  for (const polygon of polygons)
234345
- writablePolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray.create(polygon));
234594
+ writablePolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(polygon));
234346
234595
  }
234347
- const sortedPolygons = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_34__.PolygonOps.sortOuterAndHoleLoopsXY(writablePolygons);
234596
+ const sortedPolygons = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_36__.PolygonOps.sortOuterAndHoleLoopsXY(writablePolygons);
234348
234597
  if (sortedPolygons.length === 1) { // below requires exactly one outer loop!
234349
- if (graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromLoops(sortedPolygons[0]))
234350
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.flipTriangles(graph);
234598
+ if (graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromLoops(sortedPolygons[0]))
234599
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
234351
234600
  }
234352
234601
  }
234353
234602
  else {
234354
- graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromSingleLoop(firstEntry);
234603
+ graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(firstEntry);
234355
234604
  }
234356
234605
  }
234357
234606
  else {
234358
- graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
234607
+ graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
234359
234608
  }
234360
234609
  if (!graph) {
234361
234610
  // Last resort: try full merge. Conveniently, multiple polygons are processed with parity logic.
234362
- if (graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(polygons, [], (inA, _inB) => inA)) {
234363
- if (_topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.triangulateAllPositiveAreaFaces(graph))
234364
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.flipTriangles(graph);
234611
+ if (graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(polygons, [], (inA, _inB) => inA)) {
234612
+ if (_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.triangulateAllPositiveAreaFaces(graph))
234613
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
234365
234614
  }
234366
234615
  }
234367
234616
  return graph;
@@ -234371,13 +234620,13 @@ class RegionOps {
234371
234620
  const strokedComponent = component.cloneStroked(options);
234372
234621
  // package the stroked region as polygons
234373
234622
  const polygons = [];
234374
- if (strokedComponent instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop) {
234375
- if (strokedComponent.children.length > 0 && strokedComponent.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d)
234623
+ if (strokedComponent instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop) {
234624
+ if (strokedComponent.children.length > 0 && strokedComponent.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d)
234376
234625
  polygons.push(strokedComponent.children[0].packedPoints); // expect only 1
234377
234626
  }
234378
- else if (strokedComponent instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_5__.ParityRegion) {
234627
+ else if (strokedComponent instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
234379
234628
  for (const strokedLoop of strokedComponent.children) {
234380
- if (strokedLoop.children.length > 0 && strokedLoop.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d)
234629
+ if (strokedLoop.children.length > 0 && strokedLoop.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d)
234381
234630
  polygons.push(strokedLoop.children[0].packedPoints); // expect only 1
234382
234631
  }
234383
234632
  }
@@ -234407,7 +234656,7 @@ class RegionOps {
234407
234656
  */
234408
234657
  static facetRegionXY(region, options) {
234409
234658
  let graph;
234410
- if (region instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_11__.UnionRegion) {
234659
+ if (region instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion) {
234411
234660
  for (const child of region.children) {
234412
234661
  const childGraph = RegionOps.triangulateRegionComponent(child, options);
234413
234662
  if (childGraph) {
@@ -234429,8 +234678,8 @@ class RegionOps {
234429
234678
  if (!graph)
234430
234679
  return undefined;
234431
234680
  if (options?.maximizeConvexFacets)
234432
- _topology_Merging__WEBPACK_IMPORTED_MODULE_35__.HalfEdgeGraphOps.expandConvexFaces(graph);
234433
- return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_9__.PolyfaceBuilder.graphToPolyface(graph, options);
234681
+ _topology_Merging__WEBPACK_IMPORTED_MODULE_37__.HalfEdgeGraphOps.expandConvexFaces(graph);
234682
+ return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__.PolyfaceBuilder.graphToPolyface(graph, options);
234434
234683
  }
234435
234684
  /**
234436
234685
  * Decompose a polygon with optional holes into an array of convex polygons.
@@ -234443,11 +234692,11 @@ class RegionOps {
234443
234692
  if (!graph)
234444
234693
  return undefined;
234445
234694
  if (maximize)
234446
- _topology_Merging__WEBPACK_IMPORTED_MODULE_35__.HalfEdgeGraphOps.expandConvexFaces(graph);
234695
+ _topology_Merging__WEBPACK_IMPORTED_MODULE_37__.HalfEdgeGraphOps.expandConvexFaces(graph);
234447
234696
  const convexPolygons = [];
234448
234697
  graph.announceFaceLoops((_graph, seed) => {
234449
- if (!seed.isMaskSet(_topology_Graph__WEBPACK_IMPORTED_MODULE_14__.HalfEdgeMask.EXTERIOR))
234450
- convexPolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray.create(seed.collectAroundFace((node) => { return node.getPoint3d(); })));
234698
+ if (!seed.isMaskSet(_topology_Graph__WEBPACK_IMPORTED_MODULE_16__.HalfEdgeMask.EXTERIOR))
234699
+ convexPolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(seed.collectAroundFace((node) => { return node.getPoint3d(); })));
234451
234700
  return true;
234452
234701
  });
234453
234702
  return convexPolygons;
@@ -258214,9 +258463,9 @@ class Vector3d extends XYZ {
258214
258463
  if (dot < 0.0 && !oppositeIsParallel)
258215
258464
  return false;
258216
258465
  const cross2 = this.crossProductMagnitudeSquared(other);
258217
- /* a2,b2,cross2 are squared lengths of respective vectors */
258218
- /* cross2 = sin^2(theta) * a2 * b2 */
258219
- /* For small theta, sin^2(theta)~~theta^2 */
258466
+ // a2,b2,cross2 are squared lengths of respective vectors
258467
+ // cross2 = sin^2(theta) * a2 * b2
258468
+ // For small theta, sin^2(theta) ~ theta^2
258220
258469
  return cross2 <= radianSquaredTol * a2 * b2;
258221
258470
  }
258222
258471
  /**
@@ -260171,26 +260420,28 @@ class PolygonOps {
260171
260420
  return s;
260172
260421
  }
260173
260422
  /**
260174
- * Return a Ray3d with (assuming the polygon is planar and not self-intersecting):
260175
- * * `origin` at the centroid of the (3D) polygon,
260176
- * * `direction` is the unit vector perpendicular to the plane,
260177
- * * `a` is the area.
260178
- * @param points
260423
+ * Return a [[Ray3d]] with:
260424
+ * * `origin` is the centroid of the polygon,
260425
+ * * `direction` is a unit vector perpendicular to the polygon plane,
260426
+ * * `a` is the polygon area.
260427
+ * @param points the polygon vertices in order. Points can lie in any plane. First and last point do not have to be equal.
260428
+ * @param result optional pre-allocated result to populate and return.
260179
260429
  */
260180
- static centroidAreaNormal(points) {
260430
+ static centroidAreaNormal(points, result) {
260181
260431
  if (Array.isArray(points)) {
260182
260432
  const carrier = new _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_5__.Point3dArrayCarrier(points);
260183
- return this.centroidAreaNormal(carrier);
260433
+ return this.centroidAreaNormal(carrier, result);
260184
260434
  }
260185
260435
  const n = points.length;
260186
260436
  if (n === 3) {
260187
- const normal = points.crossProductIndexIndexIndex(0, 1, 2);
260437
+ const normal = points.crossProductIndexIndexIndex(0, 1, 2, result?.direction);
260188
260438
  const a = 0.5 * normal.magnitude();
260189
- const centroid = points.getPoint3dAtCheckedPointIndex(0);
260439
+ const centroid = points.getPoint3dAtCheckedPointIndex(0, result?.origin);
260190
260440
  points.accumulateScaledXYZ(1, 1.0, centroid);
260191
260441
  points.accumulateScaledXYZ(2, 1.0, centroid);
260192
260442
  centroid.scaleInPlace(1.0 / 3.0);
260193
- const result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
260443
+ if (!result)
260444
+ result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
260194
260445
  if (result.tryNormalizeInPlaceWithAreaWeight(a))
260195
260446
  return result;
260196
260447
  return undefined;
@@ -260208,22 +260459,24 @@ class PolygonOps {
260208
260459
  points.vectorXYAndZIndex(origin, 1, vector0);
260209
260460
  let cross = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
260210
260461
  const centroidSum = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
260211
- const normalSum = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
260462
+ const normal = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero(result?.direction);
260212
260463
  let signedTriangleArea;
260213
- // This will work with or without closure edge. If closure is given, the last vector is 000.
260464
+ // This will work with or without closure edge. If closure is given, the last vector is 000.
260214
260465
  for (let i = 2; i < n; i++) {
260215
260466
  points.vectorXYAndZIndex(origin, i, vector1);
260216
260467
  cross = vector0.crossProduct(vector1, cross);
260217
260468
  signedTriangleArea = areaNormal.dotProduct(cross); // well, actually twice the area.
260218
- normalSum.addInPlace(cross); // this grows to twice the area
260469
+ normal.addInPlace(cross); // this grows to twice the area
260219
260470
  const b = signedTriangleArea / 6.0;
260220
260471
  centroidSum.plus2Scaled(vector0, b, vector1, b, centroidSum);
260221
260472
  vector0.setFrom(vector1);
260222
260473
  }
260223
- const area = 0.5 * normalSum.magnitude();
260474
+ const area = 0.5 * normal.magnitude();
260224
260475
  const inverseArea = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.conditionalDivideFraction(1, area);
260225
260476
  if (inverseArea !== undefined) {
260226
- const result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(origin.plusScaled(centroidSum, inverseArea), normalSum);
260477
+ const centroid = origin.plusScaled(centroidSum, inverseArea, result?.origin);
260478
+ if (!result)
260479
+ result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
260227
260480
  result.tryNormalizeInPlaceWithAreaWeight(area);
260228
260481
  return result;
260229
260482
  }
@@ -267197,19 +267450,19 @@ class Matrix4d {
267197
267450
  this._coffs[15] += scale * beta;
267198
267451
  }
267199
267452
  /**
267200
- * Multiply and replace contents of this matrix by A*this*AT where
267201
- * * A is a pure translation with final column [x,y,z,1]
267202
- * * this is this matrix.
267203
- * * AT is the transpose of A.
267204
- * @param ax x part of translation
267205
- * @param ay y part of translation
267206
- * @param az z part of translation
267453
+ * Multiply and replace contents of ` this` matrix by `A*this*AT` where
267454
+ * * `A` is a pure translation with final column [x,y,z,1].
267455
+ * * `this` is this matrix.
267456
+ * * `AT` is the transpose of A.
267457
+ * @param ax x part of translation.
267458
+ * @param ay y part of translation.
267459
+ * @param az z part of translation.
267207
267460
  */
267208
267461
  multiplyTranslationSandwichInPlace(ax, ay, az) {
267209
267462
  const bx = this._coffs[3];
267210
267463
  const by = this._coffs[7];
267211
267464
  const bz = this._coffs[11];
267212
- // matrixB can be non-symmetric!!
267465
+ // matrixB can be non-symmetric
267213
267466
  const cx = this._coffs[12];
267214
267467
  const cy = this._coffs[13];
267215
267468
  const cz = this._coffs[14];
@@ -267232,7 +267485,7 @@ class Matrix4d {
267232
267485
  this._coffs[12] += axBeta;
267233
267486
  this._coffs[13] += ayBeta;
267234
267487
  this._coffs[14] += azBeta;
267235
- // coffs[15] is unchanged !!!
267488
+ // coffs[15] is unchanged
267236
267489
  }
267237
267490
  }
267238
267491
 
@@ -267283,8 +267536,8 @@ __webpack_require__.r(__webpack_exports__);
267283
267536
  * * e.g. entry 03 is summed x.
267284
267537
  * * In this level:
267285
267538
  * * the `absoluteQuantity` member is undefined.
267286
- * * the `localToWorldMap` and `radiiOfGyration` are created by have undefined contents.
267287
- * * Second level: after a call to inertiaProductsToPrincipalAxes, the `localToWorldMap`, `absoluteQuantity` and
267539
+ * * the `localToWorldMap` and `radiiOfGyration` are created but have undefined contents.
267540
+ * * Second level: after a call to `inertiaProductsToPrincipalAxes`, the `localToWorldMap`, `absoluteQuantity` and
267288
267541
  * `radiiOfGyration` are filled in.
267289
267542
  * @public
267290
267543
  */
@@ -267304,18 +267557,35 @@ class MomentData {
267304
267557
  * * This set up with its inverse already constructed.
267305
267558
  */
267306
267559
  localToWorldMap;
267560
+ /** Radii of gyration (square roots of principal second moments). */
267561
+ radiusOfGyration;
267562
+ /**
267563
+ * Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
267564
+ * inertiaProductsToPrincipalAxes.
267565
+ */
267566
+ absoluteQuantity;
267307
267567
  // private variables
267308
267568
  static _vectorA;
267309
267569
  static _vectorB;
267310
267570
  static _vectorC;
267311
267571
  _point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
267312
267572
  _point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
267573
+ /** Constructor. */
267574
+ constructor() {
267575
+ this.origin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
267576
+ this.needOrigin = false;
267577
+ this.sums = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createZero();
267578
+ this.localToWorldMap = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity();
267579
+ this.radiusOfGyration = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
267580
+ this.absoluteQuantity = 0.1; // so optimizer sees its type
267581
+ this.absoluteQuantity = undefined;
267582
+ }
267313
267583
  /**
267314
267584
  * Return the lower-right (3,3) entry in the sums.
267315
267585
  * * This is the quantity (i.e. length, area, or volume) summed.
267316
267586
  */
267317
267587
  get quantitySum() {
267318
- return this.sums.atIJ(3, 3);
267588
+ return this.sums.weight();
267319
267589
  }
267320
267590
  /**
267321
267591
  * Return a scale factor to make these sums match the target orientation sign.
@@ -267346,23 +267616,6 @@ class MomentData {
267346
267616
  this.needOrigin = false;
267347
267617
  }
267348
267618
  }
267349
- /** Radii of gyration (square roots of principal second moments). */
267350
- radiusOfGyration;
267351
- /**
267352
- * Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
267353
- * inertiaProductsToPrincipalAxes.
267354
- */
267355
- absoluteQuantity;
267356
- /** Constructor. */
267357
- constructor() {
267358
- this.origin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
267359
- this.sums = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createZero();
267360
- this.localToWorldMap = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity();
267361
- this.radiusOfGyration = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
267362
- this.needOrigin = false;
267363
- this.absoluteQuantity = 0.1; // so optimizer sees its type
267364
- this.absoluteQuantity = undefined;
267365
- }
267366
267619
  /**
267367
267620
  * Create moments with optional origin.
267368
267621
  * * Origin and needOrigin are quirky.
@@ -267406,7 +267659,7 @@ class MomentData {
267406
267659
  axes.setColumnsPoint4dXYZ(points[0], points[1], points[2]);
267407
267660
  if (axes.determinant() < 0)
267408
267661
  axes.scaleColumnsInPlace(-1.0, -1.0, -1.0);
267409
- // prefer x and z positive -- y falls wherever . ..
267662
+ // prefer x and z positive; y falls wherever
267410
267663
  if (axes.at(0, 0) < 0.0)
267411
267664
  axes.scaleColumnsInPlace(-1.0, -1.0, 1.0);
267412
267665
  if (axes.at(2, 2) < 0.0)
@@ -267431,7 +267684,8 @@ class MomentData {
267431
267684
  * * Hence x axis is long direction.
267432
267685
  * * Hence planar data generates large moment as Z.
267433
267686
  * @param origin The origin used for the inertia products.
267434
- * @param inertiaProducts The inertia products: sums or integrals of [xx,xy,xz,xw; yx,yy, yz,yw; zx,zy,zz,zw; wx,wy,wz,w].
267687
+ * @param inertiaProducts The inertia products: sums or integrals of
267688
+ * [xx,xy,xz,xw; yx,yy,yz,yw; zx,zy,zz,zw; wx,wy,wz,w].
267435
267689
  */
267436
267690
  static inertiaProductsToPrincipalAxes(origin, inertiaProducts) {
267437
267691
  const moments = new MomentData();
@@ -267475,23 +267729,21 @@ class MomentData {
267475
267729
  */
267476
267730
  static areEquivalentPrincipalAxes(dataA, dataB) {
267477
267731
  if (dataA && dataB
267478
- && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { // um.. need different tolerance for area, volume?)
267732
+ && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { // TODO: need different tolerance for area, volume?
267479
267733
  if (dataA.localToWorldMap.getOrigin().isAlmostEqual(dataB.localToWorldMap.getOrigin())
267480
267734
  && dataA.radiusOfGyration.isAlmostEqual(dataB.radiusOfGyration)) {
267481
267735
  if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.y)) {
267482
- // We have at least xy symmetry ....
267736
+ // we have at least xy symmetry
267483
267737
  if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.z))
267484
267738
  return true;
267485
- // just xy.
267486
- // allow opposite z directions.
267487
- // If the z's are aligned, x an dy can spin freely.
267739
+ // just xy; allow opposite z directions; if the z's are aligned, x and y can spin freely
267488
267740
  const zA = dataA.localToWorldMap.matrix.columnZ();
267489
267741
  const zB = dataB.localToWorldMap.matrix.columnZ();
267490
267742
  if (zA.isParallelTo(zB, true))
267491
267743
  return true;
267492
267744
  return false;
267493
267745
  }
267494
- // no symmetry. Test all three axes.
267746
+ // no symmetry; test all three axes
267495
267747
  const vectorA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
267496
267748
  const vectorB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
267497
267749
  for (let i = 0; i < 3; i++) {
@@ -267521,7 +267773,7 @@ class MomentData {
267521
267773
  }
267522
267774
  /** Revise the accumulated sums to be "around the centroid". */
267523
267775
  shiftOriginAndSumsToCentroidOfSums() {
267524
- const xyz = this.sums.columnW().realPoint();
267776
+ const xyz = this.sums.columnW().realPoint(); // centroid of the geometry
267525
267777
  if (xyz) {
267526
267778
  this.shiftOriginAndSumsByXYZ(xyz.x, xyz.y, xyz.z);
267527
267779
  return true;
@@ -267530,9 +267782,9 @@ class MomentData {
267530
267782
  }
267531
267783
  /**
267532
267784
  * Revise the accumulated sums.
267533
- * * add ax,ay,ax to the origin coordinates.
267534
- * * apply the negative translation to the sums.
267535
- */
267785
+ * * Add (ax,ay,az) to the origin coordinates.
267786
+ * * Apply the negative translation to the sums.
267787
+ */
267536
267788
  shiftOriginAndSumsByXYZ(ax, ay, az) {
267537
267789
  this.origin.addXYZInPlace(ax, ay, az);
267538
267790
  this.sums.multiplyTranslationSandwichInPlace(-ax, -ay, -az);
@@ -267542,23 +267794,24 @@ class MomentData {
267542
267794
  this.shiftOriginAndSumsByXYZ(newOrigin.x - this.origin.x, newOrigin.y - this.origin.y, newOrigin.z - this.origin.z);
267543
267795
  }
267544
267796
  /**
267545
- * Compute moments of a triangle from the origin to the given line.
267546
- * Accumulate them to this.sums.
267547
- * * If `pointA` is undefined, use `this.origin` as pointA.
267548
- * * If `this.needOrigin` is set, pointB is used
267549
- */
267797
+ * Compute moments of a triangle from the origin. Accumulate them to `this.sums`.
267798
+ * * If `this.needOrigin` is set, `this.origin` is set to `pointB`.
267799
+ * * If `pointA` is undefined, use `this.origin` as `pointA`.
267800
+ */
267550
267801
  accumulateTriangleMomentsXY(pointA, pointB, pointC) {
267551
267802
  this.setOriginXYZIfNeeded(pointB.x, pointB.y, 0.0);
267552
267803
  const x0 = this.origin.x;
267553
267804
  const y0 = this.origin.y;
267554
- const vectorA = MomentData._vectorA =
267555
- pointA !== undefined ? _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointA.x - x0, pointA.y - y0, 0.0, 1.0, MomentData._vectorA)
267556
- : _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(this.origin.x, this.origin.y, 0.0, 1.0, MomentData._vectorA);
267805
+ const vectorA = MomentData._vectorA = (pointA !== undefined) ?
267806
+ _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointA.x - x0, pointA.y - y0, 0.0, 1.0, MomentData._vectorA) :
267807
+ _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(0.0, 0.0, 0.0, 1.0, MomentData._vectorA);
267557
267808
  const vectorB = MomentData._vectorB = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointB.x - x0, pointB.y - y0, 0.0, 1.0, MomentData._vectorB);
267558
267809
  const vectorC = MomentData._vectorC = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointC.x - x0, pointC.y - y0, 0.0, 1.0, MomentData._vectorC);
267559
- // accumulate Return product integrals I(0<=u<=1) I (0<=v<= u) (w*W + u *U + v * V)(w*W + u *U + v * V)^ du dv
267560
- // where w = 1-u-v
267561
- // W = column vector (point00.x, point00.y, point00.z, 1.0) etc.
267810
+ // Below we calculate 16 double integrals: \iint_T [x y 0 1]^ [x y 0 1] dT over triangle T=(A,B,C).
267811
+ // Each accumulates contributions from 9 scaled outer products. Integration computations use the barycentric
267812
+ // change of variables [B-A C-A][u,v]^ = [x,y]^ with Jacobian detJ = B-A x C-A = twice the area of T.
267813
+ // This converts the integration domain from T to the triangle bounded by u=0, v=0 and v=1-u, yielding e.g.,
267814
+ // \iint_T x^2 dT = detJ \int_0^1 \int_0^{1-u} u^2 dv du = detJ / 12, and similarly \iint_T xy dT = detJ / 24.
267562
267815
  const detJ = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.crossProductXYXY(vectorB.x - vectorA.x, vectorB.y - vectorA.y, vectorC.x - vectorA.x, vectorC.y - vectorA.y);
267563
267816
  if (detJ !== 0.0) {
267564
267817
  const r1_12 = detJ / 12.0;
@@ -267574,7 +267827,7 @@ class MomentData {
267574
267827
  this.sums.addScaledOuterProductInPlace(vectorC, vectorC, r1_12);
267575
267828
  }
267576
267829
  }
267577
- /** Add scaled outer product of (4d, unit weight) point to this.sums. */
267830
+ /** Add scaled outer product of (4d, unit weight) point to `this.sums`. */
267578
267831
  accumulateScaledOuterProduct(point, scaleFactor) {
267579
267832
  this.setOriginXYZIfNeeded(point.x, point.y, 0.0);
267580
267833
  const vectorA = MomentData._vectorA = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(point.x - this.origin.x, point.y - this.origin.y, point.z - this.origin.z, 1.0, MomentData._vectorA);
@@ -267597,16 +267850,15 @@ class MomentData {
267597
267850
  this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_3);
267598
267851
  }
267599
267852
  /**
267600
- * Compute moments of triangles from a base point to the given linestring.
267601
- * Accumulate them to this.sums.
267602
- * * If `pointA` is undefined, use `this.origin` as pointA.
267603
- * * If `this.needOrigin` is set, the first point of the array is captured as local origin for subsequent sums.
267604
- *
267853
+ * Compute moments of triangles from a base point to the given linestring. Accumulate them to `this.sums`.
267854
+ * * If `this.needOrigin` is set, `this.origin` is set to the first point of the array.
267855
+ * * If `sweepBase` is undefined, use `this.origin` as `sweepBase`.
267605
267856
  */
267606
267857
  accumulateTriangleToLineStringMomentsXY(sweepBase, points) {
267607
267858
  const n = points.length;
267608
267859
  if (n > 1) {
267609
267860
  points.getPoint3dAtUncheckedPointIndex(0, this._point0);
267861
+ // The linestring forms a polygon with sweepBase. Integrate over this polygon using Shoelace algorithm.
267610
267862
  for (let i = 1; i < n; i++) {
267611
267863
  points.getPoint3dAtUncheckedPointIndex(i, this._point1);
267612
267864
  this.accumulateTriangleMomentsXY(sweepBase, this._point0, this._point1);
@@ -267615,17 +267867,17 @@ class MomentData {
267615
267867
  }
267616
267868
  }
267617
267869
  /**
267618
- * * Assemble XX, YY, XY products into a full matrix form [xx,xy,0,0; xy,yy,0,0;0,0,0,0;0,0,0,1].
267619
- * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin]. (Column weights 0001) (only xy
267620
- * parts of vectors).
267621
- * * scale by detJ for the xy-only determinant of the vectors.
267870
+ * Assemble XX, YY, XY products into a full matrix form [xx,xy,0,0; xy,yy,0,0; 0,0,0,0; 0,0,0,1].
267871
+ * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin].
267872
+ * (column weights 0001; only xy parts of vectors).
267873
+ * * Scale by detJ for the xy-only determinant of the vectors.
267622
267874
  * @param productXX
267623
267875
  * @param productXY
267624
267876
  * @param productYY
267625
- * @param area Area in caller's system.
267626
- * @param origin Caller's origin.
267627
- * @param vectorU Caller's U axis (not necessarily unit).
267628
- * @param vectorV Caller's V axis (not necessarily unit).
267877
+ * @param area area in caller's system.
267878
+ * @param origin caller's origin.
267879
+ * @param vectorU caller's U axis (not necessarily unit).
267880
+ * @param vectorV caller's V axis (not necessarily unit).
267629
267881
  */
267630
267882
  accumulateXYProductsInCentroidalFrame(productXX, productXY, productYY, area, origin, vectorU, vectorV) {
267631
267883
  const centroidalProducts = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createRowValues(productXX, productXY, 0, 0, productXY, productYY, 0, 0, 0, 0, 0, 0, 0, 0, 0, area);
@@ -329231,7 +329483,7 @@ class TestContext {
329231
329483
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
329232
329484
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
329233
329485
  await core_frontend_1.NoRenderApp.startup({
329234
- applicationVersion: "5.1.0-dev.1",
329486
+ applicationVersion: "5.1.0-dev.4",
329235
329487
  applicationId: this.settings.gprid,
329236
329488
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
329237
329489
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -331771,6 +332023,28 @@ const getClassName = (obj) => {
331771
332023
  };
331772
332024
 
331773
332025
 
332026
+ /***/ }),
332027
+
332028
+ /***/ "../../core/frontend/lib/esm/extension/providers lazy recursive":
332029
+ /*!******************************************************************************!*\
332030
+ !*** ../../core/frontend/lib/esm/extension/providers/ lazy namespace object ***!
332031
+ \******************************************************************************/
332032
+ /***/ ((module) => {
332033
+
332034
+ function webpackEmptyAsyncContext(req) {
332035
+ // Here Promise.resolve().then() is used instead of new Promise() to prevent
332036
+ // uncaught exception popping up in devtools
332037
+ return Promise.resolve().then(() => {
332038
+ var e = new Error("Cannot find module '" + req + "'");
332039
+ e.code = 'MODULE_NOT_FOUND';
332040
+ throw e;
332041
+ });
332042
+ }
332043
+ webpackEmptyAsyncContext.keys = () => ([]);
332044
+ webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
332045
+ webpackEmptyAsyncContext.id = "../../core/frontend/lib/esm/extension/providers lazy recursive";
332046
+ module.exports = webpackEmptyAsyncContext;
332047
+
331774
332048
  /***/ }),
331775
332049
 
331776
332050
  /***/ "?088e":
@@ -354277,7 +354551,7 @@ var loadLanguages = instance.loadLanguages;
354277
354551
  /***/ ((module) => {
354278
354552
 
354279
354553
  "use strict";
354280
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.1","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 ES2022 --outDir lib/esm","clean":"rimraf -g 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 --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 --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./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 webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","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:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*"},"//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/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//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.2.4","@itwin/object-storage-core":"^2.3.0","@itwin/core-i18n":"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"}}');
354554
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.4","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 ES2022 --outDir lib/esm","clean":"rimraf -g 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 --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 --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./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 webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","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:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//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/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//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.2.4","@itwin/object-storage-core":"^2.3.0","@itwin/core-i18n":"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"}}');
354281
354555
 
354282
354556
  /***/ }),
354283
354557