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