@itwin/core-geometry 4.2.0-dev.32 → 4.2.0-dev.34
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/CHANGELOG.md +6 -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 +6 -5
- 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/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/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/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 +6 -5
- 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/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/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/package.json +3 -3
|
@@ -51,15 +51,13 @@ exports.BezierBezierIntersectionXYRRToRRD = BezierBezierIntersectionXYRRToRRD;
|
|
|
51
51
|
* @internal
|
|
52
52
|
*/
|
|
53
53
|
class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
54
|
-
reinitialize() {
|
|
55
|
-
this._results = [];
|
|
56
|
-
}
|
|
57
54
|
/**
|
|
55
|
+
* The constructor.
|
|
58
56
|
* @param worldToLocal optional transform (possibly perspective) to project to xy plane for intersection.
|
|
59
|
-
* @param extendA flag
|
|
60
|
-
* @param geometryB second curve for intersection.
|
|
57
|
+
* @param extendA flag for extension of the other geometry.
|
|
58
|
+
* @param geometryB second curve for intersection. Saved for reference by specific handler methods.
|
|
61
59
|
* @param extendB flag for extension of geometryB.
|
|
62
|
-
* @param tolerance optional distance tolerance for coincidence
|
|
60
|
+
* @param tolerance optional distance tolerance for coincidence.
|
|
63
61
|
*/
|
|
64
62
|
constructor(worldToLocal, extendA, geometryB, extendB, tolerance = Geometry_1.Geometry.smallMetricDistance) {
|
|
65
63
|
super();
|
|
@@ -74,7 +72,7 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
74
72
|
this._worldToLocalPerspective = worldToLocal.clone();
|
|
75
73
|
}
|
|
76
74
|
this._coincidentGeometryContext = CoincidentGeometryOps_1.CoincidentGeometryQuery.create(tolerance);
|
|
77
|
-
this.
|
|
75
|
+
this._results = [];
|
|
78
76
|
}
|
|
79
77
|
/** Reset the geometry and flags, leaving all other parts unchanged (and preserving accumulated intersections) */
|
|
80
78
|
resetGeometry(extendA, geometryB, extendB) {
|
|
@@ -89,10 +87,7 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
89
87
|
return false;
|
|
90
88
|
return true;
|
|
91
89
|
}
|
|
92
|
-
/**
|
|
93
|
-
* Test the fraction by strict parameter, but allow toleranced distance test at ends.
|
|
94
|
-
* @param tolerance optional distance tolerance to check proximity to start/end point
|
|
95
|
-
*/
|
|
90
|
+
/** Test the fraction by strict parameter, but allow toleranced distance test at ends. */
|
|
96
91
|
acceptFractionOnLine(extend0, fraction, extend1, pointA, pointB, tolerance = Geometry_1.Geometry.smallMetricDistance) {
|
|
97
92
|
if (!extend0 && fraction < 0) {
|
|
98
93
|
return Geometry_1.Geometry.isDistanceWithinTol(fraction * pointA.distanceXY(pointB), tolerance);
|
|
@@ -102,25 +97,32 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
102
97
|
return true;
|
|
103
98
|
}
|
|
104
99
|
/**
|
|
105
|
-
*
|
|
100
|
+
* Return the results structure for the intersection calculation, structured as an array of CurveLocationDetailPair
|
|
106
101
|
* @param reinitialize if true, a new results structure is created for use by later calls.
|
|
107
102
|
*/
|
|
108
103
|
grabPairedResults(reinitialize = false) {
|
|
109
104
|
const result = this._results;
|
|
110
105
|
if (reinitialize)
|
|
111
|
-
this.
|
|
106
|
+
this._results = [];
|
|
112
107
|
return result;
|
|
113
108
|
}
|
|
114
109
|
sameCurveAndFraction(cp, fraction, detail) {
|
|
115
110
|
return cp === detail.curve && Geometry_1.Geometry.isAlmostEqualNumber(fraction, detail.fraction);
|
|
116
111
|
}
|
|
117
112
|
/**
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
113
|
+
* Record the pre-computed intersection between two curves. Filter by extension rules. Record with fraction mapping.
|
|
114
|
+
* @param localFractionA intersection fraction local to the subcurve of cpA between fractionA0 and fractionA1
|
|
115
|
+
* @param cpA the first curve
|
|
116
|
+
* @param fractionA0 start of the subcurve of cpA
|
|
117
|
+
* @param fractionA1 end of the subcurve of cpA
|
|
118
|
+
* @param localFractionB intersection fraction local to the subcurve of cpB between fractionB0 and fractionB1
|
|
119
|
+
* @param cpB the second curve
|
|
120
|
+
* @param fractionB0 start of the subcurve of cpB
|
|
121
|
+
* @param fractionB1 end of the subcurve of cpB
|
|
122
|
+
* @param reversed whether to reverse the details in the recorded intersection pair
|
|
123
|
+
* @param intervalDetails optional data for a coincident segment intersection
|
|
121
124
|
*/
|
|
122
|
-
recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB,
|
|
123
|
-
cpB, fractionB0, fractionB1, reversed, intervalDetails) {
|
|
125
|
+
recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, cpB, fractionB0, fractionB1, reversed, intervalDetails) {
|
|
124
126
|
let globalFractionA, globalFractionB;
|
|
125
127
|
let globalFractionA1, globalFractionB1;
|
|
126
128
|
const isInterval = intervalDetails !== undefined &&
|
|
@@ -136,7 +138,7 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
136
138
|
globalFractionA = globalFractionA1 = Geometry_1.Geometry.interpolate(fractionA0, localFractionA, fractionA1);
|
|
137
139
|
globalFractionB = globalFractionB1 = Geometry_1.Geometry.interpolate(fractionB0, localFractionB, fractionB1);
|
|
138
140
|
}
|
|
139
|
-
// ignore duplicate of most recent
|
|
141
|
+
// ignore duplicate of most recent pair
|
|
140
142
|
const numPrevious = this._results.length;
|
|
141
143
|
if (numPrevious > 0 && !isInterval) {
|
|
142
144
|
const oldDetailA = this._results[numPrevious - 1].detailA;
|
|
@@ -170,10 +172,10 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
170
172
|
}
|
|
171
173
|
}
|
|
172
174
|
/**
|
|
173
|
-
* Emit recordPoint for multiple pairs (on full curve
|
|
174
|
-
* @param cpA first curve primitive (possibly different from curve in detailA, but fraction compatible)
|
|
175
|
-
* @param cpB second curve primitive (possibly different from curve in detailA, but fraction compatible)
|
|
176
|
-
* @param pairs array of pairs
|
|
175
|
+
* Emit recordPoint for multiple pairs (on full curve).
|
|
176
|
+
* @param cpA first curve primitive (possibly different from curve in detailA, but fraction compatible).
|
|
177
|
+
* @param cpB second curve primitive (possibly different from curve in detailA, but fraction compatible).
|
|
178
|
+
* @param pairs array of pairs.
|
|
177
179
|
* @param reversed true to have order reversed in final structures.
|
|
178
180
|
*/
|
|
179
181
|
recordPairs(cpA, cpB, pairs, reversed) {
|
|
@@ -183,11 +185,7 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
183
185
|
}
|
|
184
186
|
}
|
|
185
187
|
}
|
|
186
|
-
/**
|
|
187
|
-
* Compute intersection of two line segments.
|
|
188
|
-
* Filter by extension rules.
|
|
189
|
-
* Record with fraction mapping.
|
|
190
|
-
*/
|
|
188
|
+
/** Compute intersection of two line segments. Filter by extension rules. Record with fraction mapping. */
|
|
191
189
|
computeSegmentSegment3D(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {
|
|
192
190
|
const uv = CurveCurveIntersectXY._workVector2dA;
|
|
193
191
|
// Problem: Normal practice is to do the (quick, simple) transverse intersection first
|
|
@@ -205,7 +203,10 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
205
203
|
}
|
|
206
204
|
}
|
|
207
205
|
}
|
|
208
|
-
|
|
206
|
+
/**
|
|
207
|
+
* Compute intersection of projected homogeneous line segments. Filter by extension rules. Record with
|
|
208
|
+
* fraction mapping. Assumes caller knows the _worldToLocal is present.
|
|
209
|
+
*/
|
|
209
210
|
computeSegmentSegment3DH(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {
|
|
210
211
|
const hA0 = CurveCurveIntersectXY._workPointA0H;
|
|
211
212
|
const hA1 = CurveCurveIntersectXY._workPointA1H;
|
|
@@ -226,8 +227,8 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
226
227
|
}
|
|
227
228
|
}
|
|
228
229
|
// Caller accesses data from a line segment and passes to here.
|
|
229
|
-
//
|
|
230
|
-
// The fraction and extend parameters allow all combinations to be passed in
|
|
230
|
+
// The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
|
|
231
|
+
// The fraction and extend parameters allow all combinations to be passed in.
|
|
231
232
|
// This method applies transform.
|
|
232
233
|
dispatchSegmentSegment(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {
|
|
233
234
|
if (this._worldToLocalAffine) {
|
|
@@ -243,14 +244,14 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
243
244
|
}
|
|
244
245
|
}
|
|
245
246
|
// Caller accesses data from a linestring or segment and passes it here.
|
|
246
|
-
//
|
|
247
|
-
// The fraction and extend parameters allow all combinations to be passed in
|
|
247
|
+
// The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
|
|
248
|
+
// The fraction and extend parameters allow all combinations to be passed in.
|
|
248
249
|
dispatchSegmentArc(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, arc, extendB0, extendB1, reversed) {
|
|
249
250
|
// Arc: X = C + cU + sV
|
|
250
251
|
// Line: contains points A0,A1
|
|
251
252
|
// Arc point colinear with line if det (A0, A1, X) = 0
|
|
252
253
|
// with homogeneous xyw points and vectors.
|
|
253
|
-
// With equational X:
|
|
254
|
+
// With equational X: det (A0, A1, C) + c det (A0, A1,U) + s det (A0, A1, V) = 0.
|
|
254
255
|
// solve for theta.
|
|
255
256
|
// evaluate points.
|
|
256
257
|
// project back to line.
|
|
@@ -306,9 +307,9 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
306
307
|
}
|
|
307
308
|
}
|
|
308
309
|
// Caller accesses data from two arcs.
|
|
309
|
-
//
|
|
310
|
-
//
|
|
311
|
-
//
|
|
310
|
+
// Each matrix has [U V C] in (x,y,w) form from projection.
|
|
311
|
+
// Invert the projection matrix matrixA.
|
|
312
|
+
// Apply the inverse to matrixB. Then arc b is an ellipse in the circular space of A.
|
|
312
313
|
dispatchArcArcThisOrder(cpA, matrixA, // homogeneous xyw projection !!!
|
|
313
314
|
extendA, cpB, matrixB, // homogeneous xyw projection !!!
|
|
314
315
|
extendB, reversed) {
|
|
@@ -332,8 +333,8 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
332
333
|
}
|
|
333
334
|
}
|
|
334
335
|
// Caller accesses data from two arcs.
|
|
335
|
-
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
336
|
-
// Solves the arc-arc equations
|
|
336
|
+
// Selects the best conditioned arc (in xy parts) as "circle after inversion".
|
|
337
|
+
// Solves the arc-arc equations.
|
|
337
338
|
dispatchArcArc(cpA, extendA, cpB, extendB, reversed) {
|
|
338
339
|
// Arc: X = C + cU + sV
|
|
339
340
|
// Line: contains points A0,A1
|
|
@@ -379,9 +380,6 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
379
380
|
this.recordPairs(cpA, cpB, pairs, reversed);
|
|
380
381
|
}
|
|
381
382
|
}
|
|
382
|
-
// Caller accesses data from two arcs.
|
|
383
|
-
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
384
|
-
// Solves the arc-arc equations
|
|
385
383
|
dispatchArcBsplineCurve3d(cpA, extendA, cpB, extendB, reversed) {
|
|
386
384
|
// Arc: X = C + cU + sV
|
|
387
385
|
// implicitize the arc as viewed. This "3d" matrix is homogeneous "XYW" not "xyz"
|
|
@@ -452,7 +450,7 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
452
450
|
}
|
|
453
451
|
}
|
|
454
452
|
}
|
|
455
|
-
/** Apply the transformation to bezier curves.
|
|
453
|
+
/** Apply the transformation to bezier curves. Optionally construct ranges. */
|
|
456
454
|
transformBeziers(beziers) {
|
|
457
455
|
if (this._worldToLocalAffine) {
|
|
458
456
|
for (const bezier of beziers)
|
|
@@ -492,8 +490,9 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
492
490
|
const s = bcurvePoint4d.dotProductXYZW(ayx, ayy, ayz, ayw);
|
|
493
491
|
const arcFraction = cpA.sweep.radiansToSignedPeriodicFraction(Math.atan2(s, c));
|
|
494
492
|
if (this.acceptFraction(extendA, arcFraction, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {
|
|
495
|
-
this.recordPointWithLocalFractions(
|
|
496
|
-
fractionB, cpB, 0, 1, reversed
|
|
493
|
+
this.recordPointWithLocalFractions(
|
|
494
|
+
arcFraction, cpA, 0, 1, fractionB, cpB, 0, 1, reversed,
|
|
495
|
+
);
|
|
497
496
|
}
|
|
498
497
|
}
|
|
499
498
|
*/
|
|
@@ -509,7 +508,7 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
509
508
|
bezierB.poleProductsXYZW(univariateBezierB.coffs, this._xyzwPlane.x, this._xyzwPlane.y, this._xyzwPlane.z, this._xyzwPlane.w);
|
|
510
509
|
let errors = 0;
|
|
511
510
|
const roots = univariateBezierB.roots(0.0, true);
|
|
512
|
-
if (roots)
|
|
511
|
+
if (roots) {
|
|
513
512
|
for (const r of roots) {
|
|
514
513
|
let bezierBFraction = r;
|
|
515
514
|
bezierB.fractionToPoint4d(bezierBFraction, this._xyzwB);
|
|
@@ -546,11 +545,9 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
546
545
|
}
|
|
547
546
|
}
|
|
548
547
|
}
|
|
548
|
+
}
|
|
549
549
|
}
|
|
550
550
|
}
|
|
551
|
-
// Caller accesses data from two arcs.
|
|
552
|
-
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
553
|
-
// Solves the arc-arc equations
|
|
554
551
|
dispatchBSplineCurve3dBSplineCurve3d(bcurveA, bcurveB, _reversed) {
|
|
555
552
|
const bezierSpanA = bcurveA.collectBezierSpans(true);
|
|
556
553
|
const bezierSpanB = bcurveB.collectBezierSpans(true);
|
|
@@ -578,9 +575,9 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
578
575
|
}
|
|
579
576
|
}
|
|
580
577
|
/**
|
|
581
|
-
* Apply the projection transform (if any) to (xyz, w)
|
|
578
|
+
* Apply the projection transform (if any) to (xyz, w).
|
|
582
579
|
* @param xyz xyz parts of input point.
|
|
583
|
-
* @param w weight to use for homogeneous effects
|
|
580
|
+
* @param w weight to use for homogeneous effects.
|
|
584
581
|
*/
|
|
585
582
|
projectPoint(xyz, w = 1.0) {
|
|
586
583
|
if (this._worldToLocalPerspective)
|
|
@@ -605,9 +602,9 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
605
602
|
npcPlane.clone(worldPlane);
|
|
606
603
|
}
|
|
607
604
|
}
|
|
608
|
-
// Caller accesses data from segment and bsplineCurve
|
|
609
|
-
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
610
|
-
// Solves the arc-arc equations
|
|
605
|
+
// Caller accesses data from segment and bsplineCurve.
|
|
606
|
+
// Selects the best conditioned arc (in xy parts) as "circle after inversion".
|
|
607
|
+
// Solves the arc-arc equations.
|
|
611
608
|
dispatchSegmentBsplineCurve(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, bcurve, extendB, reversed) {
|
|
612
609
|
const pointA0H = this.projectPoint(pointA0);
|
|
613
610
|
const pointA1H = this.projectPoint(pointA1);
|
|
@@ -689,6 +686,38 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
689
686
|
}
|
|
690
687
|
return undefined;
|
|
691
688
|
}
|
|
689
|
+
/** Detail computation for linestring intersecting linestring. */
|
|
690
|
+
computeLineStringLineString(lsA, lsB, reversed) {
|
|
691
|
+
const pointA0 = CurveCurveIntersectXY._workPointAA0;
|
|
692
|
+
const pointA1 = CurveCurveIntersectXY._workPointAA1;
|
|
693
|
+
const pointB0 = CurveCurveIntersectXY._workPointBB0;
|
|
694
|
+
const pointB1 = CurveCurveIntersectXY._workPointBB1;
|
|
695
|
+
const numA = lsA.numPoints();
|
|
696
|
+
const numB = lsB.numPoints();
|
|
697
|
+
if (numA > 1 && numB > 1) {
|
|
698
|
+
lsA.pointAt(0, pointA0);
|
|
699
|
+
const dfA = 1.0 / (numA - 1);
|
|
700
|
+
const dfB = 1.0 / (numB - 1);
|
|
701
|
+
let fA0 = 0.0;
|
|
702
|
+
let fB0;
|
|
703
|
+
let fA1;
|
|
704
|
+
let fB1;
|
|
705
|
+
const extendA = this._extendA;
|
|
706
|
+
const extendB = this._extendB;
|
|
707
|
+
lsA.pointAt(0, pointA0);
|
|
708
|
+
for (let ia = 1; ia < numA; ia++, pointA0.setFrom(pointA1), fA0 = fA1) {
|
|
709
|
+
fA1 = ia * dfA;
|
|
710
|
+
fB0 = 0.0;
|
|
711
|
+
lsA.pointAt(ia, pointA1);
|
|
712
|
+
lsB.pointAt(0, pointB0);
|
|
713
|
+
for (let ib = 1; ib < numB; ib++, pointB0.setFrom(pointB1), fB0 = fB1) {
|
|
714
|
+
lsB.pointAt(ib, pointB1);
|
|
715
|
+
fB1 = ib * dfB;
|
|
716
|
+
this.dispatchSegmentSegment(lsA, ia === 1 && extendA, pointA0, fA0, pointA1, fA1, (ia + 1) === numA && extendA, lsB, ib === 1 && extendB, pointB0, fB0, pointB1, fB1, (ib + 1) === numB && extendB, reversed);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
}
|
|
692
721
|
static setTransformedWorkPoints(transform, pointA0, pointA1, pointB0, pointB1) {
|
|
693
722
|
transform.multiplyPoint3d(pointA0, this._workPointA0);
|
|
694
723
|
transform.multiplyPoint3d(pointA1, this._workPointA1);
|
|
@@ -710,40 +739,13 @@ class CurveCurveIntersectXY extends GeometryHandler_1.NullGeometryHandler {
|
|
|
710
739
|
else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3d) {
|
|
711
740
|
this.dispatchSegmentBsplineCurve(segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA, this._geometryB, this._extendB, false);
|
|
712
741
|
}
|
|
742
|
+
return undefined;
|
|
713
743
|
}
|
|
714
744
|
/** Double dispatch handler for strongly typed linestring. */
|
|
715
745
|
handleLineString3d(lsA) {
|
|
716
746
|
if (this._geometryB instanceof LineString3d_1.LineString3d) {
|
|
717
747
|
const lsB = this._geometryB;
|
|
718
|
-
|
|
719
|
-
const pointA1 = CurveCurveIntersectXY._workPointAA1;
|
|
720
|
-
const pointB0 = CurveCurveIntersectXY._workPointBB0;
|
|
721
|
-
const pointB1 = CurveCurveIntersectXY._workPointBB1;
|
|
722
|
-
const numA = lsA.numPoints();
|
|
723
|
-
const numB = lsB.numPoints();
|
|
724
|
-
if (numA > 1 && numB > 1) {
|
|
725
|
-
lsA.pointAt(0, pointA0);
|
|
726
|
-
const dfA = 1.0 / (numA - 1);
|
|
727
|
-
const dfB = 1.0 / (numB - 1);
|
|
728
|
-
let fA0 = 0.0;
|
|
729
|
-
let fB0;
|
|
730
|
-
let fA1;
|
|
731
|
-
let fB1;
|
|
732
|
-
const extendA = this._extendA;
|
|
733
|
-
const extendB = this._extendB;
|
|
734
|
-
lsA.pointAt(0, pointA0);
|
|
735
|
-
for (let ia = 1; ia < numA; ia++, pointA0.setFrom(pointA1), fA0 = fA1) {
|
|
736
|
-
fA1 = ia * dfA;
|
|
737
|
-
fB0 = 0.0;
|
|
738
|
-
lsA.pointAt(ia, pointA1);
|
|
739
|
-
lsB.pointAt(0, pointB0);
|
|
740
|
-
for (let ib = 1; ib < numB; ib++, pointB0.setFrom(pointB1), fB0 = fB1) {
|
|
741
|
-
lsB.pointAt(ib, pointB1);
|
|
742
|
-
fB1 = ib * dfB;
|
|
743
|
-
this.dispatchSegmentSegment(lsA, ia === 1 && extendA, pointA0, fA0, pointA1, fA1, (ia + 1) === numA && extendA, lsB, ib === 1 && extendB, pointB0, fB0, pointB1, fB1, (ib + 1) === numB && extendB, false);
|
|
744
|
-
}
|
|
745
|
-
}
|
|
746
|
-
}
|
|
748
|
+
this.computeLineStringLineString(lsA, lsB, false);
|
|
747
749
|
}
|
|
748
750
|
else if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
|
|
749
751
|
this.computeSegmentLineString(this._geometryB, this._extendB, lsA, this._extendA, true);
|