@itwin/core-geometry 4.2.0-dev.31 → 4.2.0-dev.33

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.
Files changed (111) hide show
  1. package/lib/cjs/Geometry.d.ts +2 -2
  2. package/lib/cjs/Geometry.js +2 -2
  3. package/lib/cjs/Geometry.js.map +1 -1
  4. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +93 -91
  5. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  6. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +171 -152
  7. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  8. package/lib/cjs/curve/CurveCurve.d.ts +13 -11
  9. package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
  10. package/lib/cjs/curve/CurveCurve.js +14 -12
  11. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  12. package/lib/cjs/curve/CurveLocationDetail.d.ts +8 -7
  13. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  14. package/lib/cjs/curve/CurveLocationDetail.js +2 -1
  15. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  16. package/lib/cjs/curve/CurvePrimitive.d.ts +1 -2
  17. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  18. package/lib/cjs/curve/CurvePrimitive.js +2 -2
  19. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  20. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts +1 -1
  21. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
  22. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +2 -2
  23. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  24. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +20 -12
  25. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  26. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +63 -14
  27. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  28. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +31 -24
  29. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  30. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +85 -83
  31. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  32. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts +8 -7
  33. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  34. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +123 -95
  35. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  36. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.d.ts +2 -2
  37. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.d.ts.map +1 -1
  38. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js +9 -5
  39. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  40. package/lib/cjs/geometry3d/GeometryHandler.d.ts +12 -16
  41. package/lib/cjs/geometry3d/GeometryHandler.d.ts.map +1 -1
  42. package/lib/cjs/geometry3d/GeometryHandler.js +21 -26
  43. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  44. package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
  45. package/lib/cjs/geometry3d/Range.js.map +1 -1
  46. package/lib/cjs/geometry4d/Map4d.d.ts +14 -8
  47. package/lib/cjs/geometry4d/Map4d.d.ts.map +1 -1
  48. package/lib/cjs/geometry4d/Map4d.js +38 -16
  49. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  50. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  51. package/lib/cjs/polyface/PolyfaceBuilder.js +7 -10
  52. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  53. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  54. package/lib/cjs/serialization/GeometrySamples.js +7 -1
  55. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  56. package/lib/esm/Geometry.d.ts +2 -2
  57. package/lib/esm/Geometry.js +2 -2
  58. package/lib/esm/Geometry.js.map +1 -1
  59. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +93 -91
  60. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  61. package/lib/esm/curve/CurveChainWithDistanceIndex.js +171 -152
  62. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  63. package/lib/esm/curve/CurveCurve.d.ts +13 -11
  64. package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
  65. package/lib/esm/curve/CurveCurve.js +14 -12
  66. package/lib/esm/curve/CurveCurve.js.map +1 -1
  67. package/lib/esm/curve/CurveLocationDetail.d.ts +8 -7
  68. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  69. package/lib/esm/curve/CurveLocationDetail.js +2 -1
  70. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  71. package/lib/esm/curve/CurvePrimitive.d.ts +1 -2
  72. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  73. package/lib/esm/curve/CurvePrimitive.js +2 -2
  74. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  75. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts +1 -1
  76. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
  77. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +2 -2
  78. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  79. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +20 -12
  80. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  81. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +63 -14
  82. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  83. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +31 -24
  84. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  85. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +85 -83
  86. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  87. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts +8 -7
  88. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  89. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +124 -96
  90. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  91. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.d.ts +2 -2
  92. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.d.ts.map +1 -1
  93. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js +9 -5
  94. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  95. package/lib/esm/geometry3d/GeometryHandler.d.ts +12 -16
  96. package/lib/esm/geometry3d/GeometryHandler.d.ts.map +1 -1
  97. package/lib/esm/geometry3d/GeometryHandler.js +21 -26
  98. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  99. package/lib/esm/geometry3d/Range.d.ts.map +1 -1
  100. package/lib/esm/geometry3d/Range.js.map +1 -1
  101. package/lib/esm/geometry4d/Map4d.d.ts +14 -8
  102. package/lib/esm/geometry4d/Map4d.d.ts.map +1 -1
  103. package/lib/esm/geometry4d/Map4d.js +38 -16
  104. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  105. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  106. package/lib/esm/polyface/PolyfaceBuilder.js +7 -10
  107. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  108. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  109. package/lib/esm/serialization/GeometrySamples.js +7 -1
  110. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  111. package/package.json +3 -3
@@ -1,13 +1,11 @@
1
- /** @packageDocumentation
2
- * @module Curve
3
- */
4
1
  import { BSplineCurve3d } from "../../bspline/BSplineCurve";
5
2
  import { BSplineCurve3dH } from "../../bspline/BSplineCurve3dH";
6
3
  import { RecurseToCurvesGeometryHandler } from "../../geometry3d/GeometryHandler";
7
4
  import { Arc3d } from "../Arc3d";
8
- import { AnyCurve } from "../CurveTypes";
5
+ import { CurveChainWithDistanceIndex } from "../CurveChainWithDistanceIndex";
9
6
  import { CurveLocationDetail, CurveLocationDetailPair } from "../CurveLocationDetail";
10
7
  import { CurvePrimitive } from "../CurvePrimitive";
8
+ import { AnyCurve } from "../CurveTypes";
11
9
  import { LineSegment3d } from "../LineSegment3d";
12
10
  import { LineString3d } from "../LineString3d";
13
11
  /**
@@ -46,7 +44,6 @@ export declare class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHa
46
44
  private static _workPointBB0;
47
45
  private static _workPointBB1;
48
46
  private static _workPointB;
49
- private reinitialize;
50
47
  /**
51
48
  * Constructor.
52
49
  * @param geometryB second curve for intersection. Saved for reference by specific handler methods.
@@ -84,7 +81,7 @@ export declare class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHa
84
81
  * @param cpB the second curve
85
82
  * @param fractionB0 start of the second curve
86
83
  * @param fractionB1 end of the second curve
87
- * @param reversed true to have order reversed in final structures
84
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
88
85
  * @param intervalDetails optional CurveLocationDetailPair
89
86
  */
90
87
  private recordPointWithLocalFractions;
@@ -99,7 +96,7 @@ export declare class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHa
99
96
  * @param cpB curveB
100
97
  * @param fractionB0 global start fraction on curveB
101
98
  * @param fractionB1 global end fraction on curveB
102
- * @param reversed whether to reverse the details in the pair
99
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
103
100
  */
104
101
  private capturePairWithLocalFractions;
105
102
  /**
@@ -107,20 +104,20 @@ export declare class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHa
107
104
  * @param cpA first curve primitive (possibly different from curve in detailA, but fraction compatible)
108
105
  * @param cpB second curve primitive (possibly different from curve in detailA, but fraction compatible)
109
106
  * @param pairs array of pairs
110
- * @param reversed true to have order reversed in final structures.
107
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
111
108
  */
112
109
  recordPairs(cpA: CurvePrimitive, cpB: CurvePrimitive, pairs: CurveLocationDetailPair[] | undefined, reversed: boolean): void;
113
110
  /**
114
111
  * Record fully assembled (but possibly reversed) detail pair.
115
112
  * @param detailA first detail
116
113
  * @param detailB second detail
117
- * @param reversed true to have order reversed in final structures.
114
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
118
115
  */
119
116
  captureDetailPair(detailA: CurveLocationDetail | undefined, detailB: CurveLocationDetail | undefined, reversed: boolean): void;
120
117
  private static updatePointToSegmentDistance;
121
118
  /**
122
119
  * Return fractions of close approach within maxDistance between two line segments (a0,a1) and (b0,b1).
123
- * * Math details can be found at docs/learning/geometry/CurveCurve.md
120
+ * * Math details can be found at core/geometry/internaldocs/Curve.md
124
121
  * @param a0 start point of line a
125
122
  * @param a1 end point of line a
126
123
  * @param b0 start point of line b
@@ -142,7 +139,7 @@ export declare class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHa
142
139
  * @param fB0 fraction0 on curveB
143
140
  * @param fB1 fraction0 on curveB
144
141
  * @param testProjectionOnB whether to record projections of the given curveA points onto curveB
145
- * @param reversed true to have order reversed in final structures.
142
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
146
143
  */
147
144
  private testAndRecordFractionalPairApproach;
148
145
  /** Find the closest approach between pointA and cpB. Add the approach if it's within fB0 and fB1. */
@@ -169,7 +166,7 @@ export declare class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHa
169
166
  * @param pointA1 end point of the segment
170
167
  * @param fractionA1 fraction of the end of the segment
171
168
  * @param arc the arc
172
- * @param reversed true to have order reversed in final structures
169
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
173
170
  */
174
171
  private dispatchSegmentArc;
175
172
  /** Low level dispatch of circular arc with circular arc. radiusA must be larger than or equal to radiusB. */
@@ -192,6 +189,15 @@ export declare class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHa
192
189
  computeArcLineString(arcA: Arc3d, lsB: LineString3d, reversed: boolean): any;
193
190
  /** Low level dispatch of curve collection. */
194
191
  private dispatchCurveCollection;
192
+ /**
193
+ * Given a parent chain, convert the corresponding child details so that they refer to the chain's global parameterization.
194
+ * * It is assumed that `this._results[i].detailA.curve` is a child of chainA, and similarly for detailB/chainB.
195
+ * @param chainA convert each detailA to the global parameterization of chainA
196
+ * @param chainB convert each detailB to the global parameterization of chainB
197
+ */
198
+ private convertChildDetailToChainDetail;
199
+ /** Low level dispatch to geomA given a CurveChainWithDistanceIndex in geometryB. */
200
+ private dispatchCurveChainWithDistanceIndex;
195
201
  /** Double dispatch handler for strongly typed segment. */
196
202
  handleLineSegment3d(segmentA: LineSegment3d): any;
197
203
  /**
@@ -219,6 +225,8 @@ export declare class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHa
219
225
  handleArc3d(arc0: Arc3d): any;
220
226
  /** Double dispatch handler for strongly typed bspline curve. */
221
227
  handleBSplineCurve3d(curve: BSplineCurve3d): any;
228
+ /** Double dispatch handler for strongly typed CurveChainWithDistanceIndex. */
229
+ handleCurveChainWithDistanceIndex(chain: CurveChainWithDistanceIndex): any;
222
230
  /** Double dispatch handler for strongly typed homogeneous bspline curve .. */
223
231
  handleBSplineCurve3dH(_curve: BSplineCurve3dH): any;
224
232
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CurveCurveCloseApproachXY.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bentley";
8
9
  import { BSplineCurve3d, BSplineCurve3dBase } from "../../bspline/BSplineCurve";
9
10
  import { Geometry } from "../../Geometry";
10
11
  import { RecurseToCurvesGeometryHandler } from "../../geometry3d/GeometryHandler";
@@ -13,6 +14,7 @@ import { Point3d, Vector3d } from "../../geometry3d/Point3dVector3d";
13
14
  import { Range3d } from "../../geometry3d/Range";
14
15
  import { AnalyticRoots, SmallSystem } from "../../numerics/Polynomials";
15
16
  import { Arc3d } from "../Arc3d";
17
+ import { CurveChainWithDistanceIndex } from "../CurveChainWithDistanceIndex";
16
18
  import { CurveCollection } from "../CurveCollection";
17
19
  import { CurveIntervalRole, CurveLocationDetail, CurveLocationDetailPair } from "../CurveLocationDetail";
18
20
  import { LineSegment3d } from "../LineSegment3d";
@@ -45,9 +47,6 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
45
47
  }
46
48
  }
47
49
  }
48
- reinitialize() {
49
- this._results = [];
50
- }
51
50
  /**
52
51
  * Constructor.
53
52
  * @param geometryB second curve for intersection. Saved for reference by specific handler methods.
@@ -56,7 +55,7 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
56
55
  super();
57
56
  this.setGeometryB(geometryB);
58
57
  this._maxDistanceSquared = Geometry.smallMetricDistanceSquared;
59
- this.reinitialize();
58
+ this._results = [];
60
59
  }
61
60
  /** Set the (possibly undefined) max XY distance (z is ignored) to accept. */
62
61
  set maxDistanceToAccept(value) {
@@ -91,7 +90,7 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
91
90
  grabPairedResults(reinitialize = false) {
92
91
  const result = this._results;
93
92
  if (reinitialize)
94
- this.reinitialize();
93
+ this._results = [];
95
94
  return result;
96
95
  }
97
96
  /** Returns `true` if `detail` has same curve and fraction. */
@@ -123,7 +122,7 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
123
122
  * @param cpB the second curve
124
123
  * @param fractionB0 start of the second curve
125
124
  * @param fractionB1 end of the second curve
126
- * @param reversed true to have order reversed in final structures
125
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
127
126
  * @param intervalDetails optional CurveLocationDetailPair
128
127
  */
129
128
  recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, cpB, fractionB0, fractionB1, reversed, intervalDetails) {
@@ -189,7 +188,7 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
189
188
  * @param cpB curveB
190
189
  * @param fractionB0 global start fraction on curveB
191
190
  * @param fractionB1 global end fraction on curveB
192
- * @param reversed whether to reverse the details in the pair
191
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
193
192
  */
194
193
  capturePairWithLocalFractions(pair, cpA, fractionA0, fractionA1, cpB, fractionB0, fractionB1, reversed) {
195
194
  const globalFractionA = Geometry.interpolate(fractionA0, pair.detailA.fraction, fractionA1);
@@ -210,13 +209,13 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
210
209
  return;
211
210
  }
212
211
  }
213
- if (reversed)
214
- pair.swapDetails();
215
212
  // recompute the points just in case
216
213
  CurveLocationDetail.createCurveEvaluatedFraction(cpA, globalFractionA, pair.detailA);
217
214
  CurveLocationDetail.createCurveEvaluatedFraction(cpB, globalFractionB, pair.detailB);
218
215
  pair.detailA.setIntervalRole(CurveIntervalRole.isolated);
219
216
  pair.detailB.setIntervalRole(CurveIntervalRole.isolated);
217
+ if (reversed)
218
+ pair.swapDetails();
220
219
  this._results.push(pair);
221
220
  }
222
221
  /**
@@ -224,7 +223,7 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
224
223
  * @param cpA first curve primitive (possibly different from curve in detailA, but fraction compatible)
225
224
  * @param cpB second curve primitive (possibly different from curve in detailA, but fraction compatible)
226
225
  * @param pairs array of pairs
227
- * @param reversed true to have order reversed in final structures.
226
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
228
227
  */
229
228
  recordPairs(cpA, cpB, pairs, reversed) {
230
229
  if (pairs !== undefined) {
@@ -237,7 +236,7 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
237
236
  * Record fully assembled (but possibly reversed) detail pair.
238
237
  * @param detailA first detail
239
238
  * @param detailB second detail
240
- * @param reversed true to have order reversed in final structures.
239
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
241
240
  */
242
241
  captureDetailPair(detailA, detailB, reversed) {
243
242
  if (detailA && detailB) {
@@ -266,7 +265,7 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
266
265
  }
267
266
  /**
268
267
  * Return fractions of close approach within maxDistance between two line segments (a0,a1) and (b0,b1).
269
- * * Math details can be found at docs/learning/geometry/CurveCurve.md
268
+ * * Math details can be found at core/geometry/internaldocs/Curve.md
270
269
  * @param a0 start point of line a
271
270
  * @param a1 end point of line a
272
271
  * @param b0 start point of line b
@@ -339,7 +338,7 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
339
338
  * @param fB0 fraction0 on curveB
340
339
  * @param fB1 fraction0 on curveB
341
340
  * @param testProjectionOnB whether to record projections of the given curveA points onto curveB
342
- * @param reversed true to have order reversed in final structures.
341
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
343
342
  */
344
343
  testAndRecordFractionalPairApproach(cpA, fA0, fA1, testProjectionOnA, cpB, fB0, fB1, testProjectionOnB, reversed) {
345
344
  const pointA0 = cpA.fractionToPoint(fA0);
@@ -403,7 +402,7 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
403
402
  * @param pointA1 end point of the segment
404
403
  * @param fractionA1 fraction of the end of the segment
405
404
  * @param arc the arc
406
- * @param reversed true to have order reversed in final structures
405
+ * @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
407
406
  */
408
407
  dispatchSegmentArc(cpA, pointA0, fractionA0, pointA1, fractionA1, arc, reversed) {
409
408
  // 1) intersection between arc and segment
@@ -592,6 +591,39 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
592
591
  }
593
592
  this._geometryB = geomB; // restore
594
593
  }
594
+ /**
595
+ * Given a parent chain, convert the corresponding child details so that they refer to the chain's global parameterization.
596
+ * * It is assumed that `this._results[i].detailA.curve` is a child of chainA, and similarly for detailB/chainB.
597
+ * @param chainA convert each detailA to the global parameterization of chainA
598
+ * @param chainB convert each detailB to the global parameterization of chainB
599
+ */
600
+ convertChildDetailToChainDetail(chainA, chainB) {
601
+ for (const childDetailPair of this._results) {
602
+ if (chainA) {
603
+ const chainDetail = chainA.computeChainDetail(childDetailPair.detailA);
604
+ if (chainDetail)
605
+ childDetailPair.detailA = chainDetail;
606
+ }
607
+ if (chainB) {
608
+ const chainDetail = chainB.computeChainDetail(childDetailPair.detailB);
609
+ if (chainDetail)
610
+ childDetailPair.detailB = chainDetail;
611
+ }
612
+ }
613
+ }
614
+ /** Low level dispatch to geomA given a CurveChainWithDistanceIndex in geometryB. */
615
+ dispatchCurveChainWithDistanceIndex(geomA, geomAHandler) {
616
+ if (!this._geometryB || !(this._geometryB instanceof CurveChainWithDistanceIndex))
617
+ return;
618
+ const geomB = this._geometryB; // save
619
+ for (const child of geomB.path.children) {
620
+ this.resetGeometry(child);
621
+ geomAHandler(geomA);
622
+ }
623
+ this.resetGeometry(geomB); // restore
624
+ assert(!(geomA instanceof CurveChainWithDistanceIndex));
625
+ this.convertChildDetailToChainDetail(undefined, geomB);
626
+ }
595
627
  /** Double dispatch handler for strongly typed segment. */
596
628
  handleLineSegment3d(segmentA) {
597
629
  if (this._geometryB instanceof LineSegment3d) {
@@ -610,6 +642,9 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
610
642
  else if (this._geometryB instanceof CurveCollection) {
611
643
  this.dispatchCurveCollection(segmentA, this.handleLineSegment3d.bind(this));
612
644
  }
645
+ else if (this._geometryB instanceof CurveChainWithDistanceIndex) {
646
+ this.dispatchCurveChainWithDistanceIndex(segmentA, this.handleLineSegment3d.bind(this));
647
+ }
613
648
  return undefined;
614
649
  }
615
650
  /**
@@ -706,6 +741,9 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
706
741
  else if (this._geometryB instanceof CurveCollection) {
707
742
  this.dispatchCurveCollection(lsA, this.handleLineString3d.bind(this));
708
743
  }
744
+ else if (this._geometryB instanceof CurveChainWithDistanceIndex) {
745
+ this.dispatchCurveChainWithDistanceIndex(lsA, this.handleLineString3d.bind(this));
746
+ }
709
747
  return undefined;
710
748
  }
711
749
  /** Double dispatch handler for strongly typed arc. */
@@ -725,6 +763,9 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
725
763
  else if (this._geometryB instanceof CurveCollection) {
726
764
  this.dispatchCurveCollection(arc0, this.handleArc3d.bind(this));
727
765
  }
766
+ else if (this._geometryB instanceof CurveChainWithDistanceIndex) {
767
+ this.dispatchCurveChainWithDistanceIndex(arc0, this.handleArc3d.bind(this));
768
+ }
728
769
  return undefined;
729
770
  }
730
771
  /** Double dispatch handler for strongly typed bspline curve. */
@@ -744,8 +785,16 @@ class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHandler {
744
785
  else if (this._geometryB instanceof CurveCollection) {
745
786
  this.dispatchCurveCollection(curve, this.handleBSplineCurve3d.bind(this));
746
787
  }
788
+ else if (this._geometryB instanceof CurveChainWithDistanceIndex) {
789
+ this.dispatchCurveChainWithDistanceIndex(curve, this.handleBSplineCurve3d.bind(this));
790
+ }
747
791
  return undefined;
748
792
  }
793
+ /** Double dispatch handler for strongly typed CurveChainWithDistanceIndex. */
794
+ handleCurveChainWithDistanceIndex(chain) {
795
+ super.handleCurveChainWithDistanceIndex(chain);
796
+ this.convertChildDetailToChainDetail(chain, this._geometryB instanceof CurveChainWithDistanceIndex ? this._geometryB : undefined);
797
+ }
749
798
  /** Double dispatch handler for strongly typed homogeneous bspline curve .. */
750
799
  handleBSplineCurve3dH(_curve) {
751
800
  /*