@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.
- package/lib/cjs/Geometry.d.ts +2 -2
- package/lib/cjs/Geometry.js +2 -2
- package/lib/cjs/Geometry.js.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +93 -91
- package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js +171 -152
- package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/cjs/curve/CurveCurve.d.ts +13 -11
- package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
- package/lib/cjs/curve/CurveCurve.js +14 -12
- package/lib/cjs/curve/CurveCurve.js.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.d.ts +8 -7
- package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/cjs/curve/CurveLocationDetail.js +2 -1
- package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.d.ts +1 -2
- package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/cjs/curve/CurvePrimitive.js +2 -2
- package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +2 -2
- package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +20 -12
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +63 -14
- package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +31 -24
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +85 -83
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts +8 -7
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +123 -95
- package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.d.ts +2 -2
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.d.ts.map +1 -1
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js +9 -5
- package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.d.ts +12 -16
- package/lib/cjs/geometry3d/GeometryHandler.d.ts.map +1 -1
- package/lib/cjs/geometry3d/GeometryHandler.js +21 -26
- package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
- package/lib/cjs/geometry3d/Range.js.map +1 -1
- package/lib/cjs/geometry4d/Map4d.d.ts +14 -8
- package/lib/cjs/geometry4d/Map4d.d.ts.map +1 -1
- package/lib/cjs/geometry4d/Map4d.js +38 -16
- package/lib/cjs/geometry4d/Map4d.js.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/cjs/polyface/PolyfaceBuilder.js +7 -10
- package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/cjs/serialization/GeometrySamples.js +7 -1
- package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
- package/lib/esm/Geometry.d.ts +2 -2
- package/lib/esm/Geometry.js +2 -2
- package/lib/esm/Geometry.js.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +93 -91
- package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
- package/lib/esm/curve/CurveChainWithDistanceIndex.js +171 -152
- package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
- package/lib/esm/curve/CurveCurve.d.ts +13 -11
- package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
- package/lib/esm/curve/CurveCurve.js +14 -12
- package/lib/esm/curve/CurveCurve.js.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.d.ts +8 -7
- package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
- package/lib/esm/curve/CurveLocationDetail.js +2 -1
- package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
- package/lib/esm/curve/CurvePrimitive.d.ts +1 -2
- package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
- package/lib/esm/curve/CurvePrimitive.js +2 -2
- package/lib/esm/curve/CurvePrimitive.js.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +2 -2
- package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +20 -12
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +63 -14
- package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +31 -24
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +85 -83
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts +8 -7
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +124 -96
- package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.d.ts +2 -2
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.d.ts.map +1 -1
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js +9 -5
- package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.d.ts +12 -16
- package/lib/esm/geometry3d/GeometryHandler.d.ts.map +1 -1
- package/lib/esm/geometry3d/GeometryHandler.js +21 -26
- package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
- package/lib/esm/geometry3d/Range.d.ts.map +1 -1
- package/lib/esm/geometry3d/Range.js.map +1 -1
- package/lib/esm/geometry4d/Map4d.d.ts +14 -8
- package/lib/esm/geometry4d/Map4d.d.ts.map +1 -1
- package/lib/esm/geometry4d/Map4d.js +38 -16
- package/lib/esm/geometry4d/Map4d.js.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
- package/lib/esm/polyface/PolyfaceBuilder.js +7 -10
- package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
- package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
- package/lib/esm/serialization/GeometrySamples.js +7 -1
- package/lib/esm/serialization/GeometrySamples.js.map +1 -1
- 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 {
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.d.ts","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CurveCurveCloseApproachXY.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CurveCurveCloseApproachXY.d.ts","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CurveCurveCloseApproachXY.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAsB,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAKlF,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAE7E,OAAO,EAAqB,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACzG,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C;;;;;;;;;;;;;GAaG;AACH,qBAAa,yBAA0B,SAAQ,8BAA8B;IAC3E,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,aAAa,CAAoB;IACzC,OAAO,CAAC,gBAAgB,CAA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C,mBAAmB,CAAC,QAAQ,EAAE,aAAa,GAAG,GAAG;IAqBjE;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,wBAAwB;IAahC,0DAA0D;IAC1D,OAAO,CAAC,2BAA2B;IA8CnC,6DAA6D;IAC7C,kBAAkB,CAAC,GAAG,EAAE,YAAY,GAAG,GAAG;IAiB1D,sDAAsD;IACtC,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,GAAG;IAkB7C,gEAAgE;IAChD,oBAAoB,CAAC,KAAK,EAAE,cAAc,GAAG,GAAG;IAgBhE,8EAA8E;IAC9D,iCAAiC,CAAC,KAAK,EAAE,2BAA2B,GAAG,GAAG;IAI1F,8EAA8E;IAC9D,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,GAAG;CAgBpE"}
|
|
@@ -8,6 +8,7 @@ exports.CurveCurveCloseApproachXY = void 0;
|
|
|
8
8
|
/** @packageDocumentation
|
|
9
9
|
* @module Curve
|
|
10
10
|
*/
|
|
11
|
+
const core_bentley_1 = require("@itwin/core-bentley");
|
|
11
12
|
const BSplineCurve_1 = require("../../bspline/BSplineCurve");
|
|
12
13
|
const Geometry_1 = require("../../Geometry");
|
|
13
14
|
const GeometryHandler_1 = require("../../geometry3d/GeometryHandler");
|
|
@@ -16,6 +17,7 @@ const Point3dVector3d_1 = require("../../geometry3d/Point3dVector3d");
|
|
|
16
17
|
const Range_1 = require("../../geometry3d/Range");
|
|
17
18
|
const Polynomials_1 = require("../../numerics/Polynomials");
|
|
18
19
|
const Arc3d_1 = require("../Arc3d");
|
|
20
|
+
const CurveChainWithDistanceIndex_1 = require("../CurveChainWithDistanceIndex");
|
|
19
21
|
const CurveCollection_1 = require("../CurveCollection");
|
|
20
22
|
const CurveLocationDetail_1 = require("../CurveLocationDetail");
|
|
21
23
|
const LineSegment3d_1 = require("../LineSegment3d");
|
|
@@ -48,9 +50,6 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
|
-
reinitialize() {
|
|
52
|
-
this._results = [];
|
|
53
|
-
}
|
|
54
53
|
/**
|
|
55
54
|
* Constructor.
|
|
56
55
|
* @param geometryB second curve for intersection. Saved for reference by specific handler methods.
|
|
@@ -59,7 +58,7 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
59
58
|
super();
|
|
60
59
|
this.setGeometryB(geometryB);
|
|
61
60
|
this._maxDistanceSquared = Geometry_1.Geometry.smallMetricDistanceSquared;
|
|
62
|
-
this.
|
|
61
|
+
this._results = [];
|
|
63
62
|
}
|
|
64
63
|
/** Set the (possibly undefined) max XY distance (z is ignored) to accept. */
|
|
65
64
|
set maxDistanceToAccept(value) {
|
|
@@ -94,7 +93,7 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
94
93
|
grabPairedResults(reinitialize = false) {
|
|
95
94
|
const result = this._results;
|
|
96
95
|
if (reinitialize)
|
|
97
|
-
this.
|
|
96
|
+
this._results = [];
|
|
98
97
|
return result;
|
|
99
98
|
}
|
|
100
99
|
/** Returns `true` if `detail` has same curve and fraction. */
|
|
@@ -126,7 +125,7 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
126
125
|
* @param cpB the second curve
|
|
127
126
|
* @param fractionB0 start of the second curve
|
|
128
127
|
* @param fractionB1 end of the second curve
|
|
129
|
-
* @param reversed
|
|
128
|
+
* @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
|
|
130
129
|
* @param intervalDetails optional CurveLocationDetailPair
|
|
131
130
|
*/
|
|
132
131
|
recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, cpB, fractionB0, fractionB1, reversed, intervalDetails) {
|
|
@@ -192,7 +191,7 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
192
191
|
* @param cpB curveB
|
|
193
192
|
* @param fractionB0 global start fraction on curveB
|
|
194
193
|
* @param fractionB1 global end fraction on curveB
|
|
195
|
-
* @param reversed whether to reverse the details in the pair
|
|
194
|
+
* @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
|
|
196
195
|
*/
|
|
197
196
|
capturePairWithLocalFractions(pair, cpA, fractionA0, fractionA1, cpB, fractionB0, fractionB1, reversed) {
|
|
198
197
|
const globalFractionA = Geometry_1.Geometry.interpolate(fractionA0, pair.detailA.fraction, fractionA1);
|
|
@@ -213,13 +212,13 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
213
212
|
return;
|
|
214
213
|
}
|
|
215
214
|
}
|
|
216
|
-
if (reversed)
|
|
217
|
-
pair.swapDetails();
|
|
218
215
|
// recompute the points just in case
|
|
219
216
|
CurveLocationDetail_1.CurveLocationDetail.createCurveEvaluatedFraction(cpA, globalFractionA, pair.detailA);
|
|
220
217
|
CurveLocationDetail_1.CurveLocationDetail.createCurveEvaluatedFraction(cpB, globalFractionB, pair.detailB);
|
|
221
218
|
pair.detailA.setIntervalRole(CurveLocationDetail_1.CurveIntervalRole.isolated);
|
|
222
219
|
pair.detailB.setIntervalRole(CurveLocationDetail_1.CurveIntervalRole.isolated);
|
|
220
|
+
if (reversed)
|
|
221
|
+
pair.swapDetails();
|
|
223
222
|
this._results.push(pair);
|
|
224
223
|
}
|
|
225
224
|
/**
|
|
@@ -227,7 +226,7 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
227
226
|
* @param cpA first curve primitive (possibly different from curve in detailA, but fraction compatible)
|
|
228
227
|
* @param cpB second curve primitive (possibly different from curve in detailA, but fraction compatible)
|
|
229
228
|
* @param pairs array of pairs
|
|
230
|
-
* @param reversed
|
|
229
|
+
* @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
|
|
231
230
|
*/
|
|
232
231
|
recordPairs(cpA, cpB, pairs, reversed) {
|
|
233
232
|
if (pairs !== undefined) {
|
|
@@ -240,7 +239,7 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
240
239
|
* Record fully assembled (but possibly reversed) detail pair.
|
|
241
240
|
* @param detailA first detail
|
|
242
241
|
* @param detailB second detail
|
|
243
|
-
* @param reversed
|
|
242
|
+
* @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
|
|
244
243
|
*/
|
|
245
244
|
captureDetailPair(detailA, detailB, reversed) {
|
|
246
245
|
if (detailA && detailB) {
|
|
@@ -269,7 +268,7 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
269
268
|
}
|
|
270
269
|
/**
|
|
271
270
|
* Return fractions of close approach within maxDistance between two line segments (a0,a1) and (b0,b1).
|
|
272
|
-
* * Math details can be found at
|
|
271
|
+
* * Math details can be found at core/geometry/internaldocs/Curve.md
|
|
273
272
|
* @param a0 start point of line a
|
|
274
273
|
* @param a1 end point of line a
|
|
275
274
|
* @param b0 start point of line b
|
|
@@ -342,7 +341,7 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
342
341
|
* @param fB0 fraction0 on curveB
|
|
343
342
|
* @param fB1 fraction0 on curveB
|
|
344
343
|
* @param testProjectionOnB whether to record projections of the given curveA points onto curveB
|
|
345
|
-
* @param reversed
|
|
344
|
+
* @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
|
|
346
345
|
*/
|
|
347
346
|
testAndRecordFractionalPairApproach(cpA, fA0, fA1, testProjectionOnA, cpB, fB0, fB1, testProjectionOnB, reversed) {
|
|
348
347
|
const pointA0 = cpA.fractionToPoint(fA0);
|
|
@@ -406,7 +405,7 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
406
405
|
* @param pointA1 end point of the segment
|
|
407
406
|
* @param fractionA1 fraction of the end of the segment
|
|
408
407
|
* @param arc the arc
|
|
409
|
-
* @param reversed
|
|
408
|
+
* @param reversed whether to reverse the details in the pair (e.g., so that detailB refers to geometryB).
|
|
410
409
|
*/
|
|
411
410
|
dispatchSegmentArc(cpA, pointA0, fractionA0, pointA1, fractionA1, arc, reversed) {
|
|
412
411
|
// 1) intersection between arc and segment
|
|
@@ -595,6 +594,39 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
595
594
|
}
|
|
596
595
|
this._geometryB = geomB; // restore
|
|
597
596
|
}
|
|
597
|
+
/**
|
|
598
|
+
* Given a parent chain, convert the corresponding child details so that they refer to the chain's global parameterization.
|
|
599
|
+
* * It is assumed that `this._results[i].detailA.curve` is a child of chainA, and similarly for detailB/chainB.
|
|
600
|
+
* @param chainA convert each detailA to the global parameterization of chainA
|
|
601
|
+
* @param chainB convert each detailB to the global parameterization of chainB
|
|
602
|
+
*/
|
|
603
|
+
convertChildDetailToChainDetail(chainA, chainB) {
|
|
604
|
+
for (const childDetailPair of this._results) {
|
|
605
|
+
if (chainA) {
|
|
606
|
+
const chainDetail = chainA.computeChainDetail(childDetailPair.detailA);
|
|
607
|
+
if (chainDetail)
|
|
608
|
+
childDetailPair.detailA = chainDetail;
|
|
609
|
+
}
|
|
610
|
+
if (chainB) {
|
|
611
|
+
const chainDetail = chainB.computeChainDetail(childDetailPair.detailB);
|
|
612
|
+
if (chainDetail)
|
|
613
|
+
childDetailPair.detailB = chainDetail;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
/** Low level dispatch to geomA given a CurveChainWithDistanceIndex in geometryB. */
|
|
618
|
+
dispatchCurveChainWithDistanceIndex(geomA, geomAHandler) {
|
|
619
|
+
if (!this._geometryB || !(this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex))
|
|
620
|
+
return;
|
|
621
|
+
const geomB = this._geometryB; // save
|
|
622
|
+
for (const child of geomB.path.children) {
|
|
623
|
+
this.resetGeometry(child);
|
|
624
|
+
geomAHandler(geomA);
|
|
625
|
+
}
|
|
626
|
+
this.resetGeometry(geomB); // restore
|
|
627
|
+
(0, core_bentley_1.assert)(!(geomA instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex));
|
|
628
|
+
this.convertChildDetailToChainDetail(undefined, geomB);
|
|
629
|
+
}
|
|
598
630
|
/** Double dispatch handler for strongly typed segment. */
|
|
599
631
|
handleLineSegment3d(segmentA) {
|
|
600
632
|
if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
|
|
@@ -613,6 +645,9 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
613
645
|
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
614
646
|
this.dispatchCurveCollection(segmentA, this.handleLineSegment3d.bind(this));
|
|
615
647
|
}
|
|
648
|
+
else if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
|
|
649
|
+
this.dispatchCurveChainWithDistanceIndex(segmentA, this.handleLineSegment3d.bind(this));
|
|
650
|
+
}
|
|
616
651
|
return undefined;
|
|
617
652
|
}
|
|
618
653
|
/**
|
|
@@ -709,6 +744,9 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
709
744
|
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
710
745
|
this.dispatchCurveCollection(lsA, this.handleLineString3d.bind(this));
|
|
711
746
|
}
|
|
747
|
+
else if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
|
|
748
|
+
this.dispatchCurveChainWithDistanceIndex(lsA, this.handleLineString3d.bind(this));
|
|
749
|
+
}
|
|
712
750
|
return undefined;
|
|
713
751
|
}
|
|
714
752
|
/** Double dispatch handler for strongly typed arc. */
|
|
@@ -728,6 +766,9 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
728
766
|
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
729
767
|
this.dispatchCurveCollection(arc0, this.handleArc3d.bind(this));
|
|
730
768
|
}
|
|
769
|
+
else if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
|
|
770
|
+
this.dispatchCurveChainWithDistanceIndex(arc0, this.handleArc3d.bind(this));
|
|
771
|
+
}
|
|
731
772
|
return undefined;
|
|
732
773
|
}
|
|
733
774
|
/** Double dispatch handler for strongly typed bspline curve. */
|
|
@@ -747,8 +788,16 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
|
|
|
747
788
|
else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
|
|
748
789
|
this.dispatchCurveCollection(curve, this.handleBSplineCurve3d.bind(this));
|
|
749
790
|
}
|
|
791
|
+
else if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
|
|
792
|
+
this.dispatchCurveChainWithDistanceIndex(curve, this.handleBSplineCurve3d.bind(this));
|
|
793
|
+
}
|
|
750
794
|
return undefined;
|
|
751
795
|
}
|
|
796
|
+
/** Double dispatch handler for strongly typed CurveChainWithDistanceIndex. */
|
|
797
|
+
handleCurveChainWithDistanceIndex(chain) {
|
|
798
|
+
super.handleCurveChainWithDistanceIndex(chain);
|
|
799
|
+
this.convertChildDetailToChainDetail(chain, this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex ? this._geometryB : undefined);
|
|
800
|
+
}
|
|
752
801
|
/** Double dispatch handler for strongly typed homogeneous bspline curve .. */
|
|
753
802
|
handleBSplineCurve3dH(_curve) {
|
|
754
803
|
/*
|