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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -68621,6 +68621,20 @@ var RenderSchedule;
68621
68621
  get maxBatchId() {
68622
68622
  return this._maxBatchId ?? (this._maxBatchId = this.modelTimelines.reduce((accum, timeline) => Math.max(accum, timeline.maxBatchId), 0));
68623
68623
  }
68624
+ /**
68625
+ * Replaces all elementIds in a ScriptProps object with an empty string. Returns modified ScriptProps.
68626
+ * @param scheduleScript The script props to modify.
68627
+ * @internal */
68628
+ static removeScheduleScriptElementIds(scheduleScript) {
68629
+ scheduleScript.forEach((modelTimeline) => {
68630
+ modelTimeline.elementTimelines.forEach((elementTimeline) => {
68631
+ if (elementTimeline.elementIds) {
68632
+ elementTimeline.elementIds = "";
68633
+ }
68634
+ });
68635
+ });
68636
+ return scheduleScript;
68637
+ }
68624
68638
  }
68625
68639
  RenderSchedule.Script = Script;
68626
68640
  /** A reference to a [[RenderSchedule.Script]], optionally identifying the source of the script.
@@ -170754,6 +170768,7 @@ class GraphicsCollectorDrawArgs extends _tile_internal__WEBPACK_IMPORTED_MODULE_
170754
170768
  return undefined;
170755
170769
  return new GraphicsCollectorDrawArgs(planes, worldToViewMap, collector, args);
170756
170770
  }
170771
+ get shouldCollectClassifierGraphics() { return false; }
170757
170772
  }
170758
170773
 
170759
170774
 
@@ -171024,6 +171039,7 @@ class IModelTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_4__.Tile {
171024
171039
  if (format !== _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileFormat.IModel)
171025
171040
  return content;
171026
171041
  const sizeMultiplier = this.hasSizeMultiplier ? this.sizeMultiplier : undefined;
171042
+ const ecefTransform = this.tree.iModel.isGeoLocated ? this.tree.iModel.getEcefTransform() : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
171027
171043
  try {
171028
171044
  content = await this.iModelTree.decoder.decode({
171029
171045
  stream: streamBuffer,
@@ -171032,7 +171048,7 @@ class IModelTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_4__.Tile {
171032
171048
  isCanceled,
171033
171049
  sizeMultiplier,
171034
171050
  tileData: {
171035
- ecefTransform: this.tree.iModel.ecefLocation?.getTransform() ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity(),
171051
+ ecefTransform,
171036
171052
  range: this.range,
171037
171053
  layerClassifiers: this.tree.layerHandler?.layerClassifiers,
171038
171054
  },
@@ -171741,7 +171757,8 @@ class IModelTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_6__.TileTre
171741
171757
  draw(args) {
171742
171758
  const tiles = this.selectTiles(args);
171743
171759
  this._rootTile.draw(args, tiles, this._numStaticTilesSelected);
171744
- this._layerHandler.collectClassifierGraphics(args, tiles);
171760
+ if (args.shouldCollectClassifierGraphics)
171761
+ this._layerHandler.collectClassifierGraphics(args, tiles);
171745
171762
  }
171746
171763
  prune() {
171747
171764
  const olderThan = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.now().minus(this.expirationTime);
@@ -172873,14 +172890,12 @@ class LayerTileTreeReferenceHandler {
172873
172890
  removals.push(context.viewport.displayStyle.settings.onMapImageryChanged.addListener((imagery) => {
172874
172891
  this.setBaseLayerSettings(imagery.backgroundBase);
172875
172892
  this.setLayerSettings(imagery.backgroundLayers);
172876
- this.clearLayers();
172877
172893
  }));
172878
172894
  }
172879
172895
  removals.push(context.viewport.onChangeView.addListener((vp, previousViewState) => {
172880
172896
  if ((0,_tile_internal__WEBPACK_IMPORTED_MODULE_1__.compareMapLayer)(previousViewState, vp.view)) {
172881
172897
  this.setBaseLayerSettings(mapImagery.backgroundBase);
172882
172898
  this.setLayerSettings(mapImagery.backgroundLayers);
172883
- this.clearLayers();
172884
172899
  }
172885
172900
  }));
172886
172901
  }
@@ -175548,8 +175563,9 @@ class RealityTileLoader {
175548
175563
  isCanceled = () => !tile.isLoading;
175549
175564
  const { is3d, yAxisUp, iModel, modelId } = tile.realityRoot;
175550
175565
  let reader;
175566
+ const ecefTransform = tile.tree.iModel.isGeoLocated ? tile.tree.iModel.getEcefTransform() : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
175551
175567
  const tileData = {
175552
- ecefTransform: tile.tree.iModel.ecefLocation?.getTransform() ?? _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity(),
175568
+ ecefTransform,
175553
175569
  range: tile.range,
175554
175570
  layerClassifiers: tile.tree.layerHandler?.layerClassifiers,
175555
175571
  };
@@ -186864,7 +186880,7 @@ class RealityTileTree extends _internal__WEBPACK_IMPORTED_MODULE_6__.TileTree {
186864
186880
  sortIndices = selectedTiles.map((_x, i) => i);
186865
186881
  sortIndices.sort((a, b) => selectedTiles[a].depth - selectedTiles[b].depth);
186866
186882
  }
186867
- if (!(args instanceof _internal__WEBPACK_IMPORTED_MODULE_6__.GraphicsCollectorDrawArgs))
186883
+ if (args.shouldCollectClassifierGraphics)
186868
186884
  this.collectClassifierGraphics(args, selectedTiles);
186869
186885
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(selectedTiles.length === displayedTileDescendants.length);
186870
186886
  for (let i = 0; i < selectedTiles.length; i++) {
@@ -189018,6 +189034,8 @@ class TileDrawArgs {
189018
189034
  processSelectedTiles(_tiles) { }
189019
189035
  /* @internal */
189020
189036
  get maxRealityTreeSelectionCount() { return undefined; }
189037
+ /* @internal */
189038
+ get shouldCollectClassifierGraphics() { return true; }
189021
189039
  }
189022
189040
 
189023
189041
 
@@ -233638,15 +233656,15 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
233638
233656
  _activeMomentData;
233639
233657
  _point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
233640
233658
  _point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
233641
- /** Accumulate (independent) integrations over
233642
- * * origin to chord of the arc.
233643
- * * origin to the "cap" between the chord and arc.
233659
+ /**
233660
+ * Accumulate (independent) integrations over:
233661
+ * * The area between the arc and the chord connecting its endpoints.
233662
+ * * The triangle with vertices: origin, arc start, arc end.
233644
233663
  */
233645
233664
  handleArc3d(arc) {
233646
233665
  const momentData = this._activeMomentData;
233647
233666
  const sweepRadians = arc.sweep.sweepRadians;
233648
233667
  const alphaRadians = sweepRadians * 0.5;
233649
- // from https://apps.dtic.mil/dtic/tr/fulltext/u2/274936.pdf page 71 for radius = 1
233650
233668
  let s = Math.sin(alphaRadians);
233651
233669
  let c = Math.cos(alphaRadians);
233652
233670
  let s1 = Math.sin(sweepRadians);
@@ -233673,12 +233691,12 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
233673
233691
  const pointC = arc.fractionToPoint(1.0);
233674
233692
  momentData.accumulateTriangleMomentsXY(undefined, pointB, pointC);
233675
233693
  }
233676
- /** Accumulate integrals over the (triangular) areas from the origin to each line segment */
233694
+ /** Accumulate integrals over the (triangular) areas from the origin to each line segment. */
233677
233695
  handleLineString3d(ls) {
233678
233696
  const momentData = this._activeMomentData;
233679
233697
  momentData.accumulateTriangleToLineStringMomentsXY(undefined, ls.packedPoints);
233680
233698
  }
233681
- /** Accumulate integrals over the (triangular) area from the origin to this line segment */
233699
+ /** Accumulate integrals over the (triangular) area from the origin to this line segment. */
233682
233700
  handleLineSegment3d(segment) {
233683
233701
  const momentData = this._activeMomentData;
233684
233702
  segment.startPoint(this._point0);
@@ -233694,15 +233712,7 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
233694
233712
  this._activeMomentData = undefined;
233695
233713
  return momentData;
233696
233714
  }
233697
- /**
233698
- * ASSUMPTIONS FOR ORIENTATION AND CONTAINMENT ISSUES
233699
- * * Largest area is outer
233700
- * * All others are interior (and not overlapping)
233701
- * Hence
233702
- * * Outer area sign must be positive -- negate all integrations as needed
233703
- * * Outer area signs must be positive -- negate all integrations as needed
233704
- * @param region
233705
- */
233715
+ /** Accumulate integrals from origin to the components of the parity region. */
233706
233716
  handleParityRegion(region) {
233707
233717
  const allChildMoments = [];
233708
233718
  let maxAbsArea = 0.0;
@@ -233734,7 +233744,7 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
233734
233744
  }
233735
233745
  return undefined;
233736
233746
  }
233737
- /** Accumulate (as simple addition) products over each component of the union region. */
233747
+ /** Accumulate integrals from origin to the components of the union region. */
233738
233748
  handleUnionRegion(region) {
233739
233749
  const summedMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__.MomentData.create();
233740
233750
  for (const child of region.children) {
@@ -233756,9 +233766,9 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
233756
233766
  this._strokeOptions = options;
233757
233767
  return options;
233758
233768
  }
233759
- /** Single curve primitive (not loop . . .).
233760
- * * stroke the curve
233761
- * * accumulate stroke array.
233769
+ /**
233770
+ * Handle a single curve primitive (not loop).
233771
+ * * Stroke the curve and accumulate stroke array.
233762
233772
  */
233763
233773
  handleCurvePrimitive(cp) {
233764
233774
  const strokes = _LineString3d__WEBPACK_IMPORTED_MODULE_6__.LineString3d.create();
@@ -233766,12 +233776,18 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
233766
233776
  cp.emitStrokes(strokes, options);
233767
233777
  this.handleLineString3d(strokes);
233768
233778
  }
233769
- /** handle strongly typed BSplineCurve3d as generic curve primitive */
233770
- handleBSplineCurve3d(g) { return this.handleCurvePrimitive(g); }
233771
- /** handle strongly typed BSplineCurve3dH as generic curve primitive */
233772
- handleBSplineCurve3dH(g) { return this.handleCurvePrimitive(g); }
233773
- /** handle strongly typed TransitionSpiral as generic curve primitive */
233774
- handleTransitionSpiral(g) { return this.handleCurvePrimitive(g); }
233779
+ /** Handle strongly typed BSplineCurve3d as generic curve primitive. */
233780
+ handleBSplineCurve3d(g) {
233781
+ return this.handleCurvePrimitive(g);
233782
+ }
233783
+ /** Handle strongly typed BSplineCurve3dH as generic curve primitive. */
233784
+ handleBSplineCurve3dH(g) {
233785
+ return this.handleCurvePrimitive(g);
233786
+ }
233787
+ /** Handle strongly typed TransitionSpiral as generic curve primitive. */
233788
+ handleTransitionSpiral(g) {
233789
+ return this.handleCurvePrimitive(g);
233790
+ }
233775
233791
  }
233776
233792
 
233777
233793
 
@@ -233791,41 +233807,43 @@ __webpack_require__.r(__webpack_exports__);
233791
233807
  /* harmony export */ RegionOps: () => (/* binding */ RegionOps)
233792
233808
  /* harmony export */ });
233793
233809
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
233794
- /* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
233795
- /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
233796
- /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
233797
- /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
233798
- /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
233799
- /* harmony import */ var _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../geometry3d/PolylineCompressionByEdgeOffset */ "../../core/geometry/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js");
233800
- /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
233801
- /* harmony import */ var _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/SortablePolygon */ "../../core/geometry/lib/esm/geometry3d/SortablePolygon.js");
233802
- /* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
233810
+ /* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
233811
+ /* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
233812
+ /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
233813
+ /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
233814
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
233815
+ /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
233816
+ /* harmony import */ var _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/PolylineCompressionByEdgeOffset */ "../../core/geometry/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js");
233817
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
233818
+ /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
233819
+ /* harmony import */ var _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../geometry3d/SortablePolygon */ "../../core/geometry/lib/esm/geometry3d/SortablePolygon.js");
233820
+ /* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
233803
233821
  /* harmony import */ var _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry4d/MomentData */ "../../core/geometry/lib/esm/geometry4d/MomentData.js");
233804
- /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
233805
- /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
233806
- /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
233807
- /* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
233808
- /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
233809
- /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
233810
- /* harmony import */ var _CurveCurve__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./CurveCurve */ "../../core/geometry/lib/esm/curve/CurveCurve.js");
233811
- /* harmony import */ var _CurveOps__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
233812
- /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
233822
+ /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
233823
+ /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
233824
+ /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
233825
+ /* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
233826
+ /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
233827
+ /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
233828
+ /* harmony import */ var _CurveCurve__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./CurveCurve */ "../../core/geometry/lib/esm/curve/CurveCurve.js");
233829
+ /* harmony import */ var _CurveOps__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
233830
+ /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
233813
233831
  /* harmony import */ var _CurveWireMomentsXYZ__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CurveWireMomentsXYZ */ "../../core/geometry/lib/esm/curve/CurveWireMomentsXYZ.js");
233814
- /* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
233815
- /* harmony import */ var _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./internalContexts/ChainCollectorContext */ "../../core/geometry/lib/esm/curve/internalContexts/ChainCollectorContext.js");
233816
- /* harmony import */ var _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./internalContexts/PolygonOffsetContext */ "../../core/geometry/lib/esm/curve/internalContexts/PolygonOffsetContext.js");
233817
- /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
233818
- /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
233819
- /* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
233820
- /* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
233821
- /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
233822
- /* harmony import */ var _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./Query/ConsolidateAdjacentPrimitivesContext */ "../../core/geometry/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js");
233823
- /* harmony import */ var _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./Query/CurveSplitContext */ "../../core/geometry/lib/esm/curve/Query/CurveSplitContext.js");
233824
- /* harmony import */ var _Query_InOutTests__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Query/InOutTests */ "../../core/geometry/lib/esm/curve/Query/InOutTests.js");
233825
- /* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
233832
+ /* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
233833
+ /* harmony import */ var _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./internalContexts/ChainCollectorContext */ "../../core/geometry/lib/esm/curve/internalContexts/ChainCollectorContext.js");
233834
+ /* harmony import */ var _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./internalContexts/PolygonOffsetContext */ "../../core/geometry/lib/esm/curve/internalContexts/PolygonOffsetContext.js");
233835
+ /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
233836
+ /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
233837
+ /* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
233838
+ /* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
233839
+ /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
233840
+ /* harmony import */ var _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./Query/ConsolidateAdjacentPrimitivesContext */ "../../core/geometry/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js");
233841
+ /* harmony import */ var _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./Query/CurveSplitContext */ "../../core/geometry/lib/esm/curve/Query/CurveSplitContext.js");
233842
+ /* harmony import */ var _Query_InOutTests__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Query/InOutTests */ "../../core/geometry/lib/esm/curve/Query/InOutTests.js");
233843
+ /* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
233826
233844
  /* harmony import */ var _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RegionMomentsXY */ "../../core/geometry/lib/esm/curve/RegionMomentsXY.js");
233827
- /* harmony import */ var _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./RegionOpsClassificationSweeps */ "../../core/geometry/lib/esm/curve/RegionOpsClassificationSweeps.js");
233828
- /* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
233845
+ /* harmony import */ var _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./RegionOpsClassificationSweeps */ "../../core/geometry/lib/esm/curve/RegionOpsClassificationSweeps.js");
233846
+ /* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
233829
233847
  /*---------------------------------------------------------------------------------------------
233830
233848
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
233831
233849
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -233866,6 +233884,8 @@ __webpack_require__.r(__webpack_exports__);
233866
233884
 
233867
233885
 
233868
233886
 
233887
+
233888
+
233869
233889
 
233870
233890
 
233871
233891
 
@@ -233895,13 +233915,16 @@ var RegionBinaryOpType;
233895
233915
  class RegionOps {
233896
233916
  /**
233897
233917
  * Return moment sums for a loop, parity region, or union region.
233918
+ * * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
233898
233919
  * * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
233899
- * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
233900
- * @param root any Loop, ParityRegion, or UnionRegion.
233920
+ * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes(rawMomentData.origin, rawMomentData.sums);`
233921
+ * * `rawMomentData.origin` is the centroid of `region`.
233922
+ * * `rawMomentData.sums.weight()` is the signed area of `region`.
233923
+ * @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
233901
233924
  */
233902
- static computeXYAreaMoments(root) {
233925
+ static computeXYAreaMoments(region) {
233903
233926
  const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__.RegionMomentsXY();
233904
- const result = root.dispatchToGeometryHandler(handler);
233927
+ const result = region.dispatchToGeometryHandler(handler);
233905
233928
  if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__.MomentData) {
233906
233929
  result.shiftOriginAndSumsToCentroidOfSums();
233907
233930
  return result;
@@ -233910,8 +233933,8 @@ class RegionOps {
233910
233933
  }
233911
233934
  /**
233912
233935
  * Return an area tolerance for a given xy-range and optional distance tolerance.
233913
- * @param range range of planar region to tolerance
233914
- * @param distanceTolerance optional absolute distance tolerance
233936
+ * @param range range of planar region to tolerance.
233937
+ * @param distanceTolerance optional absolute distance tolerance.
233915
233938
  */
233916
233939
  static computeXYAreaTolerance(range, distanceTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
233917
233940
  // if A = bh and e is distance tolerance, then A' := (b+e/2)(h+e/2) = A + e/2(b+h+e/2), so A'-A = e/2(b+h+e/2).
@@ -233920,12 +233943,13 @@ class RegionOps {
233920
233943
  }
233921
233944
  /**
233922
233945
  * Return a (signed) xy area for a region.
233946
+ * * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
233923
233947
  * * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
233924
- * @param root any Loop, ParityRegion, or UnionRegion.
233948
+ * @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
233925
233949
  */
233926
- static computeXYArea(root) {
233950
+ static computeXYArea(region) {
233927
233951
  const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__.RegionMomentsXY();
233928
- const result = root.dispatchToGeometryHandler(handler);
233952
+ const result = region.dispatchToGeometryHandler(handler);
233929
233953
  if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__.MomentData) {
233930
233954
  return result.quantitySum;
233931
233955
  }
@@ -233933,49 +233957,88 @@ class RegionOps {
233933
233957
  }
233934
233958
  /**
233935
233959
  * Return MomentData with the sums of wire moments.
233960
+ * * The input curve should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
233936
233961
  * * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
233937
- * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
233938
- * @param root any CurveCollection or CurvePrimitive.
233962
+ * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
233963
+ * * `rawMomentData.origin` is the wire centroid of `curve`.
233964
+ * * `rawMomentData.sums.weight()` is the signed length of `curve`.
233965
+ * @param curve any [[CurveCollection]] or [[CurvePrimitive]].
233939
233966
  */
233940
- static computeXYZWireMomentSums(root) {
233967
+ static computeXYZWireMomentSums(curve) {
233941
233968
  const handler = new _CurveWireMomentsXYZ__WEBPACK_IMPORTED_MODULE_3__.CurveWireMomentsXYZ();
233942
- handler.visitLeaves(root);
233969
+ handler.visitLeaves(curve);
233943
233970
  const result = handler.momentData;
233944
233971
  result.shiftOriginAndSumsToCentroidOfSums();
233945
233972
  return result;
233946
233973
  }
233974
+ /**
233975
+ * Return a [[Ray3d]] with:
233976
+ * * `origin` is the centroid of the region,
233977
+ * * `direction` is a unit vector perpendicular to the region plane,
233978
+ * * `a` is the region area.
233979
+ * @param region the region to process. Can lie in any plane.
233980
+ * @param result optional pre-allocated result to populate and return.
233981
+ */
233982
+ static centroidAreaNormal(region, result) {
233983
+ const localToWorld = _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_4__.FrameBuilder.createRightHandedFrame(undefined, region);
233984
+ if (!localToWorld)
233985
+ return undefined;
233986
+ const normal = localToWorld.matrix.columnZ(result?.direction);
233987
+ const regionIsXY = normal.isParallelTo(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Vector3d.unitZ(), true);
233988
+ let regionXY = region;
233989
+ if (!regionIsXY) { // rotate the region to be parallel to the xy-plane
233990
+ regionXY = region.cloneTransformed(localToWorld.inverse());
233991
+ if (!regionXY)
233992
+ return undefined;
233993
+ }
233994
+ const momentData = RegionOps.computeXYAreaMoments(regionXY);
233995
+ if (!momentData)
233996
+ return undefined;
233997
+ const centroid = momentData.origin.clone(result?.origin);
233998
+ if (!regionIsXY) // rotate centroid back (area is unchanged)
233999
+ localToWorld.multiplyPoint3d(centroid, centroid);
234000
+ let area = momentData.sums.weight();
234001
+ if (area < 0.0) {
234002
+ area = -area;
234003
+ normal.scale(-1.0, normal);
234004
+ }
234005
+ if (!result)
234006
+ result = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__.Ray3d.createCapture(centroid, normal);
234007
+ result.a = area;
234008
+ return result;
234009
+ }
233947
234010
  /**
233948
234011
  * Create loops in the graph.
233949
234012
  * @internal
233950
234013
  */
233951
234014
  static addLoopsToGraph(graph, data, announceIsolatedLoop) {
233952
- if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop) {
234015
+ if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop) {
233953
234016
  const points = data.getPackedStrokes();
233954
234017
  if (points)
233955
234018
  this.addLoopsToGraph(graph, points, announceIsolatedLoop);
233956
234019
  }
233957
- else if (data instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_5__.ParityRegion) {
234020
+ else if (data instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
233958
234021
  for (const child of data.children) {
233959
234022
  const points = child.getPackedStrokes();
233960
234023
  if (points)
233961
234024
  this.addLoopsToGraph(graph, points, announceIsolatedLoop);
233962
234025
  }
233963
234026
  }
233964
- else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
233965
- const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
234027
+ else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
234028
+ const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
233966
234029
  if (loopSeed !== undefined)
233967
234030
  announceIsolatedLoop(graph, loopSeed);
233968
234031
  }
233969
234032
  else if (Array.isArray(data)) {
233970
234033
  if (data.length > 0) {
233971
- if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__.Point3d.isAnyImmediatePointType(data[0])) {
233972
- const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
234034
+ if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.isAnyImmediatePointType(data[0])) {
234035
+ const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
233973
234036
  if (loopSeed !== undefined)
233974
234037
  announceIsolatedLoop(graph, loopSeed);
233975
234038
  }
233976
- else if (data[0] instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
234039
+ else if (data[0] instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
233977
234040
  for (const loop of data) {
233978
- const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.directCreateFaceLoopFromCoordinates(graph, loop);
234041
+ const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, loop);
233979
234042
  if (loopSeed !== undefined)
233980
234043
  announceIsolatedLoop(graph, loopSeed);
233981
234044
  }
@@ -234015,10 +234078,10 @@ class RegionOps {
234015
234078
  static finishGraphToPolyface(graph, triangulate) {
234016
234079
  if (graph) {
234017
234080
  if (triangulate) {
234018
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.triangulateAllPositiveAreaFaces(graph);
234019
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.flipTriangles(graph);
234081
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.triangulateAllPositiveAreaFaces(graph);
234082
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
234020
234083
  }
234021
- return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_9__.PolyfaceBuilder.graphToPolyface(graph);
234084
+ return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__.PolyfaceBuilder.graphToPolyface(graph);
234022
234085
  }
234023
234086
  return undefined;
234024
234087
  }
@@ -234032,7 +234095,7 @@ class RegionOps {
234032
234095
  * @param triangulate whether to triangulate the result
234033
234096
  */
234034
234097
  static polygonXYAreaIntersectLoopsToPolyface(loopsA, loopsB, triangulate = false) {
234035
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && inB), this._graphCheckPointFunction);
234098
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && inB), this._graphCheckPointFunction);
234036
234099
  return this.finishGraphToPolyface(graph, triangulate);
234037
234100
  }
234038
234101
  /**
@@ -234045,7 +234108,7 @@ class RegionOps {
234045
234108
  * @param triangulate whether to triangulate the result
234046
234109
  */
234047
234110
  static polygonXYAreaUnionLoopsToPolyface(loopsA, loopsB, triangulate = false) {
234048
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA || inB), this._graphCheckPointFunction);
234111
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA || inB), this._graphCheckPointFunction);
234049
234112
  return this.finishGraphToPolyface(graph, triangulate);
234050
234113
  }
234051
234114
  /**
@@ -234058,7 +234121,7 @@ class RegionOps {
234058
234121
  * @param triangulate whether to triangulate the result
234059
234122
  */
234060
234123
  static polygonXYAreaDifferenceLoopsToPolyface(loopsA, loopsB, triangulate = false) {
234061
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && !inB), this._graphCheckPointFunction);
234124
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && !inB), this._graphCheckPointFunction);
234062
234125
  return this.finishGraphToPolyface(graph, triangulate);
234063
234126
  }
234064
234127
  /**
@@ -234075,8 +234138,8 @@ class RegionOps {
234075
234138
  static regionBooleanXY(loopsA, loopsB, operation, mergeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
234076
234139
  // Always return UnionRegion for now. But keep return type as AnyRegion:
234077
234140
  // in the future, we might return the *simplest* region type.
234078
- const result = _UnionRegion__WEBPACK_IMPORTED_MODULE_11__.UnionRegion.create();
234079
- const context = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionBooleanContext.create(_RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union);
234141
+ const result = _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion.create();
234142
+ const context = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionBooleanContext.create(_RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union);
234080
234143
  context.addMembers(loopsA, loopsB);
234081
234144
  context.annotateAndMergeCurvesInGraph(mergeTolerance);
234082
234145
  const range = context.groupA.range().union(context.groupB.range());
@@ -234088,7 +234151,7 @@ class RegionOps {
234088
234151
  if (Math.abs(area) < areaTol)
234089
234152
  return;
234090
234153
  if (faceType === 1) {
234091
- const loop = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__.PlanarSubdivision.createLoopInFace(face);
234154
+ const loop = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.createLoopInFace(face);
234092
234155
  if (loop)
234093
234156
  result.tryAddChild(loop);
234094
234157
  }
@@ -234108,7 +234171,7 @@ class RegionOps {
234108
234171
  * @param triangulate whether to triangulate the result
234109
234172
  */
234110
234173
  static polygonBooleanXYToPolyface(inputA, operation, inputB, triangulate = false) {
234111
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doBinaryBooleanBetweenMultiLoopInputs(inputA, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union, operation, inputB, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union, true);
234174
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doBinaryBooleanBetweenMultiLoopInputs(inputA, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, operation, inputB, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, true);
234112
234175
  return this.finishGraphToPolyface(graph, triangulate);
234113
234176
  }
234114
234177
  /**
@@ -234123,18 +234186,18 @@ class RegionOps {
234123
234186
  * @param inputB second set of loops
234124
234187
  */
234125
234188
  static polygonBooleanXYToLoops(inputA, operation, inputB) {
234126
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doBinaryBooleanBetweenMultiLoopInputs(inputA, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union, operation, inputB, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union, true);
234189
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doBinaryBooleanBetweenMultiLoopInputs(inputA, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, operation, inputB, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, true);
234127
234190
  if (!graph)
234128
234191
  return undefined;
234129
- const loopEdges = _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_13__.HalfEdgeGraphSearch.collectExtendedBoundaryLoopsInGraph(graph, _topology_Graph__WEBPACK_IMPORTED_MODULE_14__.HalfEdgeMask.EXTERIOR);
234192
+ const loopEdges = _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_15__.HalfEdgeGraphSearch.collectExtendedBoundaryLoopsInGraph(graph, _topology_Graph__WEBPACK_IMPORTED_MODULE_16__.HalfEdgeMask.EXTERIOR);
234130
234193
  const allLoops = [];
234131
234194
  for (const graphLoop of loopEdges) {
234132
- const points = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray();
234195
+ const points = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray();
234133
234196
  for (const edge of graphLoop)
234134
234197
  points.pushXYZ(edge.x, edge.y, edge.z);
234135
234198
  points.pushWrap(1);
234136
- const loop = _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.create();
234137
- loop.tryAddChild(_LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d.createCapture(points));
234199
+ const loop = _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.create();
234200
+ loop.tryAddChild(_LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d.createCapture(points));
234138
234201
  allLoops.push(loop);
234139
234202
  }
234140
234203
  return RegionOps.sortOuterAndHoleLoopsXY(allLoops);
@@ -234152,7 +234215,7 @@ class RegionOps {
234152
234215
  * object.
234153
234216
  */
234154
234217
  static constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions) {
234155
- const context = new _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_17__.PolygonWireOffsetContext();
234218
+ const context = new _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_19__.PolygonWireOffsetContext();
234156
234219
  return context.constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions);
234157
234220
  }
234158
234221
  /**
@@ -234164,8 +234227,8 @@ class RegionOps {
234164
234227
  * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
234165
234228
  */
234166
234229
  static constructCurveXYOffset(curves, offsetDistanceOrOptions) {
234167
- const offsetOptions = _OffsetOptions__WEBPACK_IMPORTED_MODULE_18__.OffsetOptions.create(offsetDistanceOrOptions);
234168
- return _CurveOps__WEBPACK_IMPORTED_MODULE_19__.CurveOps.constructCurveXYOffset(curves, offsetOptions);
234230
+ const offsetOptions = _OffsetOptions__WEBPACK_IMPORTED_MODULE_20__.OffsetOptions.create(offsetDistanceOrOptions);
234231
+ return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.constructCurveXYOffset(curves, offsetOptions);
234169
234232
  }
234170
234233
  /**
234171
234234
  * Test if point (x,y) is IN, OUT or ON a region.
@@ -234175,7 +234238,7 @@ class RegionOps {
234175
234238
  * @param y y coordinate of point to test
234176
234239
  */
234177
234240
  static testPointInOnOutRegionXY(curves, x, y) {
234178
- return _Query_InOutTests__WEBPACK_IMPORTED_MODULE_20__.PointInOnOutContext.testPointInOnOutRegionXY(curves, x, y);
234241
+ return _Query_InOutTests__WEBPACK_IMPORTED_MODULE_22__.PointInOnOutContext.testPointInOnOutRegionXY(curves, x, y);
234179
234242
  }
234180
234243
  /**
234181
234244
  * Create curve collection of subtype determined by gaps between the input curves.
@@ -234199,11 +234262,11 @@ class RegionOps {
234199
234262
  maxGap = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.maxXY(maxGap, curves[i].endPoint().distance(curves[i + 1].startPoint()));
234200
234263
  let collection;
234201
234264
  if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(maxGap)) {
234202
- collection = wrap ? _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.create() : _Path__WEBPACK_IMPORTED_MODULE_21__.Path.create();
234265
+ collection = wrap ? _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.create() : _Path__WEBPACK_IMPORTED_MODULE_23__.Path.create();
234203
234266
  isPath = true;
234204
234267
  }
234205
234268
  else {
234206
- collection = _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.BagOfCurves.create();
234269
+ collection = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.BagOfCurves.create();
234207
234270
  }
234208
234271
  for (const c of curves)
234209
234272
  collection.tryAddChild(c);
@@ -234229,7 +234292,7 @@ class RegionOps {
234229
234292
  * @param cutterCurves input curves to intersect with `curvesToCut`
234230
234293
  */
234231
234294
  static cloneCurvesWithXYSplits(curvesToCut, cutterCurves) {
234232
- return _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_23__.CurveSplitContext.cloneCurvesWithXYSplits(curvesToCut, cutterCurves);
234295
+ return _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_25__.CurveSplitContext.cloneCurvesWithXYSplits(curvesToCut, cutterCurves);
234233
234296
  }
234234
234297
  /**
234235
234298
  * Create paths assembled from many curves.
@@ -234240,11 +234303,11 @@ class RegionOps {
234240
234303
  static splitToPathsBetweenBreaks(source, makeClones) {
234241
234304
  if (source === undefined)
234242
234305
  return undefined;
234243
- if (source instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__.CurvePrimitive)
234306
+ if (source instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive)
234244
234307
  return source;
234245
234308
  // source is a collection . ..
234246
234309
  const primitives = source.collectCurvePrimitives();
234247
- const chainCollector = new _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_25__.ChainCollectorContext(makeClones);
234310
+ const chainCollector = new _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_27__.ChainCollectorContext(makeClones);
234248
234311
  for (const primitive of primitives) {
234249
234312
  chainCollector.announceCurvePrimitive(primitive);
234250
234313
  }
@@ -234260,7 +234323,7 @@ class RegionOps {
234260
234323
  * @returns object with named chains, insideOffsets, outsideOffsets
234261
234324
  */
234262
234325
  static collectInsideAndOutsideOffsets(fragments, offsetDistance, gapTolerance) {
234263
- return _CurveOps__WEBPACK_IMPORTED_MODULE_19__.CurveOps.collectInsideAndOutsideXYOffsets(fragments, offsetDistance, gapTolerance);
234326
+ return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.collectInsideAndOutsideXYOffsets(fragments, offsetDistance, gapTolerance);
234264
234327
  }
234265
234328
  /**
234266
234329
  * Restructure curve fragments as Paths and Loops.
@@ -234269,7 +234332,7 @@ class RegionOps {
234269
234332
  * @returns chains, possibly wrapped in a [[BagOfCurves]].
234270
234333
  */
234271
234334
  static collectChains(fragments, gapTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
234272
- return _CurveOps__WEBPACK_IMPORTED_MODULE_19__.CurveOps.collectChains(fragments, gapTolerance);
234335
+ return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.collectChains(fragments, gapTolerance);
234273
234336
  }
234274
234337
  /**
234275
234338
  * Find all intersections among curves in `curvesToCut` against the boundaries of `region` and return fragments
@@ -234281,17 +234344,17 @@ class RegionOps {
234281
234344
  const result = { insideParts: [], outsideParts: [], coincidentParts: [] };
234282
234345
  const pathWithIntersectionMarkup = RegionOps.cloneCurvesWithXYSplits(curvesToCut, region);
234283
234346
  const splitPaths = RegionOps.splitToPathsBetweenBreaks(pathWithIntersectionMarkup, true);
234284
- if (splitPaths instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection) {
234347
+ if (splitPaths instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection) {
234285
234348
  for (const child of splitPaths.children) {
234286
- const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(child);
234349
+ const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(child);
234287
234350
  if (pointOnChild) {
234288
234351
  const inOnOut = RegionOps.testPointInOnOutRegionXY(region, pointOnChild.point.x, pointOnChild.point.y);
234289
234352
  pushToInOnOutArrays(child, inOnOut, result.outsideParts, result.coincidentParts, result.insideParts);
234290
234353
  }
234291
234354
  }
234292
234355
  }
234293
- else if (splitPaths instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__.CurvePrimitive) {
234294
- const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(splitPaths);
234356
+ else if (splitPaths instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive) {
234357
+ const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(splitPaths);
234295
234358
  if (pointOnChild) {
234296
234359
  const inOnOut = RegionOps.testPointInOnOutRegionXY(region, pointOnChild.point.x, pointOnChild.point.y);
234297
234360
  pushToInOnOutArrays(splitPaths, inOnOut, result.outsideParts, result.coincidentParts, result.insideParts);
@@ -234315,10 +234378,10 @@ class RegionOps {
234315
234378
  * normal in z column. If not a rectangle, return undefined.
234316
234379
  */
234317
234380
  static rectangleEdgeTransform(data, requireClosurePoint = true) {
234318
- if (data instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
234381
+ if (data instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
234319
234382
  return this.rectangleEdgeTransform(data.packedPoints);
234320
234383
  }
234321
- else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
234384
+ else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
234322
234385
  let dataToUse;
234323
234386
  if (requireClosurePoint && data.length === 5) {
234324
234387
  if (!_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(data.distanceIndexIndex(0, 4)))
@@ -234332,8 +234395,8 @@ class RegionOps {
234332
234395
  return undefined;
234333
234396
  }
234334
234397
  else {
234335
- dataToUse = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray.create(data);
234336
- _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_26__.PolylineCompressionContext.compressInPlaceByShortEdgeLength(dataToUse, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
234398
+ dataToUse = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(data);
234399
+ _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_28__.PolylineCompressionContext.compressInPlaceByShortEdgeLength(dataToUse, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
234337
234400
  if (dataToUse.length < (requireClosurePoint ? 5 : 4))
234338
234401
  return undefined;
234339
234402
  }
@@ -234344,19 +234407,19 @@ class RegionOps {
234344
234407
  if (normalVector.normalizeInPlace()
234345
234408
  && vector12.isAlmostEqual(vector03)
234346
234409
  && vector01.isPerpendicularTo(vector03)) {
234347
- return _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_27__.Transform.createOriginAndMatrixColumns(dataToUse.getPoint3dAtUncheckedPointIndex(0), vector01, vector03, normalVector);
234410
+ return _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_29__.Transform.createOriginAndMatrixColumns(dataToUse.getPoint3dAtUncheckedPointIndex(0), vector01, vector03, normalVector);
234348
234411
  }
234349
234412
  }
234350
234413
  else if (Array.isArray(data)) {
234351
- return this.rectangleEdgeTransform(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_28__.Point3dArrayCarrier(data), requireClosurePoint);
234414
+ return this.rectangleEdgeTransform(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__.Point3dArrayCarrier(data), requireClosurePoint);
234352
234415
  }
234353
- else if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
234416
+ else if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
234354
234417
  return this.rectangleEdgeTransform(data.children[0].packedPoints, true);
234355
234418
  }
234356
- else if (data instanceof _Path__WEBPACK_IMPORTED_MODULE_21__.Path && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
234419
+ else if (data instanceof _Path__WEBPACK_IMPORTED_MODULE_23__.Path && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
234357
234420
  return this.rectangleEdgeTransform(data.children[0].packedPoints, requireClosurePoint);
234358
234421
  }
234359
- else if (data instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveChain) {
234422
+ else if (data instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveChain) {
234360
234423
  if (!data.checkForNonLinearPrimitives()) {
234361
234424
  // const linestring = LineString3d.create();
234362
234425
  const strokes = data.getPackedStrokes();
@@ -234380,7 +234443,7 @@ class RegionOps {
234380
234443
  * @param options options for tolerance and selective simplification.
234381
234444
  */
234382
234445
  static consolidateAdjacentPrimitives(curves, options) {
234383
- const context = new _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_29__.ConsolidateAdjacentCurvePrimitivesContext(options);
234446
+ const context = new _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_31__.ConsolidateAdjacentCurvePrimitivesContext(options);
234384
234447
  curves.dispatchToGeometryHandler(context);
234385
234448
  }
234386
234449
  /**
@@ -234398,14 +234461,14 @@ class RegionOps {
234398
234461
  static sortOuterAndHoleLoopsXY(loops) {
234399
234462
  const loopAndArea = [];
234400
234463
  for (const candidate of loops) {
234401
- if (candidate instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop)
234402
- _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__.SortablePolygon.pushLoop(loopAndArea, candidate);
234403
- else if (candidate instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
234404
- const loop = _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.createPolygon(candidate);
234405
- _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__.SortablePolygon.pushLoop(loopAndArea, loop);
234464
+ if (candidate instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop)
234465
+ _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.pushLoop(loopAndArea, candidate);
234466
+ else if (candidate instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
234467
+ const loop = _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.createPolygon(candidate);
234468
+ _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.pushLoop(loopAndArea, loop);
234406
234469
  }
234407
234470
  }
234408
- return _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__.SortablePolygon.sortAsAnyRegion(loopAndArea);
234471
+ return _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.sortAsAnyRegion(loopAndArea);
234409
234472
  }
234410
234473
  /**
234411
234474
  * Find all xy-areas bounded by the unstructured, possibly intersecting curves.
@@ -234431,9 +234494,9 @@ class RegionOps {
234431
234494
  const primitives = RegionOps.collectCurvePrimitives(curvesAndRegions, undefined, true, true);
234432
234495
  const range = this.curveArrayRange(primitives);
234433
234496
  const areaTol = this.computeXYAreaTolerance(range, tolerance);
234434
- const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_31__.CurveCurve.allIntersectionsAmongPrimitivesXY(primitives, tolerance);
234435
- const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__.PlanarSubdivision.assembleHalfEdgeGraph(primitives, intersections, tolerance);
234436
- return _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__.PlanarSubdivision.collectSignedLoopSetsInHalfEdgeGraph(graph, areaTol);
234497
+ const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_33__.CurveCurve.allIntersectionsAmongPrimitivesXY(primitives, tolerance);
234498
+ const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.assembleHalfEdgeGraph(primitives, intersections, tolerance);
234499
+ return _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.collectSignedLoopSetsInHalfEdgeGraph(graph, areaTol);
234437
234500
  }
234438
234501
  /**
234439
234502
  * Collect all `CurvePrimitives` in loosely typed input.
@@ -234448,10 +234511,10 @@ class RegionOps {
234448
234511
  */
234449
234512
  static collectCurvePrimitives(candidates, collectorArray, smallestPossiblePrimitives = false, explodeLinestrings = false) {
234450
234513
  const results = collectorArray === undefined ? [] : collectorArray;
234451
- if (candidates instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__.CurvePrimitive) {
234514
+ if (candidates instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive) {
234452
234515
  candidates.collectCurvePrimitives(results, smallestPossiblePrimitives, explodeLinestrings);
234453
234516
  }
234454
- else if (candidates instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection) {
234517
+ else if (candidates instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection) {
234455
234518
  candidates.collectCurvePrimitives(results, smallestPossiblePrimitives, explodeLinestrings);
234456
234519
  }
234457
234520
  else if (Array.isArray(candidates)) {
@@ -234470,7 +234533,7 @@ class RegionOps {
234470
234533
  static expandLineStrings(candidates) {
234471
234534
  const result = [];
234472
234535
  for (const c of candidates) {
234473
- if (c instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
234536
+ if (c instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
234474
234537
  for (let i = 0; i + 1 < c.packedPoints.length; i++) {
234475
234538
  const q = c.getIndexedSegment(i);
234476
234539
  if (q !== undefined)
@@ -234489,16 +234552,16 @@ class RegionOps {
234489
234552
  * @param worldToLocal transform to apply to data before computing its range
234490
234553
  */
234491
234554
  static curveArrayRange(data, worldToLocal) {
234492
- const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_32__.Range3d.create();
234493
- if (data instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_33__.GeometryQuery)
234555
+ const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_34__.Range3d.create();
234556
+ if (data instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_35__.GeometryQuery)
234494
234557
  data.extendRange(range, worldToLocal);
234495
234558
  else if (Array.isArray(data)) {
234496
234559
  for (const c of data) {
234497
- if (c instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_33__.GeometryQuery)
234560
+ if (c instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_35__.GeometryQuery)
234498
234561
  c.extendRange(range, worldToLocal);
234499
- else if (c instanceof _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__.Point3d)
234562
+ else if (c instanceof _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d)
234500
234563
  range.extendPoint(c, worldToLocal);
234501
- else if (c instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray)
234564
+ else if (c instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray)
234502
234565
  range.extendRange(c.getRange(worldToLocal));
234503
234566
  else if (Array.isArray(c))
234504
234567
  range.extendRange(this.curveArrayRange(c, worldToLocal));
@@ -234517,37 +234580,37 @@ class RegionOps {
234517
234580
  if (polygons.length === 0)
234518
234581
  return undefined;
234519
234582
  const firstEntry = polygons[0];
234520
- if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__.Point3d.isAnyImmediatePointType(firstEntry)) {
234521
- graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
234583
+ if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.isAnyImmediatePointType(firstEntry)) {
234584
+ graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
234522
234585
  }
234523
234586
  else if (polygons.length > 1) {
234524
234587
  let writablePolygons;
234525
- if (firstEntry instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedReadWriteXYZCollection) {
234588
+ if (firstEntry instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedReadWriteXYZCollection) {
234526
234589
  writablePolygons = polygons;
234527
234590
  }
234528
234591
  else {
234529
234592
  writablePolygons = [];
234530
234593
  for (const polygon of polygons)
234531
- writablePolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray.create(polygon));
234594
+ writablePolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(polygon));
234532
234595
  }
234533
- const sortedPolygons = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_34__.PolygonOps.sortOuterAndHoleLoopsXY(writablePolygons);
234596
+ const sortedPolygons = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_36__.PolygonOps.sortOuterAndHoleLoopsXY(writablePolygons);
234534
234597
  if (sortedPolygons.length === 1) { // below requires exactly one outer loop!
234535
- if (graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromLoops(sortedPolygons[0]))
234536
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.flipTriangles(graph);
234598
+ if (graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromLoops(sortedPolygons[0]))
234599
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
234537
234600
  }
234538
234601
  }
234539
234602
  else {
234540
- graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromSingleLoop(firstEntry);
234603
+ graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(firstEntry);
234541
234604
  }
234542
234605
  }
234543
234606
  else {
234544
- graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
234607
+ graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
234545
234608
  }
234546
234609
  if (!graph) {
234547
234610
  // Last resort: try full merge. Conveniently, multiple polygons are processed with parity logic.
234548
- if (graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(polygons, [], (inA, _inB) => inA)) {
234549
- if (_topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.triangulateAllPositiveAreaFaces(graph))
234550
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.flipTriangles(graph);
234611
+ if (graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(polygons, [], (inA, _inB) => inA)) {
234612
+ if (_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.triangulateAllPositiveAreaFaces(graph))
234613
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
234551
234614
  }
234552
234615
  }
234553
234616
  return graph;
@@ -234557,13 +234620,13 @@ class RegionOps {
234557
234620
  const strokedComponent = component.cloneStroked(options);
234558
234621
  // package the stroked region as polygons
234559
234622
  const polygons = [];
234560
- if (strokedComponent instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop) {
234561
- if (strokedComponent.children.length > 0 && strokedComponent.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d)
234623
+ if (strokedComponent instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop) {
234624
+ if (strokedComponent.children.length > 0 && strokedComponent.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d)
234562
234625
  polygons.push(strokedComponent.children[0].packedPoints); // expect only 1
234563
234626
  }
234564
- else if (strokedComponent instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_5__.ParityRegion) {
234627
+ else if (strokedComponent instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
234565
234628
  for (const strokedLoop of strokedComponent.children) {
234566
- if (strokedLoop.children.length > 0 && strokedLoop.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d)
234629
+ if (strokedLoop.children.length > 0 && strokedLoop.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d)
234567
234630
  polygons.push(strokedLoop.children[0].packedPoints); // expect only 1
234568
234631
  }
234569
234632
  }
@@ -234593,7 +234656,7 @@ class RegionOps {
234593
234656
  */
234594
234657
  static facetRegionXY(region, options) {
234595
234658
  let graph;
234596
- if (region instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_11__.UnionRegion) {
234659
+ if (region instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion) {
234597
234660
  for (const child of region.children) {
234598
234661
  const childGraph = RegionOps.triangulateRegionComponent(child, options);
234599
234662
  if (childGraph) {
@@ -234615,8 +234678,8 @@ class RegionOps {
234615
234678
  if (!graph)
234616
234679
  return undefined;
234617
234680
  if (options?.maximizeConvexFacets)
234618
- _topology_Merging__WEBPACK_IMPORTED_MODULE_35__.HalfEdgeGraphOps.expandConvexFaces(graph);
234619
- return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_9__.PolyfaceBuilder.graphToPolyface(graph, options);
234681
+ _topology_Merging__WEBPACK_IMPORTED_MODULE_37__.HalfEdgeGraphOps.expandConvexFaces(graph);
234682
+ return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__.PolyfaceBuilder.graphToPolyface(graph, options);
234620
234683
  }
234621
234684
  /**
234622
234685
  * Decompose a polygon with optional holes into an array of convex polygons.
@@ -234629,11 +234692,11 @@ class RegionOps {
234629
234692
  if (!graph)
234630
234693
  return undefined;
234631
234694
  if (maximize)
234632
- _topology_Merging__WEBPACK_IMPORTED_MODULE_35__.HalfEdgeGraphOps.expandConvexFaces(graph);
234695
+ _topology_Merging__WEBPACK_IMPORTED_MODULE_37__.HalfEdgeGraphOps.expandConvexFaces(graph);
234633
234696
  const convexPolygons = [];
234634
234697
  graph.announceFaceLoops((_graph, seed) => {
234635
- if (!seed.isMaskSet(_topology_Graph__WEBPACK_IMPORTED_MODULE_14__.HalfEdgeMask.EXTERIOR))
234636
- convexPolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray.create(seed.collectAroundFace((node) => { return node.getPoint3d(); })));
234698
+ if (!seed.isMaskSet(_topology_Graph__WEBPACK_IMPORTED_MODULE_16__.HalfEdgeMask.EXTERIOR))
234699
+ convexPolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(seed.collectAroundFace((node) => { return node.getPoint3d(); })));
234637
234700
  return true;
234638
234701
  });
234639
234702
  return convexPolygons;
@@ -258400,9 +258463,9 @@ class Vector3d extends XYZ {
258400
258463
  if (dot < 0.0 && !oppositeIsParallel)
258401
258464
  return false;
258402
258465
  const cross2 = this.crossProductMagnitudeSquared(other);
258403
- /* a2,b2,cross2 are squared lengths of respective vectors */
258404
- /* cross2 = sin^2(theta) * a2 * b2 */
258405
- /* For small theta, sin^2(theta)~~theta^2 */
258466
+ // a2,b2,cross2 are squared lengths of respective vectors
258467
+ // cross2 = sin^2(theta) * a2 * b2
258468
+ // For small theta, sin^2(theta) ~ theta^2
258406
258469
  return cross2 <= radianSquaredTol * a2 * b2;
258407
258470
  }
258408
258471
  /**
@@ -260357,26 +260420,28 @@ class PolygonOps {
260357
260420
  return s;
260358
260421
  }
260359
260422
  /**
260360
- * Return a Ray3d with (assuming the polygon is planar and not self-intersecting):
260361
- * * `origin` at the centroid of the (3D) polygon,
260362
- * * `direction` is the unit vector perpendicular to the plane,
260363
- * * `a` is the area.
260364
- * @param points
260423
+ * Return a [[Ray3d]] with:
260424
+ * * `origin` is the centroid of the polygon,
260425
+ * * `direction` is a unit vector perpendicular to the polygon plane,
260426
+ * * `a` is the polygon area.
260427
+ * @param points the polygon vertices in order. Points can lie in any plane. First and last point do not have to be equal.
260428
+ * @param result optional pre-allocated result to populate and return.
260365
260429
  */
260366
- static centroidAreaNormal(points) {
260430
+ static centroidAreaNormal(points, result) {
260367
260431
  if (Array.isArray(points)) {
260368
260432
  const carrier = new _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_5__.Point3dArrayCarrier(points);
260369
- return this.centroidAreaNormal(carrier);
260433
+ return this.centroidAreaNormal(carrier, result);
260370
260434
  }
260371
260435
  const n = points.length;
260372
260436
  if (n === 3) {
260373
- const normal = points.crossProductIndexIndexIndex(0, 1, 2);
260437
+ const normal = points.crossProductIndexIndexIndex(0, 1, 2, result?.direction);
260374
260438
  const a = 0.5 * normal.magnitude();
260375
- const centroid = points.getPoint3dAtCheckedPointIndex(0);
260439
+ const centroid = points.getPoint3dAtCheckedPointIndex(0, result?.origin);
260376
260440
  points.accumulateScaledXYZ(1, 1.0, centroid);
260377
260441
  points.accumulateScaledXYZ(2, 1.0, centroid);
260378
260442
  centroid.scaleInPlace(1.0 / 3.0);
260379
- const result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
260443
+ if (!result)
260444
+ result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
260380
260445
  if (result.tryNormalizeInPlaceWithAreaWeight(a))
260381
260446
  return result;
260382
260447
  return undefined;
@@ -260394,22 +260459,24 @@ class PolygonOps {
260394
260459
  points.vectorXYAndZIndex(origin, 1, vector0);
260395
260460
  let cross = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
260396
260461
  const centroidSum = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
260397
- const normalSum = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
260462
+ const normal = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero(result?.direction);
260398
260463
  let signedTriangleArea;
260399
- // This will work with or without closure edge. If closure is given, the last vector is 000.
260464
+ // This will work with or without closure edge. If closure is given, the last vector is 000.
260400
260465
  for (let i = 2; i < n; i++) {
260401
260466
  points.vectorXYAndZIndex(origin, i, vector1);
260402
260467
  cross = vector0.crossProduct(vector1, cross);
260403
260468
  signedTriangleArea = areaNormal.dotProduct(cross); // well, actually twice the area.
260404
- normalSum.addInPlace(cross); // this grows to twice the area
260469
+ normal.addInPlace(cross); // this grows to twice the area
260405
260470
  const b = signedTriangleArea / 6.0;
260406
260471
  centroidSum.plus2Scaled(vector0, b, vector1, b, centroidSum);
260407
260472
  vector0.setFrom(vector1);
260408
260473
  }
260409
- const area = 0.5 * normalSum.magnitude();
260474
+ const area = 0.5 * normal.magnitude();
260410
260475
  const inverseArea = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.conditionalDivideFraction(1, area);
260411
260476
  if (inverseArea !== undefined) {
260412
- const result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(origin.plusScaled(centroidSum, inverseArea), normalSum);
260477
+ const centroid = origin.plusScaled(centroidSum, inverseArea, result?.origin);
260478
+ if (!result)
260479
+ result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
260413
260480
  result.tryNormalizeInPlaceWithAreaWeight(area);
260414
260481
  return result;
260415
260482
  }
@@ -267383,19 +267450,19 @@ class Matrix4d {
267383
267450
  this._coffs[15] += scale * beta;
267384
267451
  }
267385
267452
  /**
267386
- * Multiply and replace contents of this matrix by A*this*AT where
267387
- * * A is a pure translation with final column [x,y,z,1]
267388
- * * this is this matrix.
267389
- * * AT is the transpose of A.
267390
- * @param ax x part of translation
267391
- * @param ay y part of translation
267392
- * @param az z part of translation
267453
+ * Multiply and replace contents of ` this` matrix by `A*this*AT` where
267454
+ * * `A` is a pure translation with final column [x,y,z,1].
267455
+ * * `this` is this matrix.
267456
+ * * `AT` is the transpose of A.
267457
+ * @param ax x part of translation.
267458
+ * @param ay y part of translation.
267459
+ * @param az z part of translation.
267393
267460
  */
267394
267461
  multiplyTranslationSandwichInPlace(ax, ay, az) {
267395
267462
  const bx = this._coffs[3];
267396
267463
  const by = this._coffs[7];
267397
267464
  const bz = this._coffs[11];
267398
- // matrixB can be non-symmetric!!
267465
+ // matrixB can be non-symmetric
267399
267466
  const cx = this._coffs[12];
267400
267467
  const cy = this._coffs[13];
267401
267468
  const cz = this._coffs[14];
@@ -267418,7 +267485,7 @@ class Matrix4d {
267418
267485
  this._coffs[12] += axBeta;
267419
267486
  this._coffs[13] += ayBeta;
267420
267487
  this._coffs[14] += azBeta;
267421
- // coffs[15] is unchanged !!!
267488
+ // coffs[15] is unchanged
267422
267489
  }
267423
267490
  }
267424
267491
 
@@ -267469,8 +267536,8 @@ __webpack_require__.r(__webpack_exports__);
267469
267536
  * * e.g. entry 03 is summed x.
267470
267537
  * * In this level:
267471
267538
  * * the `absoluteQuantity` member is undefined.
267472
- * * the `localToWorldMap` and `radiiOfGyration` are created by have undefined contents.
267473
- * * Second level: after a call to inertiaProductsToPrincipalAxes, the `localToWorldMap`, `absoluteQuantity` and
267539
+ * * the `localToWorldMap` and `radiiOfGyration` are created but have undefined contents.
267540
+ * * Second level: after a call to `inertiaProductsToPrincipalAxes`, the `localToWorldMap`, `absoluteQuantity` and
267474
267541
  * `radiiOfGyration` are filled in.
267475
267542
  * @public
267476
267543
  */
@@ -267490,18 +267557,35 @@ class MomentData {
267490
267557
  * * This set up with its inverse already constructed.
267491
267558
  */
267492
267559
  localToWorldMap;
267560
+ /** Radii of gyration (square roots of principal second moments). */
267561
+ radiusOfGyration;
267562
+ /**
267563
+ * Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
267564
+ * inertiaProductsToPrincipalAxes.
267565
+ */
267566
+ absoluteQuantity;
267493
267567
  // private variables
267494
267568
  static _vectorA;
267495
267569
  static _vectorB;
267496
267570
  static _vectorC;
267497
267571
  _point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
267498
267572
  _point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
267573
+ /** Constructor. */
267574
+ constructor() {
267575
+ this.origin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
267576
+ this.needOrigin = false;
267577
+ this.sums = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createZero();
267578
+ this.localToWorldMap = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity();
267579
+ this.radiusOfGyration = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
267580
+ this.absoluteQuantity = 0.1; // so optimizer sees its type
267581
+ this.absoluteQuantity = undefined;
267582
+ }
267499
267583
  /**
267500
267584
  * Return the lower-right (3,3) entry in the sums.
267501
267585
  * * This is the quantity (i.e. length, area, or volume) summed.
267502
267586
  */
267503
267587
  get quantitySum() {
267504
- return this.sums.atIJ(3, 3);
267588
+ return this.sums.weight();
267505
267589
  }
267506
267590
  /**
267507
267591
  * Return a scale factor to make these sums match the target orientation sign.
@@ -267532,23 +267616,6 @@ class MomentData {
267532
267616
  this.needOrigin = false;
267533
267617
  }
267534
267618
  }
267535
- /** Radii of gyration (square roots of principal second moments). */
267536
- radiusOfGyration;
267537
- /**
267538
- * Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
267539
- * inertiaProductsToPrincipalAxes.
267540
- */
267541
- absoluteQuantity;
267542
- /** Constructor. */
267543
- constructor() {
267544
- this.origin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
267545
- this.sums = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createZero();
267546
- this.localToWorldMap = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity();
267547
- this.radiusOfGyration = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
267548
- this.needOrigin = false;
267549
- this.absoluteQuantity = 0.1; // so optimizer sees its type
267550
- this.absoluteQuantity = undefined;
267551
- }
267552
267619
  /**
267553
267620
  * Create moments with optional origin.
267554
267621
  * * Origin and needOrigin are quirky.
@@ -267592,7 +267659,7 @@ class MomentData {
267592
267659
  axes.setColumnsPoint4dXYZ(points[0], points[1], points[2]);
267593
267660
  if (axes.determinant() < 0)
267594
267661
  axes.scaleColumnsInPlace(-1.0, -1.0, -1.0);
267595
- // prefer x and z positive -- y falls wherever . ..
267662
+ // prefer x and z positive; y falls wherever
267596
267663
  if (axes.at(0, 0) < 0.0)
267597
267664
  axes.scaleColumnsInPlace(-1.0, -1.0, 1.0);
267598
267665
  if (axes.at(2, 2) < 0.0)
@@ -267617,7 +267684,8 @@ class MomentData {
267617
267684
  * * Hence x axis is long direction.
267618
267685
  * * Hence planar data generates large moment as Z.
267619
267686
  * @param origin The origin used for the inertia products.
267620
- * @param inertiaProducts The inertia products: sums or integrals of [xx,xy,xz,xw; yx,yy, yz,yw; zx,zy,zz,zw; wx,wy,wz,w].
267687
+ * @param inertiaProducts The inertia products: sums or integrals of
267688
+ * [xx,xy,xz,xw; yx,yy,yz,yw; zx,zy,zz,zw; wx,wy,wz,w].
267621
267689
  */
267622
267690
  static inertiaProductsToPrincipalAxes(origin, inertiaProducts) {
267623
267691
  const moments = new MomentData();
@@ -267661,23 +267729,21 @@ class MomentData {
267661
267729
  */
267662
267730
  static areEquivalentPrincipalAxes(dataA, dataB) {
267663
267731
  if (dataA && dataB
267664
- && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { // um.. need different tolerance for area, volume?)
267732
+ && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { // TODO: need different tolerance for area, volume?
267665
267733
  if (dataA.localToWorldMap.getOrigin().isAlmostEqual(dataB.localToWorldMap.getOrigin())
267666
267734
  && dataA.radiusOfGyration.isAlmostEqual(dataB.radiusOfGyration)) {
267667
267735
  if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.y)) {
267668
- // We have at least xy symmetry ....
267736
+ // we have at least xy symmetry
267669
267737
  if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.z))
267670
267738
  return true;
267671
- // just xy.
267672
- // allow opposite z directions.
267673
- // If the z's are aligned, x an dy can spin freely.
267739
+ // just xy; allow opposite z directions; if the z's are aligned, x and y can spin freely
267674
267740
  const zA = dataA.localToWorldMap.matrix.columnZ();
267675
267741
  const zB = dataB.localToWorldMap.matrix.columnZ();
267676
267742
  if (zA.isParallelTo(zB, true))
267677
267743
  return true;
267678
267744
  return false;
267679
267745
  }
267680
- // no symmetry. Test all three axes.
267746
+ // no symmetry; test all three axes
267681
267747
  const vectorA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
267682
267748
  const vectorB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
267683
267749
  for (let i = 0; i < 3; i++) {
@@ -267707,7 +267773,7 @@ class MomentData {
267707
267773
  }
267708
267774
  /** Revise the accumulated sums to be "around the centroid". */
267709
267775
  shiftOriginAndSumsToCentroidOfSums() {
267710
- const xyz = this.sums.columnW().realPoint();
267776
+ const xyz = this.sums.columnW().realPoint(); // centroid of the geometry
267711
267777
  if (xyz) {
267712
267778
  this.shiftOriginAndSumsByXYZ(xyz.x, xyz.y, xyz.z);
267713
267779
  return true;
@@ -267716,9 +267782,9 @@ class MomentData {
267716
267782
  }
267717
267783
  /**
267718
267784
  * Revise the accumulated sums.
267719
- * * add ax,ay,ax to the origin coordinates.
267720
- * * apply the negative translation to the sums.
267721
- */
267785
+ * * Add (ax,ay,az) to the origin coordinates.
267786
+ * * Apply the negative translation to the sums.
267787
+ */
267722
267788
  shiftOriginAndSumsByXYZ(ax, ay, az) {
267723
267789
  this.origin.addXYZInPlace(ax, ay, az);
267724
267790
  this.sums.multiplyTranslationSandwichInPlace(-ax, -ay, -az);
@@ -267728,23 +267794,24 @@ class MomentData {
267728
267794
  this.shiftOriginAndSumsByXYZ(newOrigin.x - this.origin.x, newOrigin.y - this.origin.y, newOrigin.z - this.origin.z);
267729
267795
  }
267730
267796
  /**
267731
- * Compute moments of a triangle from the origin to the given line.
267732
- * Accumulate them to this.sums.
267733
- * * If `pointA` is undefined, use `this.origin` as pointA.
267734
- * * If `this.needOrigin` is set, pointB is used
267735
- */
267797
+ * Compute moments of a triangle from the origin. Accumulate them to `this.sums`.
267798
+ * * If `this.needOrigin` is set, `this.origin` is set to `pointB`.
267799
+ * * If `pointA` is undefined, use `this.origin` as `pointA`.
267800
+ */
267736
267801
  accumulateTriangleMomentsXY(pointA, pointB, pointC) {
267737
267802
  this.setOriginXYZIfNeeded(pointB.x, pointB.y, 0.0);
267738
267803
  const x0 = this.origin.x;
267739
267804
  const y0 = this.origin.y;
267740
- const vectorA = MomentData._vectorA =
267741
- pointA !== undefined ? _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointA.x - x0, pointA.y - y0, 0.0, 1.0, MomentData._vectorA)
267742
- : _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(this.origin.x, this.origin.y, 0.0, 1.0, MomentData._vectorA);
267805
+ const vectorA = MomentData._vectorA = (pointA !== undefined) ?
267806
+ _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointA.x - x0, pointA.y - y0, 0.0, 1.0, MomentData._vectorA) :
267807
+ _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(0.0, 0.0, 0.0, 1.0, MomentData._vectorA);
267743
267808
  const vectorB = MomentData._vectorB = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointB.x - x0, pointB.y - y0, 0.0, 1.0, MomentData._vectorB);
267744
267809
  const vectorC = MomentData._vectorC = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointC.x - x0, pointC.y - y0, 0.0, 1.0, MomentData._vectorC);
267745
- // 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
267746
- // where w = 1-u-v
267747
- // W = column vector (point00.x, point00.y, point00.z, 1.0) etc.
267810
+ // Below we calculate 16 double integrals: \iint_T [x y 0 1]^ [x y 0 1] dT over triangle T=(A,B,C).
267811
+ // Each accumulates contributions from 9 scaled outer products. Integration computations use the barycentric
267812
+ // change of variables [B-A C-A][u,v]^ = [x,y]^ with Jacobian detJ = B-A x C-A = twice the area of T.
267813
+ // This converts the integration domain from T to the triangle bounded by u=0, v=0 and v=1-u, yielding e.g.,
267814
+ // \iint_T x^2 dT = detJ \int_0^1 \int_0^{1-u} u^2 dv du = detJ / 12, and similarly \iint_T xy dT = detJ / 24.
267748
267815
  const detJ = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.crossProductXYXY(vectorB.x - vectorA.x, vectorB.y - vectorA.y, vectorC.x - vectorA.x, vectorC.y - vectorA.y);
267749
267816
  if (detJ !== 0.0) {
267750
267817
  const r1_12 = detJ / 12.0;
@@ -267760,7 +267827,7 @@ class MomentData {
267760
267827
  this.sums.addScaledOuterProductInPlace(vectorC, vectorC, r1_12);
267761
267828
  }
267762
267829
  }
267763
- /** Add scaled outer product of (4d, unit weight) point to this.sums. */
267830
+ /** Add scaled outer product of (4d, unit weight) point to `this.sums`. */
267764
267831
  accumulateScaledOuterProduct(point, scaleFactor) {
267765
267832
  this.setOriginXYZIfNeeded(point.x, point.y, 0.0);
267766
267833
  const vectorA = MomentData._vectorA = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(point.x - this.origin.x, point.y - this.origin.y, point.z - this.origin.z, 1.0, MomentData._vectorA);
@@ -267783,16 +267850,15 @@ class MomentData {
267783
267850
  this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_3);
267784
267851
  }
267785
267852
  /**
267786
- * Compute moments of triangles from a base point to the given linestring.
267787
- * Accumulate them to this.sums.
267788
- * * If `pointA` is undefined, use `this.origin` as pointA.
267789
- * * If `this.needOrigin` is set, the first point of the array is captured as local origin for subsequent sums.
267790
- *
267853
+ * Compute moments of triangles from a base point to the given linestring. Accumulate them to `this.sums`.
267854
+ * * If `this.needOrigin` is set, `this.origin` is set to the first point of the array.
267855
+ * * If `sweepBase` is undefined, use `this.origin` as `sweepBase`.
267791
267856
  */
267792
267857
  accumulateTriangleToLineStringMomentsXY(sweepBase, points) {
267793
267858
  const n = points.length;
267794
267859
  if (n > 1) {
267795
267860
  points.getPoint3dAtUncheckedPointIndex(0, this._point0);
267861
+ // The linestring forms a polygon with sweepBase. Integrate over this polygon using Shoelace algorithm.
267796
267862
  for (let i = 1; i < n; i++) {
267797
267863
  points.getPoint3dAtUncheckedPointIndex(i, this._point1);
267798
267864
  this.accumulateTriangleMomentsXY(sweepBase, this._point0, this._point1);
@@ -267801,17 +267867,17 @@ class MomentData {
267801
267867
  }
267802
267868
  }
267803
267869
  /**
267804
- * * 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].
267805
- * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin]. (Column weights 0001) (only xy
267806
- * parts of vectors).
267807
- * * scale by detJ for the xy-only determinant of the vectors.
267870
+ * Assemble XX, YY, XY products into a full matrix form [xx,xy,0,0; xy,yy,0,0; 0,0,0,0; 0,0,0,1].
267871
+ * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin].
267872
+ * (column weights 0001; only xy parts of vectors).
267873
+ * * Scale by detJ for the xy-only determinant of the vectors.
267808
267874
  * @param productXX
267809
267875
  * @param productXY
267810
267876
  * @param productYY
267811
- * @param area Area in caller's system.
267812
- * @param origin Caller's origin.
267813
- * @param vectorU Caller's U axis (not necessarily unit).
267814
- * @param vectorV Caller's V axis (not necessarily unit).
267877
+ * @param area area in caller's system.
267878
+ * @param origin caller's origin.
267879
+ * @param vectorU caller's U axis (not necessarily unit).
267880
+ * @param vectorV caller's V axis (not necessarily unit).
267815
267881
  */
267816
267882
  accumulateXYProductsInCentroidalFrame(productXX, productXY, productYY, area, origin, vectorU, vectorV) {
267817
267883
  const centroidalProducts = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createRowValues(productXX, productXY, 0, 0, productXY, productYY, 0, 0, 0, 0, 0, 0, 0, 0, 0, area);
@@ -329417,7 +329483,7 @@ class TestContext {
329417
329483
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
329418
329484
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
329419
329485
  await core_frontend_1.NoRenderApp.startup({
329420
- applicationVersion: "5.1.0-dev.3",
329486
+ applicationVersion: "5.1.0-dev.4",
329421
329487
  applicationId: this.settings.gprid,
329422
329488
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
329423
329489
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -354485,7 +354551,7 @@ var loadLanguages = instance.loadLanguages;
354485
354551
  /***/ ((module) => {
354486
354552
 
354487
354553
  "use strict";
354488
- 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"}}');
354554
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.4","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.3.0","@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
354489
354555
 
354490
354556
  /***/ }),
354491
354557