@itwin/ecschema-rpcinterface-tests 5.1.0-dev.3 → 5.1.0-dev.5

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.
@@ -38986,6 +38986,20 @@ var RenderSchedule;
38986
38986
  get maxBatchId() {
38987
38987
  return this._maxBatchId ?? (this._maxBatchId = this.modelTimelines.reduce((accum, timeline) => Math.max(accum, timeline.maxBatchId), 0));
38988
38988
  }
38989
+ /**
38990
+ * Replaces all elementIds in a ScriptProps object with an empty string. Returns modified ScriptProps.
38991
+ * @param scheduleScript The script props to modify.
38992
+ * @internal */
38993
+ static removeScheduleScriptElementIds(scheduleScript) {
38994
+ scheduleScript.forEach((modelTimeline) => {
38995
+ modelTimeline.elementTimelines.forEach((elementTimeline) => {
38996
+ if (elementTimeline.elementIds) {
38997
+ elementTimeline.elementIds = "";
38998
+ }
38999
+ });
39000
+ });
39001
+ return scheduleScript;
39002
+ }
38989
39003
  }
38990
39004
  RenderSchedule.Script = Script;
38991
39005
  /** A reference to a [[RenderSchedule.Script]], optionally identifying the source of the script.
@@ -141119,6 +141133,7 @@ class GraphicsCollectorDrawArgs extends _tile_internal__WEBPACK_IMPORTED_MODULE_
141119
141133
  return undefined;
141120
141134
  return new GraphicsCollectorDrawArgs(planes, worldToViewMap, collector, args);
141121
141135
  }
141136
+ get shouldCollectClassifierGraphics() { return false; }
141122
141137
  }
141123
141138
 
141124
141139
 
@@ -141389,6 +141404,7 @@ class IModelTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_4__.Tile {
141389
141404
  if (format !== _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileFormat.IModel)
141390
141405
  return content;
141391
141406
  const sizeMultiplier = this.hasSizeMultiplier ? this.sizeMultiplier : undefined;
141407
+ const ecefTransform = this.tree.iModel.isGeoLocated ? this.tree.iModel.getEcefTransform() : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
141392
141408
  try {
141393
141409
  content = await this.iModelTree.decoder.decode({
141394
141410
  stream: streamBuffer,
@@ -141397,7 +141413,7 @@ class IModelTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_4__.Tile {
141397
141413
  isCanceled,
141398
141414
  sizeMultiplier,
141399
141415
  tileData: {
141400
- ecefTransform: this.tree.iModel.ecefLocation?.getTransform() ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity(),
141416
+ ecefTransform,
141401
141417
  range: this.range,
141402
141418
  layerClassifiers: this.tree.layerHandler?.layerClassifiers,
141403
141419
  },
@@ -142106,7 +142122,8 @@ class IModelTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_6__.TileTre
142106
142122
  draw(args) {
142107
142123
  const tiles = this.selectTiles(args);
142108
142124
  this._rootTile.draw(args, tiles, this._numStaticTilesSelected);
142109
- this._layerHandler.collectClassifierGraphics(args, tiles);
142125
+ if (args.shouldCollectClassifierGraphics)
142126
+ this._layerHandler.collectClassifierGraphics(args, tiles);
142110
142127
  }
142111
142128
  prune() {
142112
142129
  const olderThan = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.now().minus(this.expirationTime);
@@ -143238,14 +143255,12 @@ class LayerTileTreeReferenceHandler {
143238
143255
  removals.push(context.viewport.displayStyle.settings.onMapImageryChanged.addListener((imagery) => {
143239
143256
  this.setBaseLayerSettings(imagery.backgroundBase);
143240
143257
  this.setLayerSettings(imagery.backgroundLayers);
143241
- this.clearLayers();
143242
143258
  }));
143243
143259
  }
143244
143260
  removals.push(context.viewport.onChangeView.addListener((vp, previousViewState) => {
143245
143261
  if ((0,_tile_internal__WEBPACK_IMPORTED_MODULE_1__.compareMapLayer)(previousViewState, vp.view)) {
143246
143262
  this.setBaseLayerSettings(mapImagery.backgroundBase);
143247
143263
  this.setLayerSettings(mapImagery.backgroundLayers);
143248
- this.clearLayers();
143249
143264
  }
143250
143265
  }));
143251
143266
  }
@@ -145913,8 +145928,9 @@ class RealityTileLoader {
145913
145928
  isCanceled = () => !tile.isLoading;
145914
145929
  const { is3d, yAxisUp, iModel, modelId } = tile.realityRoot;
145915
145930
  let reader;
145931
+ const ecefTransform = tile.tree.iModel.isGeoLocated ? tile.tree.iModel.getEcefTransform() : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
145916
145932
  const tileData = {
145917
- ecefTransform: tile.tree.iModel.ecefLocation?.getTransform() ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity(),
145933
+ ecefTransform,
145918
145934
  range: tile.range,
145919
145935
  layerClassifiers: tile.tree.layerHandler?.layerClassifiers,
145920
145936
  };
@@ -157229,7 +157245,7 @@ class RealityTileTree extends _internal__WEBPACK_IMPORTED_MODULE_6__.TileTree {
157229
157245
  sortIndices = selectedTiles.map((_x, i) => i);
157230
157246
  sortIndices.sort((a, b) => selectedTiles[a].depth - selectedTiles[b].depth);
157231
157247
  }
157232
- if (!(args instanceof _internal__WEBPACK_IMPORTED_MODULE_6__.GraphicsCollectorDrawArgs))
157248
+ if (args.shouldCollectClassifierGraphics)
157233
157249
  this.collectClassifierGraphics(args, selectedTiles);
157234
157250
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(selectedTiles.length === displayedTileDescendants.length);
157235
157251
  for (let i = 0; i < selectedTiles.length; i++) {
@@ -159383,6 +159399,8 @@ class TileDrawArgs {
159383
159399
  processSelectedTiles(_tiles) { }
159384
159400
  /* @internal */
159385
159401
  get maxRealityTreeSelectionCount() { return undefined; }
159402
+ /* @internal */
159403
+ get shouldCollectClassifierGraphics() { return true; }
159386
159404
  }
159387
159405
 
159388
159406
 
@@ -204003,15 +204021,15 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
204003
204021
  _activeMomentData;
204004
204022
  _point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
204005
204023
  _point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
204006
- /** Accumulate (independent) integrations over
204007
- * * origin to chord of the arc.
204008
- * * origin to the "cap" between the chord and arc.
204024
+ /**
204025
+ * Accumulate (independent) integrations over:
204026
+ * * The area between the arc and the chord connecting its endpoints.
204027
+ * * The triangle with vertices: origin, arc start, arc end.
204009
204028
  */
204010
204029
  handleArc3d(arc) {
204011
204030
  const momentData = this._activeMomentData;
204012
204031
  const sweepRadians = arc.sweep.sweepRadians;
204013
204032
  const alphaRadians = sweepRadians * 0.5;
204014
- // from https://apps.dtic.mil/dtic/tr/fulltext/u2/274936.pdf page 71 for radius = 1
204015
204033
  let s = Math.sin(alphaRadians);
204016
204034
  let c = Math.cos(alphaRadians);
204017
204035
  let s1 = Math.sin(sweepRadians);
@@ -204038,12 +204056,12 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
204038
204056
  const pointC = arc.fractionToPoint(1.0);
204039
204057
  momentData.accumulateTriangleMomentsXY(undefined, pointB, pointC);
204040
204058
  }
204041
- /** Accumulate integrals over the (triangular) areas from the origin to each line segment */
204059
+ /** Accumulate integrals over the (triangular) areas from the origin to each line segment. */
204042
204060
  handleLineString3d(ls) {
204043
204061
  const momentData = this._activeMomentData;
204044
204062
  momentData.accumulateTriangleToLineStringMomentsXY(undefined, ls.packedPoints);
204045
204063
  }
204046
- /** Accumulate integrals over the (triangular) area from the origin to this line segment */
204064
+ /** Accumulate integrals over the (triangular) area from the origin to this line segment. */
204047
204065
  handleLineSegment3d(segment) {
204048
204066
  const momentData = this._activeMomentData;
204049
204067
  segment.startPoint(this._point0);
@@ -204059,15 +204077,7 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
204059
204077
  this._activeMomentData = undefined;
204060
204078
  return momentData;
204061
204079
  }
204062
- /**
204063
- * ASSUMPTIONS FOR ORIENTATION AND CONTAINMENT ISSUES
204064
- * * Largest area is outer
204065
- * * All others are interior (and not overlapping)
204066
- * Hence
204067
- * * Outer area sign must be positive -- negate all integrations as needed
204068
- * * Outer area signs must be positive -- negate all integrations as needed
204069
- * @param region
204070
- */
204080
+ /** Accumulate integrals from origin to the components of the parity region. */
204071
204081
  handleParityRegion(region) {
204072
204082
  const allChildMoments = [];
204073
204083
  let maxAbsArea = 0.0;
@@ -204099,7 +204109,7 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
204099
204109
  }
204100
204110
  return undefined;
204101
204111
  }
204102
- /** Accumulate (as simple addition) products over each component of the union region. */
204112
+ /** Accumulate integrals from origin to the components of the union region. */
204103
204113
  handleUnionRegion(region) {
204104
204114
  const summedMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__.MomentData.create();
204105
204115
  for (const child of region.children) {
@@ -204121,9 +204131,9 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
204121
204131
  this._strokeOptions = options;
204122
204132
  return options;
204123
204133
  }
204124
- /** Single curve primitive (not loop . . .).
204125
- * * stroke the curve
204126
- * * accumulate stroke array.
204134
+ /**
204135
+ * Handle a single curve primitive (not loop).
204136
+ * * Stroke the curve and accumulate stroke array.
204127
204137
  */
204128
204138
  handleCurvePrimitive(cp) {
204129
204139
  const strokes = _LineString3d__WEBPACK_IMPORTED_MODULE_6__.LineString3d.create();
@@ -204131,12 +204141,18 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
204131
204141
  cp.emitStrokes(strokes, options);
204132
204142
  this.handleLineString3d(strokes);
204133
204143
  }
204134
- /** handle strongly typed BSplineCurve3d as generic curve primitive */
204135
- handleBSplineCurve3d(g) { return this.handleCurvePrimitive(g); }
204136
- /** handle strongly typed BSplineCurve3dH as generic curve primitive */
204137
- handleBSplineCurve3dH(g) { return this.handleCurvePrimitive(g); }
204138
- /** handle strongly typed TransitionSpiral as generic curve primitive */
204139
- handleTransitionSpiral(g) { return this.handleCurvePrimitive(g); }
204144
+ /** Handle strongly typed BSplineCurve3d as generic curve primitive. */
204145
+ handleBSplineCurve3d(g) {
204146
+ return this.handleCurvePrimitive(g);
204147
+ }
204148
+ /** Handle strongly typed BSplineCurve3dH as generic curve primitive. */
204149
+ handleBSplineCurve3dH(g) {
204150
+ return this.handleCurvePrimitive(g);
204151
+ }
204152
+ /** Handle strongly typed TransitionSpiral as generic curve primitive. */
204153
+ handleTransitionSpiral(g) {
204154
+ return this.handleCurvePrimitive(g);
204155
+ }
204140
204156
  }
204141
204157
 
204142
204158
 
@@ -204156,41 +204172,43 @@ __webpack_require__.r(__webpack_exports__);
204156
204172
  /* harmony export */ RegionOps: () => (/* binding */ RegionOps)
204157
204173
  /* harmony export */ });
204158
204174
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
204159
- /* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
204160
- /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
204161
- /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
204162
- /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
204163
- /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
204164
- /* harmony import */ var _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../geometry3d/PolylineCompressionByEdgeOffset */ "../../core/geometry/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js");
204165
- /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
204166
- /* harmony import */ var _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/SortablePolygon */ "../../core/geometry/lib/esm/geometry3d/SortablePolygon.js");
204167
- /* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
204175
+ /* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
204176
+ /* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
204177
+ /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
204178
+ /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
204179
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
204180
+ /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
204181
+ /* harmony import */ var _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/PolylineCompressionByEdgeOffset */ "../../core/geometry/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js");
204182
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
204183
+ /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
204184
+ /* harmony import */ var _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../geometry3d/SortablePolygon */ "../../core/geometry/lib/esm/geometry3d/SortablePolygon.js");
204185
+ /* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
204168
204186
  /* harmony import */ var _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry4d/MomentData */ "../../core/geometry/lib/esm/geometry4d/MomentData.js");
204169
- /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
204170
- /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
204171
- /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
204172
- /* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
204173
- /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
204174
- /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
204175
- /* harmony import */ var _CurveCurve__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./CurveCurve */ "../../core/geometry/lib/esm/curve/CurveCurve.js");
204176
- /* harmony import */ var _CurveOps__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
204177
- /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
204187
+ /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
204188
+ /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
204189
+ /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
204190
+ /* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
204191
+ /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
204192
+ /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
204193
+ /* harmony import */ var _CurveCurve__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./CurveCurve */ "../../core/geometry/lib/esm/curve/CurveCurve.js");
204194
+ /* harmony import */ var _CurveOps__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
204195
+ /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
204178
204196
  /* harmony import */ var _CurveWireMomentsXYZ__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CurveWireMomentsXYZ */ "../../core/geometry/lib/esm/curve/CurveWireMomentsXYZ.js");
204179
- /* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
204180
- /* harmony import */ var _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./internalContexts/ChainCollectorContext */ "../../core/geometry/lib/esm/curve/internalContexts/ChainCollectorContext.js");
204181
- /* harmony import */ var _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./internalContexts/PolygonOffsetContext */ "../../core/geometry/lib/esm/curve/internalContexts/PolygonOffsetContext.js");
204182
- /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
204183
- /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
204184
- /* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
204185
- /* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
204186
- /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
204187
- /* harmony import */ var _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./Query/ConsolidateAdjacentPrimitivesContext */ "../../core/geometry/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js");
204188
- /* harmony import */ var _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./Query/CurveSplitContext */ "../../core/geometry/lib/esm/curve/Query/CurveSplitContext.js");
204189
- /* harmony import */ var _Query_InOutTests__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Query/InOutTests */ "../../core/geometry/lib/esm/curve/Query/InOutTests.js");
204190
- /* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
204197
+ /* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
204198
+ /* harmony import */ var _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./internalContexts/ChainCollectorContext */ "../../core/geometry/lib/esm/curve/internalContexts/ChainCollectorContext.js");
204199
+ /* harmony import */ var _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./internalContexts/PolygonOffsetContext */ "../../core/geometry/lib/esm/curve/internalContexts/PolygonOffsetContext.js");
204200
+ /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
204201
+ /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
204202
+ /* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
204203
+ /* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
204204
+ /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
204205
+ /* harmony import */ var _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./Query/ConsolidateAdjacentPrimitivesContext */ "../../core/geometry/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js");
204206
+ /* harmony import */ var _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./Query/CurveSplitContext */ "../../core/geometry/lib/esm/curve/Query/CurveSplitContext.js");
204207
+ /* harmony import */ var _Query_InOutTests__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Query/InOutTests */ "../../core/geometry/lib/esm/curve/Query/InOutTests.js");
204208
+ /* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
204191
204209
  /* harmony import */ var _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RegionMomentsXY */ "../../core/geometry/lib/esm/curve/RegionMomentsXY.js");
204192
- /* harmony import */ var _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./RegionOpsClassificationSweeps */ "../../core/geometry/lib/esm/curve/RegionOpsClassificationSweeps.js");
204193
- /* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
204210
+ /* harmony import */ var _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./RegionOpsClassificationSweeps */ "../../core/geometry/lib/esm/curve/RegionOpsClassificationSweeps.js");
204211
+ /* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
204194
204212
  /*---------------------------------------------------------------------------------------------
204195
204213
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
204196
204214
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -204231,6 +204249,8 @@ __webpack_require__.r(__webpack_exports__);
204231
204249
 
204232
204250
 
204233
204251
 
204252
+
204253
+
204234
204254
 
204235
204255
 
204236
204256
 
@@ -204260,13 +204280,16 @@ var RegionBinaryOpType;
204260
204280
  class RegionOps {
204261
204281
  /**
204262
204282
  * Return moment sums for a loop, parity region, or union region.
204283
+ * * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
204263
204284
  * * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
204264
- * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
204265
- * @param root any Loop, ParityRegion, or UnionRegion.
204285
+ * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes(rawMomentData.origin, rawMomentData.sums);`
204286
+ * * `rawMomentData.origin` is the centroid of `region`.
204287
+ * * `rawMomentData.sums.weight()` is the signed area of `region`.
204288
+ * @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
204266
204289
  */
204267
- static computeXYAreaMoments(root) {
204290
+ static computeXYAreaMoments(region) {
204268
204291
  const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__.RegionMomentsXY();
204269
- const result = root.dispatchToGeometryHandler(handler);
204292
+ const result = region.dispatchToGeometryHandler(handler);
204270
204293
  if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__.MomentData) {
204271
204294
  result.shiftOriginAndSumsToCentroidOfSums();
204272
204295
  return result;
@@ -204275,8 +204298,8 @@ class RegionOps {
204275
204298
  }
204276
204299
  /**
204277
204300
  * Return an area tolerance for a given xy-range and optional distance tolerance.
204278
- * @param range range of planar region to tolerance
204279
- * @param distanceTolerance optional absolute distance tolerance
204301
+ * @param range range of planar region to tolerance.
204302
+ * @param distanceTolerance optional absolute distance tolerance.
204280
204303
  */
204281
204304
  static computeXYAreaTolerance(range, distanceTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
204282
204305
  // 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).
@@ -204285,12 +204308,13 @@ class RegionOps {
204285
204308
  }
204286
204309
  /**
204287
204310
  * Return a (signed) xy area for a region.
204311
+ * * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
204288
204312
  * * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
204289
- * @param root any Loop, ParityRegion, or UnionRegion.
204313
+ * @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
204290
204314
  */
204291
- static computeXYArea(root) {
204315
+ static computeXYArea(region) {
204292
204316
  const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__.RegionMomentsXY();
204293
- const result = root.dispatchToGeometryHandler(handler);
204317
+ const result = region.dispatchToGeometryHandler(handler);
204294
204318
  if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__.MomentData) {
204295
204319
  return result.quantitySum;
204296
204320
  }
@@ -204298,49 +204322,88 @@ class RegionOps {
204298
204322
  }
204299
204323
  /**
204300
204324
  * Return MomentData with the sums of wire moments.
204325
+ * * The input curve should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
204301
204326
  * * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
204302
- * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
204303
- * @param root any CurveCollection or CurvePrimitive.
204327
+ * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
204328
+ * * `rawMomentData.origin` is the wire centroid of `curve`.
204329
+ * * `rawMomentData.sums.weight()` is the signed length of `curve`.
204330
+ * @param curve any [[CurveCollection]] or [[CurvePrimitive]].
204304
204331
  */
204305
- static computeXYZWireMomentSums(root) {
204332
+ static computeXYZWireMomentSums(curve) {
204306
204333
  const handler = new _CurveWireMomentsXYZ__WEBPACK_IMPORTED_MODULE_3__.CurveWireMomentsXYZ();
204307
- handler.visitLeaves(root);
204334
+ handler.visitLeaves(curve);
204308
204335
  const result = handler.momentData;
204309
204336
  result.shiftOriginAndSumsToCentroidOfSums();
204310
204337
  return result;
204311
204338
  }
204339
+ /**
204340
+ * Return a [[Ray3d]] with:
204341
+ * * `origin` is the centroid of the region,
204342
+ * * `direction` is a unit vector perpendicular to the region plane,
204343
+ * * `a` is the region area.
204344
+ * @param region the region to process. Can lie in any plane.
204345
+ * @param result optional pre-allocated result to populate and return.
204346
+ */
204347
+ static centroidAreaNormal(region, result) {
204348
+ const localToWorld = _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_4__.FrameBuilder.createRightHandedFrame(undefined, region);
204349
+ if (!localToWorld)
204350
+ return undefined;
204351
+ const normal = localToWorld.matrix.columnZ(result?.direction);
204352
+ const regionIsXY = normal.isParallelTo(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Vector3d.unitZ(), true);
204353
+ let regionXY = region;
204354
+ if (!regionIsXY) { // rotate the region to be parallel to the xy-plane
204355
+ regionXY = region.cloneTransformed(localToWorld.inverse());
204356
+ if (!regionXY)
204357
+ return undefined;
204358
+ }
204359
+ const momentData = RegionOps.computeXYAreaMoments(regionXY);
204360
+ if (!momentData)
204361
+ return undefined;
204362
+ const centroid = momentData.origin.clone(result?.origin);
204363
+ if (!regionIsXY) // rotate centroid back (area is unchanged)
204364
+ localToWorld.multiplyPoint3d(centroid, centroid);
204365
+ let area = momentData.sums.weight();
204366
+ if (area < 0.0) {
204367
+ area = -area;
204368
+ normal.scale(-1.0, normal);
204369
+ }
204370
+ if (!result)
204371
+ result = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__.Ray3d.createCapture(centroid, normal);
204372
+ result.a = area;
204373
+ return result;
204374
+ }
204312
204375
  /**
204313
204376
  * Create loops in the graph.
204314
204377
  * @internal
204315
204378
  */
204316
204379
  static addLoopsToGraph(graph, data, announceIsolatedLoop) {
204317
- if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop) {
204380
+ if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop) {
204318
204381
  const points = data.getPackedStrokes();
204319
204382
  if (points)
204320
204383
  this.addLoopsToGraph(graph, points, announceIsolatedLoop);
204321
204384
  }
204322
- else if (data instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_5__.ParityRegion) {
204385
+ else if (data instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
204323
204386
  for (const child of data.children) {
204324
204387
  const points = child.getPackedStrokes();
204325
204388
  if (points)
204326
204389
  this.addLoopsToGraph(graph, points, announceIsolatedLoop);
204327
204390
  }
204328
204391
  }
204329
- else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
204330
- const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
204392
+ else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
204393
+ const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
204331
204394
  if (loopSeed !== undefined)
204332
204395
  announceIsolatedLoop(graph, loopSeed);
204333
204396
  }
204334
204397
  else if (Array.isArray(data)) {
204335
204398
  if (data.length > 0) {
204336
- if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__.Point3d.isAnyImmediatePointType(data[0])) {
204337
- const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
204399
+ if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.isAnyImmediatePointType(data[0])) {
204400
+ const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
204338
204401
  if (loopSeed !== undefined)
204339
204402
  announceIsolatedLoop(graph, loopSeed);
204340
204403
  }
204341
- else if (data[0] instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
204404
+ else if (data[0] instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
204342
204405
  for (const loop of data) {
204343
- const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.directCreateFaceLoopFromCoordinates(graph, loop);
204406
+ const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, loop);
204344
204407
  if (loopSeed !== undefined)
204345
204408
  announceIsolatedLoop(graph, loopSeed);
204346
204409
  }
@@ -204380,10 +204443,10 @@ class RegionOps {
204380
204443
  static finishGraphToPolyface(graph, triangulate) {
204381
204444
  if (graph) {
204382
204445
  if (triangulate) {
204383
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.triangulateAllPositiveAreaFaces(graph);
204384
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.flipTriangles(graph);
204446
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.triangulateAllPositiveAreaFaces(graph);
204447
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
204385
204448
  }
204386
- return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_9__.PolyfaceBuilder.graphToPolyface(graph);
204449
+ return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__.PolyfaceBuilder.graphToPolyface(graph);
204387
204450
  }
204388
204451
  return undefined;
204389
204452
  }
@@ -204397,7 +204460,7 @@ class RegionOps {
204397
204460
  * @param triangulate whether to triangulate the result
204398
204461
  */
204399
204462
  static polygonXYAreaIntersectLoopsToPolyface(loopsA, loopsB, triangulate = false) {
204400
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && inB), this._graphCheckPointFunction);
204463
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && inB), this._graphCheckPointFunction);
204401
204464
  return this.finishGraphToPolyface(graph, triangulate);
204402
204465
  }
204403
204466
  /**
@@ -204410,7 +204473,7 @@ class RegionOps {
204410
204473
  * @param triangulate whether to triangulate the result
204411
204474
  */
204412
204475
  static polygonXYAreaUnionLoopsToPolyface(loopsA, loopsB, triangulate = false) {
204413
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA || inB), this._graphCheckPointFunction);
204476
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA || inB), this._graphCheckPointFunction);
204414
204477
  return this.finishGraphToPolyface(graph, triangulate);
204415
204478
  }
204416
204479
  /**
@@ -204423,7 +204486,7 @@ class RegionOps {
204423
204486
  * @param triangulate whether to triangulate the result
204424
204487
  */
204425
204488
  static polygonXYAreaDifferenceLoopsToPolyface(loopsA, loopsB, triangulate = false) {
204426
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && !inB), this._graphCheckPointFunction);
204489
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && !inB), this._graphCheckPointFunction);
204427
204490
  return this.finishGraphToPolyface(graph, triangulate);
204428
204491
  }
204429
204492
  /**
@@ -204440,8 +204503,8 @@ class RegionOps {
204440
204503
  static regionBooleanXY(loopsA, loopsB, operation, mergeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
204441
204504
  // Always return UnionRegion for now. But keep return type as AnyRegion:
204442
204505
  // in the future, we might return the *simplest* region type.
204443
- const result = _UnionRegion__WEBPACK_IMPORTED_MODULE_11__.UnionRegion.create();
204444
- const context = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionBooleanContext.create(_RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union);
204506
+ const result = _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion.create();
204507
+ const context = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionBooleanContext.create(_RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union);
204445
204508
  context.addMembers(loopsA, loopsB);
204446
204509
  context.annotateAndMergeCurvesInGraph(mergeTolerance);
204447
204510
  const range = context.groupA.range().union(context.groupB.range());
@@ -204453,7 +204516,7 @@ class RegionOps {
204453
204516
  if (Math.abs(area) < areaTol)
204454
204517
  return;
204455
204518
  if (faceType === 1) {
204456
- const loop = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__.PlanarSubdivision.createLoopInFace(face);
204519
+ const loop = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.createLoopInFace(face);
204457
204520
  if (loop)
204458
204521
  result.tryAddChild(loop);
204459
204522
  }
@@ -204473,7 +204536,7 @@ class RegionOps {
204473
204536
  * @param triangulate whether to triangulate the result
204474
204537
  */
204475
204538
  static polygonBooleanXYToPolyface(inputA, operation, inputB, triangulate = false) {
204476
- 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);
204539
+ 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);
204477
204540
  return this.finishGraphToPolyface(graph, triangulate);
204478
204541
  }
204479
204542
  /**
@@ -204488,18 +204551,18 @@ class RegionOps {
204488
204551
  * @param inputB second set of loops
204489
204552
  */
204490
204553
  static polygonBooleanXYToLoops(inputA, operation, inputB) {
204491
- 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);
204554
+ 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);
204492
204555
  if (!graph)
204493
204556
  return undefined;
204494
- const loopEdges = _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_13__.HalfEdgeGraphSearch.collectExtendedBoundaryLoopsInGraph(graph, _topology_Graph__WEBPACK_IMPORTED_MODULE_14__.HalfEdgeMask.EXTERIOR);
204557
+ const loopEdges = _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_15__.HalfEdgeGraphSearch.collectExtendedBoundaryLoopsInGraph(graph, _topology_Graph__WEBPACK_IMPORTED_MODULE_16__.HalfEdgeMask.EXTERIOR);
204495
204558
  const allLoops = [];
204496
204559
  for (const graphLoop of loopEdges) {
204497
- const points = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray();
204560
+ const points = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray();
204498
204561
  for (const edge of graphLoop)
204499
204562
  points.pushXYZ(edge.x, edge.y, edge.z);
204500
204563
  points.pushWrap(1);
204501
- const loop = _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.create();
204502
- loop.tryAddChild(_LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d.createCapture(points));
204564
+ const loop = _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.create();
204565
+ loop.tryAddChild(_LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d.createCapture(points));
204503
204566
  allLoops.push(loop);
204504
204567
  }
204505
204568
  return RegionOps.sortOuterAndHoleLoopsXY(allLoops);
@@ -204517,7 +204580,7 @@ class RegionOps {
204517
204580
  * object.
204518
204581
  */
204519
204582
  static constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions) {
204520
- const context = new _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_17__.PolygonWireOffsetContext();
204583
+ const context = new _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_19__.PolygonWireOffsetContext();
204521
204584
  return context.constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions);
204522
204585
  }
204523
204586
  /**
@@ -204529,8 +204592,8 @@ class RegionOps {
204529
204592
  * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
204530
204593
  */
204531
204594
  static constructCurveXYOffset(curves, offsetDistanceOrOptions) {
204532
- const offsetOptions = _OffsetOptions__WEBPACK_IMPORTED_MODULE_18__.OffsetOptions.create(offsetDistanceOrOptions);
204533
- return _CurveOps__WEBPACK_IMPORTED_MODULE_19__.CurveOps.constructCurveXYOffset(curves, offsetOptions);
204595
+ const offsetOptions = _OffsetOptions__WEBPACK_IMPORTED_MODULE_20__.OffsetOptions.create(offsetDistanceOrOptions);
204596
+ return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.constructCurveXYOffset(curves, offsetOptions);
204534
204597
  }
204535
204598
  /**
204536
204599
  * Test if point (x,y) is IN, OUT or ON a region.
@@ -204540,7 +204603,7 @@ class RegionOps {
204540
204603
  * @param y y coordinate of point to test
204541
204604
  */
204542
204605
  static testPointInOnOutRegionXY(curves, x, y) {
204543
- return _Query_InOutTests__WEBPACK_IMPORTED_MODULE_20__.PointInOnOutContext.testPointInOnOutRegionXY(curves, x, y);
204606
+ return _Query_InOutTests__WEBPACK_IMPORTED_MODULE_22__.PointInOnOutContext.testPointInOnOutRegionXY(curves, x, y);
204544
204607
  }
204545
204608
  /**
204546
204609
  * Create curve collection of subtype determined by gaps between the input curves.
@@ -204564,11 +204627,11 @@ class RegionOps {
204564
204627
  maxGap = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.maxXY(maxGap, curves[i].endPoint().distance(curves[i + 1].startPoint()));
204565
204628
  let collection;
204566
204629
  if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(maxGap)) {
204567
- collection = wrap ? _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.create() : _Path__WEBPACK_IMPORTED_MODULE_21__.Path.create();
204630
+ collection = wrap ? _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.create() : _Path__WEBPACK_IMPORTED_MODULE_23__.Path.create();
204568
204631
  isPath = true;
204569
204632
  }
204570
204633
  else {
204571
- collection = _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.BagOfCurves.create();
204634
+ collection = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.BagOfCurves.create();
204572
204635
  }
204573
204636
  for (const c of curves)
204574
204637
  collection.tryAddChild(c);
@@ -204594,7 +204657,7 @@ class RegionOps {
204594
204657
  * @param cutterCurves input curves to intersect with `curvesToCut`
204595
204658
  */
204596
204659
  static cloneCurvesWithXYSplits(curvesToCut, cutterCurves) {
204597
- return _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_23__.CurveSplitContext.cloneCurvesWithXYSplits(curvesToCut, cutterCurves);
204660
+ return _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_25__.CurveSplitContext.cloneCurvesWithXYSplits(curvesToCut, cutterCurves);
204598
204661
  }
204599
204662
  /**
204600
204663
  * Create paths assembled from many curves.
@@ -204605,11 +204668,11 @@ class RegionOps {
204605
204668
  static splitToPathsBetweenBreaks(source, makeClones) {
204606
204669
  if (source === undefined)
204607
204670
  return undefined;
204608
- if (source instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__.CurvePrimitive)
204671
+ if (source instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive)
204609
204672
  return source;
204610
204673
  // source is a collection . ..
204611
204674
  const primitives = source.collectCurvePrimitives();
204612
- const chainCollector = new _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_25__.ChainCollectorContext(makeClones);
204675
+ const chainCollector = new _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_27__.ChainCollectorContext(makeClones);
204613
204676
  for (const primitive of primitives) {
204614
204677
  chainCollector.announceCurvePrimitive(primitive);
204615
204678
  }
@@ -204625,7 +204688,7 @@ class RegionOps {
204625
204688
  * @returns object with named chains, insideOffsets, outsideOffsets
204626
204689
  */
204627
204690
  static collectInsideAndOutsideOffsets(fragments, offsetDistance, gapTolerance) {
204628
- return _CurveOps__WEBPACK_IMPORTED_MODULE_19__.CurveOps.collectInsideAndOutsideXYOffsets(fragments, offsetDistance, gapTolerance);
204691
+ return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.collectInsideAndOutsideXYOffsets(fragments, offsetDistance, gapTolerance);
204629
204692
  }
204630
204693
  /**
204631
204694
  * Restructure curve fragments as Paths and Loops.
@@ -204634,7 +204697,7 @@ class RegionOps {
204634
204697
  * @returns chains, possibly wrapped in a [[BagOfCurves]].
204635
204698
  */
204636
204699
  static collectChains(fragments, gapTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
204637
- return _CurveOps__WEBPACK_IMPORTED_MODULE_19__.CurveOps.collectChains(fragments, gapTolerance);
204700
+ return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.collectChains(fragments, gapTolerance);
204638
204701
  }
204639
204702
  /**
204640
204703
  * Find all intersections among curves in `curvesToCut` against the boundaries of `region` and return fragments
@@ -204646,17 +204709,17 @@ class RegionOps {
204646
204709
  const result = { insideParts: [], outsideParts: [], coincidentParts: [] };
204647
204710
  const pathWithIntersectionMarkup = RegionOps.cloneCurvesWithXYSplits(curvesToCut, region);
204648
204711
  const splitPaths = RegionOps.splitToPathsBetweenBreaks(pathWithIntersectionMarkup, true);
204649
- if (splitPaths instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection) {
204712
+ if (splitPaths instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection) {
204650
204713
  for (const child of splitPaths.children) {
204651
- const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(child);
204714
+ const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(child);
204652
204715
  if (pointOnChild) {
204653
204716
  const inOnOut = RegionOps.testPointInOnOutRegionXY(region, pointOnChild.point.x, pointOnChild.point.y);
204654
204717
  pushToInOnOutArrays(child, inOnOut, result.outsideParts, result.coincidentParts, result.insideParts);
204655
204718
  }
204656
204719
  }
204657
204720
  }
204658
- else if (splitPaths instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__.CurvePrimitive) {
204659
- const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(splitPaths);
204721
+ else if (splitPaths instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive) {
204722
+ const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(splitPaths);
204660
204723
  if (pointOnChild) {
204661
204724
  const inOnOut = RegionOps.testPointInOnOutRegionXY(region, pointOnChild.point.x, pointOnChild.point.y);
204662
204725
  pushToInOnOutArrays(splitPaths, inOnOut, result.outsideParts, result.coincidentParts, result.insideParts);
@@ -204680,10 +204743,10 @@ class RegionOps {
204680
204743
  * normal in z column. If not a rectangle, return undefined.
204681
204744
  */
204682
204745
  static rectangleEdgeTransform(data, requireClosurePoint = true) {
204683
- if (data instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
204746
+ if (data instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
204684
204747
  return this.rectangleEdgeTransform(data.packedPoints);
204685
204748
  }
204686
- else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
204749
+ else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
204687
204750
  let dataToUse;
204688
204751
  if (requireClosurePoint && data.length === 5) {
204689
204752
  if (!_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(data.distanceIndexIndex(0, 4)))
@@ -204697,8 +204760,8 @@ class RegionOps {
204697
204760
  return undefined;
204698
204761
  }
204699
204762
  else {
204700
- dataToUse = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray.create(data);
204701
- _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_26__.PolylineCompressionContext.compressInPlaceByShortEdgeLength(dataToUse, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
204763
+ dataToUse = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(data);
204764
+ _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_28__.PolylineCompressionContext.compressInPlaceByShortEdgeLength(dataToUse, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
204702
204765
  if (dataToUse.length < (requireClosurePoint ? 5 : 4))
204703
204766
  return undefined;
204704
204767
  }
@@ -204709,19 +204772,19 @@ class RegionOps {
204709
204772
  if (normalVector.normalizeInPlace()
204710
204773
  && vector12.isAlmostEqual(vector03)
204711
204774
  && vector01.isPerpendicularTo(vector03)) {
204712
- return _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_27__.Transform.createOriginAndMatrixColumns(dataToUse.getPoint3dAtUncheckedPointIndex(0), vector01, vector03, normalVector);
204775
+ return _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_29__.Transform.createOriginAndMatrixColumns(dataToUse.getPoint3dAtUncheckedPointIndex(0), vector01, vector03, normalVector);
204713
204776
  }
204714
204777
  }
204715
204778
  else if (Array.isArray(data)) {
204716
- return this.rectangleEdgeTransform(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_28__.Point3dArrayCarrier(data), requireClosurePoint);
204779
+ return this.rectangleEdgeTransform(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__.Point3dArrayCarrier(data), requireClosurePoint);
204717
204780
  }
204718
- else if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
204781
+ else if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
204719
204782
  return this.rectangleEdgeTransform(data.children[0].packedPoints, true);
204720
204783
  }
204721
- else if (data instanceof _Path__WEBPACK_IMPORTED_MODULE_21__.Path && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
204784
+ else if (data instanceof _Path__WEBPACK_IMPORTED_MODULE_23__.Path && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
204722
204785
  return this.rectangleEdgeTransform(data.children[0].packedPoints, requireClosurePoint);
204723
204786
  }
204724
- else if (data instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveChain) {
204787
+ else if (data instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveChain) {
204725
204788
  if (!data.checkForNonLinearPrimitives()) {
204726
204789
  // const linestring = LineString3d.create();
204727
204790
  const strokes = data.getPackedStrokes();
@@ -204745,7 +204808,7 @@ class RegionOps {
204745
204808
  * @param options options for tolerance and selective simplification.
204746
204809
  */
204747
204810
  static consolidateAdjacentPrimitives(curves, options) {
204748
- const context = new _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_29__.ConsolidateAdjacentCurvePrimitivesContext(options);
204811
+ const context = new _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_31__.ConsolidateAdjacentCurvePrimitivesContext(options);
204749
204812
  curves.dispatchToGeometryHandler(context);
204750
204813
  }
204751
204814
  /**
@@ -204763,14 +204826,14 @@ class RegionOps {
204763
204826
  static sortOuterAndHoleLoopsXY(loops) {
204764
204827
  const loopAndArea = [];
204765
204828
  for (const candidate of loops) {
204766
- if (candidate instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop)
204767
- _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__.SortablePolygon.pushLoop(loopAndArea, candidate);
204768
- else if (candidate instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
204769
- const loop = _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.createPolygon(candidate);
204770
- _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__.SortablePolygon.pushLoop(loopAndArea, loop);
204829
+ if (candidate instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop)
204830
+ _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.pushLoop(loopAndArea, candidate);
204831
+ else if (candidate instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
204832
+ const loop = _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.createPolygon(candidate);
204833
+ _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.pushLoop(loopAndArea, loop);
204771
204834
  }
204772
204835
  }
204773
- return _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__.SortablePolygon.sortAsAnyRegion(loopAndArea);
204836
+ return _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.sortAsAnyRegion(loopAndArea);
204774
204837
  }
204775
204838
  /**
204776
204839
  * Find all xy-areas bounded by the unstructured, possibly intersecting curves.
@@ -204796,9 +204859,9 @@ class RegionOps {
204796
204859
  const primitives = RegionOps.collectCurvePrimitives(curvesAndRegions, undefined, true, true);
204797
204860
  const range = this.curveArrayRange(primitives);
204798
204861
  const areaTol = this.computeXYAreaTolerance(range, tolerance);
204799
- const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_31__.CurveCurve.allIntersectionsAmongPrimitivesXY(primitives, tolerance);
204800
- const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__.PlanarSubdivision.assembleHalfEdgeGraph(primitives, intersections, tolerance);
204801
- return _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__.PlanarSubdivision.collectSignedLoopSetsInHalfEdgeGraph(graph, areaTol);
204862
+ const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_33__.CurveCurve.allIntersectionsAmongPrimitivesXY(primitives, tolerance);
204863
+ const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.assembleHalfEdgeGraph(primitives, intersections, tolerance);
204864
+ return _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.collectSignedLoopSetsInHalfEdgeGraph(graph, areaTol);
204802
204865
  }
204803
204866
  /**
204804
204867
  * Collect all `CurvePrimitives` in loosely typed input.
@@ -204813,10 +204876,10 @@ class RegionOps {
204813
204876
  */
204814
204877
  static collectCurvePrimitives(candidates, collectorArray, smallestPossiblePrimitives = false, explodeLinestrings = false) {
204815
204878
  const results = collectorArray === undefined ? [] : collectorArray;
204816
- if (candidates instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__.CurvePrimitive) {
204879
+ if (candidates instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive) {
204817
204880
  candidates.collectCurvePrimitives(results, smallestPossiblePrimitives, explodeLinestrings);
204818
204881
  }
204819
- else if (candidates instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection) {
204882
+ else if (candidates instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection) {
204820
204883
  candidates.collectCurvePrimitives(results, smallestPossiblePrimitives, explodeLinestrings);
204821
204884
  }
204822
204885
  else if (Array.isArray(candidates)) {
@@ -204835,7 +204898,7 @@ class RegionOps {
204835
204898
  static expandLineStrings(candidates) {
204836
204899
  const result = [];
204837
204900
  for (const c of candidates) {
204838
- if (c instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
204901
+ if (c instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
204839
204902
  for (let i = 0; i + 1 < c.packedPoints.length; i++) {
204840
204903
  const q = c.getIndexedSegment(i);
204841
204904
  if (q !== undefined)
@@ -204854,16 +204917,16 @@ class RegionOps {
204854
204917
  * @param worldToLocal transform to apply to data before computing its range
204855
204918
  */
204856
204919
  static curveArrayRange(data, worldToLocal) {
204857
- const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_32__.Range3d.create();
204858
- if (data instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_33__.GeometryQuery)
204920
+ const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_34__.Range3d.create();
204921
+ if (data instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_35__.GeometryQuery)
204859
204922
  data.extendRange(range, worldToLocal);
204860
204923
  else if (Array.isArray(data)) {
204861
204924
  for (const c of data) {
204862
- if (c instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_33__.GeometryQuery)
204925
+ if (c instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_35__.GeometryQuery)
204863
204926
  c.extendRange(range, worldToLocal);
204864
- else if (c instanceof _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__.Point3d)
204927
+ else if (c instanceof _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d)
204865
204928
  range.extendPoint(c, worldToLocal);
204866
- else if (c instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray)
204929
+ else if (c instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray)
204867
204930
  range.extendRange(c.getRange(worldToLocal));
204868
204931
  else if (Array.isArray(c))
204869
204932
  range.extendRange(this.curveArrayRange(c, worldToLocal));
@@ -204882,37 +204945,37 @@ class RegionOps {
204882
204945
  if (polygons.length === 0)
204883
204946
  return undefined;
204884
204947
  const firstEntry = polygons[0];
204885
- if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__.Point3d.isAnyImmediatePointType(firstEntry)) {
204886
- graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
204948
+ if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.isAnyImmediatePointType(firstEntry)) {
204949
+ graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
204887
204950
  }
204888
204951
  else if (polygons.length > 1) {
204889
204952
  let writablePolygons;
204890
- if (firstEntry instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedReadWriteXYZCollection) {
204953
+ if (firstEntry instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedReadWriteXYZCollection) {
204891
204954
  writablePolygons = polygons;
204892
204955
  }
204893
204956
  else {
204894
204957
  writablePolygons = [];
204895
204958
  for (const polygon of polygons)
204896
- writablePolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray.create(polygon));
204959
+ writablePolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(polygon));
204897
204960
  }
204898
- const sortedPolygons = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_34__.PolygonOps.sortOuterAndHoleLoopsXY(writablePolygons);
204961
+ const sortedPolygons = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_36__.PolygonOps.sortOuterAndHoleLoopsXY(writablePolygons);
204899
204962
  if (sortedPolygons.length === 1) { // below requires exactly one outer loop!
204900
- if (graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromLoops(sortedPolygons[0]))
204901
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.flipTriangles(graph);
204963
+ if (graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromLoops(sortedPolygons[0]))
204964
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
204902
204965
  }
204903
204966
  }
204904
204967
  else {
204905
- graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromSingleLoop(firstEntry);
204968
+ graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(firstEntry);
204906
204969
  }
204907
204970
  }
204908
204971
  else {
204909
- graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
204972
+ graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
204910
204973
  }
204911
204974
  if (!graph) {
204912
204975
  // Last resort: try full merge. Conveniently, multiple polygons are processed with parity logic.
204913
- if (graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(polygons, [], (inA, _inB) => inA)) {
204914
- if (_topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.triangulateAllPositiveAreaFaces(graph))
204915
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.flipTriangles(graph);
204976
+ if (graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(polygons, [], (inA, _inB) => inA)) {
204977
+ if (_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.triangulateAllPositiveAreaFaces(graph))
204978
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
204916
204979
  }
204917
204980
  }
204918
204981
  return graph;
@@ -204922,13 +204985,13 @@ class RegionOps {
204922
204985
  const strokedComponent = component.cloneStroked(options);
204923
204986
  // package the stroked region as polygons
204924
204987
  const polygons = [];
204925
- if (strokedComponent instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop) {
204926
- if (strokedComponent.children.length > 0 && strokedComponent.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d)
204988
+ if (strokedComponent instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop) {
204989
+ if (strokedComponent.children.length > 0 && strokedComponent.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d)
204927
204990
  polygons.push(strokedComponent.children[0].packedPoints); // expect only 1
204928
204991
  }
204929
- else if (strokedComponent instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_5__.ParityRegion) {
204992
+ else if (strokedComponent instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
204930
204993
  for (const strokedLoop of strokedComponent.children) {
204931
- if (strokedLoop.children.length > 0 && strokedLoop.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d)
204994
+ if (strokedLoop.children.length > 0 && strokedLoop.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d)
204932
204995
  polygons.push(strokedLoop.children[0].packedPoints); // expect only 1
204933
204996
  }
204934
204997
  }
@@ -204958,7 +205021,7 @@ class RegionOps {
204958
205021
  */
204959
205022
  static facetRegionXY(region, options) {
204960
205023
  let graph;
204961
- if (region instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_11__.UnionRegion) {
205024
+ if (region instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion) {
204962
205025
  for (const child of region.children) {
204963
205026
  const childGraph = RegionOps.triangulateRegionComponent(child, options);
204964
205027
  if (childGraph) {
@@ -204980,8 +205043,8 @@ class RegionOps {
204980
205043
  if (!graph)
204981
205044
  return undefined;
204982
205045
  if (options?.maximizeConvexFacets)
204983
- _topology_Merging__WEBPACK_IMPORTED_MODULE_35__.HalfEdgeGraphOps.expandConvexFaces(graph);
204984
- return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_9__.PolyfaceBuilder.graphToPolyface(graph, options);
205046
+ _topology_Merging__WEBPACK_IMPORTED_MODULE_37__.HalfEdgeGraphOps.expandConvexFaces(graph);
205047
+ return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__.PolyfaceBuilder.graphToPolyface(graph, options);
204985
205048
  }
204986
205049
  /**
204987
205050
  * Decompose a polygon with optional holes into an array of convex polygons.
@@ -204994,11 +205057,11 @@ class RegionOps {
204994
205057
  if (!graph)
204995
205058
  return undefined;
204996
205059
  if (maximize)
204997
- _topology_Merging__WEBPACK_IMPORTED_MODULE_35__.HalfEdgeGraphOps.expandConvexFaces(graph);
205060
+ _topology_Merging__WEBPACK_IMPORTED_MODULE_37__.HalfEdgeGraphOps.expandConvexFaces(graph);
204998
205061
  const convexPolygons = [];
204999
205062
  graph.announceFaceLoops((_graph, seed) => {
205000
- if (!seed.isMaskSet(_topology_Graph__WEBPACK_IMPORTED_MODULE_14__.HalfEdgeMask.EXTERIOR))
205001
- convexPolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray.create(seed.collectAroundFace((node) => { return node.getPoint3d(); })));
205063
+ if (!seed.isMaskSet(_topology_Graph__WEBPACK_IMPORTED_MODULE_16__.HalfEdgeMask.EXTERIOR))
205064
+ convexPolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(seed.collectAroundFace((node) => { return node.getPoint3d(); })));
205002
205065
  return true;
205003
205066
  });
205004
205067
  return convexPolygons;
@@ -228765,9 +228828,9 @@ class Vector3d extends XYZ {
228765
228828
  if (dot < 0.0 && !oppositeIsParallel)
228766
228829
  return false;
228767
228830
  const cross2 = this.crossProductMagnitudeSquared(other);
228768
- /* a2,b2,cross2 are squared lengths of respective vectors */
228769
- /* cross2 = sin^2(theta) * a2 * b2 */
228770
- /* For small theta, sin^2(theta)~~theta^2 */
228831
+ // a2,b2,cross2 are squared lengths of respective vectors
228832
+ // cross2 = sin^2(theta) * a2 * b2
228833
+ // For small theta, sin^2(theta) ~ theta^2
228771
228834
  return cross2 <= radianSquaredTol * a2 * b2;
228772
228835
  }
228773
228836
  /**
@@ -230722,26 +230785,28 @@ class PolygonOps {
230722
230785
  return s;
230723
230786
  }
230724
230787
  /**
230725
- * Return a Ray3d with (assuming the polygon is planar and not self-intersecting):
230726
- * * `origin` at the centroid of the (3D) polygon,
230727
- * * `direction` is the unit vector perpendicular to the plane,
230728
- * * `a` is the area.
230729
- * @param points
230788
+ * Return a [[Ray3d]] with:
230789
+ * * `origin` is the centroid of the polygon,
230790
+ * * `direction` is a unit vector perpendicular to the polygon plane,
230791
+ * * `a` is the polygon area.
230792
+ * @param points the polygon vertices in order. Points can lie in any plane. First and last point do not have to be equal.
230793
+ * @param result optional pre-allocated result to populate and return.
230730
230794
  */
230731
- static centroidAreaNormal(points) {
230795
+ static centroidAreaNormal(points, result) {
230732
230796
  if (Array.isArray(points)) {
230733
230797
  const carrier = new _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_5__.Point3dArrayCarrier(points);
230734
- return this.centroidAreaNormal(carrier);
230798
+ return this.centroidAreaNormal(carrier, result);
230735
230799
  }
230736
230800
  const n = points.length;
230737
230801
  if (n === 3) {
230738
- const normal = points.crossProductIndexIndexIndex(0, 1, 2);
230802
+ const normal = points.crossProductIndexIndexIndex(0, 1, 2, result?.direction);
230739
230803
  const a = 0.5 * normal.magnitude();
230740
- const centroid = points.getPoint3dAtCheckedPointIndex(0);
230804
+ const centroid = points.getPoint3dAtCheckedPointIndex(0, result?.origin);
230741
230805
  points.accumulateScaledXYZ(1, 1.0, centroid);
230742
230806
  points.accumulateScaledXYZ(2, 1.0, centroid);
230743
230807
  centroid.scaleInPlace(1.0 / 3.0);
230744
- const result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
230808
+ if (!result)
230809
+ result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
230745
230810
  if (result.tryNormalizeInPlaceWithAreaWeight(a))
230746
230811
  return result;
230747
230812
  return undefined;
@@ -230759,22 +230824,24 @@ class PolygonOps {
230759
230824
  points.vectorXYAndZIndex(origin, 1, vector0);
230760
230825
  let cross = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
230761
230826
  const centroidSum = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
230762
- const normalSum = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
230827
+ const normal = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero(result?.direction);
230763
230828
  let signedTriangleArea;
230764
- // This will work with or without closure edge. If closure is given, the last vector is 000.
230829
+ // This will work with or without closure edge. If closure is given, the last vector is 000.
230765
230830
  for (let i = 2; i < n; i++) {
230766
230831
  points.vectorXYAndZIndex(origin, i, vector1);
230767
230832
  cross = vector0.crossProduct(vector1, cross);
230768
230833
  signedTriangleArea = areaNormal.dotProduct(cross); // well, actually twice the area.
230769
- normalSum.addInPlace(cross); // this grows to twice the area
230834
+ normal.addInPlace(cross); // this grows to twice the area
230770
230835
  const b = signedTriangleArea / 6.0;
230771
230836
  centroidSum.plus2Scaled(vector0, b, vector1, b, centroidSum);
230772
230837
  vector0.setFrom(vector1);
230773
230838
  }
230774
- const area = 0.5 * normalSum.magnitude();
230839
+ const area = 0.5 * normal.magnitude();
230775
230840
  const inverseArea = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.conditionalDivideFraction(1, area);
230776
230841
  if (inverseArea !== undefined) {
230777
- const result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(origin.plusScaled(centroidSum, inverseArea), normalSum);
230842
+ const centroid = origin.plusScaled(centroidSum, inverseArea, result?.origin);
230843
+ if (!result)
230844
+ result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
230778
230845
  result.tryNormalizeInPlaceWithAreaWeight(area);
230779
230846
  return result;
230780
230847
  }
@@ -237748,19 +237815,19 @@ class Matrix4d {
237748
237815
  this._coffs[15] += scale * beta;
237749
237816
  }
237750
237817
  /**
237751
- * Multiply and replace contents of this matrix by A*this*AT where
237752
- * * A is a pure translation with final column [x,y,z,1]
237753
- * * this is this matrix.
237754
- * * AT is the transpose of A.
237755
- * @param ax x part of translation
237756
- * @param ay y part of translation
237757
- * @param az z part of translation
237818
+ * Multiply and replace contents of ` this` matrix by `A*this*AT` where
237819
+ * * `A` is a pure translation with final column [x,y,z,1].
237820
+ * * `this` is this matrix.
237821
+ * * `AT` is the transpose of A.
237822
+ * @param ax x part of translation.
237823
+ * @param ay y part of translation.
237824
+ * @param az z part of translation.
237758
237825
  */
237759
237826
  multiplyTranslationSandwichInPlace(ax, ay, az) {
237760
237827
  const bx = this._coffs[3];
237761
237828
  const by = this._coffs[7];
237762
237829
  const bz = this._coffs[11];
237763
- // matrixB can be non-symmetric!!
237830
+ // matrixB can be non-symmetric
237764
237831
  const cx = this._coffs[12];
237765
237832
  const cy = this._coffs[13];
237766
237833
  const cz = this._coffs[14];
@@ -237783,7 +237850,7 @@ class Matrix4d {
237783
237850
  this._coffs[12] += axBeta;
237784
237851
  this._coffs[13] += ayBeta;
237785
237852
  this._coffs[14] += azBeta;
237786
- // coffs[15] is unchanged !!!
237853
+ // coffs[15] is unchanged
237787
237854
  }
237788
237855
  }
237789
237856
 
@@ -237834,8 +237901,8 @@ __webpack_require__.r(__webpack_exports__);
237834
237901
  * * e.g. entry 03 is summed x.
237835
237902
  * * In this level:
237836
237903
  * * the `absoluteQuantity` member is undefined.
237837
- * * the `localToWorldMap` and `radiiOfGyration` are created by have undefined contents.
237838
- * * Second level: after a call to inertiaProductsToPrincipalAxes, the `localToWorldMap`, `absoluteQuantity` and
237904
+ * * the `localToWorldMap` and `radiiOfGyration` are created but have undefined contents.
237905
+ * * Second level: after a call to `inertiaProductsToPrincipalAxes`, the `localToWorldMap`, `absoluteQuantity` and
237839
237906
  * `radiiOfGyration` are filled in.
237840
237907
  * @public
237841
237908
  */
@@ -237855,18 +237922,35 @@ class MomentData {
237855
237922
  * * This set up with its inverse already constructed.
237856
237923
  */
237857
237924
  localToWorldMap;
237925
+ /** Radii of gyration (square roots of principal second moments). */
237926
+ radiusOfGyration;
237927
+ /**
237928
+ * Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
237929
+ * inertiaProductsToPrincipalAxes.
237930
+ */
237931
+ absoluteQuantity;
237858
237932
  // private variables
237859
237933
  static _vectorA;
237860
237934
  static _vectorB;
237861
237935
  static _vectorC;
237862
237936
  _point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
237863
237937
  _point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
237938
+ /** Constructor. */
237939
+ constructor() {
237940
+ this.origin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
237941
+ this.needOrigin = false;
237942
+ this.sums = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createZero();
237943
+ this.localToWorldMap = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity();
237944
+ this.radiusOfGyration = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
237945
+ this.absoluteQuantity = 0.1; // so optimizer sees its type
237946
+ this.absoluteQuantity = undefined;
237947
+ }
237864
237948
  /**
237865
237949
  * Return the lower-right (3,3) entry in the sums.
237866
237950
  * * This is the quantity (i.e. length, area, or volume) summed.
237867
237951
  */
237868
237952
  get quantitySum() {
237869
- return this.sums.atIJ(3, 3);
237953
+ return this.sums.weight();
237870
237954
  }
237871
237955
  /**
237872
237956
  * Return a scale factor to make these sums match the target orientation sign.
@@ -237897,23 +237981,6 @@ class MomentData {
237897
237981
  this.needOrigin = false;
237898
237982
  }
237899
237983
  }
237900
- /** Radii of gyration (square roots of principal second moments). */
237901
- radiusOfGyration;
237902
- /**
237903
- * Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
237904
- * inertiaProductsToPrincipalAxes.
237905
- */
237906
- absoluteQuantity;
237907
- /** Constructor. */
237908
- constructor() {
237909
- this.origin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
237910
- this.sums = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createZero();
237911
- this.localToWorldMap = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity();
237912
- this.radiusOfGyration = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
237913
- this.needOrigin = false;
237914
- this.absoluteQuantity = 0.1; // so optimizer sees its type
237915
- this.absoluteQuantity = undefined;
237916
- }
237917
237984
  /**
237918
237985
  * Create moments with optional origin.
237919
237986
  * * Origin and needOrigin are quirky.
@@ -237957,7 +238024,7 @@ class MomentData {
237957
238024
  axes.setColumnsPoint4dXYZ(points[0], points[1], points[2]);
237958
238025
  if (axes.determinant() < 0)
237959
238026
  axes.scaleColumnsInPlace(-1.0, -1.0, -1.0);
237960
- // prefer x and z positive -- y falls wherever . ..
238027
+ // prefer x and z positive; y falls wherever
237961
238028
  if (axes.at(0, 0) < 0.0)
237962
238029
  axes.scaleColumnsInPlace(-1.0, -1.0, 1.0);
237963
238030
  if (axes.at(2, 2) < 0.0)
@@ -237982,7 +238049,8 @@ class MomentData {
237982
238049
  * * Hence x axis is long direction.
237983
238050
  * * Hence planar data generates large moment as Z.
237984
238051
  * @param origin The origin used for the inertia products.
237985
- * @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].
238052
+ * @param inertiaProducts The inertia products: sums or integrals of
238053
+ * [xx,xy,xz,xw; yx,yy,yz,yw; zx,zy,zz,zw; wx,wy,wz,w].
237986
238054
  */
237987
238055
  static inertiaProductsToPrincipalAxes(origin, inertiaProducts) {
237988
238056
  const moments = new MomentData();
@@ -238026,23 +238094,21 @@ class MomentData {
238026
238094
  */
238027
238095
  static areEquivalentPrincipalAxes(dataA, dataB) {
238028
238096
  if (dataA && dataB
238029
- && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { // um.. need different tolerance for area, volume?)
238097
+ && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { // TODO: need different tolerance for area, volume?
238030
238098
  if (dataA.localToWorldMap.getOrigin().isAlmostEqual(dataB.localToWorldMap.getOrigin())
238031
238099
  && dataA.radiusOfGyration.isAlmostEqual(dataB.radiusOfGyration)) {
238032
238100
  if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.y)) {
238033
- // We have at least xy symmetry ....
238101
+ // we have at least xy symmetry
238034
238102
  if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.z))
238035
238103
  return true;
238036
- // just xy.
238037
- // allow opposite z directions.
238038
- // If the z's are aligned, x an dy can spin freely.
238104
+ // just xy; allow opposite z directions; if the z's are aligned, x and y can spin freely
238039
238105
  const zA = dataA.localToWorldMap.matrix.columnZ();
238040
238106
  const zB = dataB.localToWorldMap.matrix.columnZ();
238041
238107
  if (zA.isParallelTo(zB, true))
238042
238108
  return true;
238043
238109
  return false;
238044
238110
  }
238045
- // no symmetry. Test all three axes.
238111
+ // no symmetry; test all three axes
238046
238112
  const vectorA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
238047
238113
  const vectorB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
238048
238114
  for (let i = 0; i < 3; i++) {
@@ -238072,7 +238138,7 @@ class MomentData {
238072
238138
  }
238073
238139
  /** Revise the accumulated sums to be "around the centroid". */
238074
238140
  shiftOriginAndSumsToCentroidOfSums() {
238075
- const xyz = this.sums.columnW().realPoint();
238141
+ const xyz = this.sums.columnW().realPoint(); // centroid of the geometry
238076
238142
  if (xyz) {
238077
238143
  this.shiftOriginAndSumsByXYZ(xyz.x, xyz.y, xyz.z);
238078
238144
  return true;
@@ -238081,9 +238147,9 @@ class MomentData {
238081
238147
  }
238082
238148
  /**
238083
238149
  * Revise the accumulated sums.
238084
- * * add ax,ay,ax to the origin coordinates.
238085
- * * apply the negative translation to the sums.
238086
- */
238150
+ * * Add (ax,ay,az) to the origin coordinates.
238151
+ * * Apply the negative translation to the sums.
238152
+ */
238087
238153
  shiftOriginAndSumsByXYZ(ax, ay, az) {
238088
238154
  this.origin.addXYZInPlace(ax, ay, az);
238089
238155
  this.sums.multiplyTranslationSandwichInPlace(-ax, -ay, -az);
@@ -238093,23 +238159,24 @@ class MomentData {
238093
238159
  this.shiftOriginAndSumsByXYZ(newOrigin.x - this.origin.x, newOrigin.y - this.origin.y, newOrigin.z - this.origin.z);
238094
238160
  }
238095
238161
  /**
238096
- * Compute moments of a triangle from the origin to the given line.
238097
- * Accumulate them to this.sums.
238098
- * * If `pointA` is undefined, use `this.origin` as pointA.
238099
- * * If `this.needOrigin` is set, pointB is used
238100
- */
238162
+ * Compute moments of a triangle from the origin. Accumulate them to `this.sums`.
238163
+ * * If `this.needOrigin` is set, `this.origin` is set to `pointB`.
238164
+ * * If `pointA` is undefined, use `this.origin` as `pointA`.
238165
+ */
238101
238166
  accumulateTriangleMomentsXY(pointA, pointB, pointC) {
238102
238167
  this.setOriginXYZIfNeeded(pointB.x, pointB.y, 0.0);
238103
238168
  const x0 = this.origin.x;
238104
238169
  const y0 = this.origin.y;
238105
- const vectorA = MomentData._vectorA =
238106
- pointA !== undefined ? _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointA.x - x0, pointA.y - y0, 0.0, 1.0, MomentData._vectorA)
238107
- : _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(this.origin.x, this.origin.y, 0.0, 1.0, MomentData._vectorA);
238170
+ const vectorA = MomentData._vectorA = (pointA !== undefined) ?
238171
+ _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointA.x - x0, pointA.y - y0, 0.0, 1.0, MomentData._vectorA) :
238172
+ _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(0.0, 0.0, 0.0, 1.0, MomentData._vectorA);
238108
238173
  const vectorB = MomentData._vectorB = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointB.x - x0, pointB.y - y0, 0.0, 1.0, MomentData._vectorB);
238109
238174
  const vectorC = MomentData._vectorC = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointC.x - x0, pointC.y - y0, 0.0, 1.0, MomentData._vectorC);
238110
- // 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
238111
- // where w = 1-u-v
238112
- // W = column vector (point00.x, point00.y, point00.z, 1.0) etc.
238175
+ // Below we calculate 16 double integrals: \iint_T [x y 0 1]^ [x y 0 1] dT over triangle T=(A,B,C).
238176
+ // Each accumulates contributions from 9 scaled outer products. Integration computations use the barycentric
238177
+ // change of variables [B-A C-A][u,v]^ = [x,y]^ with Jacobian detJ = B-A x C-A = twice the area of T.
238178
+ // This converts the integration domain from T to the triangle bounded by u=0, v=0 and v=1-u, yielding e.g.,
238179
+ // \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.
238113
238180
  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);
238114
238181
  if (detJ !== 0.0) {
238115
238182
  const r1_12 = detJ / 12.0;
@@ -238125,7 +238192,7 @@ class MomentData {
238125
238192
  this.sums.addScaledOuterProductInPlace(vectorC, vectorC, r1_12);
238126
238193
  }
238127
238194
  }
238128
- /** Add scaled outer product of (4d, unit weight) point to this.sums. */
238195
+ /** Add scaled outer product of (4d, unit weight) point to `this.sums`. */
238129
238196
  accumulateScaledOuterProduct(point, scaleFactor) {
238130
238197
  this.setOriginXYZIfNeeded(point.x, point.y, 0.0);
238131
238198
  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);
@@ -238148,16 +238215,15 @@ class MomentData {
238148
238215
  this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_3);
238149
238216
  }
238150
238217
  /**
238151
- * Compute moments of triangles from a base point to the given linestring.
238152
- * Accumulate them to this.sums.
238153
- * * If `pointA` is undefined, use `this.origin` as pointA.
238154
- * * If `this.needOrigin` is set, the first point of the array is captured as local origin for subsequent sums.
238155
- *
238218
+ * Compute moments of triangles from a base point to the given linestring. Accumulate them to `this.sums`.
238219
+ * * If `this.needOrigin` is set, `this.origin` is set to the first point of the array.
238220
+ * * If `sweepBase` is undefined, use `this.origin` as `sweepBase`.
238156
238221
  */
238157
238222
  accumulateTriangleToLineStringMomentsXY(sweepBase, points) {
238158
238223
  const n = points.length;
238159
238224
  if (n > 1) {
238160
238225
  points.getPoint3dAtUncheckedPointIndex(0, this._point0);
238226
+ // The linestring forms a polygon with sweepBase. Integrate over this polygon using Shoelace algorithm.
238161
238227
  for (let i = 1; i < n; i++) {
238162
238228
  points.getPoint3dAtUncheckedPointIndex(i, this._point1);
238163
238229
  this.accumulateTriangleMomentsXY(sweepBase, this._point0, this._point1);
@@ -238166,17 +238232,17 @@ class MomentData {
238166
238232
  }
238167
238233
  }
238168
238234
  /**
238169
- * * 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].
238170
- * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin]. (Column weights 0001) (only xy
238171
- * parts of vectors).
238172
- * * scale by detJ for the xy-only determinant of the vectors.
238235
+ * 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].
238236
+ * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin].
238237
+ * (column weights 0001; only xy parts of vectors).
238238
+ * * Scale by detJ for the xy-only determinant of the vectors.
238173
238239
  * @param productXX
238174
238240
  * @param productXY
238175
238241
  * @param productYY
238176
- * @param area Area in caller's system.
238177
- * @param origin Caller's origin.
238178
- * @param vectorU Caller's U axis (not necessarily unit).
238179
- * @param vectorV Caller's V axis (not necessarily unit).
238242
+ * @param area area in caller's system.
238243
+ * @param origin caller's origin.
238244
+ * @param vectorU caller's U axis (not necessarily unit).
238245
+ * @param vectorV caller's V axis (not necessarily unit).
238180
238246
  */
238181
238247
  accumulateXYProductsInCentroidalFrame(productXX, productXY, productYY, area, origin, vectorU, vectorV) {
238182
238248
  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);
@@ -312349,7 +312415,7 @@ var loadLanguages = instance.loadLanguages;
312349
312415
  /***/ ((module) => {
312350
312416
 
312351
312417
  "use strict";
312352
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.3","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"}}');
312418
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.5","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"}}');
312353
312419
 
312354
312420
  /***/ })
312355
312421