@itwin/ecschema-rpcinterface-tests 5.0.0-dev.14 → 5.0.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.
@@ -178689,11 +178689,12 @@ __webpack_require__.r(__webpack_exports__);
178689
178689
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
178690
178690
  /* harmony export */ "BSplineCurveOps": () => (/* binding */ BSplineCurveOps)
178691
178691
  /* harmony export */ });
178692
- /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
178692
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
178693
178693
  /* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
178694
178694
  /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
178695
+ /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
178695
178696
  /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
178696
- /* harmony import */ var _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/PointHelpers */ "../../core/geometry/lib/esm/geometry3d/PointHelpers.js");
178697
+ /* harmony import */ var _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/PointHelpers */ "../../core/geometry/lib/esm/geometry3d/PointHelpers.js");
178697
178698
  /* harmony import */ var _numerics_BandedSystem__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../numerics/BandedSystem */ "../../core/geometry/lib/esm/numerics/BandedSystem.js");
178698
178699
  /* harmony import */ var _BSplineCurve__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
178699
178700
  /* harmony import */ var _KnotVector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./KnotVector */ "../../core/geometry/lib/esm/bspline/KnotVector.js");
@@ -178712,6 +178713,7 @@ __webpack_require__.r(__webpack_exports__);
178712
178713
 
178713
178714
 
178714
178715
 
178716
+
178715
178717
  /**
178716
178718
  * A class with static methods for creating B-spline curves.
178717
178719
  * @public
@@ -178838,28 +178840,24 @@ class BSplineCurveOps {
178838
178840
  static removeDuplicateFitPoints(options) {
178839
178841
  if (undefined !== options.knots && options.knots.length !== options.fitPoints.length)
178840
178842
  options.knots = undefined;
178841
- // get indices of duplicate points to be removed
178842
- const newPts = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_0__.GrowableXYZArray.create(options.fitPoints);
178843
- const indices = newPts.findOrderedDuplicates();
178844
- newPts.clear();
178845
- // remove duplicate fit points
178846
- for (let iRead = 0, iIndex = 0; iRead < options.fitPoints.length; ++iRead) {
178847
- if (iRead === indices[iIndex])
178848
- ++iIndex; // skip the duplicate
178849
- else
178850
- newPts.push(options.fitPoints[iRead].clone());
178851
- }
178852
- options.fitPoints = newPts.getPoint3dArray();
178853
- // remove params corresponding to removed fit points
178854
- if (undefined !== options.knots) {
178855
- const newKnots = [];
178856
- for (let iRead = 0, iIndex = 0; iRead < options.knots.length; ++iRead) {
178857
- if (iRead === indices[iIndex])
178858
- ++iIndex; // skip
178859
- else
178860
- newKnots.push(options.knots[iRead]);
178843
+ const carrier = new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_6__.Point3dArrayCarrier(options.fitPoints);
178844
+ const indices = carrier.findOrderedDuplicates(undefined, true); // use default tolerance
178845
+ if (indices.length > 0) {
178846
+ // remove duplicate fit points, and their corresponding params
178847
+ let iWrite = 0;
178848
+ for (let iRead = 0, iIndex = 0; iRead < options.fitPoints.length; ++iRead) {
178849
+ if (iIndex < indices.length && iRead === indices[iIndex])
178850
+ ++iIndex; // skip the duplicate
178851
+ else {
178852
+ options.fitPoints[iWrite] = options.fitPoints[iRead];
178853
+ if (options.knots)
178854
+ options.knots[iWrite] = options.knots[iRead];
178855
+ ++iWrite;
178856
+ }
178861
178857
  }
178862
- options.knots = newKnots.slice();
178858
+ options.fitPoints.splice(iWrite);
178859
+ if (options.knots)
178860
+ options.knots.splice(iWrite);
178863
178861
  }
178864
178862
  return true;
178865
178863
  }
@@ -179309,25 +179307,25 @@ class BSplineCurveOps {
179309
179307
  let tmp = 0.0;
179310
179308
  // first forward substitution
179311
179309
  for (let i = 1; i < numIntervals; ++i) {
179312
- if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.conditionalDivideFraction(-alpha[i], beta[i - 1])))
179310
+ if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_7__.Geometry.conditionalDivideFraction(-alpha[i], beta[i - 1])))
179313
179311
  return undefined;
179314
179312
  beta[i] += tmp * gamma[i - 1];
179315
179313
  alpha[i] = tmp * alpha[i - 1];
179316
179314
  leftPts[i].addScaledInPlace(leftPts[i - 1], tmp);
179317
179315
  }
179318
179316
  // first backward substitution
179319
- if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.conditionalDivideFraction(1.0, beta[numIntervals - 1] + alpha[numIntervals - 1])))
179317
+ if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_7__.Geometry.conditionalDivideFraction(1.0, beta[numIntervals - 1] + alpha[numIntervals - 1])))
179320
179318
  return undefined;
179321
179319
  gamma[numIntervals - 1] *= tmp;
179322
179320
  leftPts[numIntervals - 1].scaleInPlace(tmp);
179323
179321
  for (let i = numIntervals - 2; i >= 0; --i) {
179324
- if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.conditionalDivideFraction(1.0, beta[i])))
179322
+ if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_7__.Geometry.conditionalDivideFraction(1.0, beta[i])))
179325
179323
  return undefined;
179326
179324
  _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.createScale(leftPts[i].plus2Scaled(leftPts[i + 1], -gamma[i], leftPts[numIntervals - 1], -alpha[i]), tmp, leftPts[i]);
179327
179325
  gamma[i] = -(gamma[i] * gamma[i + 1] + alpha[i] * gamma[numIntervals - 1]) * tmp;
179328
179326
  }
179329
179327
  // second forward substitution
179330
- if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.conditionalDivideFraction(1.0, 1.0 + gamma[0])))
179328
+ if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_7__.Geometry.conditionalDivideFraction(1.0, 1.0 + gamma[0])))
179331
179329
  return undefined;
179332
179330
  poles.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.createScale(leftPts[0], tmp));
179333
179331
  for (let i = 1; i < numIntervals; ++i) {
@@ -179448,7 +179446,7 @@ class BSplineCurveOps {
179448
179446
  props.knots = this.convertFitParamsToCubicKnotVector(props.knots, props.closed, true);
179449
179447
  }
179450
179448
  else {
179451
- props.knots = this.constructFitParametersFromPoints(_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_7__.Point3dArray.clonePoint3dArray(props.fitPoints), props.isChordLenKnots, props.closed);
179449
+ props.knots = this.constructFitParametersFromPoints(_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_8__.Point3dArray.clonePoint3dArray(props.fitPoints), props.isChordLenKnots, props.closed);
179452
179450
  props.knots = this.convertFitParamsToCubicKnotVector(props.knots, props.closed, true);
179453
179451
  }
179454
179452
  }
@@ -188644,10 +188642,17 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
188644
188642
  isSameGeometryClass(other) {
188645
188643
  return other instanceof Arc3d;
188646
188644
  }
188647
- /** Read property for (clone of) center. */
188645
+ /** Read/write the center. Getter returns clone. */
188648
188646
  get center() {
188649
188647
  return this._center.clone();
188650
188648
  }
188649
+ set center(center) {
188650
+ this._center.setFrom(center);
188651
+ }
188652
+ /** Read property for (reference to) center. */
188653
+ get centerRef() {
188654
+ return this._center;
188655
+ }
188651
188656
  /** Read property for (clone of) vector0. */
188652
188657
  get vector0() {
188653
188658
  return this._matrix.columnX();
@@ -188668,7 +188673,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
188668
188673
  get matrixRef() {
188669
188674
  return this._matrix;
188670
188675
  }
188671
- /** Sweep of the angle. */
188676
+ /** Read/write the sweep. Getter returns reference. */
188672
188677
  get sweep() {
188673
188678
  return this._sweep;
188674
188679
  }
@@ -191627,7 +191632,7 @@ var MiteredSweepOutputSelect;
191627
191632
  * @public
191628
191633
  */
191629
191634
  class CurveFactory {
191630
- /** (cautiously) construct and save a line segment between fractional positions. */
191635
+ /** (Cautiously) construct and save a line segment between fractional positions. */
191631
191636
  static addPartialSegment(path, allowBackup, pointA, pointB, fraction0, fraction1) {
191632
191637
  if (allowBackup || (fraction1 > fraction0)) {
191633
191638
  if (pointA !== undefined && pointB !== undefined && !_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(fraction0, fraction1))
@@ -191724,10 +191729,11 @@ class CurveFactory {
191724
191729
  }
191725
191730
  return path;
191726
191731
  }
191727
- /** Create a `Loop` with given xy corners and fixed z.
191732
+ /**
191733
+ * Create a `Loop` with given xy corners and fixed z.
191728
191734
  * * The corners always proceed counter clockwise from lower left.
191729
191735
  * * If the radius is too large for the outer rectangle size, it is reduced to half of the the smaller x or y size.
191730
- */
191736
+ */
191731
191737
  static createRectangleXY(x0, y0, x1, y1, z = 0, filletRadius) {
191732
191738
  let radius = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.correctSmallMetricDistance(filletRadius);
191733
191739
  const xMin = Math.min(x0, x1);
@@ -191736,7 +191742,13 @@ class CurveFactory {
191736
191742
  const yMax = Math.max(y0, y1);
191737
191743
  radius = Math.min(Math.abs(radius), 0.5 * (xMax - xMin), 0.5 * (yMax - yMin));
191738
191744
  if (radius === 0.0)
191739
- return _Loop__WEBPACK_IMPORTED_MODULE_6__.Loop.createPolygon([_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMin, yMin, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMax, yMin, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMax, yMax, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMin, yMax, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMin, yMin, z)]);
191745
+ return _Loop__WEBPACK_IMPORTED_MODULE_6__.Loop.createPolygon([
191746
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMin, yMin, z),
191747
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMax, yMin, z),
191748
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMax, yMax, z),
191749
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMin, yMax, z),
191750
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMin, yMin, z),
191751
+ ]);
191740
191752
  else {
191741
191753
  const vectorU = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(radius, 0, 0);
191742
191754
  const vectorV = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(0, radius, 0);
@@ -191744,7 +191756,12 @@ class CurveFactory {
191744
191756
  const y0A = yMin + radius;
191745
191757
  const x1A = xMax - radius;
191746
191758
  const y1A = yMax - radius;
191747
- const centers = [_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x1A, y1A, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x0A, y1A, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x0A, y0A, z), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x1A, y0A, z)];
191759
+ const centers = [
191760
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x1A, y1A, z),
191761
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x0A, y1A, z),
191762
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x0A, y0A, z),
191763
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x1A, y0A, z),
191764
+ ];
191748
191765
  const loop = _Loop__WEBPACK_IMPORTED_MODULE_6__.Loop.create();
191749
191766
  for (let i = 0; i < 4; i++) {
191750
191767
  const center = centers[i];
@@ -191764,10 +191781,10 @@ class CurveFactory {
191764
191781
  /**
191765
191782
  * If `arcB` is a continuation of `arcA`, extend `arcA` (in place) to include the range of `arcB`
191766
191783
  * * This only succeeds if the two arcs are part of identical complete arcs and end of `arcA` matches the beginning of `arcB`.
191767
- * @param arcA first arc, modified in place
191768
- * @param arcB second arc, unmodified
191769
- * @param allowReversed whether to consolidate even when second arc is reversed
191770
- * @returns whether `arcA` was modified
191784
+ * @param arcA first arc, modified in place.
191785
+ * @param arcB second arc, unmodified.
191786
+ * @param allowReversed whether to consolidate even when second arc is reversed.
191787
+ * @returns whether `arcA` was modified.
191771
191788
  */
191772
191789
  static appendToArcInPlace(arcA, arcB, allowReverse = false) {
191773
191790
  if (arcA.center.isAlmostEqual(arcB.center)) {
@@ -191783,7 +191800,7 @@ class CurveFactory {
191783
191800
  arcA.sweep.setStartEndRadians(arcA.sweep.startRadians, arcA.sweep.startRadians + arcA.sweep.sweepRadians + sweepSign * arcB.sweep.sweepRadians);
191784
191801
  return true;
191785
191802
  }
191786
- // Also ok if negated tangent . ..
191803
+ // Also ok if negated tangent
191787
191804
  if (allowReverse) {
191788
191805
  startB.direction.scaleInPlace(-1.0);
191789
191806
  if (endA.isAlmostEqual(startB)) {
@@ -191796,7 +191813,8 @@ class CurveFactory {
191796
191813
  }
191797
191814
  /**
191798
191815
  * Return a `Path` containing arcs are on the surface of an ellipsoid and pass through a sequence of points.
191799
- * * Each arc passes through the two given endpoints and in the plane containing the true surface normal at given `fractionForIntermediateNormal`
191816
+ * * Each arc passes through the two given endpoints and in the plane containing the true surface normal at
191817
+ * given `fractionForIntermediateNormal`
191800
191818
  * @param ellipsoid
191801
191819
  * @param pathPoints
191802
191820
  * @param fractionForIntermediateNormal fractional position for surface normal used to create the section plane.
@@ -191819,7 +191837,7 @@ class CurveFactory {
191819
191837
  }
191820
191838
  /**
191821
191839
  * Create solid primitives for pipe segments (e.g. Cone or TorusPipe) around line and arc primitives.
191822
- * @param centerline centerline geometry/
191840
+ * @param centerline centerline geometry.
191823
191841
  * @param pipeRadius radius of pipe.
191824
191842
  */
191825
191843
  static createPipeSegments(centerline, pipeRadius) {
@@ -191845,16 +191863,22 @@ class CurveFactory {
191845
191863
  return undefined;
191846
191864
  }
191847
191865
  /**
191848
- * * Create section arcs for mitered pipe.
191849
- * * At each end of each pipe, the pipe is cut by the plane that bisects the angle between successive pipe centerlines.
191850
- * * The arc definitions are constructed so that lines between corresponding fractional positions on the arcs are
191851
- * axial lines on the pipes.
191852
- * * This means that each arc definition axes (aka vector0 and vector90) are _not_ perpendicular to each other.
191853
- * * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis lengths, or a full Arc3d.
191854
- * * For semi-axis length input, x corresponds to an ellipse local axis nominally situated parallel to the xy-plane.
191855
- * * The center of Arc3d input is translated to the centerline start point to act as initial cross section.
191856
- * @param centerline centerline of pipe
191857
- * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d
191866
+ * Create section arcs for mitered pipe.
191867
+ * * At the end of each pipe segment, the pipe is mitered by the plane that bisects the angle between successive
191868
+ * centerline segments.
191869
+ * * The section arcs are constructed so that lines between corresponding fractional positions on the arcs are
191870
+ * axial lines on the pipes.
191871
+ * * This means that the initial arc's vector0 and vector90 lengths and angular separation are _not_ preserved in
191872
+ * the section arcs.
191873
+ * * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis
191874
+ * lengths, or an Arc3d:
191875
+ * * For semi-axis length input, x and y correspond to ellipse local axes perpendicular to each other and to the
191876
+ * start tangent.
191877
+ * * For Arc3d input, the center is translated to the centerline start point, but otherwise the arc is used as-is
191878
+ * for the first section. For best results, the arc should be perpendicular to the centerline start tangent.
191879
+ * @param centerline centerline of pipe. For best results, ensure no successive duplicate points with e.g.,
191880
+ * [[GrowableXYZArray.createCompressed]].
191881
+ * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d (if not full, function makes it full).
191858
191882
  */
191859
191883
  static createMiteredPipeSections(centerline, sectionData) {
191860
191884
  const arcs = [];
@@ -191863,15 +191887,15 @@ class CurveFactory {
191863
191887
  const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
191864
191888
  const vector90 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
191865
191889
  const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
191866
- const currentCenter = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
191867
- centerline.vectorIndexIndex(0, 1, vectorBC);
191868
- centerline.getPoint3dAtUncheckedPointIndex(0, currentCenter);
191869
- let initialSection;
191890
+ const sweep = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__.AngleSweep.create360();
191891
+ centerline.vectorIndexIndex(0, 1, vectorBC); // initially, the start tangent
191870
191892
  if (sectionData instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
191871
- initialSection = sectionData.clone();
191872
- initialSection.center.setFrom(currentCenter);
191873
191893
  vector0.setFrom(sectionData.vector0);
191874
191894
  vector90.setFrom(sectionData.vector90);
191895
+ sweep.setFrom(sectionData.sweep); // allow e.g., half-pipe
191896
+ const sectionFacesForward = sectionData.matrixRef.columnDotXYZ(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, vectorBC.x, vectorBC.y, vectorBC.z) > 0;
191897
+ if (sectionFacesForward !== sectionData.sweep.isCCW)
191898
+ sweep.reverseInPlace();
191875
191899
  }
191876
191900
  else if (typeof sectionData === "number" || _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.isXAndY(sectionData)) {
191877
191901
  const length0 = (typeof sectionData === "number") ? sectionData : sectionData.x;
@@ -191879,31 +191903,31 @@ class CurveFactory {
191879
191903
  const baseFrame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_15__.Matrix3d.createRigidHeadsUp(vectorBC, _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.ZXY);
191880
191904
  baseFrame.columnX(vector0).scaleInPlace(length0);
191881
191905
  baseFrame.columnY(vector90).scaleInPlace(length90);
191882
- initialSection = _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(currentCenter, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__.AngleSweep.create360());
191883
191906
  }
191884
191907
  else {
191885
191908
  return [];
191886
191909
  }
191910
+ // ASSUME: initial section normal points toward sweep direction for subsequent facet creation
191911
+ const initialSection = _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(undefined, vector0, vector90, sweep);
191912
+ centerline.getPoint3dAtUncheckedPointIndex(0, initialSection.centerRef);
191887
191913
  arcs.push(initialSection);
191888
191914
  const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
191889
191915
  const bisector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
191916
+ const center = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
191890
191917
  for (let i = 1; i < centerline.length; i++) {
191891
191918
  vectorAB.setFromVector3d(vectorBC);
191892
- centerline.getPoint3dAtUncheckedPointIndex(i, currentCenter);
191893
- if (i + 1 < centerline.length) {
191919
+ centerline.getPoint3dAtUncheckedPointIndex(i, center);
191920
+ if (i + 1 < centerline.length)
191894
191921
  centerline.vectorIndexIndex(i, i + 1, vectorBC);
191895
- }
191896
- else {
191922
+ else
191897
191923
  vectorBC.setFromVector3d(vectorAB);
191898
- }
191899
191924
  if (vectorAB.normalizeInPlace() && vectorBC.normalizeInPlace()) {
191900
191925
  vectorAB.interpolate(0.5, vectorBC, bisector);
191901
- // On the end ellipse for this pipe section. ..
191902
- // center comes directly from centerline[i]
191903
- // vector0 and vector90 are obtained by sweeping the corresponding vectors of the start ellipse to the split plane.
191926
+ // At pipe end, the ellipse center comes directly from centerline[i], and vector0/vector90 are
191927
+ // obtained by sweeping the corresponding vectors of the pipe start ellipse to the bisector plane.
191904
191928
  moveVectorToPlane(vector0, vectorAB, bisector, vector0);
191905
191929
  moveVectorToPlane(vector90, vectorAB, bisector, vector90);
191906
- arcs.push(_Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(currentCenter, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__.AngleSweep.create360()));
191930
+ arcs.push(_Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(center, vector0, vector90, sweep));
191907
191931
  }
191908
191932
  }
191909
191933
  return arcs;
@@ -191912,21 +191936,38 @@ class CurveFactory {
191912
191936
  * Sweep the initialSection along each segment of the centerLine until it hits the bisector plane at the next vertex.
191913
191937
  * * The caller should place the initialSection on a plane perpendicular to the first edge.
191914
191938
  * * This plane is commonly (but not necessarily) through the start point itself.
191915
- * * If the geometry is not "on a perpendicular plane", the output geometry will still be flattened onto the various planes.
191916
- * * In the "open path" case (i.e when wrapIfPhysicallyClosed is false or the path does not have matched first and last points)
191917
- * the first/last output plane will be at the start/end of the first/last edge and on a perpendicular plane.
191918
- * * In the "closed path" case, the output plane for the first and last point is the bisector of the start and end planes from the "open path" case,
191919
- * and the first/last section geometry may be different from `initialSection`.
191920
- * * The centerline path does NOT have to be planar, however twisting effects effects will appear in the various bisector planes.
191921
- * @param centerline sweep path, e.g., as stroked from a smooth centerline curve
191922
- * @param initialSection profile curve to be swept. As noted above, this should be on a plane perpendicular to the first segment of the centerline.
191923
- * @param options options for computation and output
191939
+ * * If the initialSection is not "on a perpendicular plane", the output geometry will still be flattened onto the
191940
+ * various planes.
191941
+ * * In the "open path" case (i.e when `wrapIfPhysicallyClosed` is false or the path does not have matched first and
191942
+ * last points), the first/last output plane will be at the start/end of the first/last edge and on a perpendicular
191943
+ * plane.
191944
+ * * In the "closed path" case, if start/edn tangents are not provided in the `options`, then the output plane for the
191945
+ * first and last point is the bisector of the start and end planes from the "open path" case, and the first/last
191946
+ * section geometry may be different from `initialSection`.
191947
+ * * The centerline path does NOT have to be planar, however twisting effects effects will appear in the various bisector
191948
+ * planes.
191949
+ * @param centerline sweep path, e.g., as stroked from a smooth centerline curve.
191950
+ * @param initialSection profile curve to be swept. As noted above, this should be on a plane perpendicular to the
191951
+ * first segment of the centerline.
191952
+ * @param options options for computation and output.
191924
191953
  * @return array of sections, starting with `initialSection` projected along the first edge to the first plane.
191925
191954
  */
191926
191955
  static createMiteredSweepSections(centerline, initialSection, options) {
191927
191956
  const sectionData = { sections: [], planes: [] };
191928
191957
  const planes = _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_16__.PolylineOps.createBisectorPlanesForDistinctPoints(centerline, options.wrapIfPhysicallyClosed);
191958
+ // apply start/end tangent options
191929
191959
  if (planes !== undefined && planes.length > 1) {
191960
+ const firstPlane = planes[0];
191961
+ const lastPlane = planes[planes.length - 1];
191962
+ const startTang = options.startTangent;
191963
+ const endTang = options.endTangent;
191964
+ if (!firstPlane.getOriginRef().isAlmostEqual(lastPlane.getOriginRef()) ||
191965
+ (startTang && endTang && startTang.isAlmostEqual(endTang, 0.0))) {
191966
+ if (startTang?.tryNormalizeInPlace())
191967
+ firstPlane.getNormalRef().setFrom(startTang);
191968
+ if (endTang?.tryNormalizeInPlace())
191969
+ lastPlane.getNormalRef().setFrom(endTang);
191970
+ }
191930
191971
  // Projection to target plane, constructing sweep direction from two given planes.
191931
191972
  // If successful, push the target plane and swept section to the output arrays and return the swept section.
191932
191973
  // If unsuccessful, leave the output arrays alone and return the input section.
@@ -191935,12 +191976,12 @@ class CurveFactory {
191935
191976
  const transform = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createFlattenAlongVectorToPlane(sweepVector, targetPlane.getOriginRef(), targetPlane.getNormalRef());
191936
191977
  if (transform === undefined)
191937
191978
  return section;
191938
- const section1 = section.cloneTransformed(transform);
191939
- if (section1 === undefined)
191979
+ const transformedSection = section.cloneTransformed(transform);
191980
+ if (transformedSection === undefined)
191940
191981
  return section;
191941
191982
  sectionData.planes.push(targetPlane);
191942
- sectionData.sections.push(section1);
191943
- return section1;
191983
+ sectionData.sections.push(transformedSection);
191984
+ return transformedSection;
191944
191985
  };
191945
191986
  let currentSection = doSweepToPlane(planes[0], planes[1], planes[0], initialSection);
191946
191987
  for (let i = 1; i < planes.length; i++) {
@@ -191976,11 +192017,11 @@ class CurveFactory {
191976
192017
  /**
191977
192018
  * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.
191978
192019
  * * First spiral begins at given start point.
191979
- * * first tangent aims at shoulder
192020
+ * * first tangent aims at shoulder.
191980
192021
  * * outbound spiral joins line from shoulder to target.
191981
- * @param spiralType name of spiral type. THIS MUST BE AN "Integrated" SPIRAL TYPE
192022
+ * @param spiralType name of spiral type. THIS MUST BE AN "Integrated" SPIRAL TYPE.
191982
192023
  * @param startPoint inbound start point.
191983
- * @param shoulder point target point for (both) spiral-to-line tangencies
192024
+ * @param shoulder point target point for (both) spiral-to-line tangencies.
191984
192025
  * @return array with the computed spirals, or undefined if failure.
191985
192026
  */
191986
192027
  static createLineSpiralSpiralLine(spiralType, startPoint, shoulderPoint, targetPoint) {
@@ -192018,9 +192059,9 @@ class CurveFactory {
192018
192059
  * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.
192019
192060
  * * Spiral length is given.
192020
192061
  * * tangency points float on both lines.
192021
- * @param spiralType name of spiral type. THIS MUST BE AN "Integrated" SPIRAL TYPE
192062
+ * @param spiralType name of spiral type. THIS MUST BE AN "Integrated" SPIRAL TYPE.
192022
192063
  * @param pointA inbound start point.
192023
- * @param shoulder point target point for (both) spiral-to-line tangencies
192064
+ * @param shoulder point target point for (both) spiral-to-line tangencies.
192024
192065
  * @param spiralLength for each part of the spiral pair.
192025
192066
  * @return array with the computed spirals, or undefined if failure.
192026
192067
  */
@@ -192058,12 +192099,12 @@ class CurveFactory {
192058
192099
  }
192059
192100
  /**
192060
192101
  * Compute 2 spirals and an arc (all in XY) for a symmetric line-to-line transition.
192061
- * Spiral lengths and arc radius are given. (e.g. from design speed standards.)
192062
- * @param spiralType name of spiral type. THIS MUST BE AN "Integrated" SPIRAL TYPE
192102
+ * Spiral lengths and arc radius are given (e.g., from design speed standards).
192103
+ * @param spiralType name of spiral type. THIS MUST BE AN "Integrated" SPIRAL TYPE.
192063
192104
  * @param pointA inbound start point.
192064
- * @param pointB shoulder (target) point for (both) spiral-to-line tangencies
192065
- * @param lengthA inbound spiral length
192066
- * @param lengthB outbound spiral length
192105
+ * @param pointB shoulder (target) point for (both) spiral-to-line tangencies.
192106
+ * @param lengthA inbound spiral length.
192107
+ * @param lengthB outbound spiral length.
192067
192108
  * @return array with the computed spirals, or undefined if failure.
192068
192109
  */
192069
192110
  static createLineSpiralArcSpiralLine(spiralType, pointA, pointB, pointC, lengthA, lengthB, arcRadius) {
@@ -192113,12 +192154,7 @@ class CurveFactory {
192113
192154
  }
192114
192155
  return undefined;
192115
192156
  }
192116
- /**
192117
- * Return the intersection point of 3 planes.
192118
- * @param planeA
192119
- * @param planeB
192120
- * @param planeC
192121
- */
192157
+ /** Return the intersection point of 3 planes. */
192122
192158
  static planePlaneIntersectionRay(planeA, planeB) {
192123
192159
  const altitudeA = planeA.altitudeXYZ(0, 0, 0);
192124
192160
  const altitudeB = planeB.altitudeXYZ(0, 0, 0);
@@ -192138,9 +192174,7 @@ class CurveFactory {
192138
192174
  return undefined;
192139
192175
  }
192140
192176
  }
192141
- /**
192142
- * Starting at vectorR, move parallel to vectorV until perpendicular to planeNormal
192143
- */
192177
+ /** Starting at vectorR, move parallel to vectorV until perpendicular to planeNormal. */
192144
192178
  function moveVectorToPlane(vectorR, vectorV, planeNormal, result) {
192145
192179
  // find s such that (vectorR + s * vectorV) DOT planeNormal = 0.
192146
192180
  const dotRN = vectorR.dotProduct(planeNormal);
@@ -209518,7 +209552,7 @@ class AngleSweep {
209518
209552
  this._radians0 = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.clampToStartEnd(this._radians0, -limit, limit);
209519
209553
  this._radians1 = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.clampToStartEnd(this._radians1, -limit, limit);
209520
209554
  }
209521
- /** Ask if the sweep is counterclockwise, i.e. positive sweep */
209555
+ /** Ask if the sweep is counterclockwise, i.e. positive sweep. */
209522
209556
  get isCCW() {
209523
209557
  return this._radians1 >= this._radians0;
209524
209558
  }
@@ -214177,11 +214211,11 @@ __webpack_require__.r(__webpack_exports__);
214177
214211
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
214178
214212
  /* harmony export */ "GrowableXYZArray": () => (/* binding */ GrowableXYZArray)
214179
214213
  /* harmony export */ });
214180
- /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
214214
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
214181
214215
  /* harmony import */ var _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
214182
- /* harmony import */ var _Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
214183
- /* harmony import */ var _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
214184
- /* harmony import */ var _PointStreaming__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PointStreaming */ "../../core/geometry/lib/esm/geometry3d/PointStreaming.js");
214216
+ /* harmony import */ var _Point2dVector2d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
214217
+ /* harmony import */ var _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
214218
+ /* harmony import */ var _PointStreaming__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PointStreaming */ "../../core/geometry/lib/esm/geometry3d/PointStreaming.js");
214185
214219
  /* harmony import */ var _Range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
214186
214220
  /* harmony import */ var _Transform__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
214187
214221
  /*---------------------------------------------------------------------------------------------
@@ -214297,6 +214331,54 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214297
214331
  result._xyzInUse = this.length;
214298
214332
  return result;
214299
214333
  }
214334
+ /**
214335
+ * Clone the input array with each successive duplicate point removed.
214336
+ * * First and last points are always preserved.
214337
+ * @param source the source array
214338
+ * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])
214339
+ * @param result optional pre-allocated object to populate and return. Can be a reference to `source`, in
214340
+ * which case the array is compressed in place and returned.
214341
+ * @see [[cloneCompressed]], [[compressInPlace]], [[PolylineOps.compressShortEdges]]
214342
+ */
214343
+ static createCompressed(source, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance, result) {
214344
+ const dupIndices = source.findOrderedDuplicates(tolerance, true);
214345
+ const newSize = source.length - dupIndices.length;
214346
+ if (!result)
214347
+ result = new GrowableXYZArray(newSize);
214348
+ if (result !== source) {
214349
+ result.clear();
214350
+ result.resize(newSize, true);
214351
+ }
214352
+ for (let iRead = 0, iWrite = 0, iDup = 0; iRead < source.length; ++iRead) {
214353
+ if (iDup < dupIndices.length && iRead === dupIndices[iDup])
214354
+ ++iDup; // skip the duplicate
214355
+ else
214356
+ result.transferFromGrowableXYZArray(iWrite++, source, iRead);
214357
+ }
214358
+ result.resize(newSize);
214359
+ return result;
214360
+ }
214361
+ /**
214362
+ * Clone the instance array with each successive duplicate point removed.
214363
+ * * First and last points are always preserved.
214364
+ * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])
214365
+ * @param result optional pre-allocated object to populate and return. Can be a reference to the instance array, in
214366
+ * which case the array is compressed in place and returned.
214367
+ * @see [[createCompressed]], [[compressInPlace]], [[PolylineOps.compressShortEdges]]
214368
+ */
214369
+ cloneCompressed(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance, result) {
214370
+ return GrowableXYZArray.createCompressed(this, tolerance, result);
214371
+ }
214372
+ /**
214373
+ * Compress the input array by removing successive duplicate points.
214374
+ * * First and last points are always preserved.
214375
+ * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])
214376
+ * @returns the instance array.
214377
+ * @see [[createCompressed]], [[cloneCompressed]], [[PolylineOps.compressShortEdges]]
214378
+ */
214379
+ compressInPlace(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
214380
+ return GrowableXYZArray.createCompressed(this, tolerance, this);
214381
+ }
214300
214382
  /** Create an array from various point data formats.
214301
214383
  * Valid inputs are:
214302
214384
  * * Point2d
@@ -214324,8 +214406,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214324
214406
  }
214325
214407
  /** Restructure MultiLineStringDataVariant as array of GrowableXYZArray */
214326
214408
  static createArrayOfGrowableXYZArray(data) {
214327
- const collector = new _PointStreaming__WEBPACK_IMPORTED_MODULE_1__.PointStreamGrowableXYZArrayCollector();
214328
- _PointStreaming__WEBPACK_IMPORTED_MODULE_1__.VariantPointDataStream.streamXYZ(data, collector);
214409
+ const collector = new _PointStreaming__WEBPACK_IMPORTED_MODULE_2__.PointStreamGrowableXYZArrayCollector();
214410
+ _PointStreaming__WEBPACK_IMPORTED_MODULE_2__.VariantPointDataStream.streamXYZ(data, collector);
214329
214411
  return collector.claimArrayOfGrowableXYZArray();
214330
214412
  }
214331
214413
  /** push a point to the end of the array */
@@ -214351,30 +214433,30 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214351
214433
  * * An array of any of the above
214352
214434
  */
214353
214435
  pushFrom(p) {
214354
- if (p instanceof _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d)
214436
+ if (p instanceof _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d)
214355
214437
  this.pushXYZ(p.x, p.y, p.z);
214356
214438
  else if (p instanceof GrowableXYZArray)
214357
214439
  this.pushFromGrowableXYZArray(p);
214358
- else if (p instanceof _Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Point2d)
214440
+ else if (p instanceof _Point2dVector2d__WEBPACK_IMPORTED_MODULE_4__.Point2d)
214359
214441
  this.pushXYZ(p.x, p.y, 0.0);
214360
- else if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isNumberArray(p, 4) || p instanceof Float64Array) {
214442
+ else if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(p, 4) || p instanceof Float64Array) {
214361
214443
  const xyzToAdd = Math.trunc(p.length / 3);
214362
214444
  this.ensureCapacity(this._xyzInUse + xyzToAdd, false);
214363
214445
  this.copyData(p, xyzToAdd, this._xyzInUse);
214364
214446
  this._xyzInUse += xyzToAdd;
214365
214447
  }
214366
- else if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isNumberArray(p, 3))
214448
+ else if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(p, 3))
214367
214449
  this.pushXYZ(p[0], p[1], p[2]);
214368
- else if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isNumberArray(p, 2))
214450
+ else if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(p, 2))
214369
214451
  this.pushXYZ(p[0], p[1], 0.0);
214370
214452
  else if (Array.isArray(p)) {
214371
214453
  // direct recursion re-wraps p and goes infinite. Unroll here.
214372
214454
  for (const q of p)
214373
214455
  this.pushFrom(q);
214374
214456
  }
214375
- else if (_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.isXYAndZ(p))
214457
+ else if (_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.isXYAndZ(p))
214376
214458
  this.pushXYZ(p.x, p.y, p.z);
214377
- else if (_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.isXAndY(p))
214459
+ else if (_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.isXAndY(p))
214378
214460
  this.pushXYZ(p.x, p.y, 0.0);
214379
214461
  else if (p instanceof _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0__.IndexedXYZCollection) {
214380
214462
  const n = p.length;
@@ -214453,15 +214535,6 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214453
214535
  if (this._xyzInUse > 0)
214454
214536
  this._xyzInUse--;
214455
214537
  }
214456
- /**
214457
- * Test if index is valid for an xyz (point or vector) within this array
214458
- * @param index xyz index to test.
214459
- */
214460
- isIndexValid(index) {
214461
- if (index >= this._xyzInUse || index < 0)
214462
- return false;
214463
- return true;
214464
- }
214465
214538
  /**
214466
214539
  * Clear all xyz data, but leave capacity unchanged.
214467
214540
  */
@@ -214475,7 +214548,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214475
214548
  */
214476
214549
  getPoint3dAtUncheckedPointIndex(pointIndex, result) {
214477
214550
  const index = 3 * pointIndex;
214478
- return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
214551
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
214479
214552
  }
214480
214553
  /**
214481
214554
  * Get a point by index, strongly typed as a Point2d. This is unchecked. Use [[getPoint2dAtCheckedPointIndex]] to have validity test.
@@ -214484,7 +214557,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214484
214557
  */
214485
214558
  getPoint2dAtUncheckedPointIndex(pointIndex, result) {
214486
214559
  const index = 3 * pointIndex;
214487
- return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Point2d.create(this._data[index], this._data[index + 1], result);
214560
+ return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_4__.Point2d.create(this._data[index], this._data[index + 1], result);
214488
214561
  }
214489
214562
  /**
214490
214563
  * Get a vector by index, strongly typed as a Vector3d. This is unchecked. Use [[getVector3dAtCheckedVectorIndex]] to have validity test.
@@ -214493,13 +214566,13 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214493
214566
  */
214494
214567
  getVector3dAtUncheckedVectorIndex(vectorIndex, result) {
214495
214568
  const index = 3 * vectorIndex;
214496
- return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
214569
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Vector3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
214497
214570
  }
214498
214571
  /** copy xyz into strongly typed Point3d */
214499
214572
  getPoint3dAtCheckedPointIndex(pointIndex, result) {
214500
214573
  if (this.isIndexValid(pointIndex)) {
214501
214574
  const index = 3 * pointIndex;
214502
- return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
214575
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
214503
214576
  }
214504
214577
  return undefined;
214505
214578
  }
@@ -214522,7 +214595,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214522
214595
  getPoint2dAtCheckedPointIndex(pointIndex, result) {
214523
214596
  if (this.isIndexValid(pointIndex)) {
214524
214597
  const index = 3 * pointIndex;
214525
- return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Point2d.create(this._data[index], this._data[index + 1], result);
214598
+ return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_4__.Point2d.create(this._data[index], this._data[index + 1], result);
214526
214599
  }
214527
214600
  return undefined;
214528
214601
  }
@@ -214530,7 +214603,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214530
214603
  getVector3dAtCheckedVectorIndex(vectorIndex, result) {
214531
214604
  if (this.isIndexValid(vectorIndex)) {
214532
214605
  const index = 3 * vectorIndex;
214533
- return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
214606
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Vector3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
214534
214607
  }
214535
214608
  return undefined;
214536
214609
  }
@@ -214544,10 +214617,9 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214544
214617
  transferFromGrowableXYZArray(destIndex, source, sourceIndex) {
214545
214618
  if (this.isIndexValid(destIndex) && source.isIndexValid(sourceIndex)) {
214546
214619
  const i = destIndex * 3;
214547
- const j = sourceIndex * 3;
214548
- this._data[i] = source._data[j];
214549
- this._data[i + 1] = source._data[j + 1];
214550
- this._data[i + 2] = source._data[j + 2];
214620
+ this._data[i] = source.getXAtUncheckedPointIndex(sourceIndex);
214621
+ this._data[i + 1] = source.getYAtUncheckedPointIndex(sourceIndex);
214622
+ this._data[i + 2] = source.getZAtUncheckedPointIndex(sourceIndex);
214551
214623
  return true;
214552
214624
  }
214553
214625
  return false;
@@ -214613,7 +214685,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214613
214685
  const result = [];
214614
214686
  const data = this._data;
214615
214687
  for (let i = 0; i < n; i += 3)
214616
- result.push(_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(data[i], data[i + 1], data[i + 2]));
214688
+ result.push(_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(data[i], data[i + 1], data[i + 2]));
214617
214689
  return result;
214618
214690
  }
214619
214691
  /** multiply each point by the transform, replace values. */
@@ -214699,7 +214771,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214699
214771
  if (!matrix.computeCachedInverse(true))
214700
214772
  return false;
214701
214773
  const coffs = matrix.inverseCoffs;
214702
- const tol = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.smallFloatingPoint;
214774
+ const tol = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallFloatingPoint;
214703
214775
  let x = 0;
214704
214776
  let y = 0;
214705
214777
  let z = 0;
@@ -214742,7 +214814,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214742
214814
  multiplyMatrix4dAndQuietRenormalizeMatrix4d(matrix) {
214743
214815
  const data = this._data;
214744
214816
  const nDouble = this.float64Length;
214745
- const xyz1 = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create();
214817
+ const xyz1 = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create();
214746
214818
  for (let i = 0; i + 2 <= nDouble; i += 3) {
214747
214819
  matrix.multiplyXYZWQuietRenormalize(data[i], data[i + 1], data[i + 2], 1.0, xyz1);
214748
214820
  data[i] = xyz1.x;
@@ -214806,7 +214878,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214806
214878
  const n = 3 * (this._xyzInUse - 1); // Length already takes into account what specifically is in use
214807
214879
  const data = this._data;
214808
214880
  for (let i = 0; i < n; i += 3)
214809
- sum += _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.hypotenuseXYZ(data[i + 3] - data[i], data[i + 4] - data[i + 1], data[i + 5] - data[i + 2]);
214881
+ 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]);
214810
214882
  return sum;
214811
214883
  }
214812
214884
  /**
@@ -214821,7 +214893,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214821
214893
  }
214822
214894
  }
214823
214895
  /** test if all points are within tolerance of a plane. */
214824
- isCloseToPlane(plane, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.smallMetricDistance) {
214896
+ isCloseToPlane(plane, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
214825
214897
  const numCoordinate = 3 * this._xyzInUse;
214826
214898
  const data = this._data;
214827
214899
  for (let i = 0; i < numCoordinate; i += 3)
@@ -214834,7 +214906,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214834
214906
  * * If already closed within tolerance, force exact copy
214835
214907
  * * otherwise leave unchanged.
214836
214908
  */
214837
- forceClosure(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.smallMetricDistance) {
214909
+ forceClosure(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
214838
214910
  const d = this.distanceIndexIndex(0, this.length - 1);
214839
214911
  // leave the empty array alone.
214840
214912
  // Note that singleton will generate 0 distance and do nothing.
@@ -214856,7 +214928,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214856
214928
  const data = this._data;
214857
214929
  i = 3 * i;
214858
214930
  j = 3 * j;
214859
- return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(fraction0 * data[i] + fraction * data[j], fraction0 * data[i + 1] + fraction * data[j + 1], fraction0 * data[i + 2] + fraction * data[j + 2], result);
214931
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(fraction0 * data[i] + fraction * data[j], fraction0 * data[i + 1] + fraction * data[j + 1], fraction0 * data[i + 2] + fraction * data[j + 2], result);
214860
214932
  }
214861
214933
  return undefined;
214862
214934
  }
@@ -214887,37 +214959,37 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214887
214959
  for (let i = 3; i < n; i += 3, dx1 = dx2, dy1 = dy2) {
214888
214960
  dx2 = this._data[i] - x0;
214889
214961
  dy2 = this._data[i + 1] - y0;
214890
- area += _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.crossProductXYXY(dx1, dy1, dx2, dy2);
214962
+ area += _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.crossProductXYXY(dx1, dy1, dx2, dy2);
214891
214963
  }
214892
214964
  }
214893
214965
  return 0.5 * area;
214894
214966
  }
214895
- /** Compute a vector from index origin i to indexed target j */
214967
+ /** Compute a vector from index origin i to indexed target j. */
214896
214968
  vectorIndexIndex(i, j, result) {
214897
214969
  if (!this.isIndexValid(i) || !this.isIndexValid(j))
214898
214970
  return undefined;
214899
214971
  const data = this._data;
214900
214972
  i = 3 * i;
214901
214973
  j = 3 * j;
214902
- return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(data[j] - data[i], data[j + 1] - data[i + 1], data[j + 2] - data[i + 2], result);
214974
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Vector3d.create(data[j] - data[i], data[j + 1] - data[i + 1], data[j + 2] - data[i + 2], result);
214903
214975
  }
214904
- /** Compute a vector from origin to indexed target j */
214976
+ /** Compute a vector from origin to indexed target j. */
214905
214977
  vectorXYAndZIndex(origin, j, result) {
214906
214978
  if (this.isIndexValid(j)) {
214907
214979
  const data = this._data;
214908
214980
  j = 3 * j;
214909
- return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(data[j] - origin.x, data[j + 1] - origin.y, data[j + 2] - origin.z, result);
214981
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Vector3d.create(data[j] - origin.x, data[j + 1] - origin.y, data[j + 2] - origin.z, result);
214910
214982
  }
214911
214983
  return undefined;
214912
214984
  }
214913
- /** Compute the cross product of vectors from from indexed origin to indexed targets i and j */
214985
+ /** Compute the cross product of vectors from from indexed origin to indexed targets i and j. */
214914
214986
  crossProductIndexIndexIndex(originIndex, targetAIndex, targetBIndex, result) {
214915
214987
  if (this.isIndexValid(originIndex) && this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {
214916
214988
  const i = originIndex * 3;
214917
214989
  const j = targetAIndex * 3;
214918
214990
  const k = targetBIndex * 3;
214919
214991
  const data = this._data;
214920
- return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.crossProductXYZXYZ(data[j] - data[i], data[j + 1] - data[i + 1], data[j + 2] - data[i + 2], data[k] - data[i], data[k + 1] - data[i + 1], data[k + 2] - data[i + 2], result);
214992
+ return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.crossProductXYZXYZ(data[j] - data[i], data[j + 1] - data[i + 1], data[j + 2] - data[i + 2], data[k] - data[i], data[k + 1] - data[i + 1], data[k + 2] - data[i + 2], result);
214921
214993
  }
214922
214994
  return undefined;
214923
214995
  }
@@ -214965,7 +215037,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214965
215037
  const j = targetAIndex * 3;
214966
215038
  const k = targetBIndex * 3;
214967
215039
  const data = this._data;
214968
- return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.crossProductXYZXYZ(data[j] - origin.x, data[j + 1] - origin.y, data[j + 2] - origin.z, data[k] - origin.x, data[k + 1] - origin.y, data[k + 2] - origin.z, result);
215040
+ return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.crossProductXYZXYZ(data[j] - origin.x, data[j + 1] - origin.y, data[j + 2] - origin.z, data[k] - origin.x, data[k + 1] - origin.y, data[k + 2] - origin.z, result);
214969
215041
  }
214970
215042
  return undefined;
214971
215043
  }
@@ -214973,7 +215045,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214973
215045
  distanceIndexToPoint(i, spacePoint) {
214974
215046
  if (this.isIndexValid(i)) {
214975
215047
  const i0 = 3 * i;
214976
- return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.hypotenuseXYZ(spacePoint.x - this._data[i0], spacePoint.y - this._data[i0 + 1], spacePoint.z - this._data[i0 + 2]);
215048
+ return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseXYZ(spacePoint.x - this._data[i0], spacePoint.y - this._data[i0 + 1], spacePoint.z - this._data[i0 + 2]);
214977
215049
  }
214978
215050
  return undefined;
214979
215051
  }
@@ -214986,7 +215058,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214986
215058
  if (this.isIndexValid(i) && this.isIndexValid(j)) {
214987
215059
  const i0 = 3 * i;
214988
215060
  const j0 = 3 * j;
214989
- return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.hypotenuseSquaredXYZ(this._data[j0] - this._data[i0], this._data[j0 + 1] - this._data[i0 + 1], this._data[j0 + 2] - this._data[i0 + 2]);
215061
+ return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseSquaredXYZ(this._data[j0] - this._data[i0], this._data[j0 + 1] - this._data[i0 + 1], this._data[j0 + 2] - this._data[i0 + 2]);
214990
215062
  }
214991
215063
  return undefined;
214992
215064
  }
@@ -214999,7 +215071,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
214999
215071
  if (this.isIndexValid(i) && this.isIndexValid(j)) {
215000
215072
  const i0 = 3 * i;
215001
215073
  const j0 = 3 * j;
215002
- return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.hypotenuseXYZ(this._data[j0] - this._data[i0], this._data[j0 + 1] - this._data[i0 + 1], this._data[j0 + 2] - this._data[i0 + 2]);
215074
+ return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseXYZ(this._data[j0] - this._data[i0], this._data[j0 + 1] - this._data[i0 + 1], this._data[j0 + 2] - this._data[i0 + 2]);
215003
215075
  }
215004
215076
  return undefined;
215005
215077
  }
@@ -215008,7 +215080,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
215008
215080
  if (arrayA.isIndexValid(i) && arrayB.isIndexValid(j)) {
215009
215081
  const i0 = 3 * i;
215010
215082
  const j0 = 3 * j;
215011
- return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.hypotenuseXYZ(arrayB._data[j0] - arrayA._data[i0], arrayB._data[j0 + 1] - arrayA._data[i0 + 1], arrayB._data[j0 + 2] - arrayA._data[i0 + 2]);
215083
+ return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseXYZ(arrayB._data[j0] - arrayA._data[i0], arrayB._data[j0 + 1] - arrayA._data[i0 + 1], arrayB._data[j0 + 2] - arrayA._data[i0 + 2]);
215012
215084
  }
215013
215085
  return undefined;
215014
215086
  }
@@ -215090,7 +215162,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
215090
215162
  const range = _Range__WEBPACK_IMPORTED_MODULE_5__.Range1d.createNull();
215091
215163
  while (i < n) {
215092
215164
  k0 = 3 * i;
215093
- range.extendX(_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.hypotenuseXYZ(dataA[k0] - dataB[k0], dataA[k0 + 1] - dataB[k0 + 1], dataA[k0 + 2] - dataB[k0 + 2]));
215165
+ range.extendX(_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseXYZ(dataA[k0] - dataB[k0], dataA[k0 + 1] - dataB[k0 + 1], dataA[k0 + 2] - dataB[k0 + 2]));
215094
215166
  i++;
215095
215167
  }
215096
215168
  return range;
@@ -215100,7 +215172,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
215100
215172
  * @param points
215101
215173
  * @param tolerance
215102
215174
  */
215103
- static removeClosure(points, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.smallMetricDistance) {
215175
+ static removeClosure(points, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
215104
215176
  while (points.length > 1 && points.distanceIndexIndex(0, points.length - 1) < tolerance)
215105
215177
  points.pop();
215106
215178
  }
@@ -215459,6 +215531,13 @@ class IndexedXYZCollection {
215459
215531
  return undefined;
215460
215532
  return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseSquaredXYZ(target.x - this.getXAtUncheckedPointIndex(index0), target.y - this.getYAtUncheckedPointIndex(index0), target.z - this.getZAtUncheckedPointIndex(index0));
215461
215533
  }
215534
+ /**
215535
+ * Test if index is valid for an xyz within this array.
215536
+ * @param index xyz index to test.
215537
+ */
215538
+ isIndexValid(index) {
215539
+ return index >= 0 && index < this.length;
215540
+ }
215462
215541
  /** Adjust index into range by modulo with the length. */
215463
215542
  cyclicIndex(i) {
215464
215543
  return (i % this.length);
@@ -215475,24 +215554,31 @@ class IndexedXYZCollection {
215475
215554
  return range;
215476
215555
  }
215477
215556
  /**
215478
- * For each run of points with indices i+1 to i+n within distance tolerance of points[i], return the indices i+1, ..., i+n.
215557
+ * For each subset of `k` successive points within tolerance of the first point in the subset, return the indices of
215558
+ * the last `k-1` duplicates.
215559
+ * * Index `0` is never returned.
215560
+ * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])
215561
+ * @param preserveLast if the last `k < this.length` points of the instance are duplicates, whether to return the
215562
+ * indices of the *first* `k-1` duplicates for this last run. If true, index `this.length - 1` is not returned
215563
+ * unless all points are duplicates, in which case all indices but `0` are returned. Default value is false.
215479
215564
  * @return ordered array of 0-based indices of duplicate points
215480
215565
  */
215481
- findOrderedDuplicates(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
215482
- const tol2 = tolerance * tolerance;
215566
+ findOrderedDuplicates(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance, preserveLast = false) {
215483
215567
  const indices = [];
215484
215568
  if (this.length > 1) {
215485
215569
  for (let i = 0; i < this.length - 1;) {
215486
215570
  let j = i + 1;
215487
- for (; j < this.length; ++j) {
215488
- const dist2 = this.distanceSquaredIndexIndex(i, j);
215489
- if (dist2 !== undefined && dist2 < tol2)
215490
- indices.push(j);
215491
- else
215492
- break;
215493
- }
215571
+ for (; this.almostEqualIndexIndex(i, j, tolerance); ++j)
215572
+ indices.push(j);
215494
215573
  i = j; // found next unique point
215495
215574
  }
215575
+ if (preserveLast && indices.length > 0 && indices.length < this.length - 1) { // not all points are duplicate
215576
+ let numLastRun = 0;
215577
+ for (; numLastRun <= indices.length - 1 && indices[indices.length - 1 - numLastRun] === this.length - 1 - numLastRun; ++numLastRun)
215578
+ ;
215579
+ for (let i = 0; i < numLastRun; ++i)
215580
+ indices[indices.length - 1 - i] -= 1; // decrement the indices of the last run so that the last point is preserved
215581
+ }
215496
215582
  }
215497
215583
  return indices;
215498
215584
  }
@@ -216391,12 +216477,11 @@ class Matrix3d {
216391
216477
  return undefined;
216392
216478
  }
216393
216479
  /**
216394
- * Construct a rigid matrix (orthogonal matrix with +1 determinant) using vectorA and its 2 perpendicular.
216480
+ * Construct a rigid matrix (orthogonal matrix with determinant 1) using vectorA and its 2 perpendiculars.
216395
216481
  * * If axisOrder is not passed then `AxisOrder = AxisOrder.ZXY` is used as default.
216396
216482
  * * This function internally uses createPerpendicularVectorFavorXYPlane and createRigidFromColumns.
216397
- * * If you want to rotate a given plane (which contains (0,0,0)) to the xy-plane, pass the normal vector of
216398
- * your plane into createRigidHeadsUp. The transpose of the returned Matrix3d can be used to rotate your plane
216399
- * to the xy-plane. If plane does not contain (0,0,0) then the plane is rotated to a plane parallel to the xy-plane.
216483
+ * * Passing the normal of a plane P into this method returns a matrix whose transpose rotates geometry in P
216484
+ * to the xy-plane if P contains the origin, or to a plane parallel to the xy-plane if P does not contain the origin.
216400
216485
  * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/2PerpendicularVectorsTo1Vector
216401
216486
  */
216402
216487
  static createRigidHeadsUp(vectorA, axisOrder = _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.ZXY, result) {
@@ -220471,7 +220556,7 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
220471
220556
  }
220472
220557
  /** Test if `index` is a valid index into the array. */
220473
220558
  isValidIndex(index) {
220474
- return index >= 0 && index < this.data.length;
220559
+ return this.isIndexValid(index);
220475
220560
  }
220476
220561
  /**
220477
220562
  * Access by index, returning strongly typed Point3d
@@ -221734,10 +221819,10 @@ class Vector3d extends XYZ {
221734
221819
  return unitNormal ? unitNormal.crossProduct(this).plusScaled(unitNormal, unitNormal.dotProduct(this), result) : undefined;
221735
221820
  }
221736
221821
  /**
221737
- * Return a vector computed at fractional position between this vector and vectorB
221738
- * @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`.
221739
- * True fractions are "between", negatives are "before this", beyond 1 is "beyond vectorB".
221740
- * @param vectorB second vector
221822
+ * Return a vector computed at fractional position between this vector and vectorB.
221823
+ * @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`. True fractions are "between",
221824
+ * negatives are "before this", beyond 1 is "beyond vectorB".
221825
+ * @param vectorB second vector.
221741
221826
  * @param result optional preallocated result.
221742
221827
  */
221743
221828
  interpolate(fraction, vectorB, result) {
@@ -225644,6 +225729,7 @@ class PolylineOps {
225644
225729
  * * This is a local search, with a single pass over the data.
225645
225730
  * @param source input points
225646
225731
  * @param maxEdgeLength
225732
+ * @see [[GrowableXYZArray.cloneCompressed]]
225647
225733
  */
225648
225734
  static compressShortEdges(source, maxEdgeLength) {
225649
225735
  const dest = _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_2__.GrowableXYZArray.create(source);
@@ -225815,13 +225901,15 @@ class PolylineOps {
225815
225901
  }
225816
225902
  /** Create an array of planes.
225817
225903
  * * First plane has origin at first centerline point, with unit normal directed at the next point.
225818
- * * Intermediate planes have origin at intermediate points, with unit normals computed from the average of unit vectors along the incoming and outgoing segments.
225904
+ * * Intermediate planes have origin at intermediate points, with unit normals computed from the average of unit vectors
225905
+ * along the incoming and outgoing segments.
225819
225906
  * * Last plane has origin at last centerline point, with unit normal directed from previous point.
225820
225907
  * * All sets of adjacent coincident points are reduced to a single point.
225821
225908
  * * Hence the output array may have fewer points than the centerline.
225822
- * * If there are one or fewer distinct input points, the return is undefined
225823
- * @param centerline points to reside in output planes
225824
- * @param wrapIfPhysicallyClosed if true and the first and last centerline points are the same, then the first and last output planes are averaged and equated (cloned).
225909
+ * * If there are one or fewer distinct input points, the return is undefined.
225910
+ * @param centerline points to reside in output planes.
225911
+ * @param wrapIfPhysicallyClosed if true and the first and last centerline points are the same, then the first and last
225912
+ * output planes are averaged and equated (cloned).
225825
225913
  */
225826
225914
  static createBisectorPlanesForDistinctPoints(centerline, wrapIfPhysicallyClosed = false) {
225827
225915
  const packedPoints = PolylineOps.compressShortEdges(centerline, 2.0 * _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance); // double the tolerance to ensure normalized vectors exist.
@@ -240557,29 +240645,28 @@ __webpack_require__.r(__webpack_exports__);
240557
240645
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
240558
240646
  /* harmony export */ "PolyfaceBuilder": () => (/* binding */ PolyfaceBuilder)
240559
240647
  /* harmony export */ });
240648
+ /* harmony import */ var _curve_Arc3d__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../curve/Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
240560
240649
  /* harmony import */ var _curve_ConstructCurveBetweenCurves__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../curve/ConstructCurveBetweenCurves */ "../../core/geometry/lib/esm/curve/ConstructCurveBetweenCurves.js");
240561
240650
  /* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
240562
240651
  /* harmony import */ var _curve_CurveFactory__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../curve/CurveFactory */ "../../core/geometry/lib/esm/curve/CurveFactory.js");
240563
240652
  /* harmony import */ var _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../curve/CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
240564
- /* harmony import */ var _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../curve/GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
240565
240653
  /* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
240566
240654
  /* harmony import */ var _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../curve/ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
240567
240655
  /* harmony import */ var _curve_Query_CylindricalRange__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../curve/Query/CylindricalRange */ "../../core/geometry/lib/esm/curve/Query/CylindricalRange.js");
240568
240656
  /* harmony import */ var _curve_Query_StrokeCountChain__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../curve/Query/StrokeCountChain */ "../../core/geometry/lib/esm/curve/Query/StrokeCountChain.js");
240569
240657
  /* harmony import */ var _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../curve/StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
240570
240658
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
240571
- /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
240659
+ /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
240572
240660
  /* harmony import */ var _geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../geometry3d/BilinearPatch */ "../../core/geometry/lib/esm/geometry3d/BilinearPatch.js");
240573
240661
  /* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
240574
240662
  /* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
240575
240663
  /* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
240576
240664
  /* harmony import */ var _geometry3d_GrowableXYArray__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../geometry3d/GrowableXYArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYArray.js");
240577
240665
  /* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
240578
- /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
240579
240666
  /* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
240580
240667
  /* harmony import */ var _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndVectors */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndVectors.js");
240581
240668
  /* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
240582
- /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
240669
+ /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
240583
240670
  /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
240584
240671
  /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
240585
240672
  /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
@@ -240592,15 +240679,17 @@ __webpack_require__.r(__webpack_exports__);
240592
240679
  /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
240593
240680
  /* harmony import */ var _BoxTopology__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./BoxTopology */ "../../core/geometry/lib/esm/polyface/BoxTopology.js");
240594
240681
  /* harmony import */ var _GreedyTriangulationBetweenLineStrings__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./GreedyTriangulationBetweenLineStrings */ "../../core/geometry/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js");
240595
- /* harmony import */ var _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./IndexedEdgeMatcher */ "../../core/geometry/lib/esm/polyface/IndexedEdgeMatcher.js");
240596
- /* harmony import */ var _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./IndexedPolyfaceVisitor */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceVisitor.js");
240682
+ /* harmony import */ var _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./IndexedEdgeMatcher */ "../../core/geometry/lib/esm/polyface/IndexedEdgeMatcher.js");
240683
+ /* harmony import */ var _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./IndexedPolyfaceVisitor */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceVisitor.js");
240597
240684
  /* harmony import */ var _Polyface__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
240598
- /* harmony import */ var _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
240685
+ /* harmony import */ var _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
240599
240686
  /*---------------------------------------------------------------------------------------------
240600
240687
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
240601
240688
  * See LICENSE.md in the project root for license terms and full copyright notice.
240602
240689
  *--------------------------------------------------------------------------------------------*/
240603
-
240690
+ /** @packageDocumentation
240691
+ * @module Polyface
240692
+ */
240604
240693
 
240605
240694
 
240606
240695
 
@@ -242425,16 +242514,25 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
242425
242514
  const context = _GreedyTriangulationBetweenLineStrings__WEBPACK_IMPORTED_MODULE_30__.GreedyTriangulationBetweenLineStrings.createContext();
242426
242515
  context.emitTriangles(resolveToIndexedXYZCollectionOrCarrier(pointsA), resolveToIndexedXYZCollectionOrCarrier(pointsB), (triangle) => { this.addTriangleFacet(triangle.points); });
242427
242516
  }
242428
- addMiteredPipesFromPoints(centerline, sectionData, numFacetAround = 12) {
242517
+ /** Doc is same as `addMiteredPipes` doc. */
242518
+ addMiteredPipesFromPoints(centerline, sectionData, numFacetAround = 12, capped = false) {
242429
242519
  const sections = _curve_CurveFactory__WEBPACK_IMPORTED_MODULE_31__.CurveFactory.createMiteredPipeSections(centerline, sectionData);
242430
242520
  const pointA0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
242431
242521
  const pointA1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
242432
242522
  const pointB0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
242433
242523
  const pointB1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
242524
+ const wantCaps = capped && (!(sectionData instanceof _curve_Arc3d__WEBPACK_IMPORTED_MODULE_32__.Arc3d) || sectionData.sweep.isFullCircle);
242434
242525
  if (numFacetAround < 3)
242435
242526
  numFacetAround = 3;
242436
242527
  const df = 1.0 / numFacetAround;
242437
- for (let i = 1; i < sections.length; i++) {
242528
+ if (wantCaps) { // start cap facets
242529
+ const startLineString = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d.create();
242530
+ for (let i = 0; i < numFacetAround; i++)
242531
+ startLineString.addPoint(sections[0].fractionToPoint(i * df));
242532
+ this.addTrianglesInUncheckedConvexPolygon(startLineString, true);
242533
+ this.endFace();
242534
+ }
242535
+ for (let i = 1; i < sections.length; i++) { // side facets
242438
242536
  const arcA = sections[i - 1];
242439
242537
  const arcB = sections[i];
242440
242538
  arcA.fractionToPoint(0.0, pointA0);
@@ -242443,38 +242541,44 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
242443
242541
  const f = k * df;
242444
242542
  arcA.fractionToPoint(f, pointA1);
242445
242543
  arcB.fractionToPoint(f, pointB1);
242446
- this.addQuadFacet([pointA0, pointB0, pointB1, pointA1]);
242544
+ this.addQuadFacet([pointA0, pointA1, pointB1, pointB0]); // ASSUME: CCW section traversal wrt rail tangent
242447
242545
  }
242448
242546
  }
242547
+ if (wantCaps) { // end cap facets
242548
+ const endLineString = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d.create();
242549
+ for (let i = 0; i < numFacetAround; i++)
242550
+ endLineString.addPoint(sections[sections.length - 1].fractionToPoint(i * df));
242551
+ this.addTrianglesInUncheckedConvexPolygon(endLineString, false);
242552
+ this.endFace();
242553
+ }
242449
242554
  }
242450
242555
  /**
242451
242556
  * Add quad facets along a mitered pipe that follows a centerline curve.
242557
+ * * At the end of each pipe segment, the pipe is mitered by the plane that bisects the angle between successive
242558
+ * centerline segments.
242452
242559
  * * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis
242453
- * lengths, or a full Arc3d:
242454
- * * For semi-axis length input, x corresponds to an ellipse local axis nominally situated parallel to the xy-plane.
242455
- * * For Arc3d input, the center is translated to the centerline start point to act as initial cross section.
242456
- * @param centerline centerline of pipe. If curved, it will be stroked using the builder's StrokeOptions.
242457
- * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d.
242560
+ * lengths, or an Arc3d:
242561
+ * * For semi-axis length input, x and y correspond to ellipse local axes perpendicular to each other and to the
242562
+ * start tangent.
242563
+ * * For Arc3d input, the center is translated to the centerline start point, but otherwise the arc is used as-is
242564
+ * for the first section. For best results, the arc should be perpendicular to the centerline start tangent.
242565
+ * @param centerline centerline of pipe. If curved, it will be stroked using the builder's StrokeOptions, otherwise
242566
+ * for best results, ensure no successive duplicate points with e.g., [[GrowableXYZArray.createCompressed]].
242567
+ * @param sectionData circle radius, ellipse semi-axis lengths, or Arc3d.
242458
242568
  * @param numFacetAround how many equal parameter-space chords around each section.
242459
- */
242460
- addMiteredPipes(centerline, sectionData, numFacetAround = 12) {
242461
- if (Array.isArray(centerline)) {
242462
- this.addMiteredPipesFromPoints(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_32__.Point3dArrayCarrier(centerline), sectionData, numFacetAround);
242463
- }
242464
- else if (centerline instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__.GrowableXYZArray) {
242465
- this.addMiteredPipesFromPoints(centerline, sectionData, numFacetAround);
242466
- }
242467
- else if (centerline instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_33__.IndexedXYZCollection) {
242468
- this.addMiteredPipesFromPoints(centerline, sectionData, numFacetAround);
242469
- }
242470
- else if (centerline instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d) {
242471
- this.addMiteredPipesFromPoints(centerline.packedPoints, sectionData, numFacetAround);
242472
- }
242473
- else if (centerline instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_34__.GeometryQuery) {
242569
+ * @param capped if `true`, add a cap at each end of the pipe; defaults to `false`.
242570
+ */
242571
+ addMiteredPipes(centerline, sectionData, numFacetAround = 12, capped = false) {
242572
+ if (Array.isArray(centerline))
242573
+ centerline = new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_33__.Point3dArrayCarrier(centerline);
242574
+ else if (centerline instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d)
242575
+ centerline = centerline.packedPoints;
242576
+ else if (centerline instanceof _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_19__.CurvePrimitive) {
242474
242577
  const linestring = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d.create();
242475
242578
  centerline.emitStrokes(linestring, this._options);
242476
- this.addMiteredPipesFromPoints(linestring.packedPoints, sectionData, numFacetAround);
242579
+ centerline = linestring.packedPoints;
242477
242580
  }
242581
+ this.addMiteredPipesFromPoints(centerline, sectionData, numFacetAround, capped);
242478
242582
  }
242479
242583
  /** Return the polyface index array indices corresponding to the given edge, or `undefined` if error. */
242480
242584
  getEdgeIndices(edge) {
@@ -242546,10 +242650,10 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
242546
242650
  */
242547
242651
  addSweptIndexedPolyface(source, sweepVector, triangulateSides = false) {
242548
242652
  let isSimpleSweep = true;
242549
- const totalProjectedArea = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_35__.PolyfaceQuery.sumFacetAreas(source, sweepVector);
242653
+ const totalProjectedArea = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__.PolyfaceQuery.sumFacetAreas(source, sweepVector);
242550
242654
  if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isAlmostEqualNumber(0.0, totalProjectedArea))
242551
242655
  isSimpleSweep = false;
242552
- const partitionedIndices = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_35__.PolyfaceQuery.partitionFacetIndicesByVisibilityVector(source, sweepVector, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_36__.Angle.createDegrees(1.0e-3));
242656
+ const partitionedIndices = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__.PolyfaceQuery.partitionFacetIndicesByVisibilityVector(source, sweepVector, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_35__.Angle.createDegrees(1.0e-3));
242553
242657
  const numForwardFacets = partitionedIndices[0].length;
242554
242658
  const numBackwardFacets = partitionedIndices[1].length;
242555
242659
  const numSideFacets = partitionedIndices[2].length;
@@ -242566,15 +242670,15 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
242566
242670
  // collect base edges added to the builder, and extract boundary
242567
242671
  const numBaseFacets = firstSweptFacet - firstBaseFacet;
242568
242672
  const baseFacetIndices = Array.from({ length: numBaseFacets }, (_, i) => firstBaseFacet + i);
242569
- const baseFacetVisitor = _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_37__.IndexedPolyfaceSubsetVisitor.createSubsetVisitor(this._polyface, baseFacetIndices, 1);
242570
- const baseEdges = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_35__.PolyfaceQuery.createIndexedEdges(baseFacetVisitor);
242673
+ const baseFacetVisitor = _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_36__.IndexedPolyfaceSubsetVisitor.createSubsetVisitor(this._polyface, baseFacetIndices, 1);
242674
+ const baseEdges = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__.PolyfaceQuery.createIndexedEdges(baseFacetVisitor);
242571
242675
  const baseBoundaryEdges = [];
242572
242676
  baseEdges.sortAndCollectClusters(undefined, baseBoundaryEdges, undefined, undefined);
242573
242677
  // add a side face per boundary edge
242574
242678
  const oldShouldTriangulate = this._options.shouldTriangulate;
242575
242679
  this._options.shouldTriangulate = triangulateSides;
242576
242680
  for (const edgeOrCluster of baseBoundaryEdges) {
242577
- if (edgeOrCluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_38__.SortableEdge)
242681
+ if (edgeOrCluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_37__.SortableEdge)
242578
242682
  this.addSweptFace(edgeOrCluster, numBaseFacets);
242579
242683
  else if (Array.isArray(edgeOrCluster))
242580
242684
  for (const edge of edgeOrCluster)
@@ -242589,7 +242693,7 @@ PolyfaceBuilder._workVectorFindOrAdd = _geometry3d_Point3dVector3d__WEBPACK_IMPO
242589
242693
  PolyfaceBuilder._workUVFindOrAdd = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_1__.Point2d.create();
242590
242694
  function resolveToIndexedXYZCollectionOrCarrier(points) {
242591
242695
  if (Array.isArray(points))
242592
- return new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_32__.Point3dArrayCarrier(points);
242696
+ return new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_33__.Point3dArrayCarrier(points);
242593
242697
  if (points instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d)
242594
242698
  return points.packedPoints;
242595
242699
  return points;
@@ -257187,7 +257291,7 @@ class Sample {
257187
257291
  }
257188
257292
  return result;
257189
257293
  }
257190
- /** Create various orders of non-rational B-spline curves with helical poles */
257294
+ /** Create various orders of non-rational B-spline curves with helical poles. */
257191
257295
  static createBsplineCurveHelices(radius, height, numTurns, numSamplesPerTurn) {
257192
257296
  const pts = [];
257193
257297
  const zDelta = (height / numTurns) / numSamplesPerTurn;
@@ -258877,11 +258981,11 @@ class Sample {
258877
258981
  return result;
258878
258982
  }
258879
258983
  /**
258880
- * Create points on a sine wave
258881
- * Point i is origin + (i * xStep, a *sin(theta0 + i * dTheta), b * sin(beta0 + i * dBeta))
258882
- * * Default b is zero, so it is a simple sine wave
258984
+ * Create points on a sine wave.
258985
+ * * Point i is origin + (i * xStep, a *sin(theta0 + i * dTheta), b * sin(beta0 + i * dBeta)).
258986
+ * * Default b is zero, so it is a simple sine wave.
258883
258987
  * * If the dTheta and dBeta are equal, it is a sine wave in a tilted plane.
258884
- * * If dTheta and dBeta are different it is a non-planar curve
258988
+ * * If dTheta and dBeta are different it is a non-planar curve.
258885
258989
  */
258886
258990
  static createPointSineWave(origin, numInterval = 24, xStep = Math.PI / 12, a = 1, thetaSweep = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(0, 360), b = 0, betaSweep = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_0__.AngleSweep.createStartEndDegrees(0, 180)) {
258887
258991
  return this.createPointsByIndexFunctions(numInterval, SteppedIndexFunctionFactory.createLinear(xStep, origin ? origin.x : 0), SteppedIndexFunctionFactory.createCosine(a, thetaSweep, origin ? origin.y : 0), SteppedIndexFunctionFactory.createCosine(b, betaSweep, origin ? origin.z : 0));
@@ -304935,7 +305039,7 @@ var loadLanguages = instance.loadLanguages;
304935
305039
  /***/ ((module) => {
304936
305040
 
304937
305041
  "use strict";
304938
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.14","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run --coverage","test:debug":"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:^5.0.0-dev.14","@itwin/core-bentley":"workspace:^5.0.0-dev.14","@itwin/core-common":"workspace:^5.0.0-dev.14","@itwin/core-geometry":"workspace:^5.0.0-dev.14","@itwin/core-orbitgt":"workspace:^5.0.0-dev.14","@itwin/core-quantity":"workspace:^5.0.0-dev.14"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^2.1.0","@vitest/coverage-v8":"^2.1.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","cpx2":"^3.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^3.0.2","source-map-loader":"^4.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^2.1.0","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"1.0.6","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.2.5","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","meshoptimizer":"~0.20.0","wms-capabilities":"0.4.0"}}');
305042
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.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","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 ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run --coverage","test:debug":"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:^5.0.0-dev.16","@itwin/core-bentley":"workspace:^5.0.0-dev.16","@itwin/core-common":"workspace:^5.0.0-dev.16","@itwin/core-geometry":"workspace:^5.0.0-dev.16","@itwin/core-orbitgt":"workspace:^5.0.0-dev.16","@itwin/core-quantity":"workspace:^5.0.0-dev.16"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^2.1.0","@vitest/coverage-v8":"^2.1.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","cpx2":"^3.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^3.0.2","source-map-loader":"^4.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^2.1.0","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"1.0.6","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.2.5","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","meshoptimizer":"~0.20.0","wms-capabilities":"0.4.0"}}');
304939
305043
 
304940
305044
  /***/ })
304941
305045