@itwin/rpcinterface-full-stack-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.
@@ -173063,8 +173063,8 @@ class Geometry {
173063
173063
  return result;
173064
173064
  }
173065
173065
  /**
173066
- * For a line `f(x)` where `f(x0) = f0` and `f(x1) = f1`, return the `x` value at which `f(x) = fTarget`
173067
- * Return `defaultResult` if `(fTarget - f0) / (f1 - f0)` exceeds `Geometry.largeFractionResult`
173066
+ * For a line `f(x)` where `f(x0) = f0` and `f(x1) = f1`, return the `x` value at which `f(x) = fTarget`.
173067
+ * Return `defaultResult` if `(fTarget - f0) / (f1 - f0)` exceeds `Geometry.largeFractionResult`.
173068
173068
  */
173069
173069
  static inverseInterpolate(x0, f0, x1, f1, fTarget = 0, defaultResult) {
173070
173070
  /**
@@ -185737,17 +185737,18 @@ __webpack_require__.r(__webpack_exports__);
185737
185737
  /* harmony export */ CurveChainWithDistanceIndex: () => (/* binding */ CurveChainWithDistanceIndex),
185738
185738
  /* harmony export */ PathFragment: () => (/* binding */ PathFragment)
185739
185739
  /* harmony export */ });
185740
- /* harmony import */ var _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../curve/CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
185741
- /* harmony import */ var _curve_Query_StrokeCountMap__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../curve/Query/StrokeCountMap */ "../../core/geometry/lib/esm/curve/Query/StrokeCountMap.js");
185742
- /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
185743
- /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
185744
- /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
185745
- /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
185746
- /* harmony import */ var _CurveExtendMode__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./CurveExtendMode */ "../../core/geometry/lib/esm/curve/CurveExtendMode.js");
185747
- /* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
185748
- /* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
185749
- /* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
185750
- /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
185740
+ /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
185741
+ /* harmony import */ var _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../curve/CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
185742
+ /* harmony import */ var _curve_Query_StrokeCountMap__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../curve/Query/StrokeCountMap */ "../../core/geometry/lib/esm/curve/Query/StrokeCountMap.js");
185743
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
185744
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
185745
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
185746
+ /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
185747
+ /* harmony import */ var _CurveExtendMode__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./CurveExtendMode */ "../../core/geometry/lib/esm/curve/CurveExtendMode.js");
185748
+ /* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
185749
+ /* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
185750
+ /* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
185751
+ /* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
185751
185752
  /*---------------------------------------------------------------------------------------------
185752
185753
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
185753
185754
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -185766,15 +185767,16 @@ __webpack_require__.r(__webpack_exports__);
185766
185767
 
185767
185768
 
185768
185769
 
185770
+
185769
185771
  /**
185770
- * Annotation of an interval of a curve.
185772
+ * Annotation of a fragment, i.e. an interval of a curve.
185771
185773
  * * The interval is marked with two pairs of numbers:
185772
- * * * fraction0, fraction1 = fraction parameters along the child curve
185773
- * * * distance0,distance1 = distances within containing CurveChainWithDistanceIndex
185774
+ * * * fraction0, fraction1 = fraction parameters along the child curve.
185775
+ * * * distance0, distance1 = distances within containing CurveChainWithDistanceIndex.
185774
185776
  * @public
185775
185777
  */
185776
185778
  class PathFragment {
185777
- /** Create a fragment with complete fraction, distance and child data. */
185779
+ /** Create a fragment with complete fraction, distance, and child data. */
185778
185780
  constructor(childFraction0, childFraction1, distance0, distance1, childCurve, range) {
185779
185781
  this.childFraction0 = childFraction0;
185780
185782
  this.childFraction1 = childFraction1;
@@ -185784,68 +185786,64 @@ class PathFragment {
185784
185786
  this.range = range;
185785
185787
  this.a = 0;
185786
185788
  }
185787
- /**
185788
- * Return true if the distance is within the distance limits of this fragment.
185789
- * @param distance
185790
- */
185789
+ /** Return true if the distance is within the distance limits of this fragment. */
185791
185790
  containsChainDistance(distance) {
185792
185791
  return distance >= this.chainDistance0 && distance <= this.chainDistance1;
185793
185792
  }
185794
- /** Return a quick distance to the curve. This may be SMALLER than true distance but may not be larger */
185793
+ /**
185794
+ * Return a quick minimum distance from spacePoint to the curve.
185795
+ * * The returned distance is to the curve's range box if defined; otherwise, the true distance is computed.
185796
+ * * Thus the returned distance may be SMALLER than the true distance to the curve, but not larger.
185797
+ */
185795
185798
  quickMinDistanceToChildCurve(spacePoint) {
185796
- if (this.range) {
185799
+ if (this.range)
185797
185800
  return this.range.distanceToPoint(spacePoint);
185798
- }
185799
- // ugh. have to do real computation ..
185800
185801
  const detail = this.childCurve.closestPoint(spacePoint, false);
185801
185802
  if (detail)
185802
185803
  return detail.a;
185803
185804
  return 0;
185804
185805
  }
185805
185806
  /**
185806
- * Return an array with (references to) all the path fragments, sorted smallest to largest on the "a" value
185807
- * equal to the quick min distance to the fragment
185807
+ * Return an array with (references to) all the input path fragments, sorted smallest to largest on the "a" value,
185808
+ * initialized with `quickMinDistanceToChildCurve`
185808
185809
  */
185809
185810
  static collectSortedQuickMinDistances(fragments, spacePoint) {
185810
185811
  const sortedFragments = [];
185811
- for (const f of fragments) {
185812
- f.a = f.quickMinDistanceToChildCurve(spacePoint);
185813
- sortedFragments.push(f);
185812
+ for (const frag of fragments) {
185813
+ frag.a = frag.quickMinDistanceToChildCurve(spacePoint);
185814
+ sortedFragments.push(frag);
185814
185815
  }
185815
- sortedFragments.sort((a, b) => a.a - b.a);
185816
+ sortedFragments.sort((frag1, frag2) => frag1.a - frag2.a);
185816
185817
  return sortedFragments;
185817
185818
  }
185818
- /**
185819
- * Return true if this fragment addresses `curve` and brackets `fraction`
185820
- * @param distance
185821
- */
185819
+ /** Return true if `this` fragment addresses `curve` and brackets `fraction`. */
185822
185820
  containsChildCurveAndChildFraction(curve, fraction) {
185823
185821
  return this.childCurve === curve && fraction >= this.childFraction0 && fraction <= this.childFraction1;
185824
185822
  }
185825
185823
  /**
185826
- * Convert distance to local fraction, and apply that to interpolate between the stored curve fractions.
185827
- * Note that proportional calculation does NOT account for nonuniform parameterization in the child curve.
185824
+ * Convert distance to local fraction and apply that to interpolate between the stored curve fractions.
185825
+ * Note that proportional calculation does NOT account for non-uniform parameterization in the child curve.
185828
185826
  */
185829
185827
  chainDistanceToInterpolatedChildFraction(distance) {
185830
- 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 . ..
185828
+ 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
185831
185829
  }
185832
- /** Convert chainDistance to true chidFraction, using detailed moveSignedDistanceFromFraction */
185830
+ /** Convert the given chainDistance to a fraction along this childCurve using `moveSignedDistanceFromFraction`. */
185833
185831
  chainDistanceToAccurateChildFraction(chainDistance, allowExtrapolation) {
185834
- // The fragments are really expected to do good mappings in their distance range ...
185835
185832
  const childDetail = this.childCurve.moveSignedDistanceFromFraction(this.childFraction0, chainDistance - this.chainDistance0, allowExtrapolation ?? false);
185836
185833
  return childDetail.fraction;
185837
185834
  }
185838
185835
  /**
185839
- * Return the scale factor to map childCurve fraction derivatives to chain fraction derivatives
185840
- * @param globalDistance total length of the global curve.
185836
+ * Return the scale factor to map childCurve fraction derivatives to chain fraction derivatives.
185837
+ * @param globalDistance total length of the global curve
185841
185838
  */
185842
185839
  fractionScaleFactor(globalDistance) {
185843
185840
  return globalDistance * (this.childFraction1 - this.childFraction0) / (this.chainDistance1 - this.chainDistance0);
185844
185841
  }
185845
185842
  /**
185846
185843
  * Reverse the fraction and distance data.
185847
- * * each child fraction `f` is replaced by `1-f`
185848
- * * each `chainDistance` is replaced by `totalDistance-chainDistance`
185844
+ * * Each child fraction `f` is replaced by `1-f`
185845
+ * * Each `chainDistance` is replaced by `totalDistance - chainDistance`
185846
+ * @param totalDistance the total distance
185849
185847
  */
185850
185848
  reverseFractionsAndDistances(totalDistance) {
185851
185849
  const f0 = this.childFraction0;
@@ -185857,14 +185855,14 @@ class PathFragment {
185857
185855
  this.chainDistance0 = totalDistance - d1;
185858
185856
  this.chainDistance1 = totalDistance - d0;
185859
185857
  }
185860
- /** @deprecated in 3.x. Use childFractionToChainDistance */
185858
+ /** @deprecated in 3.x. Use `PathFragment.childFractionToChainDistance`. */
185861
185859
  childFractionTChainDistance(fraction) {
185862
185860
  return this.childFractionToChainDistance(fraction);
185863
185861
  }
185864
185862
  /**
185865
- * Convert a fractional position on the childCurve to distance in the chain space.
185866
- * * Return value is SIGNED -- will be negative when fraction < this.childFraction0.
185867
- * @param fraction fraction along the curve within this fragment
185863
+ * Convert a fractional position on the childCurve of this fragment to distance on the curve chain.
185864
+ * * Return value is SIGNED and will be negative when `fraction < this.childFraction0`.
185865
+ * @param fraction the fractional position on the childCurve of this fragment
185868
185866
  */
185869
185867
  childFractionToChainDistance(fraction) {
185870
185868
  let d = this.childCurve.curveLengthBetweenFractions(this.childFraction0, fraction);
@@ -185873,7 +185871,7 @@ class PathFragment {
185873
185871
  return this.chainDistance0 + d;
185874
185872
  }
185875
185873
  }
185876
- /** Non-instantiable class to build a distance index for a path. */
185874
+ /** Non-instantiable class to build a distance index for a curve chain. */
185877
185875
  class DistanceIndexConstructionContext {
185878
185876
  constructor() {
185879
185877
  this._accumulatedDistance = 0;
@@ -185885,23 +185883,22 @@ class DistanceIndexConstructionContext {
185885
185883
  endParentCurvePrimitive(_cp) { }
185886
185884
  endCurvePrimitive(_cp) { }
185887
185885
  announcePointTangent(_xyz, _fraction, _tangent) { }
185888
- /** Announce numPoints interpolated between point0 and point1, with associated fractions */
185889
185886
  announceSegmentInterval(cp, point0, point1, numStrokes, fraction0, fraction1) {
185890
185887
  const fragmentPoint0 = point0.clone();
185891
185888
  const fragmentPoint1 = point1.clone();
185892
185889
  let d0 = this._accumulatedDistance;
185893
185890
  if (numStrokes <= 1) {
185894
185891
  this._accumulatedDistance += point0.distance(point1);
185895
- this._fragments.push(new PathFragment(fraction0, fraction1, d0, this._accumulatedDistance, cp, _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__.Range3d.create(fragmentPoint0, fragmentPoint1)));
185892
+ this._fragments.push(new PathFragment(fraction0, fraction1, d0, this._accumulatedDistance, cp, _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__.Range3d.create(fragmentPoint0, fragmentPoint1)));
185896
185893
  }
185897
185894
  else {
185898
185895
  let f1;
185899
185896
  for (let i = 1, f0 = fraction0; i <= numStrokes; i++, f0 = f1) {
185900
- f1 = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.interpolate(fraction0, i / numStrokes, fraction1);
185897
+ f1 = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(fraction0, i / numStrokes, fraction1);
185901
185898
  point0.interpolate(f1, point1, fragmentPoint1);
185902
185899
  d0 = this._accumulatedDistance;
185903
185900
  this._accumulatedDistance += (Math.abs(f1 - f0) * point0.distance(point1));
185904
- this._fragments.push(new PathFragment(f0, f1, d0, this._accumulatedDistance, cp, _geometry3d_Range__WEBPACK_IMPORTED_MODULE_1__.Range3d.create(fragmentPoint0, fragmentPoint1)));
185901
+ this._fragments.push(new PathFragment(f0, f1, d0, this._accumulatedDistance, cp, _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__.Range3d.create(fragmentPoint0, fragmentPoint1)));
185905
185902
  fragmentPoint0.setFrom(fragmentPoint1);
185906
185903
  }
185907
185904
  }
@@ -185909,7 +185906,7 @@ class DistanceIndexConstructionContext {
185909
185906
  announceIntervalForUniformStepStrokes(cp, numStrokes, fraction0, fraction1) {
185910
185907
  let f1, d, d0;
185911
185908
  for (let i = 1, f0 = fraction0; i <= numStrokes; i++, f0 = f1) {
185912
- f1 = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.interpolate(fraction0, i / numStrokes, fraction1);
185909
+ f1 = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(fraction0, i / numStrokes, fraction1);
185913
185910
  d = cp.curveLengthBetweenFractions(f0, f1);
185914
185911
  d0 = this._accumulatedDistance;
185915
185912
  this._accumulatedDistance += d;
@@ -185917,7 +185914,10 @@ class DistanceIndexConstructionContext {
185917
185914
  this._fragments.push(new PathFragment(f0, f1, d0, this._accumulatedDistance, cp, range));
185918
185915
  }
185919
185916
  }
185920
- needPrimaryGeometryForStrokes() { return true; }
185917
+ needPrimaryGeometryForStrokes() {
185918
+ return true;
185919
+ }
185920
+ /** Create an array of PathFragment from input curve chain. */
185921
185921
  static createPathFragmentIndex(path, options) {
185922
185922
  const handler = new DistanceIndexConstructionContext();
185923
185923
  for (const curve of path.children) {
@@ -185932,12 +185932,11 @@ class DistanceIndexConstructionContext {
185932
185932
  * distance along a CurveChain.
185933
185933
  * * For example if the total length of the chain is `L`, then the distance along the chain from parameters `t0`
185934
185934
  * to `t1` is easily computed as `L*(t1-t0)`.
185935
- * * The curve chain can be any type derived from CurveChain.
185936
- * * * i.e. either a `Path` or a `Loop`
185935
+ * * The curve chain can be any type derived from `CurveChain`, i.e., either a `Path` or a `Loop`.
185937
185936
  * @public
185938
185937
  */
185939
- class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__.CurvePrimitive {
185940
- /** Test if other is a `CurveChainWithDistanceIndex` */
185938
+ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_3__.CurvePrimitive {
185939
+ /** Test if `other` is a `CurveChainWithDistanceIndex` */
185941
185940
  isSameGeometryClass(other) {
185942
185941
  return other instanceof CurveChainWithDistanceIndex;
185943
185942
  }
@@ -185956,13 +185955,13 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
185956
185955
  */
185957
185956
  cloneTransformed(transform) {
185958
185957
  const c = this._path.clone();
185959
- if (c instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_3__.CurveChain && c.tryTransformInPlace(transform))
185958
+ if (c instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_4__.CurveChain && c.tryTransformInPlace(transform))
185960
185959
  return CurveChainWithDistanceIndex.createCapture(c);
185961
185960
  return undefined;
185962
185961
  }
185963
185962
  /**
185964
185963
  * Reference to the contained path.
185965
- * * Do not modify the path. The distance index will be wrong.
185964
+ * * Do not modify the path. The distance index will be wrong.
185966
185965
  */
185967
185966
  get path() {
185968
185967
  return this._path;
@@ -186007,7 +186006,7 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
186007
186006
  const childFractionA = fragmentA.chainDistanceToAccurateChildFraction(chainDistanceA, true);
186008
186007
  const childFractionB = fragmentB.chainDistanceToAccurateChildFraction(chainDistanceB, true);
186009
186008
  // add a (possibly reversed) partial clone to newPath
186010
- const newPath = _Path__WEBPACK_IMPORTED_MODULE_4__.Path.create();
186009
+ const newPath = _Path__WEBPACK_IMPORTED_MODULE_5__.Path.create();
186011
186010
  const addPartialChild = (childCurve, childFraction0, childFraction1, reversedClone) => {
186012
186011
  if (childFraction0 === childFraction1)
186013
186012
  return false;
@@ -186056,19 +186055,19 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
186056
186055
  }
186057
186056
  return true;
186058
186057
  }
186059
- /** Return the start point of the primitive. The default implementation returns fractionToPoint (0.0) */
186058
+ /** Return the start point of `this` curve. */
186060
186059
  startPoint(result) {
186061
186060
  const c = this._path.cyclicCurvePrimitive(0);
186062
186061
  if (c)
186063
186062
  return c.startPoint(result);
186064
- return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.createZero(result);
186063
+ return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.createZero(result);
186065
186064
  }
186066
- /** Return the end point of the primitive. The default implementation returns fractionToPoint(1.0) */
186065
+ /** Return the end point of of `this` curve. */
186067
186066
  endPoint(result) {
186068
186067
  const c = this._path.cyclicCurvePrimitive(-1);
186069
186068
  if (c)
186070
186069
  return c.endPoint(result);
186071
- return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.createZero(result);
186070
+ return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.createZero(result);
186072
186071
  }
186073
186072
  /** Add strokes to caller-supplied linestring */
186074
186073
  emitStrokes(dest, options) {
@@ -186099,7 +186098,7 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
186099
186098
  /**
186100
186099
  * Return an array containing only the curve primitives.
186101
186100
  * @param collectorArray array to receive primitives (pushed -- the array is not cleared)
186102
- * @param smallestPossiblePrimitives if true, recurse on the (otherwise hidden) children. If false, only push `this`.
186101
+ * @param smallestPossiblePrimitives if true, recurse on the children. If false, only push `this`.
186103
186102
  * @param explodeLinestrings (if smallestPossiblePrimitives is true) whether to push a [[LineSegment3d]] for each
186104
186103
  * segment of a [[LineString3d]] child. If false, push only the [[LineString3d]].
186105
186104
  */
@@ -186119,28 +186118,24 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
186119
186118
  * @param parentStrokeMap evolving parent map.
186120
186119
  */
186121
186120
  computeAndAttachRecursiveStrokeCounts(options, parentStrokeMap) {
186122
- const myMap = _curve_Query_StrokeCountMap__WEBPACK_IMPORTED_MODULE_6__.StrokeCountMap.createWithCurvePrimitiveAndOptionalParent(this, parentStrokeMap);
186121
+ const myMap = _curve_Query_StrokeCountMap__WEBPACK_IMPORTED_MODULE_7__.StrokeCountMap.createWithCurvePrimitiveAndOptionalParent(this, parentStrokeMap);
186123
186122
  for (const c of this._path.children) {
186124
186123
  c.computeAndAttachRecursiveStrokeCounts(options, myMap);
186125
186124
  }
186126
- _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__.CurvePrimitive.installStrokeCountMap(this, myMap, parentStrokeMap);
186125
+ _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_3__.CurvePrimitive.installStrokeCountMap(this, myMap, parentStrokeMap);
186127
186126
  }
186128
186127
  /**
186129
- * Second step of double dispatch: call `this._path.dispatchToGeometryHandler (handler)`
186128
+ * Second step of double dispatch: call `this._path.dispatchToGeometryHandler (handler)`
186130
186129
  * * Note that this exposes the children individually to the handler.
186131
186130
  */
186132
186131
  dispatchToGeometryHandler(handler) {
186133
- return this._path.dispatchToGeometryHandler(handler);
186132
+ return handler.handleCurveChainWithDistanceIndex(this);
186134
186133
  }
186135
- /** Extend (increase) `rangeToExtend` as needed to include these curves (optionally transformed) */
186134
+ /** Extend `rangeToExtend` as needed to include these curves (optionally transformed) */
186136
186135
  extendRange(rangeToExtend, transform) {
186137
186136
  this._path.extendRange(rangeToExtend, transform);
186138
186137
  }
186139
- /**
186140
- * Curve length is always positive.
186141
- * @returns Returns a (high accuracy) length of the curve between fractional positions
186142
- * @returns Returns the length of the curve.
186143
- */
186138
+ /** Return a (high accuracy and positive) length of the curve between fractional positions */
186144
186139
  curveLengthBetweenFractions(fraction0, fraction1) {
186145
186140
  return Math.abs(fraction1 - fraction0) * this._totalLength;
186146
186141
  }
@@ -186154,9 +186149,10 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
186154
186149
  return result;
186155
186150
  }
186156
186151
  /**
186157
- * Resolve a fraction of the CurveChain to a PathFragment
186158
- * @param distance
186159
- * @param allowExtrapolation
186152
+ * Return the PathFragment object at the given `distance` along the chain.
186153
+ * @param distance distance along the chain.
186154
+ * @param allowExtrapolation if `true`, returns first fragment for negative distances and returns last fragment
186155
+ * for distances larger than curve length. If `false` returns `undefined` for those out of bound distances.
186160
186156
  */
186161
186157
  chainDistanceToFragment(distance, allowExtrapolation = false) {
186162
186158
  const i = this.chainDistanceToFragmentIndex(distance, allowExtrapolation);
@@ -186165,9 +186161,10 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
186165
186161
  return undefined;
186166
186162
  }
186167
186163
  /**
186168
- * Resolve a fraction of the CurveChain to a PathFragment index
186169
- * @param distance
186170
- * @param allowExtrapolation
186164
+ * Return the index of the PathFragment at the given `distance` along the chain.
186165
+ * @param distance distance along the chain.
186166
+ * @param allowExtrapolation if `true`, returns 0 for negative distances and returns last fragment index for
186167
+ * distances larger than curve length. If `false` returns `undefined` for those out of bound distances.
186171
186168
  */
186172
186169
  chainDistanceToFragmentIndex(distance, allowExtrapolation = false) {
186173
186170
  const numFragments = this._fragments.length;
@@ -186177,7 +186174,7 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
186177
186174
  return allowExtrapolation ? 0 : undefined;
186178
186175
  if (distance > this._totalLength)
186179
186176
  return allowExtrapolation ? (numFragments - 1) : undefined;
186180
- // humbug, linear search
186177
+ // linear search (opportunity for improvement)
186181
186178
  for (let i = 0; i < numFragments; i++) {
186182
186179
  if (fragments[i].containsChainDistance(distance))
186183
186180
  return i;
@@ -186187,33 +186184,29 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
186187
186184
  }
186188
186185
  /**
186189
186186
  * Convert distance along the chain to fraction along the chain.
186190
- * @param distance distance along the chain
186187
+ * @param distance distance along the chain.
186191
186188
  */
186192
186189
  chainDistanceToChainFraction(distance) {
186193
186190
  return distance / this._totalLength;
186194
186191
  }
186195
- /**
186196
- * Resolve a fraction within a specific curve to a fragment.
186197
- * @param curve
186198
- * @param fraction
186199
- */
186192
+ /** Return the PathFragment object containing the point at the given `fraction` of the given child curve. */
186200
186193
  curveAndChildFractionToFragment(curve, fraction) {
186201
186194
  const numFragments = this._fragments.length;
186202
186195
  const fragments = this._fragments;
186203
186196
  if (numFragments > 0) {
186204
- // humbug, linear search
186197
+ if (fraction < 0)
186198
+ return fragments[0];
186199
+ if (fraction > 1.0)
186200
+ return fragments[numFragments - 1];
186201
+ // linear search (opportunity for improvement)
186205
186202
  for (const fragment of fragments) {
186206
186203
  if (fragment.containsChildCurveAndChildFraction(curve, fraction))
186207
186204
  return fragment;
186208
186205
  }
186209
- if (fraction <= 0)
186210
- return fragments[0];
186211
- if (fraction > 1.0)
186212
- return fragments[numFragments - 1];
186213
186206
  }
186214
186207
  return undefined;
186215
186208
  }
186216
- /** Returns the total length of curves. */
186209
+ /** Returns the total length of `this` curve. */
186217
186210
  curveLength() {
186218
186211
  return this._totalLength;
186219
186212
  }
@@ -186226,52 +186219,59 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
186226
186219
  }
186227
186220
  /**
186228
186221
  * Return the point (x,y,z) on the curve at fractional position along the chain.
186229
- * @param fraction fractional position along the geometry.
186230
- * @returns Returns a point on the curve.
186222
+ * @param fraction fractional position along the curve.
186223
+ * @returns a point on the curve.
186231
186224
  */
186232
186225
  fractionToPoint(fraction, result) {
186233
- const chainDistance = fraction * this._totalLength;
186234
- const fragment = this.chainDistanceToFragment(chainDistance, true);
186226
+ const distanceAlongPath = fraction * this._totalLength;
186227
+ const fragment = this.chainDistanceToFragment(distanceAlongPath, true);
186235
186228
  if (fragment) {
186236
- const childFraction = fragment.chainDistanceToAccurateChildFraction(chainDistance, true);
186229
+ const childFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
186237
186230
  return fragment.childCurve.fractionToPoint(childFraction, result);
186238
186231
  }
186239
- // no fragment found. Use _fragments[0]
186240
- // fragment = this.chainDistanceToFragment(chainDistance, true);
186232
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false); // we never expect to get here
186233
+ // no fragment found. just return the first point on the curve.
186241
186234
  return this._fragments[0].childCurve.fractionToPoint(0.0, result);
186242
186235
  }
186243
186236
  /**
186244
186237
  * Return the point (x,y,z) and derivative on the curve at fractional position.
186245
- * * Note that this derivative is "derivative of xyz with respect to fraction."
186246
- * * this derivative shows the speed of the "fractional point" moving along the curve.
186247
- * * this is not generally a unit vector. use fractionToPointAndUnitTangent for a unit vector.
186238
+ * * Note that the derivative is "derivative of xyz with respect to fraction".
186239
+ * * The derivative shows the speed of the "fractional point" moving along the curve.
186240
+ * * The derivative is not generally a unit vector. Use `fractionToPointAndUnitTangent` for a unit vector.
186248
186241
  * @param fraction fractional position along the geometry.
186249
- * @returns Returns a ray whose origin is the curve point and direction is the derivative with respect to the fraction.
186242
+ * @param result optional receiver for the result.
186243
+ * @returns a ray whose origin is the curve point and direction is the derivative with respect to the fraction.
186250
186244
  */
186251
186245
  fractionToPointAndDerivative(fraction, result) {
186252
186246
  const distanceAlongPath = fraction * this._totalLength;
186253
186247
  const fragment = this.chainDistanceToFragment(distanceAlongPath, true);
186254
- const curveFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
186255
- result = fragment.childCurve.fractionToPointAndDerivative(curveFraction, result);
186256
- // Fractional arc length parameterization for the curve C is f=f(t)=s(t)/L, where
186257
- // L is total length of C, f'=||C'||/L, and inverse t=t(f), t'=1/f'=L/||C'||.
186258
- // Then d/df(C(t(f)))=C't'=C'L/||C'||. The fragment gave us C', so the
186259
- // derivative we seek is just a scale away.
186260
- const a = this._totalLength / result.direction.magnitude();
186248
+ const childFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
186249
+ result = fragment.childCurve.fractionToPointAndDerivative(childFraction, result);
186250
+ // Recall the standard arclength formula s(t) for the curve C = C(t), with derivative s'(t) = ||C'||.
186251
+ // Define fractional arclength for C by f = f(t) = s(t)/L, where L is the total length of C. Then f' = ||C'||/L.
186252
+ // Denote the inverse of f by t = t(f). Then C = C(t(f)) is a parameterization of C by its fractional arclength f.
186253
+ // 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'||.
186254
+ // The fragment gives us C', so we're just a scale away.
186255
+ // Math details can be found at core/geometry/internaldocs/Curve.md
186256
+ const a = this._totalLength / result.direction.magnitude(); // L/||C'||
186261
186257
  result.direction.scaleInPlace(a);
186262
186258
  return result;
186263
186259
  }
186264
186260
  /**
186265
- * Returns a ray whose origin is the curve point and direction is the unit tangent.
186261
+ * Return the point (x,y,z) and normalized derivative on the curve at fractional position.
186262
+ * * Note that the derivative is "derivative of xyz with respect to fraction".
186263
+ * * The un-normalized derivative shows the speed of the "fractional point" moving along the curve.
186264
+ * * To find the un-normalized derivative, use `fractionToPointAndDerivative`.
186266
186265
  * @param fraction fractional position on the curve
186267
186266
  * @param result optional receiver for the result.
186268
- * Returns a ray whose origin is the curve point and direction is the unit tangent.
186267
+ * @returns a ray whose origin is the curve point and direction is the normalized derivative with respect to
186268
+ * the fraction.
186269
186269
  */
186270
186270
  fractionToPointAndUnitTangent(fraction, result) {
186271
186271
  const distanceAlongPath = fraction * this._totalLength;
186272
186272
  const fragment = this.chainDistanceToFragment(distanceAlongPath, true);
186273
- const curveFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
186274
- result = fragment.childCurve.fractionToPointAndDerivative(curveFraction, result);
186273
+ const childFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
186274
+ result = fragment.childCurve.fractionToPointAndDerivative(childFraction, result);
186275
186275
  result.direction.normalizeInPlace();
186276
186276
  return result;
186277
186277
  }
@@ -186280,34 +186280,39 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
186280
186280
  * * origin at fractional position along the curve
186281
186281
  * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to
186282
186282
  * the fraction.
186283
- * * vectorV is the second derivative, i.e.derivative of vectorU.
186283
+ * * vectorV is the second derivative, i.e. derivative of vectorU which points in the direction of the curve's
186284
+ * derivative's change.
186284
186285
  */
186285
186286
  fractionToPointAnd2Derivatives(fraction, result) {
186286
186287
  const distanceAlongPath = fraction * this._totalLength;
186287
186288
  const fragment = this.chainDistanceToFragment(distanceAlongPath, true);
186288
- const curveFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
186289
- result = fragment.childCurve.fractionToPointAnd2Derivatives(curveFraction, result);
186289
+ const childFraction = fragment.chainDistanceToAccurateChildFraction(distanceAlongPath, true);
186290
+ result = fragment.childCurve.fractionToPointAnd2Derivatives(childFraction, result);
186290
186291
  if (!result)
186291
186292
  return undefined;
186292
- // See fractionToPointAndDerivative for derivation of d/df(C(t(f)))=L C'/||C'||.
186293
- // For the 2nd deriv, use quotient rule, d/dt||x(t)||=x.x'/||x|| and ||x||^2=x.x :
186294
- // d2/df2(C(t(f))) = L d/df(C'/||C'||)
186295
- // = L (||C'|| d/df(C') - C' d/df||C'||) / ||C'||^2
186293
+ // See fractionToPointAndDerivative, where we show d/df(C(t(f))) = L C'/||C'||.
186294
+ // Here we seek the 2nd derivative. We'll use the quotient rule, and the identities
186295
+ // d/dt||x(t)|| = x.x'/||x|| and ||x||^2 = x.x, where "." is the dot product.
186296
+ // d2/df2(C(t(f))) = L d/df(C'/||C'||) = L (||C'|| d/df(C') - C' d/df||C'||) / ||C'||^2
186296
186297
  // = L (||C'|| C" L/||C'|| - C' C'.C"/||C'|| L/||C'||) / ||C'||^2
186297
- // = (L/||C'||)^2 (C" - C' C'.C"/C'.C' )
186298
- // We have C' and C" from the fragment.
186299
- const magU = result.vectorU.magnitude();
186300
- const dotUU = magU * magU;
186301
- const dotUV = result.vectorU.dotProduct(result.vectorV);
186302
- result.vectorV.addScaledInPlace(result.vectorU, -dotUV / dotUU);
186303
- const scale = this._totalLength / magU;
186304
- result.vectorU.scaleInPlace(scale);
186305
- result.vectorV.scaleInPlace(scale * scale);
186298
+ // = (L/||C'||)^2 (C" - C' C'.C"/C'.C' ), where C' and C" are given by the fragment.
186299
+ // The second derivative that fractionToPointAnd2Derivatives returns is C", so the second
186300
+ // derivative we seek is just few scales away.
186301
+ // Math details can be found at core/geometry/internaldocs/Curve.md
186302
+ const magU = result.vectorU.magnitude(); // ||C'||
186303
+ const dotUU = magU * magU; // ||C'||^2
186304
+ const dotUV = result.vectorU.dotProduct(result.vectorV); // C'.C"
186305
+ result.vectorV.addScaledInPlace(result.vectorU, -dotUV / dotUU); // add -(C'*C'.C")/(||C'||^2) to vectorV
186306
+ const scale = this._totalLength / magU; // L/||C'||
186307
+ result.vectorU.scaleInPlace(scale); // scale vectorU by L/||C'||
186308
+ result.vectorV.scaleInPlace(scale * scale); // scale vectorV by (L/||C'(t)||)^2
186306
186309
  return result;
186307
186310
  }
186308
186311
  /**
186309
186312
  * Attempt to transform in place.
186310
- * * Warning: If any child fails, this object becomes invalid. But that should never happen.
186313
+ * * Warning: If any child transform fails, `this` object becomes invalid but that should never happen.
186314
+ * @param transform the transform to be applied.
186315
+ * @returns true if all of child transforms succeed and false otherwise.
186311
186316
  */
186312
186317
  tryTransformInPlace(transform) {
186313
186318
  let numFail = 0;
@@ -186320,48 +186325,45 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
186320
186325
  /** Reverse the curve's data so that its fractional stroking moves in the opposite direction. */
186321
186326
  reverseInPlace() {
186322
186327
  this._path.reverseChildrenInPlace();
186323
- const totalLength = this._totalLength;
186324
186328
  for (const fragment of this._fragments) {
186325
- fragment.reverseFractionsAndDistances(totalLength);
186329
+ fragment.reverseFractionsAndDistances(this._totalLength);
186326
186330
  }
186327
186331
  this._fragments.reverse();
186328
186332
  }
186329
186333
  /**
186330
- * Test for equality conditions:
186331
- * * Mismatched totalLength is a quick exit condition
186332
- * * If totalLength matches, recurse to the path for matching primitives.
186333
- * @param other
186334
+ * Test for equality conditions.
186335
+ * * Mismatched total length is a quick exit condition.
186336
+ * * If total length matches, recurse to the path for matching primitives.
186334
186337
  */
186335
186338
  isAlmostEqual(other) {
186336
186339
  if (other instanceof CurveChainWithDistanceIndex) {
186337
- return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this._totalLength, other._totalLength)
186338
- && this._path.isAlmostEqual(other._path);
186340
+ return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this._totalLength, other._totalLength) && this._path.isAlmostEqual(other._path);
186339
186341
  }
186340
186342
  return false;
186341
186343
  }
186342
186344
  /**
186343
- * Implement moveSignedDistanceFromFraction.
186344
- * * See `CurvePrimitive` for parameter details.
186345
- * * The returned location directly identifies fractional position along the CurveChainWithDistanceIndex, and
186345
+ * (Attempt to) find a position on the curve at a signed distance from start fraction.
186346
+ * * See `CurvePrimitive.moveSignedDistanceFromFraction` for parameter details.
186347
+ * * The returned location directly identifies fractional position along the CurveChainWithDistanceIndex and
186346
186348
  * has pointer to an additional detail for the child curve.
186347
186349
  */
186348
186350
  moveSignedDistanceFromFraction(startFraction, signedDistance, allowExtension, result) {
186349
186351
  const distanceA = startFraction * this._totalLength;
186350
186352
  const distanceB = distanceA + signedDistance;
186351
186353
  const fragmentB = this.chainDistanceToFragment(distanceB, true);
186352
- const childDetail = fragmentB.childCurve.moveSignedDistanceFromFraction(fragmentB.childFraction0, distanceB - fragmentB.chainDistance0, allowExtension, result);
186354
+ const childDetail = fragmentB.childCurve.moveSignedDistanceFromFraction(fragmentB.childFraction0, distanceB - fragmentB.chainDistance0, allowExtension, result); // local detail related to the child curve
186353
186355
  const endFraction = startFraction + (signedDistance / this._totalLength);
186354
- const chainDetail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_7__.CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, endFraction, signedDistance, result);
186356
+ const chainDetail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__.CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, endFraction, signedDistance, result); // global detail related to the curve chain
186355
186357
  chainDetail.childDetail = childDetail;
186356
186358
  return chainDetail;
186357
186359
  }
186358
186360
  /**
186361
+ * Return an object summarizing closest point test counts.
186359
186362
  * The returned object has
186360
186363
  * * numCalls = number of times closestPoint was called.
186361
- * * numCurvesTested = number of curves tested with full closestPoint
186362
- * * numAssigned = number of times a new minimum value was recorded
186364
+ * * numCurvesTested = number of curves tested with full closestPoint.
186365
+ * * numAssigned = number of times a new minimum value was recorded.
186363
186366
  * * numCandidate = number of curves that would be tested in worst case.
186364
- * return an object summarizing closest point test counts
186365
186367
  * @param clear if true, counts are cleared after the return object is formed.
186366
186368
  */
186367
186369
  static getClosestPointTestCounts(clear = true) {
@@ -186378,13 +186380,13 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
186378
186380
  }
186379
186381
  /**
186380
186382
  * Search for the curve point that is closest to the spacePoint.
186381
- * * The CurveChainWithDistanceIndex invokes the base class CurvePrimitive method, which
186382
- * (via a handler) determines a CurveLocation detail among the children.
186383
- * * The returned detail directly identifies fractional position along the CurveChainWithDistanceIndex, and
186383
+ * * The CurveChainWithDistanceIndex invokes the base class CurvePrimitive method, which (via a handler)
186384
+ * determines a CurveLocation detail among the children.
186385
+ * * The returned detail directly identifies fractional position along the CurveChainWithDistanceIndex and
186384
186386
  * has pointer to an additional detail for the child curve.
186385
186387
  * @param spacePoint point in space
186386
186388
  * @param extend true to extend the curve
186387
- * @returns Returns a CurveLocationDetail structure that holds the details of the close point.
186389
+ * @returns a CurveLocationDetail structure that holds the details of the close point.
186388
186390
  */
186389
186391
  closestPoint(spacePoint, extend) {
186390
186392
  let childDetail;
@@ -186395,52 +186397,51 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
186395
186397
  }
186396
186398
  else {
186397
186399
  const sortedFragments = PathFragment.collectSortedQuickMinDistances(this._fragments, spacePoint);
186398
- const extend0 = [_CurveExtendMode__WEBPACK_IMPORTED_MODULE_8__.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 0), _CurveExtendMode__WEBPACK_IMPORTED_MODULE_8__.CurveExtendMode.None];
186399
- const extend1 = [_CurveExtendMode__WEBPACK_IMPORTED_MODULE_8__.CurveExtendMode.None, _CurveExtendMode__WEBPACK_IMPORTED_MODULE_8__.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 1)];
186400
+ const extend0 = [
186401
+ _CurveExtendMode__WEBPACK_IMPORTED_MODULE_9__.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 0),
186402
+ _CurveExtendMode__WEBPACK_IMPORTED_MODULE_9__.CurveExtendMode.None,
186403
+ ];
186404
+ const extend1 = [
186405
+ _CurveExtendMode__WEBPACK_IMPORTED_MODULE_9__.CurveExtendMode.None,
186406
+ _CurveExtendMode__WEBPACK_IMPORTED_MODULE_9__.CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extend, 1),
186407
+ ];
186400
186408
  const fragment0 = this._fragments[0];
186401
186409
  const fragment1 = this._fragments[this._fragments.length - 1];
186402
186410
  CurveChainWithDistanceIndex._numCalls++;
186403
186411
  CurveChainWithDistanceIndex._numCandidate += sortedFragments.length;
186404
- for (const f of sortedFragments) {
186405
- if (f.a > aMin)
186412
+ let detailA;
186413
+ for (const sortedFragment of sortedFragments) {
186414
+ if (sortedFragment.a > aMin)
186415
+ // sortedFragments help early exit because it is likely that one of the first few fragments
186416
+ // in sortedFragments is the fragment with minimum distance from space point to the curve.
186406
186417
  break;
186407
186418
  CurveChainWithDistanceIndex._numTested++;
186408
- const child = f.childCurve;
186409
- const detailA = child.closestPoint(spacePoint, f === fragment0 ? extend0 : f === fragment1 ? extend1 : false);
186419
+ const child = sortedFragment.childCurve;
186420
+ detailA = child.closestPoint(spacePoint, sortedFragment === fragment0 ? extend0 : sortedFragment === fragment1 ? extend1 : false, detailA);
186410
186421
  if (detailA && detailA.a < aMin) {
186411
186422
  aMin = detailA.a;
186412
- childDetail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_7__.CurveLocationDetail.createCurveFractionPoint(detailA.curve, detailA.fraction, detailA.point, childDetail);
186413
- childDetail.a = detailA.a;
186423
+ childDetail = detailA.clone(childDetail);
186414
186424
  CurveChainWithDistanceIndex._numAssigned++;
186415
186425
  }
186416
186426
  }
186417
186427
  }
186418
186428
  if (!childDetail)
186419
186429
  return undefined;
186420
- const fragment = this.curveAndChildFractionToFragment(childDetail.curve, childDetail.fraction);
186421
- if (fragment) {
186422
- const chainDistance = fragment.childFractionToChainDistance(childDetail.fraction);
186423
- const chainFraction = this.chainDistanceToChainFraction(chainDistance);
186424
- const chainDetail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_7__.CurveLocationDetail.createCurveFractionPoint(this, chainFraction, childDetail.point);
186425
- chainDetail.childDetail = childDetail;
186426
- chainDetail.a = childDetail.a;
186427
- return chainDetail;
186428
- }
186429
- return undefined;
186430
+ return this.computeChainDetail(childDetail);
186430
186431
  }
186431
186432
  /**
186432
186433
  * Construct an offset of each child as viewed in the xy-plane (ignoring z).
186433
- * * No attempt is made to join the offset children. Use RegionOps.constructCurveXYOffset() to return a fully
186434
+ * * No attempt is made to join the offset children. Use RegionOps.constructCurveXYOffset to return a fully
186434
186435
  * joined offset.
186435
- * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object
186436
+ * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve) or offset options object.
186436
186437
  */
186437
186438
  constructOffsetXY(offsetDistanceOrOptions) {
186438
- const options = _OffsetOptions__WEBPACK_IMPORTED_MODULE_9__.OffsetOptions.create(offsetDistanceOrOptions);
186439
+ const options = _OffsetOptions__WEBPACK_IMPORTED_MODULE_10__.OffsetOptions.create(offsetDistanceOrOptions);
186439
186440
  const offsets = [];
186440
186441
  for (const prim of this.collectCurvePrimitives(undefined, true, true)) {
186441
186442
  const offset = prim.constructOffsetXY(options);
186442
186443
  if (offset !== undefined) {
186443
- if (offset instanceof _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__.CurvePrimitive)
186444
+ if (offset instanceof _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_3__.CurvePrimitive)
186444
186445
  offsets.push(offset);
186445
186446
  else if (Array.isArray(offset))
186446
186447
  offset.forEach((cp) => offsets.push(cp));
@@ -186452,12 +186453,31 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
186452
186453
  * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of
186453
186454
  * projection.
186454
186455
  * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.
186455
- * @param lowHigh optional receiver for output
186456
+ * @param lowHigh optional receiver for output.
186456
186457
  * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the
186457
186458
  * end of the ray.
186458
186459
  */
186459
186460
  projectedParameterRange(ray, lowHigh) {
186460
- return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_10__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
186461
+ return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_11__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
186462
+ }
186463
+ /**
186464
+ * Compute the global chain detail corresponding to a local child detail.
186465
+ * @param childDetail the local detail, with respect to a child of this chain.
186466
+ * @returns the global detail, with respect to this chain.
186467
+ */
186468
+ computeChainDetail(childDetail) {
186469
+ if (!childDetail.curve)
186470
+ return undefined;
186471
+ const fragment = this.curveAndChildFractionToFragment(childDetail.curve, childDetail.fraction);
186472
+ if (fragment) {
186473
+ const chainDistance = fragment.childFractionToChainDistance(childDetail.fraction);
186474
+ const chainFraction = this.chainDistanceToChainFraction(chainDistance);
186475
+ const chainDetail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__.CurveLocationDetail.createCurveFractionPoint(this, chainFraction, childDetail.point);
186476
+ chainDetail.childDetail = childDetail;
186477
+ chainDetail.a = childDetail.a;
186478
+ return chainDetail;
186479
+ }
186480
+ return undefined;
186461
186481
  }
186462
186482
  }
186463
186483
  CurveChainWithDistanceIndex._numCalls = 0;
@@ -188824,8 +188844,8 @@ class CurvePrimitive extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_1__.Geometr
188824
188844
  * directions), or array of distinct CurveExtendOptions for start and end.
188825
188845
  * @returns Returns a CurveLocationDetail structure that holds the details of the close point.
188826
188846
  */
188827
- closestPoint(spacePoint, extend) {
188828
- const strokeHandler = new _internalContexts_ClosestPointStrokeHandler__WEBPACK_IMPORTED_MODULE_10__.ClosestPointStrokeHandler(spacePoint, extend);
188847
+ closestPoint(spacePoint, extend, result) {
188848
+ const strokeHandler = new _internalContexts_ClosestPointStrokeHandler__WEBPACK_IMPORTED_MODULE_10__.ClosestPointStrokeHandler(spacePoint, extend, result);
188829
188849
  this.emitStrokableParts(strokeHandler);
188830
188850
  return strokeHandler.claimResult();
188831
188851
  }
@@ -196180,7 +196200,7 @@ __webpack_require__.r(__webpack_exports__);
196180
196200
  * @internal
196181
196201
  */
196182
196202
  class ClosestPointStrokeHandler extends _NewtonRtoRStrokeHandler__WEBPACK_IMPORTED_MODULE_0__.NewtonRtoRStrokeHandler {
196183
- constructor(spacePoint, extend) {
196203
+ constructor(spacePoint, extend, result) {
196184
196204
  super();
196185
196205
  this._fractionA = 0;
196186
196206
  this._functionA = 0;
@@ -196190,7 +196210,7 @@ class ClosestPointStrokeHandler extends _NewtonRtoRStrokeHandler__WEBPACK_IMPORT
196190
196210
  this._spacePoint = spacePoint;
196191
196211
  this._workPoint = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
196192
196212
  this._workRay = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_2__.Ray3d.createZero();
196193
- this._closestPoint = undefined;
196213
+ this._closestPoint = result;
196194
196214
  this._extend = extend;
196195
196215
  this.startCurvePrimitive(undefined);
196196
196216
  this._newtonSolver = new _numerics_Newton__WEBPACK_IMPORTED_MODULE_3__.Newton1dUnboundedApproximateDerivative(this);
@@ -196366,18 +196386,20 @@ __webpack_require__.r(__webpack_exports__);
196366
196386
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
196367
196387
  /* harmony export */ CurveCurveCloseApproachXY: () => (/* binding */ CurveCurveCloseApproachXY)
196368
196388
  /* harmony export */ });
196369
- /* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
196370
- /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
196371
- /* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
196372
- /* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
196373
- /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
196374
- /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
196375
- /* harmony import */ var _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../numerics/Polynomials */ "../../core/geometry/lib/esm/numerics/Polynomials.js");
196376
- /* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
196377
- /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
196378
- /* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
196379
- /* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
196380
- /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
196389
+ /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
196390
+ /* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
196391
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
196392
+ /* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
196393
+ /* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
196394
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
196395
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
196396
+ /* harmony import */ var _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../numerics/Polynomials */ "../../core/geometry/lib/esm/numerics/Polynomials.js");
196397
+ /* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
196398
+ /* harmony import */ var _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../CurveChainWithDistanceIndex */ "../../core/geometry/lib/esm/curve/CurveChainWithDistanceIndex.js");
196399
+ /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
196400
+ /* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
196401
+ /* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
196402
+ /* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
196381
196403
  /*---------------------------------------------------------------------------------------------
196382
196404
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
196383
196405
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -196397,6 +196419,8 @@ __webpack_require__.r(__webpack_exports__);
196397
196419
 
196398
196420
 
196399
196421
 
196422
+
196423
+
196400
196424
  // cspell:word XYRR
196401
196425
  /**
196402
196426
  * Handler class for XY close approach between _geometryB and another geometry.
@@ -196412,12 +196436,12 @@ __webpack_require__.r(__webpack_exports__);
196412
196436
  * * geometryB is saved for later reference.
196413
196437
  * @internal
196414
196438
  */
196415
- class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_0__.RecurseToCurvesGeometryHandler {
196439
+ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_1__.RecurseToCurvesGeometryHandler {
196416
196440
  setGeometryB(geometryB) {
196417
196441
  this._geometryB = geometryB;
196418
196442
  this._circularArcB = undefined;
196419
196443
  this._circularRadiusB = undefined;
196420
- if (geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_1__.Arc3d) {
196444
+ if (geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
196421
196445
  const r = geometryB.circularRadiusXY();
196422
196446
  if (r !== undefined) {
196423
196447
  this._circularRadiusB = r;
@@ -196425,9 +196449,6 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196425
196449
  }
196426
196450
  }
196427
196451
  }
196428
- reinitialize() {
196429
- this._results = [];
196430
- }
196431
196452
  /**
196432
196453
  * Constructor.
196433
196454
  * @param geometryB second curve for intersection. Saved for reference by specific handler methods.
@@ -196435,8 +196456,8 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196435
196456
  constructor(geometryB) {
196436
196457
  super();
196437
196458
  this.setGeometryB(geometryB);
196438
- this._maxDistanceSquared = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistanceSquared;
196439
- this.reinitialize();
196459
+ this._maxDistanceSquared = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistanceSquared;
196460
+ this._results = [];
196440
196461
  }
196441
196462
  /** Set the (possibly undefined) max XY distance (z is ignored) to accept. */
196442
196463
  set maxDistanceToAccept(value) {
@@ -196471,12 +196492,12 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196471
196492
  grabPairedResults(reinitialize = false) {
196472
196493
  const result = this._results;
196473
196494
  if (reinitialize)
196474
- this.reinitialize();
196495
+ this._results = [];
196475
196496
  return result;
196476
196497
  }
196477
196498
  /** Returns `true` if `detail` has same curve and fraction. */
196478
196499
  sameCurveAndFraction(cp, fraction, detail) {
196479
- return cp === detail.curve && _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isAlmostEqualNumber(fraction, detail.fraction);
196500
+ return cp === detail.curve && _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isAlmostEqualNumber(fraction, detail.fraction);
196480
196501
  }
196481
196502
  /**
196482
196503
  * If distance between pointA and pointB is less than maxDistance, record CurveLocationDetailPair which is
@@ -196485,9 +196506,9 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196485
196506
  testAndRecordPointPairApproach(cpA, fA, pointA, cpB, fB, pointB, reversed) {
196486
196507
  const d2 = pointA.distanceSquaredXY(pointB);
196487
196508
  if (d2 < this._maxDistanceSquared) {
196488
- const detailA = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveFractionPoint(cpA, fA, pointA);
196489
- const detailB = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveFractionPoint(cpB, fB, pointB);
196490
- const pair = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetailPair.createCapture(detailA, detailB);
196509
+ const detailA = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveFractionPoint(cpA, fA, pointA);
196510
+ const detailB = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveFractionPoint(cpB, fB, pointB);
196511
+ const pair = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetailPair.createCapture(detailA, detailB);
196491
196512
  if (reversed)
196492
196513
  pair.swapDetails();
196493
196514
  this._results.push(pair);
@@ -196503,7 +196524,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196503
196524
  * @param cpB the second curve
196504
196525
  * @param fractionB0 start of the second curve
196505
196526
  * @param fractionB1 end of the second curve
196506
- * @param reversed true to have order reversed in final structures
196527
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
196507
196528
  * @param intervalDetails optional CurveLocationDetailPair
196508
196529
  */
196509
196530
  recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, cpB, fractionB0, fractionB1, reversed, intervalDetails) {
@@ -196513,14 +196534,14 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196513
196534
  intervalDetails.detailA.hasFraction1 &&
196514
196535
  intervalDetails.detailB.hasFraction1;
196515
196536
  if (isInterval) {
196516
- globalFractionA = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction, fractionA1);
196517
- globalFractionB = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction, fractionB1);
196518
- globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction1, fractionA1);
196519
- globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction1, fractionB1);
196537
+ globalFractionA = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction, fractionA1);
196538
+ globalFractionB = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction, fractionB1);
196539
+ globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction1, fractionA1);
196540
+ globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction1, fractionB1);
196520
196541
  }
196521
196542
  else {
196522
- globalFractionA = globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionA0, localFractionA, fractionA1);
196523
- globalFractionB = globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionB0, localFractionB, fractionB1);
196543
+ globalFractionA = globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionA0, localFractionA, fractionA1);
196544
+ globalFractionB = globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionB0, localFractionB, fractionB1);
196524
196545
  }
196525
196546
  // ignore duplicate of most recent approach
196526
196547
  const numPrevious = this._results.length;
@@ -196538,8 +196559,8 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196538
196559
  return;
196539
196560
  }
196540
196561
  }
196541
- const detailA = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveFractionPoint(cpA, globalFractionA, cpA.fractionToPoint(globalFractionA));
196542
- const detailB = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveFractionPoint(cpB, globalFractionB, cpB.fractionToPoint(globalFractionB));
196562
+ const detailA = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveFractionPoint(cpA, globalFractionA, cpA.fractionToPoint(globalFractionA));
196563
+ const detailB = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveFractionPoint(cpB, globalFractionB, cpB.fractionToPoint(globalFractionB));
196543
196564
  if (isInterval) {
196544
196565
  detailA.captureFraction1Point1(globalFractionA1, cpA.fractionToPoint(globalFractionA1));
196545
196566
  detailB.captureFraction1Point1(globalFractionB1, cpB.fractionToPoint(globalFractionB1));
@@ -196548,14 +196569,14 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196548
196569
  const d2 = detailA.point.distanceSquaredXY(detailB.point);
196549
196570
  if (d2 > this._maxDistanceSquared)
196550
196571
  return;
196551
- detailA.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveIntervalRole.isolated);
196552
- detailB.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveIntervalRole.isolated);
196572
+ detailA.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveIntervalRole.isolated);
196573
+ detailB.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveIntervalRole.isolated);
196553
196574
  }
196554
196575
  if (reversed) {
196555
- this._results.push(new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetailPair(detailB, detailA));
196576
+ this._results.push(new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetailPair(detailB, detailA));
196556
196577
  }
196557
196578
  else {
196558
- this._results.push(new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetailPair(detailA, detailB));
196579
+ this._results.push(new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetailPair(detailA, detailB));
196559
196580
  }
196560
196581
  }
196561
196582
  /**
@@ -196569,11 +196590,11 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196569
196590
  * @param cpB curveB
196570
196591
  * @param fractionB0 global start fraction on curveB
196571
196592
  * @param fractionB1 global end fraction on curveB
196572
- * @param reversed whether to reverse the details in the pair
196593
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
196573
196594
  */
196574
196595
  capturePairWithLocalFractions(pair, cpA, fractionA0, fractionA1, cpB, fractionB0, fractionB1, reversed) {
196575
- const globalFractionA = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionA0, pair.detailA.fraction, fractionA1);
196576
- const globalFractionB = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionB0, pair.detailB.fraction, fractionB1);
196596
+ const globalFractionA = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionA0, pair.detailA.fraction, fractionA1);
196597
+ const globalFractionB = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionB0, pair.detailB.fraction, fractionB1);
196577
196598
  // ignore duplicate of most recent pair
196578
196599
  const numPrevious = this._results.length;
196579
196600
  if (numPrevious > 0) {
@@ -196590,13 +196611,13 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196590
196611
  return;
196591
196612
  }
196592
196613
  }
196614
+ // recompute the points just in case
196615
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveEvaluatedFraction(cpA, globalFractionA, pair.detailA);
196616
+ _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveEvaluatedFraction(cpB, globalFractionB, pair.detailB);
196617
+ pair.detailA.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveIntervalRole.isolated);
196618
+ pair.detailB.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveIntervalRole.isolated);
196593
196619
  if (reversed)
196594
196620
  pair.swapDetails();
196595
- // recompute the points just in case
196596
- _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveEvaluatedFraction(cpA, globalFractionA, pair.detailA);
196597
- _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveEvaluatedFraction(cpB, globalFractionB, pair.detailB);
196598
- pair.detailA.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveIntervalRole.isolated);
196599
- pair.detailB.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveIntervalRole.isolated);
196600
196621
  this._results.push(pair);
196601
196622
  }
196602
196623
  /**
@@ -196604,7 +196625,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196604
196625
  * @param cpA first curve primitive (possibly different from curve in detailA, but fraction compatible)
196605
196626
  * @param cpB second curve primitive (possibly different from curve in detailA, but fraction compatible)
196606
196627
  * @param pairs array of pairs
196607
- * @param reversed true to have order reversed in final structures.
196628
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
196608
196629
  */
196609
196630
  recordPairs(cpA, cpB, pairs, reversed) {
196610
196631
  if (pairs !== undefined) {
@@ -196617,15 +196638,15 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196617
196638
  * Record fully assembled (but possibly reversed) detail pair.
196618
196639
  * @param detailA first detail
196619
196640
  * @param detailB second detail
196620
- * @param reversed true to have order reversed in final structures.
196641
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
196621
196642
  */
196622
196643
  captureDetailPair(detailA, detailB, reversed) {
196623
196644
  if (detailA && detailB) {
196624
196645
  if (reversed) {
196625
- this._results.push(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetailPair.createCapture(detailB, detailA));
196646
+ this._results.push(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetailPair.createCapture(detailB, detailA));
196626
196647
  }
196627
196648
  else {
196628
- this._results.push(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetailPair.createCapture(detailA, detailB));
196649
+ this._results.push(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetailPair.createCapture(detailA, detailB));
196629
196650
  }
196630
196651
  }
196631
196652
  }
@@ -196646,7 +196667,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196646
196667
  }
196647
196668
  /**
196648
196669
  * Return fractions of close approach within maxDistance between two line segments (a0,a1) and (b0,b1).
196649
- * * Math details can be found at docs/learning/geometry/CurveCurve.md
196670
+ * * Math details can be found at core/geometry/internaldocs/Curve.md
196650
196671
  * @param a0 start point of line a
196651
196672
  * @param a1 end point of line a
196652
196673
  * @param b0 start point of line b
@@ -196666,38 +196687,38 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196666
196687
  const e01y = b1.y - a0.y;
196667
196688
  const e10x = b0.x - a1.x;
196668
196689
  const e10y = b0.y - a1.y;
196669
- const hab0 = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.crossProductXYXY(ux, uy, e00x, e00y);
196670
- const hab1 = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.crossProductXYXY(ux, uy, e01x, e01y);
196671
- const hba0 = -_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.crossProductXYXY(vx, vy, e00x, e00y);
196672
- const hba1 = -_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.crossProductXYXY(vx, vy, e10x, e10y);
196690
+ const hab0 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.crossProductXYXY(ux, uy, e00x, e00y);
196691
+ const hab1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.crossProductXYXY(ux, uy, e01x, e01y);
196692
+ const hba0 = -_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.crossProductXYXY(vx, vy, e00x, e00y);
196693
+ const hba1 = -_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.crossProductXYXY(vx, vy, e10x, e10y);
196673
196694
  if (hab0 * hab1 < 0.0 && hba0 * hba1 < 0.0) { // true intersection, strictly within both segments
196674
196695
  const fractionA = -hba0 / (hba1 - hba0);
196675
196696
  const fractionB = -hab0 / (hab1 - hab0);
196676
- 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)));
196697
+ 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)));
196677
196698
  }
196678
196699
  // there's no intersection, so find the closest approach within maxDistance from an endpoint
196679
- const closestApproach = new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetailPair();
196700
+ const closestApproach = new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetailPair();
196680
196701
  closestApproach.detailA.a = 2 * maxDistanceSquared; // init to an approach that's too far away
196681
196702
  let reversed = false;
196682
- const uu = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.hypotenuseSquaredXY(ux, uy);
196703
+ const uu = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.hypotenuseSquaredXY(ux, uy);
196683
196704
  if (hab0 * hab0 <= maxDistanceSquared * uu) { // test distance of b0 to u
196684
- const fractionA = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.dotProductXYXY(ux, uy, e00x, e00y) / uu;
196705
+ const fractionA = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYXY(ux, uy, e00x, e00y) / uu;
196685
196706
  if (this.updatePointToSegmentDistance(0, b0, a0, a1, fractionA, maxDistanceSquared, closestApproach))
196686
196707
  reversed = true;
196687
196708
  }
196688
196709
  if (hab1 * hab1 <= maxDistanceSquared * uu) { // test distance of b1 to u
196689
- const fractionA = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.dotProductXYXY(ux, uy, e01x, e01y) / uu;
196710
+ const fractionA = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYXY(ux, uy, e01x, e01y) / uu;
196690
196711
  if (this.updatePointToSegmentDistance(1, b1, a0, a1, fractionA, maxDistanceSquared, closestApproach))
196691
196712
  reversed = true;
196692
196713
  }
196693
- const vv = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.hypotenuseSquaredXY(vx, vy);
196714
+ const vv = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.hypotenuseSquaredXY(vx, vy);
196694
196715
  if (hba0 * hba0 <= maxDistanceSquared * vv) { // test distance of a0 to v
196695
- const fractionB = -_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.dotProductXYXY(vx, vy, e00x, e00y) / vv;
196716
+ const fractionB = -_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYXY(vx, vy, e00x, e00y) / vv;
196696
196717
  if (this.updatePointToSegmentDistance(0, a0, b0, b1, fractionB, maxDistanceSquared, closestApproach))
196697
196718
  reversed = false;
196698
196719
  }
196699
196720
  if (hba1 * hba1 <= maxDistanceSquared * vv) { // test distance of a1 to v
196700
- const fractionB = -_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.dotProductXYXY(vx, vy, e10x, e10y) / vv;
196721
+ const fractionB = -_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.dotProductXYXY(vx, vy, e10x, e10y) / vv;
196701
196722
  if (this.updatePointToSegmentDistance(1, a1, b0, b1, fractionB, maxDistanceSquared, closestApproach))
196702
196723
  reversed = false;
196703
196724
  }
@@ -196719,7 +196740,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196719
196740
  * @param fB0 fraction0 on curveB
196720
196741
  * @param fB1 fraction0 on curveB
196721
196742
  * @param testProjectionOnB whether to record projections of the given curveA points onto curveB
196722
- * @param reversed true to have order reversed in final structures.
196743
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
196723
196744
  */
196724
196745
  testAndRecordFractionalPairApproach(cpA, fA0, fA1, testProjectionOnA, cpB, fB0, fB1, testProjectionOnB, reversed) {
196725
196746
  const pointA0 = cpA.fractionToPoint(fA0);
@@ -196744,7 +196765,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196744
196765
  // NO NO NO -- this is 3D closest point --- need 2d !!
196745
196766
  const detail = cpB.closestPoint(pointA, false);
196746
196767
  if (detail) {
196747
- const fB = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.restrictToInterval(detail.fraction, fB0, fB1);
196768
+ const fB = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.restrictToInterval(detail.fraction, fB0, fB1);
196748
196769
  if (fB === detail.fraction) { // if fraction is within fB0 and fB1
196749
196770
  this.testAndRecordPointPairApproach(cpA, fA, pointA, cpB, detail.fraction, detail.point, reversed);
196750
196771
  }
@@ -196783,7 +196804,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196783
196804
  * @param pointA1 end point of the segment
196784
196805
  * @param fractionA1 fraction of the end of the segment
196785
196806
  * @param arc the arc
196786
- * @param reversed true to have order reversed in final structures
196807
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
196787
196808
  */
196788
196809
  dispatchSegmentArc(cpA, pointA0, fractionA0, pointA1, fractionA1, arc, reversed) {
196789
196810
  // 1) intersection between arc and segment
@@ -196799,18 +196820,18 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196799
196820
  const data = arc.toTransformedVectors();
196800
196821
  const pointA0Local = pointA0;
196801
196822
  const pointA1Local = pointA1;
196802
- const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.center, 1); // det(A0, A1, C)
196803
- const beta = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector0, 0); // det(A0, A1, U)
196804
- const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector90, 0); // det(A0, A1, V)
196805
- const cosines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_4__.GrowableFloat64Array(2);
196806
- const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_4__.GrowableFloat64Array(2);
196807
- const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_4__.GrowableFloat64Array(2);
196808
- const numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_5__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(// solve the equation
196823
+ const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.center, 1); // det(A0, A1, C)
196824
+ const beta = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector0, 0); // det(A0, A1, U)
196825
+ const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector90, 0); // det(A0, A1, V)
196826
+ const cosines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_5__.GrowableFloat64Array(2);
196827
+ const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_5__.GrowableFloat64Array(2);
196828
+ const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_5__.GrowableFloat64Array(2);
196829
+ const numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_6__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(// solve the equation
196809
196830
  alpha, beta, gamma, cosines, sines, radians);
196810
196831
  for (let i = 0; i < numRoots; i++) {
196811
196832
  const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
196812
196833
  const arcFraction = data.sweep.radiansToSignedPeriodicFraction(radians.atUncheckedIndex(i));
196813
- const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_5__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
196834
+ const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_6__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
196814
196835
  // only add if the point is within the start and end fractions of both line segment and arc
196815
196836
  if (lineFraction !== undefined && this.acceptFraction(lineFraction) && this.acceptFraction(arcFraction)) {
196816
196837
  this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
@@ -196830,7 +196851,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196830
196851
  for (const radians1 of [parallelRadians, parallelRadians + Math.PI]) {
196831
196852
  const arcPoint = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
196832
196853
  const arcFraction = data.sweep.radiansToSignedPeriodicFraction(radians1);
196833
- const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_5__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
196854
+ const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_6__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
196834
196855
  // only add if the point is within the start and end fractions of both line segment and arc
196835
196856
  if (lineFraction !== undefined && this.acceptFraction(lineFraction) && this.acceptFraction(arcFraction)) {
196836
196857
  this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
@@ -196840,15 +196861,15 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196840
196861
  /** Low level dispatch of circular arc with circular arc. radiusA must be larger than or equal to radiusB. */
196841
196862
  dispatchCircularCircularOrdered(cpA, radiusA, cpB, radiusB, reversed) {
196842
196863
  const c = cpA.center.distance(cpB.center);
196843
- const e = this._maxDistanceToAccept !== undefined ? this._maxDistanceToAccept : _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance;
196864
+ const e = this._maxDistanceToAccept !== undefined ? this._maxDistanceToAccept : _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance;
196844
196865
  if (c > radiusA + radiusB + e) // distance between circles is more than max distance
196845
196866
  return;
196846
196867
  // TODO: 1) intersection between arcs
196847
196868
  // 2) endpoints to endpoints
196848
196869
  this.testAndRecordFractionalPairApproach(cpA, 0, 1, false, cpB, 0, 1, false, reversed);
196849
196870
  // 3) line from one arc to another (perpendicular to arc tangents along center-center line)
196850
- if (!_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(c)) {
196851
- const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(cpA.center, cpB.center);
196871
+ if (!_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isSmallMetricDistance(c)) {
196872
+ const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.createStartEnd(cpA.center, cpB.center);
196852
196873
  vectorAB.scaleInPlace(1.0 / c);
196853
196874
  for (const rA of [-radiusA, radiusA]) {
196854
196875
  for (const rB of [-radiusB, radiusB]) {
@@ -196873,7 +196894,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196873
196894
  const radians = Math.atan2(s, c);
196874
196895
  const fraction = arc.sweep.radiansToPositivePeriodicFraction(radians, 0);
196875
196896
  if (fraction < 1.0)
196876
- return _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveEvaluatedFraction(arc, fraction);
196897
+ return _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveEvaluatedFraction(arc, fraction);
196877
196898
  return undefined;
196878
196899
  }
196879
196900
  /** Low level dispatch of arc with arc. Only circular arcs are supported. */
@@ -196897,34 +196918,34 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196897
196918
  }
196898
196919
  /** Low level dispatch of arc with (beziers of) a bspline curve */
196899
196920
  dispatchArcBsplineCurve3d(cpA, cpB, reversed) {
196900
- const ls = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
196921
+ const ls = _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d.create();
196901
196922
  cpB.emitStrokes(ls);
196902
196923
  this.computeArcLineString(cpA, ls, reversed);
196903
196924
  }
196904
196925
  /** Low level dispatch of (beziers of) a bspline curve with (beziers of) a bspline curve */
196905
196926
  dispatchBSplineCurve3dBSplineCurve3d(bcurveA, bcurveB, reversed) {
196906
- const lsA = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
196927
+ const lsA = _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d.create();
196907
196928
  bcurveA.emitStrokes(lsA);
196908
- const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
196929
+ const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d.create();
196909
196930
  bcurveB.emitStrokes(lsB);
196910
196931
  this.computeLineStringLineString(lsA, lsB, reversed);
196911
196932
  }
196912
196933
  /** Low level dispatch of linestring with (beziers of) a bspline curve */
196913
196934
  dispatchLineStringBSplineCurve(lsA, curveB, reversed) {
196914
- const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
196935
+ const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d.create();
196915
196936
  curveB.emitStrokes(lsB);
196916
196937
  this.computeLineStringLineString(lsA, lsB, reversed);
196917
196938
  }
196918
196939
  /** Low level dispatch of segment with (beziers of) a bspline curve */
196919
196940
  dispatchSegmentBsplineCurve(segA, curveB, reversed) {
196920
- const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
196941
+ const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d.create();
196921
196942
  curveB.emitStrokes(lsB);
196922
196943
  this.computeSegmentLineString(segA, lsB, reversed);
196923
196944
  }
196924
196945
  /** Detail computation for segment approaching linestring. */
196925
196946
  computeSegmentLineString(segA, lsB, reversed) {
196926
196947
  const numB = lsB.numPoints();
196927
- const deltaFracB = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.safeDivideFraction(1, numB - 1, 0);
196948
+ const deltaFracB = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.safeDivideFraction(1, numB - 1, 0);
196928
196949
  const pointA0 = segA.point0Ref;
196929
196950
  const pointA1 = segA.point1Ref;
196930
196951
  const pointB0 = CurveCurveCloseApproachXY._workPointBB0;
@@ -196964,7 +196985,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196964
196985
  /** Low level dispatch of curve collection. */
196965
196986
  dispatchCurveCollection(geomA, geomAHandler) {
196966
196987
  const geomB = this._geometryB; // save
196967
- if (!geomB || !geomB.children || !(geomB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_8__.CurveCollection))
196988
+ if (!geomB || !geomB.children || !(geomB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_9__.CurveCollection))
196968
196989
  return;
196969
196990
  for (const child of geomB.children) {
196970
196991
  this.resetGeometry(child);
@@ -196972,24 +196993,60 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
196972
196993
  }
196973
196994
  this._geometryB = geomB; // restore
196974
196995
  }
196996
+ /**
196997
+ * Given a parent chain, convert the corresponding child details so that they refer to the chain's global parameterization.
196998
+ * * It is assumed that `this._results[i].detailA.curve` is a child of chainA, and similarly for detailB/chainB.
196999
+ * @param chainA convert each detailA to the global parameterization of chainA
197000
+ * @param chainB convert each detailB to the global parameterization of chainB
197001
+ */
197002
+ convertChildDetailToChainDetail(chainA, chainB) {
197003
+ for (const childDetailPair of this._results) {
197004
+ if (chainA) {
197005
+ const chainDetail = chainA.computeChainDetail(childDetailPair.detailA);
197006
+ if (chainDetail)
197007
+ childDetailPair.detailA = chainDetail;
197008
+ }
197009
+ if (chainB) {
197010
+ const chainDetail = chainB.computeChainDetail(childDetailPair.detailB);
197011
+ if (chainDetail)
197012
+ childDetailPair.detailB = chainDetail;
197013
+ }
197014
+ }
197015
+ }
197016
+ /** Low level dispatch to geomA given a CurveChainWithDistanceIndex in geometryB. */
197017
+ dispatchCurveChainWithDistanceIndex(geomA, geomAHandler) {
197018
+ if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex))
197019
+ return;
197020
+ const geomB = this._geometryB; // save
197021
+ for (const child of geomB.path.children) {
197022
+ this.resetGeometry(child);
197023
+ geomAHandler(geomA);
197024
+ }
197025
+ this.resetGeometry(geomB); // restore
197026
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!(geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex));
197027
+ this.convertChildDetailToChainDetail(undefined, geomB);
197028
+ }
196975
197029
  /** Double dispatch handler for strongly typed segment. */
196976
197030
  handleLineSegment3d(segmentA) {
196977
- if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_9__.LineSegment3d) {
197031
+ if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d) {
196978
197032
  const segmentB = this._geometryB;
196979
197033
  this.dispatchSegmentSegment(segmentA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, segmentB, segmentB.point0Ref, 0.0, segmentB.point1Ref, 1.0, false);
196980
197034
  }
196981
- else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
197035
+ else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d) {
196982
197036
  this.computeSegmentLineString(segmentA, this._geometryB, false);
196983
197037
  }
196984
- else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_1__.Arc3d) {
197038
+ else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
196985
197039
  this.dispatchSegmentArc(segmentA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._geometryB, false);
196986
197040
  }
196987
- else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_10__.BSplineCurve3d) {
197041
+ else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__.BSplineCurve3d) {
196988
197042
  this.dispatchSegmentBsplineCurve(segmentA, this._geometryB, false);
196989
197043
  }
196990
- else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_8__.CurveCollection) {
197044
+ else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_9__.CurveCollection) {
196991
197045
  this.dispatchCurveCollection(segmentA, this.handleLineSegment3d.bind(this));
196992
197046
  }
197047
+ else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex) {
197048
+ this.dispatchCurveChainWithDistanceIndex(segmentA, this.handleLineSegment3d.bind(this));
197049
+ }
196993
197050
  return undefined;
196994
197051
  }
196995
197052
  /**
@@ -197030,7 +197087,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
197030
197087
  return;
197031
197088
  let bitB0;
197032
197089
  let bitB1;
197033
- const rangeA1 = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_11__.Range3d.createNull();
197090
+ const rangeA1 = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_13__.Range3d.createNull();
197034
197091
  const pointA0 = CurveCurveCloseApproachXY._workPointAA0;
197035
197092
  const pointA1 = CurveCurveCloseApproachXY._workPointAA1;
197036
197093
  const pointB0 = CurveCurveCloseApproachXY._workPointBB0;
@@ -197070,62 +197127,76 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
197070
197127
  }
197071
197128
  /** Double dispatch handler for strongly typed linestring. */
197072
197129
  handleLineString3d(lsA) {
197073
- if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
197130
+ if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d) {
197074
197131
  const lsB = this._geometryB;
197075
197132
  this.computeLineStringLineString(lsA, lsB, false);
197076
197133
  }
197077
- else if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_9__.LineSegment3d) {
197134
+ else if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d) {
197078
197135
  this.computeSegmentLineString(this._geometryB, lsA, true);
197079
197136
  }
197080
- else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_1__.Arc3d) {
197137
+ else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
197081
197138
  this.computeArcLineString(this._geometryB, lsA, true);
197082
197139
  }
197083
- else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_10__.BSplineCurve3d) {
197140
+ else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__.BSplineCurve3d) {
197084
197141
  this.dispatchLineStringBSplineCurve(lsA, this._geometryB, false);
197085
197142
  }
197086
- else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_8__.CurveCollection) {
197143
+ else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_9__.CurveCollection) {
197087
197144
  this.dispatchCurveCollection(lsA, this.handleLineString3d.bind(this));
197088
197145
  }
197146
+ else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex) {
197147
+ this.dispatchCurveChainWithDistanceIndex(lsA, this.handleLineString3d.bind(this));
197148
+ }
197089
197149
  return undefined;
197090
197150
  }
197091
197151
  /** Double dispatch handler for strongly typed arc. */
197092
197152
  handleArc3d(arc0) {
197093
- if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_9__.LineSegment3d) {
197153
+ if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d) {
197094
197154
  this.dispatchSegmentArc(this._geometryB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, arc0, true);
197095
197155
  }
197096
- else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
197156
+ else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d) {
197097
197157
  this.computeArcLineString(arc0, this._geometryB, false);
197098
197158
  }
197099
- else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_1__.Arc3d) {
197159
+ else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
197100
197160
  this.dispatchArcArc(arc0, this._geometryB, false);
197101
197161
  }
197102
- else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_10__.BSplineCurve3d) {
197162
+ else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__.BSplineCurve3d) {
197103
197163
  this.dispatchArcBsplineCurve3d(arc0, this._geometryB, false);
197104
197164
  }
197105
- else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_8__.CurveCollection) {
197165
+ else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_9__.CurveCollection) {
197106
197166
  this.dispatchCurveCollection(arc0, this.handleArc3d.bind(this));
197107
197167
  }
197168
+ else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex) {
197169
+ this.dispatchCurveChainWithDistanceIndex(arc0, this.handleArc3d.bind(this));
197170
+ }
197108
197171
  return undefined;
197109
197172
  }
197110
197173
  /** Double dispatch handler for strongly typed bspline curve. */
197111
197174
  handleBSplineCurve3d(curve) {
197112
- if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_9__.LineSegment3d) {
197175
+ if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d) {
197113
197176
  this.dispatchSegmentBsplineCurve(this._geometryB, curve, true);
197114
197177
  }
197115
- else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
197178
+ else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_8__.LineString3d) {
197116
197179
  this.dispatchLineStringBSplineCurve(this._geometryB, curve, true);
197117
197180
  }
197118
- else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_1__.Arc3d) {
197181
+ else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
197119
197182
  this.dispatchArcBsplineCurve3d(this._geometryB, curve, true);
197120
197183
  }
197121
- else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_10__.BSplineCurve3dBase) {
197184
+ else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__.BSplineCurve3dBase) {
197122
197185
  this.dispatchBSplineCurve3dBSplineCurve3d(curve, this._geometryB, false);
197123
197186
  }
197124
- else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_8__.CurveCollection) {
197187
+ else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_9__.CurveCollection) {
197125
197188
  this.dispatchCurveCollection(curve, this.handleBSplineCurve3d.bind(this));
197126
197189
  }
197190
+ else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex) {
197191
+ this.dispatchCurveChainWithDistanceIndex(curve, this.handleBSplineCurve3d.bind(this));
197192
+ }
197127
197193
  return undefined;
197128
197194
  }
197195
+ /** Double dispatch handler for strongly typed CurveChainWithDistanceIndex. */
197196
+ handleCurveChainWithDistanceIndex(chain) {
197197
+ super.handleCurveChainWithDistanceIndex(chain);
197198
+ this.convertChildDetailToChainDetail(chain, this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex ? this._geometryB : undefined);
197199
+ }
197129
197200
  /** Double dispatch handler for strongly typed homogeneous bspline curve .. */
197130
197201
  handleBSplineCurve3dH(_curve) {
197131
197202
  /*
@@ -197144,11 +197215,11 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
197144
197215
  return undefined;
197145
197216
  }
197146
197217
  }
197147
- CurveCurveCloseApproachXY._workPointAA0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
197148
- CurveCurveCloseApproachXY._workPointAA1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
197149
- CurveCurveCloseApproachXY._workPointBB0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
197150
- CurveCurveCloseApproachXY._workPointBB1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
197151
- CurveCurveCloseApproachXY._workPointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
197218
+ CurveCurveCloseApproachXY._workPointAA0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
197219
+ CurveCurveCloseApproachXY._workPointAA1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
197220
+ CurveCurveCloseApproachXY._workPointBB0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
197221
+ CurveCurveCloseApproachXY._workPointBB1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
197222
+ CurveCurveCloseApproachXY._workPointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
197152
197223
 
197153
197224
 
197154
197225
 
@@ -198804,11 +198875,11 @@ __webpack_require__.r(__webpack_exports__);
198804
198875
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
198805
198876
  /* harmony export */ CurveOffsetXYHandler: () => (/* binding */ CurveOffsetXYHandler)
198806
198877
  /* harmony export */ });
198878
+ /* harmony import */ var _bspline_BSplineCurveOps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../bspline/BSplineCurveOps */ "../../core/geometry/lib/esm/bspline/BSplineCurveOps.js");
198879
+ /* harmony import */ var _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../bspline/InterpolationCurve3d */ "../../core/geometry/lib/esm/bspline/InterpolationCurve3d.js");
198807
198880
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
198808
198881
  /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
198809
198882
  /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
198810
- /* harmony import */ var _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../bspline/InterpolationCurve3d */ "../../core/geometry/lib/esm/bspline/InterpolationCurve3d.js");
198811
- /* harmony import */ var _bspline_BSplineCurveOps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../bspline/BSplineCurveOps */ "../../core/geometry/lib/esm/bspline/BSplineCurveOps.js");
198812
198883
  /*---------------------------------------------------------------------------------------------
198813
198884
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
198814
198885
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -198846,13 +198917,16 @@ class CurveOffsetXYHandler {
198846
198917
  if (!_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isSmallMetricDistance(tangent.x) || !_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isSmallMetricDistance(tangent.y))
198847
198918
  this._fitOptions.fitPoints.push(xyz.plusScaled(tangent.unitPerpendicularXY(this._v0), this._offsetDistance));
198848
198919
  }
198849
- needPrimaryGeometryForStrokes() { return true; }
198920
+ needPrimaryGeometryForStrokes() {
198921
+ return true;
198922
+ }
198850
198923
  startParentCurvePrimitive(_cp) { }
198851
198924
  startCurvePrimitive(_cp) { }
198852
198925
  endCurvePrimitive(_cp) { }
198853
198926
  endParentCurvePrimitive(_cp) { }
198854
198927
  announceIntervalForUniformStepStrokes(cp, numStrokes, fraction0, fraction1) {
198855
- for (let i = 0; i <= numStrokes; ++i) { // announce both start and end; adjacent duplicates will be filtered by c2 cubic fit logic
198928
+ // announce both start and end; adjacent duplicates will be filtered by c2 cubic fit logic
198929
+ for (let i = 0; i <= numStrokes; ++i) {
198856
198930
  const fraction = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fraction0, i / numStrokes, fraction1);
198857
198931
  const ray = cp.fractionToPointAndDerivative(fraction, this._r0);
198858
198932
  this.pushOffsetPoint(ray.origin, ray.direction);
@@ -198861,7 +198935,8 @@ class CurveOffsetXYHandler {
198861
198935
  announceSegmentInterval(_cp, point0, point1, numStrokes, _fraction0, _fraction1) {
198862
198936
  if (numStrokes > 0) {
198863
198937
  const tangent = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.createStartEnd(point0, point1, this._v1);
198864
- for (let i = 0; i <= numStrokes; ++i) { // announce both start and end; adjacent duplicates will be filtered by c2 cubic fit logic
198938
+ // announce both start and end; adjacent duplicates will be filtered by c2 cubic fit logic
198939
+ for (let i = 0; i <= numStrokes; ++i) {
198865
198940
  this.pushOffsetPoint(point0.interpolate(i / numStrokes, point1, this._p0), tangent);
198866
198941
  }
198867
198942
  }
@@ -206506,10 +206581,14 @@ __webpack_require__.r(__webpack_exports__);
206506
206581
  /* harmony export */ NullGeometryHandler: () => (/* binding */ NullGeometryHandler),
206507
206582
  /* harmony export */ RecurseToCurvesGeometryHandler: () => (/* binding */ RecurseToCurvesGeometryHandler)
206508
206583
  /* harmony export */ });
206584
+ /* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
206585
+ /* harmony import */ var _curve_Path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../curve/Path */ "../../core/geometry/lib/esm/curve/Path.js");
206509
206586
  /*---------------------------------------------------------------------------------------------
206510
206587
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
206511
206588
  * See LICENSE.md in the project root for license terms and full copyright notice.
206512
206589
  *--------------------------------------------------------------------------------------------*/
206590
+
206591
+
206513
206592
  /**
206514
206593
  * `GeometryHandler` defines the base abstract methods for double-dispatch geometry computation.
206515
206594
  * * User code that wants to handle one or all of the commonly known geometry types implements a handler class.
@@ -206520,26 +206599,34 @@ __webpack_require__.r(__webpack_exports__);
206520
206599
  class GeometryHandler {
206521
206600
  /** Handle strongly typed [[CurveCollection]] */
206522
206601
  handleCurveCollection(_g) { }
206523
- /** Handle strongly typed Path (base class method calls handleCurveCollection) */
206602
+ /** Handle strongly typed [[Path]] (base class method calls [[handleCurveCollection]]) */
206524
206603
  handlePath(g) {
206525
206604
  return this.handleCurveCollection(g);
206526
206605
  }
206527
- /** Handle strongly typed Loop (base class method calls handleCurveCollection) */
206606
+ /** Handle strongly typed [[Loop]] (base class method calls [[handleCurveCollection]]) */
206528
206607
  handleLoop(g) {
206529
206608
  return this.handleCurveCollection(g);
206530
206609
  }
206531
- /** Handle strongly typed ParityRegion (base class method calls handleCurveCollection) */
206610
+ /** Handle strongly typed [[ParityRegion]] (base class method calls [[handleCurveCollection]]) */
206532
206611
  handleParityRegion(g) {
206533
206612
  return this.handleCurveCollection(g);
206534
206613
  }
206535
- /** Handle strongly typed UnionRegion (base class method calls handleCurveCollection) */
206614
+ /** Handle strongly typed [[UnionRegion]] (base class method calls [[handleCurveCollection]]) */
206536
206615
  handleUnionRegion(g) {
206537
206616
  return this.handleCurveCollection(g);
206538
206617
  }
206539
- /** Handle strongly typed BagOfCurves (base class method calls handleCurveCollection) */
206618
+ /** Handle strongly typed [[BagOfCurves]] (base class method calls [[handleCurveCollection]]) */
206540
206619
  handleBagOfCurves(g) {
206541
206620
  return this.handleCurveCollection(g);
206542
206621
  }
206622
+ /** Handle strongly typed [[CurveChainWithDistanceIndex]] (base class method calls [[handlePath]] or [[handleLoop]]) */
206623
+ handleCurveChainWithDistanceIndex(g) {
206624
+ if (g.path instanceof _curve_Path__WEBPACK_IMPORTED_MODULE_0__.Path)
206625
+ return this.handlePath(g.path);
206626
+ if (g.path instanceof _curve_Loop__WEBPACK_IMPORTED_MODULE_1__.Loop)
206627
+ return this.handleLoop(g.path);
206628
+ return this.handleCurveCollection(g.path);
206629
+ }
206543
206630
  }
206544
206631
  /**
206545
206632
  * `NullGeometryHandler` is a base class for dispatching various geometry types to application specific implementation
@@ -206571,6 +206658,10 @@ class NullGeometryHandler extends GeometryHandler {
206571
206658
  return undefined;
206572
206659
  }
206573
206660
  /** No-action implementation */
206661
+ handleCurveChainWithDistanceIndex(_g) {
206662
+ return undefined;
206663
+ }
206664
+ /** No-action implementation */
206574
206665
  handleBSplineCurve3d(_g) {
206575
206666
  return undefined;
206576
206667
  }
@@ -206668,7 +206759,8 @@ class NullGeometryHandler extends GeometryHandler {
206668
206759
  }
206669
206760
  }
206670
206761
  /**
206671
- * Implement GeometryHandler methods, with all curve collection methods recursing to children.
206762
+ * Implement GeometryHandler methods, but override `handleCurveCollection` so that all methods
206763
+ * that operate on a [[CurveCollection]] recurse to their children.
206672
206764
  * @public
206673
206765
  */
206674
206766
  class RecurseToCurvesGeometryHandler extends GeometryHandler {
@@ -206732,26 +206824,6 @@ class RecurseToCurvesGeometryHandler extends GeometryHandler {
206732
206824
  handleCurveCollection(g) {
206733
206825
  return this.handleChildren(g);
206734
206826
  }
206735
- /** Recurse to children */
206736
- handlePath(g) {
206737
- return this.handleChildren(g);
206738
- }
206739
- /** Recurse to children */
206740
- handleLoop(g) {
206741
- return this.handleChildren(g);
206742
- }
206743
- /** Recurse to children */
206744
- handleParityRegion(g) {
206745
- return this.handleChildren(g);
206746
- }
206747
- /** Recurse to children */
206748
- handleUnionRegion(g) {
206749
- return this.handleChildren(g);
206750
- }
206751
- /** Recurse to children */
206752
- handleBagOfCurves(g) {
206753
- return this.handleChildren(g);
206754
- }
206755
206827
  /** No-action implementation */
206756
206828
  handleSphere(_g) {
206757
206829
  return undefined;
@@ -249556,7 +249628,13 @@ class Sample {
249556
249628
  * * direct spiral (half-cosine)
249557
249629
  */
249558
249630
  static createCurveChainWithDistanceIndex() {
249559
- 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)];
249631
+ const pointsA = [
249632
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(0, 0, 0),
249633
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(1, 3, 0),
249634
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(2, 4, 0),
249635
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(3, 3, 0),
249636
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(4, 0, 0),
249637
+ ];
249560
249638
  const result = [];
249561
249639
  // one singleton per basic curve type ...
249562
249640
  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)))));
@@ -280425,7 +280503,7 @@ class TestContext {
280425
280503
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
280426
280504
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
280427
280505
  await core_frontend_1.NoRenderApp.startup({
280428
- applicationVersion: "4.2.0-dev.31",
280506
+ applicationVersion: "4.2.0-dev.32",
280429
280507
  applicationId: this.settings.gprid,
280430
280508
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
280431
280509
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -299833,7 +299911,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
299833
299911
  /***/ ((module) => {
299834
299912
 
299835
299913
  "use strict";
299836
- 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"}}');
299914
+ 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"}}');
299837
299915
 
299838
299916
  /***/ }),
299839
299917