@itwin/rpcinterface-full-stack-tests 5.0.0-dev.114 → 5.0.0-dev.115

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.
@@ -214859,7 +214859,8 @@ class BSpline2dNd extends _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geom
214859
214859
  knots;
214860
214860
  /** flat array of coordinate data, blocked by poleDimension and row */
214861
214861
  coffs;
214862
- /** Number of components per pole.
214862
+ /**
214863
+ * Number of components per pole.
214863
214864
  * * 3 for conventional xyz surface
214864
214865
  * * 4 for weighted (wx, wy, wz, w) surface.
214865
214866
  */
@@ -220639,11 +220640,13 @@ class ClipUtilities {
220639
220640
  clippedLocalRegion.tryTransformInPlace(localToWorld);
220640
220641
  if (!result)
220641
220642
  result = (clippedLocalRegion instanceof _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_8__.UnionRegion) ? clippedLocalRegion : _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_8__.UnionRegion.create(clippedLocalRegion);
220642
- else if (!result.tryAddChild(clippedLocalRegion))
220643
- result.children.push(...clippedLocalRegion.children);
220643
+ if (clippedLocalRegion instanceof _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_8__.UnionRegion)
220644
+ result.children.push(...clippedLocalRegion.children); // avoid nested UnionRegions
220645
+ else
220646
+ result.tryAddChild(clippedLocalRegion);
220644
220647
  }
220645
220648
  }
220646
- return result;
220649
+ return result ? _curve_RegionOps__WEBPACK_IMPORTED_MODULE_7__.RegionOps.simplifyRegionType(result) : undefined;
220647
220650
  }
220648
220651
  /**
220649
220652
  * Compute and return portions of the input curve or region that are within the clipper.
@@ -234031,9 +234034,10 @@ __webpack_require__.r(__webpack_exports__);
234031
234034
  /* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
234032
234035
  /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
234033
234036
  /* harmony import */ var _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry4d/MomentData */ "../../core/geometry/lib/esm/geometry4d/MomentData.js");
234034
- /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
234035
- /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
234036
- /* harmony import */ var _StrokeOptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
234037
+ /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
234038
+ /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
234039
+ /* harmony import */ var _RegionOps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
234040
+ /* harmony import */ var _StrokeOptions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
234037
234041
  /*---------------------------------------------------------------------------------------------
234038
234042
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
234039
234043
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -234045,6 +234049,7 @@ __webpack_require__.r(__webpack_exports__);
234045
234049
 
234046
234050
 
234047
234051
 
234052
+
234048
234053
  /**
234049
234054
  * Implementation class for computing XY area moments.
234050
234055
  * @internal
@@ -234053,15 +234058,15 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
234053
234058
  _activeMomentData;
234054
234059
  _point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
234055
234060
  _point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
234056
- /** Accumulate (independent) integrations over
234057
- * * origin to chord of the arc.
234058
- * * origin to the "cap" between the chord and arc.
234061
+ /**
234062
+ * Accumulate (independent) integrations over:
234063
+ * * The area between the arc and the chord connecting its endpoints.
234064
+ * * The triangle with vertices: origin, arc start, arc end.
234059
234065
  */
234060
234066
  handleArc3d(arc) {
234061
234067
  const momentData = this._activeMomentData;
234062
234068
  const sweepRadians = arc.sweep.sweepRadians;
234063
234069
  const alphaRadians = sweepRadians * 0.5;
234064
- // from https://apps.dtic.mil/dtic/tr/fulltext/u2/274936.pdf page 71 for radius = 1
234065
234070
  let s = Math.sin(alphaRadians);
234066
234071
  let c = Math.cos(alphaRadians);
234067
234072
  let s1 = Math.sin(sweepRadians);
@@ -234088,12 +234093,12 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
234088
234093
  const pointC = arc.fractionToPoint(1.0);
234089
234094
  momentData.accumulateTriangleMomentsXY(undefined, pointB, pointC);
234090
234095
  }
234091
- /** Accumulate integrals over the (triangular) areas from the origin to each line segment */
234096
+ /** Accumulate integrals over the (triangular) areas from the origin to each line segment. */
234092
234097
  handleLineString3d(ls) {
234093
234098
  const momentData = this._activeMomentData;
234094
234099
  momentData.accumulateTriangleToLineStringMomentsXY(undefined, ls.packedPoints);
234095
234100
  }
234096
- /** Accumulate integrals over the (triangular) area from the origin to this line segment */
234101
+ /** Accumulate integrals over the (triangular) area from the origin to this line segment. */
234097
234102
  handleLineSegment3d(segment) {
234098
234103
  const momentData = this._activeMomentData;
234099
234104
  segment.startPoint(this._point0);
@@ -234109,50 +234114,15 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
234109
234114
  this._activeMomentData = undefined;
234110
234115
  return momentData;
234111
234116
  }
234112
- /**
234113
- * ASSUMPTIONS FOR ORIENTATION AND CONTAINMENT ISSUES
234114
- * * Largest area is outer
234115
- * * All others are interior (and not overlapping)
234116
- * Hence
234117
- * * Outer area sign must be positive -- negate all integrations as needed
234118
- * * Outer area signs must be positive -- negate all integrations as needed
234119
- * @param region
234120
- */
234121
- handleParityRegion(region) {
234122
- const allChildMoments = [];
234123
- let maxAbsArea = 0.0;
234124
- let largestChildMoments;
234125
- for (const child of region.children) {
234126
- if (child instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop) {
234127
- const childMoments = this.handleLoop(child);
234128
- if (childMoments) {
234129
- allChildMoments.push(childMoments);
234130
- const q = Math.abs(childMoments.quantitySum);
234131
- if (q > maxAbsArea) {
234132
- maxAbsArea = q;
234133
- largestChildMoments = childMoments;
234134
- }
234135
- }
234136
- }
234137
- }
234138
- if (largestChildMoments) {
234139
- const summedMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__.MomentData.create();
234140
- const sign0 = largestChildMoments.signFactor(1.0);
234141
- summedMoments.accumulateProducts(largestChildMoments, sign0);
234142
- for (const childMoments of allChildMoments) {
234143
- if (childMoments !== largestChildMoments) {
234144
- const sign1 = childMoments.signFactor(-1.0);
234145
- summedMoments.accumulateProducts(childMoments, sign1);
234146
- }
234147
- }
234148
- return summedMoments;
234149
- }
234150
- return undefined;
234151
- }
234152
- /** Accumulate (as simple addition) products over each component of the union region. */
234153
- handleUnionRegion(region) {
234117
+ handleAnyRegion(region) {
234118
+ // guarantee there is no overlapping children
234119
+ const merged = _RegionOps__WEBPACK_IMPORTED_MODULE_4__.RegionOps.regionBooleanXY(region, undefined, _RegionOps__WEBPACK_IMPORTED_MODULE_4__.RegionBinaryOpType.Union);
234120
+ if (!merged)
234121
+ return undefined;
234122
+ if (merged instanceof _Loop__WEBPACK_IMPORTED_MODULE_5__.Loop)
234123
+ return this.handleLoop(merged);
234154
234124
  const summedMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__.MomentData.create();
234155
- for (const child of region.children) {
234125
+ for (const child of merged.children) {
234156
234126
  const childMoments = child.dispatchToGeometryHandler(this);
234157
234127
  if (childMoments) {
234158
234128
  const sign0 = childMoments.signFactor(1.0);
@@ -234161,32 +234131,46 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
234161
234131
  }
234162
234132
  return summedMoments;
234163
234133
  }
234134
+ /** Accumulate integrals from origin to the components of the parity region. */
234135
+ handleParityRegion(region) {
234136
+ return this.handleAnyRegion(region);
234137
+ }
234138
+ /** Accumulate integrals from origin to the components of the union region. */
234139
+ handleUnionRegion(region) {
234140
+ return this.handleAnyRegion(region);
234141
+ }
234164
234142
  _strokeOptions;
234165
234143
  getStrokeOptions() {
234166
234144
  if (this._strokeOptions)
234167
234145
  return this._strokeOptions;
234168
- const options = _StrokeOptions__WEBPACK_IMPORTED_MODULE_5__.StrokeOptions.createForCurves();
234146
+ const options = _StrokeOptions__WEBPACK_IMPORTED_MODULE_6__.StrokeOptions.createForCurves();
234169
234147
  // this is unusually fine for stroking, but appropriate for sum.
234170
234148
  options.angleTol = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(5.0);
234171
234149
  this._strokeOptions = options;
234172
234150
  return options;
234173
234151
  }
234174
- /** Single curve primitive (not loop . . .).
234175
- * * stroke the curve
234176
- * * accumulate stroke array.
234152
+ /**
234153
+ * Handle a single curve primitive (not loop).
234154
+ * * Stroke the curve and accumulate stroke array.
234177
234155
  */
234178
234156
  handleCurvePrimitive(cp) {
234179
- const strokes = _LineString3d__WEBPACK_IMPORTED_MODULE_6__.LineString3d.create();
234157
+ const strokes = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
234180
234158
  const options = this.getStrokeOptions();
234181
234159
  cp.emitStrokes(strokes, options);
234182
234160
  this.handleLineString3d(strokes);
234183
234161
  }
234184
- /** handle strongly typed BSplineCurve3d as generic curve primitive */
234185
- handleBSplineCurve3d(g) { return this.handleCurvePrimitive(g); }
234186
- /** handle strongly typed BSplineCurve3dH as generic curve primitive */
234187
- handleBSplineCurve3dH(g) { return this.handleCurvePrimitive(g); }
234188
- /** handle strongly typed TransitionSpiral as generic curve primitive */
234189
- handleTransitionSpiral(g) { return this.handleCurvePrimitive(g); }
234162
+ /** Handle strongly typed BSplineCurve3d as generic curve primitive. */
234163
+ handleBSplineCurve3d(g) {
234164
+ this.handleCurvePrimitive(g);
234165
+ }
234166
+ /** Handle strongly typed BSplineCurve3dH as generic curve primitive. */
234167
+ handleBSplineCurve3dH(g) {
234168
+ this.handleCurvePrimitive(g);
234169
+ }
234170
+ /** Handle strongly typed TransitionSpiral as generic curve primitive. */
234171
+ handleTransitionSpiral(g) {
234172
+ this.handleCurvePrimitive(g);
234173
+ }
234190
234174
  }
234191
234175
 
234192
234176
 
@@ -234206,41 +234190,44 @@ __webpack_require__.r(__webpack_exports__);
234206
234190
  /* harmony export */ RegionOps: () => (/* binding */ RegionOps)
234207
234191
  /* harmony export */ });
234208
234192
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
234209
- /* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
234210
- /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
234211
- /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
234212
- /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
234213
- /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
234214
- /* harmony import */ var _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../geometry3d/PolylineCompressionByEdgeOffset */ "../../core/geometry/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js");
234215
- /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
234216
- /* harmony import */ var _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/SortablePolygon */ "../../core/geometry/lib/esm/geometry3d/SortablePolygon.js");
234217
- /* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
234193
+ /* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
234194
+ /* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
234195
+ /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
234196
+ /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
234197
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
234198
+ /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
234199
+ /* harmony import */ var _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/PolylineCompressionByEdgeOffset */ "../../core/geometry/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js");
234200
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
234201
+ /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
234202
+ /* harmony import */ var _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../geometry3d/SortablePolygon */ "../../core/geometry/lib/esm/geometry3d/SortablePolygon.js");
234203
+ /* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
234218
234204
  /* harmony import */ var _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry4d/MomentData */ "../../core/geometry/lib/esm/geometry4d/MomentData.js");
234219
- /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
234220
- /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
234221
- /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
234222
- /* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
234223
- /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
234224
- /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
234225
- /* harmony import */ var _CurveCurve__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./CurveCurve */ "../../core/geometry/lib/esm/curve/CurveCurve.js");
234226
- /* harmony import */ var _CurveOps__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
234227
- /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
234205
+ /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
234206
+ /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
234207
+ /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
234208
+ /* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
234209
+ /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
234210
+ /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
234211
+ /* harmony import */ var _CurveCurve__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./CurveCurve */ "../../core/geometry/lib/esm/curve/CurveCurve.js");
234212
+ /* harmony import */ var _CurveOps__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
234213
+ /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
234228
234214
  /* harmony import */ var _CurveWireMomentsXYZ__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CurveWireMomentsXYZ */ "../../core/geometry/lib/esm/curve/CurveWireMomentsXYZ.js");
234229
- /* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
234230
- /* harmony import */ var _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./internalContexts/ChainCollectorContext */ "../../core/geometry/lib/esm/curve/internalContexts/ChainCollectorContext.js");
234231
- /* harmony import */ var _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./internalContexts/PolygonOffsetContext */ "../../core/geometry/lib/esm/curve/internalContexts/PolygonOffsetContext.js");
234232
- /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
234233
- /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
234234
- /* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
234235
- /* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
234236
- /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
234237
- /* harmony import */ var _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./Query/ConsolidateAdjacentPrimitivesContext */ "../../core/geometry/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js");
234238
- /* harmony import */ var _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./Query/CurveSplitContext */ "../../core/geometry/lib/esm/curve/Query/CurveSplitContext.js");
234239
- /* harmony import */ var _Query_InOutTests__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./Query/InOutTests */ "../../core/geometry/lib/esm/curve/Query/InOutTests.js");
234240
- /* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
234215
+ /* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
234216
+ /* harmony import */ var _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./internalContexts/ChainCollectorContext */ "../../core/geometry/lib/esm/curve/internalContexts/ChainCollectorContext.js");
234217
+ /* harmony import */ var _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./internalContexts/PolygonOffsetContext */ "../../core/geometry/lib/esm/curve/internalContexts/PolygonOffsetContext.js");
234218
+ /* harmony import */ var _internalContexts_TransferWithSplitArcs__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./internalContexts/TransferWithSplitArcs */ "../../core/geometry/lib/esm/curve/internalContexts/TransferWithSplitArcs.js");
234219
+ /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
234220
+ /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
234221
+ /* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
234222
+ /* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
234223
+ /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
234224
+ /* harmony import */ var _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./Query/ConsolidateAdjacentPrimitivesContext */ "../../core/geometry/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js");
234225
+ /* harmony import */ var _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./Query/CurveSplitContext */ "../../core/geometry/lib/esm/curve/Query/CurveSplitContext.js");
234226
+ /* harmony import */ var _Query_InOutTests__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Query/InOutTests */ "../../core/geometry/lib/esm/curve/Query/InOutTests.js");
234227
+ /* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
234241
234228
  /* harmony import */ var _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RegionMomentsXY */ "../../core/geometry/lib/esm/curve/RegionMomentsXY.js");
234242
- /* harmony import */ var _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./RegionOpsClassificationSweeps */ "../../core/geometry/lib/esm/curve/RegionOpsClassificationSweeps.js");
234243
- /* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
234229
+ /* harmony import */ var _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./RegionOpsClassificationSweeps */ "../../core/geometry/lib/esm/curve/RegionOpsClassificationSweeps.js");
234230
+ /* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
234244
234231
  /*---------------------------------------------------------------------------------------------
234245
234232
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
234246
234233
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -234280,6 +234267,9 @@ __webpack_require__.r(__webpack_exports__);
234280
234267
 
234281
234268
 
234282
234269
 
234270
+
234271
+
234272
+
234283
234273
 
234284
234274
 
234285
234275
 
@@ -234311,13 +234301,16 @@ var RegionBinaryOpType;
234311
234301
  class RegionOps {
234312
234302
  /**
234313
234303
  * Return moment sums for a loop, parity region, or union region.
234304
+ * * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
234314
234305
  * * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
234315
- * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
234316
- * @param root any Loop, ParityRegion, or UnionRegion.
234306
+ * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes(rawMomentData.origin, rawMomentData.sums);`
234307
+ * * `rawMomentData.origin` is the centroid of `region`.
234308
+ * * `rawMomentData.sums.weight()` is the signed area of `region`.
234309
+ * @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
234317
234310
  */
234318
- static computeXYAreaMoments(root) {
234311
+ static computeXYAreaMoments(region) {
234319
234312
  const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__.RegionMomentsXY();
234320
- const result = root.dispatchToGeometryHandler(handler);
234313
+ const result = region.dispatchToGeometryHandler(handler);
234321
234314
  if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__.MomentData) {
234322
234315
  result.shiftOriginAndSumsToCentroidOfSums();
234323
234316
  return result;
@@ -234326,8 +234319,8 @@ class RegionOps {
234326
234319
  }
234327
234320
  /**
234328
234321
  * Return an area tolerance for a given xy-range and optional distance tolerance.
234329
- * @param range range of planar region to tolerance
234330
- * @param distanceTolerance optional absolute distance tolerance
234322
+ * @param range range of planar region to tolerance.
234323
+ * @param distanceTolerance optional absolute distance tolerance.
234331
234324
  */
234332
234325
  static computeXYAreaTolerance(range, distanceTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
234333
234326
  // 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).
@@ -234336,19 +234329,13 @@ class RegionOps {
234336
234329
  }
234337
234330
  /**
234338
234331
  * Return a (signed) xy area for a region.
234339
- <<<<<<< HEAD
234340
- * * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
234341
- * @param root any Loop, ParityRegion, or UnionRegion.
234342
- =======
234343
234332
  * * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
234344
- * * For a non-self-intersecting Loop, the returned area is negative if and only if the Loop is oriented clockwise
234345
- * with respect to the positive z-axis.
234333
+ * * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
234346
234334
  * @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
234347
- >>>>>>> 168574b454 (Utilize `PolyfaceData.edgeMateIndex` to speed up some `Polyface` methods (#8095))
234348
234335
  */
234349
- static computeXYArea(root) {
234336
+ static computeXYArea(region) {
234350
234337
  const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__.RegionMomentsXY();
234351
- const result = root.dispatchToGeometryHandler(handler);
234338
+ const result = region.dispatchToGeometryHandler(handler);
234352
234339
  if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__.MomentData) {
234353
234340
  return result.quantitySum;
234354
234341
  }
@@ -234356,49 +234343,88 @@ class RegionOps {
234356
234343
  }
234357
234344
  /**
234358
234345
  * Return MomentData with the sums of wire moments.
234346
+ * * The input curve should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
234359
234347
  * * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
234360
- * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
234361
- * @param root any CurveCollection or CurvePrimitive.
234348
+ * call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
234349
+ * * `rawMomentData.origin` is the wire centroid of `curve`.
234350
+ * * `rawMomentData.sums.weight()` is the signed length of `curve`.
234351
+ * @param curve any [[CurveCollection]] or [[CurvePrimitive]].
234362
234352
  */
234363
- static computeXYZWireMomentSums(root) {
234353
+ static computeXYZWireMomentSums(curve) {
234364
234354
  const handler = new _CurveWireMomentsXYZ__WEBPACK_IMPORTED_MODULE_3__.CurveWireMomentsXYZ();
234365
- handler.visitLeaves(root);
234355
+ handler.visitLeaves(curve);
234366
234356
  const result = handler.momentData;
234367
234357
  result.shiftOriginAndSumsToCentroidOfSums();
234368
234358
  return result;
234369
234359
  }
234360
+ /**
234361
+ * Return a [[Ray3d]] with:
234362
+ * * `origin` is the centroid of the region,
234363
+ * * `direction` is a unit vector perpendicular to the region plane,
234364
+ * * `a` is the region area.
234365
+ * @param region the region to process. Can lie in any plane.
234366
+ * @param result optional pre-allocated result to populate and return.
234367
+ */
234368
+ static centroidAreaNormal(region, result) {
234369
+ const localToWorld = _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_4__.FrameBuilder.createRightHandedFrame(undefined, region);
234370
+ if (!localToWorld)
234371
+ return undefined;
234372
+ const normal = localToWorld.matrix.columnZ(result?.direction);
234373
+ const regionIsXY = normal.isParallelTo(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Vector3d.unitZ(), true);
234374
+ let regionXY = region;
234375
+ if (!regionIsXY) { // rotate the region to be parallel to the xy-plane
234376
+ regionXY = region.cloneTransformed(localToWorld.inverse());
234377
+ if (!regionXY)
234378
+ return undefined;
234379
+ }
234380
+ const momentData = RegionOps.computeXYAreaMoments(regionXY);
234381
+ if (!momentData)
234382
+ return undefined;
234383
+ const centroid = momentData.origin.clone(result?.origin);
234384
+ if (!regionIsXY) // rotate centroid back (area is unchanged)
234385
+ localToWorld.multiplyPoint3d(centroid, centroid);
234386
+ let area = momentData.sums.weight();
234387
+ if (area < 0.0) {
234388
+ area = -area;
234389
+ normal.scale(-1.0, normal);
234390
+ }
234391
+ if (!result)
234392
+ result = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__.Ray3d.createCapture(centroid, normal);
234393
+ result.a = area;
234394
+ return result;
234395
+ }
234370
234396
  /**
234371
234397
  * Create loops in the graph.
234372
234398
  * @internal
234373
234399
  */
234374
234400
  static addLoopsToGraph(graph, data, announceIsolatedLoop) {
234375
- if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop) {
234401
+ if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop) {
234376
234402
  const points = data.getPackedStrokes();
234377
234403
  if (points)
234378
234404
  this.addLoopsToGraph(graph, points, announceIsolatedLoop);
234379
234405
  }
234380
- else if (data instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_5__.ParityRegion) {
234406
+ else if (data instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
234381
234407
  for (const child of data.children) {
234382
234408
  const points = child.getPackedStrokes();
234383
234409
  if (points)
234384
234410
  this.addLoopsToGraph(graph, points, announceIsolatedLoop);
234385
234411
  }
234386
234412
  }
234387
- else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
234388
- const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
234413
+ else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
234414
+ const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
234389
234415
  if (loopSeed !== undefined)
234390
234416
  announceIsolatedLoop(graph, loopSeed);
234391
234417
  }
234392
234418
  else if (Array.isArray(data)) {
234393
234419
  if (data.length > 0) {
234394
- if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__.Point3d.isAnyImmediatePointType(data[0])) {
234395
- const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
234420
+ if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.isAnyImmediatePointType(data[0])) {
234421
+ const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
234396
234422
  if (loopSeed !== undefined)
234397
234423
  announceIsolatedLoop(graph, loopSeed);
234398
234424
  }
234399
- else if (data[0] instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
234425
+ else if (data[0] instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
234400
234426
  for (const loop of data) {
234401
- const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.directCreateFaceLoopFromCoordinates(graph, loop);
234427
+ const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, loop);
234402
234428
  if (loopSeed !== undefined)
234403
234429
  announceIsolatedLoop(graph, loopSeed);
234404
234430
  }
@@ -234438,10 +234464,10 @@ class RegionOps {
234438
234464
  static finishGraphToPolyface(graph, triangulate) {
234439
234465
  if (graph) {
234440
234466
  if (triangulate) {
234441
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.triangulateAllPositiveAreaFaces(graph);
234442
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.flipTriangles(graph);
234467
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.triangulateAllPositiveAreaFaces(graph);
234468
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
234443
234469
  }
234444
- return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_9__.PolyfaceBuilder.graphToPolyface(graph);
234470
+ return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__.PolyfaceBuilder.graphToPolyface(graph);
234445
234471
  }
234446
234472
  return undefined;
234447
234473
  }
@@ -234455,7 +234481,7 @@ class RegionOps {
234455
234481
  * @param triangulate whether to triangulate the result
234456
234482
  */
234457
234483
  static polygonXYAreaIntersectLoopsToPolyface(loopsA, loopsB, triangulate = false) {
234458
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && inB), this._graphCheckPointFunction);
234484
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && inB), this._graphCheckPointFunction);
234459
234485
  return this.finishGraphToPolyface(graph, triangulate);
234460
234486
  }
234461
234487
  /**
@@ -234468,7 +234494,7 @@ class RegionOps {
234468
234494
  * @param triangulate whether to triangulate the result
234469
234495
  */
234470
234496
  static polygonXYAreaUnionLoopsToPolyface(loopsA, loopsB, triangulate = false) {
234471
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA || inB), this._graphCheckPointFunction);
234497
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA || inB), this._graphCheckPointFunction);
234472
234498
  return this.finishGraphToPolyface(graph, triangulate);
234473
234499
  }
234474
234500
  /**
@@ -234481,9 +234507,31 @@ class RegionOps {
234481
234507
  * @param triangulate whether to triangulate the result
234482
234508
  */
234483
234509
  static polygonXYAreaDifferenceLoopsToPolyface(loopsA, loopsB, triangulate = false) {
234484
- const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && !inB), this._graphCheckPointFunction);
234510
+ const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && !inB), this._graphCheckPointFunction);
234485
234511
  return this.finishGraphToPolyface(graph, triangulate);
234486
234512
  }
234513
+ /**
234514
+ * Simplify the type of the region by stripping redundant parent(s).
234515
+ * * No Boolean operations are performed.
234516
+ * * Invalid inputs (such as childless regions) are not corrected.
234517
+ * @param region region to simplify
234518
+ * @returns
234519
+ * * For a [[UnionRegion]] with exactly one child, return it if it is a [[Loop]],
234520
+ * or if it is a [[ParityRegion]] with multiple children, otherwise return the `ParityRegion`'s `Loop`.
234521
+ * * For a `ParityRegion` with exactly one `Loop`, return it.
234522
+ * * All other inputs returned unchanged.
234523
+ */
234524
+ static simplifyRegionType(region) {
234525
+ if (region instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion) {
234526
+ if (region.children.length === 1)
234527
+ return this.simplifyRegionType(region.children[0]);
234528
+ }
234529
+ else if (region instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
234530
+ if (region.children.length === 1)
234531
+ return region.children[0];
234532
+ }
234533
+ return region;
234534
+ }
234487
234535
  /**
234488
234536
  * Return areas defined by a boolean operation.
234489
234537
  * @note For best results, input regions should have correctly oriented loops. See [[sortOuterAndHoleLoopsXY]].
@@ -234497,10 +234545,8 @@ class RegionOps {
234497
234545
  * to connect interior loops to exterior loops.
234498
234546
  */
234499
234547
  static regionBooleanXY(loopsA, loopsB, operation, mergeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
234500
- // Always return UnionRegion for now. But keep return type as AnyRegion:
234501
- // in the future, we might return the *simplest* region type.
234502
- const result = _UnionRegion__WEBPACK_IMPORTED_MODULE_11__.UnionRegion.create();
234503
- const context = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionBooleanContext.create(_RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union);
234548
+ const result = _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion.create();
234549
+ const context = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionBooleanContext.create(_RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union);
234504
234550
  context.addMembers(loopsA, loopsB);
234505
234551
  context.annotateAndMergeCurvesInGraph(mergeTolerance);
234506
234552
  const range = context.groupA.range().union(context.groupB.range());
@@ -234512,12 +234558,12 @@ class RegionOps {
234512
234558
  if (Math.abs(area) < areaTol)
234513
234559
  return;
234514
234560
  if (faceType === 1) {
234515
- const loop = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__.PlanarSubdivision.createLoopInFace(face);
234561
+ const loop = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.createLoopInFace(face);
234516
234562
  if (loop)
234517
234563
  result.tryAddChild(loop);
234518
234564
  }
234519
234565
  });
234520
- return result;
234566
+ return result ? this.simplifyRegionType(result) : undefined;
234521
234567
  }
234522
234568
  /**
234523
234569
  * Return a polyface whose facets are a boolean operation between the input regions.
@@ -234532,7 +234578,7 @@ class RegionOps {
234532
234578
  * @param triangulate whether to triangulate the result
234533
234579
  */
234534
234580
  static polygonBooleanXYToPolyface(inputA, operation, inputB, triangulate = false) {
234535
- 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);
234581
+ 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);
234536
234582
  return this.finishGraphToPolyface(graph, triangulate);
234537
234583
  }
234538
234584
  /**
@@ -234547,18 +234593,18 @@ class RegionOps {
234547
234593
  * @param inputB second set of loops
234548
234594
  */
234549
234595
  static polygonBooleanXYToLoops(inputA, operation, inputB) {
234550
- 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);
234596
+ 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);
234551
234597
  if (!graph)
234552
234598
  return undefined;
234553
- const loopEdges = _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_13__.HalfEdgeGraphSearch.collectExtendedBoundaryLoopsInGraph(graph, _topology_Graph__WEBPACK_IMPORTED_MODULE_14__.HalfEdgeMask.EXTERIOR);
234599
+ const loopEdges = _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_15__.HalfEdgeGraphSearch.collectExtendedBoundaryLoopsInGraph(graph, _topology_Graph__WEBPACK_IMPORTED_MODULE_16__.HalfEdgeMask.EXTERIOR);
234554
234600
  const allLoops = [];
234555
234601
  for (const graphLoop of loopEdges) {
234556
- const points = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray();
234602
+ const points = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray();
234557
234603
  for (const edge of graphLoop)
234558
234604
  points.pushXYZ(edge.x, edge.y, edge.z);
234559
234605
  points.pushWrap(1);
234560
- const loop = _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.create();
234561
- loop.tryAddChild(_LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d.createCapture(points));
234606
+ const loop = _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.create();
234607
+ loop.tryAddChild(_LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d.createCapture(points));
234562
234608
  allLoops.push(loop);
234563
234609
  }
234564
234610
  return RegionOps.sortOuterAndHoleLoopsXY(allLoops);
@@ -234576,7 +234622,7 @@ class RegionOps {
234576
234622
  * object.
234577
234623
  */
234578
234624
  static constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions) {
234579
- const context = new _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_17__.PolygonWireOffsetContext();
234625
+ const context = new _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_19__.PolygonWireOffsetContext();
234580
234626
  return context.constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions);
234581
234627
  }
234582
234628
  /**
@@ -234588,8 +234634,8 @@ class RegionOps {
234588
234634
  * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
234589
234635
  */
234590
234636
  static constructCurveXYOffset(curves, offsetDistanceOrOptions) {
234591
- const offsetOptions = _OffsetOptions__WEBPACK_IMPORTED_MODULE_18__.OffsetOptions.create(offsetDistanceOrOptions);
234592
- return _CurveOps__WEBPACK_IMPORTED_MODULE_19__.CurveOps.constructCurveXYOffset(curves, offsetOptions);
234637
+ const offsetOptions = _OffsetOptions__WEBPACK_IMPORTED_MODULE_20__.OffsetOptions.create(offsetDistanceOrOptions);
234638
+ return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.constructCurveXYOffset(curves, offsetOptions);
234593
234639
  }
234594
234640
  /**
234595
234641
  * Test if point (x,y) is IN, OUT or ON a region.
@@ -234599,7 +234645,7 @@ class RegionOps {
234599
234645
  * @param y y coordinate of point to test
234600
234646
  */
234601
234647
  static testPointInOnOutRegionXY(curves, x, y) {
234602
- return _Query_InOutTests__WEBPACK_IMPORTED_MODULE_20__.PointInOnOutContext.testPointInOnOutRegionXY(curves, x, y);
234648
+ return _Query_InOutTests__WEBPACK_IMPORTED_MODULE_22__.PointInOnOutContext.testPointInOnOutRegionXY(curves, x, y);
234603
234649
  }
234604
234650
  /**
234605
234651
  * Create curve collection of subtype determined by gaps between the input curves.
@@ -234623,11 +234669,11 @@ class RegionOps {
234623
234669
  maxGap = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.maxXY(maxGap, curves[i].endPoint().distance(curves[i + 1].startPoint()));
234624
234670
  let collection;
234625
234671
  if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(maxGap)) {
234626
- collection = wrap ? _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.create() : _Path__WEBPACK_IMPORTED_MODULE_21__.Path.create();
234672
+ collection = wrap ? _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.create() : _Path__WEBPACK_IMPORTED_MODULE_23__.Path.create();
234627
234673
  isPath = true;
234628
234674
  }
234629
234675
  else {
234630
- collection = _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.BagOfCurves.create();
234676
+ collection = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.BagOfCurves.create();
234631
234677
  }
234632
234678
  for (const c of curves)
234633
234679
  collection.tryAddChild(c);
@@ -234653,7 +234699,7 @@ class RegionOps {
234653
234699
  * @param cutterCurves input curves to intersect with `curvesToCut`
234654
234700
  */
234655
234701
  static cloneCurvesWithXYSplits(curvesToCut, cutterCurves) {
234656
- return _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_23__.CurveSplitContext.cloneCurvesWithXYSplits(curvesToCut, cutterCurves);
234702
+ return _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_25__.CurveSplitContext.cloneCurvesWithXYSplits(curvesToCut, cutterCurves);
234657
234703
  }
234658
234704
  /**
234659
234705
  * Create paths assembled from many curves.
@@ -234664,11 +234710,11 @@ class RegionOps {
234664
234710
  static splitToPathsBetweenBreaks(source, makeClones) {
234665
234711
  if (source === undefined)
234666
234712
  return undefined;
234667
- if (source instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__.CurvePrimitive)
234713
+ if (source instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive)
234668
234714
  return source;
234669
234715
  // source is a collection . ..
234670
234716
  const primitives = source.collectCurvePrimitives();
234671
- const chainCollector = new _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_25__.ChainCollectorContext(makeClones);
234717
+ const chainCollector = new _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_27__.ChainCollectorContext(makeClones);
234672
234718
  for (const primitive of primitives) {
234673
234719
  chainCollector.announceCurvePrimitive(primitive);
234674
234720
  }
@@ -234684,7 +234730,7 @@ class RegionOps {
234684
234730
  * @returns object with named chains, insideOffsets, outsideOffsets
234685
234731
  */
234686
234732
  static collectInsideAndOutsideOffsets(fragments, offsetDistance, gapTolerance) {
234687
- return _CurveOps__WEBPACK_IMPORTED_MODULE_19__.CurveOps.collectInsideAndOutsideXYOffsets(fragments, offsetDistance, gapTolerance);
234733
+ return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.collectInsideAndOutsideXYOffsets(fragments, offsetDistance, gapTolerance);
234688
234734
  }
234689
234735
  /**
234690
234736
  * Restructure curve fragments as Paths and Loops.
@@ -234693,7 +234739,7 @@ class RegionOps {
234693
234739
  * @returns chains, possibly wrapped in a [[BagOfCurves]].
234694
234740
  */
234695
234741
  static collectChains(fragments, gapTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
234696
- return _CurveOps__WEBPACK_IMPORTED_MODULE_19__.CurveOps.collectChains(fragments, gapTolerance);
234742
+ return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.collectChains(fragments, gapTolerance);
234697
234743
  }
234698
234744
  /**
234699
234745
  * Find all intersections among curves in `curvesToCut` against the boundaries of `region` and return fragments
@@ -234705,17 +234751,17 @@ class RegionOps {
234705
234751
  const result = { insideParts: [], outsideParts: [], coincidentParts: [] };
234706
234752
  const pathWithIntersectionMarkup = RegionOps.cloneCurvesWithXYSplits(curvesToCut, region);
234707
234753
  const splitPaths = RegionOps.splitToPathsBetweenBreaks(pathWithIntersectionMarkup, true);
234708
- if (splitPaths instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection) {
234754
+ if (splitPaths instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection) {
234709
234755
  for (const child of splitPaths.children) {
234710
- const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(child);
234756
+ const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(child);
234711
234757
  if (pointOnChild) {
234712
234758
  const inOnOut = RegionOps.testPointInOnOutRegionXY(region, pointOnChild.point.x, pointOnChild.point.y);
234713
234759
  pushToInOnOutArrays(child, inOnOut, result.outsideParts, result.coincidentParts, result.insideParts);
234714
234760
  }
234715
234761
  }
234716
234762
  }
234717
- else if (splitPaths instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__.CurvePrimitive) {
234718
- const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(splitPaths);
234763
+ else if (splitPaths instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive) {
234764
+ const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(splitPaths);
234719
234765
  if (pointOnChild) {
234720
234766
  const inOnOut = RegionOps.testPointInOnOutRegionXY(region, pointOnChild.point.x, pointOnChild.point.y);
234721
234767
  pushToInOnOutArrays(splitPaths, inOnOut, result.outsideParts, result.coincidentParts, result.insideParts);
@@ -234739,10 +234785,10 @@ class RegionOps {
234739
234785
  * normal in z column. If not a rectangle, return undefined.
234740
234786
  */
234741
234787
  static rectangleEdgeTransform(data, requireClosurePoint = true) {
234742
- if (data instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
234788
+ if (data instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
234743
234789
  return this.rectangleEdgeTransform(data.packedPoints);
234744
234790
  }
234745
- else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
234791
+ else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
234746
234792
  let dataToUse;
234747
234793
  if (requireClosurePoint && data.length === 5) {
234748
234794
  if (!_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(data.distanceIndexIndex(0, 4)))
@@ -234756,8 +234802,8 @@ class RegionOps {
234756
234802
  return undefined;
234757
234803
  }
234758
234804
  else {
234759
- dataToUse = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray.create(data);
234760
- _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_26__.PolylineCompressionContext.compressInPlaceByShortEdgeLength(dataToUse, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
234805
+ dataToUse = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(data);
234806
+ _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_28__.PolylineCompressionContext.compressInPlaceByShortEdgeLength(dataToUse, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
234761
234807
  if (dataToUse.length < (requireClosurePoint ? 5 : 4))
234762
234808
  return undefined;
234763
234809
  }
@@ -234768,19 +234814,19 @@ class RegionOps {
234768
234814
  if (normalVector.normalizeInPlace()
234769
234815
  && vector12.isAlmostEqual(vector03)
234770
234816
  && vector01.isPerpendicularTo(vector03)) {
234771
- return _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_27__.Transform.createOriginAndMatrixColumns(dataToUse.getPoint3dAtUncheckedPointIndex(0), vector01, vector03, normalVector);
234817
+ return _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_29__.Transform.createOriginAndMatrixColumns(dataToUse.getPoint3dAtUncheckedPointIndex(0), vector01, vector03, normalVector);
234772
234818
  }
234773
234819
  }
234774
234820
  else if (Array.isArray(data)) {
234775
- return this.rectangleEdgeTransform(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_28__.Point3dArrayCarrier(data), requireClosurePoint);
234821
+ return this.rectangleEdgeTransform(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__.Point3dArrayCarrier(data), requireClosurePoint);
234776
234822
  }
234777
- else if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
234823
+ else if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
234778
234824
  return this.rectangleEdgeTransform(data.children[0].packedPoints, true);
234779
234825
  }
234780
- else if (data instanceof _Path__WEBPACK_IMPORTED_MODULE_21__.Path && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
234826
+ else if (data instanceof _Path__WEBPACK_IMPORTED_MODULE_23__.Path && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
234781
234827
  return this.rectangleEdgeTransform(data.children[0].packedPoints, requireClosurePoint);
234782
234828
  }
234783
- else if (data instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveChain) {
234829
+ else if (data instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveChain) {
234784
234830
  if (!data.checkForNonLinearPrimitives()) {
234785
234831
  // const linestring = LineString3d.create();
234786
234832
  const strokes = data.getPackedStrokes();
@@ -234804,7 +234850,7 @@ class RegionOps {
234804
234850
  * @param options options for tolerance and selective simplification.
234805
234851
  */
234806
234852
  static consolidateAdjacentPrimitives(curves, options) {
234807
- const context = new _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_29__.ConsolidateAdjacentCurvePrimitivesContext(options);
234853
+ const context = new _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_31__.ConsolidateAdjacentCurvePrimitivesContext(options);
234808
234854
  curves.dispatchToGeometryHandler(context);
234809
234855
  }
234810
234856
  /**
@@ -234823,14 +234869,14 @@ class RegionOps {
234823
234869
  static sortOuterAndHoleLoopsXY(loops) {
234824
234870
  const loopAndArea = [];
234825
234871
  for (const candidate of loops) {
234826
- if (candidate instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop)
234827
- _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__.SortablePolygon.pushLoop(loopAndArea, candidate);
234828
- else if (candidate instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
234829
- const loop = _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.createPolygon(candidate);
234830
- _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__.SortablePolygon.pushLoop(loopAndArea, loop);
234872
+ if (candidate instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop)
234873
+ _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.pushLoop(loopAndArea, candidate);
234874
+ else if (candidate instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
234875
+ const loop = _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.createPolygon(candidate);
234876
+ _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.pushLoop(loopAndArea, loop);
234831
234877
  }
234832
234878
  }
234833
- return _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_30__.SortablePolygon.sortAsAnyRegion(loopAndArea);
234879
+ return _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.sortAsAnyRegion(loopAndArea);
234834
234880
  }
234835
234881
  /**
234836
234882
  * Find all xy-areas bounded by the unstructured, possibly intersecting curves.
@@ -234853,12 +234899,13 @@ class RegionOps {
234853
234899
  * to the edge and a constituent curve in each.
234854
234900
  */
234855
234901
  static constructAllXYRegionLoops(curvesAndRegions, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
234856
- const primitives = RegionOps.collectCurvePrimitives(curvesAndRegions, undefined, true, true);
234902
+ let primitives = RegionOps.collectCurvePrimitives(curvesAndRegions, undefined, true, true);
234903
+ primitives = _internalContexts_TransferWithSplitArcs__WEBPACK_IMPORTED_MODULE_33__.TransferWithSplitArcs.clone(_CurveCollection__WEBPACK_IMPORTED_MODULE_24__.BagOfCurves.create(...primitives)).children;
234857
234904
  const range = this.curveArrayRange(primitives);
234858
234905
  const areaTol = this.computeXYAreaTolerance(range, tolerance);
234859
- const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_31__.CurveCurve.allIntersectionsAmongPrimitivesXY(primitives, tolerance);
234860
- const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__.PlanarSubdivision.assembleHalfEdgeGraph(primitives, intersections, tolerance);
234861
- return _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_12__.PlanarSubdivision.collectSignedLoopSetsInHalfEdgeGraph(graph, areaTol);
234906
+ const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_34__.CurveCurve.allIntersectionsAmongPrimitivesXY(primitives, tolerance);
234907
+ const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.assembleHalfEdgeGraph(primitives, intersections, tolerance);
234908
+ return _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.collectSignedLoopSetsInHalfEdgeGraph(graph, areaTol);
234862
234909
  }
234863
234910
  /**
234864
234911
  * Collect all `CurvePrimitives` in loosely typed input.
@@ -234873,10 +234920,10 @@ class RegionOps {
234873
234920
  */
234874
234921
  static collectCurvePrimitives(candidates, collectorArray, smallestPossiblePrimitives = false, explodeLinestrings = false) {
234875
234922
  const results = collectorArray === undefined ? [] : collectorArray;
234876
- if (candidates instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_24__.CurvePrimitive) {
234923
+ if (candidates instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive) {
234877
234924
  candidates.collectCurvePrimitives(results, smallestPossiblePrimitives, explodeLinestrings);
234878
234925
  }
234879
- else if (candidates instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_22__.CurveCollection) {
234926
+ else if (candidates instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection) {
234880
234927
  candidates.collectCurvePrimitives(results, smallestPossiblePrimitives, explodeLinestrings);
234881
234928
  }
234882
234929
  else if (Array.isArray(candidates)) {
@@ -234895,7 +234942,7 @@ class RegionOps {
234895
234942
  static expandLineStrings(candidates) {
234896
234943
  const result = [];
234897
234944
  for (const c of candidates) {
234898
- if (c instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d) {
234945
+ if (c instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
234899
234946
  for (let i = 0; i + 1 < c.packedPoints.length; i++) {
234900
234947
  const q = c.getIndexedSegment(i);
234901
234948
  if (q !== undefined)
@@ -234914,16 +234961,16 @@ class RegionOps {
234914
234961
  * @param worldToLocal transform to apply to data before computing its range
234915
234962
  */
234916
234963
  static curveArrayRange(data, worldToLocal) {
234917
- const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_32__.Range3d.create();
234918
- if (data instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_33__.GeometryQuery)
234964
+ const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_35__.Range3d.create();
234965
+ if (data instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_36__.GeometryQuery)
234919
234966
  data.extendRange(range, worldToLocal);
234920
234967
  else if (Array.isArray(data)) {
234921
234968
  for (const c of data) {
234922
- if (c instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_33__.GeometryQuery)
234969
+ if (c instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_36__.GeometryQuery)
234923
234970
  c.extendRange(range, worldToLocal);
234924
- else if (c instanceof _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__.Point3d)
234971
+ else if (c instanceof _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d)
234925
234972
  range.extendPoint(c, worldToLocal);
234926
- else if (c instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray)
234973
+ else if (c instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray)
234927
234974
  range.extendRange(c.getRange(worldToLocal));
234928
234975
  else if (Array.isArray(c))
234929
234976
  range.extendRange(this.curveArrayRange(c, worldToLocal));
@@ -234942,37 +234989,37 @@ class RegionOps {
234942
234989
  if (polygons.length === 0)
234943
234990
  return undefined;
234944
234991
  const firstEntry = polygons[0];
234945
- if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_8__.Point3d.isAnyImmediatePointType(firstEntry)) {
234946
- graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
234992
+ if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.isAnyImmediatePointType(firstEntry)) {
234993
+ graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
234947
234994
  }
234948
234995
  else if (polygons.length > 1) {
234949
234996
  let writablePolygons;
234950
- if (firstEntry instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedReadWriteXYZCollection) {
234997
+ if (firstEntry instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedReadWriteXYZCollection) {
234951
234998
  writablePolygons = polygons;
234952
234999
  }
234953
235000
  else {
234954
235001
  writablePolygons = [];
234955
235002
  for (const polygon of polygons)
234956
- writablePolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray.create(polygon));
235003
+ writablePolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(polygon));
234957
235004
  }
234958
- const sortedPolygons = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_34__.PolygonOps.sortOuterAndHoleLoopsXY(writablePolygons);
235005
+ const sortedPolygons = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_37__.PolygonOps.sortOuterAndHoleLoopsXY(writablePolygons);
234959
235006
  if (sortedPolygons.length === 1) { // below requires exactly one outer loop!
234960
- if (graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromLoops(sortedPolygons[0]))
234961
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.flipTriangles(graph);
235007
+ if (graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromLoops(sortedPolygons[0]))
235008
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
234962
235009
  }
234963
235010
  }
234964
235011
  else {
234965
- graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromSingleLoop(firstEntry);
235012
+ graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(firstEntry);
234966
235013
  }
234967
235014
  }
234968
235015
  else {
234969
- graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
235016
+ graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
234970
235017
  }
234971
235018
  if (!graph) {
234972
235019
  // Last resort: try full merge. Conveniently, multiple polygons are processed with parity logic.
234973
- if (graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionOpsFaceToFaceSearch.doPolygonBoolean(polygons, [], (inA, _inB) => inA)) {
234974
- if (_topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.triangulateAllPositiveAreaFaces(graph))
234975
- _topology_Triangulation__WEBPACK_IMPORTED_MODULE_7__.Triangulator.flipTriangles(graph);
235020
+ if (graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(polygons, [], (inA, _inB) => inA)) {
235021
+ if (_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.triangulateAllPositiveAreaFaces(graph))
235022
+ _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
234976
235023
  }
234977
235024
  }
234978
235025
  return graph;
@@ -234982,13 +235029,13 @@ class RegionOps {
234982
235029
  const strokedComponent = component.cloneStroked(options);
234983
235030
  // package the stroked region as polygons
234984
235031
  const polygons = [];
234985
- if (strokedComponent instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop) {
234986
- if (strokedComponent.children.length > 0 && strokedComponent.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d)
235032
+ if (strokedComponent instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop) {
235033
+ if (strokedComponent.children.length > 0 && strokedComponent.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d)
234987
235034
  polygons.push(strokedComponent.children[0].packedPoints); // expect only 1
234988
235035
  }
234989
- else if (strokedComponent instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_5__.ParityRegion) {
235036
+ else if (strokedComponent instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
234990
235037
  for (const strokedLoop of strokedComponent.children) {
234991
- if (strokedLoop.children.length > 0 && strokedLoop.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_16__.LineString3d)
235038
+ if (strokedLoop.children.length > 0 && strokedLoop.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d)
234992
235039
  polygons.push(strokedLoop.children[0].packedPoints); // expect only 1
234993
235040
  }
234994
235041
  }
@@ -235016,7 +235063,7 @@ class RegionOps {
235016
235063
  */
235017
235064
  static facetRegionXY(region, options) {
235018
235065
  let graph;
235019
- if (region instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_11__.UnionRegion) {
235066
+ if (region instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion) {
235020
235067
  for (const child of region.children) {
235021
235068
  const childGraph = RegionOps.triangulateRegionComponent(child, options);
235022
235069
  if (childGraph) {
@@ -235038,8 +235085,8 @@ class RegionOps {
235038
235085
  if (!graph)
235039
235086
  return undefined;
235040
235087
  if (options?.maximizeConvexFacets)
235041
- _topology_Merging__WEBPACK_IMPORTED_MODULE_35__.HalfEdgeGraphOps.expandConvexFaces(graph);
235042
- return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_9__.PolyfaceBuilder.graphToPolyface(graph, options);
235088
+ _topology_Merging__WEBPACK_IMPORTED_MODULE_38__.HalfEdgeGraphOps.expandConvexFaces(graph);
235089
+ return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__.PolyfaceBuilder.graphToPolyface(graph, options);
235043
235090
  }
235044
235091
  /**
235045
235092
  * Decompose a polygon with optional holes into an array of convex polygons.
@@ -235052,11 +235099,11 @@ class RegionOps {
235052
235099
  if (!graph)
235053
235100
  return undefined;
235054
235101
  if (maximize)
235055
- _topology_Merging__WEBPACK_IMPORTED_MODULE_35__.HalfEdgeGraphOps.expandConvexFaces(graph);
235102
+ _topology_Merging__WEBPACK_IMPORTED_MODULE_38__.HalfEdgeGraphOps.expandConvexFaces(graph);
235056
235103
  const convexPolygons = [];
235057
235104
  graph.announceFaceLoops((_graph, seed) => {
235058
- if (!seed.isMaskSet(_topology_Graph__WEBPACK_IMPORTED_MODULE_14__.HalfEdgeMask.EXTERIOR))
235059
- convexPolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_15__.GrowableXYZArray.create(seed.collectAroundFace((node) => { return node.getPoint3d(); })));
235105
+ if (!seed.isMaskSet(_topology_Graph__WEBPACK_IMPORTED_MODULE_16__.HalfEdgeMask.EXTERIOR))
235106
+ convexPolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(seed.collectAroundFace((node) => { return node.getPoint3d(); })));
235060
235107
  return true;
235061
235108
  });
235062
235109
  return convexPolygons;
@@ -235108,24 +235155,25 @@ __webpack_require__.r(__webpack_exports__);
235108
235155
  /* harmony export */ RegionOpsFaceToFaceSearch: () => (/* binding */ RegionOpsFaceToFaceSearch)
235109
235156
  /* harmony export */ });
235110
235157
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
235111
- /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
235158
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
235112
235159
  /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
235113
- /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
235160
+ /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
235114
235161
  /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
235115
235162
  /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
235116
235163
  /* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
235117
235164
  /* harmony import */ var _topology_RegularizeFace__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../topology/RegularizeFace */ "../../core/geometry/lib/esm/topology/RegularizeFace.js");
235118
- /* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
235119
- /* harmony import */ var _CurveCurve__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./CurveCurve */ "../../core/geometry/lib/esm/curve/CurveCurve.js");
235120
- /* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
235165
+ /* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
235166
+ /* harmony import */ var _CurveCurve__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./CurveCurve */ "../../core/geometry/lib/esm/curve/CurveCurve.js");
235167
+ /* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
235121
235168
  /* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
235122
- /* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
235123
- /* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
235169
+ /* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
235170
+ /* harmony import */ var _internalContexts_TransferWithSplitArcs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./internalContexts/TransferWithSplitArcs */ "../../core/geometry/lib/esm/curve/internalContexts/TransferWithSplitArcs.js");
235171
+ /* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
235124
235172
  /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
235125
235173
  /* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
235126
- /* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
235174
+ /* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
235127
235175
  /* harmony import */ var _RegionOps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
235128
- /* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
235176
+ /* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
235129
235177
  /*---------------------------------------------------------------------------------------------
235130
235178
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
235131
235179
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -235152,6 +235200,7 @@ __webpack_require__.r(__webpack_exports__);
235152
235200
 
235153
235201
 
235154
235202
 
235203
+
235155
235204
  /**
235156
235205
  * base class for callbacks during region sweeps.
235157
235206
  * * At start of a component, `startComponent(node)` is called announcing a representative node on the outermost face.
@@ -235468,8 +235517,7 @@ class RegionGroup {
235468
235517
  }
235469
235518
  return range;
235470
235519
  }
235471
- /** Ask if the current _numIn count qualifies as an "in" for this operation type.
235472
- */
235520
+ /** Ask if the current _numIn count qualifies as an "in" for this operation type. */
235473
235521
  getInOut() {
235474
235522
  // UNION is true if one or more members are IN
235475
235523
  if (this.groupOpType === RegionGroupOpType.Union)
@@ -235485,11 +235533,12 @@ class RegionGroup {
235485
235533
  // push new members into the group.
235486
235534
  addMember(data, allowLineSegment = false) {
235487
235535
  if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_8__.Loop || data instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_9__.ParityRegion) {
235488
- const cleanerData = data.clone();
235536
+ let cleanerData = data.clone();
235489
235537
  _RegionOps__WEBPACK_IMPORTED_MODULE_1__.RegionOps.consolidateAdjacentPrimitives(cleanerData);
235538
+ cleanerData = _internalContexts_TransferWithSplitArcs__WEBPACK_IMPORTED_MODULE_10__.TransferWithSplitArcs.clone(cleanerData);
235490
235539
  this.members.push(new RegionGroupMember(cleanerData, this));
235491
235540
  }
235492
- else if (data instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_10__.UnionRegion) {
235541
+ else if (data instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_11__.UnionRegion) {
235493
235542
  for (const child of data.children) {
235494
235543
  this.addMember(child);
235495
235544
  }
@@ -235499,7 +235548,7 @@ class RegionGroup {
235499
235548
  this.addMember(item);
235500
235549
  }
235501
235550
  }
235502
- else if (allowLineSegment && data instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d) {
235551
+ else if (allowLineSegment && data instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d) {
235503
235552
  this.members.push(new RegionGroupMember(data, this));
235504
235553
  }
235505
235554
  }
@@ -235516,22 +235565,22 @@ class RegionGroup {
235516
235565
  /**
235517
235566
  * A `RegionBooleanContext` carries structure and operations for binary operations between two sets of regions.
235518
235567
  * * In the binary operation OP (union, intersection, parity, difference), the left and right operands
235519
- * are each a composite union, difference, or parity among multiple inputs, i.e.
235568
+ * are each a composite union, difference, or parity among multiple inputs, i.e.,
235520
235569
  * * (operationA among Ai) OP (operationB among Bi)
235521
235570
  * * where the Ai are one set of regions, being combined by operationA
235522
- * * and the Bi are the another set of regions, being combined by operationB
235523
- * * Each group of Ai and Bi is a `RegionGroup`
235571
+ * * and the Bi are the another set of regions, being combined by operationB.
235572
+ * * Each group of Ai and Bi is a `RegionGroup`.
235524
235573
  * * This is an extremely delicate structure.
235525
235574
  * * Members are public because of the unique variety of queries, but should only be used for queries.
235526
235575
  * * The graph and curves in the booleans are connected by an extended pointer chain:
235527
- * * (HalfEdge in Graph).edgeTag points to a CurveLocationDetail
235528
- * * (CurveLocationDetail).curve points to a curve
235529
- * * (Curve).parent points to RegionGroupMember
235530
- * * (RegionGroupMember) points to RegionGroup
235531
- * * (RegionGroup) points to RegionBooleanBinaryContext
235532
- * * So..when a graph sweep crosses an edge,
235533
- * * the chain leads to a parity count in the RegionGroupMember
235534
- * * that can change the number of members active in the RegionGroup
235576
+ * * (HalfEdge in Graph).edgeTag points to a CurveLocationDetail.
235577
+ * * (CurveLocationDetail).curve points to a curve.
235578
+ * * (Curve).parent points to RegionGroupMember.
235579
+ * * (RegionGroupMember) points to RegionGroup.
235580
+ * * (RegionGroup) points to RegionBooleanBinaryContext.
235581
+ * * So when a graph sweep crosses an edge
235582
+ * * the chain leads to a parity count in the RegionGroupMember.
235583
+ * * that can change the number of members active in the RegionGroup.
235535
235584
  * * which can change the state of the context.
235536
235585
  * @internal
235537
235586
  */
@@ -235546,7 +235595,7 @@ class RegionBooleanContext {
235546
235595
  this.groupA = new RegionGroup(this, groupTypeA);
235547
235596
  this.groupB = new RegionGroup(this, groupTypeB);
235548
235597
  this.extraGeometry = new RegionGroup(this, RegionGroupOpType.NonBounding);
235549
- this.binaryOp = _RegionOps__WEBPACK_IMPORTED_MODULE_1__.RegionBinaryOpType.Union; // it will be revised on can calls.
235598
+ this.binaryOp = _RegionOps__WEBPACK_IMPORTED_MODULE_1__.RegionBinaryOpType.Union; // revised in runClassificationSweep
235550
235599
  }
235551
235600
  /**
235552
235601
  * Create a context with both A and B groups empty.
@@ -235565,7 +235614,7 @@ class RegionBooleanContext {
235565
235614
  this.addConnectives();
235566
235615
  }
235567
235616
  _workSegment;
235568
- static _bridgeDirection = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_12__.Vector3d.createNormalized(1.0, -0.12328974132467); // magic unit direction to minimize vertex hits
235617
+ static _bridgeDirection = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_13__.Vector3d.createNormalized(1.0, -0.12328974132467); // magic unit direction to minimize vertex hits
235569
235618
  /**
235570
235619
  * The sweep operations require access to all geometry by edge crossings and face walk.
235571
235620
  * If input loops are non-overlapping, there may be disconnected islands not reachable.
@@ -235580,7 +235629,7 @@ class RegionBooleanContext {
235580
235629
  const rangeAB = rangeA.union(rangeB);
235581
235630
  const areaTol = _RegionOps__WEBPACK_IMPORTED_MODULE_1__.RegionOps.computeXYAreaTolerance(rangeAB);
235582
235631
  let margin = 0.1;
235583
- this._workSegment = _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_13__.PlaneAltitudeRangeContext.findExtremePointsInDirection(rangeAB.corners(), RegionBooleanContext._bridgeDirection, this._workSegment);
235632
+ this._workSegment = _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_14__.PlaneAltitudeRangeContext.findExtremePointsInDirection(rangeAB.corners(), RegionBooleanContext._bridgeDirection, this._workSegment);
235584
235633
  if (this._workSegment)
235585
235634
  margin *= this._workSegment.point0Ref.distanceXY(this._workSegment.point1Ref); // how much further to extend each bridge ray
235586
235635
  const maxPoints = [];
@@ -235588,7 +235637,7 @@ class RegionBooleanContext {
235588
235637
  const area = _RegionOps__WEBPACK_IMPORTED_MODULE_1__.RegionOps.computeXYArea(region);
235589
235638
  if (area === undefined || Math.abs(area) < areaTol)
235590
235639
  return; // avoid bridging trivial faces
235591
- this._workSegment = _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_13__.PlaneAltitudeRangeContext.findExtremePointsInDirection(region, RegionBooleanContext._bridgeDirection, this._workSegment);
235640
+ this._workSegment = _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_14__.PlaneAltitudeRangeContext.findExtremePointsInDirection(region, RegionBooleanContext._bridgeDirection, this._workSegment);
235592
235641
  if (this._workSegment)
235593
235642
  maxPoints.push(this._workSegment.point1Ref);
235594
235643
  };
@@ -235603,17 +235652,17 @@ class RegionBooleanContext {
235603
235652
  }
235604
235653
  }
235605
235654
  }
235606
- const ray = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_14__.Ray3d.createZero();
235655
+ const ray = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_15__.Ray3d.createZero();
235607
235656
  for (const p of maxPoints) {
235608
- // Make a line from...
235609
- // 1) exactly the max point of the loops to
235610
- // 2) a point clearly outside the big range
235611
- // If p came from some inner loop this will...
235612
- // 1) create a bridge from the inner loop through any containing loops (always)
235613
- // 2) avoid crossing any containing loop at a vertex. (with high probability, but not absolutely always)
235614
- const bridgeLength = margin + _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_14__.Ray3d.create(p, RegionBooleanContext._bridgeDirection, ray).intersectionWithRange3d(rangeAB).high;
235615
- const outside = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_12__.Point3d.createAdd2Scaled(p, 1.0, RegionBooleanContext._bridgeDirection, bridgeLength);
235616
- const bridgeLine = _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.createXYXY(p.x, p.y, outside.x, outside.y);
235657
+ // Make a line from
235658
+ // 1) exactly the max point of the loops to
235659
+ // 2) a point clearly outside the big range
235660
+ // If p came from some inner loop this will
235661
+ // 1) create a bridge from the inner loop through any containing loops (always)
235662
+ // 2) avoid crossing any containing loop at a vertex. (with high probability, but not absolutely always)
235663
+ const bridgeLength = margin + _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_15__.Ray3d.create(p, RegionBooleanContext._bridgeDirection, ray).intersectionWithRange3d(rangeAB).high;
235664
+ const outside = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_13__.Point3d.createAdd2Scaled(p, 1.0, RegionBooleanContext._bridgeDirection, bridgeLength);
235665
+ const bridgeLine = _LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.createXYXY(p.x, p.y, outside.x, outside.y);
235617
235666
  this.extraGeometry.addMember(bridgeLine, true);
235618
235667
  }
235619
235668
  }
@@ -235627,7 +235676,7 @@ class RegionBooleanContext {
235627
235676
  */
235628
235677
  annotateAndMergeCurvesInGraph(mergeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_7__.Geometry.smallMetricDistance) {
235629
235678
  const allPrimitives = [];
235630
- // ASSUME loops have fine-grained types -- no linestrings !!
235679
+ // ASSUME loops have fine-grained types (no linestrings)
235631
235680
  for (const group of [this.groupA, this.groupB, this.extraGeometry]) {
235632
235681
  for (const member of group.members) {
235633
235682
  let k = allPrimitives.length;
@@ -235638,9 +235687,8 @@ class RegionBooleanContext {
235638
235687
  }
235639
235688
  }
235640
235689
  }
235641
- // const range = RegionOps.curveArrayRange(allPrimitives);
235642
- const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_15__.CurveCurve.allIntersectionsAmongPrimitivesXY(allPrimitives, mergeTolerance);
235643
- const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_16__.PlanarSubdivision.assembleHalfEdgeGraph(allPrimitives, intersections, mergeTolerance);
235690
+ const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_16__.CurveCurve.allIntersectionsAmongPrimitivesXY(allPrimitives, mergeTolerance);
235691
+ const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_17__.PlanarSubdivision.assembleHalfEdgeGraph(allPrimitives, intersections, mergeTolerance);
235644
235692
  this.graph = graph;
235645
235693
  this.faceAreaFunction = faceAreaFromCurvedEdgeData;
235646
235694
  }
@@ -235731,7 +235779,7 @@ class RegionBooleanContext {
235731
235779
  const data = node.edgeTag;
235732
235780
  if (data instanceof RegionGroupMember)
235733
235781
  return updateRegionGroupMemberState(data);
235734
- if (data instanceof _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_17__.CurveLocationDetail) {
235782
+ if (data instanceof _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_18__.CurveLocationDetail) {
235735
235783
  // We trust that the caller has linked from the graph node to a curve which has a RegionGroupMember as its parent.
235736
235784
  const member = data.curve.parent;
235737
235785
  if (member instanceof RegionGroupMember)
@@ -235786,10 +235834,10 @@ function areaUnderPartialCurveXY(detail, xyStart, xyEnd, referencePoint) {
235786
235834
  }
235787
235835
  let areaToChord = 0.0;
235788
235836
  if (detail && detail.curve && detail.hasFraction1) {
235789
- if (detail.curve instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d) {
235837
+ if (detail.curve instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d) {
235790
235838
  // ah .. nothing to do for a line segment
235791
235839
  }
235792
- else if (detail.curve instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_18__.Arc3d) {
235840
+ else if (detail.curve instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_19__.Arc3d) {
235793
235841
  areaToChord = detail.curve.areaToChordXY(detail.fraction, detail.fraction1);
235794
235842
  }
235795
235843
  }
@@ -238331,6 +238379,8 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
238331
238379
  // The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
238332
238380
  // The fraction and extend parameters allow all combinations to be passed in.
238333
238381
  dispatchSegmentArc(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, arc, extendB0, extendB1, reversed) {
238382
+ const tol2 = this._coincidentGeometryContext.tolerance * this._coincidentGeometryContext.tolerance;
238383
+ let dist2;
238334
238384
  // Arc: X = C + cU + sV
238335
238385
  // Line: contains points A0,A1
238336
238386
  // Arc point colinear with line if det (A0, A1, X) = 0
@@ -238341,6 +238391,10 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
238341
238391
  // project back to line.
238342
238392
  if (this._worldToLocalPerspective) {
238343
238393
  const data = arc.toTransformedPoint4d(this._worldToLocalPerspective);
238394
+ const radians0 = data.sweep.fractionToRadians(0);
238395
+ const pointB0H = data.center.plus2Scaled(data.vector0, Math.cos(radians0), data.vector90, Math.sin(radians0));
238396
+ const radians1 = data.sweep.fractionToRadians(1);
238397
+ const pointB1H = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
238344
238398
  const pointA0H = this._worldToLocalPerspective.multiplyPoint3d(pointA0, 1);
238345
238399
  const pointA1H = this._worldToLocalPerspective.multiplyPoint3d(pointA1, 1);
238346
238400
  const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.center);
@@ -238350,19 +238404,31 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
238350
238404
  const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_9__.GrowableFloat64Array(2);
238351
238405
  const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_9__.GrowableFloat64Array(2);
238352
238406
  const numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_10__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
238407
+ if (numRoots <= 0)
238408
+ return;
238353
238409
  for (let i = 0; i < numRoots; i++) {
238354
238410
  const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
238355
- const arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
238411
+ let arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
238356
238412
  const lineFraction = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegment3dHXYClosestPointUnbounded(pointA0H, pointA1H, arcPoint);
238357
- if (lineFraction !== undefined &&
238358
- this.acceptFraction(extendA0, lineFraction, extendA1) &&
238359
- this.acceptFraction(extendB0, arcFraction, extendB1)) {
238360
- this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
238413
+ if (lineFraction !== undefined) {
238414
+ if (this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB0, arcFraction, extendB1)) {
238415
+ this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
238416
+ }
238417
+ else { // check for endpoint intersections beyond parametric tolerance but within point tolerance
238418
+ const pointAH = lineFraction < 0.5 ? pointA0H : pointA1H;
238419
+ const pointBH = (arcFraction = data.sweep.fractionToSignedPeriodicFraction(arcFraction)) < 0.5 ? pointB0H : pointB1H;
238420
+ if ((dist2 = pointAH.realDistanceSquaredXY(pointBH)) !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isDistanceWithinTol(dist2, tol2))
238421
+ this.recordPointWithLocalFractions(lineFraction < 0.5 ? 0 : 1, cpA, fractionA0, fractionA1, arcFraction < 0.5 ? 0 : 1, arc, 0, 1, reversed);
238422
+ }
238361
238423
  }
238362
238424
  }
238363
238425
  }
238364
238426
  else {
238365
238427
  const data = arc.toTransformedVectors(this._worldToLocalAffine);
238428
+ const radians0 = data.sweep.fractionToRadians(0);
238429
+ const pointB0Local = data.center.plus2Scaled(data.vector0, Math.cos(radians0), data.vector90, Math.sin(radians0));
238430
+ const radians1 = data.sweep.fractionToRadians(1);
238431
+ const pointB1Local = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
238366
238432
  let pointA0Local = pointA0;
238367
238433
  let pointA1Local = pointA1;
238368
238434
  if (this._worldToLocalAffine) {
@@ -238376,16 +238442,22 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
238376
238442
  const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_9__.GrowableFloat64Array(2);
238377
238443
  const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_9__.GrowableFloat64Array(2);
238378
238444
  const numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_10__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
238379
- const lineFractionTol = 1.0e-10; // TODO: why are we loosening tolerances here?
238380
- const arcFractionTol = 1.0e-7;
238445
+ if (numRoots <= 0)
238446
+ return;
238381
238447
  for (let i = 0; i < numRoots; i++) {
238382
238448
  const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
238383
- const arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
238449
+ let arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
238384
238450
  const lineFraction = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
238385
- if (lineFraction !== undefined &&
238386
- this.acceptFraction(extendA0, lineFraction, extendA1, lineFractionTol) &&
238387
- this.acceptFraction(extendB0, arcFraction, extendB1, arcFractionTol)) {
238388
- this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
238451
+ if (lineFraction !== undefined) {
238452
+ if (this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB0, arcFraction, extendB1)) {
238453
+ this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
238454
+ }
238455
+ else { // check for endpoint intersections beyond parametric tolerance but within point tolerance
238456
+ const pointALocal = lineFraction < 0.5 ? pointA0Local : pointA1Local;
238457
+ const pointBLocal = (arcFraction = data.sweep.fractionToSignedPeriodicFraction(arcFraction)) < 0.5 ? pointB0Local : pointB1Local;
238458
+ if ((dist2 = pointALocal.distanceSquaredXY(pointBLocal)) !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isDistanceWithinTol(dist2, tol2))
238459
+ this.recordPointWithLocalFractions(lineFraction < 0.5 ? 0 : 1, cpA, fractionA0, fractionA1, arcFraction < 0.5 ? 0 : 1, arc, 0, 1, reversed);
238460
+ }
238389
238461
  }
238390
238462
  }
238391
238463
  }
@@ -242458,6 +242530,52 @@ class SumLengthsContext extends _CurveProcessor__WEBPACK_IMPORTED_MODULE_0__.Rec
242458
242530
  }
242459
242531
 
242460
242532
 
242533
+ /***/ }),
242534
+
242535
+ /***/ "../../core/geometry/lib/esm/curve/internalContexts/TransferWithSplitArcs.js":
242536
+ /*!***********************************************************************************!*\
242537
+ !*** ../../core/geometry/lib/esm/curve/internalContexts/TransferWithSplitArcs.js ***!
242538
+ \***********************************************************************************/
242539
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
242540
+
242541
+ "use strict";
242542
+ __webpack_require__.r(__webpack_exports__);
242543
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
242544
+ /* harmony export */ TransferWithSplitArcs: () => (/* binding */ TransferWithSplitArcs)
242545
+ /* harmony export */ });
242546
+ /* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
242547
+ /* harmony import */ var _CloneCurvesContext__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CloneCurvesContext */ "../../core/geometry/lib/esm/curve/internalContexts/CloneCurvesContext.js");
242548
+ /*---------------------------------------------------------------------------------------------
242549
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
242550
+ * See LICENSE.md in the project root for license terms and full copyright notice.
242551
+ *--------------------------------------------------------------------------------------------*/
242552
+ /** @packageDocumentation
242553
+ * @module Curve
242554
+ */
242555
+
242556
+
242557
+ /**
242558
+ * Algorithmic class for shallow-copying a CurveCollection with each full-sweep arc replaced by two half-sweep arcs.
242559
+ * * Often useful for building graphs from loops.
242560
+ * @internal
242561
+ */
242562
+ class TransferWithSplitArcs extends _CloneCurvesContext__WEBPACK_IMPORTED_MODULE_0__.CloneCurvesContext {
242563
+ constructor() {
242564
+ super(undefined);
242565
+ }
242566
+ doClone(primitive) {
242567
+ if (primitive instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_1__.Arc3d && primitive.sweep.isFullCircle) // replace full arc with two half arcs
242568
+ return [primitive.clonePartialCurve(0.0, 0.5), primitive.clonePartialCurve(0.5, 1)];
242569
+ return primitive;
242570
+ }
242571
+ static clone(target) {
242572
+ const context = new TransferWithSplitArcs();
242573
+ target.announceToCurveProcessor(context);
242574
+ return context._result;
242575
+ }
242576
+ }
242577
+
242578
+
242461
242579
  /***/ }),
242462
242580
 
242463
242581
  /***/ "../../core/geometry/lib/esm/curve/internalContexts/TransformInPlaceContext.js":
@@ -245955,8 +246073,10 @@ class AngleSweep {
245955
246073
  * @param fraction fraction of the sweep.
245956
246074
  * @param radians0 start angle of sweep (in radians).
245957
246075
  * @param radians1 end angle of sweep (in radians).
245958
- * @param toNegativeFraction return an exterior fraction period-shifted to within one period of the start (true) or
245959
- * end (false) of the sweep.
246076
+ * @param toNegativeFraction exterior fraction handling:
246077
+ * * if true, return `fraction` period-shifted to within one period of the start
246078
+ * * if false, return `fraction` period-shifted to within one period of the end
246079
+ * * if undefined, return the period-shift of `fraction` closest to [0,1].
245960
246080
  * @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is
245961
246081
  * returned unchanged.
245962
246082
  */
@@ -245970,16 +246090,25 @@ class AngleSweep {
245970
246090
  fraction = fraction % period; // period-shifted equivalent fraction closest to 0 with same sign as fraction
245971
246091
  if (fraction + period < 1)
245972
246092
  fraction += period; // it's really an interior fraction
245973
- if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isIn01(fraction) || (toNegativeFraction && fraction < 0) || (!toNegativeFraction && fraction > 1))
246093
+ if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isIn01(fraction))
245974
246094
  return fraction;
245975
- return toNegativeFraction ? fraction - period : fraction + period; // shift to other side of sweep
246095
+ if (toNegativeFraction === true)
246096
+ return fraction < 0 ? fraction : fraction - period;
246097
+ if (toNegativeFraction === false)
246098
+ return fraction > 1 ? fraction : fraction + period;
246099
+ const fractionDistFrom01 = fraction < 0 ? -fraction : fraction - 1;
246100
+ const fraction2 = fraction < 0 ? fraction + period : fraction - period; // period-shift with opposite sign
246101
+ const fraction2DistFrom01 = fraction2 < 0 ? -fraction2 : fraction2 - 1;
246102
+ return fractionDistFrom01 < fraction2DistFrom01 ? fraction : fraction2; // choose the period-shift closer to [0,1]
245976
246103
  }
245977
246104
  /**
245978
246105
  * Convert a sweep fraction to the equivalent period-shifted fraction inside this sweep, or within one period of
245979
246106
  * zero on the desired side.
245980
246107
  * @param fraction fraction of the sweep.
245981
- * @param toNegativeFraction return an exterior fraction period-shifted to within one period of the start (true) or
245982
- * end (false) of the sweep.
246108
+ * @param toNegativeFraction exterior fraction handling:
246109
+ * * if true, return `fraction` period-shifted to within one period of the start
246110
+ * * if false, return `fraction` period-shifted to within one period of the end
246111
+ * * if undefined, return the period-shift of `fraction` closest to [0,1].
245983
246112
  * @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is
245984
246113
  * returned unchanged.
245985
246114
  */
@@ -258868,9 +258997,9 @@ class Vector3d extends XYZ {
258868
258997
  if (dot < 0.0 && !oppositeIsParallel)
258869
258998
  return false;
258870
258999
  const cross2 = this.crossProductMagnitudeSquared(other);
258871
- /* a2,b2,cross2 are squared lengths of respective vectors */
258872
- /* cross2 = sin^2(theta) * a2 * b2 */
258873
- /* For small theta, sin^2(theta)~~theta^2 */
259000
+ // a2,b2,cross2 are squared lengths of respective vectors
259001
+ // cross2 = sin^2(theta) * a2 * b2
259002
+ // For small theta, sin^2(theta) ~ theta^2
258874
259003
  return cross2 <= radianSquaredTol * a2 * b2;
258875
259004
  }
258876
259005
  /**
@@ -260865,26 +260994,28 @@ class PolygonOps {
260865
260994
  return s;
260866
260995
  }
260867
260996
  /**
260868
- * Return a Ray3d with (assuming the polygon is planar and not self-intersecting):
260869
- * * `origin` at the centroid of the (3D) polygon,
260870
- * * `direction` is the unit vector perpendicular to the plane,
260871
- * * `a` is the area.
260872
- * @param points
260997
+ * Return a [[Ray3d]] with:
260998
+ * * `origin` is the centroid of the polygon,
260999
+ * * `direction` is a unit vector perpendicular to the polygon plane,
261000
+ * * `a` is the polygon area.
261001
+ * @param points the polygon vertices in order. Points can lie in any plane. First and last point do not have to be equal.
261002
+ * @param result optional pre-allocated result to populate and return.
260873
261003
  */
260874
- static centroidAreaNormal(points) {
261004
+ static centroidAreaNormal(points, result) {
260875
261005
  if (Array.isArray(points)) {
260876
261006
  const carrier = new _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_5__.Point3dArrayCarrier(points);
260877
- return this.centroidAreaNormal(carrier);
261007
+ return this.centroidAreaNormal(carrier, result);
260878
261008
  }
260879
261009
  const n = points.length;
260880
261010
  if (n === 3) {
260881
- const normal = points.crossProductIndexIndexIndex(0, 1, 2);
261011
+ const normal = points.crossProductIndexIndexIndex(0, 1, 2, result?.direction);
260882
261012
  const a = 0.5 * normal.magnitude();
260883
- const centroid = points.getPoint3dAtCheckedPointIndex(0);
261013
+ const centroid = points.getPoint3dAtCheckedPointIndex(0, result?.origin);
260884
261014
  points.accumulateScaledXYZ(1, 1.0, centroid);
260885
261015
  points.accumulateScaledXYZ(2, 1.0, centroid);
260886
261016
  centroid.scaleInPlace(1.0 / 3.0);
260887
- const result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
261017
+ if (!result)
261018
+ result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
260888
261019
  if (result.tryNormalizeInPlaceWithAreaWeight(a))
260889
261020
  return result;
260890
261021
  return undefined;
@@ -260902,22 +261033,24 @@ class PolygonOps {
260902
261033
  points.vectorXYAndZIndex(origin, 1, vector0);
260903
261034
  let cross = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
260904
261035
  const centroidSum = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
260905
- const normalSum = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
261036
+ const normal = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero(result?.direction);
260906
261037
  let signedTriangleArea;
260907
- // This will work with or without closure edge. If closure is given, the last vector is 000.
261038
+ // This will work with or without closure edge. If closure is given, the last vector is 000.
260908
261039
  for (let i = 2; i < n; i++) {
260909
261040
  points.vectorXYAndZIndex(origin, i, vector1);
260910
261041
  cross = vector0.crossProduct(vector1, cross);
260911
261042
  signedTriangleArea = areaNormal.dotProduct(cross); // well, actually twice the area.
260912
- normalSum.addInPlace(cross); // this grows to twice the area
261043
+ normal.addInPlace(cross); // this grows to twice the area
260913
261044
  const b = signedTriangleArea / 6.0;
260914
261045
  centroidSum.plus2Scaled(vector0, b, vector1, b, centroidSum);
260915
261046
  vector0.setFrom(vector1);
260916
261047
  }
260917
- const area = 0.5 * normalSum.magnitude();
261048
+ const area = 0.5 * normal.magnitude();
260918
261049
  const inverseArea = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.conditionalDivideFraction(1, area);
260919
261050
  if (inverseArea !== undefined) {
260920
- const result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(origin.plusScaled(centroidSum, inverseArea), normalSum);
261051
+ const centroid = origin.plusScaled(centroidSum, inverseArea, result?.origin);
261052
+ if (!result)
261053
+ result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
260921
261054
  result.tryNormalizeInPlaceWithAreaWeight(area);
260922
261055
  return result;
260923
261056
  }
@@ -267942,19 +268075,19 @@ class Matrix4d {
267942
268075
  this._coffs[15] += scale * beta;
267943
268076
  }
267944
268077
  /**
267945
- * Multiply and replace contents of this matrix by A*this*AT where
267946
- * * A is a pure translation with final column [x,y,z,1]
267947
- * * this is this matrix.
267948
- * * AT is the transpose of A.
267949
- * @param ax x part of translation
267950
- * @param ay y part of translation
267951
- * @param az z part of translation
268078
+ * Multiply and replace contents of ` this` matrix by `A*this*AT` where
268079
+ * * `A` is a pure translation with final column [x,y,z,1].
268080
+ * * `this` is this matrix.
268081
+ * * `AT` is the transpose of A.
268082
+ * @param ax x part of translation.
268083
+ * @param ay y part of translation.
268084
+ * @param az z part of translation.
267952
268085
  */
267953
268086
  multiplyTranslationSandwichInPlace(ax, ay, az) {
267954
268087
  const bx = this._coffs[3];
267955
268088
  const by = this._coffs[7];
267956
268089
  const bz = this._coffs[11];
267957
- // matrixB can be non-symmetric!!
268090
+ // matrixB can be non-symmetric
267958
268091
  const cx = this._coffs[12];
267959
268092
  const cy = this._coffs[13];
267960
268093
  const cz = this._coffs[14];
@@ -267977,7 +268110,7 @@ class Matrix4d {
267977
268110
  this._coffs[12] += axBeta;
267978
268111
  this._coffs[13] += ayBeta;
267979
268112
  this._coffs[14] += azBeta;
267980
- // coffs[15] is unchanged !!!
268113
+ // coffs[15] is unchanged
267981
268114
  }
267982
268115
  }
267983
268116
 
@@ -268028,8 +268161,8 @@ __webpack_require__.r(__webpack_exports__);
268028
268161
  * * e.g. entry 03 is summed x.
268029
268162
  * * In this level:
268030
268163
  * * the `absoluteQuantity` member is undefined.
268031
- * * the `localToWorldMap` and `radiiOfGyration` are created by have undefined contents.
268032
- * * Second level: after a call to inertiaProductsToPrincipalAxes, the `localToWorldMap`, `absoluteQuantity` and
268164
+ * * the `localToWorldMap` and `radiiOfGyration` are created but have undefined contents.
268165
+ * * Second level: after a call to `inertiaProductsToPrincipalAxes`, the `localToWorldMap`, `absoluteQuantity` and
268033
268166
  * `radiiOfGyration` are filled in.
268034
268167
  * @public
268035
268168
  */
@@ -268049,18 +268182,35 @@ class MomentData {
268049
268182
  * * This set up with its inverse already constructed.
268050
268183
  */
268051
268184
  localToWorldMap;
268185
+ /** Radii of gyration (square roots of principal second moments). */
268186
+ radiusOfGyration;
268187
+ /**
268188
+ * Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
268189
+ * inertiaProductsToPrincipalAxes.
268190
+ */
268191
+ absoluteQuantity;
268052
268192
  // private variables
268053
268193
  static _vectorA;
268054
268194
  static _vectorB;
268055
268195
  static _vectorC;
268056
268196
  _point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
268057
268197
  _point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
268198
+ /** Constructor. */
268199
+ constructor() {
268200
+ this.origin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
268201
+ this.needOrigin = false;
268202
+ this.sums = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createZero();
268203
+ this.localToWorldMap = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity();
268204
+ this.radiusOfGyration = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
268205
+ this.absoluteQuantity = 0.1; // so optimizer sees its type
268206
+ this.absoluteQuantity = undefined;
268207
+ }
268058
268208
  /**
268059
268209
  * Return the lower-right (3,3) entry in the sums.
268060
268210
  * * This is the quantity (i.e. length, area, or volume) summed.
268061
268211
  */
268062
268212
  get quantitySum() {
268063
- return this.sums.atIJ(3, 3);
268213
+ return this.sums.weight();
268064
268214
  }
268065
268215
  /**
268066
268216
  * Return a scale factor to make these sums match the target orientation sign.
@@ -268091,23 +268241,6 @@ class MomentData {
268091
268241
  this.needOrigin = false;
268092
268242
  }
268093
268243
  }
268094
- /** Radii of gyration (square roots of principal second moments). */
268095
- radiusOfGyration;
268096
- /**
268097
- * Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
268098
- * inertiaProductsToPrincipalAxes.
268099
- */
268100
- absoluteQuantity;
268101
- /** Constructor. */
268102
- constructor() {
268103
- this.origin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
268104
- this.sums = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createZero();
268105
- this.localToWorldMap = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity();
268106
- this.radiusOfGyration = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
268107
- this.needOrigin = false;
268108
- this.absoluteQuantity = 0.1; // so optimizer sees its type
268109
- this.absoluteQuantity = undefined;
268110
- }
268111
268244
  /**
268112
268245
  * Create moments with optional origin.
268113
268246
  * * Origin and needOrigin are quirky.
@@ -268151,7 +268284,7 @@ class MomentData {
268151
268284
  axes.setColumnsPoint4dXYZ(points[0], points[1], points[2]);
268152
268285
  if (axes.determinant() < 0)
268153
268286
  axes.scaleColumnsInPlace(-1.0, -1.0, -1.0);
268154
- // prefer x and z positive -- y falls wherever . ..
268287
+ // prefer x and z positive; y falls wherever
268155
268288
  if (axes.at(0, 0) < 0.0)
268156
268289
  axes.scaleColumnsInPlace(-1.0, -1.0, 1.0);
268157
268290
  if (axes.at(2, 2) < 0.0)
@@ -268176,7 +268309,8 @@ class MomentData {
268176
268309
  * * Hence x axis is long direction.
268177
268310
  * * Hence planar data generates large moment as Z.
268178
268311
  * @param origin The origin used for the inertia products.
268179
- * @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].
268312
+ * @param inertiaProducts The inertia products: sums or integrals of
268313
+ * [xx,xy,xz,xw; yx,yy,yz,yw; zx,zy,zz,zw; wx,wy,wz,w].
268180
268314
  */
268181
268315
  static inertiaProductsToPrincipalAxes(origin, inertiaProducts) {
268182
268316
  const moments = new MomentData();
@@ -268220,23 +268354,21 @@ class MomentData {
268220
268354
  */
268221
268355
  static areEquivalentPrincipalAxes(dataA, dataB) {
268222
268356
  if (dataA && dataB
268223
- && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { // um.. need different tolerance for area, volume?)
268357
+ && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { // TODO: need different tolerance for area, volume?
268224
268358
  if (dataA.localToWorldMap.getOrigin().isAlmostEqual(dataB.localToWorldMap.getOrigin())
268225
268359
  && dataA.radiusOfGyration.isAlmostEqual(dataB.radiusOfGyration)) {
268226
268360
  if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.y)) {
268227
- // We have at least xy symmetry ....
268361
+ // we have at least xy symmetry
268228
268362
  if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.z))
268229
268363
  return true;
268230
- // just xy.
268231
- // allow opposite z directions.
268232
- // If the z's are aligned, x an dy can spin freely.
268364
+ // just xy; allow opposite z directions; if the z's are aligned, x and y can spin freely
268233
268365
  const zA = dataA.localToWorldMap.matrix.columnZ();
268234
268366
  const zB = dataB.localToWorldMap.matrix.columnZ();
268235
268367
  if (zA.isParallelTo(zB, true))
268236
268368
  return true;
268237
268369
  return false;
268238
268370
  }
268239
- // no symmetry. Test all three axes.
268371
+ // no symmetry; test all three axes
268240
268372
  const vectorA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
268241
268373
  const vectorB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
268242
268374
  for (let i = 0; i < 3; i++) {
@@ -268266,7 +268398,7 @@ class MomentData {
268266
268398
  }
268267
268399
  /** Revise the accumulated sums to be "around the centroid". */
268268
268400
  shiftOriginAndSumsToCentroidOfSums() {
268269
- const xyz = this.sums.columnW().realPoint();
268401
+ const xyz = this.sums.columnW().realPoint(); // centroid of the geometry
268270
268402
  if (xyz) {
268271
268403
  this.shiftOriginAndSumsByXYZ(xyz.x, xyz.y, xyz.z);
268272
268404
  return true;
@@ -268275,9 +268407,9 @@ class MomentData {
268275
268407
  }
268276
268408
  /**
268277
268409
  * Revise the accumulated sums.
268278
- * * add ax,ay,ax to the origin coordinates.
268279
- * * apply the negative translation to the sums.
268280
- */
268410
+ * * Add (ax,ay,az) to the origin coordinates.
268411
+ * * Apply the negative translation to the sums.
268412
+ */
268281
268413
  shiftOriginAndSumsByXYZ(ax, ay, az) {
268282
268414
  this.origin.addXYZInPlace(ax, ay, az);
268283
268415
  this.sums.multiplyTranslationSandwichInPlace(-ax, -ay, -az);
@@ -268287,23 +268419,24 @@ class MomentData {
268287
268419
  this.shiftOriginAndSumsByXYZ(newOrigin.x - this.origin.x, newOrigin.y - this.origin.y, newOrigin.z - this.origin.z);
268288
268420
  }
268289
268421
  /**
268290
- * Compute moments of a triangle from the origin to the given line.
268291
- * Accumulate them to this.sums.
268292
- * * If `pointA` is undefined, use `this.origin` as pointA.
268293
- * * If `this.needOrigin` is set, pointB is used
268294
- */
268422
+ * Compute moments of a triangle from the origin. Accumulate them to `this.sums`.
268423
+ * * If `this.needOrigin` is set, `this.origin` is set to `pointB`.
268424
+ * * If `pointA` is undefined, use `this.origin` as `pointA`.
268425
+ */
268295
268426
  accumulateTriangleMomentsXY(pointA, pointB, pointC) {
268296
268427
  this.setOriginXYZIfNeeded(pointB.x, pointB.y, 0.0);
268297
268428
  const x0 = this.origin.x;
268298
268429
  const y0 = this.origin.y;
268299
- const vectorA = MomentData._vectorA =
268300
- pointA !== undefined ? _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointA.x - x0, pointA.y - y0, 0.0, 1.0, MomentData._vectorA)
268301
- : _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(this.origin.x, this.origin.y, 0.0, 1.0, MomentData._vectorA);
268430
+ const vectorA = MomentData._vectorA = (pointA !== undefined) ?
268431
+ _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointA.x - x0, pointA.y - y0, 0.0, 1.0, MomentData._vectorA) :
268432
+ _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(0.0, 0.0, 0.0, 1.0, MomentData._vectorA);
268302
268433
  const vectorB = MomentData._vectorB = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointB.x - x0, pointB.y - y0, 0.0, 1.0, MomentData._vectorB);
268303
268434
  const vectorC = MomentData._vectorC = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointC.x - x0, pointC.y - y0, 0.0, 1.0, MomentData._vectorC);
268304
- // 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
268305
- // where w = 1-u-v
268306
- // W = column vector (point00.x, point00.y, point00.z, 1.0) etc.
268435
+ // Below we calculate 16 double integrals: \iint_T [x y 0 1]^ [x y 0 1] dT over triangle T=(A,B,C).
268436
+ // Each accumulates contributions from 9 scaled outer products. Integration computations use the barycentric
268437
+ // change of variables [B-A C-A][u,v]^ = [x,y]^ with Jacobian detJ = B-A x C-A = twice the area of T.
268438
+ // This converts the integration domain from T to the triangle bounded by u=0, v=0 and v=1-u, yielding e.g.,
268439
+ // \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.
268307
268440
  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);
268308
268441
  if (detJ !== 0.0) {
268309
268442
  const r1_12 = detJ / 12.0;
@@ -268319,7 +268452,7 @@ class MomentData {
268319
268452
  this.sums.addScaledOuterProductInPlace(vectorC, vectorC, r1_12);
268320
268453
  }
268321
268454
  }
268322
- /** Add scaled outer product of (4d, unit weight) point to this.sums. */
268455
+ /** Add scaled outer product of (4d, unit weight) point to `this.sums`. */
268323
268456
  accumulateScaledOuterProduct(point, scaleFactor) {
268324
268457
  this.setOriginXYZIfNeeded(point.x, point.y, 0.0);
268325
268458
  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);
@@ -268342,16 +268475,15 @@ class MomentData {
268342
268475
  this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_3);
268343
268476
  }
268344
268477
  /**
268345
- * Compute moments of triangles from a base point to the given linestring.
268346
- * Accumulate them to this.sums.
268347
- * * If `pointA` is undefined, use `this.origin` as pointA.
268348
- * * If `this.needOrigin` is set, the first point of the array is captured as local origin for subsequent sums.
268349
- *
268478
+ * Compute moments of triangles from a base point to the given linestring. Accumulate them to `this.sums`.
268479
+ * * If `this.needOrigin` is set, `this.origin` is set to the first point of the array.
268480
+ * * If `sweepBase` is undefined, use `this.origin` as `sweepBase`.
268350
268481
  */
268351
268482
  accumulateTriangleToLineStringMomentsXY(sweepBase, points) {
268352
268483
  const n = points.length;
268353
268484
  if (n > 1) {
268354
268485
  points.getPoint3dAtUncheckedPointIndex(0, this._point0);
268486
+ // The linestring forms a polygon with sweepBase. Integrate over this polygon using Shoelace algorithm.
268355
268487
  for (let i = 1; i < n; i++) {
268356
268488
  points.getPoint3dAtUncheckedPointIndex(i, this._point1);
268357
268489
  this.accumulateTriangleMomentsXY(sweepBase, this._point0, this._point1);
@@ -268360,17 +268492,17 @@ class MomentData {
268360
268492
  }
268361
268493
  }
268362
268494
  /**
268363
- * * 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].
268364
- * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin]. (Column weights 0001) (only xy
268365
- * parts of vectors).
268366
- * * scale by detJ for the xy-only determinant of the vectors.
268495
+ * 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].
268496
+ * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin].
268497
+ * (column weights 0001; only xy parts of vectors).
268498
+ * * Scale by detJ for the xy-only determinant of the vectors.
268367
268499
  * @param productXX
268368
268500
  * @param productXY
268369
268501
  * @param productYY
268370
- * @param area Area in caller's system.
268371
- * @param origin Caller's origin.
268372
- * @param vectorU Caller's U axis (not necessarily unit).
268373
- * @param vectorV Caller's V axis (not necessarily unit).
268502
+ * @param area area in caller's system.
268503
+ * @param origin caller's origin.
268504
+ * @param vectorU caller's U axis (not necessarily unit).
268505
+ * @param vectorV caller's V axis (not necessarily unit).
268374
268506
  */
268375
268507
  accumulateXYProductsInCentroidalFrame(productXX, productXY, productYY, area, origin, vectorU, vectorV) {
268376
268508
  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);
@@ -268683,8 +268815,7 @@ class Point4d extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
268683
268815
  distanceSquaredXYZW(other) {
268684
268816
  return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseSquaredXYZW(other.xyzw[0] - this.xyzw[0], other.xyzw[1] - this.xyzw[1], other.xyzw[2] - this.xyzw[2], other.xyzw[3] - this.xyzw[3]);
268685
268817
  }
268686
- /** Return the distance between the instance and other after normalizing by weights
268687
- */
268818
+ /** Return the xy distance between the instance and `other` after normalizing by weights */
268688
268819
  realDistanceXY(other) {
268689
268820
  const wA = this.w;
268690
268821
  const wB = other.w;
@@ -268692,6 +268823,14 @@ class Point4d extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
268692
268823
  return undefined;
268693
268824
  return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);
268694
268825
  }
268826
+ /** Return the xy squared distance between the instance and `other` after normalizing by weights */
268827
+ realDistanceSquaredXY(other) {
268828
+ const wA = this.w;
268829
+ const wB = other.w;
268830
+ if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSmallMetricDistance(wA) || _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSmallMetricDistance(wB))
268831
+ return undefined;
268832
+ return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseSquaredXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);
268833
+ }
268695
268834
  /** Return the largest absolute distance between corresponding components
268696
268835
  * * x,y,z,w all participate without normalization.
268697
268836
  */
@@ -277057,7 +277196,7 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
277057
277196
  */
277058
277197
  class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {
277059
277198
  _facetIndices;
277060
- _currentSubsetIndex; // index within _facetIndices, or -1 after construction
277199
+ _currentSubsetIndex; // index within _facetIndices
277061
277200
  _nextSubsetIndex; // index within _facetIndices
277062
277201
  constructor(polyface, facetIndices, numWrap) {
277063
277202
  super(polyface, numWrap);
@@ -330107,7 +330246,7 @@ class TestContext {
330107
330246
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
330108
330247
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
330109
330248
  await core_frontend_1.NoRenderApp.startup({
330110
- applicationVersion: "5.0.0-dev.114",
330249
+ applicationVersion: "5.0.0-dev.115",
330111
330250
  applicationId: this.settings.gprid,
330112
330251
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
330113
330252
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -355155,7 +355294,7 @@ var loadLanguages = instance.loadLanguages;
355155
355294
  /***/ ((module) => {
355156
355295
 
355157
355296
  "use strict";
355158
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.114","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"}}');
355297
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.115","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"}}');
355159
355298
 
355160
355299
  /***/ }),
355161
355300