@itwin/rpcinterface-full-stack-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.
@@ -191998,11 +191998,12 @@ __webpack_require__.r(__webpack_exports__);
191998
191998
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
191999
191999
  /* harmony export */ "BSplineCurveOps": () => (/* binding */ BSplineCurveOps)
192000
192000
  /* harmony export */ });
192001
- /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
192001
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
192002
192002
  /* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
192003
192003
  /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
192004
+ /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
192004
192005
  /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
192005
- /* harmony import */ var _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/PointHelpers */ "../../core/geometry/lib/esm/geometry3d/PointHelpers.js");
192006
+ /* harmony import */ var _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/PointHelpers */ "../../core/geometry/lib/esm/geometry3d/PointHelpers.js");
192006
192007
  /* harmony import */ var _numerics_BandedSystem__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../numerics/BandedSystem */ "../../core/geometry/lib/esm/numerics/BandedSystem.js");
192007
192008
  /* harmony import */ var _BSplineCurve__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
192008
192009
  /* harmony import */ var _KnotVector__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./KnotVector */ "../../core/geometry/lib/esm/bspline/KnotVector.js");
@@ -192021,6 +192022,7 @@ __webpack_require__.r(__webpack_exports__);
192021
192022
 
192022
192023
 
192023
192024
 
192025
+
192024
192026
  /**
192025
192027
  * A class with static methods for creating B-spline curves.
192026
192028
  * @public
@@ -192147,28 +192149,24 @@ class BSplineCurveOps {
192147
192149
  static removeDuplicateFitPoints(options) {
192148
192150
  if (undefined !== options.knots && options.knots.length !== options.fitPoints.length)
192149
192151
  options.knots = undefined;
192150
- // get indices of duplicate points to be removed
192151
- const newPts = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_0__.GrowableXYZArray.create(options.fitPoints);
192152
- const indices = newPts.findOrderedDuplicates();
192153
- newPts.clear();
192154
- // remove duplicate fit points
192155
- for (let iRead = 0, iIndex = 0; iRead < options.fitPoints.length; ++iRead) {
192156
- if (iRead === indices[iIndex])
192157
- ++iIndex; // skip the duplicate
192158
- else
192159
- newPts.push(options.fitPoints[iRead].clone());
192160
- }
192161
- options.fitPoints = newPts.getPoint3dArray();
192162
- // remove params corresponding to removed fit points
192163
- if (undefined !== options.knots) {
192164
- const newKnots = [];
192165
- for (let iRead = 0, iIndex = 0; iRead < options.knots.length; ++iRead) {
192166
- if (iRead === indices[iIndex])
192167
- ++iIndex; // skip
192168
- else
192169
- newKnots.push(options.knots[iRead]);
192152
+ const carrier = new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_6__.Point3dArrayCarrier(options.fitPoints);
192153
+ const indices = carrier.findOrderedDuplicates(undefined, true); // use default tolerance
192154
+ if (indices.length > 0) {
192155
+ // remove duplicate fit points, and their corresponding params
192156
+ let iWrite = 0;
192157
+ for (let iRead = 0, iIndex = 0; iRead < options.fitPoints.length; ++iRead) {
192158
+ if (iIndex < indices.length && iRead === indices[iIndex])
192159
+ ++iIndex; // skip the duplicate
192160
+ else {
192161
+ options.fitPoints[iWrite] = options.fitPoints[iRead];
192162
+ if (options.knots)
192163
+ options.knots[iWrite] = options.knots[iRead];
192164
+ ++iWrite;
192165
+ }
192170
192166
  }
192171
- options.knots = newKnots.slice();
192167
+ options.fitPoints.splice(iWrite);
192168
+ if (options.knots)
192169
+ options.knots.splice(iWrite);
192172
192170
  }
192173
192171
  return true;
192174
192172
  }
@@ -192618,25 +192616,25 @@ class BSplineCurveOps {
192618
192616
  let tmp = 0.0;
192619
192617
  // first forward substitution
192620
192618
  for (let i = 1; i < numIntervals; ++i) {
192621
- if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.conditionalDivideFraction(-alpha[i], beta[i - 1])))
192619
+ if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_7__.Geometry.conditionalDivideFraction(-alpha[i], beta[i - 1])))
192622
192620
  return undefined;
192623
192621
  beta[i] += tmp * gamma[i - 1];
192624
192622
  alpha[i] = tmp * alpha[i - 1];
192625
192623
  leftPts[i].addScaledInPlace(leftPts[i - 1], tmp);
192626
192624
  }
192627
192625
  // first backward substitution
192628
- if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.conditionalDivideFraction(1.0, beta[numIntervals - 1] + alpha[numIntervals - 1])))
192626
+ if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_7__.Geometry.conditionalDivideFraction(1.0, beta[numIntervals - 1] + alpha[numIntervals - 1])))
192629
192627
  return undefined;
192630
192628
  gamma[numIntervals - 1] *= tmp;
192631
192629
  leftPts[numIntervals - 1].scaleInPlace(tmp);
192632
192630
  for (let i = numIntervals - 2; i >= 0; --i) {
192633
- if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.conditionalDivideFraction(1.0, beta[i])))
192631
+ if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_7__.Geometry.conditionalDivideFraction(1.0, beta[i])))
192634
192632
  return undefined;
192635
192633
  _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.createScale(leftPts[i].plus2Scaled(leftPts[i + 1], -gamma[i], leftPts[numIntervals - 1], -alpha[i]), tmp, leftPts[i]);
192636
192634
  gamma[i] = -(gamma[i] * gamma[i + 1] + alpha[i] * gamma[numIntervals - 1]) * tmp;
192637
192635
  }
192638
192636
  // second forward substitution
192639
- if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.conditionalDivideFraction(1.0, 1.0 + gamma[0])))
192637
+ if (undefined === (tmp = _Geometry__WEBPACK_IMPORTED_MODULE_7__.Geometry.conditionalDivideFraction(1.0, 1.0 + gamma[0])))
192640
192638
  return undefined;
192641
192639
  poles.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.createScale(leftPts[0], tmp));
192642
192640
  for (let i = 1; i < numIntervals; ++i) {
@@ -192757,7 +192755,7 @@ class BSplineCurveOps {
192757
192755
  props.knots = this.convertFitParamsToCubicKnotVector(props.knots, props.closed, true);
192758
192756
  }
192759
192757
  else {
192760
- props.knots = this.constructFitParametersFromPoints(_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_7__.Point3dArray.clonePoint3dArray(props.fitPoints), props.isChordLenKnots, props.closed);
192758
+ props.knots = this.constructFitParametersFromPoints(_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_8__.Point3dArray.clonePoint3dArray(props.fitPoints), props.isChordLenKnots, props.closed);
192761
192759
  props.knots = this.convertFitParamsToCubicKnotVector(props.knots, props.closed, true);
192762
192760
  }
192763
192761
  }
@@ -201953,10 +201951,17 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
201953
201951
  isSameGeometryClass(other) {
201954
201952
  return other instanceof Arc3d;
201955
201953
  }
201956
- /** Read property for (clone of) center. */
201954
+ /** Read/write the center. Getter returns clone. */
201957
201955
  get center() {
201958
201956
  return this._center.clone();
201959
201957
  }
201958
+ set center(center) {
201959
+ this._center.setFrom(center);
201960
+ }
201961
+ /** Read property for (reference to) center. */
201962
+ get centerRef() {
201963
+ return this._center;
201964
+ }
201960
201965
  /** Read property for (clone of) vector0. */
201961
201966
  get vector0() {
201962
201967
  return this._matrix.columnX();
@@ -201977,7 +201982,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
201977
201982
  get matrixRef() {
201978
201983
  return this._matrix;
201979
201984
  }
201980
- /** Sweep of the angle. */
201985
+ /** Read/write the sweep. Getter returns reference. */
201981
201986
  get sweep() {
201982
201987
  return this._sweep;
201983
201988
  }
@@ -204936,7 +204941,7 @@ var MiteredSweepOutputSelect;
204936
204941
  * @public
204937
204942
  */
204938
204943
  class CurveFactory {
204939
- /** (cautiously) construct and save a line segment between fractional positions. */
204944
+ /** (Cautiously) construct and save a line segment between fractional positions. */
204940
204945
  static addPartialSegment(path, allowBackup, pointA, pointB, fraction0, fraction1) {
204941
204946
  if (allowBackup || (fraction1 > fraction0)) {
204942
204947
  if (pointA !== undefined && pointB !== undefined && !_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(fraction0, fraction1))
@@ -205033,10 +205038,11 @@ class CurveFactory {
205033
205038
  }
205034
205039
  return path;
205035
205040
  }
205036
- /** Create a `Loop` with given xy corners and fixed z.
205041
+ /**
205042
+ * Create a `Loop` with given xy corners and fixed z.
205037
205043
  * * The corners always proceed counter clockwise from lower left.
205038
205044
  * * If the radius is too large for the outer rectangle size, it is reduced to half of the the smaller x or y size.
205039
- */
205045
+ */
205040
205046
  static createRectangleXY(x0, y0, x1, y1, z = 0, filletRadius) {
205041
205047
  let radius = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.correctSmallMetricDistance(filletRadius);
205042
205048
  const xMin = Math.min(x0, x1);
@@ -205045,7 +205051,13 @@ class CurveFactory {
205045
205051
  const yMax = Math.max(y0, y1);
205046
205052
  radius = Math.min(Math.abs(radius), 0.5 * (xMax - xMin), 0.5 * (yMax - yMin));
205047
205053
  if (radius === 0.0)
205048
- 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)]);
205054
+ return _Loop__WEBPACK_IMPORTED_MODULE_6__.Loop.createPolygon([
205055
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMin, yMin, z),
205056
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMax, yMin, z),
205057
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMax, yMax, z),
205058
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMin, yMax, z),
205059
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(xMin, yMin, z),
205060
+ ]);
205049
205061
  else {
205050
205062
  const vectorU = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(radius, 0, 0);
205051
205063
  const vectorV = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(0, radius, 0);
@@ -205053,7 +205065,12 @@ class CurveFactory {
205053
205065
  const y0A = yMin + radius;
205054
205066
  const x1A = xMax - radius;
205055
205067
  const y1A = yMax - radius;
205056
- 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)];
205068
+ const centers = [
205069
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x1A, y1A, z),
205070
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x0A, y1A, z),
205071
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x0A, y0A, z),
205072
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(x1A, y0A, z),
205073
+ ];
205057
205074
  const loop = _Loop__WEBPACK_IMPORTED_MODULE_6__.Loop.create();
205058
205075
  for (let i = 0; i < 4; i++) {
205059
205076
  const center = centers[i];
@@ -205073,10 +205090,10 @@ class CurveFactory {
205073
205090
  /**
205074
205091
  * If `arcB` is a continuation of `arcA`, extend `arcA` (in place) to include the range of `arcB`
205075
205092
  * * This only succeeds if the two arcs are part of identical complete arcs and end of `arcA` matches the beginning of `arcB`.
205076
- * @param arcA first arc, modified in place
205077
- * @param arcB second arc, unmodified
205078
- * @param allowReversed whether to consolidate even when second arc is reversed
205079
- * @returns whether `arcA` was modified
205093
+ * @param arcA first arc, modified in place.
205094
+ * @param arcB second arc, unmodified.
205095
+ * @param allowReversed whether to consolidate even when second arc is reversed.
205096
+ * @returns whether `arcA` was modified.
205080
205097
  */
205081
205098
  static appendToArcInPlace(arcA, arcB, allowReverse = false) {
205082
205099
  if (arcA.center.isAlmostEqual(arcB.center)) {
@@ -205092,7 +205109,7 @@ class CurveFactory {
205092
205109
  arcA.sweep.setStartEndRadians(arcA.sweep.startRadians, arcA.sweep.startRadians + arcA.sweep.sweepRadians + sweepSign * arcB.sweep.sweepRadians);
205093
205110
  return true;
205094
205111
  }
205095
- // Also ok if negated tangent . ..
205112
+ // Also ok if negated tangent
205096
205113
  if (allowReverse) {
205097
205114
  startB.direction.scaleInPlace(-1.0);
205098
205115
  if (endA.isAlmostEqual(startB)) {
@@ -205105,7 +205122,8 @@ class CurveFactory {
205105
205122
  }
205106
205123
  /**
205107
205124
  * Return a `Path` containing arcs are on the surface of an ellipsoid and pass through a sequence of points.
205108
- * * Each arc passes through the two given endpoints and in the plane containing the true surface normal at given `fractionForIntermediateNormal`
205125
+ * * Each arc passes through the two given endpoints and in the plane containing the true surface normal at
205126
+ * given `fractionForIntermediateNormal`
205109
205127
  * @param ellipsoid
205110
205128
  * @param pathPoints
205111
205129
  * @param fractionForIntermediateNormal fractional position for surface normal used to create the section plane.
@@ -205128,7 +205146,7 @@ class CurveFactory {
205128
205146
  }
205129
205147
  /**
205130
205148
  * Create solid primitives for pipe segments (e.g. Cone or TorusPipe) around line and arc primitives.
205131
- * @param centerline centerline geometry/
205149
+ * @param centerline centerline geometry.
205132
205150
  * @param pipeRadius radius of pipe.
205133
205151
  */
205134
205152
  static createPipeSegments(centerline, pipeRadius) {
@@ -205154,16 +205172,22 @@ class CurveFactory {
205154
205172
  return undefined;
205155
205173
  }
205156
205174
  /**
205157
- * * Create section arcs for mitered pipe.
205158
- * * At each end of each pipe, the pipe is cut by the plane that bisects the angle between successive pipe centerlines.
205159
- * * The arc definitions are constructed so that lines between corresponding fractional positions on the arcs are
205160
- * axial lines on the pipes.
205161
- * * This means that each arc definition axes (aka vector0 and vector90) are _not_ perpendicular to each other.
205162
- * * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis lengths, or a full Arc3d.
205163
- * * For semi-axis length input, x corresponds to an ellipse local axis nominally situated parallel to the xy-plane.
205164
- * * The center of Arc3d input is translated to the centerline start point to act as initial cross section.
205165
- * @param centerline centerline of pipe
205166
- * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d
205175
+ * Create section arcs for mitered pipe.
205176
+ * * At the end of each pipe segment, the pipe is mitered by the plane that bisects the angle between successive
205177
+ * centerline segments.
205178
+ * * The section arcs are constructed so that lines between corresponding fractional positions on the arcs are
205179
+ * axial lines on the pipes.
205180
+ * * This means that the initial arc's vector0 and vector90 lengths and angular separation are _not_ preserved in
205181
+ * the section arcs.
205182
+ * * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis
205183
+ * lengths, or an Arc3d:
205184
+ * * For semi-axis length input, x and y correspond to ellipse local axes perpendicular to each other and to the
205185
+ * start tangent.
205186
+ * * For Arc3d input, the center is translated to the centerline start point, but otherwise the arc is used as-is
205187
+ * for the first section. For best results, the arc should be perpendicular to the centerline start tangent.
205188
+ * @param centerline centerline of pipe. For best results, ensure no successive duplicate points with e.g.,
205189
+ * [[GrowableXYZArray.createCompressed]].
205190
+ * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d (if not full, function makes it full).
205167
205191
  */
205168
205192
  static createMiteredPipeSections(centerline, sectionData) {
205169
205193
  const arcs = [];
@@ -205172,15 +205196,15 @@ class CurveFactory {
205172
205196
  const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
205173
205197
  const vector90 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
205174
205198
  const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
205175
- const currentCenter = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
205176
- centerline.vectorIndexIndex(0, 1, vectorBC);
205177
- centerline.getPoint3dAtUncheckedPointIndex(0, currentCenter);
205178
- let initialSection;
205199
+ const sweep = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__.AngleSweep.create360();
205200
+ centerline.vectorIndexIndex(0, 1, vectorBC); // initially, the start tangent
205179
205201
  if (sectionData instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
205180
- initialSection = sectionData.clone();
205181
- initialSection.center.setFrom(currentCenter);
205182
205202
  vector0.setFrom(sectionData.vector0);
205183
205203
  vector90.setFrom(sectionData.vector90);
205204
+ sweep.setFrom(sectionData.sweep); // allow e.g., half-pipe
205205
+ const sectionFacesForward = sectionData.matrixRef.columnDotXYZ(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, vectorBC.x, vectorBC.y, vectorBC.z) > 0;
205206
+ if (sectionFacesForward !== sectionData.sweep.isCCW)
205207
+ sweep.reverseInPlace();
205184
205208
  }
205185
205209
  else if (typeof sectionData === "number" || _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.isXAndY(sectionData)) {
205186
205210
  const length0 = (typeof sectionData === "number") ? sectionData : sectionData.x;
@@ -205188,31 +205212,31 @@ class CurveFactory {
205188
205212
  const baseFrame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_15__.Matrix3d.createRigidHeadsUp(vectorBC, _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.ZXY);
205189
205213
  baseFrame.columnX(vector0).scaleInPlace(length0);
205190
205214
  baseFrame.columnY(vector90).scaleInPlace(length90);
205191
- initialSection = _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(currentCenter, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__.AngleSweep.create360());
205192
205215
  }
205193
205216
  else {
205194
205217
  return [];
205195
205218
  }
205219
+ // ASSUME: initial section normal points toward sweep direction for subsequent facet creation
205220
+ const initialSection = _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(undefined, vector0, vector90, sweep);
205221
+ centerline.getPoint3dAtUncheckedPointIndex(0, initialSection.centerRef);
205196
205222
  arcs.push(initialSection);
205197
205223
  const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
205198
205224
  const bisector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create();
205225
+ const center = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
205199
205226
  for (let i = 1; i < centerline.length; i++) {
205200
205227
  vectorAB.setFromVector3d(vectorBC);
205201
- centerline.getPoint3dAtUncheckedPointIndex(i, currentCenter);
205202
- if (i + 1 < centerline.length) {
205228
+ centerline.getPoint3dAtUncheckedPointIndex(i, center);
205229
+ if (i + 1 < centerline.length)
205203
205230
  centerline.vectorIndexIndex(i, i + 1, vectorBC);
205204
- }
205205
- else {
205231
+ else
205206
205232
  vectorBC.setFromVector3d(vectorAB);
205207
- }
205208
205233
  if (vectorAB.normalizeInPlace() && vectorBC.normalizeInPlace()) {
205209
205234
  vectorAB.interpolate(0.5, vectorBC, bisector);
205210
- // On the end ellipse for this pipe section. ..
205211
- // center comes directly from centerline[i]
205212
- // vector0 and vector90 are obtained by sweeping the corresponding vectors of the start ellipse to the split plane.
205235
+ // At pipe end, the ellipse center comes directly from centerline[i], and vector0/vector90 are
205236
+ // obtained by sweeping the corresponding vectors of the pipe start ellipse to the bisector plane.
205213
205237
  moveVectorToPlane(vector0, vectorAB, bisector, vector0);
205214
205238
  moveVectorToPlane(vector90, vectorAB, bisector, vector90);
205215
- arcs.push(_Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(currentCenter, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_8__.AngleSweep.create360()));
205239
+ arcs.push(_Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d.create(center, vector0, vector90, sweep));
205216
205240
  }
205217
205241
  }
205218
205242
  return arcs;
@@ -205221,21 +205245,38 @@ class CurveFactory {
205221
205245
  * Sweep the initialSection along each segment of the centerLine until it hits the bisector plane at the next vertex.
205222
205246
  * * The caller should place the initialSection on a plane perpendicular to the first edge.
205223
205247
  * * This plane is commonly (but not necessarily) through the start point itself.
205224
- * * If the geometry is not "on a perpendicular plane", the output geometry will still be flattened onto the various planes.
205225
- * * In the "open path" case (i.e when wrapIfPhysicallyClosed is false or the path does not have matched first and last points)
205226
- * the first/last output plane will be at the start/end of the first/last edge and on a perpendicular plane.
205227
- * * 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,
205228
- * and the first/last section geometry may be different from `initialSection`.
205229
- * * The centerline path does NOT have to be planar, however twisting effects effects will appear in the various bisector planes.
205230
- * @param centerline sweep path, e.g., as stroked from a smooth centerline curve
205231
- * @param initialSection profile curve to be swept. As noted above, this should be on a plane perpendicular to the first segment of the centerline.
205232
- * @param options options for computation and output
205248
+ * * If the initialSection is not "on a perpendicular plane", the output geometry will still be flattened onto the
205249
+ * various planes.
205250
+ * * In the "open path" case (i.e when `wrapIfPhysicallyClosed` is false or the path does not have matched first and
205251
+ * last points), the first/last output plane will be at the start/end of the first/last edge and on a perpendicular
205252
+ * plane.
205253
+ * * In the "closed path" case, if start/edn tangents are not provided in the `options`, then the output plane for the
205254
+ * first and last point is the bisector of the start and end planes from the "open path" case, and the first/last
205255
+ * section geometry may be different from `initialSection`.
205256
+ * * The centerline path does NOT have to be planar, however twisting effects effects will appear in the various bisector
205257
+ * planes.
205258
+ * @param centerline sweep path, e.g., as stroked from a smooth centerline curve.
205259
+ * @param initialSection profile curve to be swept. As noted above, this should be on a plane perpendicular to the
205260
+ * first segment of the centerline.
205261
+ * @param options options for computation and output.
205233
205262
  * @return array of sections, starting with `initialSection` projected along the first edge to the first plane.
205234
205263
  */
205235
205264
  static createMiteredSweepSections(centerline, initialSection, options) {
205236
205265
  const sectionData = { sections: [], planes: [] };
205237
205266
  const planes = _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_16__.PolylineOps.createBisectorPlanesForDistinctPoints(centerline, options.wrapIfPhysicallyClosed);
205267
+ // apply start/end tangent options
205238
205268
  if (planes !== undefined && planes.length > 1) {
205269
+ const firstPlane = planes[0];
205270
+ const lastPlane = planes[planes.length - 1];
205271
+ const startTang = options.startTangent;
205272
+ const endTang = options.endTangent;
205273
+ if (!firstPlane.getOriginRef().isAlmostEqual(lastPlane.getOriginRef()) ||
205274
+ (startTang && endTang && startTang.isAlmostEqual(endTang, 0.0))) {
205275
+ if (startTang?.tryNormalizeInPlace())
205276
+ firstPlane.getNormalRef().setFrom(startTang);
205277
+ if (endTang?.tryNormalizeInPlace())
205278
+ lastPlane.getNormalRef().setFrom(endTang);
205279
+ }
205239
205280
  // Projection to target plane, constructing sweep direction from two given planes.
205240
205281
  // If successful, push the target plane and swept section to the output arrays and return the swept section.
205241
205282
  // If unsuccessful, leave the output arrays alone and return the input section.
@@ -205244,12 +205285,12 @@ class CurveFactory {
205244
205285
  const transform = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_17__.Transform.createFlattenAlongVectorToPlane(sweepVector, targetPlane.getOriginRef(), targetPlane.getNormalRef());
205245
205286
  if (transform === undefined)
205246
205287
  return section;
205247
- const section1 = section.cloneTransformed(transform);
205248
- if (section1 === undefined)
205288
+ const transformedSection = section.cloneTransformed(transform);
205289
+ if (transformedSection === undefined)
205249
205290
  return section;
205250
205291
  sectionData.planes.push(targetPlane);
205251
- sectionData.sections.push(section1);
205252
- return section1;
205292
+ sectionData.sections.push(transformedSection);
205293
+ return transformedSection;
205253
205294
  };
205254
205295
  let currentSection = doSweepToPlane(planes[0], planes[1], planes[0], initialSection);
205255
205296
  for (let i = 1; i < planes.length; i++) {
@@ -205285,11 +205326,11 @@ class CurveFactory {
205285
205326
  /**
205286
205327
  * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.
205287
205328
  * * First spiral begins at given start point.
205288
- * * first tangent aims at shoulder
205329
+ * * first tangent aims at shoulder.
205289
205330
  * * outbound spiral joins line from shoulder to target.
205290
- * @param spiralType name of spiral type. THIS MUST BE AN "Integrated" SPIRAL TYPE
205331
+ * @param spiralType name of spiral type. THIS MUST BE AN "Integrated" SPIRAL TYPE.
205291
205332
  * @param startPoint inbound start point.
205292
- * @param shoulder point target point for (both) spiral-to-line tangencies
205333
+ * @param shoulder point target point for (both) spiral-to-line tangencies.
205293
205334
  * @return array with the computed spirals, or undefined if failure.
205294
205335
  */
205295
205336
  static createLineSpiralSpiralLine(spiralType, startPoint, shoulderPoint, targetPoint) {
@@ -205327,9 +205368,9 @@ class CurveFactory {
205327
205368
  * Compute 2 spirals (all in XY) for a symmetric line-to-line transition.
205328
205369
  * * Spiral length is given.
205329
205370
  * * tangency points float on both lines.
205330
- * @param spiralType name of spiral type. THIS MUST BE AN "Integrated" SPIRAL TYPE
205371
+ * @param spiralType name of spiral type. THIS MUST BE AN "Integrated" SPIRAL TYPE.
205331
205372
  * @param pointA inbound start point.
205332
- * @param shoulder point target point for (both) spiral-to-line tangencies
205373
+ * @param shoulder point target point for (both) spiral-to-line tangencies.
205333
205374
  * @param spiralLength for each part of the spiral pair.
205334
205375
  * @return array with the computed spirals, or undefined if failure.
205335
205376
  */
@@ -205367,12 +205408,12 @@ class CurveFactory {
205367
205408
  }
205368
205409
  /**
205369
205410
  * Compute 2 spirals and an arc (all in XY) for a symmetric line-to-line transition.
205370
- * Spiral lengths and arc radius are given. (e.g. from design speed standards.)
205371
- * @param spiralType name of spiral type. THIS MUST BE AN "Integrated" SPIRAL TYPE
205411
+ * Spiral lengths and arc radius are given (e.g., from design speed standards).
205412
+ * @param spiralType name of spiral type. THIS MUST BE AN "Integrated" SPIRAL TYPE.
205372
205413
  * @param pointA inbound start point.
205373
- * @param pointB shoulder (target) point for (both) spiral-to-line tangencies
205374
- * @param lengthA inbound spiral length
205375
- * @param lengthB outbound spiral length
205414
+ * @param pointB shoulder (target) point for (both) spiral-to-line tangencies.
205415
+ * @param lengthA inbound spiral length.
205416
+ * @param lengthB outbound spiral length.
205376
205417
  * @return array with the computed spirals, or undefined if failure.
205377
205418
  */
205378
205419
  static createLineSpiralArcSpiralLine(spiralType, pointA, pointB, pointC, lengthA, lengthB, arcRadius) {
@@ -205422,12 +205463,7 @@ class CurveFactory {
205422
205463
  }
205423
205464
  return undefined;
205424
205465
  }
205425
- /**
205426
- * Return the intersection point of 3 planes.
205427
- * @param planeA
205428
- * @param planeB
205429
- * @param planeC
205430
- */
205466
+ /** Return the intersection point of 3 planes. */
205431
205467
  static planePlaneIntersectionRay(planeA, planeB) {
205432
205468
  const altitudeA = planeA.altitudeXYZ(0, 0, 0);
205433
205469
  const altitudeB = planeB.altitudeXYZ(0, 0, 0);
@@ -205447,9 +205483,7 @@ class CurveFactory {
205447
205483
  return undefined;
205448
205484
  }
205449
205485
  }
205450
- /**
205451
- * Starting at vectorR, move parallel to vectorV until perpendicular to planeNormal
205452
- */
205486
+ /** Starting at vectorR, move parallel to vectorV until perpendicular to planeNormal. */
205453
205487
  function moveVectorToPlane(vectorR, vectorV, planeNormal, result) {
205454
205488
  // find s such that (vectorR + s * vectorV) DOT planeNormal = 0.
205455
205489
  const dotRN = vectorR.dotProduct(planeNormal);
@@ -222827,7 +222861,7 @@ class AngleSweep {
222827
222861
  this._radians0 = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.clampToStartEnd(this._radians0, -limit, limit);
222828
222862
  this._radians1 = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.clampToStartEnd(this._radians1, -limit, limit);
222829
222863
  }
222830
- /** Ask if the sweep is counterclockwise, i.e. positive sweep */
222864
+ /** Ask if the sweep is counterclockwise, i.e. positive sweep. */
222831
222865
  get isCCW() {
222832
222866
  return this._radians1 >= this._radians0;
222833
222867
  }
@@ -227486,11 +227520,11 @@ __webpack_require__.r(__webpack_exports__);
227486
227520
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
227487
227521
  /* harmony export */ "GrowableXYZArray": () => (/* binding */ GrowableXYZArray)
227488
227522
  /* harmony export */ });
227489
- /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
227523
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
227490
227524
  /* harmony import */ var _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
227491
- /* harmony import */ var _Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
227492
- /* harmony import */ var _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
227493
- /* harmony import */ var _PointStreaming__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PointStreaming */ "../../core/geometry/lib/esm/geometry3d/PointStreaming.js");
227525
+ /* harmony import */ var _Point2dVector2d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
227526
+ /* harmony import */ var _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
227527
+ /* harmony import */ var _PointStreaming__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PointStreaming */ "../../core/geometry/lib/esm/geometry3d/PointStreaming.js");
227494
227528
  /* harmony import */ var _Range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
227495
227529
  /* harmony import */ var _Transform__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
227496
227530
  /*---------------------------------------------------------------------------------------------
@@ -227606,6 +227640,54 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
227606
227640
  result._xyzInUse = this.length;
227607
227641
  return result;
227608
227642
  }
227643
+ /**
227644
+ * Clone the input array with each successive duplicate point removed.
227645
+ * * First and last points are always preserved.
227646
+ * @param source the source array
227647
+ * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])
227648
+ * @param result optional pre-allocated object to populate and return. Can be a reference to `source`, in
227649
+ * which case the array is compressed in place and returned.
227650
+ * @see [[cloneCompressed]], [[compressInPlace]], [[PolylineOps.compressShortEdges]]
227651
+ */
227652
+ static createCompressed(source, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance, result) {
227653
+ const dupIndices = source.findOrderedDuplicates(tolerance, true);
227654
+ const newSize = source.length - dupIndices.length;
227655
+ if (!result)
227656
+ result = new GrowableXYZArray(newSize);
227657
+ if (result !== source) {
227658
+ result.clear();
227659
+ result.resize(newSize, true);
227660
+ }
227661
+ for (let iRead = 0, iWrite = 0, iDup = 0; iRead < source.length; ++iRead) {
227662
+ if (iDup < dupIndices.length && iRead === dupIndices[iDup])
227663
+ ++iDup; // skip the duplicate
227664
+ else
227665
+ result.transferFromGrowableXYZArray(iWrite++, source, iRead);
227666
+ }
227667
+ result.resize(newSize);
227668
+ return result;
227669
+ }
227670
+ /**
227671
+ * Clone the instance array with each successive duplicate point removed.
227672
+ * * First and last points are always preserved.
227673
+ * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])
227674
+ * @param result optional pre-allocated object to populate and return. Can be a reference to the instance array, in
227675
+ * which case the array is compressed in place and returned.
227676
+ * @see [[createCompressed]], [[compressInPlace]], [[PolylineOps.compressShortEdges]]
227677
+ */
227678
+ cloneCompressed(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance, result) {
227679
+ return GrowableXYZArray.createCompressed(this, tolerance, result);
227680
+ }
227681
+ /**
227682
+ * Compress the input array by removing successive duplicate points.
227683
+ * * First and last points are always preserved.
227684
+ * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])
227685
+ * @returns the instance array.
227686
+ * @see [[createCompressed]], [[cloneCompressed]], [[PolylineOps.compressShortEdges]]
227687
+ */
227688
+ compressInPlace(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
227689
+ return GrowableXYZArray.createCompressed(this, tolerance, this);
227690
+ }
227609
227691
  /** Create an array from various point data formats.
227610
227692
  * Valid inputs are:
227611
227693
  * * Point2d
@@ -227633,8 +227715,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
227633
227715
  }
227634
227716
  /** Restructure MultiLineStringDataVariant as array of GrowableXYZArray */
227635
227717
  static createArrayOfGrowableXYZArray(data) {
227636
- const collector = new _PointStreaming__WEBPACK_IMPORTED_MODULE_1__.PointStreamGrowableXYZArrayCollector();
227637
- _PointStreaming__WEBPACK_IMPORTED_MODULE_1__.VariantPointDataStream.streamXYZ(data, collector);
227718
+ const collector = new _PointStreaming__WEBPACK_IMPORTED_MODULE_2__.PointStreamGrowableXYZArrayCollector();
227719
+ _PointStreaming__WEBPACK_IMPORTED_MODULE_2__.VariantPointDataStream.streamXYZ(data, collector);
227638
227720
  return collector.claimArrayOfGrowableXYZArray();
227639
227721
  }
227640
227722
  /** push a point to the end of the array */
@@ -227660,30 +227742,30 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
227660
227742
  * * An array of any of the above
227661
227743
  */
227662
227744
  pushFrom(p) {
227663
- if (p instanceof _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d)
227745
+ if (p instanceof _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d)
227664
227746
  this.pushXYZ(p.x, p.y, p.z);
227665
227747
  else if (p instanceof GrowableXYZArray)
227666
227748
  this.pushFromGrowableXYZArray(p);
227667
- else if (p instanceof _Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Point2d)
227749
+ else if (p instanceof _Point2dVector2d__WEBPACK_IMPORTED_MODULE_4__.Point2d)
227668
227750
  this.pushXYZ(p.x, p.y, 0.0);
227669
- else if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isNumberArray(p, 4) || p instanceof Float64Array) {
227751
+ else if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(p, 4) || p instanceof Float64Array) {
227670
227752
  const xyzToAdd = Math.trunc(p.length / 3);
227671
227753
  this.ensureCapacity(this._xyzInUse + xyzToAdd, false);
227672
227754
  this.copyData(p, xyzToAdd, this._xyzInUse);
227673
227755
  this._xyzInUse += xyzToAdd;
227674
227756
  }
227675
- else if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isNumberArray(p, 3))
227757
+ else if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(p, 3))
227676
227758
  this.pushXYZ(p[0], p[1], p[2]);
227677
- else if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isNumberArray(p, 2))
227759
+ else if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(p, 2))
227678
227760
  this.pushXYZ(p[0], p[1], 0.0);
227679
227761
  else if (Array.isArray(p)) {
227680
227762
  // direct recursion re-wraps p and goes infinite. Unroll here.
227681
227763
  for (const q of p)
227682
227764
  this.pushFrom(q);
227683
227765
  }
227684
- else if (_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.isXYAndZ(p))
227766
+ else if (_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.isXYAndZ(p))
227685
227767
  this.pushXYZ(p.x, p.y, p.z);
227686
- else if (_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.isXAndY(p))
227768
+ else if (_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.isXAndY(p))
227687
227769
  this.pushXYZ(p.x, p.y, 0.0);
227688
227770
  else if (p instanceof _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0__.IndexedXYZCollection) {
227689
227771
  const n = p.length;
@@ -227762,15 +227844,6 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
227762
227844
  if (this._xyzInUse > 0)
227763
227845
  this._xyzInUse--;
227764
227846
  }
227765
- /**
227766
- * Test if index is valid for an xyz (point or vector) within this array
227767
- * @param index xyz index to test.
227768
- */
227769
- isIndexValid(index) {
227770
- if (index >= this._xyzInUse || index < 0)
227771
- return false;
227772
- return true;
227773
- }
227774
227847
  /**
227775
227848
  * Clear all xyz data, but leave capacity unchanged.
227776
227849
  */
@@ -227784,7 +227857,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
227784
227857
  */
227785
227858
  getPoint3dAtUncheckedPointIndex(pointIndex, result) {
227786
227859
  const index = 3 * pointIndex;
227787
- return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
227860
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
227788
227861
  }
227789
227862
  /**
227790
227863
  * Get a point by index, strongly typed as a Point2d. This is unchecked. Use [[getPoint2dAtCheckedPointIndex]] to have validity test.
@@ -227793,7 +227866,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
227793
227866
  */
227794
227867
  getPoint2dAtUncheckedPointIndex(pointIndex, result) {
227795
227868
  const index = 3 * pointIndex;
227796
- return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Point2d.create(this._data[index], this._data[index + 1], result);
227869
+ return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_4__.Point2d.create(this._data[index], this._data[index + 1], result);
227797
227870
  }
227798
227871
  /**
227799
227872
  * Get a vector by index, strongly typed as a Vector3d. This is unchecked. Use [[getVector3dAtCheckedVectorIndex]] to have validity test.
@@ -227802,13 +227875,13 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
227802
227875
  */
227803
227876
  getVector3dAtUncheckedVectorIndex(vectorIndex, result) {
227804
227877
  const index = 3 * vectorIndex;
227805
- return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
227878
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Vector3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
227806
227879
  }
227807
227880
  /** copy xyz into strongly typed Point3d */
227808
227881
  getPoint3dAtCheckedPointIndex(pointIndex, result) {
227809
227882
  if (this.isIndexValid(pointIndex)) {
227810
227883
  const index = 3 * pointIndex;
227811
- return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
227884
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
227812
227885
  }
227813
227886
  return undefined;
227814
227887
  }
@@ -227831,7 +227904,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
227831
227904
  getPoint2dAtCheckedPointIndex(pointIndex, result) {
227832
227905
  if (this.isIndexValid(pointIndex)) {
227833
227906
  const index = 3 * pointIndex;
227834
- return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Point2d.create(this._data[index], this._data[index + 1], result);
227907
+ return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_4__.Point2d.create(this._data[index], this._data[index + 1], result);
227835
227908
  }
227836
227909
  return undefined;
227837
227910
  }
@@ -227839,7 +227912,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
227839
227912
  getVector3dAtCheckedVectorIndex(vectorIndex, result) {
227840
227913
  if (this.isIndexValid(vectorIndex)) {
227841
227914
  const index = 3 * vectorIndex;
227842
- return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
227915
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Vector3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
227843
227916
  }
227844
227917
  return undefined;
227845
227918
  }
@@ -227853,10 +227926,9 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
227853
227926
  transferFromGrowableXYZArray(destIndex, source, sourceIndex) {
227854
227927
  if (this.isIndexValid(destIndex) && source.isIndexValid(sourceIndex)) {
227855
227928
  const i = destIndex * 3;
227856
- const j = sourceIndex * 3;
227857
- this._data[i] = source._data[j];
227858
- this._data[i + 1] = source._data[j + 1];
227859
- this._data[i + 2] = source._data[j + 2];
227929
+ this._data[i] = source.getXAtUncheckedPointIndex(sourceIndex);
227930
+ this._data[i + 1] = source.getYAtUncheckedPointIndex(sourceIndex);
227931
+ this._data[i + 2] = source.getZAtUncheckedPointIndex(sourceIndex);
227860
227932
  return true;
227861
227933
  }
227862
227934
  return false;
@@ -227922,7 +227994,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
227922
227994
  const result = [];
227923
227995
  const data = this._data;
227924
227996
  for (let i = 0; i < n; i += 3)
227925
- result.push(_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(data[i], data[i + 1], data[i + 2]));
227997
+ result.push(_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(data[i], data[i + 1], data[i + 2]));
227926
227998
  return result;
227927
227999
  }
227928
228000
  /** multiply each point by the transform, replace values. */
@@ -228008,7 +228080,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228008
228080
  if (!matrix.computeCachedInverse(true))
228009
228081
  return false;
228010
228082
  const coffs = matrix.inverseCoffs;
228011
- const tol = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.smallFloatingPoint;
228083
+ const tol = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallFloatingPoint;
228012
228084
  let x = 0;
228013
228085
  let y = 0;
228014
228086
  let z = 0;
@@ -228051,7 +228123,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228051
228123
  multiplyMatrix4dAndQuietRenormalizeMatrix4d(matrix) {
228052
228124
  const data = this._data;
228053
228125
  const nDouble = this.float64Length;
228054
- const xyz1 = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create();
228126
+ const xyz1 = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create();
228055
228127
  for (let i = 0; i + 2 <= nDouble; i += 3) {
228056
228128
  matrix.multiplyXYZWQuietRenormalize(data[i], data[i + 1], data[i + 2], 1.0, xyz1);
228057
228129
  data[i] = xyz1.x;
@@ -228115,7 +228187,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228115
228187
  const n = 3 * (this._xyzInUse - 1); // Length already takes into account what specifically is in use
228116
228188
  const data = this._data;
228117
228189
  for (let i = 0; i < n; i += 3)
228118
- 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]);
228190
+ 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]);
228119
228191
  return sum;
228120
228192
  }
228121
228193
  /**
@@ -228130,7 +228202,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228130
228202
  }
228131
228203
  }
228132
228204
  /** test if all points are within tolerance of a plane. */
228133
- isCloseToPlane(plane, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.smallMetricDistance) {
228205
+ isCloseToPlane(plane, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
228134
228206
  const numCoordinate = 3 * this._xyzInUse;
228135
228207
  const data = this._data;
228136
228208
  for (let i = 0; i < numCoordinate; i += 3)
@@ -228143,7 +228215,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228143
228215
  * * If already closed within tolerance, force exact copy
228144
228216
  * * otherwise leave unchanged.
228145
228217
  */
228146
- forceClosure(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.smallMetricDistance) {
228218
+ forceClosure(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
228147
228219
  const d = this.distanceIndexIndex(0, this.length - 1);
228148
228220
  // leave the empty array alone.
228149
228221
  // Note that singleton will generate 0 distance and do nothing.
@@ -228165,7 +228237,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228165
228237
  const data = this._data;
228166
228238
  i = 3 * i;
228167
228239
  j = 3 * j;
228168
- 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);
228240
+ 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);
228169
228241
  }
228170
228242
  return undefined;
228171
228243
  }
@@ -228196,37 +228268,37 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228196
228268
  for (let i = 3; i < n; i += 3, dx1 = dx2, dy1 = dy2) {
228197
228269
  dx2 = this._data[i] - x0;
228198
228270
  dy2 = this._data[i + 1] - y0;
228199
- area += _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.crossProductXYXY(dx1, dy1, dx2, dy2);
228271
+ area += _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.crossProductXYXY(dx1, dy1, dx2, dy2);
228200
228272
  }
228201
228273
  }
228202
228274
  return 0.5 * area;
228203
228275
  }
228204
- /** Compute a vector from index origin i to indexed target j */
228276
+ /** Compute a vector from index origin i to indexed target j. */
228205
228277
  vectorIndexIndex(i, j, result) {
228206
228278
  if (!this.isIndexValid(i) || !this.isIndexValid(j))
228207
228279
  return undefined;
228208
228280
  const data = this._data;
228209
228281
  i = 3 * i;
228210
228282
  j = 3 * j;
228211
- 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);
228283
+ 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);
228212
228284
  }
228213
- /** Compute a vector from origin to indexed target j */
228285
+ /** Compute a vector from origin to indexed target j. */
228214
228286
  vectorXYAndZIndex(origin, j, result) {
228215
228287
  if (this.isIndexValid(j)) {
228216
228288
  const data = this._data;
228217
228289
  j = 3 * j;
228218
- return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(data[j] - origin.x, data[j + 1] - origin.y, data[j + 2] - origin.z, result);
228290
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Vector3d.create(data[j] - origin.x, data[j + 1] - origin.y, data[j + 2] - origin.z, result);
228219
228291
  }
228220
228292
  return undefined;
228221
228293
  }
228222
- /** Compute the cross product of vectors from from indexed origin to indexed targets i and j */
228294
+ /** Compute the cross product of vectors from from indexed origin to indexed targets i and j. */
228223
228295
  crossProductIndexIndexIndex(originIndex, targetAIndex, targetBIndex, result) {
228224
228296
  if (this.isIndexValid(originIndex) && this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {
228225
228297
  const i = originIndex * 3;
228226
228298
  const j = targetAIndex * 3;
228227
228299
  const k = targetBIndex * 3;
228228
228300
  const data = this._data;
228229
- 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);
228301
+ 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);
228230
228302
  }
228231
228303
  return undefined;
228232
228304
  }
@@ -228274,7 +228346,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228274
228346
  const j = targetAIndex * 3;
228275
228347
  const k = targetBIndex * 3;
228276
228348
  const data = this._data;
228277
- 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);
228349
+ 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);
228278
228350
  }
228279
228351
  return undefined;
228280
228352
  }
@@ -228282,7 +228354,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228282
228354
  distanceIndexToPoint(i, spacePoint) {
228283
228355
  if (this.isIndexValid(i)) {
228284
228356
  const i0 = 3 * i;
228285
- 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]);
228357
+ 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]);
228286
228358
  }
228287
228359
  return undefined;
228288
228360
  }
@@ -228295,7 +228367,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228295
228367
  if (this.isIndexValid(i) && this.isIndexValid(j)) {
228296
228368
  const i0 = 3 * i;
228297
228369
  const j0 = 3 * j;
228298
- 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]);
228370
+ 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]);
228299
228371
  }
228300
228372
  return undefined;
228301
228373
  }
@@ -228308,7 +228380,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228308
228380
  if (this.isIndexValid(i) && this.isIndexValid(j)) {
228309
228381
  const i0 = 3 * i;
228310
228382
  const j0 = 3 * j;
228311
- 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]);
228383
+ 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]);
228312
228384
  }
228313
228385
  return undefined;
228314
228386
  }
@@ -228317,7 +228389,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228317
228389
  if (arrayA.isIndexValid(i) && arrayB.isIndexValid(j)) {
228318
228390
  const i0 = 3 * i;
228319
228391
  const j0 = 3 * j;
228320
- 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]);
228392
+ 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]);
228321
228393
  }
228322
228394
  return undefined;
228323
228395
  }
@@ -228399,7 +228471,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228399
228471
  const range = _Range__WEBPACK_IMPORTED_MODULE_5__.Range1d.createNull();
228400
228472
  while (i < n) {
228401
228473
  k0 = 3 * i;
228402
- 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]));
228474
+ 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]));
228403
228475
  i++;
228404
228476
  }
228405
228477
  return range;
@@ -228409,7 +228481,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
228409
228481
  * @param points
228410
228482
  * @param tolerance
228411
228483
  */
228412
- static removeClosure(points, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.smallMetricDistance) {
228484
+ static removeClosure(points, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
228413
228485
  while (points.length > 1 && points.distanceIndexIndex(0, points.length - 1) < tolerance)
228414
228486
  points.pop();
228415
228487
  }
@@ -228768,6 +228840,13 @@ class IndexedXYZCollection {
228768
228840
  return undefined;
228769
228841
  return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseSquaredXYZ(target.x - this.getXAtUncheckedPointIndex(index0), target.y - this.getYAtUncheckedPointIndex(index0), target.z - this.getZAtUncheckedPointIndex(index0));
228770
228842
  }
228843
+ /**
228844
+ * Test if index is valid for an xyz within this array.
228845
+ * @param index xyz index to test.
228846
+ */
228847
+ isIndexValid(index) {
228848
+ return index >= 0 && index < this.length;
228849
+ }
228771
228850
  /** Adjust index into range by modulo with the length. */
228772
228851
  cyclicIndex(i) {
228773
228852
  return (i % this.length);
@@ -228784,24 +228863,31 @@ class IndexedXYZCollection {
228784
228863
  return range;
228785
228864
  }
228786
228865
  /**
228787
- * 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.
228866
+ * For each subset of `k` successive points within tolerance of the first point in the subset, return the indices of
228867
+ * the last `k-1` duplicates.
228868
+ * * Index `0` is never returned.
228869
+ * @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])
228870
+ * @param preserveLast if the last `k < this.length` points of the instance are duplicates, whether to return the
228871
+ * indices of the *first* `k-1` duplicates for this last run. If true, index `this.length - 1` is not returned
228872
+ * unless all points are duplicates, in which case all indices but `0` are returned. Default value is false.
228788
228873
  * @return ordered array of 0-based indices of duplicate points
228789
228874
  */
228790
- findOrderedDuplicates(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
228791
- const tol2 = tolerance * tolerance;
228875
+ findOrderedDuplicates(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance, preserveLast = false) {
228792
228876
  const indices = [];
228793
228877
  if (this.length > 1) {
228794
228878
  for (let i = 0; i < this.length - 1;) {
228795
228879
  let j = i + 1;
228796
- for (; j < this.length; ++j) {
228797
- const dist2 = this.distanceSquaredIndexIndex(i, j);
228798
- if (dist2 !== undefined && dist2 < tol2)
228799
- indices.push(j);
228800
- else
228801
- break;
228802
- }
228880
+ for (; this.almostEqualIndexIndex(i, j, tolerance); ++j)
228881
+ indices.push(j);
228803
228882
  i = j; // found next unique point
228804
228883
  }
228884
+ if (preserveLast && indices.length > 0 && indices.length < this.length - 1) { // not all points are duplicate
228885
+ let numLastRun = 0;
228886
+ for (; numLastRun <= indices.length - 1 && indices[indices.length - 1 - numLastRun] === this.length - 1 - numLastRun; ++numLastRun)
228887
+ ;
228888
+ for (let i = 0; i < numLastRun; ++i)
228889
+ indices[indices.length - 1 - i] -= 1; // decrement the indices of the last run so that the last point is preserved
228890
+ }
228805
228891
  }
228806
228892
  return indices;
228807
228893
  }
@@ -229700,12 +229786,11 @@ class Matrix3d {
229700
229786
  return undefined;
229701
229787
  }
229702
229788
  /**
229703
- * Construct a rigid matrix (orthogonal matrix with +1 determinant) using vectorA and its 2 perpendicular.
229789
+ * Construct a rigid matrix (orthogonal matrix with determinant 1) using vectorA and its 2 perpendiculars.
229704
229790
  * * If axisOrder is not passed then `AxisOrder = AxisOrder.ZXY` is used as default.
229705
229791
  * * This function internally uses createPerpendicularVectorFavorXYPlane and createRigidFromColumns.
229706
- * * If you want to rotate a given plane (which contains (0,0,0)) to the xy-plane, pass the normal vector of
229707
- * your plane into createRigidHeadsUp. The transpose of the returned Matrix3d can be used to rotate your plane
229708
- * 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.
229792
+ * * Passing the normal of a plane P into this method returns a matrix whose transpose rotates geometry in P
229793
+ * 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.
229709
229794
  * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/2PerpendicularVectorsTo1Vector
229710
229795
  */
229711
229796
  static createRigidHeadsUp(vectorA, axisOrder = _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.ZXY, result) {
@@ -233780,7 +233865,7 @@ class Point3dArrayCarrier extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE
233780
233865
  }
233781
233866
  /** Test if `index` is a valid index into the array. */
233782
233867
  isValidIndex(index) {
233783
- return index >= 0 && index < this.data.length;
233868
+ return this.isIndexValid(index);
233784
233869
  }
233785
233870
  /**
233786
233871
  * Access by index, returning strongly typed Point3d
@@ -235043,10 +235128,10 @@ class Vector3d extends XYZ {
235043
235128
  return unitNormal ? unitNormal.crossProduct(this).plusScaled(unitNormal, unitNormal.dotProduct(this), result) : undefined;
235044
235129
  }
235045
235130
  /**
235046
- * Return a vector computed at fractional position between this vector and vectorB
235047
- * @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`.
235048
- * True fractions are "between", negatives are "before this", beyond 1 is "beyond vectorB".
235049
- * @param vectorB second vector
235131
+ * Return a vector computed at fractional position between this vector and vectorB.
235132
+ * @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`. True fractions are "between",
235133
+ * negatives are "before this", beyond 1 is "beyond vectorB".
235134
+ * @param vectorB second vector.
235050
235135
  * @param result optional preallocated result.
235051
235136
  */
235052
235137
  interpolate(fraction, vectorB, result) {
@@ -238953,6 +239038,7 @@ class PolylineOps {
238953
239038
  * * This is a local search, with a single pass over the data.
238954
239039
  * @param source input points
238955
239040
  * @param maxEdgeLength
239041
+ * @see [[GrowableXYZArray.cloneCompressed]]
238956
239042
  */
238957
239043
  static compressShortEdges(source, maxEdgeLength) {
238958
239044
  const dest = _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_2__.GrowableXYZArray.create(source);
@@ -239124,13 +239210,15 @@ class PolylineOps {
239124
239210
  }
239125
239211
  /** Create an array of planes.
239126
239212
  * * First plane has origin at first centerline point, with unit normal directed at the next point.
239127
- * * Intermediate planes have origin at intermediate points, with unit normals computed from the average of unit vectors along the incoming and outgoing segments.
239213
+ * * Intermediate planes have origin at intermediate points, with unit normals computed from the average of unit vectors
239214
+ * along the incoming and outgoing segments.
239128
239215
  * * Last plane has origin at last centerline point, with unit normal directed from previous point.
239129
239216
  * * All sets of adjacent coincident points are reduced to a single point.
239130
239217
  * * Hence the output array may have fewer points than the centerline.
239131
- * * If there are one or fewer distinct input points, the return is undefined
239132
- * @param centerline points to reside in output planes
239133
- * @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).
239218
+ * * If there are one or fewer distinct input points, the return is undefined.
239219
+ * @param centerline points to reside in output planes.
239220
+ * @param wrapIfPhysicallyClosed if true and the first and last centerline points are the same, then the first and last
239221
+ * output planes are averaged and equated (cloned).
239134
239222
  */
239135
239223
  static createBisectorPlanesForDistinctPoints(centerline, wrapIfPhysicallyClosed = false) {
239136
239224
  const packedPoints = PolylineOps.compressShortEdges(centerline, 2.0 * _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance); // double the tolerance to ensure normalized vectors exist.
@@ -253866,29 +253954,28 @@ __webpack_require__.r(__webpack_exports__);
253866
253954
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
253867
253955
  /* harmony export */ "PolyfaceBuilder": () => (/* binding */ PolyfaceBuilder)
253868
253956
  /* harmony export */ });
253957
+ /* harmony import */ var _curve_Arc3d__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../curve/Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
253869
253958
  /* harmony import */ var _curve_ConstructCurveBetweenCurves__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../curve/ConstructCurveBetweenCurves */ "../../core/geometry/lib/esm/curve/ConstructCurveBetweenCurves.js");
253870
253959
  /* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
253871
253960
  /* harmony import */ var _curve_CurveFactory__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../curve/CurveFactory */ "../../core/geometry/lib/esm/curve/CurveFactory.js");
253872
253961
  /* harmony import */ var _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../curve/CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
253873
- /* harmony import */ var _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../curve/GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
253874
253962
  /* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
253875
253963
  /* harmony import */ var _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../curve/ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
253876
253964
  /* harmony import */ var _curve_Query_CylindricalRange__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../curve/Query/CylindricalRange */ "../../core/geometry/lib/esm/curve/Query/CylindricalRange.js");
253877
253965
  /* harmony import */ var _curve_Query_StrokeCountChain__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../curve/Query/StrokeCountChain */ "../../core/geometry/lib/esm/curve/Query/StrokeCountChain.js");
253878
253966
  /* harmony import */ var _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../curve/StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
253879
253967
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
253880
- /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
253968
+ /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
253881
253969
  /* harmony import */ var _geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../geometry3d/BilinearPatch */ "../../core/geometry/lib/esm/geometry3d/BilinearPatch.js");
253882
253970
  /* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
253883
253971
  /* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
253884
253972
  /* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
253885
253973
  /* harmony import */ var _geometry3d_GrowableXYArray__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../geometry3d/GrowableXYArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYArray.js");
253886
253974
  /* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
253887
- /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
253888
253975
  /* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
253889
253976
  /* harmony import */ var _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndVectors */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndVectors.js");
253890
253977
  /* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
253891
- /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
253978
+ /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
253892
253979
  /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
253893
253980
  /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
253894
253981
  /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
@@ -253901,15 +253988,17 @@ __webpack_require__.r(__webpack_exports__);
253901
253988
  /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
253902
253989
  /* harmony import */ var _BoxTopology__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./BoxTopology */ "../../core/geometry/lib/esm/polyface/BoxTopology.js");
253903
253990
  /* harmony import */ var _GreedyTriangulationBetweenLineStrings__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./GreedyTriangulationBetweenLineStrings */ "../../core/geometry/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js");
253904
- /* harmony import */ var _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./IndexedEdgeMatcher */ "../../core/geometry/lib/esm/polyface/IndexedEdgeMatcher.js");
253905
- /* harmony import */ var _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./IndexedPolyfaceVisitor */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceVisitor.js");
253991
+ /* harmony import */ var _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./IndexedEdgeMatcher */ "../../core/geometry/lib/esm/polyface/IndexedEdgeMatcher.js");
253992
+ /* harmony import */ var _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./IndexedPolyfaceVisitor */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceVisitor.js");
253906
253993
  /* harmony import */ var _Polyface__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
253907
- /* harmony import */ var _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
253994
+ /* harmony import */ var _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
253908
253995
  /*---------------------------------------------------------------------------------------------
253909
253996
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
253910
253997
  * See LICENSE.md in the project root for license terms and full copyright notice.
253911
253998
  *--------------------------------------------------------------------------------------------*/
253912
-
253999
+ /** @packageDocumentation
254000
+ * @module Polyface
254001
+ */
253913
254002
 
253914
254003
 
253915
254004
 
@@ -255734,16 +255823,25 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
255734
255823
  const context = _GreedyTriangulationBetweenLineStrings__WEBPACK_IMPORTED_MODULE_30__.GreedyTriangulationBetweenLineStrings.createContext();
255735
255824
  context.emitTriangles(resolveToIndexedXYZCollectionOrCarrier(pointsA), resolveToIndexedXYZCollectionOrCarrier(pointsB), (triangle) => { this.addTriangleFacet(triangle.points); });
255736
255825
  }
255737
- addMiteredPipesFromPoints(centerline, sectionData, numFacetAround = 12) {
255826
+ /** Doc is same as `addMiteredPipes` doc. */
255827
+ addMiteredPipesFromPoints(centerline, sectionData, numFacetAround = 12, capped = false) {
255738
255828
  const sections = _curve_CurveFactory__WEBPACK_IMPORTED_MODULE_31__.CurveFactory.createMiteredPipeSections(centerline, sectionData);
255739
255829
  const pointA0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
255740
255830
  const pointA1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
255741
255831
  const pointB0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
255742
255832
  const pointB1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
255833
+ const wantCaps = capped && (!(sectionData instanceof _curve_Arc3d__WEBPACK_IMPORTED_MODULE_32__.Arc3d) || sectionData.sweep.isFullCircle);
255743
255834
  if (numFacetAround < 3)
255744
255835
  numFacetAround = 3;
255745
255836
  const df = 1.0 / numFacetAround;
255746
- for (let i = 1; i < sections.length; i++) {
255837
+ if (wantCaps) { // start cap facets
255838
+ const startLineString = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d.create();
255839
+ for (let i = 0; i < numFacetAround; i++)
255840
+ startLineString.addPoint(sections[0].fractionToPoint(i * df));
255841
+ this.addTrianglesInUncheckedConvexPolygon(startLineString, true);
255842
+ this.endFace();
255843
+ }
255844
+ for (let i = 1; i < sections.length; i++) { // side facets
255747
255845
  const arcA = sections[i - 1];
255748
255846
  const arcB = sections[i];
255749
255847
  arcA.fractionToPoint(0.0, pointA0);
@@ -255752,38 +255850,44 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
255752
255850
  const f = k * df;
255753
255851
  arcA.fractionToPoint(f, pointA1);
255754
255852
  arcB.fractionToPoint(f, pointB1);
255755
- this.addQuadFacet([pointA0, pointB0, pointB1, pointA1]);
255853
+ this.addQuadFacet([pointA0, pointA1, pointB1, pointB0]); // ASSUME: CCW section traversal wrt rail tangent
255756
255854
  }
255757
255855
  }
255856
+ if (wantCaps) { // end cap facets
255857
+ const endLineString = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d.create();
255858
+ for (let i = 0; i < numFacetAround; i++)
255859
+ endLineString.addPoint(sections[sections.length - 1].fractionToPoint(i * df));
255860
+ this.addTrianglesInUncheckedConvexPolygon(endLineString, false);
255861
+ this.endFace();
255862
+ }
255758
255863
  }
255759
255864
  /**
255760
255865
  * Add quad facets along a mitered pipe that follows a centerline curve.
255866
+ * * At the end of each pipe segment, the pipe is mitered by the plane that bisects the angle between successive
255867
+ * centerline segments.
255761
255868
  * * Circular or elliptical pipe cross sections can be specified by supplying either a radius, a pair of semi-axis
255762
- * lengths, or a full Arc3d:
255763
- * * For semi-axis length input, x corresponds to an ellipse local axis nominally situated parallel to the xy-plane.
255764
- * * For Arc3d input, the center is translated to the centerline start point to act as initial cross section.
255765
- * @param centerline centerline of pipe. If curved, it will be stroked using the builder's StrokeOptions.
255766
- * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d.
255869
+ * lengths, or an Arc3d:
255870
+ * * For semi-axis length input, x and y correspond to ellipse local axes perpendicular to each other and to the
255871
+ * start tangent.
255872
+ * * For Arc3d input, the center is translated to the centerline start point, but otherwise the arc is used as-is
255873
+ * for the first section. For best results, the arc should be perpendicular to the centerline start tangent.
255874
+ * @param centerline centerline of pipe. If curved, it will be stroked using the builder's StrokeOptions, otherwise
255875
+ * for best results, ensure no successive duplicate points with e.g., [[GrowableXYZArray.createCompressed]].
255876
+ * @param sectionData circle radius, ellipse semi-axis lengths, or Arc3d.
255767
255877
  * @param numFacetAround how many equal parameter-space chords around each section.
255768
- */
255769
- addMiteredPipes(centerline, sectionData, numFacetAround = 12) {
255770
- if (Array.isArray(centerline)) {
255771
- this.addMiteredPipesFromPoints(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_32__.Point3dArrayCarrier(centerline), sectionData, numFacetAround);
255772
- }
255773
- else if (centerline instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__.GrowableXYZArray) {
255774
- this.addMiteredPipesFromPoints(centerline, sectionData, numFacetAround);
255775
- }
255776
- else if (centerline instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_33__.IndexedXYZCollection) {
255777
- this.addMiteredPipesFromPoints(centerline, sectionData, numFacetAround);
255778
- }
255779
- else if (centerline instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d) {
255780
- this.addMiteredPipesFromPoints(centerline.packedPoints, sectionData, numFacetAround);
255781
- }
255782
- else if (centerline instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_34__.GeometryQuery) {
255878
+ * @param capped if `true`, add a cap at each end of the pipe; defaults to `false`.
255879
+ */
255880
+ addMiteredPipes(centerline, sectionData, numFacetAround = 12, capped = false) {
255881
+ if (Array.isArray(centerline))
255882
+ centerline = new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_33__.Point3dArrayCarrier(centerline);
255883
+ else if (centerline instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d)
255884
+ centerline = centerline.packedPoints;
255885
+ else if (centerline instanceof _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_19__.CurvePrimitive) {
255783
255886
  const linestring = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d.create();
255784
255887
  centerline.emitStrokes(linestring, this._options);
255785
- this.addMiteredPipesFromPoints(linestring.packedPoints, sectionData, numFacetAround);
255888
+ centerline = linestring.packedPoints;
255786
255889
  }
255890
+ this.addMiteredPipesFromPoints(centerline, sectionData, numFacetAround, capped);
255787
255891
  }
255788
255892
  /** Return the polyface index array indices corresponding to the given edge, or `undefined` if error. */
255789
255893
  getEdgeIndices(edge) {
@@ -255855,10 +255959,10 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
255855
255959
  */
255856
255960
  addSweptIndexedPolyface(source, sweepVector, triangulateSides = false) {
255857
255961
  let isSimpleSweep = true;
255858
- const totalProjectedArea = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_35__.PolyfaceQuery.sumFacetAreas(source, sweepVector);
255962
+ const totalProjectedArea = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__.PolyfaceQuery.sumFacetAreas(source, sweepVector);
255859
255963
  if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isAlmostEqualNumber(0.0, totalProjectedArea))
255860
255964
  isSimpleSweep = false;
255861
- const partitionedIndices = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_35__.PolyfaceQuery.partitionFacetIndicesByVisibilityVector(source, sweepVector, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_36__.Angle.createDegrees(1.0e-3));
255965
+ const partitionedIndices = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__.PolyfaceQuery.partitionFacetIndicesByVisibilityVector(source, sweepVector, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_35__.Angle.createDegrees(1.0e-3));
255862
255966
  const numForwardFacets = partitionedIndices[0].length;
255863
255967
  const numBackwardFacets = partitionedIndices[1].length;
255864
255968
  const numSideFacets = partitionedIndices[2].length;
@@ -255875,15 +255979,15 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
255875
255979
  // collect base edges added to the builder, and extract boundary
255876
255980
  const numBaseFacets = firstSweptFacet - firstBaseFacet;
255877
255981
  const baseFacetIndices = Array.from({ length: numBaseFacets }, (_, i) => firstBaseFacet + i);
255878
- const baseFacetVisitor = _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_37__.IndexedPolyfaceSubsetVisitor.createSubsetVisitor(this._polyface, baseFacetIndices, 1);
255879
- const baseEdges = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_35__.PolyfaceQuery.createIndexedEdges(baseFacetVisitor);
255982
+ const baseFacetVisitor = _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_36__.IndexedPolyfaceSubsetVisitor.createSubsetVisitor(this._polyface, baseFacetIndices, 1);
255983
+ const baseEdges = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__.PolyfaceQuery.createIndexedEdges(baseFacetVisitor);
255880
255984
  const baseBoundaryEdges = [];
255881
255985
  baseEdges.sortAndCollectClusters(undefined, baseBoundaryEdges, undefined, undefined);
255882
255986
  // add a side face per boundary edge
255883
255987
  const oldShouldTriangulate = this._options.shouldTriangulate;
255884
255988
  this._options.shouldTriangulate = triangulateSides;
255885
255989
  for (const edgeOrCluster of baseBoundaryEdges) {
255886
- if (edgeOrCluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_38__.SortableEdge)
255990
+ if (edgeOrCluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_37__.SortableEdge)
255887
255991
  this.addSweptFace(edgeOrCluster, numBaseFacets);
255888
255992
  else if (Array.isArray(edgeOrCluster))
255889
255993
  for (const edge of edgeOrCluster)
@@ -255898,7 +256002,7 @@ PolyfaceBuilder._workVectorFindOrAdd = _geometry3d_Point3dVector3d__WEBPACK_IMPO
255898
256002
  PolyfaceBuilder._workUVFindOrAdd = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_1__.Point2d.create();
255899
256003
  function resolveToIndexedXYZCollectionOrCarrier(points) {
255900
256004
  if (Array.isArray(points))
255901
- return new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_32__.Point3dArrayCarrier(points);
256005
+ return new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_33__.Point3dArrayCarrier(points);
255902
256006
  if (points instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d)
255903
256007
  return points.packedPoints;
255904
256008
  return points;
@@ -270496,7 +270600,7 @@ class Sample {
270496
270600
  }
270497
270601
  return result;
270498
270602
  }
270499
- /** Create various orders of non-rational B-spline curves with helical poles */
270603
+ /** Create various orders of non-rational B-spline curves with helical poles. */
270500
270604
  static createBsplineCurveHelices(radius, height, numTurns, numSamplesPerTurn) {
270501
270605
  const pts = [];
270502
270606
  const zDelta = (height / numTurns) / numSamplesPerTurn;
@@ -272186,11 +272290,11 @@ class Sample {
272186
272290
  return result;
272187
272291
  }
272188
272292
  /**
272189
- * Create points on a sine wave
272190
- * Point i is origin + (i * xStep, a *sin(theta0 + i * dTheta), b * sin(beta0 + i * dBeta))
272191
- * * Default b is zero, so it is a simple sine wave
272293
+ * Create points on a sine wave.
272294
+ * * Point i is origin + (i * xStep, a *sin(theta0 + i * dTheta), b * sin(beta0 + i * dBeta)).
272295
+ * * Default b is zero, so it is a simple sine wave.
272192
272296
  * * If the dTheta and dBeta are equal, it is a sine wave in a tilted plane.
272193
- * * If dTheta and dBeta are different it is a non-planar curve
272297
+ * * If dTheta and dBeta are different it is a non-planar curve.
272194
272298
  */
272195
272299
  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)) {
272196
272300
  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));
@@ -304294,7 +304398,7 @@ class TestContext {
304294
304398
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
304295
304399
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
304296
304400
  await core_frontend_1.NoRenderApp.startup({
304297
- applicationVersion: "5.0.0-dev.14",
304401
+ applicationVersion: "5.0.0-dev.16",
304298
304402
  applicationId: this.settings.gprid,
304299
304403
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
304300
304404
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -331940,7 +332044,7 @@ function __rewriteRelativeImportExtension(path, preserveJsx) {
331940
332044
  /***/ ((module) => {
331941
332045
 
331942
332046
  "use strict";
331943
- 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"}}');
332047
+ 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"}}');
331944
332048
 
331945
332049
  /***/ }),
331946
332050