@itwin/ecschema-rpcinterface-tests 5.3.0-dev.12 → 5.3.0-dev.16

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.
@@ -97409,7 +97409,9 @@ class ViewManager {
97409
97409
  get selectedView() { return this._selectedView; }
97410
97410
  /** Get the first opened view. */
97411
97411
  getFirstOpenView() { return this._viewports.length > 0 ? this._viewports[0] : undefined; }
97412
- /** Check if only a single viewport is being used. If so, render directly on-screen using its WebGL canvas. Otherwise, render each view offscreen. */
97412
+ /** Check if only a single viewport is being used. If so, render directly on-screen using its WebGL canvas. Otherwise, render each view offscreen.
97413
+ * @internal
97414
+ */
97413
97415
  updateRenderToScreen() {
97414
97416
  const renderToScreen = 1 === this._viewports.length;
97415
97417
  for (const vp of this)
@@ -106032,6 +106034,7 @@ __webpack_require__.r(__webpack_exports__);
106032
106034
  /** @packageDocumentation
106033
106035
  * @module Utils
106034
106036
  */
106037
+ /** @internal */
106035
106038
  const _implementationProhibited = Symbol.for("Implementations of this interface can only be obtained from the containing package");
106036
106039
  function sym(name) {
106037
106040
  return `${name}_core-frontend_INTERNAL_ONLY_DO_NOT_USE`;
@@ -111972,6 +111975,7 @@ __webpack_require__.r(__webpack_exports__);
111972
111975
  /* harmony export */ WorkerGraphicDescriptionContext: () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_10__.WorkerGraphicDescriptionContext),
111973
111976
  /* harmony export */ ZoomViewTool: () => (/* reexport safe */ _tools_ViewTool__WEBPACK_IMPORTED_MODULE_114__.ZoomViewTool),
111974
111977
  /* harmony export */ _callIpcChannel: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_122__._callIpcChannel),
111978
+ /* harmony export */ _implementationProhibited: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_122__._implementationProhibited),
111975
111979
  /* harmony export */ _scheduleScriptReference: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_122__._scheduleScriptReference),
111976
111980
  /* harmony export */ acquireImdlDecoder: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_122__.acquireImdlDecoder),
111977
111981
  /* harmony export */ appendQueryParams: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_122__.appendQueryParams),
@@ -113540,6 +113544,7 @@ __webpack_require__.r(__webpack_exports__);
113540
113544
  /* harmony export */ Target: () => (/* reexport safe */ _render_webgl_Target__WEBPACK_IMPORTED_MODULE_3__.Target),
113541
113545
  /* harmony export */ WmsUtilities: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_8__.WmsUtilities),
113542
113546
  /* harmony export */ _callIpcChannel: () => (/* reexport safe */ _common_internal_Symbols__WEBPACK_IMPORTED_MODULE_0__._callIpcChannel),
113547
+ /* harmony export */ _implementationProhibited: () => (/* reexport safe */ _common_internal_Symbols__WEBPACK_IMPORTED_MODULE_0__._implementationProhibited),
113543
113548
  /* harmony export */ _scheduleScriptReference: () => (/* reexport safe */ _common_internal_Symbols__WEBPACK_IMPORTED_MODULE_0__._scheduleScriptReference),
113544
113549
  /* harmony export */ acquireImdlDecoder: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_8__.acquireImdlDecoder),
113545
113550
  /* harmony export */ appendQueryParams: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_8__.appendQueryParams),
@@ -113583,6 +113588,7 @@ __webpack_require__.r(__webpack_exports__);
113583
113588
 
113584
113589
 
113585
113590
 
113591
+
113586
113592
  /***/ }),
113587
113593
 
113588
113594
  /***/ "../../core/frontend/lib/esm/internal/render/AnimationBranchState.js":
@@ -199835,6 +199841,7 @@ __webpack_require__.r(__webpack_exports__);
199835
199841
  /* harmony export */ IndexedPolyfaceSubsetVisitor: () => (/* reexport safe */ _polyface_IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_116__.IndexedPolyfaceSubsetVisitor),
199836
199842
  /* harmony export */ IndexedPolyfaceVisitor: () => (/* reexport safe */ _polyface_IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_116__.IndexedPolyfaceVisitor),
199837
199843
  /* harmony export */ IndexedPolyfaceWalker: () => (/* reexport safe */ _polyface_IndexedPolyfaceWalker__WEBPACK_IMPORTED_MODULE_117__.IndexedPolyfaceWalker),
199844
+ /* harmony export */ IndexedReadWriteXYCollection: () => (/* reexport safe */ _geometry3d_IndexedXYCollection__WEBPACK_IMPORTED_MODULE_14__.IndexedReadWriteXYCollection),
199838
199845
  /* harmony export */ IndexedReadWriteXYZCollection: () => (/* reexport safe */ _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_15__.IndexedReadWriteXYZCollection),
199839
199846
  /* harmony export */ IndexedXYCollection: () => (/* reexport safe */ _geometry3d_IndexedXYCollection__WEBPACK_IMPORTED_MODULE_14__.IndexedXYCollection),
199840
199847
  /* harmony export */ IndexedXYZCollection: () => (/* reexport safe */ _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_15__.IndexedXYZCollection),
@@ -203698,32 +203705,33 @@ __webpack_require__.r(__webpack_exports__);
203698
203705
  /* harmony export */ CurveFactory: () => (/* binding */ CurveFactory),
203699
203706
  /* harmony export */ MiteredSweepOutputSelect: () => (/* binding */ MiteredSweepOutputSelect)
203700
203707
  /* harmony export */ });
203701
- /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
203702
- /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
203703
- /* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
203704
- /* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
203705
- /* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
203706
- /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
203707
- /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
203708
- /* harmony import */ var _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../geometry3d/PolylineOps */ "../../core/geometry/lib/esm/geometry3d/PolylineOps.js");
203709
- /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
203710
- /* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
203711
- /* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
203712
- /* harmony import */ var _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../numerics/SmallSystem */ "../../core/geometry/lib/esm/numerics/SmallSystem.js");
203713
- /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
203714
- /* harmony import */ var _solid_Cone__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../solid/Cone */ "../../core/geometry/lib/esm/solid/Cone.js");
203715
- /* harmony import */ var _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../solid/RuledSweep */ "../../core/geometry/lib/esm/solid/RuledSweep.js");
203716
- /* harmony import */ var _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../solid/TorusPipe */ "../../core/geometry/lib/esm/solid/TorusPipe.js");
203717
- /* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
203718
- /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
203719
- /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
203720
- /* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
203721
- /* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
203722
- /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
203723
- /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
203724
- /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
203725
- /* harmony import */ var _RegionOps__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
203726
- /* harmony import */ var _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
203708
+ /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
203709
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
203710
+ /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
203711
+ /* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
203712
+ /* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
203713
+ /* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
203714
+ /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
203715
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
203716
+ /* harmony import */ var _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../geometry3d/PolylineOps */ "../../core/geometry/lib/esm/geometry3d/PolylineOps.js");
203717
+ /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
203718
+ /* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
203719
+ /* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
203720
+ /* harmony import */ var _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../numerics/SmallSystem */ "../../core/geometry/lib/esm/numerics/SmallSystem.js");
203721
+ /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
203722
+ /* harmony import */ var _solid_Cone__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../solid/Cone */ "../../core/geometry/lib/esm/solid/Cone.js");
203723
+ /* harmony import */ var _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../solid/RuledSweep */ "../../core/geometry/lib/esm/solid/RuledSweep.js");
203724
+ /* harmony import */ var _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../solid/TorusPipe */ "../../core/geometry/lib/esm/solid/TorusPipe.js");
203725
+ /* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
203726
+ /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
203727
+ /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
203728
+ /* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
203729
+ /* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
203730
+ /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
203731
+ /* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
203732
+ /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
203733
+ /* harmony import */ var _RegionOps__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
203734
+ /* harmony import */ var _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
203727
203735
  /*---------------------------------------------------------------------------------------------
203728
203736
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
203729
203737
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -203755,6 +203763,7 @@ __webpack_require__.r(__webpack_exports__);
203755
203763
 
203756
203764
 
203757
203765
 
203766
+
203758
203767
 
203759
203768
 
203760
203769
  /**
@@ -203779,8 +203788,8 @@ class CurveFactory {
203779
203788
  /** (Cautiously) construct and save a line segment between fractional positions. */
203780
203789
  static addPartialSegment(path, allowBackup, pointA, pointB, fraction0, fraction1) {
203781
203790
  if (allowBackup || (fraction1 > fraction0)) {
203782
- if (pointA !== undefined && pointB !== undefined && !_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(fraction0, fraction1))
203783
- path.tryAddChild(_LineSegment3d__WEBPACK_IMPORTED_MODULE_1__.LineSegment3d.create(pointA.interpolate(fraction0, pointB), pointA.interpolate(fraction1, pointB)));
203791
+ if (pointA !== undefined && pointB !== undefined && !_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isAlmostEqualNumber(fraction0, fraction1))
203792
+ path.tryAddChild(_LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d.create(pointA.interpolate(fraction0, pointB), pointA.interpolate(fraction1, pointB)));
203784
203793
  }
203785
203794
  }
203786
203795
  /**
@@ -203789,8 +203798,8 @@ class CurveFactory {
203789
203798
  * * If tangent is parallel to line segment from start to end, return `undefined`.
203790
203799
  */
203791
203800
  static createArcPointTangentPoint(start, tangentAtStart, end) {
203792
- const ret = _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.createCircularStartTangentEnd(start, tangentAtStart, end);
203793
- if (ret instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d)
203801
+ const ret = _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d.createCircularStartTangentEnd(start, tangentAtStart, end);
203802
+ if (ret instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d)
203794
203803
  return ret;
203795
203804
  else
203796
203805
  return undefined;
@@ -203799,77 +203808,72 @@ class CurveFactory {
203799
203808
  * Construct a sequence of alternating lines and arcs with the arcs creating tangent transition between consecutive edges.
203800
203809
  * * If the radius parameter is a number, that radius is used throughout.
203801
203810
  * * If the radius parameter is an array of numbers, `radius[i]` is applied at `point[i]`.
203802
- * * Note that since no fillet is constructed at the initial or final point, those entries in `radius[]` are never referenced.
203803
- * * A zero radius for any point indicates to leave the as a simple corner.
203804
- * @param points point source
203811
+ * * A zero radius for any point indicates to leave the as a simple corner.
203812
+ * @param points point source.
203805
203813
  * @param radius fillet radius or array of radii indexed to correspond to the points.
203806
- * @param allowBackupAlongEdge true to allow edges to be created going "backwards" along edges if needed to create the blend.
203814
+ * @param allowCuspOrOptions flag to allow cusps in output (default `true`), or a list of extended options.
203807
203815
  */
203808
- static createFilletsInLineString(points, radius, allowBackupAlongEdge = true) {
203816
+ static createFilletsInLineString(points, radius, allowCuspOrOptions = true) {
203809
203817
  if (Array.isArray(points))
203810
- return this.createFilletsInLineString(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_3__.Point3dArrayCarrier(points), radius, allowBackupAlongEdge);
203811
- if (points instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_4__.LineString3d)
203812
- return this.createFilletsInLineString(points.packedPoints, radius, allowBackupAlongEdge);
203813
- const n = points.length;
203818
+ return this.createFilletsInLineString(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_4__.Point3dArrayCarrier(points), radius, allowCuspOrOptions);
203819
+ if (points instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_5__.LineString3d)
203820
+ return this.createFilletsInLineString(points.packedPoints, radius, allowCuspOrOptions);
203821
+ let allowCusp = true;
203822
+ let filletClosure = false;
203823
+ if (typeof allowCuspOrOptions === "boolean") {
203824
+ allowCusp = allowCuspOrOptions;
203825
+ }
203826
+ else {
203827
+ allowCusp = allowCuspOrOptions.allowCusp ?? true;
203828
+ filletClosure = allowCuspOrOptions.filletClosure ?? false;
203829
+ }
203830
+ let n = points.length;
203831
+ if (filletClosure && points.almostEqualIndexIndex(0, n - 1))
203832
+ n--; // ignore closure point
203814
203833
  if (n <= 1)
203815
203834
  return undefined;
203816
- const pointA = points.getPoint3dAtCheckedPointIndex(0);
203817
- const pointB = points.getPoint3dAtCheckedPointIndex(1);
203818
- // remark: n=2 and n=3 cases should fall out from loop logic
203835
+ const pointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
203836
+ const pointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
203837
+ const pointC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
203819
203838
  const blendArray = [];
203820
- // build one-sided blends at each end . .
203821
- blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointA.clone() });
203822
- for (let i = 1; i + 1 < n; i++) {
203823
- const pointC = points.getPoint3dAtCheckedPointIndex(i + 1);
203824
- let thisRadius = 0;
203825
- if (Array.isArray(radius)) {
203826
- if (i < radius.length)
203827
- thisRadius = radius[i];
203828
- }
203829
- else if (Number.isFinite(radius))
203830
- thisRadius = radius;
203831
- if (thisRadius !== 0.0)
203832
- blendArray.push(_Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.createFilletArc(pointA, pointB, pointC, thisRadius));
203833
- else
203834
- blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointB.clone() });
203835
- pointA.setFromPoint3d(pointB);
203836
- pointB.setFromPoint3d(pointC);
203839
+ // remark: n=2 and n=3 cases should fall out from loop logic
203840
+ for (let i = 0; i < n; i++) {
203841
+ let thisRadius = Math.abs(Array.isArray(radius) ? (i < radius.length ? radius[i] : 0) : radius);
203842
+ if (!Number.isFinite(thisRadius))
203843
+ thisRadius = 0;
203844
+ if (thisRadius === 0 || (!filletClosure && (i === 0 || i === n - 1))) {
203845
+ blendArray.push({ fraction10: 0, fraction12: 0, point: points.getPoint3dAtUncheckedPointIndex(i) });
203846
+ }
203847
+ else {
203848
+ points.getPoint3dAtUncheckedPointIndex(_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.modulo(i - 1, n), pointA);
203849
+ points.getPoint3dAtUncheckedPointIndex(i, pointB);
203850
+ points.getPoint3dAtUncheckedPointIndex(_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.modulo(i + 1, n), pointC);
203851
+ blendArray.push(_Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d.createFilletArc(pointA, pointB, pointC, thisRadius));
203852
+ }
203837
203853
  }
203838
- blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointB.clone() });
203839
- if (!allowBackupAlongEdge) {
203840
- // suppress arcs that have overlap with both neighbors or flood either neighbor ..
203841
- for (let i = 1; i + 1 < n; i++) {
203842
- const b = blendArray[i];
203843
- if (b.fraction10 > 1.0
203844
- || b.fraction12 > 1.0
203845
- || 1.0 - b.fraction10 < blendArray[i - 1].fraction12
203846
- || b.fraction12 > 1.0 - blendArray[i + 1].fraction10) {
203847
- b.fraction10 = 0.0;
203848
- b.fraction12 = 0.0;
203849
- blendArray[i].arc = undefined;
203850
- }
203851
- }
203852
- /* The "1-b" logic above prevents this loop from ever doing anything.
203853
- // on edge with conflict, suppress the arc with larger fraction
203854
- for (let i = 1; i < n; i++) {
203855
- const b0 = blendArray[i - 1];
203856
- const b1 = blendArray[i];
203857
- if (b0.fraction12 > 1 - b1.fraction10) {
203858
- const b = b0.fraction12 > b1.fraction12 ? b1 : b0;
203859
- b.fraction10 = 0.0;
203860
- b.fraction12 = 0.0;
203861
- blendArray[i].arc = undefined;
203862
- }
203863
- } */
203854
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(blendArray.length === n);
203855
+ if (!allowCusp) {
203856
+ // suppress arcs that overlap a neighboring arc, or that consume the entire segment
203857
+ for (let i = 0; i < n; i++) {
203858
+ const bB = blendArray[i];
203859
+ if (!bB.arc)
203860
+ continue;
203861
+ const bA = blendArray[_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.modulo(i - 1, n)];
203862
+ const bC = blendArray[_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.modulo(i + 1, n)];
203863
+ if (bB.fraction10 > 1 || bB.fraction12 > 1 || 1 - bB.fraction10 < bA.fraction12 || bB.fraction12 > 1 - bC.fraction10) {
203864
+ bB.fraction10 = bB.fraction12 = 0;
203865
+ bB.arc = undefined;
203866
+ }
203867
+ }
203864
203868
  }
203865
- const path = _Path__WEBPACK_IMPORTED_MODULE_5__.Path.create();
203866
- this.addPartialSegment(path, allowBackupAlongEdge, blendArray[0].point, blendArray[1].point, blendArray[0].fraction12, 1.0 - blendArray[1].fraction10);
203867
- // add each path and successor edge ...
203868
- for (let i = 1; i + 1 < points.length; i++) {
203869
+ const path = _Path__WEBPACK_IMPORTED_MODULE_7__.Path.create();
203870
+ for (let i = 0; i < n; i++) {
203869
203871
  const b0 = blendArray[i];
203870
- const b1 = blendArray[i + 1];
203871
203872
  path.tryAddChild(b0.arc);
203872
- this.addPartialSegment(path, allowBackupAlongEdge, b0.point, b1.point, b0.fraction12, 1.0 - b1.fraction10);
203873
+ if (i + 1 < n || filletClosure) {
203874
+ const b1 = blendArray[_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.modulo(i + 1, n)];
203875
+ this.addPartialSegment(path, allowCusp, b0.point, b1.point, b0.fraction12, 1 - b1.fraction10);
203876
+ }
203873
203877
  }
203874
203878
  return path;
203875
203879
  }
@@ -203879,43 +203883,43 @@ class CurveFactory {
203879
203883
  * * If the radius is too large for the outer rectangle size, it is reduced to half of the the smaller x or y size.
203880
203884
  */
203881
203885
  static createRectangleXY(x0, y0, x1, y1, z = 0, filletRadius) {
203882
- let radius = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.correctSmallMetricDistance(filletRadius);
203886
+ let radius = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.correctSmallMetricDistance(filletRadius);
203883
203887
  const xMin = Math.min(x0, x1);
203884
203888
  const xMax = Math.max(x0, x1);
203885
203889
  const yMin = Math.min(y0, y1);
203886
203890
  const yMax = Math.max(y0, y1);
203887
203891
  radius = Math.min(Math.abs(radius), 0.5 * (xMax - xMin), 0.5 * (yMax - yMin));
203888
203892
  if (radius === 0.0)
203889
- return _Loop__WEBPACK_IMPORTED_MODULE_6__.Loop.createPolygon([
203890
- _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMin, yMin, z),
203891
- _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMax, yMin, z),
203892
- _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMax, yMax, z),
203893
- _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMin, yMax, z),
203894
- _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMin, yMin, z),
203893
+ return _Loop__WEBPACK_IMPORTED_MODULE_8__.Loop.createPolygon([
203894
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(xMin, yMin, z),
203895
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(xMax, yMin, z),
203896
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(xMax, yMax, z),
203897
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(xMin, yMax, z),
203898
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(xMin, yMin, z),
203895
203899
  ]);
203896
203900
  else {
203897
- const vectorU = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(radius, 0, 0);
203898
- const vectorV = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(0, radius, 0);
203901
+ const vectorU = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.create(radius, 0, 0);
203902
+ const vectorV = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.create(0, radius, 0);
203899
203903
  const x0A = xMin + radius;
203900
203904
  const y0A = yMin + radius;
203901
203905
  const x1A = xMax - radius;
203902
203906
  const y1A = yMax - radius;
203903
203907
  const centers = [
203904
- _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x1A, y1A, z),
203905
- _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x0A, y1A, z),
203906
- _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x0A, y0A, z),
203907
- _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x1A, y0A, z),
203908
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(x1A, y1A, z),
203909
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(x0A, y1A, z),
203910
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(x0A, y0A, z),
203911
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(x1A, y0A, z),
203908
203912
  ];
203909
- const loop = _Loop__WEBPACK_IMPORTED_MODULE_6__.Loop.create();
203913
+ const loop = _Loop__WEBPACK_IMPORTED_MODULE_8__.Loop.create();
203910
203914
  for (let i = 0; i < 4; i++) {
203911
203915
  const center = centers[i];
203912
203916
  const nextCenter = centers[(i + 1) % 4];
203913
- const edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(center, nextCenter);
203914
- const arc = _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(center, vectorU, vectorV, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__.AngleSweep.createStartEndDegrees(0, 90));
203917
+ const edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(center, nextCenter);
203918
+ const arc = _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d.create(center, vectorU, vectorV, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_9__.AngleSweep.createStartEndDegrees(0, 90));
203915
203919
  loop.tryAddChild(arc);
203916
203920
  const arcEnd = arc.endPoint();
203917
203921
  if (!edgeVector.isAlmostZero)
203918
- loop.tryAddChild(_LineSegment3d__WEBPACK_IMPORTED_MODULE_1__.LineSegment3d.create(arcEnd, arcEnd.plus(edgeVector)));
203922
+ loop.tryAddChild(_LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d.create(arcEnd, arcEnd.plus(edgeVector)));
203919
203923
  vectorU.rotate90CCWXY(vectorU);
203920
203924
  vectorV.rotate90CCWXY(vectorV);
203921
203925
  }
@@ -203931,9 +203935,9 @@ class CurveFactory {
203931
203935
  * @param tolerance optional coordinate tolerance for point equality (default is `Geometry.smallMetricDistance`).
203932
203936
  * @returns whether `arcA` was modified.
203933
203937
  */
203934
- static appendToArcInPlace(arcA, arcB, allowReverse = false, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
203938
+ static appendToArcInPlace(arcA, arcB, allowReverse = false, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
203935
203939
  if (arcA.center.isAlmostEqual(arcB.center, tolerance)) {
203936
- const sweepSign = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.split3WaySign(arcA.sweep.sweepRadians * arcB.sweep.sweepRadians, -1, 0, 1);
203940
+ const sweepSign = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.split3WaySign(arcA.sweep.sweepRadians * arcB.sweep.sweepRadians, -1, 0, 1);
203937
203941
  // evaluate derivatives wrt radians (not fraction!), but adjust direction for sweep signs
203938
203942
  const endA = arcA.angleToPointAndDerivative(arcA.sweep.fractionToAngle(1.0));
203939
203943
  if (arcA.sweep.sweepRadians < 0)
@@ -203965,7 +203969,7 @@ class CurveFactory {
203965
203969
  * @param fractionForIntermediateNormal fractional position for surface normal used to create the section plane.
203966
203970
  */
203967
203971
  static assembleArcChainOnEllipsoid(ellipsoid, pathPoints, fractionForIntermediateNormal = 0.5) {
203968
- const arcPath = _Path__WEBPACK_IMPORTED_MODULE_5__.Path.create();
203972
+ const arcPath = _Path__WEBPACK_IMPORTED_MODULE_7__.Path.create();
203969
203973
  for (let i = 0; i + 1 < pathPoints.length; i++) {
203970
203974
  const arc = ellipsoid.sectionArcWithIntermediateNormal(pathPoints[i].toAngles(), fractionForIntermediateNormal, pathPoints[i + 1].toAngles());
203971
203975
  arcPath.tryAddChild(arc);
@@ -203973,7 +203977,7 @@ class CurveFactory {
203973
203977
  return arcPath;
203974
203978
  }
203975
203979
  static appendGeometryQueryArray(candidate, result) {
203976
- if (candidate instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_9__.GeometryQuery)
203980
+ if (candidate instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_10__.GeometryQuery)
203977
203981
  result.push(candidate);
203978
203982
  else if (Array.isArray(candidate)) {
203979
203983
  for (const p of candidate)
@@ -203986,18 +203990,18 @@ class CurveFactory {
203986
203990
  * @param pipeRadius radius of pipe.
203987
203991
  */
203988
203992
  static createPipeSegments(centerline, pipeRadius) {
203989
- if (centerline instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_1__.LineSegment3d) {
203990
- return _solid_Cone__WEBPACK_IMPORTED_MODULE_10__.Cone.createAxisPoints(centerline.startPoint(), centerline.endPoint(), pipeRadius, pipeRadius, false);
203993
+ if (centerline instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d) {
203994
+ return _solid_Cone__WEBPACK_IMPORTED_MODULE_11__.Cone.createAxisPoints(centerline.startPoint(), centerline.endPoint(), pipeRadius, pipeRadius, false);
203991
203995
  }
203992
- else if (centerline instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
203993
- return _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_11__.TorusPipe.createAlongArc(centerline, pipeRadius, false);
203996
+ else if (centerline instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d) {
203997
+ return _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_12__.TorusPipe.createAlongArc(centerline, pipeRadius, false);
203994
203998
  }
203995
- else if (centerline instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__.CurvePrimitive) {
203996
- const builder = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_13__.PolyfaceBuilder.create();
203999
+ else if (centerline instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_13__.CurvePrimitive) {
204000
+ const builder = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_14__.PolyfaceBuilder.create();
203997
204001
  builder.addMiteredPipes(centerline, pipeRadius);
203998
204002
  return builder.claimPolyface();
203999
204003
  }
204000
- else if (centerline instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_14__.CurveChain) {
204004
+ else if (centerline instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_15__.CurveChain) {
204001
204005
  const result = [];
204002
204006
  for (const p of centerline.children) {
204003
204007
  const pipe = this.createPipeSegments(p, pipeRadius);
@@ -204009,13 +204013,13 @@ class CurveFactory {
204009
204013
  }
204010
204014
  /** Get start point and tangent for variant curve data. */
204011
204015
  static startPointAndTangent(curve) {
204012
- if (curve instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__.CurvePrimitive)
204016
+ if (curve instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_13__.CurvePrimitive)
204013
204017
  return curve.fractionToPointAndDerivative(0.0);
204014
204018
  if (curve.length < 2)
204015
204019
  return undefined;
204016
204020
  if (Array.isArray(curve))
204017
- curve = new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_3__.Point3dArrayCarrier(curve);
204018
- const ray = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_15__.Ray3d.createZero();
204021
+ curve = new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_4__.Point3dArrayCarrier(curve);
204022
+ const ray = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_16__.Ray3d.createZero();
204019
204023
  curve.getPoint3dAtUncheckedPointIndex(0, ray.origin);
204020
204024
  curve.vectorIndexIndex(0, 1, ray.direction);
204021
204025
  return ray;
@@ -204027,19 +204031,19 @@ class CurveFactory {
204027
204031
  if (!ray)
204028
204032
  return undefined;
204029
204033
  let arc;
204030
- if (sectionData instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
204034
+ if (sectionData instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d) {
204031
204035
  arc = sectionData.clone();
204032
204036
  arc.center = ray.origin;
204033
204037
  }
204034
204038
  else {
204035
- const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
204036
- const vector90 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
204039
+ const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.create();
204040
+ const vector90 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.create();
204037
204041
  const length0 = (typeof sectionData === "number") ? sectionData : sectionData.x;
204038
204042
  const length90 = (typeof sectionData === "number") ? sectionData : sectionData.y;
204039
- const baseFrame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_16__.Matrix3d.createRigidHeadsUp(ray.direction, _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.ZXY);
204043
+ const baseFrame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_17__.Matrix3d.createRigidHeadsUp(ray.direction, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.ZXY);
204040
204044
  baseFrame.columnX(vector0).scaleInPlace(length0);
204041
204045
  baseFrame.columnY(vector90).scaleInPlace(length90);
204042
- arc = _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(ray.origin, vector0, vector90);
204046
+ arc = _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d.create(ray.origin, vector0, vector90);
204043
204047
  }
204044
204048
  if (arc.binormalVector().dotProduct(ray.direction) < 0.0)
204045
204049
  arc.reverseInPlace();
@@ -204077,14 +204081,14 @@ class CurveFactory {
204077
204081
  /** For a smooth curve, stroke and return unnormalized start/end tangents. */
204078
204082
  static strokeSmoothCurve(curve, options) {
204079
204083
  let startTangent, endTangent;
204080
- if (curve instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__.CurvePrimitive) {
204084
+ if (curve instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_13__.CurvePrimitive) {
204081
204085
  startTangent = curve.fractionToPointAndDerivative(0.0).direction;
204082
204086
  endTangent = curve.fractionToPointAndDerivative(1.0).direction;
204083
- const strokes = _LineString3d__WEBPACK_IMPORTED_MODULE_4__.LineString3d.create();
204087
+ const strokes = _LineString3d__WEBPACK_IMPORTED_MODULE_5__.LineString3d.create();
204084
204088
  curve.emitStrokes(strokes, options);
204085
204089
  curve = strokes.packedPoints;
204086
204090
  }
204087
- else if (curve instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_14__.CurveChain) {
204091
+ else if (curve instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_15__.CurveChain) {
204088
204092
  startTangent = curve.startPointAndDerivative()?.direction;
204089
204093
  endTangent = curve.endPointAndDerivative()?.direction;
204090
204094
  const strokes = curve.getPackedStrokes(options);
@@ -204093,7 +204097,7 @@ class CurveFactory {
204093
204097
  curve = strokes;
204094
204098
  }
204095
204099
  else if (Array.isArray(curve))
204096
- curve = new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_3__.Point3dArrayCarrier(curve);
204100
+ curve = new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_4__.Point3dArrayCarrier(curve);
204097
204101
  return { strokes: curve, startTangent, endTangent };
204098
204102
  }
204099
204103
  /**
@@ -204119,18 +204123,18 @@ class CurveFactory {
204119
204123
  /** Reverse a closed curve or region if necessary so that its orientation is CCW with respect to the plane normal. */
204120
204124
  static alignClosedCurveToPlane(curve, planeNormal) {
204121
204125
  let closedCurve;
204122
- if (curve instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_12__.CurvePrimitive) {
204126
+ if (curve instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_13__.CurvePrimitive) {
204123
204127
  if (curve.startPoint().isAlmostEqual(curve.endPoint()))
204124
- closedCurve = _Loop__WEBPACK_IMPORTED_MODULE_6__.Loop.create(curve);
204128
+ closedCurve = _Loop__WEBPACK_IMPORTED_MODULE_8__.Loop.create(curve);
204125
204129
  }
204126
204130
  else if (curve.isAnyRegion())
204127
204131
  closedCurve = curve;
204128
204132
  if (closedCurve) {
204129
204133
  // The alignment condition is equivalent to positive projected curve area computed wrt to the plane normal.
204130
- const toLocal = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_16__.Matrix3d.createRigidHeadsUp(planeNormal).transpose();
204131
- const projection = closedCurve.cloneTransformed(_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createOriginAndMatrix(undefined, toLocal));
204134
+ const toLocal = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_17__.Matrix3d.createRigidHeadsUp(planeNormal).transpose();
204135
+ const projection = closedCurve.cloneTransformed(_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createOriginAndMatrix(undefined, toLocal));
204132
204136
  if (projection) { // now we can ignore z-coords
204133
- const areaXY = _RegionOps__WEBPACK_IMPORTED_MODULE_18__.RegionOps.computeXYArea(projection);
204137
+ const areaXY = _RegionOps__WEBPACK_IMPORTED_MODULE_19__.RegionOps.computeXYArea(projection);
204134
204138
  if (areaXY && areaXY < 0)
204135
204139
  curve.reverseInPlace();
204136
204140
  }
@@ -204142,8 +204146,8 @@ class CurveFactory {
204142
204146
  * * If unsuccessful, leave the output arrays alone and return the input section.
204143
204147
  */
204144
204148
  static doSweepToPlane(output, edgePlane0, edgePlane1, targetPlane, section) {
204145
- const sweepVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(edgePlane0.getOriginRef(), edgePlane1.getOriginRef());
204146
- const transform = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createFlattenAlongVectorToPlane(sweepVector, targetPlane.getOriginRef(), targetPlane.getNormalRef());
204149
+ const sweepVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(edgePlane0.getOriginRef(), edgePlane1.getOriginRef());
204150
+ const transform = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createFlattenAlongVectorToPlane(sweepVector, targetPlane.getOriginRef(), targetPlane.getNormalRef());
204147
204151
  if (transform === undefined)
204148
204152
  return section;
204149
204153
  const transformedSection = section.cloneTransformed(transform);
@@ -204179,7 +204183,7 @@ class CurveFactory {
204179
204183
  const rail = this.strokeSmoothCurve(centerline, options.strokeOptions);
204180
204184
  if (!rail)
204181
204185
  return undefined;
204182
- const planes = _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_19__.PolylineOps.createBisectorPlanesForDistinctPoints(rail.strokes);
204186
+ const planes = _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_20__.PolylineOps.createBisectorPlanesForDistinctPoints(rail.strokes);
204183
204187
  if (!planes || planes.length < 2)
204184
204188
  return undefined;
204185
204189
  this.alignFirstAndLastBisectorPlanes(planes[0], planes[planes.length - 1], rail, options);
@@ -204191,11 +204195,11 @@ class CurveFactory {
204191
204195
  for (let i = 1; i < planes.length; i++)
204192
204196
  currentSection = this.doSweepToPlane(sectionData, planes[i - 1], planes[i], planes[i], currentSection);
204193
204197
  if (options.outputSelect) {
204194
- const ruledSweep = _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_20__.RuledSweep.create(sectionData.sections, options.capped ?? false);
204198
+ const ruledSweep = _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_21__.RuledSweep.create(sectionData.sections, options.capped ?? false);
204195
204199
  if (ruledSweep) {
204196
204200
  sectionData.ruledSweep = ruledSweep;
204197
204201
  if (MiteredSweepOutputSelect.AlsoMesh === options.outputSelect) {
204198
- const builder = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_13__.PolyfaceBuilder.create(options.strokeOptions);
204202
+ const builder = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_14__.PolyfaceBuilder.create(options.strokeOptions);
204199
204203
  builder.addRuledSweep(ruledSweep);
204200
204204
  sectionData.mesh = builder.claimPolyface();
204201
204205
  }
@@ -204213,7 +204217,7 @@ class CurveFactory {
204213
204217
  * @param sweep angular range. If single `Angle` is given, start angle is at 0 degrees (the start point).
204214
204218
  */
204215
204219
  static createArcPointTangentRadius(start, tangentAtStart, radius, upVector, sweep) {
204216
- return _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.createCircularStartTangentRadius(start, tangentAtStart, radius, upVector, sweep);
204220
+ return _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d.createCircularStartTangentRadius(start, tangentAtStart, radius, upVector, sweep);
204217
204221
  }
204218
204222
  /**
204219
204223
  * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.
@@ -204226,32 +204230,32 @@ class CurveFactory {
204226
204230
  * @return array with the computed spirals, or undefined if failure.
204227
204231
  */
204228
204232
  static createLineSpiralSpiralLine(spiralType, startPoint, shoulderPoint, targetPoint) {
204229
- const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(startPoint, shoulderPoint);
204230
- const vectorBC0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(shoulderPoint, targetPoint);
204233
+ const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(startPoint, shoulderPoint);
204234
+ const vectorBC0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(shoulderPoint, targetPoint);
204231
204235
  const referenceLength = vectorAB.magnitude();
204232
204236
  const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);
204233
204237
  const lineTurnRadians = vectorAB.angleToXY(vectorBC0);
204234
204238
  const spiralTurnRadians = 0.5 * lineTurnRadians.radians;
204235
204239
  const radiansBC = radiansAB + lineTurnRadians.radians;
204236
- const axesA = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_16__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.createRadians(radiansAB));
204237
- const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createRefs(startPoint.clone(), axesA);
204240
+ const axesA = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_17__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(radiansAB));
204241
+ const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createRefs(startPoint.clone(), axesA);
204238
204242
  // We know how much it has to turn, and but not the length or end radius.
204239
204243
  // make a spiral of referenceLength and scale it back to the junction line
204240
- const spiralARefLength = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_22__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.createRadians(0), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.createRadians(spiralTurnRadians), referenceLength, undefined, frameA);
204244
+ const spiralARefLength = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(0), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(spiralTurnRadians), referenceLength, undefined, frameA);
204241
204245
  if (spiralARefLength) {
204242
204246
  const midPlanePerpendicularRadians = radiansAB + spiralTurnRadians;
204243
- const midPlanePerpendicularVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createPolar(1.0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.createRadians(midPlanePerpendicularRadians));
204247
+ const midPlanePerpendicularVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createPolar(1.0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(midPlanePerpendicularRadians));
204244
204248
  const altitudeB = midPlanePerpendicularVector.dotProductStartEnd(startPoint, shoulderPoint);
204245
204249
  const altitudeSpiralEnd = midPlanePerpendicularVector.dotProductStartEnd(startPoint, spiralARefLength.endPoint());
204246
204250
  const scaleFactor = altitudeB / altitudeSpiralEnd;
204247
- const spiralA = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_22__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.createRadians(0), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.createRadians(spiralTurnRadians), referenceLength * scaleFactor, undefined, frameA);
204251
+ const spiralA = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(0), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(spiralTurnRadians), referenceLength * scaleFactor, undefined, frameA);
204248
204252
  const distanceAB = vectorAB.magnitude();
204249
- const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(shoulderPoint, targetPoint);
204253
+ const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(shoulderPoint, targetPoint);
204250
204254
  vectorBC.scaleToLength(distanceAB, vectorBC);
204251
204255
  const pointC = shoulderPoint.plus(vectorBC);
204252
- const axesC = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_16__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.createRadians(radiansBC + Math.PI));
204253
- const frameC = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createRefs(pointC, axesC);
204254
- const spiralC = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_22__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, -spiralA.radius01.x1, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.zero(), undefined, spiralA.curveLength(), _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_23__.Segment1d.create(1, 0), frameC);
204256
+ const axesC = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_17__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(radiansBC + Math.PI));
204257
+ const frameC = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createRefs(pointC, axesC);
204258
+ const spiralC = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, -spiralA.radius01.x1, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.zero(), undefined, spiralA.curveLength(), _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_24__.Segment1d.create(1, 0), frameC);
204255
204259
  return [spiralA, spiralC];
204256
204260
  }
204257
204261
  return undefined;
@@ -204267,14 +204271,14 @@ class CurveFactory {
204267
204271
  * @return array with the computed spirals, or undefined if failure.
204268
204272
  */
204269
204273
  static createLineSpiralSpiralLineWithSpiralLength(spiralType, pointA, pointB, pointC, spiralLength) {
204270
- const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(pointA, pointB);
204271
- const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(pointB, pointC);
204274
+ const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(pointA, pointB);
204275
+ const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(pointB, pointC);
204272
204276
  const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);
204273
204277
  const lineTurnAngle = vectorAB.angleToXY(vectorBC);
204274
204278
  const spiralTurnRadians = 0.5 * lineTurnAngle.radians;
204275
204279
  const bisectorRadians = 0.5 * (Math.PI - lineTurnAngle.radians);
204276
204280
  const radiansCB = Math.atan2(-vectorBC.y, -vectorBC.x);
204277
- const spiralAB0 = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_22__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.zero(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.createRadians(spiralTurnRadians), spiralLength, undefined, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createIdentity());
204281
+ const spiralAB0 = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.zero(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(spiralTurnRadians), spiralLength, undefined, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createIdentity());
204278
204282
  if (spiralAB0) {
204279
204283
  const localEndPoint = spiralAB0.fractionToPoint(1);
204280
204284
  const distanceAB = pointA.distance(pointB);
@@ -204282,17 +204286,17 @@ class CurveFactory {
204282
204286
  // The spiral eventually has to end on the bisector, at localEndPoint.y height from the inbound line
204283
204287
  // distance from shoulder to projection of that point to point E on the inbound line is
204284
204288
  const distanceBE = localEndPoint.y / Math.tan(bisectorRadians);
204285
- const xFractionAB = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(distanceAB - distanceBE - localEndPoint.x, distanceAB);
204286
- const xFractionCB = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(distanceCB - distanceBE - localEndPoint.x, distanceCB);
204289
+ const xFractionAB = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.conditionalDivideFraction(distanceAB - distanceBE - localEndPoint.x, distanceAB);
204290
+ const xFractionCB = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.conditionalDivideFraction(distanceCB - distanceBE - localEndPoint.x, distanceCB);
204287
204291
  if (xFractionAB !== undefined && xFractionCB !== undefined) {
204288
- const axesA = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_16__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.createRadians(radiansAB));
204292
+ const axesA = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_17__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(radiansAB));
204289
204293
  const frameAOrigin = pointA.interpolate(xFractionAB, pointB);
204290
- const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createRefs(frameAOrigin, axesA);
204291
- const spiralAB = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_22__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.zero(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.createRadians(spiralTurnRadians), spiralLength, undefined, frameA);
204292
- const axesB = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_16__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.createRadians(radiansCB));
204294
+ const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createRefs(frameAOrigin, axesA);
204295
+ const spiralAB = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.zero(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(spiralTurnRadians), spiralLength, undefined, frameA);
204296
+ const axesB = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_17__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(radiansCB));
204293
204297
  const frameBOrigin = pointC.interpolate(xFractionCB, pointB);
204294
- const frameB = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createRefs(frameBOrigin, axesB);
204295
- const spiralBC = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_22__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.zero(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.createRadians(-spiralTurnRadians), spiralLength, undefined, frameB);
204298
+ const frameB = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createRefs(frameBOrigin, axesB);
204299
+ const spiralBC = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.zero(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(-spiralTurnRadians), spiralLength, undefined, frameB);
204296
204300
  return [spiralAB, spiralBC];
204297
204301
  }
204298
204302
  }
@@ -204309,9 +204313,9 @@ class CurveFactory {
204309
204313
  * @return array with the computed spirals, or undefined if failure.
204310
204314
  */
204311
204315
  static createLineSpiralArcSpiralLine(spiralType, pointA, pointB, pointC, lengthA, lengthB, arcRadius) {
204312
- const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(pointA, pointB);
204316
+ const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(pointA, pointB);
204313
204317
  vectorAB.z = 0;
204314
- const vectorCB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(pointC, pointB);
204318
+ const vectorCB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(pointC, pointB);
204315
204319
  vectorCB.z = 0;
204316
204320
  const unitAB = vectorAB.normalize();
204317
204321
  const unitCB = vectorCB.normalize();
@@ -204320,12 +204324,12 @@ class CurveFactory {
204320
204324
  const unitPerpAB = unitAB.unitPerpendicularXY();
204321
204325
  const unitPerpCB = unitCB.unitPerpendicularXY();
204322
204326
  const thetaABC = vectorAB.angleToXY(vectorCB);
204323
- const sideA = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.split3WaySign(thetaABC.radians, 1, -1, -1);
204327
+ const sideA = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.split3WaySign(thetaABC.radians, 1, -1, -1);
204324
204328
  const sideB = -sideA;
204325
204329
  const radiusA = sideA * Math.abs(arcRadius);
204326
204330
  const radiusB = sideB * Math.abs(arcRadius);
204327
- const spiralA = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_22__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, radiusA, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.zero(), undefined, lengthA, undefined, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createIdentity());
204328
- const spiralB = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_22__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, radiusB, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_21__.Angle.zero(), undefined, lengthB, undefined, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createIdentity());
204331
+ const spiralA = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, radiusA, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.zero(), undefined, lengthA, undefined, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createIdentity());
204332
+ const spiralB = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, radiusB, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.zero(), undefined, lengthB, undefined, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createIdentity());
204329
204333
  const spiralEndA = spiralA.fractionToPointAndUnitTangent(1.0);
204330
204334
  const spiralEndB = spiralB.fractionToPointAndUnitTangent(1.0);
204331
204335
  // From the end of spiral, step away to arc center (and this is in local coordinates of each spiral)
@@ -204334,14 +204338,14 @@ class CurveFactory {
204334
204338
  const sB = spiralEndB.origin.x - radiusB * spiralEndB.direction.y;
204335
204339
  const tB = spiralEndB.origin.y + radiusB * spiralEndB.direction.x;
204336
204340
  // Those local coordinates are rotated to unitAB and unitBC ...
204337
- const vectorA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createAdd2Scaled(unitAB, sA, unitPerpAB, tA);
204338
- const vectorB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createAdd2Scaled(unitCB, sB, unitPerpCB, tB);
204339
- const uv = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_24__.Vector2d.create();
204340
- if (_numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_25__.SmallSystem.linearSystem2d(unitAB.x, -unitCB.x, unitAB.y, -unitCB.y, vectorB.x - vectorA.x, vectorB.y - vectorA.y, uv)) {
204341
+ const vectorA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createAdd2Scaled(unitAB, sA, unitPerpAB, tA);
204342
+ const vectorB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createAdd2Scaled(unitCB, sB, unitPerpCB, tB);
204343
+ const uv = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_25__.Vector2d.create();
204344
+ if (_numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_26__.SmallSystem.linearSystem2d(unitAB.x, -unitCB.x, unitAB.y, -unitCB.y, vectorB.x - vectorA.x, vectorB.y - vectorA.y, uv)) {
204341
204345
  const tangencyAB = pointB.plusScaled(unitAB, uv.x);
204342
204346
  const tangencyCB = pointB.plusScaled(unitCB, uv.y);
204343
- const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createOriginAndMatrixColumns(tangencyAB, unitAB, unitPerpAB, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.unitZ());
204344
- const frameB = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createOriginAndMatrixColumns(tangencyCB, unitCB, unitPerpCB, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.unitZ());
204347
+ const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createOriginAndMatrixColumns(tangencyAB, unitAB, unitPerpAB, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.unitZ());
204348
+ const frameB = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createOriginAndMatrixColumns(tangencyCB, unitCB, unitPerpCB, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.unitZ());
204345
204349
  spiralA.tryTransformInPlace(frameA);
204346
204350
  spiralB.tryTransformInPlace(frameB);
204347
204351
  const rayA1 = spiralA.fractionToPointAndUnitTangent(1.0);
@@ -204365,12 +204369,12 @@ class CurveFactory {
204365
204369
  const normalBx = planeB.normalX();
204366
204370
  const normalBy = planeB.normalY();
204367
204371
  const normalBz = planeB.normalZ();
204368
- const normalCx = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.crossProductXYXY(normalAy, normalAz, normalBy, normalBz);
204369
- const normalCy = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.crossProductXYXY(normalAz, normalAx, normalBz, normalBx);
204370
- const normalCz = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.crossProductXYXY(normalAx, normalAy, normalBx, normalBy);
204371
- const rayOrigin = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_25__.SmallSystem.linearSystem3d(normalAx, normalAy, normalAz, normalBx, normalBy, normalBz, normalCx, normalCy, normalCz, -altitudeA, -altitudeB, 0.0);
204372
+ const normalCx = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.crossProductXYXY(normalAy, normalAz, normalBy, normalBz);
204373
+ const normalCy = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.crossProductXYXY(normalAz, normalAx, normalBz, normalBx);
204374
+ const normalCz = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.crossProductXYXY(normalAx, normalAy, normalBx, normalBy);
204375
+ const rayOrigin = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_26__.SmallSystem.linearSystem3d(normalAx, normalAy, normalAz, normalBx, normalBy, normalBz, normalCx, normalCy, normalCz, -altitudeA, -altitudeB, 0.0);
204372
204376
  if (rayOrigin !== undefined) {
204373
- return _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_15__.Ray3d.createXYZUVW(rayOrigin.x, rayOrigin.y, rayOrigin.z, normalCx, normalCy, normalCz);
204377
+ return _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_16__.Ray3d.createXYZUVW(rayOrigin.x, rayOrigin.y, rayOrigin.z, normalCx, normalCy, normalCz);
204374
204378
  }
204375
204379
  return undefined;
204376
204380
  }
@@ -227185,42 +227189,38 @@ __webpack_require__.r(__webpack_exports__);
227185
227189
 
227186
227190
 
227187
227191
 
227188
- /** `GrowableXYArray` manages a (possibly growing) Float64Array to pack xy coordinates.
227192
+ /**
227193
+ * `GrowableXYArray` manages a (possibly growing) Float64Array to pack xy coordinates.
227189
227194
  * @public
227190
227195
  */
227191
- class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.IndexedXYCollection {
227192
- /**
227193
- * array of packed xy xy xy components
227194
- */
227196
+ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.IndexedReadWriteXYCollection {
227197
+ /** Array of packed xy xy xy components. */
227195
227198
  _data;
227196
- /**
227197
- * Number of xy tuples (not floats) in the array
227198
- */
227199
+ /** Number of xy tuples (not floats) in the array. */
227199
227200
  _xyInUse;
227200
- /**
227201
- * capacity in xy tuples. (not floats)
227202
- */
227201
+ /** Capacity in xy tuples. (not floats). */
227203
227202
  _xyCapacity;
227204
- /**
227205
- * multiplier used by ensureCapacity to expand requested reallocation size
227206
- */
227203
+ /** Multiplier used by ensureCapacity to expand requested reallocation size. */
227207
227204
  _growthFactor;
227208
- /** Construct a new GrowablePoint2d array.
227209
- * @param numPoints initial capacity in xy tuples (default 8)
227210
- * @param growthFactor used by ensureCapacity to expand requested reallocation size (default 1.5)
227205
+ /**
227206
+ * Construct a new GrowablePoint2d array.
227207
+ * @param numPoints initial capacity in xy tuples (default 8).
227208
+ * @param growthFactor used by ensureCapacity to expand requested reallocation size (default 1.5).
227209
+ * @param data optional pre-existing Float64Array to use as the backing memory. If supplied, numPoints is ignored.
227211
227210
  */
227212
- constructor(numPoints = 8, growthFactor) {
227211
+ constructor(numPoints = 8, growthFactor, data) {
227213
227212
  super();
227214
- this._data = new Float64Array(numPoints * 2); // 2 values per point
227213
+ this._data = data || new Float64Array(numPoints * 2); // 2 values per point
227215
227214
  this._xyInUse = 0;
227216
- this._xyCapacity = numPoints;
227215
+ this._xyCapacity = data ? data.length / 2 : numPoints;
227217
227216
  this._growthFactor = (undefined !== growthFactor && growthFactor >= 1.0) ? growthFactor : 1.5;
227218
227217
  }
227219
- /** Copy xy points from source array. Does not reallocate or change active point count.
227220
- * @param source array to copy from
227221
- * @param sourceCount copy the first sourceCount points; all points if undefined
227222
- * @param destOffset copy to instance array starting at this point index; zero if undefined
227223
- * @return count and offset of points copied
227218
+ /**
227219
+ * Copy xy points from source array. Does not reallocate or change active point count.
227220
+ * @param source array to copy from.
227221
+ * @param sourceCount copy the first sourceCount points; all points if undefined.
227222
+ * @param destOffset copy to instance array starting at this point index; zero if undefined.
227223
+ * @return count and offset of points copied.
227224
227224
  */
227225
227225
  copyData(source, sourceCount, destOffset) {
227226
227226
  // validate inputs and convert from points to entries
@@ -227249,30 +227249,45 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227249
227249
  return { count: myCount / 2, offset: myOffset / 2 };
227250
227250
  }
227251
227251
  /** The number of points in use. When the length is increased, the array is padded with zeroes. */
227252
- get length() { return this._xyInUse; }
227253
- set length(newLength) { this.resize(newLength, true); }
227252
+ get length() {
227253
+ return this._xyInUse;
227254
+ }
227255
+ set length(newLength) {
227256
+ this.resize(newLength, true);
227257
+ }
227254
227258
  /** Return the number of float64 in use. */
227255
- get float64Length() { return this._xyInUse * 2; }
227256
- /** Return the raw packed data.
227259
+ get float64Length() {
227260
+ return this._xyInUse * 2;
227261
+ }
227262
+ /**
227263
+ * Return the raw packed data.
227257
227264
  * * Note that the length of the returned Float64Array is a count of doubles, and includes the excess capacity
227258
227265
  */
227259
- float64Data() { return this._data; }
227260
- /** If necessary, increase the capacity to a new pointCount. Current coordinates and point count (length) are unchanged. */
227266
+ float64Data() {
227267
+ return this._data;
227268
+ }
227269
+ /** If necessary, increase the capacity to a new pointCount. Current coordinates and point count (length) are unchanged. */
227261
227270
  ensureCapacity(pointCapacity, applyGrowthFactor = true) {
227262
227271
  if (pointCapacity > this._xyCapacity) {
227263
227272
  if (applyGrowthFactor)
227264
- pointCapacity *= this._growthFactor;
227273
+ pointCapacity = Math.trunc(pointCapacity * this._growthFactor);
227265
227274
  const prevData = this._data;
227266
- this._data = new Float64Array(pointCapacity * 2);
227275
+ if (this._data.buffer instanceof ArrayBuffer)
227276
+ this._data = new Float64Array(new ArrayBuffer(pointCapacity * 2 * this._data.BYTES_PER_ELEMENT));
227277
+ else
227278
+ this._data = new Float64Array(new SharedArrayBuffer(pointCapacity * 2 * this._data.BYTES_PER_ELEMENT));
227267
227279
  this.copyData(prevData, this._xyInUse);
227268
227280
  this._xyCapacity = pointCapacity;
227269
227281
  }
227270
227282
  }
227271
227283
  /**
227272
- * * If pointCount is less than current length, just reset current length to pointCount, effectively trimming active points but preserving original capacity.
227273
- * * If pointCount is greater than current length, reallocate to exactly pointCount, copy existing points, and optionally pad excess with zero.
227274
- * @param pointCount new number of active points in array
227275
- * @param padWithZero when increasing point count, whether to zero out new points (default false)
227284
+ * Resize the internal storage to hold a new number of points.
227285
+ * * If pointCount is less than current length, just reset current length to pointCount, effectively trimming active
227286
+ * points but preserving original capacity.
227287
+ * * If pointCount is greater than current length, reallocate to exactly pointCount, copy existing points, and
227288
+ * optionally pad excess with zero.
227289
+ * @param pointCount new number of active points in array.
227290
+ * @param padWithZero when increasing point count, whether to zero out new points (default false).
227276
227291
  */
227277
227292
  resize(pointCount, padWithZero) {
227278
227293
  if (pointCount >= 0 && pointCount < this._xyInUse)
@@ -227284,10 +227299,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227284
227299
  this._xyInUse = pointCount;
227285
227300
  }
227286
227301
  }
227287
- /**
227288
- * Make a copy of the (active) points in this array.
227289
- * (The clone does NOT get excess capacity)
227290
- */
227302
+ /** Make a copy of the (active) points in this array (the clone does NOT get excess capacity). */
227291
227303
  clone() {
227292
227304
  const newPoints = new GrowableXYArray(this.length);
227293
227305
  newPoints.copyData(this._data, this.length);
@@ -227305,7 +227317,9 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227305
227317
  * * A GrowableXYArray
227306
227318
  * * Any json object satisfying Point3d.isXAndY
227307
227319
  * * A Float64Array of doubles, interpreted as xyxy
227308
- * * An array of any of the above
227320
+ * * An array of any of the above.
227321
+ * @param data source points.
227322
+ * @param result optional pre-allocated GrowableXYArray to clear and fill.
227309
227323
  */
227310
227324
  static create(data, result) {
227311
227325
  if (result) {
@@ -227318,23 +227332,32 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227318
227332
  result.pushFrom(data);
227319
227333
  return result;
227320
227334
  }
227321
- /** Restructure MultiLineStringDataVariant as array of GrowableXYZArray
227335
+ /**
227336
+ * Create a new GrowableXYArray capturing the provided data. The data is not copied, just referenced.
227337
+ * @param data source data to capture.
227338
+ * @returns a new GrowableXYArray object that references the provided data.
227339
+ */
227340
+ static createCapture(data) {
227341
+ return new GrowableXYArray(0, undefined, data);
227342
+ }
227343
+ /**
227344
+ * Restructure MultiLineStringDataVariant as array of GrowableXYZArray
227322
227345
  * @deprecated in 4.2.0 - will not be removed until after 2026-06-13. Moved to GrowableXYZArray class.
227323
227346
  */
227324
227347
  static createArrayOfGrowableXYZArray(data) {
227325
227348
  return _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_1__.GrowableXYZArray.createArrayOfGrowableXYZArray(data);
227326
227349
  }
227327
- /** push a point to the end of the array */
227350
+ /** Push a point to the end of the array. */
227328
227351
  push(toPush) {
227329
227352
  this.pushXY(toPush.x, toPush.y);
227330
227353
  }
227331
- /** push all points of an array */
227354
+ /** Push all points of an array. */
227332
227355
  pushAll(points) {
227333
227356
  this.ensureCapacity(this._xyInUse + points.length, false);
227334
227357
  for (const p of points)
227335
227358
  this.push(p);
227336
227359
  }
227337
- /** push all points of an array */
227360
+ /** Push all points of an array. */
227338
227361
  pushAllXYAndZ(points) {
227339
227362
  this.ensureCapacity(this._xyInUse + points.length, false);
227340
227363
  if (points instanceof _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_1__.GrowableXYZArray) {
@@ -227348,7 +227371,8 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227348
227371
  this.pushXY(p.x, p.y);
227349
227372
  }
227350
227373
  }
227351
- /** Push copies of points from variant sources.
227374
+ /**
227375
+ * Push copies of points from variant sources.
227352
227376
  * Valid inputs are:
227353
227377
  * * Point2d
227354
227378
  * * Point3d
@@ -227357,7 +227381,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227357
227381
  * * A GrowableXYZArray
227358
227382
  * * Any json object satisfying Point3d.isXAndY
227359
227383
  * * A Float64Array of doubles, interpreted as xyxy
227360
- * * An array of any of the above
227384
+ * * An array of any of the above.
227361
227385
  */
227362
227386
  pushFrom(p) {
227363
227387
  if (p instanceof _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d) {
@@ -227379,7 +227403,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227379
227403
  this.pushXY(p[0], p[1]);
227380
227404
  }
227381
227405
  else if (Array.isArray(p)) {
227382
- // direct recursion re-wraps p and goes infinite. Unroll here.
227406
+ // direct recursion re-wraps p and goes infinite; unroll here.
227383
227407
  for (const q of p)
227384
227408
  this.pushFrom(q);
227385
227409
  }
@@ -227395,7 +227419,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227395
227419
  }
227396
227420
  /**
227397
227421
  * Replicate numWrap xy values from the front of the array as new values at the end.
227398
- * @param numWrap number of xy values to replicate
227422
+ * @param numWrap number of xy values to replicate.
227399
227423
  */
227400
227424
  pushWrap(numWrap) {
227401
227425
  if (this._xyInUse >= numWrap) {
@@ -227414,16 +227438,17 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227414
227438
  this._data[index + 1] = y;
227415
227439
  this._xyInUse++;
227416
227440
  }
227417
- /** Remove one point from the back.
227441
+ /**
227442
+ * Remove one point from the back.
227418
227443
  * * NOTE that (in the manner of std::vector native) this is "just" removing the point -- no point is NOT returned.
227419
- * * Use `back ()` to get the last x,y assembled into a `Point2d `
227444
+ * * Use `back ()` to get the last x,y assembled into a `Point2d`.
227420
227445
  */
227421
227446
  pop() {
227422
227447
  if (this._xyInUse > 0)
227423
227448
  this._xyInUse--;
227424
227449
  }
227425
227450
  /**
227426
- * Test if index is valid for an xy (point or vector) within this array
227451
+ * Test if index is valid for an xy (point or vector) within this array.
227427
227452
  * @param index xy index to test.
227428
227453
  */
227429
227454
  isIndexValid(index) {
@@ -227431,38 +227456,34 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227431
227456
  return false;
227432
227457
  return true;
227433
227458
  }
227434
- /**
227435
- * Clear all xy data, but leave capacity unchanged.
227436
- */
227459
+ /** Clear all xy data, but leave capacity unchanged. */
227437
227460
  clear() {
227438
227461
  this._xyInUse = 0;
227439
227462
  }
227440
227463
  /**
227441
- * Get a point by index, strongly typed as a Point2d. This is unchecked. Use atPoint2dIndex to have validity test.
227442
- * @param pointIndex index to access
227443
- * @param result optional result
227464
+ * Get a point by index, strongly typed as a `Point2d`. This is unchecked. Use atPoint2dIndex to have validity test.
227465
+ * @param pointIndex index to access.
227466
+ * @param result optional result.
227444
227467
  */
227445
227468
  getPoint2dAtUncheckedPointIndex(pointIndex, result) {
227446
227469
  const index = 2 * pointIndex;
227447
227470
  return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Point2d.create(this._data[index], this._data[index + 1], result);
227448
227471
  }
227449
227472
  /**
227450
- * Get x coordinate by point index, with no index checking
227451
- * @param pointIndex index to access
227473
+ * Get x coordinate by point index, with no index checking.
227474
+ * @param pointIndex index to access.
227452
227475
  */
227453
227476
  getXAtUncheckedPointIndex(pointIndex) {
227454
227477
  return this._data[2 * pointIndex];
227455
227478
  }
227456
227479
  /**
227457
- * Get y coordinate by point index, with no index checking
227458
- * @param pointIndex index to access
227480
+ * Get y coordinate by point index, with no index checking.
227481
+ * @param pointIndex index to access.
227459
227482
  */
227460
227483
  getYAtUncheckedPointIndex(pointIndex) {
227461
227484
  return this._data[2 * pointIndex + 1];
227462
227485
  }
227463
- /**
227464
- * Gather all points as a Point2d[]
227465
- */
227486
+ /** Gather all points as a Point2d[]. */
227466
227487
  getPoint2dArray() {
227467
227488
  const n = 2 * this._xyInUse;
227468
227489
  const result = [];
@@ -227471,7 +227492,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227471
227492
  result.push(_Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Point2d.create(data[i], data[i + 1]));
227472
227493
  return result;
227473
227494
  }
227474
- /** copy xy into strongly typed Point2d */
227495
+ /** Copy xy into strongly typed Point2d. */
227475
227496
  getPoint2dAtCheckedPointIndex(pointIndex, result) {
227476
227497
  if (this.isIndexValid(pointIndex)) {
227477
227498
  const index = 2 * pointIndex;
@@ -227479,7 +227500,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227479
227500
  }
227480
227501
  return undefined;
227481
227502
  }
227482
- /** copy xy into strongly typed Vector2d */
227503
+ /** Copy xy into strongly typed Vector2d. */
227483
227504
  getVector2dAtCheckedVectorIndex(vectorIndex, result) {
227484
227505
  if (this.isIndexValid(vectorIndex)) {
227485
227506
  const index = 2 * vectorIndex;
@@ -227489,9 +227510,9 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227489
227510
  }
227490
227511
  /**
227491
227512
  * Read coordinates from source array, place them at index within this array.
227492
- * @param destIndex point index where coordinates are to be placed in this array
227493
- * @param source source array
227494
- * @param sourceIndex point index in source array
227513
+ * @param destIndex point index where coordinates are to be placed in this array.
227514
+ * @param source source array.
227515
+ * @param sourceIndex point index in source array.
227495
227516
  * @returns true if destIndex and sourceIndex are both valid.
227496
227517
  */
227497
227518
  transferFromGrowableXYArray(destIndex, source, sourceIndex) {
@@ -227505,13 +227526,13 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227505
227526
  return false;
227506
227527
  }
227507
227528
  /**
227508
- * push coordinates from the source array to the end of this array.
227509
- * @param source source array
227510
- * @param sourceIndex xy index within the source. If undefined, push entire contents of source
227529
+ * Push coordinates from the source array to the end of this array.
227530
+ * @param source source array.
227531
+ * @param sourceIndex xy index within the source. If undefined, push entire contents of source.
227511
227532
  * @returns number of points pushed.
227512
227533
  */
227513
227534
  pushFromGrowableXYArray(source, sourceIndex) {
227514
- // full array push . . .
227535
+ // full array push
227515
227536
  if (sourceIndex === undefined) {
227516
227537
  const numXYAdd = source.length;
227517
227538
  this.ensureCapacity(this.length + numXYAdd, false);
@@ -227519,7 +227540,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227519
227540
  this._xyInUse += numXYAdd;
227520
227541
  return numXYAdd;
227521
227542
  }
227522
- // single point push . . .
227543
+ // single point push
227523
227544
  if (source.isIndexValid(sourceIndex)) {
227524
227545
  const j = sourceIndex * 2;
227525
227546
  this.pushXY(source._data[j], source._data[j + 1]);
@@ -227528,8 +227549,8 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227528
227549
  return 0;
227529
227550
  }
227530
227551
  /**
227531
- * * Compute a point at fractional coordinate between points i and j of source
227532
- * * push onto this array.
227552
+ * * Compute a point at fractional coordinate between points i and j of source.
227553
+ * * Push onto this array.
227533
227554
  */
227534
227555
  pushInterpolatedFromGrowableXYArray(source, i, fraction, j) {
227535
227556
  if (source.isIndexValid(i) && source.isIndexValid(j)) {
@@ -227542,7 +227563,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227542
227563
  }
227543
227564
  /**
227544
227565
  * Create an array of xy points from source xyz points.
227545
- * @param source source array of xyz
227566
+ * @param source source array of xyz.
227546
227567
  * @param transform optional transform to apply to xyz points.
227547
227568
  * @param dest optional result.
227548
227569
  */
@@ -227570,17 +227591,13 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227570
227591
  }
227571
227592
  return dest;
227572
227593
  }
227573
- /**
227574
- * Return the first point, or undefined if the array is empty.
227575
- */
227594
+ /** Return the first point, or undefined if the array is empty. */
227576
227595
  front(result) {
227577
227596
  if (this._xyInUse === 0)
227578
227597
  return undefined;
227579
227598
  return this.getPoint2dAtUncheckedPointIndex(0, result);
227580
227599
  }
227581
- /**
227582
- * Return the last point, or undefined if the array is empty.
227583
- */
227600
+ /** Return the last point, or undefined if the array is empty. */
227584
227601
  back(result) {
227585
227602
  if (this._xyInUse < 1)
227586
227603
  return undefined;
@@ -227588,8 +227605,8 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227588
227605
  }
227589
227606
  /**
227590
227607
  * Set the coordinates of a single point.
227591
- * @param pointIndex index of point to set
227592
- * @param value coordinates to set
227608
+ * @param pointIndex index of point to set.
227609
+ * @param value coordinates to set.
227593
227610
  */
227594
227611
  setAtCheckedPointIndex(pointIndex, value) {
227595
227612
  if (!this.isIndexValid(pointIndex))
@@ -227601,9 +227618,9 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227601
227618
  }
227602
227619
  /**
227603
227620
  * Set the coordinates of a single point given as coordinates.
227604
- * @param pointIndex index of point to set
227605
- * @param x x coordinate
227606
- * @param y y coordinate
227621
+ * @param pointIndex index of point to set.
227622
+ * @param x x coordinate.
227623
+ * @param y y coordinate.
227607
227624
  */
227608
227625
  setXYAtCheckedPointIndex(pointIndex, x, y) {
227609
227626
  if (!this.isIndexValid(pointIndex))
@@ -227613,9 +227630,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227613
227630
  this._data[index + 1] = y;
227614
227631
  return true;
227615
227632
  }
227616
- /**
227617
- * Copy all points into a simple array of Point3d with given z.
227618
- */
227633
+ /** Copy all points into a simple array of Point3d with given z. */
227619
227634
  getPoint3dArray(z = 0) {
227620
227635
  const n = 2 * this._xyInUse;
227621
227636
  const result = [];
@@ -227624,7 +227639,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227624
227639
  result.push(_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(data[i], data[i + 1], z));
227625
227640
  return result;
227626
227641
  }
227627
- /** reverse the order of points. */
227642
+ /** Reverse the order of points. */
227628
227643
  reverseInPlace() {
227629
227644
  const n = this.length;
227630
227645
  let j0, j1;
@@ -227643,7 +227658,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227643
227658
  data[j1] = a;
227644
227659
  }
227645
227660
  }
227646
- /** multiply each point by the transform, replace values. */
227661
+ /** Multiply each point by the transform, replace values. */
227647
227662
  multiplyTransformInPlace(transform) {
227648
227663
  const data = this._data;
227649
227664
  const nDouble = this.float64Length;
@@ -227660,7 +227675,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227660
227675
  data[i + 1] = coffs[3] * x + coffs[4] * y + y0;
227661
227676
  }
227662
227677
  }
227663
- /** multiply each xy (as a vector) by matrix, replace values. */
227678
+ /** Multiply each xy (as a vector) by matrix, replace values. */
227664
227679
  multiplyMatrix3dInPlace(matrix) {
227665
227680
  const data = this._data;
227666
227681
  const nDouble = this.float64Length;
@@ -227674,7 +227689,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227674
227689
  data[i + 1] = coffs[3] * x + coffs[4] * y;
227675
227690
  }
227676
227691
  }
227677
- /** multiply each point by the transform, replace values. */
227692
+ /** Multiply each point by the transform, replace values. */
227678
227693
  tryTransformInverseInPlace(transform) {
227679
227694
  const data = this._data;
227680
227695
  const nDouble = this.float64Length;
@@ -227709,7 +227724,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227709
227724
  rangeToExtend.extendXY(data[i], data[i + 1]);
227710
227725
  }
227711
227726
  }
227712
- /** sum the lengths of segments between points. */
227727
+ /** Sum the lengths of segments between points. */
227713
227728
  sumLengths() {
227714
227729
  let sum = 0.0;
227715
227730
  const n = 2 * (this._xyInUse - 1); // Length already takes into account what specifically is in use
@@ -227720,7 +227735,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227720
227735
  }
227721
227736
  /**
227722
227737
  * Multiply each x,y by the scale factor.
227723
- * @param factor
227738
+ * @param factor scale factor.
227724
227739
  */
227725
227740
  scaleInPlace(factor) {
227726
227741
  if (this._data) {
@@ -227729,7 +227744,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227729
227744
  this._data[i] = this._data[i] * factor;
227730
227745
  }
227731
227746
  }
227732
- /** Compute a point at fractional coordinate between points i and j */
227747
+ /** Compute a point at fractional coordinate between points i and j. */
227733
227748
  interpolate(i, fraction, j, result) {
227734
227749
  if (this.isIndexValid(i) && this.isIndexValid(j)) {
227735
227750
  const fraction0 = 1.0 - fraction;
@@ -227740,10 +227755,10 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227740
227755
  }
227741
227756
  return undefined;
227742
227757
  }
227743
- /** Sum the signed areas of the projection to xy plane */
227758
+ /** Sum the signed areas of the projection to xy plane. */
227744
227759
  areaXY() {
227745
227760
  let area = 0.0;
227746
- const n = 2 * this._xyInUse; // float count !!
227761
+ const n = 2 * this._xyInUse; // float count
227747
227762
  if (n > 4) {
227748
227763
  const x0 = this._data[n - 2];
227749
227764
  const y0 = this._data[n - 1];
@@ -227759,7 +227774,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227759
227774
  }
227760
227775
  return 0.5 * area;
227761
227776
  }
227762
- /** Compute a vector from index origin i to indexed target j */
227777
+ /** Compute a vector from index origin i to indexed target j. */
227763
227778
  vectorIndexIndex(i, j, result) {
227764
227779
  if (!this.isIndexValid(i) || !this.isIndexValid(j))
227765
227780
  return undefined;
@@ -227768,7 +227783,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227768
227783
  j = 2 * j;
227769
227784
  return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Vector2d.create(data[j] - data[i], data[j + 1] - data[i + 1], result);
227770
227785
  }
227771
- /** Compute a vector from origin to indexed target j */
227786
+ /** Compute a vector from origin to indexed target j. */
227772
227787
  vectorXAndYIndex(origin, j, result) {
227773
227788
  if (this.isIndexValid(j)) {
227774
227789
  const data = this._data;
@@ -227777,7 +227792,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227777
227792
  }
227778
227793
  return undefined;
227779
227794
  }
227780
- /** Compute the cross product of vectors from from indexed origin to indexed targets i and j */
227795
+ /** Compute the cross product of vectors from from indexed origin to indexed targets i and j. */
227781
227796
  crossProductIndexIndexIndex(originIndex, targetAIndex, targetBIndex) {
227782
227797
  if (this.isIndexValid(originIndex) && this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {
227783
227798
  const i = originIndex * 2;
@@ -227788,7 +227803,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227788
227803
  }
227789
227804
  return undefined;
227790
227805
  }
227791
- /** Compute the cross product of vectors from from origin to indexed targets i and j */
227806
+ /** Compute the cross product of vectors from from origin to indexed targets i and j. */
227792
227807
  crossProductXAndYIndexIndex(origin, targetAIndex, targetBIndex) {
227793
227808
  if (this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {
227794
227809
  const j = targetAIndex * 2;
@@ -227828,7 +227843,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227828
227843
  // if both are null it is equal, otherwise unequal
227829
227844
  return (!dataA && !dataB);
227830
227845
  }
227831
- /** Return an array of block indices sorted per compareLexicalBlock function */
227846
+ /** Return an array of block indices sorted per compareLexicalBlock function. */
227832
227847
  sortIndicesLexical() {
227833
227848
  const n = this._xyInUse;
227834
227849
  // let numCompare = 0;
@@ -227854,13 +227869,13 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
227854
227869
  if (ax < bx)
227855
227870
  return -1;
227856
227871
  }
227857
- return ia - ib; // so original order is maintained among duplicates !!!!
227872
+ return ia - ib; // so original order is maintained among duplicates
227858
227873
  }
227859
- /** Access a single double at offset within a block. This has no index checking. */
227874
+ /** Access a single double at offset within a block. This has no index checking. */
227860
227875
  component(pointIndex, componentIndex) {
227861
227876
  return this._data[2 * pointIndex + componentIndex];
227862
227877
  }
227863
- /** Toleranced equality test */
227878
+ /** Toleranced equality test. */
227864
227879
  isAlmostEqual(other, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.smallMetricDistance) {
227865
227880
  const numXY = this._xyInUse;
227866
227881
  if (other._xyInUse !== numXY)
@@ -227910,42 +227925,38 @@ __webpack_require__.r(__webpack_exports__);
227910
227925
 
227911
227926
 
227912
227927
 
227913
- /** `GrowableXYArray` manages a (possibly growing) Float64Array to pack xy coordinates.
227928
+ /**
227929
+ * `GrowableXYZArray` manages a (possibly growing) Float64Array to pack xyz coordinates.
227914
227930
  * @public
227915
227931
  */
227916
227932
  class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0__.IndexedReadWriteXYZCollection {
227917
- /**
227918
- * array of packed xyz xyz xyz components
227919
- */
227933
+ /** Array of packed xyz xyz xyz components. */
227920
227934
  _data;
227921
- /**
227922
- * Number of xyz triples (not floats) in the array
227923
- */
227935
+ /** Number of xyz triples (not floats) in the array. */
227924
227936
  _xyzInUse;
227925
- /**
227926
- * capacity in xyz triples. (not floats)
227927
- */
227937
+ /** Capacity in xyz triples (not floats). */
227928
227938
  _xyzCapacity;
227929
- /**
227930
- * multiplier used by ensureCapacity to expand requested reallocation size
227931
- */
227939
+ /** Multiplier used by ensureCapacity to expand requested reallocation size. */
227932
227940
  _growthFactor;
227933
- /** Construct a new GrowablePoint3d array.
227934
- * @param numPoints initial capacity in xyz triples (default 8)
227935
- * @param growthFactor used by ensureCapacity to expand requested reallocation size (default 1.5)
227941
+ /**
227942
+ * Construct a new GrowablePoint3d array.
227943
+ * @param numPoints initial capacity in xyz triples (default 8).
227944
+ * @param growthFactor used by ensureCapacity to expand requested reallocation size (default 1.5).
227945
+ * @param data optional pre-existing Float64Array to use as the backing memory. If supplied, numPoints is ignored.
227936
227946
  */
227937
- constructor(numPoints = 8, growthFactor) {
227947
+ constructor(numPoints = 8, growthFactor, data) {
227938
227948
  super();
227939
- this._data = new Float64Array(numPoints * 3); // 3 values per point
227949
+ this._data = data || new Float64Array(numPoints * 3); // 3 values per point
227940
227950
  this._xyzInUse = 0;
227941
- this._xyzCapacity = numPoints;
227951
+ this._xyzCapacity = data ? data.length / 3 : numPoints;
227942
227952
  this._growthFactor = (undefined !== growthFactor && growthFactor >= 1.0) ? growthFactor : 1.5;
227943
227953
  }
227944
- /** Copy xyz points from source array. Does not reallocate or change active point count.
227945
- * @param source array to copy from
227946
- * @param sourceCount copy the first sourceCount points; all points if undefined
227947
- * @param destOffset copy to instance array starting at this point index; zero if undefined
227948
- * @return count and offset of points copied
227954
+ /**
227955
+ * Copy xyz points from source array. Does not reallocate or change active point count.
227956
+ * @param source array to copy from.
227957
+ * @param sourceCount copy the first sourceCount points; all points if undefined.
227958
+ * @param destOffset copy to instance array starting at this point index; zero if undefined.
227959
+ * @return count and offset of points copied.
227949
227960
  */
227950
227961
  copyData(source, sourceCount, destOffset) {
227951
227962
  // validate inputs and convert from points to entries
@@ -227974,30 +227985,47 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
227974
227985
  return { count: myCount / 3, offset: myOffset / 3 };
227975
227986
  }
227976
227987
  /** The number of points in use. When the length is increased, the array is padded with zeroes. */
227977
- get length() { return this._xyzInUse; }
227978
- set length(newLength) { this.resize(newLength, true); }
227988
+ get length() {
227989
+ return this._xyzInUse;
227990
+ }
227991
+ set length(newLength) {
227992
+ this.resize(newLength, true);
227993
+ }
227979
227994
  /** Return the number of float64 in use. */
227980
- get float64Length() { return this._xyzInUse * 3; }
227981
- /** Return the raw packed data.
227995
+ get float64Length() {
227996
+ return this._xyzInUse * 3;
227997
+ }
227998
+ /**
227999
+ * Return the raw packed data.
227982
228000
  * * Note that the length of the returned Float64Array is a count of doubles, and includes the excess capacity
227983
228001
  */
227984
- float64Data() { return this._data; }
227985
- /** If necessary, increase the capacity to the new number of points. Current coordinates and point count (length) are unchanged. */
228002
+ float64Data() {
228003
+ return this._data;
228004
+ }
228005
+ /**
228006
+ * If necessary, increase the capacity to the new number of points. Current coordinates and point count (length) are
228007
+ * unchanged.
228008
+ */
227986
228009
  ensureCapacity(pointCapacity, applyGrowthFactor = true) {
227987
228010
  if (pointCapacity > this._xyzCapacity) {
227988
228011
  if (applyGrowthFactor)
227989
- pointCapacity *= this._growthFactor;
228012
+ pointCapacity = Math.trunc(pointCapacity * this._growthFactor);
227990
228013
  const prevData = this._data;
227991
- this._data = new Float64Array(pointCapacity * 3);
228014
+ if (this._data.buffer instanceof ArrayBuffer)
228015
+ this._data = new Float64Array(new ArrayBuffer(pointCapacity * 3 * this._data.BYTES_PER_ELEMENT));
228016
+ else
228017
+ this._data = new Float64Array(new SharedArrayBuffer(pointCapacity * 3 * this._data.BYTES_PER_ELEMENT));
227992
228018
  this.copyData(prevData, this._xyzInUse);
227993
228019
  this._xyzCapacity = pointCapacity;
227994
228020
  }
227995
228021
  }
227996
228022
  /**
227997
- * * If pointCount is less than current length, just reset current length to pointCount, effectively trimming active points but preserving original capacity.
227998
- * * If pointCount is greater than current length, reallocate to exactly pointCount, copy existing points, and optionally pad excess with zero.
227999
- * @param pointCount new number of active points in array
228000
- * @param padWithZero when increasing point count, whether to zero out new points (default false)
228023
+ * * If pointCount is less than current length, just reset current length to pointCount, effectively trimming active
228024
+ * points but preserving original capacity.
228025
+ * * If pointCount is greater than current length, reallocate to exactly pointCount, copy existing points, and
228026
+ * optionally pad excess with zero.
228027
+ * @param pointCount new number of active points in array.
228028
+ * @param padWithZero when increasing point count, whether to zero out new points (default false).
228001
228029
  */
228002
228030
  resize(pointCount, padWithZero) {
228003
228031
  if (pointCount >= 0 && pointCount < this._xyzInUse)
@@ -228009,10 +228037,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228009
228037
  this._xyzInUse = pointCount;
228010
228038
  }
228011
228039
  }
228012
- /**
228013
- * Make a copy of the (active) points in this array.
228014
- * (The clone does NOT get excess capacity)
228015
- */
228040
+ /** Make a copy of the (active) points in this array (the clone does NOT get excess capacity). */
228016
228041
  clone(result) {
228017
228042
  if (!result)
228018
228043
  result = new GrowableXYZArray(this.length);
@@ -228028,11 +228053,11 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228028
228053
  /**
228029
228054
  * Clone the input array with each successive duplicate point removed.
228030
228055
  * * First and last points are always preserved.
228031
- * @param source the source array
228032
- * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])
228056
+ * @param source the source array.
228057
+ * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]]).
228033
228058
  * @param result optional pre-allocated object to populate and return. Can be a reference to `source`, in
228034
228059
  * which case the array is compressed in place and returned.
228035
- * @see [[cloneCompressed]], [[compressInPlace]], [[PolylineOps.compressShortEdges]]
228060
+ * @see [[cloneCompressed]], [[compressInPlace]], [[PolylineOps.compressShortEdges]].
228036
228061
  */
228037
228062
  static createCompressed(source, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance, result) {
228038
228063
  const dupIndices = source.findOrderedDuplicates(tolerance, true);
@@ -228066,9 +228091,9 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228066
228091
  /**
228067
228092
  * Compress the input array by removing successive duplicate points.
228068
228093
  * * First and last points are always preserved.
228069
- * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])
228094
+ * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]]).
228070
228095
  * @returns the instance array.
228071
- * @see [[createCompressed]], [[cloneCompressed]], [[PolylineOps.compressShortEdges]]
228096
+ * @see [[createCompressed]], [[cloneCompressed]], [[PolylineOps.compressShortEdges]].
228072
228097
  */
228073
228098
  compressInPlace(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
228074
228099
  return GrowableXYZArray.createCompressed(this, tolerance, this);
@@ -228099,23 +228124,32 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228099
228124
  result.pushFrom(data);
228100
228125
  return result;
228101
228126
  }
228102
- /** Restructure MultiLineStringDataVariant as array of GrowableXYZArray */
228127
+ /**
228128
+ * Create a new GrowableXYZArray capturing the provided data. The data is not copied, just referenced.
228129
+ * @param data source data to capture.
228130
+ * @returns a new GrowableXYZArray object that references the provided data.
228131
+ */
228132
+ static createCapture(data) {
228133
+ return new GrowableXYZArray(0, undefined, data);
228134
+ }
228135
+ /** Restructure MultiLineStringDataVariant as array of GrowableXYZArray. */
228103
228136
  static createArrayOfGrowableXYZArray(data) {
228104
228137
  const collector = new _PointStreaming__WEBPACK_IMPORTED_MODULE_2__.PointStreamGrowableXYZArrayCollector();
228105
228138
  _PointStreaming__WEBPACK_IMPORTED_MODULE_2__.VariantPointDataStream.streamXYZ(data, collector);
228106
228139
  return collector.claimArrayOfGrowableXYZArray();
228107
228140
  }
228108
- /** push a point to the end of the array */
228141
+ /** Push a point to the end of the array. */
228109
228142
  push(toPush) {
228110
228143
  this.pushXYZ(toPush.x, toPush.y, toPush.z);
228111
228144
  }
228112
- /** push all points of an array */
228145
+ /** Push all points of an array. */
228113
228146
  pushAll(points) {
228114
228147
  this.ensureCapacity(this._xyzInUse + points.length, false);
228115
228148
  for (const p of points)
228116
228149
  this.push(p);
228117
228150
  }
228118
- /** Push copies of points from variant sources.
228151
+ /**
228152
+ * Push copies of points from variant sources.
228119
228153
  * Valid inputs are:
228120
228154
  * * Point2d
228121
228155
  * * Point3d
@@ -228125,7 +228159,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228125
228159
  * * Any json object satisfying Point3d.isXYAndZ
228126
228160
  * * Any json object satisfying Point3d.isXAndY
228127
228161
  * * A Float64Array of doubles, interpreted as xyzxyz
228128
- * * An array of any of the above
228162
+ * * An array of any of the above.
228129
228163
  */
228130
228164
  pushFrom(p) {
228131
228165
  if (p instanceof _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d)
@@ -228145,7 +228179,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228145
228179
  else if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(p, 2))
228146
228180
  this.pushXYZ(p[0], p[1], 0.0);
228147
228181
  else if (Array.isArray(p)) {
228148
- // direct recursion re-wraps p and goes infinite. Unroll here.
228182
+ // direct recursion re-wraps p and goes infinite; unroll here.
228149
228183
  for (const q of p)
228150
228184
  this.pushFrom(q);
228151
228185
  }
@@ -228162,7 +228196,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228162
228196
  }
228163
228197
  /**
228164
228198
  * Replicate numWrap xyz values from the front of the array as new values at the end.
228165
- * @param numWrap number of xyz values to replicate
228199
+ * @param numWrap number of xyz values to replicate.
228166
228200
  */
228167
228201
  pushWrap(numWrap) {
228168
228202
  if (this._xyzInUse >= numWrap) {
@@ -228173,7 +228207,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228173
228207
  }
228174
228208
  }
228175
228209
  }
228176
- /** append a new point with given x,y,z */
228210
+ /** Append a new point with given x,y,z. */
228177
228211
  pushXYZ(x, y, z) {
228178
228212
  this.ensureCapacity(this._xyzInUse + 1);
228179
228213
  const index = this._xyzInUse * 3;
@@ -228182,10 +228216,11 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228182
228216
  this._data[index + 2] = z;
228183
228217
  this._xyzInUse++;
228184
228218
  }
228185
- /** Shift all data forward to make space for numPoints at the front.
228219
+ /**
228220
+ * Shift all data forward to make space for numPoints at the front.
228186
228221
  * * Leading (3*numPoints) doubles are left with prior contents.
228187
- * * _xyzInUse count is increased
228188
- */
228222
+ * * _xyzInUse count is increased.
228223
+ */
228189
228224
  shiftForward(numPoints) {
228190
228225
  if (numPoints <= 0)
228191
228226
  return;
@@ -228195,7 +228230,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228195
228230
  this._data.copyWithin(numAddedDouble, 0, lastIndex);
228196
228231
  this._xyzInUse += numPoints;
228197
228232
  }
228198
- /** prepend a new point with given x,y,z
228233
+ /**
228234
+ * Prepend a new point with given x,y,z
228199
228235
  * * Remark: this copies all content forward.
228200
228236
  */
228201
228237
  pushFrontXYZ(x, y, z) {
@@ -228204,13 +228240,12 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228204
228240
  this._data[1] = y;
228205
228241
  this._data[2] = z;
228206
228242
  }
228207
- /** prepend a new point at the front of the array.
228208
- *
228209
- */
228243
+ /** Prepend a new point at the front of the array. */
228210
228244
  pushFront(toPush) {
228211
228245
  this.pushFrontXYZ(toPush.x, toPush.y, toPush.z);
228212
228246
  }
228213
- /** move the coordinates at fromIndex to toIndex.
228247
+ /**
228248
+ * Move the coordinates at fromIndex to toIndex.
228214
228249
  * * No action if either index is invalid.
228215
228250
  */
228216
228251
  moveIndexToIndex(fromIndex, toIndex) {
@@ -228222,7 +228257,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228222
228257
  this._data[iB] = this._data[iA];
228223
228258
  }
228224
228259
  }
228225
- /** Remove one point from the back.
228260
+ /**
228261
+ * Remove one point from the back.
228226
228262
  * * NOTE that (in the manner of std::vector native) this is "just" removing the point -- no point is NOT returned.
228227
228263
  * * Use `back ()` to get the last x,y,z assembled into a `Point3d `
228228
228264
  */
@@ -228230,40 +228266,41 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228230
228266
  if (this._xyzInUse > 0)
228231
228267
  this._xyzInUse--;
228232
228268
  }
228233
- /**
228234
- * Clear all xyz data, but leave capacity unchanged.
228235
- */
228269
+ /** Clear all xyz data, but leave capacity unchanged. */
228236
228270
  clear() {
228237
228271
  this._xyzInUse = 0;
228238
228272
  }
228239
228273
  /**
228240
- * Get a point by index, strongly typed as a Point3d. This is unchecked. Use [[getPoint3dAtCheckedPointIndex]] to have validity test.
228241
- * @param pointIndex index to access
228242
- * @param result optional result
228274
+ * Get a point by index, strongly typed as a Point3d. This is unchecked. Use [[getPoint3dAtCheckedPointIndex]] to
228275
+ * have validity test.
228276
+ * @param pointIndex index to access.
228277
+ * @param result optional result.
228243
228278
  */
228244
228279
  getPoint3dAtUncheckedPointIndex(pointIndex, result) {
228245
228280
  const index = 3 * pointIndex;
228246
228281
  return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
228247
228282
  }
228248
228283
  /**
228249
- * Get a point by index, strongly typed as a Point2d. This is unchecked. Use [[getPoint2dAtCheckedPointIndex]] to have validity test.
228250
- * @param pointIndex index to access
228251
- * @param result optional result
228284
+ * Get a point by index, strongly typed as a Point2d. This is unchecked. Use [[getPoint2dAtCheckedPointIndex]] to
228285
+ * have validity test.
228286
+ * @param pointIndex index to access.
228287
+ * @param result optional result.
228252
228288
  */
228253
228289
  getPoint2dAtUncheckedPointIndex(pointIndex, result) {
228254
228290
  const index = 3 * pointIndex;
228255
228291
  return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_4__.Point2d.create(this._data[index], this._data[index + 1], result);
228256
228292
  }
228257
228293
  /**
228258
- * Get a vector by index, strongly typed as a Vector3d. This is unchecked. Use [[getVector3dAtCheckedVectorIndex]] to have validity test.
228259
- * @param vectorIndex index to access
228260
- * @param result optional result
228294
+ * Get a vector by index, strongly typed as a Vector3d. This is unchecked. Use [[getVector3dAtCheckedVectorIndex]]
228295
+ * to have validity test.
228296
+ * @param vectorIndex index to access.
228297
+ * @param result optional result.
228261
228298
  */
228262
228299
  getVector3dAtUncheckedVectorIndex(vectorIndex, result) {
228263
228300
  const index = 3 * vectorIndex;
228264
228301
  return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Vector3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
228265
228302
  }
228266
- /** copy xyz into strongly typed Point3d */
228303
+ /** Copy xyz into strongly typed Point3d. */
228267
228304
  getPoint3dAtCheckedPointIndex(pointIndex, result) {
228268
228305
  if (this.isIndexValid(pointIndex)) {
228269
228306
  const index = 3 * pointIndex;
@@ -228271,22 +228308,22 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228271
228308
  }
228272
228309
  return undefined;
228273
228310
  }
228274
- /** access x of indexed point */
228311
+ /** Access x of indexed point. */
228275
228312
  getXAtUncheckedPointIndex(pointIndex) {
228276
228313
  const index = 3 * pointIndex;
228277
228314
  return this._data[index];
228278
228315
  }
228279
- /** access y of indexed point */
228316
+ /** Access y of indexed point. */
228280
228317
  getYAtUncheckedPointIndex(pointIndex) {
228281
228318
  const index = 3 * pointIndex;
228282
228319
  return this._data[index + 1];
228283
228320
  }
228284
- /** access y of indexed point */
228321
+ /** Access z of indexed point. */
228285
228322
  getZAtUncheckedPointIndex(pointIndex) {
228286
228323
  const index = 3 * pointIndex;
228287
228324
  return this._data[index + 2];
228288
228325
  }
228289
- /** copy xy into strongly typed Point2d */
228326
+ /** Copy xy into strongly typed Point2d. */
228290
228327
  getPoint2dAtCheckedPointIndex(pointIndex, result) {
228291
228328
  if (this.isIndexValid(pointIndex)) {
228292
228329
  const index = 3 * pointIndex;
@@ -228294,7 +228331,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228294
228331
  }
228295
228332
  return undefined;
228296
228333
  }
228297
- /** copy xyz into strongly typed Vector3d */
228334
+ /** Copy xyz into strongly typed Vector3d. */
228298
228335
  getVector3dAtCheckedVectorIndex(vectorIndex, result) {
228299
228336
  if (this.isIndexValid(vectorIndex)) {
228300
228337
  const index = 3 * vectorIndex;
@@ -228304,9 +228341,9 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228304
228341
  }
228305
228342
  /**
228306
228343
  * Read coordinates from source array, place them at index within this array.
228307
- * @param destIndex point index where coordinates are to be placed in this array
228308
- * @param source source array
228309
- * @param sourceIndex point index in source array
228344
+ * @param destIndex point index where coordinates are to be placed in this array.
228345
+ * @param source source array.
228346
+ * @param sourceIndex point index in source array.
228310
228347
  * @returns true if destIndex and sourceIndex are both valid.
228311
228348
  */
228312
228349
  transferFromGrowableXYZArray(destIndex, source, sourceIndex) {
@@ -228320,13 +228357,13 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228320
228357
  return false;
228321
228358
  }
228322
228359
  /**
228323
- * push coordinates from the source array to the end of this array.
228324
- * @param source source array
228325
- * @param sourceIndex xyz index within the source. If undefined, entire source is pushed.
228360
+ * Push coordinates from the source array to the end of this array.
228361
+ * @param source source array.
228362
+ * @param sourceIndex xyz index within the source. If undefined, entire source is pushed.
228326
228363
  * @returns number of points pushed.
228327
228364
  */
228328
228365
  pushFromGrowableXYZArray(source, sourceIndex) {
228329
- // full array push . . .
228366
+ // full array push
228330
228367
  if (sourceIndex === undefined) {
228331
228368
  const numXYZAdd = source.length;
228332
228369
  this.ensureCapacity(this.length + numXYZAdd, false);
@@ -228334,7 +228371,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228334
228371
  this._xyzInUse += numXYZAdd;
228335
228372
  return numXYZAdd;
228336
228373
  }
228337
- // single point push . . .
228374
+ // single point push
228338
228375
  if (source.isIndexValid(sourceIndex)) {
228339
228376
  const j = sourceIndex * 3;
228340
228377
  this.pushXYZ(source._data[j], source._data[j + 1], source._data[j + 2]);
@@ -228344,8 +228381,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228344
228381
  }
228345
228382
  /**
228346
228383
  * Set the coordinates of a single point.
228347
- * @param pointIndex index of point to set
228348
- * @param value coordinates to set
228384
+ * @param pointIndex index of point to set.
228385
+ * @param value coordinates to set.
228349
228386
  */
228350
228387
  setAtCheckedPointIndex(pointIndex, value) {
228351
228388
  if (!this.isIndexValid(pointIndex))
@@ -228357,11 +228394,11 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228357
228394
  return true;
228358
228395
  }
228359
228396
  /**
228360
- * Set the coordinates of a single point given as coordinates
228361
- * @param pointIndex index of point to set
228362
- * @param x x coordinate
228363
- * @param y y coordinate
228364
- * @param z z coordinate
228397
+ * Set the coordinates of a single point given as coordinates.
228398
+ * @param pointIndex index of point to set.
228399
+ * @param x x coordinate.
228400
+ * @param y y coordinate.
228401
+ * @param z z coordinate.
228365
228402
  */
228366
228403
  setXYZAtCheckedPointIndex(pointIndex, x, y, z) {
228367
228404
  if (!this.isIndexValid(pointIndex))
@@ -228372,9 +228409,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228372
228409
  this._data[index] = z;
228373
228410
  return true;
228374
228411
  }
228375
- /**
228376
- * Copy all points into a simple array of Point3d
228377
- */
228412
+ /** Copy all points into a simple array of Point3. */
228378
228413
  getPoint3dArray() {
228379
228414
  const n = 3 * this._xyzInUse;
228380
228415
  const result = [];
@@ -228383,7 +228418,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228383
228418
  result.push(_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(data[i], data[i + 1], data[i + 2]));
228384
228419
  return result;
228385
228420
  }
228386
- /** multiply each point by the transform, replace values. */
228421
+ /** Multiply each point by the transform, replace values. */
228387
228422
  static multiplyTransformInPlace(transform, data) {
228388
228423
  if (Array.isArray(data)) {
228389
228424
  for (const d of data)
@@ -228393,7 +228428,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228393
228428
  data.multiplyTransformInPlace(transform);
228394
228429
  }
228395
228430
  }
228396
- /** multiply each point by the transform, replace values. */
228431
+ /** Multiply each point by the transform, replace values. */
228397
228432
  multiplyTransformInPlace(transform) {
228398
228433
  const data = this._data;
228399
228434
  const nDouble = this.float64Length;
@@ -228414,7 +228449,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228414
228449
  data[i + 2] = coffs[6] * x + coffs[7] * y + coffs[8] * z + z0;
228415
228450
  }
228416
228451
  }
228417
- /** reverse the order of points. */
228452
+ /** Reverse the order of points. */
228418
228453
  reverseInPlace() {
228419
228454
  const n = this.length;
228420
228455
  let j0, j1;
@@ -228438,7 +228473,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228438
228473
  data[j1] = a;
228439
228474
  }
228440
228475
  }
228441
- /** multiply each xyz (as a vector) by matrix, replace values. */
228476
+ /** Multiply each xyz (as a vector) by matrix, replace values. */
228442
228477
  multiplyMatrix3dInPlace(matrix) {
228443
228478
  const data = this._data;
228444
228479
  const nDouble = this.float64Length;
@@ -228455,9 +228490,10 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228455
228490
  data[i + 2] = coffs[6] * x + coffs[7] * y + coffs[8] * z;
228456
228491
  }
228457
228492
  }
228458
- /** multiply each xyz (as a vector) by matrix inverse transpose, renormalize the vector, replace values.
228459
- * * This is the way to apply a matrix (possibly with skew and scale) to a surface normal, and
228460
- * have it end up perpendicular to the transformed in-surface vectors.
228493
+ /**
228494
+ * Multiply each xyz (as a vector) by matrix inverse transpose, renormalize the vector, replace values.
228495
+ * * This is the way to apply a matrix (possibly with skew and scale) to a surface normal, and have it end up
228496
+ * perpendicular to the transformed in-surface vectors.
228461
228497
  * * Return false if matrix is not invertible or if any normalization fails.
228462
228498
  */
228463
228499
  multiplyAndRenormalizeMatrix3dInverseTransposeInPlace(matrix) {
@@ -228485,7 +228521,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228485
228521
  z1 = coffs[2] * x + coffs[5] * y + coffs[8] * z;
228486
228522
  a = x1 * x1 + y1 * y1 + z1 * z1;
228487
228523
  if (a < tol) {
228488
- // put the originals back ..
228524
+ // put the originals back
228489
228525
  x1 = x;
228490
228526
  y1 = y;
228491
228527
  z1 = z;
@@ -228496,16 +228532,14 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228496
228532
  x1 *= q;
228497
228533
  y1 *= q;
228498
228534
  z1 *= q;
228499
- } // else -- q is near 1, no need to do the division !!
228535
+ } // else if q is near 1, no need to do the division
228500
228536
  data[i] = x1;
228501
228537
  data[i + 1] = y1;
228502
228538
  data[i + 2] = z1;
228503
228539
  }
228504
228540
  return numFail === 0;
228505
228541
  }
228506
- /** multiply each xyz (as a point) by a homogeneous matrix and update as the normalized point
228507
- *
228508
- */
228542
+ /** Multiply each xyz (as a point) by a homogeneous matrix and update as the normalized point. */
228509
228543
  multiplyMatrix4dAndQuietRenormalizeMatrix4d(matrix) {
228510
228544
  const data = this._data;
228511
228545
  const nDouble = this.float64Length;
@@ -228517,7 +228551,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228517
228551
  data[i + 2] = xyz1.z;
228518
228552
  }
228519
228553
  }
228520
- /** multiply each point by the transform, replace values. */
228554
+ /** Multiply each point by the transform, replace values. */
228521
228555
  tryTransformInverseInPlace(transform) {
228522
228556
  const data = this._data;
228523
228557
  const nDouble = this.float64Length;
@@ -228556,7 +228590,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228556
228590
  rangeToExtend.extendXYZ(data[i], data[i + 1], data[i + 2]);
228557
228591
  }
228558
228592
  }
228559
- /** get range of points. */
228593
+ /** Get range of points. */
228560
228594
  getRange(transform, result) {
228561
228595
  let range = result;
228562
228596
  if (range)
@@ -228574,7 +228608,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228574
228608
  /** Sum the lengths of segments between points. */
228575
228609
  sumLengths() {
228576
228610
  let sum = 0.0;
228577
- const n = 3 * (this._xyzInUse - 1); // Length already takes into account what specifically is in use
228611
+ const n = 3 * (this._xyzInUse - 1); // length already takes into account what specifically is in use
228578
228612
  const data = this._data;
228579
228613
  for (let i = 0; i < n; i += 3)
228580
228614
  sum += _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseXYZ(data[i + 3] - data[i], data[i + 4] - data[i + 1], data[i + 5] - data[i + 2]);
@@ -228582,7 +228616,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228582
228616
  }
228583
228617
  /**
228584
228618
  * Multiply each x,y,z by the scale factor.
228585
- * @param factor
228619
+ * @param factor scale factor.
228586
228620
  */
228587
228621
  scaleInPlace(factor) {
228588
228622
  if (this._data) {
@@ -228591,7 +228625,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228591
228625
  this._data[i] = this._data[i] * factor;
228592
228626
  }
228593
228627
  }
228594
- /** test if all points are within tolerance of a plane. */
228628
+ /** Test if all points are within tolerance of a plane. */
228595
228629
  isCloseToPlane(plane, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
228596
228630
  const numCoordinate = 3 * this._xyzInUse;
228597
228631
  const data = this._data;
@@ -228602,13 +228636,12 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228602
228636
  }
228603
228637
  /**
228604
228638
  * * If not already closed, push a copy of the first point.
228605
- * * If already closed within tolerance, force exact copy
228606
- * * otherwise leave unchanged.
228639
+ * * If already closed within tolerance, force exact copy.
228640
+ * * Otherwise leave unchanged.
228607
228641
  */
228608
228642
  forceClosure(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
228609
228643
  const d = this.distanceIndexIndex(0, this.length - 1);
228610
- // leave the empty array alone.
228611
- // Note that singleton will generate 0 distance and do nothing.
228644
+ // leave the empty array alone; note that singleton will generate 0 distance and do nothing
228612
228645
  if (d === undefined) {
228613
228646
  }
228614
228647
  else if (d > tolerance)
@@ -228620,7 +228653,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228620
228653
  this._data[i0 + i] = this._data[i];
228621
228654
  }
228622
228655
  }
228623
- /** Compute a point at fractional coordinate between points i and j */
228656
+ /** Compute a point at fractional coordinate between points i and j. */
228624
228657
  interpolate(i, fraction, j, result) {
228625
228658
  if (this.isIndexValid(i) && this.isIndexValid(j)) {
228626
228659
  const fraction0 = 1.0 - fraction;
@@ -228631,10 +228664,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228631
228664
  }
228632
228665
  return undefined;
228633
228666
  }
228634
- /**
228635
- * * Compute a point at fractional coordinate between points i and j of source
228636
- * * push onto this array.
228637
- */
228667
+ /** Compute a point at fractional coordinate between points i and j of source and push onto this array. */
228638
228668
  pushInterpolatedFromGrowableXYZArray(source, i, fraction, j) {
228639
228669
  if (source.isIndexValid(i) && source.isIndexValid(j)) {
228640
228670
  const fraction0 = 1.0 - fraction;
@@ -228644,10 +228674,10 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228644
228674
  this.pushXYZ(fraction0 * data[i] + fraction * data[j], fraction0 * data[i + 1] + fraction * data[j + 1], fraction0 * data[i + 2] + fraction * data[j + 2]);
228645
228675
  }
228646
228676
  }
228647
- /** Sum the signed areas of the projection to xy plane */
228677
+ /** Sum the signed areas of the projection to xy plane. */
228648
228678
  areaXY() {
228649
228679
  let area = 0.0;
228650
- const n = 3 * this._xyzInUse; // float count !!
228680
+ const n = 3 * this._xyzInUse; // float count
228651
228681
  if (n > 6) {
228652
228682
  const x0 = this._data[n - 3];
228653
228683
  const y0 = this._data[n - 2];
@@ -228692,21 +228722,21 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228692
228722
  }
228693
228723
  return undefined;
228694
228724
  }
228695
- /** Compute the dot product of pointIndex with [x,y,z] */
228725
+ /** Compute the dot product of pointIndex with [x,y,z]. */
228696
228726
  evaluateUncheckedIndexDotProductXYZ(pointIndex, x, y, z) {
228697
228727
  const i = pointIndex * 3;
228698
228728
  const data = this._data;
228699
228729
  return data[i] * x + data[i + 1] * y + data[i + 2] * z;
228700
228730
  }
228701
- /** Compute the dot product of pointIndex with [x,y,z] */
228731
+ /** Compute the dot product of pointIndex with [x,y,z]. */
228702
228732
  evaluateUncheckedIndexPlaneAltitude(pointIndex, plane) {
228703
228733
  const i = pointIndex * 3;
228704
228734
  const data = this._data;
228705
228735
  return plane.altitudeXYZ(data[i], data[i + 1], data[i + 2]);
228706
228736
  }
228707
228737
  /**
228708
- * * compute the cross product from indexed origin t indexed targets targetAIndex and targetB index.
228709
- * * accumulate it to the result.
228738
+ * Compute the cross product from indexed origin t indexed targets targetAIndex and targetB index.
228739
+ * * Accumulate it to the result.
228710
228740
  */
228711
228741
  accumulateCrossProductIndexIndexIndex(originIndex, targetAIndex, targetBIndex, result) {
228712
228742
  if (this.isIndexValid(originIndex) && this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {
@@ -228718,8 +228748,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228718
228748
  }
228719
228749
  }
228720
228750
  /**
228721
- * * compute the cross product from indexed origin t indexed targets targetAIndex and targetB index.
228722
- * * accumulate it to the result.
228751
+ * Compute the cross product from indexed origin t indexed targets targetAIndex and targetB index.
228752
+ * * Accumulate it to the result.
228723
228753
  */
228724
228754
  accumulateScaledXYZ(index, scale, sum) {
228725
228755
  if (this.isIndexValid(index)) {
@@ -228730,7 +228760,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228730
228760
  sum.z += scale * data[i + 2];
228731
228761
  }
228732
228762
  }
228733
- /** Compute the cross product of vectors from from origin to indexed targets i and j */
228763
+ /** Compute the cross product of vectors from from origin to indexed targets i and j. */
228734
228764
  crossProductXYAndZIndexIndex(origin, targetAIndex, targetBIndex, result) {
228735
228765
  if (this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {
228736
228766
  const j = targetAIndex * 3;
@@ -228750,8 +228780,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228750
228780
  }
228751
228781
  /**
228752
228782
  * Return distance squared between indicated points.
228753
- * @param i first point index
228754
- * @param j second point index
228783
+ * @param i first point index.
228784
+ * @param j second point index.
228755
228785
  */
228756
228786
  distanceSquaredIndexIndex(i, j) {
228757
228787
  if (this.isIndexValid(i) && this.isIndexValid(j)) {
@@ -228763,8 +228793,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228763
228793
  }
228764
228794
  /**
228765
228795
  * Return distance between indicated points.
228766
- * @param i first point index
228767
- * @param j second point index
228796
+ * @param i first point index.
228797
+ * @param j second point index.
228768
228798
  */
228769
228799
  distanceIndexIndex(i, j) {
228770
228800
  if (this.isIndexValid(i) && this.isIndexValid(j)) {
@@ -228783,7 +228813,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228783
228813
  }
228784
228814
  return undefined;
228785
228815
  }
228786
- /** test for near equality between two `GrowableXYZArray`. */
228816
+ /** Test for near equality between two `GrowableXYZArray`. */
228787
228817
  static isAlmostEqual(dataA, dataB) {
228788
228818
  if (dataA && dataB) {
228789
228819
  if (dataA.length !== dataB.length)
@@ -228796,7 +228826,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228796
228826
  // if both are null it is equal, otherwise unequal
228797
228827
  return (!dataA && !dataB);
228798
228828
  }
228799
- /** Return an array of block indices sorted per compareLexicalBlock function */
228829
+ /** Return an array of block indices sorted per compareLexicalBlock function. */
228800
228830
  sortIndicesLexical() {
228801
228831
  const n = this._xyzInUse;
228802
228832
  // let numCompare = 0;
@@ -228810,7 +228840,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228810
228840
  // console.log (n, numCompare);
228811
228841
  return result;
228812
228842
  }
228813
- /** compare two blocks in simple lexical order. */
228843
+ /** Compare two blocks in simple lexical order. */
228814
228844
  compareLexicalBlock(ia, ib) {
228815
228845
  let ax = 0;
228816
228846
  let bx = 0;
@@ -228822,19 +228852,13 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228822
228852
  if (ax < bx)
228823
228853
  return -1;
228824
228854
  }
228825
- return ia - ib; // so original order is maintained among duplicates !!!!
228855
+ return ia - ib; // so original order is maintained among duplicates
228826
228856
  }
228827
- /** Access a single double at offset within a block. This has no index checking. */
228857
+ /** Access a single double at offset within a block. This has no index checking. */
228828
228858
  component(pointIndex, componentIndex) {
228829
228859
  return this._data[3 * pointIndex + componentIndex];
228830
228860
  }
228831
- /**
228832
- * add points at regular steps from `other`
228833
- * @param source
228834
- * @param pointIndex0
228835
- * @param step
228836
- * @param numAdd
228837
- */
228861
+ /** Add points at regular steps from `other`. */
228838
228862
  addSteppedPoints(other, pointIndex0, step, numAdd) {
228839
228863
  const dataB = other._data;
228840
228864
  let b0 = pointIndex0 * 3;
@@ -228848,9 +228872,9 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228848
228872
  }
228849
228873
  }
228850
228874
  /**
228851
- * find the min and max distance between corresponding indexed points. Excess points are ignored.
228852
- * @param arrayA first array
228853
- * @param arrayB second array
228875
+ * Find the min and max distance between corresponding indexed points. Excess points are ignored.
228876
+ * @param arrayA first array.
228877
+ * @param arrayB second array.
228854
228878
  */
228855
228879
  static distanceRangeBetweenCorrespondingPoints(arrayA, arrayB) {
228856
228880
  const dataA = arrayA._data;
@@ -228866,11 +228890,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228866
228890
  }
228867
228891
  return range;
228868
228892
  }
228869
- /**
228870
- * remove trailing point(s) within tolerance of the start point.
228871
- * @param points
228872
- * @param tolerance
228873
- */
228893
+ /** Remove trailing point(s) within tolerance of the start point. */
228874
228894
  static removeClosure(points, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
228875
228895
  while (points.length > 1 && points.distanceIndexIndex(0, points.length - 1) < tolerance)
228876
228896
  points.pop();
@@ -228878,8 +228898,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228878
228898
  /**
228879
228899
  * Compute frame for a triangle formed by three (unchecked!) points identified by index.
228880
228900
  * * z direction of frame is 001.
228881
- * * Transform axes from origin to targetA and targetB
228882
- * * in local coordinates (u,v,w) the xy interior of the triangle is `u>=0, v>= 0, w>= 0, u+v+w<1`
228901
+ * * Transform axes from origin to targetA and targetB.
228902
+ * * in local coordinates (u,v,w) the xy interior of the triangle is `u>=0, v>= 0, w>= 0, u+v+w<1`.
228883
228903
  * * Return undefined if transform is not invertible, e.g. if points are in a vertical plane.
228884
228904
  */
228885
228905
  fillLocalXYTriangleFrame(originIndex, targetAIndex, targetBIndex, result) {
@@ -228905,7 +228925,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228905
228925
  /**
228906
228926
  * Pass the (x,y,z) of each point to a function which returns a replacement for one of the 3 components.
228907
228927
  * @param componentIndex Index (0,1,2) of component to be replaced.
228908
- * @param func function to be called as `func(x,y,z)`, returning a replacement value for componentIndex
228928
+ * @param func function to be called as `func(x,y,z)`, returning a replacement value for componentIndex.
228909
228929
  */
228910
228930
  mapComponent(componentIndex, func) {
228911
228931
  const n = this._data.length;
@@ -229069,6 +229089,7 @@ class IndexedXYZCollectionInterval extends IndexedCollectionInterval {
229069
229089
  "use strict";
229070
229090
  __webpack_require__.r(__webpack_exports__);
229071
229091
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
229092
+ /* harmony export */ IndexedReadWriteXYCollection: () => (/* binding */ IndexedReadWriteXYCollection),
229072
229093
  /* harmony export */ IndexedXYCollection: () => (/* binding */ IndexedXYCollection)
229073
229094
  /* harmony export */ });
229074
229095
  /* harmony import */ var _Point2dVector2d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
@@ -229081,7 +229102,7 @@ __webpack_require__.r(__webpack_exports__);
229081
229102
  */
229082
229103
 
229083
229104
  /**
229084
- * abstract base class for access to XY data with indexed reference.
229105
+ * Abstract base class for access to XY data with indexed reference.
229085
229106
  * * This allows algorithms to work with Point2d[] or GrowableXY.
229086
229107
  * * GrowableXYArray implements these for its data.
229087
229108
  * * Point2dArrayCarrier carries a (reference to) a Point2d[] and implements the methods with calls on that array reference.
@@ -229091,7 +229112,8 @@ __webpack_require__.r(__webpack_exports__);
229091
229112
  */
229092
229113
  class IndexedXYCollection {
229093
229114
  static _workPoint;
229094
- /** access x of indexed point
229115
+ /**
229116
+ * Access x of indexed point.
229095
229117
  * * Subclasses may wish to override with a more efficient implementation.
229096
229118
  */
229097
229119
  getXAtUncheckedPointIndex(pointIndex) {
@@ -229100,7 +229122,8 @@ class IndexedXYCollection {
229100
229122
  IndexedXYCollection._workPoint = pt; // allocate the cache
229101
229123
  return pt ? pt.x : 0.0;
229102
229124
  }
229103
- /** access y of indexed point
229125
+ /**
229126
+ * Access y of indexed point.
229104
229127
  * * Subclasses may wish to override with a more efficient implementation.
229105
229128
  */
229106
229129
  getYAtUncheckedPointIndex(pointIndex) {
@@ -229109,9 +229132,10 @@ class IndexedXYCollection {
229109
229132
  IndexedXYCollection._workPoint = pt; // allocate the cache
229110
229133
  return pt ? pt.y : 0.0;
229111
229134
  }
229112
- /** Compute the linear combination s of the indexed p_i and given scales s_i.
229135
+ /**
229136
+ * Compute the linear combination s of the indexed p_i and given scales s_i.
229113
229137
  * @param scales array of scales. For best results, scales should have same length as the instance.
229114
- * @param result optional pre-allocated object to fill and return
229138
+ * @param result optional pre-allocated object to fill and return.
229115
229139
  * @return s = sum(p_i * s_i), where i ranges from 0 to min(this.length, scales.length).
229116
229140
  */
229117
229141
  linearCombination(scales, result) {
@@ -229124,6 +229148,12 @@ class IndexedXYCollection {
229124
229148
  return sum;
229125
229149
  }
229126
229150
  }
229151
+ /**
229152
+ * Abstract base class extends [[IndexedXYCollection]] with methods that modify the collection.
229153
+ * @public
229154
+ */
229155
+ class IndexedReadWriteXYCollection extends IndexedXYCollection {
229156
+ }
229127
229157
 
229128
229158
 
229129
229159
  /***/ }),
@@ -229161,7 +229191,8 @@ class PointsIterator {
229161
229191
  }
229162
229192
  next() {
229163
229193
  if (++this._curIndex >= this._collection.length) {
229164
- // The ECMAScript spec states that value=undefined is valid if done=true. The TypeScript interface violates the spec hence the cast to any and back below.
229194
+ // the ECMAScript spec states that value=undefined is valid if done=true
229195
+ // the TypeScript interface violates the spec hence the cast to any and back below
229165
229196
  return { done: true };
229166
229197
  }
229167
229198
  return {
@@ -229182,11 +229213,11 @@ class PointsIterator {
229182
229213
  */
229183
229214
  class IndexedXYZCollection {
229184
229215
  /**
229185
- * Return a vector from the point at `indexA` to `target`
229186
- * @param indexA index of point within the array
229187
- * @param target target for vector
229216
+ * Return a vector from the point at `indexA` to `target`.
229217
+ * @param indexA index of point within the array.
229218
+ * @param target target for vector.
229188
229219
  * @param result caller-allocated vector.
229189
- * @returns undefined if index is out of bounds
229220
+ * @returns undefined if index is out of bounds.
229190
229221
  */
229191
229222
  vectorIndexXYAndZ(indexA, target, result) {
229192
229223
  const reversed = this.vectorXYAndZIndex(target, indexA, result);
@@ -229194,10 +229225,10 @@ class IndexedXYZCollection {
229194
229225
  }
229195
229226
  /**
229196
229227
  * Return the dot product of the vectors from the point at `origin` to the points at `indexA` and `indexB`.
229197
- * @param origin index of point within the array; origin of both vectors
229198
- * @param indexA index of point within the array; target of the first vector
229199
- * @param indexA index of point within the array; target of the second vector
229200
- * @returns undefined if index is out of bounds
229228
+ * @param origin index of point within the array; origin of both vectors.
229229
+ * @param indexA index of point within the array; target of the first vector.
229230
+ * @param indexB index of point within the array; target of the second vector.
229231
+ * @returns undefined if index is out of bounds.
229201
229232
  */
229202
229233
  dotProductIndexIndexIndex(origin, indexA, indexB) {
229203
229234
  if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length || indexB < 0 || indexB >= this.length)
@@ -229211,10 +229242,10 @@ class IndexedXYZCollection {
229211
229242
  }
229212
229243
  /**
229213
229244
  * Return the dot product of the vectors from the point at `origin` to the point at `indexA` and to `targetB`.
229214
- * @param origin index of point within the array; origin of both vectors
229215
- * @param indexA index of point within the array; target of the first vector
229216
- * @param targetB target for second vector
229217
- * @returns undefined if index is out of bounds
229245
+ * @param origin index of point within the array; origin of both vectors.
229246
+ * @param indexA index of point within the array; target of the first vector.
229247
+ * @param targetB target for second vector.
229248
+ * @returns undefined if index is out of bounds.
229218
229249
  */
229219
229250
  dotProductIndexIndexXYAndZ(origin, indexA, targetB) {
229220
229251
  if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)
@@ -229227,12 +229258,12 @@ class IndexedXYZCollection {
229227
229258
  (this.getZAtUncheckedPointIndex(indexA) - z0) * (targetB.z - z0);
229228
229259
  }
229229
229260
  /**
229230
- * Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB`
229231
- * @param origin index of point within the array; origin of both vectors
229232
- * @param indexA index of point within the array; target of the first vector
229233
- * @param targetB target of second vector
229234
- * @param result optional caller-allocated result to fill and return
229235
- * @returns undefined if an index is out of bounds
229261
+ * Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB`.
229262
+ * @param origin index of point within the array; origin of both vectors.
229263
+ * @param indexA index of point within the array; target of the first vector.
229264
+ * @param targetB target of second vector.
229265
+ * @param result optional caller-allocated result to fill and return.
229266
+ * @returns undefined if an index is out of bounds.
229236
229267
  */
229237
229268
  crossProductIndexIndexXYAndZ(origin, indexA, targetB, result) {
229238
229269
  if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)
@@ -229244,8 +229275,8 @@ class IndexedXYZCollection {
229244
229275
  }
229245
229276
  /**
229246
229277
  * Return distance squared between the point at index0 and target.
229247
- * @param index0 first point index
229248
- * @param target second point
229278
+ * @param index0 first point index.
229279
+ * @param target second point.
229249
229280
  */
229250
229281
  distanceSquaredIndexXYAndZ(index0, target) {
229251
229282
  if (index0 < 0 || index0 >= this.length)
@@ -229282,9 +229313,9 @@ class IndexedXYZCollection {
229282
229313
  * For each subset of `k` successive points within tolerance of the first point in the subset, return the indices of
229283
229314
  * the last `k-1` duplicates.
229284
229315
  * * Index `0` is never returned.
229285
- * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])
229316
+ * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]]).
229286
229317
  * @param preserveLast if the last `k < this.length` points of the instance are duplicates, whether to return the
229287
- * indices of the *first* `k-1` duplicates for this last run. If true, index `this.length - 1` is not returned
229318
+ * indices of the *first* `k-1` duplicates for this last run. If true, index `this.length - 1` is not returned.
229288
229319
  * unless all points are duplicates, in which case all indices but `0` are returned. Default value is false.
229289
229320
  * @return ordered array of 0-based indices of duplicate points
229290
229321
  */
@@ -229307,7 +229338,8 @@ class IndexedXYZCollection {
229307
229338
  }
229308
229339
  return indices;
229309
229340
  }
229310
- /** Compute the linear combination s of the indexed p_i and given scales s_i.
229341
+ /**
229342
+ * Compute the linear combination s of the indexed p_i and given scales s_i.
229311
229343
  * @param scales array of scales. For best results, scales should have same length as the instance.
229312
229344
  * @param result optional pre-allocated object to fill and return
229313
229345
  * @return s = sum(p_i * s_i), where i ranges from 0 to min(this.length, scales.length).
@@ -229324,18 +229356,19 @@ class IndexedXYZCollection {
229324
229356
  }
229325
229357
  /**
229326
229358
  * Interpolate the points at the given indices.
229327
- * @param index0 index of point p0 within the array
229328
- * @param fraction fraction f such that returned point is p0 + f * (p1 - p0)
229329
- * @param index1 index of point p1 within the array
229330
- * @param result optional caller-allocated result to fill and return
229331
- * @returns undefined if an index is out of bounds
229359
+ * @param index0 index of point p0 within the array.
229360
+ * @param fraction fraction f such that returned point is p0 + f * (p1 - p0).
229361
+ * @param index1 index of point p1 within the array.
229362
+ * @param result optional caller-allocated result to fill and return.
229363
+ * @returns undefined if an index is out of bounds.
229332
229364
  */
229333
229365
  interpolateIndexIndex(index0, fraction, index1, result) {
229334
229366
  if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)
229335
229367
  return undefined;
229336
229368
  return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create(_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(this.getXAtUncheckedPointIndex(index0), fraction, this.getXAtUncheckedPointIndex(index1)), _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(this.getYAtUncheckedPointIndex(index0), fraction, this.getYAtUncheckedPointIndex(index1)), _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(this.getZAtUncheckedPointIndex(index0), fraction, this.getZAtUncheckedPointIndex(index1)), result);
229337
229369
  }
229338
- /** Return iterator over the points in this collection. Usage:
229370
+ /**
229371
+ * Return iterator over the points in this collection. Usage:
229339
229372
  * ```ts
229340
229373
  * for (const point: Point3d of collection.points) { ... }
229341
229374
  * ```
@@ -229343,7 +229376,7 @@ class IndexedXYZCollection {
229343
229376
  get points() {
229344
229377
  return new PointsIterator(this);
229345
229378
  }
229346
- /** convert to Point3d[] */
229379
+ /** Convert to Point3d[]. */
229347
229380
  getArray() {
229348
229381
  const result = [];
229349
229382
  for (const p of this.points)
@@ -229364,8 +229397,8 @@ class IndexedXYZCollection {
229364
229397
  }
229365
229398
  /**
229366
229399
  * Test whether the indexed points are equal within tolerance.
229367
- * @param index0 index of first point
229368
- * @param index1 index of second point
229400
+ * @param index0 index of first point.
229401
+ * @param index1 index of second point.
229369
229402
  * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.
229370
229403
  * @returns whether the points are equal within tolerance, or `undefined` if either index is invalid.
229371
229404
  */
@@ -229378,8 +229411,8 @@ class IndexedXYZCollection {
229378
229411
  }
229379
229412
  /**
229380
229413
  * Test whether the xy-coordinates of the indexed points are equal within tolerance. The z-coordinates are ignored.
229381
- * @param index0 index of first point
229382
- * @param index1 index of second point
229414
+ * @param index0 index of first point.
229415
+ * @param index1 index of second point.
229383
229416
  * @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.
229384
229417
  * @returns whether the xy-coordinates of the points are equal within tolerance, or `undefined` if either index is invalid.
229385
229418
  */
@@ -307092,6 +307125,9 @@ class Parser {
307092
307125
  if (unitConversion !== undefined)
307093
307126
  return unitConversion;
307094
307127
  }
307128
+ // if there were unique unit labels but not matched to any units, throw an error
307129
+ if (uniqueUnitLabels.length > 0)
307130
+ throw new _Exception__WEBPACK_IMPORTED_MODULE_1__.QuantityError(_Exception__WEBPACK_IMPORTED_MODULE_1__.QuantityStatus.UnitLabelSuppliedButNotMatched, `The unit label(s) ${uniqueUnitLabels.join(", ")} could not be matched to a known unit.`);
307095
307131
  }
307096
307132
  return unitConversion;
307097
307133
  }
@@ -307139,7 +307175,14 @@ class Parser {
307139
307175
  return { ok: false, error: ParseError.UnableToConvertParseTokensToQuantity };
307140
307176
  }
307141
307177
  const defaultUnit = format.units && format.units.length > 0 ? format.units[0][0] : undefined;
307142
- defaultUnitConversion = defaultUnitConversion ? defaultUnitConversion : Parser.getDefaultUnitConversion(tokens, unitsConversions, defaultUnit);
307178
+ try {
307179
+ defaultUnitConversion = defaultUnitConversion ? defaultUnitConversion : Parser.getDefaultUnitConversion(tokens, unitsConversions, defaultUnit);
307180
+ }
307181
+ catch (e) {
307182
+ // If we failed to get the default unit conversion, we need to return an error.
307183
+ if (e instanceof _Exception__WEBPACK_IMPORTED_MODULE_1__.QuantityError && e.errorNumber === _Exception__WEBPACK_IMPORTED_MODULE_1__.QuantityStatus.UnitLabelSuppliedButNotMatched)
307184
+ return { ok: false, error: ParseError.UnitLabelSuppliedButNotMatched };
307185
+ }
307143
307186
  if (format.type === _Formatter_FormatEnums__WEBPACK_IMPORTED_MODULE_2__.FormatType.Bearing && format.units !== undefined && format.units.length > 0) {
307144
307187
  const units = format.units;
307145
307188
  const desiredNumberOfTokens = units.length;
@@ -321475,7 +321518,7 @@ var loadLanguages = instance.loadLanguages;
321475
321518
  /***/ ((module) => {
321476
321519
 
321477
321520
  "use strict";
321478
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.3.0-dev.12","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 && npm run -s copy:draco","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","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./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","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","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/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"5.2.2-dev.2","@types/chai-as-promised":"^7","@types/draco3d":"^1.4.10","@types/sinon":"^17.0.2","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.31.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","sinon":"^17.0.2","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/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.3.4","@loaders.gl/draco":"^4.3.4","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
321521
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.3.0-dev.16","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 && npm run -s copy:draco","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","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./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","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","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/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"5.2.2-dev.2","@types/chai-as-promised":"^7","@types/draco3d":"^1.4.10","@types/sinon":"^17.0.2","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.31.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","sinon":"^17.0.2","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/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.3.4","@loaders.gl/draco":"^4.3.4","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
321479
321522
 
321480
321523
  /***/ })
321481
321524