@itwin/ecschema-rpcinterface-tests 4.2.0-dev.31 → 4.2.0-dev.32

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.
@@ -170304,8 +170304,8 @@ class Geometry {
170304
170304
  return result;
170305
170305
  }
170306
170306
  /**
170307
- * For a line `f(x)` where `f(x0) = f0` and `f(x1) = f1`, return the `x` value at which `f(x) = fTarget`
170308
- * Return `defaultResult` if `(fTarget - f0) / (f1 - f0)` exceeds `Geometry.largeFractionResult`
170307
+ * For a line `f(x)` where `f(x0) = f0` and `f(x1) = f1`, return the `x` value at which `f(x) = fTarget`.
170308
+ * Return `defaultResult` if `(fTarget - f0) / (f1 - f0)` exceeds `Geometry.largeFractionResult`.
170309
170309
  */
170310
170310
  static inverseInterpolate(x0, f0, x1, f1, fTarget = 0, defaultResult) {
170311
170311
  /**
@@ -182978,17 +182978,18 @@ __webpack_require__.r(__webpack_exports__);
182978
182978
  /* harmony export */ CurveChainWithDistanceIndex: () => (/* binding */ CurveChainWithDistanceIndex),
182979
182979
  /* harmony export */ PathFragment: () => (/* binding */ PathFragment)
182980
182980
  /* harmony export */ });
182981
- /* harmony import */ var _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../curve/CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
182982
- /* harmony import */ var _curve_Query_StrokeCountMap__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../curve/Query/StrokeCountMap */ "../../core/geometry/lib/esm/curve/Query/StrokeCountMap.js");
182983
- /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
182984
- /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
182985
- /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
182986
- /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
182987
- /* harmony import */ var _CurveExtendMode__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./CurveExtendMode */ "../../core/geometry/lib/esm/curve/CurveExtendMode.js");
182988
- /* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
182989
- /* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
182990
- /* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
182991
- /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
182981
+ /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
182982
+ /* harmony import */ var _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../curve/CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
182983
+ /* harmony import */ var _curve_Query_StrokeCountMap__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../curve/Query/StrokeCountMap */ "../../core/geometry/lib/esm/curve/Query/StrokeCountMap.js");
182984
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
182985
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
182986
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
182987
+ /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
182988
+ /* harmony import */ var _CurveExtendMode__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./CurveExtendMode */ "../../core/geometry/lib/esm/curve/CurveExtendMode.js");
182989
+ /* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
182990
+ /* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
182991
+ /* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
182992
+ /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
182992
182993
  /*---------------------------------------------------------------------------------------------
182993
182994
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
182994
182995
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -183007,15 +183008,16 @@ __webpack_require__.r(__webpack_exports__);
183007
183008
 
183008
183009
 
183009
183010
 
183011
+
183010
183012
  /**
183011
- * Annotation of an interval of a curve.
183013
+ * Annotation of a fragment, i.e. an interval of a curve.
183012
183014
  * * The interval is marked with two pairs of numbers:
183013
- * * * fraction0, fraction1 = fraction parameters along the child curve
183014
- * * * distance0,distance1 = distances within containing CurveChainWithDistanceIndex
183015
+ * * * fraction0, fraction1 = fraction parameters along the child curve.
183016
+ * * * distance0, distance1 = distances within containing CurveChainWithDistanceIndex.
183015
183017
  * @public
183016
183018
  */
183017
183019
  class PathFragment {
183018
- /** Create a fragment with complete fraction, distance and child data. */
183020
+ /** Create a fragment with complete fraction, distance, and child data. */
183019
183021
  constructor(childFraction0, childFraction1, distance0, distance1, childCurve, range) {
183020
183022
  this.childFraction0 = childFraction0;
183021
183023
  this.childFraction1 = childFraction1;
@@ -183025,68 +183027,64 @@ class PathFragment {
183025
183027
  this.range = range;
183026
183028
  this.a = 0;
183027
183029
  }
183028
- /**
183029
- * Return true if the distance is within the distance limits of this fragment.
183030
- * @param distance
183031
- */
183030
+ /** Return true if the distance is within the distance limits of this fragment. */
183032
183031
  containsChainDistance(distance) {
183033
183032
  return distance >= this.chainDistance0 && distance <= this.chainDistance1;
183034
183033
  }
183035
- /** Return a quick distance to the curve. This may be SMALLER than true distance but may not be larger */
183034
+ /**
183035
+ * Return a quick minimum distance from spacePoint to the curve.
183036
+ * * The returned distance is to the curve's range box if defined; otherwise, the true distance is computed.
183037
+ * * Thus the returned distance may be SMALLER than the true distance to the curve, but not larger.
183038
+ */
183036
183039
  quickMinDistanceToChildCurve(spacePoint) {
183037
- if (this.range) {
183040
+ if (this.range)
183038
183041
  return this.range.distanceToPoint(spacePoint);
183039
- }
183040
- // ugh. have to do real computation ..
183041
183042
  const detail = this.childCurve.closestPoint(spacePoint, false);
183042
183043
  if (detail)
183043
183044
  return detail.a;
183044
183045
  return 0;
183045
183046
  }
183046
183047
  /**
183047
- * Return an array with (references to) all the path fragments, sorted smallest to largest on the "a" value
183048
- * equal to the quick min distance to the fragment
183048
+ * Return an array with (references to) all the input path fragments, sorted smallest to largest on the "a" value,
183049
+ * initialized with `quickMinDistanceToChildCurve`
183049
183050
  */
183050
183051
  static collectSortedQuickMinDistances(fragments, spacePoint) {
183051
183052
  const sortedFragments = [];
183052
- for (const f of fragments) {
183053
- f.a = f.quickMinDistanceToChildCurve(spacePoint);
183054
- sortedFragments.push(f);
183053
+ for (const frag of fragments) {
183054
+ frag.a = frag.quickMinDistanceToChildCurve(spacePoint);
183055
+ sortedFragments.push(frag);
183055
183056
  }
183056
- sortedFragments.sort((a, b) => a.a - b.a);
183057
+ sortedFragments.sort((frag1, frag2) => frag1.a - frag2.a);
183057
183058
  return sortedFragments;
183058
183059
  }
183059
- /**
183060
- * Return true if this fragment addresses `curve` and brackets `fraction`
183061
- * @param distance
183062
- */
183060
+ /** Return true if `this` fragment addresses `curve` and brackets `fraction`. */
183063
183061
  containsChildCurveAndChildFraction(curve, fraction) {
183064
183062
  return this.childCurve === curve && fraction >= this.childFraction0 && fraction <= this.childFraction1;
183065
183063
  }
183066
183064
  /**
183067
- * Convert distance to local fraction, and apply that to interpolate between the stored curve fractions.
183068
- * Note that proportional calculation does NOT account for nonuniform parameterization in the child curve.
183065
+ * Convert distance to local fraction and apply that to interpolate between the stored curve fractions.
183066
+ * Note that proportional calculation does NOT account for non-uniform parameterization in the child curve.
183069
183067
  */
183070
183068
  chainDistanceToInterpolatedChildFraction(distance) {
183071
- return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.inverseInterpolate(this.childFraction0, this.chainDistance0, this.childFraction1, this.chainDistance1, distance, this.childFraction0); // the interval "must" have nonzero length, division should be safe . ..
183069
+ return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.inverseInterpolate(this.childFraction0, this.chainDistance0, this.childFraction1, this.chainDistance1, distance, this.childFraction0); // the interval must have nonzero length so division should be safe
183072
183070
  }
183073
- /** Convert chainDistance to true chidFraction, using detailed moveSignedDistanceFromFraction */
183071
+ /** Convert the given chainDistance to a fraction along this childCurve using `moveSignedDistanceFromFraction`. */
183074
183072
  chainDistanceToAccurateChildFraction(chainDistance, allowExtrapolation) {
183075
- // The fragments are really expected to do good mappings in their distance range ...
183076
183073
  const childDetail = this.childCurve.moveSignedDistanceFromFraction(this.childFraction0, chainDistance - this.chainDistance0, allowExtrapolation ?? false);
183077
183074
  return childDetail.fraction;
183078
183075
  }
183079
183076
  /**
183080
- * Return the scale factor to map childCurve fraction derivatives to chain fraction derivatives
183081
- * @param globalDistance total length of the global curve.
183077
+ * Return the scale factor to map childCurve fraction derivatives to chain fraction derivatives.
183078
+ * @param globalDistance total length of the global curve
183082
183079
  */
183083
183080
  fractionScaleFactor(globalDistance) {
183084
183081
  return globalDistance * (this.childFraction1 - this.childFraction0) / (this.chainDistance1 - this.chainDistance0);
183085
183082
  }
183086
183083
  /**
183087
183084
  * Reverse the fraction and distance data.
183088
- * * each child fraction `f` is replaced by `1-f`
183089
- * * each `chainDistance` is replaced by `totalDistance-chainDistance`
183085
+ * * Each child fraction `f` is replaced by `1-f`
183086
+ * * Each `chainDistance` is replaced by `totalDistance - chainDistance`
183087
+ * @param totalDistance the total distance
183090
183088
  */
183091
183089
  reverseFractionsAndDistances(totalDistance) {
183092
183090
  const f0 = this.childFraction0;
@@ -183098,14 +183096,14 @@ class PathFragment {
183098
183096
  this.chainDistance0 = totalDistance - d1;
183099
183097
  this.chainDistance1 = totalDistance - d0;
183100
183098
  }
183101
- /** @deprecated in 3.x. Use childFractionToChainDistance */
183099
+ /** @deprecated in 3.x. Use `PathFragment.childFractionToChainDistance`. */
183102
183100
  childFractionTChainDistance(fraction) {
183103
183101
  return this.childFractionToChainDistance(fraction);
183104
183102
  }
183105
183103
  /**
183106
- * Convert a fractional position on the childCurve to distance in the chain space.
183107
- * * Return value is SIGNED -- will be negative when fraction < this.childFraction0.
183108
- * @param fraction fraction along the curve within this fragment
183104
+ * Convert a fractional position on the childCurve of this fragment to distance on the curve chain.
183105
+ * * Return value is SIGNED and will be negative when `fraction < this.childFraction0`.
183106
+ * @param fraction the fractional position on the childCurve of this fragment
183109
183107
  */
183110
183108
  childFractionToChainDistance(fraction) {
183111
183109
  let d = this.childCurve.curveLengthBetweenFractions(this.childFraction0, fraction);
@@ -183114,7 +183112,7 @@ class PathFragment {
183114
183112
  return this.chainDistance0 + d;
183115
183113
  }
183116
183114
  }
183117
- /** Non-instantiable class to build a distance index for a path. */
183115
+ /** Non-instantiable class to build a distance index for a curve chain. */
183118
183116
  class DistanceIndexConstructionContext {
183119
183117
  constructor() {
183120
183118
  this._accumulatedDistance = 0;
@@ -183126,23 +183124,22 @@ class DistanceIndexConstructionContext {
183126
183124
  endParentCurvePrimitive(_cp) { }
183127
183125
  endCurvePrimitive(_cp) { }
183128
183126
  announcePointTangent(_xyz, _fraction, _tangent) { }
183129
- /** Announce numPoints interpolated between point0 and point1, with associated fractions */
183130
183127
  announceSegmentInterval(cp, point0, point1, numStrokes, fraction0, fraction1) {
183131
183128
  const fragmentPoint0 = point0.clone();
183132
183129
  const fragmentPoint1 = point1.clone();
183133
183130
  let d0 = this._accumulatedDistance;
183134
183131
  if (numStrokes <= 1) {
183135
183132
  this._accumulatedDistance += point0.distance(point1);
183136
- this._fragments.push(new PathFragment(fraction0, fraction1, d0, this._accumulatedDistance, cp, _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__.Range3d.create(fragmentPoint0, fragmentPoint1)));
183133
+ this._fragments.push(new PathFragment(fraction0, fraction1, d0, this._accumulatedDistance, cp, _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__.Range3d.create(fragmentPoint0, fragmentPoint1)));
183137
183134
  }
183138
183135
  else {
183139
183136
  let f1;
183140
183137
  for (let i = 1, f0 = fraction0; i <= numStrokes; i++, f0 = f1) {
183141
- f1 = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.interpolate(fraction0, i / numStrokes, fraction1);
183138
+ f1 = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(fraction0, i / numStrokes, fraction1);
183142
183139
  point0.interpolate(f1, point1, fragmentPoint1);
183143
183140
  d0 = this._accumulatedDistance;
183144
183141
  this._accumulatedDistance += (Math.abs(f1 - f0) * point0.distance(point1));
183145
- this._fragments.push(new PathFragment(f0, f1, d0, this._accumulatedDistance, cp, _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__.Range3d.create(fragmentPoint0, fragmentPoint1)));
183142
+ this._fragments.push(new PathFragment(f0, f1, d0, this._accumulatedDistance, cp, _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__.Range3d.create(fragmentPoint0, fragmentPoint1)));
183146
183143
  fragmentPoint0.setFrom(fragmentPoint1);
183147
183144
  }
183148
183145
  }
@@ -183150,7 +183147,7 @@ class DistanceIndexConstructionContext {
183150
183147
  announceIntervalForUniformStepStrokes(cp, numStrokes, fraction0, fraction1) {
183151
183148
  let f1, d, d0;
183152
183149
  for (let i = 1, f0 = fraction0; i <= numStrokes; i++, f0 = f1) {
183153
- f1 = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.interpolate(fraction0, i / numStrokes, fraction1);
183150
+ f1 = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(fraction0, i / numStrokes, fraction1);
183154
183151
  d = cp.curveLengthBetweenFractions(f0, f1);
183155
183152
  d0 = this._accumulatedDistance;
183156
183153
  this._accumulatedDistance += d;
@@ -183158,7 +183155,10 @@ class DistanceIndexConstructionContext {
183158
183155
  this._fragments.push(new PathFragment(f0, f1, d0, this._accumulatedDistance, cp, range));
183159
183156
  }
183160
183157
  }
183161
- needPrimaryGeometryForStrokes() { return true; }
183158
+ needPrimaryGeometryForStrokes() {
183159
+ return true;
183160
+ }
183161
+ /** Create an array of PathFragment from input curve chain. */
183162
183162
  static createPathFragmentIndex(path, options) {
183163
183163
  const handler = new DistanceIndexConstructionContext();
183164
183164
  for (const curve of path.children) {
@@ -183173,12 +183173,11 @@ class DistanceIndexConstructionContext {
183173
183173
  * distance along a CurveChain.
183174
183174
  * * For example if the total length of the chain is `L`, then the distance along the chain from parameters `t0`
183175
183175
  * to `t1` is easily computed as `L*(t1-t0)`.
183176
- * * The curve chain can be any type derived from CurveChain.
183177
- * * * i.e. either a `Path` or a `Loop`
183176
+ * * The curve chain can be any type derived from `CurveChain`, i.e., either a `Path` or a `Loop`.
183178
183177
  * @public
183179
183178
  */
183180
- class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__.CurvePrimitive {
183181
- /** Test if other is a `CurveChainWithDistanceIndex` */
183179
+ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_3__.CurvePrimitive {
183180
+ /** Test if `other` is a `CurveChainWithDistanceIndex` */
183182
183181
  isSameGeometryClass(other) {
183183
183182
  return other instanceof CurveChainWithDistanceIndex;
183184
183183
  }
@@ -183197,13 +183196,13 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
183197
183196
  */
183198
183197
  cloneTransformed(transform) {
183199
183198
  const c = this._path.clone();
183200
- if (c instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_3__.CurveChain && c.tryTransformInPlace(transform))
183199
+ if (c instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_4__.CurveChain && c.tryTransformInPlace(transform))
183201
183200
  return CurveChainWithDistanceIndex.createCapture(c);
183202
183201
  return undefined;
183203
183202
  }
183204
183203
  /**
183205
183204
  * Reference to the contained path.
183206
- * * Do not modify the path. The distance index will be wrong.
183205
+ * * Do not modify the path. The distance index will be wrong.
183207
183206
  */
183208
183207
  get path() {
183209
183208
  return this._path;
@@ -183248,7 +183247,7 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
183248
183247
  const childFractionA = fragmentA.chainDistanceToAccurateChildFraction(chainDistanceA, true);
183249
183248
  const childFractionB = fragmentB.chainDistanceToAccurateChildFraction(chainDistanceB, true);
183250
183249
  // add a (possibly reversed) partial clone to newPath
183251
- const newPath = _Path__WEBPACK_IMPORTED_MODULE_4__.Path.create();
183250
+ const newPath = _Path__WEBPACK_IMPORTED_MODULE_5__.Path.create();
183252
183251
  const addPartialChild = (childCurve, childFraction0, childFraction1, reversedClone) => {
183253
183252
  if (childFraction0 === childFraction1)
183254
183253
  return false;
@@ -183297,19 +183296,19 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
183297
183296
  }
183298
183297
  return true;
183299
183298
  }
183300
- /** Return the start point of the primitive. The default implementation returns fractionToPoint (0.0) */
183299
+ /** Return the start point of `this` curve. */
183301
183300
  startPoint(result) {
183302
183301
  const c = this._path.cyclicCurvePrimitive(0);
183303
183302
  if (c)
183304
183303
  return c.startPoint(result);
183305
- return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.createZero(result);
183304
+ return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.createZero(result);
183306
183305
  }
183307
- /** Return the end point of the primitive. The default implementation returns fractionToPoint(1.0) */
183306
+ /** Return the end point of of `this` curve. */
183308
183307
  endPoint(result) {
183309
183308
  const c = this._path.cyclicCurvePrimitive(-1);
183310
183309
  if (c)
183311
183310
  return c.endPoint(result);
183312
- return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.createZero(result);
183311
+ return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.createZero(result);
183313
183312
  }
183314
183313
  /** Add strokes to caller-supplied linestring */
183315
183314
  emitStrokes(dest, options) {
@@ -183340,7 +183339,7 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
183340
183339
  /**
183341
183340
  * Return an array containing only the curve primitives.
183342
183341
  * @param collectorArray array to receive primitives (pushed -- the array is not cleared)
183343
- * @param smallestPossiblePrimitives if true, recurse on the (otherwise hidden) children. If false, only push `this`.
183342
+ * @param smallestPossiblePrimitives if true, recurse on the children. If false, only push `this`.
183344
183343
  * @param explodeLinestrings (if smallestPossiblePrimitives is true) whether to push a [[LineSegment3d]] for each
183345
183344
  * segment of a [[LineString3d]] child. If false, push only the [[LineString3d]].
183346
183345
  */
@@ -183360,28 +183359,24 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
183360
183359
  * @param parentStrokeMap evolving parent map.
183361
183360
  */
183362
183361
  computeAndAttachRecursiveStrokeCounts(options, parentStrokeMap) {
183363
- const myMap = _curve_Query_StrokeCountMap__WEBPACK_IMPORTED_MODULE_6__.StrokeCountMap.createWithCurvePrimitiveAndOptionalParent(this, parentStrokeMap);
183362
+ const myMap = _curve_Query_StrokeCountMap__WEBPACK_IMPORTED_MODULE_7__.StrokeCountMap.createWithCurvePrimitiveAndOptionalParent(this, parentStrokeMap);
183364
183363
  for (const c of this._path.children) {
183365
183364
  c.computeAndAttachRecursiveStrokeCounts(options, myMap);
183366
183365
  }
183367
- _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__.CurvePrimitive.installStrokeCountMap(this, myMap, parentStrokeMap);
183366
+ _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_3__.CurvePrimitive.installStrokeCountMap(this, myMap, parentStrokeMap);
183368
183367
  }
183369
183368
  /**
183370
- * Second step of double dispatch: call `this._path.dispatchToGeometryHandler (handler)`
183369
+ * Second step of double dispatch: call `this._path.dispatchToGeometryHandler (handler)`
183371
183370
  * * Note that this exposes the children individually to the handler.
183372
183371
  */
183373
183372
  dispatchToGeometryHandler(handler) {
183374
- return this._path.dispatchToGeometryHandler(handler);
183373
+ return handler.handleCurveChainWithDistanceIndex(this);
183375
183374
  }
183376
- /** Extend (increase) `rangeToExtend` as needed to include these curves (optionally transformed) */
183375
+ /** Extend `rangeToExtend` as needed to include these curves (optionally transformed) */
183377
183376
  extendRange(rangeToExtend, transform) {
183378
183377
  this._path.extendRange(rangeToExtend, transform);
183379
183378
  }
183380
- /**
183381
- * Curve length is always positive.
183382
- * @returns Returns a (high accuracy) length of the curve between fractional positions
183383
- * @returns Returns the length of the curve.
183384
- */
183379
+ /** Return a (high accuracy and positive) length of the curve between fractional positions */
183385
183380
  curveLengthBetweenFractions(fraction0, fraction1) {
183386
183381
  return Math.abs(fraction1 - fraction0) * this._totalLength;
183387
183382
  }
@@ -183395,9 +183390,10 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
183395
183390
  return result;
183396
183391
  }
183397
183392
  /**
183398
- * Resolve a fraction of the CurveChain to a PathFragment
183399
- * @param distance
183400
- * @param allowExtrapolation
183393
+ * Return the PathFragment object at the given `distance` along the chain.
183394
+ * @param distance distance along the chain.
183395
+ * @param allowExtrapolation if `true`, returns first fragment for negative distances and returns last fragment
183396
+ * for distances larger than curve length. If `false` returns `undefined` for those out of bound distances.
183401
183397
  */
183402
183398
  chainDistanceToFragment(distance, allowExtrapolation = false) {
183403
183399
  const i = this.chainDistanceToFragmentIndex(distance, allowExtrapolation);
@@ -183406,9 +183402,10 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
183406
183402
  return undefined;
183407
183403
  }
183408
183404
  /**
183409
- * Resolve a fraction of the CurveChain to a PathFragment index
183410
- * @param distance
183411
- * @param allowExtrapolation
183405
+ * Return the index of the PathFragment at the given `distance` along the chain.
183406
+ * @param distance distance along the chain.
183407
+ * @param allowExtrapolation if `true`, returns 0 for negative distances and returns last fragment index for
183408
+ * distances larger than curve length. If `false` returns `undefined` for those out of bound distances.
183412
183409
  */
183413
183410
  chainDistanceToFragmentIndex(distance, allowExtrapolation = false) {
183414
183411
  const numFragments = this._fragments.length;
@@ -183418,7 +183415,7 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
183418
183415
  return allowExtrapolation ? 0 : undefined;
183419
183416
  if (distance > this._totalLength)
183420
183417
  return allowExtrapolation ? (numFragments - 1) : undefined;
183421
- // humbug, linear search
183418
+ // linear search (opportunity for improvement)
183422
183419
  for (let i = 0; i < numFragments; i++) {
183423
183420
  if (fragments[i].containsChainDistance(distance))
183424
183421
  return i;
@@ -183428,33 +183425,29 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
183428
183425
  }
183429
183426
  /**
183430
183427
  * Convert distance along the chain to fraction along the chain.
183431
- * @param distance distance along the chain
183428
+ * @param distance distance along the chain.
183432
183429
  */
183433
183430
  chainDistanceToChainFraction(distance) {
183434
183431
  return distance / this._totalLength;
183435
183432
  }
183436
- /**
183437
- * Resolve a fraction within a specific curve to a fragment.
183438
- * @param curve
183439
- * @param fraction
183440
- */
183433
+ /** Return the PathFragment object containing the point at the given `fraction` of the given child curve. */
183441
183434
  curveAndChildFractionToFragment(curve, fraction) {
183442
183435
  const numFragments = this._fragments.length;
183443
183436
  const fragments = this._fragments;
183444
183437
  if (numFragments > 0) {
183445
- // humbug, linear search
183438
+ if (fraction < 0)
183439
+ return fragments[0];
183440
+ if (fraction > 1.0)
183441
+ return fragments[numFragments - 1];
183442
+ // linear search (opportunity for improvement)
183446
183443
  for (const fragment of fragments) {
183447
183444
  if (fragment.containsChildCurveAndChildFraction(curve, fraction))
183448
183445
  return fragment;
183449
183446
  }
183450
- if (fraction <= 0)
183451
- return fragments[0];
183452
- if (fraction > 1.0)
183453
- return fragments[numFragments - 1];
183454
183447
  }
183455
183448
  return undefined;
183456
183449
  }
183457
- /** Returns the total length of curves. */
183450
+ /** Returns the total length of `this` curve. */
183458
183451
  curveLength() {
183459
183452
  return this._totalLength;
183460
183453
  }
@@ -183467,52 +183460,59 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
183467
183460
  }
183468
183461
  /**
183469
183462
  * Return the point (x,y,z) on the curve at fractional position along the chain.
183470
- * @param fraction fractional position along the geometry.
183471
- * @returns Returns a point on the curve.
183463
+ * @param fraction fractional position along the curve.
183464
+ * @returns a point on the curve.
183472
183465
  */
183473
183466
  fractionToPoint(fraction, result) {
183474
- const chainDistance = fraction * this._totalLength;
183475
- const fragment = this.chainDistanceToFragment(chainDistance, true);
183467
+ const distanceAlongPath = fraction * this._totalLength;
183468
+ const fragment = this.chainDistanceToFragment(distanceAlongPath, true);
183476
183469
  if (fragment) {
183477
- const childFraction = fragment.chainDistanceToAccurateChildFraction(chainDistance, true);
183470
+ const childFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
183478
183471
  return fragment.childCurve.fractionToPoint(childFraction, result);
183479
183472
  }
183480
- // no fragment found. Use _fragments[0]
183481
- // fragment = this.chainDistanceToFragment(chainDistance, true);
183473
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false); // we never expect to get here
183474
+ // no fragment found. just return the first point on the curve.
183482
183475
  return this._fragments[0].childCurve.fractionToPoint(0.0, result);
183483
183476
  }
183484
183477
  /**
183485
183478
  * Return the point (x,y,z) and derivative on the curve at fractional position.
183486
- * * Note that this derivative is "derivative of xyz with respect to fraction."
183487
- * * this derivative shows the speed of the "fractional point" moving along the curve.
183488
- * * this is not generally a unit vector. use fractionToPointAndUnitTangent for a unit vector.
183479
+ * * Note that the derivative is "derivative of xyz with respect to fraction".
183480
+ * * The derivative shows the speed of the "fractional point" moving along the curve.
183481
+ * * The derivative is not generally a unit vector. Use `fractionToPointAndUnitTangent` for a unit vector.
183489
183482
  * @param fraction fractional position along the geometry.
183490
- * @returns Returns a ray whose origin is the curve point and direction is the derivative with respect to the fraction.
183483
+ * @param result optional receiver for the result.
183484
+ * @returns a ray whose origin is the curve point and direction is the derivative with respect to the fraction.
183491
183485
  */
183492
183486
  fractionToPointAndDerivative(fraction, result) {
183493
183487
  const distanceAlongPath = fraction * this._totalLength;
183494
183488
  const fragment = this.chainDistanceToFragment(distanceAlongPath, true);
183495
- const curveFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
183496
- result = fragment.childCurve.fractionToPointAndDerivative(curveFraction, result);
183497
- // Fractional arc length parameterization for the curve C is f=f(t)=s(t)/L, where
183498
- // L is total length of C, f'=||C'||/L, and inverse t=t(f), t'=1/f'=L/||C'||.
183499
- // Then d/df(C(t(f)))=C't'=C'L/||C'||. The fragment gave us C', so the
183500
- // derivative we seek is just a scale away.
183501
- const a = this._totalLength / result.direction.magnitude();
183489
+ const childFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
183490
+ result = fragment.childCurve.fractionToPointAndDerivative(childFraction, result);
183491
+ // Recall the standard arclength formula s(t) for the curve C = C(t), with derivative s'(t) = ||C'||.
183492
+ // Define fractional arclength for C by f = f(t) = s(t)/L, where L is the total length of C. Then f' = ||C'||/L.
183493
+ // Denote the inverse of f by t = t(f). Then C = C(t(f)) is a parameterization of C by its fractional arclength f.
183494
+ // Since the derivative of t is t'=1/f'=L/||C'||, the derivative we seek is d/df(C(t(f))) = C' t' = C' L/||C'||.
183495
+ // The fragment gives us C', so we're just a scale away.
183496
+ // Math details can be found at core/geometry/internaldocs/Curve.md
183497
+ const a = this._totalLength / result.direction.magnitude(); // L/||C'||
183502
183498
  result.direction.scaleInPlace(a);
183503
183499
  return result;
183504
183500
  }
183505
183501
  /**
183506
- * Returns a ray whose origin is the curve point and direction is the unit tangent.
183502
+ * Return the point (x,y,z) and normalized derivative on the curve at fractional position.
183503
+ * * Note that the derivative is "derivative of xyz with respect to fraction".
183504
+ * * The un-normalized derivative shows the speed of the "fractional point" moving along the curve.
183505
+ * * To find the un-normalized derivative, use `fractionToPointAndDerivative`.
183507
183506
  * @param fraction fractional position on the curve
183508
183507
  * @param result optional receiver for the result.
183509
- * Returns a ray whose origin is the curve point and direction is the unit tangent.
183508
+ * @returns a ray whose origin is the curve point and direction is the normalized derivative with respect to
183509
+ * the fraction.
183510
183510
  */
183511
183511
  fractionToPointAndUnitTangent(fraction, result) {
183512
183512
  const distanceAlongPath = fraction * this._totalLength;
183513
183513
  const fragment = this.chainDistanceToFragment(distanceAlongPath, true);
183514
- const curveFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
183515
- result = fragment.childCurve.fractionToPointAndDerivative(curveFraction, result);
183514
+ const childFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
183515
+ result = fragment.childCurve.fractionToPointAndDerivative(childFraction, result);
183516
183516
  result.direction.normalizeInPlace();
183517
183517
  return result;
183518
183518
  }
@@ -183521,34 +183521,39 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
183521
183521
  * * origin at fractional position along the curve
183522
183522
  * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to
183523
183523
  * the fraction.
183524
- * * vectorV is the second derivative, i.e.derivative of vectorU.
183524
+ * * vectorV is the second derivative, i.e. derivative of vectorU which points in the direction of the curve's
183525
+ * derivative's change.
183525
183526
  */
183526
183527
  fractionToPointAnd2Derivatives(fraction, result) {
183527
183528
  const distanceAlongPath = fraction * this._totalLength;
183528
183529
  const fragment = this.chainDistanceToFragment(distanceAlongPath, true);
183529
- const curveFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
183530
- result = fragment.childCurve.fractionToPointAnd2Derivatives(curveFraction, result);
183530
+ const childFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
183531
+ result = fragment.childCurve.fractionToPointAnd2Derivatives(childFraction, result);
183531
183532
  if (!result)
183532
183533
  return undefined;
183533
- // See fractionToPointAndDerivative for derivation of d/df(C(t(f)))=L C'/||C'||.
183534
- // For the 2nd deriv, use quotient rule, d/dt||x(t)||=x.x'/||x|| and ||x||^2=x.x :
183535
- // d2/df2(C(t(f))) = L d/df(C'/||C'||)
183536
- // = L (||C'|| d/df(C') - C' d/df||C'||) / ||C'||^2
183534
+ // See fractionToPointAndDerivative, where we show d/df(C(t(f))) = L C'/||C'||.
183535
+ // Here we seek the 2nd derivative. We'll use the quotient rule, and the identities
183536
+ // d/dt||x(t)|| = x.x'/||x|| and ||x||^2 = x.x, where "." is the dot product.
183537
+ // d2/df2(C(t(f))) = L d/df(C'/||C'||) = L (||C'|| d/df(C') - C' d/df||C'||) / ||C'||^2
183537
183538
  // = L (||C'|| C" L/||C'|| - C' C'.C"/||C'|| L/||C'||) / ||C'||^2
183538
- // = (L/||C'||)^2 (C" - C' C'.C"/C'.C' )
183539
- // We have C' and C" from the fragment.
183540
- const magU = result.vectorU.magnitude();
183541
- const dotUU = magU * magU;
183542
- const dotUV = result.vectorU.dotProduct(result.vectorV);
183543
- result.vectorV.addScaledInPlace(result.vectorU, -dotUV / dotUU);
183544
- const scale = this._totalLength / magU;
183545
- result.vectorU.scaleInPlace(scale);
183546
- result.vectorV.scaleInPlace(scale * scale);
183539
+ // = (L/||C'||)^2 (C" - C' C'.C"/C'.C' ), where C' and C" are given by the fragment.
183540
+ // The second derivative that fractionToPointAnd2Derivatives returns is C", so the second
183541
+ // derivative we seek is just few scales away.
183542
+ // Math details can be found at core/geometry/internaldocs/Curve.md
183543
+ const magU = result.vectorU.magnitude(); // ||C'||
183544
+ const dotUU = magU * magU; // ||C'||^2
183545
+ const dotUV = result.vectorU.dotProduct(result.vectorV); // C'.C"
183546
+ result.vectorV.addScaledInPlace(result.vectorU, -dotUV / dotUU); // add -(C'*C'.C")/(||C'||^2) to vectorV
183547
+ const scale = this._totalLength / magU; // L/||C'||
183548
+ result.vectorU.scaleInPlace(scale); // scale vectorU by L/||C'||
183549
+ result.vectorV.scaleInPlace(scale * scale); // scale vectorV by (L/||C'(t)||)^2
183547
183550
  return result;
183548
183551
  }
183549
183552
  /**
183550
183553
  * Attempt to transform in place.
183551
- * * Warning: If any child fails, this object becomes invalid. But that should never happen.
183554
+ * * Warning: If any child transform fails, `this` object becomes invalid but that should never happen.
183555
+ * @param transform the transform to be applied.
183556
+ * @returns true if all of child transforms succeed and false otherwise.
183552
183557
  */
183553
183558
  tryTransformInPlace(transform) {
183554
183559
  let numFail = 0;
@@ -183561,48 +183566,45 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
183561
183566
  /** Reverse the curve's data so that its fractional stroking moves in the opposite direction. */
183562
183567
  reverseInPlace() {
183563
183568
  this._path.reverseChildrenInPlace();
183564
- const totalLength = this._totalLength;
183565
183569
  for (const fragment of this._fragments) {
183566
- fragment.reverseFractionsAndDistances(totalLength);
183570
+ fragment.reverseFractionsAndDistances(this._totalLength);
183567
183571
  }
183568
183572
  this._fragments.reverse();
183569
183573
  }
183570
183574
  /**
183571
- * Test for equality conditions:
183572
- * * Mismatched totalLength is a quick exit condition
183573
- * * If totalLength matches, recurse to the path for matching primitives.
183574
- * @param other
183575
+ * Test for equality conditions.
183576
+ * * Mismatched total length is a quick exit condition.
183577
+ * * If total length matches, recurse to the path for matching primitives.
183575
183578
  */
183576
183579
  isAlmostEqual(other) {
183577
183580
  if (other instanceof CurveChainWithDistanceIndex) {
183578
- return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this._totalLength, other._totalLength)
183579
- && this._path.isAlmostEqual(other._path);
183581
+ return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this._totalLength, other._totalLength) && this._path.isAlmostEqual(other._path);
183580
183582
  }
183581
183583
  return false;
183582
183584
  }
183583
183585
  /**
183584
- * Implement moveSignedDistanceFromFraction.
183585
- * * See `CurvePrimitive` for parameter details.
183586
- * * The returned location directly identifies fractional position along the CurveChainWithDistanceIndex, and
183586
+ * (Attempt to) find a position on the curve at a signed distance from start fraction.
183587
+ * * See `CurvePrimitive.moveSignedDistanceFromFraction` for parameter details.
183588
+ * * The returned location directly identifies fractional position along the CurveChainWithDistanceIndex and
183587
183589
  * has pointer to an additional detail for the child curve.
183588
183590
  */
183589
183591
  moveSignedDistanceFromFraction(startFraction, signedDistance, allowExtension, result) {
183590
183592
  const distanceA = startFraction * this._totalLength;
183591
183593
  const distanceB = distanceA + signedDistance;
183592
183594
  const fragmentB = this.chainDistanceToFragment(distanceB, true);
183593
- const childDetail = fragmentB.childCurve.moveSignedDistanceFromFraction(fragmentB.childFraction0, distanceB - fragmentB.chainDistance0, allowExtension, result);
183595
+ const childDetail = fragmentB.childCurve.moveSignedDistanceFromFraction(fragmentB.childFraction0, distanceB - fragmentB.chainDistance0, allowExtension, result); // local detail related to the child curve
183594
183596
  const endFraction = startFraction + (signedDistance / this._totalLength);
183595
- const chainDetail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_7__.CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, endFraction, signedDistance, result);
183597
+ const chainDetail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__.CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, endFraction, signedDistance, result); // global detail related to the curve chain
183596
183598
  chainDetail.childDetail = childDetail;
183597
183599
  return chainDetail;
183598
183600
  }
183599
183601
  /**
183602
+ * Return an object summarizing closest point test counts.
183600
183603
  * The returned object has
183601
183604
  * * numCalls = number of times closestPoint was called.
183602
- * * numCurvesTested = number of curves tested with full closestPoint
183603
- * * numAssigned = number of times a new minimum value was recorded
183605
+ * * numCurvesTested = number of curves tested with full closestPoint.
183606
+ * * numAssigned = number of times a new minimum value was recorded.
183604
183607
  * * numCandidate = number of curves that would be tested in worst case.
183605
- * return an object summarizing closest point test counts
183606
183608
  * @param clear if true, counts are cleared after the return object is formed.
183607
183609
  */
183608
183610
  static getClosestPointTestCounts(clear = true) {
@@ -183619,13 +183621,13 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
183619
183621
  }
183620
183622
  /**
183621
183623
  * Search for the curve point that is closest to the spacePoint.
183622
- * * The CurveChainWithDistanceIndex invokes the base class CurvePrimitive method, which
183623
- * (via a handler) determines a CurveLocation detail among the children.
183624
- * * The returned detail directly identifies fractional position along the CurveChainWithDistanceIndex, and
183624
+ * * The CurveChainWithDistanceIndex invokes the base class CurvePrimitive method, which (via a handler)
183625
+ * determines a CurveLocation detail among the children.
183626
+ * * The returned detail directly identifies fractional position along the CurveChainWithDistanceIndex and
183625
183627
  * has pointer to an additional detail for the child curve.
183626
183628
  * @param spacePoint point in space
183627
183629
  * @param extend true to extend the curve
183628
- * @returns Returns a CurveLocationDetail structure that holds the details of the close point.
183630
+ * @returns a CurveLocationDetail structure that holds the details of the close point.
183629
183631
  */
183630
183632
  closestPoint(spacePoint, extend) {
183631
183633
  let childDetail;
@@ -183636,52 +183638,51 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
183636
183638
  }
183637
183639
  else {
183638
183640
  const sortedFragments = PathFragment.collectSortedQuickMinDistances(this._fragments, spacePoint);
183639
- const extend0 = [_CurveExtendMode__WEBPACK_IMPORTED_MODULE_8__.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 0), _CurveExtendMode__WEBPACK_IMPORTED_MODULE_8__.CurveExtendMode.None];
183640
- const extend1 = [_CurveExtendMode__WEBPACK_IMPORTED_MODULE_8__.CurveExtendMode.None, _CurveExtendMode__WEBPACK_IMPORTED_MODULE_8__.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 1)];
183641
+ const extend0 = [
183642
+ _CurveExtendMode__WEBPACK_IMPORTED_MODULE_9__.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 0),
183643
+ _CurveExtendMode__WEBPACK_IMPORTED_MODULE_9__.CurveExtendMode.None,
183644
+ ];
183645
+ const extend1 = [
183646
+ _CurveExtendMode__WEBPACK_IMPORTED_MODULE_9__.CurveExtendMode.None,
183647
+ _CurveExtendMode__WEBPACK_IMPORTED_MODULE_9__.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 1),
183648
+ ];
183641
183649
  const fragment0 = this._fragments[0];
183642
183650
  const fragment1 = this._fragments[this._fragments.length - 1];
183643
183651
  CurveChainWithDistanceIndex._numCalls++;
183644
183652
  CurveChainWithDistanceIndex._numCandidate += sortedFragments.length;
183645
- for (const f of sortedFragments) {
183646
- if (f.a > aMin)
183653
+ let detailA;
183654
+ for (const sortedFragment of sortedFragments) {
183655
+ if (sortedFragment.a > aMin)
183656
+ // sortedFragments help early exit because it is likely that one of the first few fragments
183657
+ // in sortedFragments is the fragment with minimum distance from space point to the curve.
183647
183658
  break;
183648
183659
  CurveChainWithDistanceIndex._numTested++;
183649
- const child = f.childCurve;
183650
- const detailA = child.closestPoint(spacePoint, f === fragment0 ? extend0 : f === fragment1 ? extend1 : false);
183660
+ const child = sortedFragment.childCurve;
183661
+ detailA = child.closestPoint(spacePoint, sortedFragment === fragment0 ? extend0 : sortedFragment === fragment1 ? extend1 : false, detailA);
183651
183662
  if (detailA && detailA.a < aMin) {
183652
183663
  aMin = detailA.a;
183653
- childDetail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_7__.CurveLocationDetail.createCurveFractionPoint(detailA.curve, detailA.fraction, detailA.point, childDetail);
183654
- childDetail.a = detailA.a;
183664
+ childDetail = detailA.clone(childDetail);
183655
183665
  CurveChainWithDistanceIndex._numAssigned++;
183656
183666
  }
183657
183667
  }
183658
183668
  }
183659
183669
  if (!childDetail)
183660
183670
  return undefined;
183661
- const fragment = this.curveAndChildFractionToFragment(childDetail.curve, childDetail.fraction);
183662
- if (fragment) {
183663
- const chainDistance = fragment.childFractionToChainDistance(childDetail.fraction);
183664
- const chainFraction = this.chainDistanceToChainFraction(chainDistance);
183665
- const chainDetail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_7__.CurveLocationDetail.createCurveFractionPoint(this, chainFraction, childDetail.point);
183666
- chainDetail.childDetail = childDetail;
183667
- chainDetail.a = childDetail.a;
183668
- return chainDetail;
183669
- }
183670
- return undefined;
183671
+ return this.computeChainDetail(childDetail);
183671
183672
  }
183672
183673
  /**
183673
183674
  * Construct an offset of each child as viewed in the xy-plane (ignoring z).
183674
- * * No attempt is made to join the offset children. Use RegionOps.constructCurveXYOffset() to return a fully
183675
+ * * No attempt is made to join the offset children. Use RegionOps.constructCurveXYOffset to return a fully
183675
183676
  * joined offset.
183676
- * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object
183677
+ * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve) or offset options object.
183677
183678
  */
183678
183679
  constructOffsetXY(offsetDistanceOrOptions) {
183679
- const options = _OffsetOptions__WEBPACK_IMPORTED_MODULE_9__.OffsetOptions.create(offsetDistanceOrOptions);
183680
+ const options = _OffsetOptions__WEBPACK_IMPORTED_MODULE_10__.OffsetOptions.create(offsetDistanceOrOptions);
183680
183681
  const offsets = [];
183681
183682
  for (const prim of this.collectCurvePrimitives(undefined, true, true)) {
183682
183683
  const offset = prim.constructOffsetXY(options);
183683
183684
  if (offset !== undefined) {
183684
- if (offset instanceof _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__.CurvePrimitive)
183685
+ if (offset instanceof _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_3__.CurvePrimitive)
183685
183686
  offsets.push(offset);
183686
183687
  else if (Array.isArray(offset))
183687
183688
  offset.forEach((cp) => offsets.push(cp));
@@ -183693,12 +183694,31 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
183693
183694
  * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of
183694
183695
  * projection.
183695
183696
  * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.
183696
- * @param lowHigh optional receiver for output
183697
+ * @param lowHigh optional receiver for output.
183697
183698
  * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the
183698
183699
  * end of the ray.
183699
183700
  */
183700
183701
  projectedParameterRange(ray, lowHigh) {
183701
- return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_10__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
183702
+ return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_11__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
183703
+ }
183704
+ /**
183705
+ * Compute the global chain detail corresponding to a local child detail.
183706
+ * @param childDetail the local detail, with respect to a child of this chain.
183707
+ * @returns the global detail, with respect to this chain.
183708
+ */
183709
+ computeChainDetail(childDetail) {
183710
+ if (!childDetail.curve)
183711
+ return undefined;
183712
+ const fragment = this.curveAndChildFractionToFragment(childDetail.curve, childDetail.fraction);
183713
+ if (fragment) {
183714
+ const chainDistance = fragment.childFractionToChainDistance(childDetail.fraction);
183715
+ const chainFraction = this.chainDistanceToChainFraction(chainDistance);
183716
+ const chainDetail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__.CurveLocationDetail.createCurveFractionPoint(this, chainFraction, childDetail.point);
183717
+ chainDetail.childDetail = childDetail;
183718
+ chainDetail.a = childDetail.a;
183719
+ return chainDetail;
183720
+ }
183721
+ return undefined;
183702
183722
  }
183703
183723
  }
183704
183724
  CurveChainWithDistanceIndex._numCalls = 0;
@@ -186065,8 +186085,8 @@ class CurvePrimitive extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__.Geometr
186065
186085
  * directions), or array of distinct CurveExtendOptions for start and end.
186066
186086
  * @returns Returns a CurveLocationDetail structure that holds the details of the close point.
186067
186087
  */
186068
- closestPoint(spacePoint, extend) {
186069
- const strokeHandler = new _internalContexts_ClosestPointStrokeHandler__WEBPACK_IMPORTED_MODULE_10__.ClosestPointStrokeHandler(spacePoint, extend);
186088
+ closestPoint(spacePoint, extend, result) {
186089
+ const strokeHandler = new _internalContexts_ClosestPointStrokeHandler__WEBPACK_IMPORTED_MODULE_10__.ClosestPointStrokeHandler(spacePoint, extend, result);
186070
186090
  this.emitStrokableParts(strokeHandler);
186071
186091
  return strokeHandler.claimResult();
186072
186092
  }
@@ -193421,7 +193441,7 @@ __webpack_require__.r(__webpack_exports__);
193421
193441
  * @internal
193422
193442
  */
193423
193443
  class ClosestPointStrokeHandler extends _NewtonRtoRStrokeHandler__WEBPACK_IMPORTED_MODULE_0__.NewtonRtoRStrokeHandler {
193424
- constructor(spacePoint, extend) {
193444
+ constructor(spacePoint, extend, result) {
193425
193445
  super();
193426
193446
  this._fractionA = 0;
193427
193447
  this._functionA = 0;
@@ -193431,7 +193451,7 @@ class ClosestPointStrokeHandler extends _NewtonRtoRStrokeHandler__WEBPACK_IMPORT
193431
193451
  this._spacePoint = spacePoint;
193432
193452
  this._workPoint = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
193433
193453
  this._workRay = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_2__.Ray3d.createZero();
193434
- this._closestPoint = undefined;
193454
+ this._closestPoint = result;
193435
193455
  this._extend = extend;
193436
193456
  this.startCurvePrimitive(undefined);
193437
193457
  this._newtonSolver = new _numerics_Newton__WEBPACK_IMPORTED_MODULE_3__.Newton1dUnboundedApproximateDerivative(this);
@@ -193607,18 +193627,20 @@ __webpack_require__.r(__webpack_exports__);
193607
193627
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
193608
193628
  /* harmony export */ CurveCurveCloseApproachXY: () => (/* binding */ CurveCurveCloseApproachXY)
193609
193629
  /* harmony export */ });
193610
- /* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
193611
- /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
193612
- /* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
193613
- /* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
193614
- /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
193615
- /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
193616
- /* harmony import */ var _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../numerics/Polynomials */ "../../core/geometry/lib/esm/numerics/Polynomials.js");
193617
- /* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
193618
- /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
193619
- /* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
193620
- /* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
193621
- /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
193630
+ /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
193631
+ /* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
193632
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
193633
+ /* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
193634
+ /* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
193635
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
193636
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
193637
+ /* harmony import */ var _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../numerics/Polynomials */ "../../core/geometry/lib/esm/numerics/Polynomials.js");
193638
+ /* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
193639
+ /* harmony import */ var _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../CurveChainWithDistanceIndex */ "../../core/geometry/lib/esm/curve/CurveChainWithDistanceIndex.js");
193640
+ /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
193641
+ /* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
193642
+ /* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
193643
+ /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
193622
193644
  /*---------------------------------------------------------------------------------------------
193623
193645
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
193624
193646
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -193638,6 +193660,8 @@ __webpack_require__.r(__webpack_exports__);
193638
193660
 
193639
193661
 
193640
193662
 
193663
+
193664
+
193641
193665
  // cspell:word XYRR
193642
193666
  /**
193643
193667
  * Handler class for XY close approach between _geometryB and another geometry.
@@ -193653,12 +193677,12 @@ __webpack_require__.r(__webpack_exports__);
193653
193677
  * * geometryB is saved for later reference.
193654
193678
  * @internal
193655
193679
  */
193656
- class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_0__.RecurseToCurvesGeometryHandler {
193680
+ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_1__.RecurseToCurvesGeometryHandler {
193657
193681
  setGeometryB(geometryB) {
193658
193682
  this._geometryB = geometryB;
193659
193683
  this._circularArcB = undefined;
193660
193684
  this._circularRadiusB = undefined;
193661
- if (geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_1__.Arc3d) {
193685
+ if (geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
193662
193686
  const r = geometryB.circularRadiusXY();
193663
193687
  if (r !== undefined) {
193664
193688
  this._circularRadiusB = r;
@@ -193666,9 +193690,6 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193666
193690
  }
193667
193691
  }
193668
193692
  }
193669
- reinitialize() {
193670
- this._results = [];
193671
- }
193672
193693
  /**
193673
193694
  * Constructor.
193674
193695
  * @param geometryB second curve for intersection. Saved for reference by specific handler methods.
@@ -193676,8 +193697,8 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193676
193697
  constructor(geometryB) {
193677
193698
  super();
193678
193699
  this.setGeometryB(geometryB);
193679
- this._maxDistanceSquared = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistanceSquared;
193680
- this.reinitialize();
193700
+ this._maxDistanceSquared = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistanceSquared;
193701
+ this._results = [];
193681
193702
  }
193682
193703
  /** Set the (possibly undefined) max XY distance (z is ignored) to accept. */
193683
193704
  set maxDistanceToAccept(value) {
@@ -193712,12 +193733,12 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193712
193733
  grabPairedResults(reinitialize = false) {
193713
193734
  const result = this._results;
193714
193735
  if (reinitialize)
193715
- this.reinitialize();
193736
+ this._results = [];
193716
193737
  return result;
193717
193738
  }
193718
193739
  /** Returns `true` if `detail` has same curve and fraction. */
193719
193740
  sameCurveAndFraction(cp, fraction, detail) {
193720
- return cp === detail.curve && _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isAlmostEqualNumber(fraction, detail.fraction);
193741
+ return cp === detail.curve && _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isAlmostEqualNumber(fraction, detail.fraction);
193721
193742
  }
193722
193743
  /**
193723
193744
  * If distance between pointA and pointB is less than maxDistance, record CurveLocationDetailPair which is
@@ -193726,9 +193747,9 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193726
193747
  testAndRecordPointPairApproach(cpA, fA, pointA, cpB, fB, pointB, reversed) {
193727
193748
  const d2 = pointA.distanceSquaredXY(pointB);
193728
193749
  if (d2 < this._maxDistanceSquared) {
193729
- const detailA = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveFractionPoint(cpA, fA, pointA);
193730
- const detailB = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveFractionPoint(cpB, fB, pointB);
193731
- const pair = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetailPair.createCapture(detailA, detailB);
193750
+ const detailA = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveFractionPoint(cpA, fA, pointA);
193751
+ const detailB = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveFractionPoint(cpB, fB, pointB);
193752
+ const pair = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetailPair.createCapture(detailA, detailB);
193732
193753
  if (reversed)
193733
193754
  pair.swapDetails();
193734
193755
  this._results.push(pair);
@@ -193744,7 +193765,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193744
193765
  * @param cpB the second curve
193745
193766
  * @param fractionB0 start of the second curve
193746
193767
  * @param fractionB1 end of the second curve
193747
- * @param reversed true to have order reversed in final structures
193768
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
193748
193769
  * @param intervalDetails optional CurveLocationDetailPair
193749
193770
  */
193750
193771
  recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, cpB, fractionB0, fractionB1, reversed, intervalDetails) {
@@ -193754,14 +193775,14 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193754
193775
  intervalDetails.detailA.hasFraction1 &&
193755
193776
  intervalDetails.detailB.hasFraction1;
193756
193777
  if (isInterval) {
193757
- globalFractionA = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction, fractionA1);
193758
- globalFractionB = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction, fractionB1);
193759
- globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction1, fractionA1);
193760
- globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction1, fractionB1);
193778
+ globalFractionA = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction, fractionA1);
193779
+ globalFractionB = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction, fractionB1);
193780
+ globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction1, fractionA1);
193781
+ globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction1, fractionB1);
193761
193782
  }
193762
193783
  else {
193763
- globalFractionA = globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionA0, localFractionA, fractionA1);
193764
- globalFractionB = globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionB0, localFractionB, fractionB1);
193784
+ globalFractionA = globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionA0, localFractionA, fractionA1);
193785
+ globalFractionB = globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionB0, localFractionB, fractionB1);
193765
193786
  }
193766
193787
  // ignore duplicate of most recent approach
193767
193788
  const numPrevious = this._results.length;
@@ -193779,8 +193800,8 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193779
193800
  return;
193780
193801
  }
193781
193802
  }
193782
- const detailA = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveFractionPoint(cpA, globalFractionA, cpA.fractionToPoint(globalFractionA));
193783
- const detailB = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveFractionPoint(cpB, globalFractionB, cpB.fractionToPoint(globalFractionB));
193803
+ const detailA = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveFractionPoint(cpA, globalFractionA, cpA.fractionToPoint(globalFractionA));
193804
+ const detailB = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveFractionPoint(cpB, globalFractionB, cpB.fractionToPoint(globalFractionB));
193784
193805
  if (isInterval) {
193785
193806
  detailA.captureFraction1Point1(globalFractionA1, cpA.fractionToPoint(globalFractionA1));
193786
193807
  detailB.captureFraction1Point1(globalFractionB1, cpB.fractionToPoint(globalFractionB1));
@@ -193789,14 +193810,14 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193789
193810
  const d2 = detailA.point.distanceSquaredXY(detailB.point);
193790
193811
  if (d2 > this._maxDistanceSquared)
193791
193812
  return;
193792
- detailA.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveIntervalRole.isolated);
193793
- detailB.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveIntervalRole.isolated);
193813
+ detailA.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveIntervalRole.isolated);
193814
+ detailB.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveIntervalRole.isolated);
193794
193815
  }
193795
193816
  if (reversed) {
193796
- this._results.push(new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetailPair(detailB, detailA));
193817
+ this._results.push(new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetailPair(detailB, detailA));
193797
193818
  }
193798
193819
  else {
193799
- this._results.push(new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetailPair(detailA, detailB));
193820
+ this._results.push(new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetailPair(detailA, detailB));
193800
193821
  }
193801
193822
  }
193802
193823
  /**
@@ -193810,11 +193831,11 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193810
193831
  * @param cpB curveB
193811
193832
  * @param fractionB0 global start fraction on curveB
193812
193833
  * @param fractionB1 global end fraction on curveB
193813
- * @param reversed whether to reverse the details in the pair
193834
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
193814
193835
  */
193815
193836
  capturePairWithLocalFractions(pair, cpA, fractionA0, fractionA1, cpB, fractionB0, fractionB1, reversed) {
193816
- const globalFractionA = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionA0, pair.detailA.fraction, fractionA1);
193817
- const globalFractionB = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionB0, pair.detailB.fraction, fractionB1);
193837
+ const globalFractionA = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionA0, pair.detailA.fraction, fractionA1);
193838
+ const globalFractionB = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionB0, pair.detailB.fraction, fractionB1);
193818
193839
  // ignore duplicate of most recent pair
193819
193840
  const numPrevious = this._results.length;
193820
193841
  if (numPrevious > 0) {
@@ -193831,13 +193852,13 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193831
193852
  return;
193832
193853
  }
193833
193854
  }
193855
+ // recompute the points just in case
193856
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveEvaluatedFraction(cpA, globalFractionA, pair.detailA);
193857
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveEvaluatedFraction(cpB, globalFractionB, pair.detailB);
193858
+ pair.detailA.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveIntervalRole.isolated);
193859
+ pair.detailB.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveIntervalRole.isolated);
193834
193860
  if (reversed)
193835
193861
  pair.swapDetails();
193836
- // recompute the points just in case
193837
- _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveEvaluatedFraction(cpA, globalFractionA, pair.detailA);
193838
- _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveEvaluatedFraction(cpB, globalFractionB, pair.detailB);
193839
- pair.detailA.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveIntervalRole.isolated);
193840
- pair.detailB.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveIntervalRole.isolated);
193841
193862
  this._results.push(pair);
193842
193863
  }
193843
193864
  /**
@@ -193845,7 +193866,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193845
193866
  * @param cpA first curve primitive (possibly different from curve in detailA, but fraction compatible)
193846
193867
  * @param cpB second curve primitive (possibly different from curve in detailA, but fraction compatible)
193847
193868
  * @param pairs array of pairs
193848
- * @param reversed true to have order reversed in final structures.
193869
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
193849
193870
  */
193850
193871
  recordPairs(cpA, cpB, pairs, reversed) {
193851
193872
  if (pairs !== undefined) {
@@ -193858,15 +193879,15 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193858
193879
  * Record fully assembled (but possibly reversed) detail pair.
193859
193880
  * @param detailA first detail
193860
193881
  * @param detailB second detail
193861
- * @param reversed true to have order reversed in final structures.
193882
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
193862
193883
  */
193863
193884
  captureDetailPair(detailA, detailB, reversed) {
193864
193885
  if (detailA && detailB) {
193865
193886
  if (reversed) {
193866
- this._results.push(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetailPair.createCapture(detailB, detailA));
193887
+ this._results.push(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetailPair.createCapture(detailB, detailA));
193867
193888
  }
193868
193889
  else {
193869
- this._results.push(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetailPair.createCapture(detailA, detailB));
193890
+ this._results.push(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetailPair.createCapture(detailA, detailB));
193870
193891
  }
193871
193892
  }
193872
193893
  }
@@ -193887,7 +193908,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193887
193908
  }
193888
193909
  /**
193889
193910
  * Return fractions of close approach within maxDistance between two line segments (a0,a1) and (b0,b1).
193890
- * * Math details can be found at docs/learning/geometry/CurveCurve.md
193911
+ * * Math details can be found at core/geometry/internaldocs/Curve.md
193891
193912
  * @param a0 start point of line a
193892
193913
  * @param a1 end point of line a
193893
193914
  * @param b0 start point of line b
@@ -193907,38 +193928,38 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193907
193928
  const e01y = b1.y - a0.y;
193908
193929
  const e10x = b0.x - a1.x;
193909
193930
  const e10y = b0.y - a1.y;
193910
- const hab0 = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.crossProductXYXY(ux, uy, e00x, e00y);
193911
- const hab1 = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.crossProductXYXY(ux, uy, e01x, e01y);
193912
- const hba0 = -_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.crossProductXYXY(vx, vy, e00x, e00y);
193913
- const hba1 = -_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.crossProductXYXY(vx, vy, e10x, e10y);
193931
+ const hab0 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.crossProductXYXY(ux, uy, e00x, e00y);
193932
+ const hab1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.crossProductXYXY(ux, uy, e01x, e01y);
193933
+ const hba0 = -_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.crossProductXYXY(vx, vy, e00x, e00y);
193934
+ const hba1 = -_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.crossProductXYXY(vx, vy, e10x, e10y);
193914
193935
  if (hab0 * hab1 < 0.0 && hba0 * hba1 < 0.0) { // true intersection, strictly within both segments
193915
193936
  const fractionA = -hba0 / (hba1 - hba0);
193916
193937
  const fractionB = -hab0 / (hab1 - hab0);
193917
- return _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetailPair.createCapture(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveFractionPoint(undefined, fractionA, a0.interpolate(fractionA, a1)), _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveFractionPoint(undefined, fractionB, b0.interpolate(fractionB, b1)));
193938
+ return _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetailPair.createCapture(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveFractionPoint(undefined, fractionA, a0.interpolate(fractionA, a1)), _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveFractionPoint(undefined, fractionB, b0.interpolate(fractionB, b1)));
193918
193939
  }
193919
193940
  // there's no intersection, so find the closest approach within maxDistance from an endpoint
193920
- const closestApproach = new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetailPair();
193941
+ const closestApproach = new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetailPair();
193921
193942
  closestApproach.detailA.a = 2 * maxDistanceSquared; // init to an approach that's too far away
193922
193943
  let reversed = false;
193923
- const uu = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.hypotenuseSquaredXY(ux, uy);
193944
+ const uu = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.hypotenuseSquaredXY(ux, uy);
193924
193945
  if (hab0 * hab0 <= maxDistanceSquared * uu) { // test distance of b0 to u
193925
- const fractionA = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.dotProductXYXY(ux, uy, e00x, e00y) / uu;
193946
+ const fractionA = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYXY(ux, uy, e00x, e00y) / uu;
193926
193947
  if (this.updatePointToSegmentDistance(0, b0, a0, a1, fractionA, maxDistanceSquared, closestApproach))
193927
193948
  reversed = true;
193928
193949
  }
193929
193950
  if (hab1 * hab1 <= maxDistanceSquared * uu) { // test distance of b1 to u
193930
- const fractionA = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.dotProductXYXY(ux, uy, e01x, e01y) / uu;
193951
+ const fractionA = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYXY(ux, uy, e01x, e01y) / uu;
193931
193952
  if (this.updatePointToSegmentDistance(1, b1, a0, a1, fractionA, maxDistanceSquared, closestApproach))
193932
193953
  reversed = true;
193933
193954
  }
193934
- const vv = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.hypotenuseSquaredXY(vx, vy);
193955
+ const vv = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.hypotenuseSquaredXY(vx, vy);
193935
193956
  if (hba0 * hba0 <= maxDistanceSquared * vv) { // test distance of a0 to v
193936
- const fractionB = -_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.dotProductXYXY(vx, vy, e00x, e00y) / vv;
193957
+ const fractionB = -_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYXY(vx, vy, e00x, e00y) / vv;
193937
193958
  if (this.updatePointToSegmentDistance(0, a0, b0, b1, fractionB, maxDistanceSquared, closestApproach))
193938
193959
  reversed = false;
193939
193960
  }
193940
193961
  if (hba1 * hba1 <= maxDistanceSquared * vv) { // test distance of a1 to v
193941
- const fractionB = -_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.dotProductXYXY(vx, vy, e10x, e10y) / vv;
193962
+ const fractionB = -_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYXY(vx, vy, e10x, e10y) / vv;
193942
193963
  if (this.updatePointToSegmentDistance(1, a1, b0, b1, fractionB, maxDistanceSquared, closestApproach))
193943
193964
  reversed = false;
193944
193965
  }
@@ -193960,7 +193981,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193960
193981
  * @param fB0 fraction0 on curveB
193961
193982
  * @param fB1 fraction0 on curveB
193962
193983
  * @param testProjectionOnB whether to record projections of the given curveA points onto curveB
193963
- * @param reversed true to have order reversed in final structures.
193984
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
193964
193985
  */
193965
193986
  testAndRecordFractionalPairApproach(cpA, fA0, fA1, testProjectionOnA, cpB, fB0, fB1, testProjectionOnB, reversed) {
193966
193987
  const pointA0 = cpA.fractionToPoint(fA0);
@@ -193985,7 +194006,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
193985
194006
  // NO NO NO -- this is 3D closest point --- need 2d !!
193986
194007
  const detail = cpB.closestPoint(pointA, false);
193987
194008
  if (detail) {
193988
- const fB = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.restrictToInterval(detail.fraction, fB0, fB1);
194009
+ const fB = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.restrictToInterval(detail.fraction, fB0, fB1);
193989
194010
  if (fB === detail.fraction) { // if fraction is within fB0 and fB1
193990
194011
  this.testAndRecordPointPairApproach(cpA, fA, pointA, cpB, detail.fraction, detail.point, reversed);
193991
194012
  }
@@ -194024,7 +194045,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
194024
194045
  * @param pointA1 end point of the segment
194025
194046
  * @param fractionA1 fraction of the end of the segment
194026
194047
  * @param arc the arc
194027
- * @param reversed true to have order reversed in final structures
194048
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
194028
194049
  */
194029
194050
  dispatchSegmentArc(cpA, pointA0, fractionA0, pointA1, fractionA1, arc, reversed) {
194030
194051
  // 1) intersection between arc and segment
@@ -194040,18 +194061,18 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
194040
194061
  const data = arc.toTransformedVectors();
194041
194062
  const pointA0Local = pointA0;
194042
194063
  const pointA1Local = pointA1;
194043
- const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.center, 1); // det(A0, A1, C)
194044
- const beta = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector0, 0); // det(A0, A1, U)
194045
- const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector90, 0); // det(A0, A1, V)
194046
- const cosines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_4__.GrowableFloat64Array(2);
194047
- const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_4__.GrowableFloat64Array(2);
194048
- const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_4__.GrowableFloat64Array(2);
194049
- const numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_5__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(// solve the equation
194064
+ const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.center, 1); // det(A0, A1, C)
194065
+ const beta = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector0, 0); // det(A0, A1, U)
194066
+ const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector90, 0); // det(A0, A1, V)
194067
+ const cosines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_5__.GrowableFloat64Array(2);
194068
+ const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_5__.GrowableFloat64Array(2);
194069
+ const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_5__.GrowableFloat64Array(2);
194070
+ const numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_6__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(// solve the equation
194050
194071
  alpha, beta, gamma, cosines, sines, radians);
194051
194072
  for (let i = 0; i < numRoots; i++) {
194052
194073
  const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
194053
194074
  const arcFraction = data.sweep.radiansToSignedPeriodicFraction(radians.atUncheckedIndex(i));
194054
- const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_5__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
194075
+ const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_6__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
194055
194076
  // only add if the point is within the start and end fractions of both line segment and arc
194056
194077
  if (lineFraction !== undefined && this.acceptFraction(lineFraction) && this.acceptFraction(arcFraction)) {
194057
194078
  this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
@@ -194071,7 +194092,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
194071
194092
  for (const radians1 of [parallelRadians, parallelRadians + Math.PI]) {
194072
194093
  const arcPoint = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
194073
194094
  const arcFraction = data.sweep.radiansToSignedPeriodicFraction(radians1);
194074
- const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_5__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
194095
+ const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_6__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
194075
194096
  // only add if the point is within the start and end fractions of both line segment and arc
194076
194097
  if (lineFraction !== undefined && this.acceptFraction(lineFraction) && this.acceptFraction(arcFraction)) {
194077
194098
  this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
@@ -194081,15 +194102,15 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
194081
194102
  /** Low level dispatch of circular arc with circular arc. radiusA must be larger than or equal to radiusB. */
194082
194103
  dispatchCircularCircularOrdered(cpA, radiusA, cpB, radiusB, reversed) {
194083
194104
  const c = cpA.center.distance(cpB.center);
194084
- const e = this._maxDistanceToAccept !== undefined ? this._maxDistanceToAccept : _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance;
194105
+ const e = this._maxDistanceToAccept !== undefined ? this._maxDistanceToAccept : _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance;
194085
194106
  if (c > radiusA + radiusB + e) // distance between circles is more than max distance
194086
194107
  return;
194087
194108
  // TODO: 1) intersection between arcs
194088
194109
  // 2) endpoints to endpoints
194089
194110
  this.testAndRecordFractionalPairApproach(cpA, 0, 1, false, cpB, 0, 1, false, reversed);
194090
194111
  // 3) line from one arc to another (perpendicular to arc tangents along center-center line)
194091
- if (!_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(c)) {
194092
- const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(cpA.center, cpB.center);
194112
+ if (!_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isSmallMetricDistance(c)) {
194113
+ const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(cpA.center, cpB.center);
194093
194114
  vectorAB.scaleInPlace(1.0 / c);
194094
194115
  for (const rA of [-radiusA, radiusA]) {
194095
194116
  for (const rB of [-radiusB, radiusB]) {
@@ -194114,7 +194135,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
194114
194135
  const radians = Math.atan2(s, c);
194115
194136
  const fraction = arc.sweep.radiansToPositivePeriodicFraction(radians, 0);
194116
194137
  if (fraction < 1.0)
194117
- return _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveEvaluatedFraction(arc, fraction);
194138
+ return _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveEvaluatedFraction(arc, fraction);
194118
194139
  return undefined;
194119
194140
  }
194120
194141
  /** Low level dispatch of arc with arc. Only circular arcs are supported. */
@@ -194138,34 +194159,34 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
194138
194159
  }
194139
194160
  /** Low level dispatch of arc with (beziers of) a bspline curve */
194140
194161
  dispatchArcBsplineCurve3d(cpA, cpB, reversed) {
194141
- const ls = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
194162
+ const ls = _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d.create();
194142
194163
  cpB.emitStrokes(ls);
194143
194164
  this.computeArcLineString(cpA, ls, reversed);
194144
194165
  }
194145
194166
  /** Low level dispatch of (beziers of) a bspline curve with (beziers of) a bspline curve */
194146
194167
  dispatchBSplineCurve3dBSplineCurve3d(bcurveA, bcurveB, reversed) {
194147
- const lsA = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
194168
+ const lsA = _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d.create();
194148
194169
  bcurveA.emitStrokes(lsA);
194149
- const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
194170
+ const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d.create();
194150
194171
  bcurveB.emitStrokes(lsB);
194151
194172
  this.computeLineStringLineString(lsA, lsB, reversed);
194152
194173
  }
194153
194174
  /** Low level dispatch of linestring with (beziers of) a bspline curve */
194154
194175
  dispatchLineStringBSplineCurve(lsA, curveB, reversed) {
194155
- const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
194176
+ const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d.create();
194156
194177
  curveB.emitStrokes(lsB);
194157
194178
  this.computeLineStringLineString(lsA, lsB, reversed);
194158
194179
  }
194159
194180
  /** Low level dispatch of segment with (beziers of) a bspline curve */
194160
194181
  dispatchSegmentBsplineCurve(segA, curveB, reversed) {
194161
- const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
194182
+ const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d.create();
194162
194183
  curveB.emitStrokes(lsB);
194163
194184
  this.computeSegmentLineString(segA, lsB, reversed);
194164
194185
  }
194165
194186
  /** Detail computation for segment approaching linestring. */
194166
194187
  computeSegmentLineString(segA, lsB, reversed) {
194167
194188
  const numB = lsB.numPoints();
194168
- const deltaFracB = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.safeDivideFraction(1, numB - 1, 0);
194189
+ const deltaFracB = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.safeDivideFraction(1, numB - 1, 0);
194169
194190
  const pointA0 = segA.point0Ref;
194170
194191
  const pointA1 = segA.point1Ref;
194171
194192
  const pointB0 = CurveCurveCloseApproachXY._workPointBB0;
@@ -194205,7 +194226,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
194205
194226
  /** Low level dispatch of curve collection. */
194206
194227
  dispatchCurveCollection(geomA, geomAHandler) {
194207
194228
  const geomB = this._geometryB; // save
194208
- if (!geomB || !geomB.children || !(geomB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_8__.CurveCollection))
194229
+ if (!geomB || !geomB.children || !(geomB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_9__.CurveCollection))
194209
194230
  return;
194210
194231
  for (const child of geomB.children) {
194211
194232
  this.resetGeometry(child);
@@ -194213,24 +194234,60 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
194213
194234
  }
194214
194235
  this._geometryB = geomB; // restore
194215
194236
  }
194237
+ /**
194238
+ * Given a parent chain, convert the corresponding child details so that they refer to the chain's global parameterization.
194239
+ * * It is assumed that `this._results[i].detailA.curve` is a child of chainA, and similarly for detailB/chainB.
194240
+ * @param chainA convert each detailA to the global parameterization of chainA
194241
+ * @param chainB convert each detailB to the global parameterization of chainB
194242
+ */
194243
+ convertChildDetailToChainDetail(chainA, chainB) {
194244
+ for (const childDetailPair of this._results) {
194245
+ if (chainA) {
194246
+ const chainDetail = chainA.computeChainDetail(childDetailPair.detailA);
194247
+ if (chainDetail)
194248
+ childDetailPair.detailA = chainDetail;
194249
+ }
194250
+ if (chainB) {
194251
+ const chainDetail = chainB.computeChainDetail(childDetailPair.detailB);
194252
+ if (chainDetail)
194253
+ childDetailPair.detailB = chainDetail;
194254
+ }
194255
+ }
194256
+ }
194257
+ /** Low level dispatch to geomA given a CurveChainWithDistanceIndex in geometryB. */
194258
+ dispatchCurveChainWithDistanceIndex(geomA, geomAHandler) {
194259
+ if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex))
194260
+ return;
194261
+ const geomB = this._geometryB; // save
194262
+ for (const child of geomB.path.children) {
194263
+ this.resetGeometry(child);
194264
+ geomAHandler(geomA);
194265
+ }
194266
+ this.resetGeometry(geomB); // restore
194267
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!(geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex));
194268
+ this.convertChildDetailToChainDetail(undefined, geomB);
194269
+ }
194216
194270
  /** Double dispatch handler for strongly typed segment. */
194217
194271
  handleLineSegment3d(segmentA) {
194218
- if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_9__.LineSegment3d) {
194272
+ if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d) {
194219
194273
  const segmentB = this._geometryB;
194220
194274
  this.dispatchSegmentSegment(segmentA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, segmentB, segmentB.point0Ref, 0.0, segmentB.point1Ref, 1.0, false);
194221
194275
  }
194222
- else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
194276
+ else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d) {
194223
194277
  this.computeSegmentLineString(segmentA, this._geometryB, false);
194224
194278
  }
194225
- else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_1__.Arc3d) {
194279
+ else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
194226
194280
  this.dispatchSegmentArc(segmentA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._geometryB, false);
194227
194281
  }
194228
- else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_10__.BSplineCurve3d) {
194282
+ else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__.BSplineCurve3d) {
194229
194283
  this.dispatchSegmentBsplineCurve(segmentA, this._geometryB, false);
194230
194284
  }
194231
- else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_8__.CurveCollection) {
194285
+ else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_9__.CurveCollection) {
194232
194286
  this.dispatchCurveCollection(segmentA, this.handleLineSegment3d.bind(this));
194233
194287
  }
194288
+ else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex) {
194289
+ this.dispatchCurveChainWithDistanceIndex(segmentA, this.handleLineSegment3d.bind(this));
194290
+ }
194234
194291
  return undefined;
194235
194292
  }
194236
194293
  /**
@@ -194271,7 +194328,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
194271
194328
  return;
194272
194329
  let bitB0;
194273
194330
  let bitB1;
194274
- const rangeA1 = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_11__.Range3d.createNull();
194331
+ const rangeA1 = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_13__.Range3d.createNull();
194275
194332
  const pointA0 = CurveCurveCloseApproachXY._workPointAA0;
194276
194333
  const pointA1 = CurveCurveCloseApproachXY._workPointAA1;
194277
194334
  const pointB0 = CurveCurveCloseApproachXY._workPointBB0;
@@ -194311,62 +194368,76 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
194311
194368
  }
194312
194369
  /** Double dispatch handler for strongly typed linestring. */
194313
194370
  handleLineString3d(lsA) {
194314
- if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
194371
+ if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d) {
194315
194372
  const lsB = this._geometryB;
194316
194373
  this.computeLineStringLineString(lsA, lsB, false);
194317
194374
  }
194318
- else if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_9__.LineSegment3d) {
194375
+ else if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d) {
194319
194376
  this.computeSegmentLineString(this._geometryB, lsA, true);
194320
194377
  }
194321
- else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_1__.Arc3d) {
194378
+ else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
194322
194379
  this.computeArcLineString(this._geometryB, lsA, true);
194323
194380
  }
194324
- else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_10__.BSplineCurve3d) {
194381
+ else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__.BSplineCurve3d) {
194325
194382
  this.dispatchLineStringBSplineCurve(lsA, this._geometryB, false);
194326
194383
  }
194327
- else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_8__.CurveCollection) {
194384
+ else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_9__.CurveCollection) {
194328
194385
  this.dispatchCurveCollection(lsA, this.handleLineString3d.bind(this));
194329
194386
  }
194387
+ else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex) {
194388
+ this.dispatchCurveChainWithDistanceIndex(lsA, this.handleLineString3d.bind(this));
194389
+ }
194330
194390
  return undefined;
194331
194391
  }
194332
194392
  /** Double dispatch handler for strongly typed arc. */
194333
194393
  handleArc3d(arc0) {
194334
- if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_9__.LineSegment3d) {
194394
+ if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d) {
194335
194395
  this.dispatchSegmentArc(this._geometryB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, arc0, true);
194336
194396
  }
194337
- else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
194397
+ else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d) {
194338
194398
  this.computeArcLineString(arc0, this._geometryB, false);
194339
194399
  }
194340
- else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_1__.Arc3d) {
194400
+ else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
194341
194401
  this.dispatchArcArc(arc0, this._geometryB, false);
194342
194402
  }
194343
- else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_10__.BSplineCurve3d) {
194403
+ else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__.BSplineCurve3d) {
194344
194404
  this.dispatchArcBsplineCurve3d(arc0, this._geometryB, false);
194345
194405
  }
194346
- else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_8__.CurveCollection) {
194406
+ else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_9__.CurveCollection) {
194347
194407
  this.dispatchCurveCollection(arc0, this.handleArc3d.bind(this));
194348
194408
  }
194409
+ else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex) {
194410
+ this.dispatchCurveChainWithDistanceIndex(arc0, this.handleArc3d.bind(this));
194411
+ }
194349
194412
  return undefined;
194350
194413
  }
194351
194414
  /** Double dispatch handler for strongly typed bspline curve. */
194352
194415
  handleBSplineCurve3d(curve) {
194353
- if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_9__.LineSegment3d) {
194416
+ if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d) {
194354
194417
  this.dispatchSegmentBsplineCurve(this._geometryB, curve, true);
194355
194418
  }
194356
- else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
194419
+ else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d) {
194357
194420
  this.dispatchLineStringBSplineCurve(this._geometryB, curve, true);
194358
194421
  }
194359
- else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_1__.Arc3d) {
194422
+ else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
194360
194423
  this.dispatchArcBsplineCurve3d(this._geometryB, curve, true);
194361
194424
  }
194362
- else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_10__.BSplineCurve3dBase) {
194425
+ else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__.BSplineCurve3dBase) {
194363
194426
  this.dispatchBSplineCurve3dBSplineCurve3d(curve, this._geometryB, false);
194364
194427
  }
194365
- else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_8__.CurveCollection) {
194428
+ else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_9__.CurveCollection) {
194366
194429
  this.dispatchCurveCollection(curve, this.handleBSplineCurve3d.bind(this));
194367
194430
  }
194431
+ else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex) {
194432
+ this.dispatchCurveChainWithDistanceIndex(curve, this.handleBSplineCurve3d.bind(this));
194433
+ }
194368
194434
  return undefined;
194369
194435
  }
194436
+ /** Double dispatch handler for strongly typed CurveChainWithDistanceIndex. */
194437
+ handleCurveChainWithDistanceIndex(chain) {
194438
+ super.handleCurveChainWithDistanceIndex(chain);
194439
+ this.convertChildDetailToChainDetail(chain, this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex ? this._geometryB : undefined);
194440
+ }
194370
194441
  /** Double dispatch handler for strongly typed homogeneous bspline curve .. */
194371
194442
  handleBSplineCurve3dH(_curve) {
194372
194443
  /*
@@ -194385,11 +194456,11 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
194385
194456
  return undefined;
194386
194457
  }
194387
194458
  }
194388
- CurveCurveCloseApproachXY._workPointAA0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
194389
- CurveCurveCloseApproachXY._workPointAA1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
194390
- CurveCurveCloseApproachXY._workPointBB0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
194391
- CurveCurveCloseApproachXY._workPointBB1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
194392
- CurveCurveCloseApproachXY._workPointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
194459
+ CurveCurveCloseApproachXY._workPointAA0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
194460
+ CurveCurveCloseApproachXY._workPointAA1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
194461
+ CurveCurveCloseApproachXY._workPointBB0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
194462
+ CurveCurveCloseApproachXY._workPointBB1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
194463
+ CurveCurveCloseApproachXY._workPointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
194393
194464
 
194394
194465
 
194395
194466
 
@@ -196045,11 +196116,11 @@ __webpack_require__.r(__webpack_exports__);
196045
196116
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
196046
196117
  /* harmony export */ CurveOffsetXYHandler: () => (/* binding */ CurveOffsetXYHandler)
196047
196118
  /* harmony export */ });
196119
+ /* harmony import */ var _bspline_BSplineCurveOps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../bspline/BSplineCurveOps */ "../../core/geometry/lib/esm/bspline/BSplineCurveOps.js");
196120
+ /* harmony import */ var _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../bspline/InterpolationCurve3d */ "../../core/geometry/lib/esm/bspline/InterpolationCurve3d.js");
196048
196121
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
196049
196122
  /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
196050
196123
  /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
196051
- /* harmony import */ var _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../bspline/InterpolationCurve3d */ "../../core/geometry/lib/esm/bspline/InterpolationCurve3d.js");
196052
- /* harmony import */ var _bspline_BSplineCurveOps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../bspline/BSplineCurveOps */ "../../core/geometry/lib/esm/bspline/BSplineCurveOps.js");
196053
196124
  /*---------------------------------------------------------------------------------------------
196054
196125
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
196055
196126
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -196087,13 +196158,16 @@ class CurveOffsetXYHandler {
196087
196158
  if (!_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isSmallMetricDistance(tangent.x) || !_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isSmallMetricDistance(tangent.y))
196088
196159
  this._fitOptions.fitPoints.push(xyz.plusScaled(tangent.unitPerpendicularXY(this._v0), this._offsetDistance));
196089
196160
  }
196090
- needPrimaryGeometryForStrokes() { return true; }
196161
+ needPrimaryGeometryForStrokes() {
196162
+ return true;
196163
+ }
196091
196164
  startParentCurvePrimitive(_cp) { }
196092
196165
  startCurvePrimitive(_cp) { }
196093
196166
  endCurvePrimitive(_cp) { }
196094
196167
  endParentCurvePrimitive(_cp) { }
196095
196168
  announceIntervalForUniformStepStrokes(cp, numStrokes, fraction0, fraction1) {
196096
- for (let i = 0; i <= numStrokes; ++i) { // announce both start and end; adjacent duplicates will be filtered by c2 cubic fit logic
196169
+ // announce both start and end; adjacent duplicates will be filtered by c2 cubic fit logic
196170
+ for (let i = 0; i <= numStrokes; ++i) {
196097
196171
  const fraction = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fraction0, i / numStrokes, fraction1);
196098
196172
  const ray = cp.fractionToPointAndDerivative(fraction, this._r0);
196099
196173
  this.pushOffsetPoint(ray.origin, ray.direction);
@@ -196102,7 +196176,8 @@ class CurveOffsetXYHandler {
196102
196176
  announceSegmentInterval(_cp, point0, point1, numStrokes, _fraction0, _fraction1) {
196103
196177
  if (numStrokes > 0) {
196104
196178
  const tangent = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.createStartEnd(point0, point1, this._v1);
196105
- for (let i = 0; i <= numStrokes; ++i) { // announce both start and end; adjacent duplicates will be filtered by c2 cubic fit logic
196179
+ // announce both start and end; adjacent duplicates will be filtered by c2 cubic fit logic
196180
+ for (let i = 0; i <= numStrokes; ++i) {
196106
196181
  this.pushOffsetPoint(point0.interpolate(i / numStrokes, point1, this._p0), tangent);
196107
196182
  }
196108
196183
  }
@@ -203747,10 +203822,14 @@ __webpack_require__.r(__webpack_exports__);
203747
203822
  /* harmony export */ NullGeometryHandler: () => (/* binding */ NullGeometryHandler),
203748
203823
  /* harmony export */ RecurseToCurvesGeometryHandler: () => (/* binding */ RecurseToCurvesGeometryHandler)
203749
203824
  /* harmony export */ });
203825
+ /* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
203826
+ /* harmony import */ var _curve_Path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../curve/Path */ "../../core/geometry/lib/esm/curve/Path.js");
203750
203827
  /*---------------------------------------------------------------------------------------------
203751
203828
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
203752
203829
  * See LICENSE.md in the project root for license terms and full copyright notice.
203753
203830
  *--------------------------------------------------------------------------------------------*/
203831
+
203832
+
203754
203833
  /**
203755
203834
  * `GeometryHandler` defines the base abstract methods for double-dispatch geometry computation.
203756
203835
  * * User code that wants to handle one or all of the commonly known geometry types implements a handler class.
@@ -203761,26 +203840,34 @@ __webpack_require__.r(__webpack_exports__);
203761
203840
  class GeometryHandler {
203762
203841
  /** Handle strongly typed [[CurveCollection]] */
203763
203842
  handleCurveCollection(_g) { }
203764
- /** Handle strongly typed Path (base class method calls handleCurveCollection) */
203843
+ /** Handle strongly typed [[Path]] (base class method calls [[handleCurveCollection]]) */
203765
203844
  handlePath(g) {
203766
203845
  return this.handleCurveCollection(g);
203767
203846
  }
203768
- /** Handle strongly typed Loop (base class method calls handleCurveCollection) */
203847
+ /** Handle strongly typed [[Loop]] (base class method calls [[handleCurveCollection]]) */
203769
203848
  handleLoop(g) {
203770
203849
  return this.handleCurveCollection(g);
203771
203850
  }
203772
- /** Handle strongly typed ParityRegion (base class method calls handleCurveCollection) */
203851
+ /** Handle strongly typed [[ParityRegion]] (base class method calls [[handleCurveCollection]]) */
203773
203852
  handleParityRegion(g) {
203774
203853
  return this.handleCurveCollection(g);
203775
203854
  }
203776
- /** Handle strongly typed UnionRegion (base class method calls handleCurveCollection) */
203855
+ /** Handle strongly typed [[UnionRegion]] (base class method calls [[handleCurveCollection]]) */
203777
203856
  handleUnionRegion(g) {
203778
203857
  return this.handleCurveCollection(g);
203779
203858
  }
203780
- /** Handle strongly typed BagOfCurves (base class method calls handleCurveCollection) */
203859
+ /** Handle strongly typed [[BagOfCurves]] (base class method calls [[handleCurveCollection]]) */
203781
203860
  handleBagOfCurves(g) {
203782
203861
  return this.handleCurveCollection(g);
203783
203862
  }
203863
+ /** Handle strongly typed [[CurveChainWithDistanceIndex]] (base class method calls [[handlePath]] or [[handleLoop]]) */
203864
+ handleCurveChainWithDistanceIndex(g) {
203865
+ if (g.path instanceof _curve_Path__WEBPACK_IMPORTED_MODULE_0__.Path)
203866
+ return this.handlePath(g.path);
203867
+ if (g.path instanceof _curve_Loop__WEBPACK_IMPORTED_MODULE_1__.Loop)
203868
+ return this.handleLoop(g.path);
203869
+ return this.handleCurveCollection(g.path);
203870
+ }
203784
203871
  }
203785
203872
  /**
203786
203873
  * `NullGeometryHandler` is a base class for dispatching various geometry types to application specific implementation
@@ -203812,6 +203899,10 @@ class NullGeometryHandler extends GeometryHandler {
203812
203899
  return undefined;
203813
203900
  }
203814
203901
  /** No-action implementation */
203902
+ handleCurveChainWithDistanceIndex(_g) {
203903
+ return undefined;
203904
+ }
203905
+ /** No-action implementation */
203815
203906
  handleBSplineCurve3d(_g) {
203816
203907
  return undefined;
203817
203908
  }
@@ -203909,7 +204000,8 @@ class NullGeometryHandler extends GeometryHandler {
203909
204000
  }
203910
204001
  }
203911
204002
  /**
203912
- * Implement GeometryHandler methods, with all curve collection methods recursing to children.
204003
+ * Implement GeometryHandler methods, but override `handleCurveCollection` so that all methods
204004
+ * that operate on a [[CurveCollection]] recurse to their children.
203913
204005
  * @public
203914
204006
  */
203915
204007
  class RecurseToCurvesGeometryHandler extends GeometryHandler {
@@ -203973,26 +204065,6 @@ class RecurseToCurvesGeometryHandler extends GeometryHandler {
203973
204065
  handleCurveCollection(g) {
203974
204066
  return this.handleChildren(g);
203975
204067
  }
203976
- /** Recurse to children */
203977
- handlePath(g) {
203978
- return this.handleChildren(g);
203979
- }
203980
- /** Recurse to children */
203981
- handleLoop(g) {
203982
- return this.handleChildren(g);
203983
- }
203984
- /** Recurse to children */
203985
- handleParityRegion(g) {
203986
- return this.handleChildren(g);
203987
- }
203988
- /** Recurse to children */
203989
- handleUnionRegion(g) {
203990
- return this.handleChildren(g);
203991
- }
203992
- /** Recurse to children */
203993
- handleBagOfCurves(g) {
203994
- return this.handleChildren(g);
203995
- }
203996
204068
  /** No-action implementation */
203997
204069
  handleSphere(_g) {
203998
204070
  return undefined;
@@ -246797,7 +246869,13 @@ class Sample {
246797
246869
  * * direct spiral (half-cosine)
246798
246870
  */
246799
246871
  static createCurveChainWithDistanceIndex() {
246800
- const pointsA = [_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 3, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(2, 4, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(3, 3, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(4, 0, 0)];
246872
+ const pointsA = [
246873
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0),
246874
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 3, 0),
246875
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(2, 4, 0),
246876
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(3, 3, 0),
246877
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(4, 0, 0),
246878
+ ];
246801
246879
  const result = [];
246802
246880
  // one singleton per basic curve type ...
246803
246881
  result.push(_curve_CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_45__.CurveChainWithDistanceIndex.createCapture(_curve_Path__WEBPACK_IMPORTED_MODULE_22__.Path.create(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_20__.LineSegment3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(5, 0, 0)))));
@@ -287946,7 +288024,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
287946
288024
  /***/ ((module) => {
287947
288025
 
287948
288026
  "use strict";
287949
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.2.0-dev.31","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 --includes=../../generated-docs/extract --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 -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","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:^4.2.0-dev.31","@itwin/core-bentley":"workspace:^4.2.0-dev.31","@itwin/core-common":"workspace:^4.2.0-dev.31","@itwin/core-geometry":"workspace:^4.2.0-dev.31","@itwin/core-orbitgt":"workspace:^4.2.0-dev.31","@itwin/core-quantity":"workspace:^4.2.0-dev.31"},"//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/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"18.16.1","@types/sinon":"^10.0.15","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^15.0.4","source-map-loader":"^4.0.0","typescript":"~5.0.2","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.1.0","@itwin/object-storage-core":"^2.1.0","@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","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
288027
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.2.0-dev.32","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 --includes=../../generated-docs/extract --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 -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","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:^4.2.0-dev.32","@itwin/core-bentley":"workspace:^4.2.0-dev.32","@itwin/core-common":"workspace:^4.2.0-dev.32","@itwin/core-geometry":"workspace:^4.2.0-dev.32","@itwin/core-orbitgt":"workspace:^4.2.0-dev.32","@itwin/core-quantity":"workspace:^4.2.0-dev.32"},"//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/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"18.16.1","@types/sinon":"^10.0.15","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^15.0.4","source-map-loader":"^4.0.0","typescript":"~5.0.2","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.1.0","@itwin/object-storage-core":"^2.1.0","@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","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
287950
288028
 
287951
288029
  /***/ })
287952
288030