@itwin/rpcinterface-full-stack-tests 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/dist/_0062.bundled-tests.js.map +1 -1
- package/lib/dist/bundled-tests.js +284 -232
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_4_7_node_modules_loaders_gl_draco_di-02c2bd.bundled-tests.js.map +1 -1
- package/package.json +13 -13
|
@@ -186933,10 +186933,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
186933
186933
|
/* harmony export */ });
|
|
186934
186934
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
186935
186935
|
/* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
186936
|
+
/* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
|
|
186936
186937
|
/* harmony import */ var _internalContexts_CurveCurveCloseApproachXY__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./internalContexts/CurveCurveCloseApproachXY */ "../../core/geometry/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js");
|
|
186937
186938
|
/* harmony import */ var _internalContexts_CurveCurveIntersectXY__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./internalContexts/CurveCurveIntersectXY */ "../../core/geometry/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js");
|
|
186938
186939
|
/* harmony import */ var _internalContexts_CurveCurveIntersectXYZ__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./internalContexts/CurveCurveIntersectXYZ */ "../../core/geometry/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js");
|
|
186939
|
-
/* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
|
|
186940
186940
|
/*---------------------------------------------------------------------------------------------
|
|
186941
186941
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
186942
186942
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -186979,6 +186979,7 @@ class CurveCurve {
|
|
|
186979
186979
|
}
|
|
186980
186980
|
/**
|
|
186981
186981
|
* Return xy intersections of 2 projected curves.
|
|
186982
|
+
* @param worldToLocal transform (possibly perspective) defining the local coordinates in which to compute xy intersections.
|
|
186982
186983
|
* @param curveA first curve
|
|
186983
186984
|
* @param extendA true to allow curveA to extend
|
|
186984
186985
|
* @param curveB second curve
|
|
@@ -186991,19 +186992,20 @@ class CurveCurve {
|
|
|
186991
186992
|
return handler.grabPairedResults();
|
|
186992
186993
|
}
|
|
186993
186994
|
/**
|
|
186994
|
-
|
|
186995
|
-
|
|
186996
|
-
|
|
186997
|
-
|
|
186998
|
-
|
|
186999
|
-
|
|
187000
|
-
|
|
187001
|
-
|
|
187002
|
-
|
|
187003
|
-
|
|
186995
|
+
* Return full 3d xyz intersections of 2 curves.
|
|
186996
|
+
* * Implemented for combinations of LineSegment3d, LineString3d, Arc3d.
|
|
186997
|
+
* * Not Implemented for bspline and bezier curves.
|
|
186998
|
+
* @beta
|
|
186999
|
+
* @param curveA first curve
|
|
187000
|
+
* @param extendA true to allow curveA to extend
|
|
187001
|
+
* @param curveB second curve
|
|
187002
|
+
* @param extendB true to allow curveB to extend
|
|
187003
|
+
* @returns array of intersections structured as CurveLocationDetailPair[]
|
|
187004
|
+
*/
|
|
187005
|
+
static intersectionXYZPairs(curveA, extendA, curveB, extendB) {
|
|
187004
187006
|
const handler = new _internalContexts_CurveCurveIntersectXYZ__WEBPACK_IMPORTED_MODULE_4__.CurveCurveIntersectXYZ(extendA, curveB, extendB);
|
|
187005
187007
|
curveA.dispatchToGeometryHandler(handler);
|
|
187006
|
-
return handler.
|
|
187008
|
+
return handler.grabPairedResults();
|
|
187007
187009
|
}
|
|
187008
187010
|
/**
|
|
187009
187011
|
* Return xy intersections of input curves.
|
|
@@ -188233,7 +188235,8 @@ class CurveLocationDetailPair {
|
|
|
188233
188235
|
}
|
|
188234
188236
|
}
|
|
188235
188237
|
/**
|
|
188236
|
-
* Data bundle for a pair of arrays of CurveLocationDetail structures
|
|
188238
|
+
* Data bundle for a pair of arrays of CurveLocationDetail structures.
|
|
188239
|
+
* @deprecated in 4.x. Use CurveLocationDetailPair[] instead.
|
|
188237
188240
|
* @public
|
|
188238
188241
|
*/
|
|
188239
188242
|
class CurveLocationDetailArrayPair {
|
|
@@ -197303,15 +197306,13 @@ class BezierBezierIntersectionXYRRToRRD extends _numerics_Newton__WEBPACK_IMPORT
|
|
|
197303
197306
|
* @internal
|
|
197304
197307
|
*/
|
|
197305
197308
|
class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_2__.NullGeometryHandler {
|
|
197306
|
-
reinitialize() {
|
|
197307
|
-
this._results = [];
|
|
197308
|
-
}
|
|
197309
197309
|
/**
|
|
197310
|
+
* The constructor.
|
|
197310
197311
|
* @param worldToLocal optional transform (possibly perspective) to project to xy plane for intersection.
|
|
197311
|
-
* @param extendA flag
|
|
197312
|
-
* @param geometryB second curve for intersection.
|
|
197312
|
+
* @param extendA flag for extension of the other geometry.
|
|
197313
|
+
* @param geometryB second curve for intersection. Saved for reference by specific handler methods.
|
|
197313
197314
|
* @param extendB flag for extension of geometryB.
|
|
197314
|
-
* @param tolerance optional distance tolerance for coincidence
|
|
197315
|
+
* @param tolerance optional distance tolerance for coincidence.
|
|
197315
197316
|
*/
|
|
197316
197317
|
constructor(worldToLocal, extendA, geometryB, extendB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance) {
|
|
197317
197318
|
super();
|
|
@@ -197326,7 +197327,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197326
197327
|
this._worldToLocalPerspective = worldToLocal.clone();
|
|
197327
197328
|
}
|
|
197328
197329
|
this._coincidentGeometryContext = _geometry3d_CoincidentGeometryOps__WEBPACK_IMPORTED_MODULE_4__.CoincidentGeometryQuery.create(tolerance);
|
|
197329
|
-
this.
|
|
197330
|
+
this._results = [];
|
|
197330
197331
|
}
|
|
197331
197332
|
/** Reset the geometry and flags, leaving all other parts unchanged (and preserving accumulated intersections) */
|
|
197332
197333
|
resetGeometry(extendA, geometryB, extendB) {
|
|
@@ -197341,10 +197342,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197341
197342
|
return false;
|
|
197342
197343
|
return true;
|
|
197343
197344
|
}
|
|
197344
|
-
/**
|
|
197345
|
-
* Test the fraction by strict parameter, but allow toleranced distance test at ends.
|
|
197346
|
-
* @param tolerance optional distance tolerance to check proximity to start/end point
|
|
197347
|
-
*/
|
|
197345
|
+
/** Test the fraction by strict parameter, but allow toleranced distance test at ends. */
|
|
197348
197346
|
acceptFractionOnLine(extend0, fraction, extend1, pointA, pointB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance) {
|
|
197349
197347
|
if (!extend0 && fraction < 0) {
|
|
197350
197348
|
return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isDistanceWithinTol(fraction * pointA.distanceXY(pointB), tolerance);
|
|
@@ -197354,25 +197352,32 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197354
197352
|
return true;
|
|
197355
197353
|
}
|
|
197356
197354
|
/**
|
|
197357
|
-
*
|
|
197355
|
+
* Return the results structure for the intersection calculation, structured as an array of CurveLocationDetailPair
|
|
197358
197356
|
* @param reinitialize if true, a new results structure is created for use by later calls.
|
|
197359
197357
|
*/
|
|
197360
197358
|
grabPairedResults(reinitialize = false) {
|
|
197361
197359
|
const result = this._results;
|
|
197362
197360
|
if (reinitialize)
|
|
197363
|
-
this.
|
|
197361
|
+
this._results = [];
|
|
197364
197362
|
return result;
|
|
197365
197363
|
}
|
|
197366
197364
|
sameCurveAndFraction(cp, fraction, detail) {
|
|
197367
197365
|
return cp === detail.curve && _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isAlmostEqualNumber(fraction, detail.fraction);
|
|
197368
197366
|
}
|
|
197369
197367
|
/**
|
|
197370
|
-
*
|
|
197371
|
-
*
|
|
197372
|
-
*
|
|
197368
|
+
* Record the pre-computed intersection between two curves. Filter by extension rules. Record with fraction mapping.
|
|
197369
|
+
* @param localFractionA intersection fraction local to the subcurve of cpA between fractionA0 and fractionA1
|
|
197370
|
+
* @param cpA the first curve
|
|
197371
|
+
* @param fractionA0 start of the subcurve of cpA
|
|
197372
|
+
* @param fractionA1 end of the subcurve of cpA
|
|
197373
|
+
* @param localFractionB intersection fraction local to the subcurve of cpB between fractionB0 and fractionB1
|
|
197374
|
+
* @param cpB the second curve
|
|
197375
|
+
* @param fractionB0 start of the subcurve of cpB
|
|
197376
|
+
* @param fractionB1 end of the subcurve of cpB
|
|
197377
|
+
* @param reversed whether to reverse the details in the recorded intersection pair
|
|
197378
|
+
* @param intervalDetails optional data for a coincident segment intersection
|
|
197373
197379
|
*/
|
|
197374
|
-
recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB,
|
|
197375
|
-
cpB, fractionB0, fractionB1, reversed, intervalDetails) {
|
|
197380
|
+
recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, cpB, fractionB0, fractionB1, reversed, intervalDetails) {
|
|
197376
197381
|
let globalFractionA, globalFractionB;
|
|
197377
197382
|
let globalFractionA1, globalFractionB1;
|
|
197378
197383
|
const isInterval = intervalDetails !== undefined &&
|
|
@@ -197388,7 +197393,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197388
197393
|
globalFractionA = globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionA0, localFractionA, fractionA1);
|
|
197389
197394
|
globalFractionB = globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionB0, localFractionB, fractionB1);
|
|
197390
197395
|
}
|
|
197391
|
-
// ignore duplicate of most recent
|
|
197396
|
+
// ignore duplicate of most recent pair
|
|
197392
197397
|
const numPrevious = this._results.length;
|
|
197393
197398
|
if (numPrevious > 0 && !isInterval) {
|
|
197394
197399
|
const oldDetailA = this._results[numPrevious - 1].detailA;
|
|
@@ -197422,10 +197427,10 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197422
197427
|
}
|
|
197423
197428
|
}
|
|
197424
197429
|
/**
|
|
197425
|
-
* Emit recordPoint for multiple pairs (on full curve
|
|
197426
|
-
* @param cpA first curve primitive (possibly different from curve in detailA, but fraction compatible)
|
|
197427
|
-
* @param cpB second curve primitive (possibly different from curve in detailA, but fraction compatible)
|
|
197428
|
-
* @param pairs array of pairs
|
|
197430
|
+
* Emit recordPoint for multiple pairs (on full curve).
|
|
197431
|
+
* @param cpA first curve primitive (possibly different from curve in detailA, but fraction compatible).
|
|
197432
|
+
* @param cpB second curve primitive (possibly different from curve in detailA, but fraction compatible).
|
|
197433
|
+
* @param pairs array of pairs.
|
|
197429
197434
|
* @param reversed true to have order reversed in final structures.
|
|
197430
197435
|
*/
|
|
197431
197436
|
recordPairs(cpA, cpB, pairs, reversed) {
|
|
@@ -197435,11 +197440,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197435
197440
|
}
|
|
197436
197441
|
}
|
|
197437
197442
|
}
|
|
197438
|
-
/**
|
|
197439
|
-
* Compute intersection of two line segments.
|
|
197440
|
-
* Filter by extension rules.
|
|
197441
|
-
* Record with fraction mapping.
|
|
197442
|
-
*/
|
|
197443
|
+
/** Compute intersection of two line segments. Filter by extension rules. Record with fraction mapping. */
|
|
197443
197444
|
computeSegmentSegment3D(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {
|
|
197444
197445
|
const uv = CurveCurveIntersectXY._workVector2dA;
|
|
197445
197446
|
// Problem: Normal practice is to do the (quick, simple) transverse intersection first
|
|
@@ -197457,7 +197458,10 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197457
197458
|
}
|
|
197458
197459
|
}
|
|
197459
197460
|
}
|
|
197460
|
-
|
|
197461
|
+
/**
|
|
197462
|
+
* Compute intersection of projected homogeneous line segments. Filter by extension rules. Record with
|
|
197463
|
+
* fraction mapping. Assumes caller knows the _worldToLocal is present.
|
|
197464
|
+
*/
|
|
197461
197465
|
computeSegmentSegment3DH(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {
|
|
197462
197466
|
const hA0 = CurveCurveIntersectXY._workPointA0H;
|
|
197463
197467
|
const hA1 = CurveCurveIntersectXY._workPointA1H;
|
|
@@ -197478,8 +197482,8 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197478
197482
|
}
|
|
197479
197483
|
}
|
|
197480
197484
|
// Caller accesses data from a line segment and passes to here.
|
|
197481
|
-
//
|
|
197482
|
-
// The fraction and extend parameters allow all combinations to be passed in
|
|
197485
|
+
// The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
|
|
197486
|
+
// The fraction and extend parameters allow all combinations to be passed in.
|
|
197483
197487
|
// This method applies transform.
|
|
197484
197488
|
dispatchSegmentSegment(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {
|
|
197485
197489
|
if (this._worldToLocalAffine) {
|
|
@@ -197495,14 +197499,14 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197495
197499
|
}
|
|
197496
197500
|
}
|
|
197497
197501
|
// Caller accesses data from a linestring or segment and passes it here.
|
|
197498
|
-
//
|
|
197499
|
-
// The fraction and extend parameters allow all combinations to be passed in
|
|
197502
|
+
// The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
|
|
197503
|
+
// The fraction and extend parameters allow all combinations to be passed in.
|
|
197500
197504
|
dispatchSegmentArc(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, arc, extendB0, extendB1, reversed) {
|
|
197501
197505
|
// Arc: X = C + cU + sV
|
|
197502
197506
|
// Line: contains points A0,A1
|
|
197503
197507
|
// Arc point colinear with line if det (A0, A1, X) = 0
|
|
197504
197508
|
// with homogeneous xyw points and vectors.
|
|
197505
|
-
// With equational X:
|
|
197509
|
+
// With equational X: det (A0, A1, C) + c det (A0, A1,U) + s det (A0, A1, V) = 0.
|
|
197506
197510
|
// solve for theta.
|
|
197507
197511
|
// evaluate points.
|
|
197508
197512
|
// project back to line.
|
|
@@ -197558,9 +197562,9 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197558
197562
|
}
|
|
197559
197563
|
}
|
|
197560
197564
|
// Caller accesses data from two arcs.
|
|
197561
|
-
//
|
|
197562
|
-
//
|
|
197563
|
-
//
|
|
197565
|
+
// Each matrix has [U V C] in (x,y,w) form from projection.
|
|
197566
|
+
// Invert the projection matrix matrixA.
|
|
197567
|
+
// Apply the inverse to matrixB. Then arc b is an ellipse in the circular space of A.
|
|
197564
197568
|
dispatchArcArcThisOrder(cpA, matrixA, // homogeneous xyw projection !!!
|
|
197565
197569
|
extendA, cpB, matrixB, // homogeneous xyw projection !!!
|
|
197566
197570
|
extendB, reversed) {
|
|
@@ -197584,8 +197588,8 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197584
197588
|
}
|
|
197585
197589
|
}
|
|
197586
197590
|
// Caller accesses data from two arcs.
|
|
197587
|
-
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
197588
|
-
// Solves the arc-arc equations
|
|
197591
|
+
// Selects the best conditioned arc (in xy parts) as "circle after inversion".
|
|
197592
|
+
// Solves the arc-arc equations.
|
|
197589
197593
|
dispatchArcArc(cpA, extendA, cpB, extendB, reversed) {
|
|
197590
197594
|
// Arc: X = C + cU + sV
|
|
197591
197595
|
// Line: contains points A0,A1
|
|
@@ -197631,9 +197635,6 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197631
197635
|
this.recordPairs(cpA, cpB, pairs, reversed);
|
|
197632
197636
|
}
|
|
197633
197637
|
}
|
|
197634
|
-
// Caller accesses data from two arcs.
|
|
197635
|
-
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
197636
|
-
// Solves the arc-arc equations
|
|
197637
197638
|
dispatchArcBsplineCurve3d(cpA, extendA, cpB, extendB, reversed) {
|
|
197638
197639
|
// Arc: X = C + cU + sV
|
|
197639
197640
|
// implicitize the arc as viewed. This "3d" matrix is homogeneous "XYW" not "xyz"
|
|
@@ -197704,7 +197705,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197704
197705
|
}
|
|
197705
197706
|
}
|
|
197706
197707
|
}
|
|
197707
|
-
/** Apply the transformation to bezier curves.
|
|
197708
|
+
/** Apply the transformation to bezier curves. Optionally construct ranges. */
|
|
197708
197709
|
transformBeziers(beziers) {
|
|
197709
197710
|
if (this._worldToLocalAffine) {
|
|
197710
197711
|
for (const bezier of beziers)
|
|
@@ -197744,8 +197745,9 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197744
197745
|
const s = bcurvePoint4d.dotProductXYZW(ayx, ayy, ayz, ayw);
|
|
197745
197746
|
const arcFraction = cpA.sweep.radiansToSignedPeriodicFraction(Math.atan2(s, c));
|
|
197746
197747
|
if (this.acceptFraction(extendA, arcFraction, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {
|
|
197747
|
-
this.recordPointWithLocalFractions(
|
|
197748
|
-
fractionB, cpB, 0, 1, reversed
|
|
197748
|
+
this.recordPointWithLocalFractions(
|
|
197749
|
+
arcFraction, cpA, 0, 1, fractionB, cpB, 0, 1, reversed,
|
|
197750
|
+
);
|
|
197749
197751
|
}
|
|
197750
197752
|
}
|
|
197751
197753
|
*/
|
|
@@ -197761,7 +197763,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197761
197763
|
bezierB.poleProductsXYZW(univariateBezierB.coffs, this._xyzwPlane.x, this._xyzwPlane.y, this._xyzwPlane.z, this._xyzwPlane.w);
|
|
197762
197764
|
let errors = 0;
|
|
197763
197765
|
const roots = univariateBezierB.roots(0.0, true);
|
|
197764
|
-
if (roots)
|
|
197766
|
+
if (roots) {
|
|
197765
197767
|
for (const r of roots) {
|
|
197766
197768
|
let bezierBFraction = r;
|
|
197767
197769
|
bezierB.fractionToPoint4d(bezierBFraction, this._xyzwB);
|
|
@@ -197798,11 +197800,9 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197798
197800
|
}
|
|
197799
197801
|
}
|
|
197800
197802
|
}
|
|
197803
|
+
}
|
|
197801
197804
|
}
|
|
197802
197805
|
}
|
|
197803
|
-
// Caller accesses data from two arcs.
|
|
197804
|
-
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
197805
|
-
// Solves the arc-arc equations
|
|
197806
197806
|
dispatchBSplineCurve3dBSplineCurve3d(bcurveA, bcurveB, _reversed) {
|
|
197807
197807
|
const bezierSpanA = bcurveA.collectBezierSpans(true);
|
|
197808
197808
|
const bezierSpanB = bcurveB.collectBezierSpans(true);
|
|
@@ -197830,9 +197830,9 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197830
197830
|
}
|
|
197831
197831
|
}
|
|
197832
197832
|
/**
|
|
197833
|
-
* Apply the projection transform (if any) to (xyz, w)
|
|
197833
|
+
* Apply the projection transform (if any) to (xyz, w).
|
|
197834
197834
|
* @param xyz xyz parts of input point.
|
|
197835
|
-
* @param w weight to use for homogeneous effects
|
|
197835
|
+
* @param w weight to use for homogeneous effects.
|
|
197836
197836
|
*/
|
|
197837
197837
|
projectPoint(xyz, w = 1.0) {
|
|
197838
197838
|
if (this._worldToLocalPerspective)
|
|
@@ -197857,9 +197857,9 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197857
197857
|
npcPlane.clone(worldPlane);
|
|
197858
197858
|
}
|
|
197859
197859
|
}
|
|
197860
|
-
// Caller accesses data from segment and bsplineCurve
|
|
197861
|
-
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
197862
|
-
// Solves the arc-arc equations
|
|
197860
|
+
// Caller accesses data from segment and bsplineCurve.
|
|
197861
|
+
// Selects the best conditioned arc (in xy parts) as "circle after inversion".
|
|
197862
|
+
// Solves the arc-arc equations.
|
|
197863
197863
|
dispatchSegmentBsplineCurve(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, bcurve, extendB, reversed) {
|
|
197864
197864
|
const pointA0H = this.projectPoint(pointA0);
|
|
197865
197865
|
const pointA1H = this.projectPoint(pointA1);
|
|
@@ -197941,6 +197941,38 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197941
197941
|
}
|
|
197942
197942
|
return undefined;
|
|
197943
197943
|
}
|
|
197944
|
+
/** Detail computation for linestring intersecting linestring. */
|
|
197945
|
+
computeLineStringLineString(lsA, lsB, reversed) {
|
|
197946
|
+
const pointA0 = CurveCurveIntersectXY._workPointAA0;
|
|
197947
|
+
const pointA1 = CurveCurveIntersectXY._workPointAA1;
|
|
197948
|
+
const pointB0 = CurveCurveIntersectXY._workPointBB0;
|
|
197949
|
+
const pointB1 = CurveCurveIntersectXY._workPointBB1;
|
|
197950
|
+
const numA = lsA.numPoints();
|
|
197951
|
+
const numB = lsB.numPoints();
|
|
197952
|
+
if (numA > 1 && numB > 1) {
|
|
197953
|
+
lsA.pointAt(0, pointA0);
|
|
197954
|
+
const dfA = 1.0 / (numA - 1);
|
|
197955
|
+
const dfB = 1.0 / (numB - 1);
|
|
197956
|
+
let fA0 = 0.0;
|
|
197957
|
+
let fB0;
|
|
197958
|
+
let fA1;
|
|
197959
|
+
let fB1;
|
|
197960
|
+
const extendA = this._extendA;
|
|
197961
|
+
const extendB = this._extendB;
|
|
197962
|
+
lsA.pointAt(0, pointA0);
|
|
197963
|
+
for (let ia = 1; ia < numA; ia++, pointA0.setFrom(pointA1), fA0 = fA1) {
|
|
197964
|
+
fA1 = ia * dfA;
|
|
197965
|
+
fB0 = 0.0;
|
|
197966
|
+
lsA.pointAt(ia, pointA1);
|
|
197967
|
+
lsB.pointAt(0, pointB0);
|
|
197968
|
+
for (let ib = 1; ib < numB; ib++, pointB0.setFrom(pointB1), fB0 = fB1) {
|
|
197969
|
+
lsB.pointAt(ib, pointB1);
|
|
197970
|
+
fB1 = ib * dfB;
|
|
197971
|
+
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);
|
|
197972
|
+
}
|
|
197973
|
+
}
|
|
197974
|
+
}
|
|
197975
|
+
}
|
|
197944
197976
|
static setTransformedWorkPoints(transform, pointA0, pointA1, pointB0, pointB1) {
|
|
197945
197977
|
transform.multiplyPoint3d(pointA0, this._workPointA0);
|
|
197946
197978
|
transform.multiplyPoint3d(pointA1, this._workPointA1);
|
|
@@ -197962,40 +197994,13 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197962
197994
|
else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_14__.BSplineCurve3d) {
|
|
197963
197995
|
this.dispatchSegmentBsplineCurve(segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA, this._geometryB, this._extendB, false);
|
|
197964
197996
|
}
|
|
197997
|
+
return undefined;
|
|
197965
197998
|
}
|
|
197966
197999
|
/** Double dispatch handler for strongly typed linestring. */
|
|
197967
198000
|
handleLineString3d(lsA) {
|
|
197968
198001
|
if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_12__.LineString3d) {
|
|
197969
198002
|
const lsB = this._geometryB;
|
|
197970
|
-
|
|
197971
|
-
const pointA1 = CurveCurveIntersectXY._workPointAA1;
|
|
197972
|
-
const pointB0 = CurveCurveIntersectXY._workPointBB0;
|
|
197973
|
-
const pointB1 = CurveCurveIntersectXY._workPointBB1;
|
|
197974
|
-
const numA = lsA.numPoints();
|
|
197975
|
-
const numB = lsB.numPoints();
|
|
197976
|
-
if (numA > 1 && numB > 1) {
|
|
197977
|
-
lsA.pointAt(0, pointA0);
|
|
197978
|
-
const dfA = 1.0 / (numA - 1);
|
|
197979
|
-
const dfB = 1.0 / (numB - 1);
|
|
197980
|
-
let fA0 = 0.0;
|
|
197981
|
-
let fB0;
|
|
197982
|
-
let fA1;
|
|
197983
|
-
let fB1;
|
|
197984
|
-
const extendA = this._extendA;
|
|
197985
|
-
const extendB = this._extendB;
|
|
197986
|
-
lsA.pointAt(0, pointA0);
|
|
197987
|
-
for (let ia = 1; ia < numA; ia++, pointA0.setFrom(pointA1), fA0 = fA1) {
|
|
197988
|
-
fA1 = ia * dfA;
|
|
197989
|
-
fB0 = 0.0;
|
|
197990
|
-
lsA.pointAt(ia, pointA1);
|
|
197991
|
-
lsB.pointAt(0, pointB0);
|
|
197992
|
-
for (let ib = 1; ib < numB; ib++, pointB0.setFrom(pointB1), fB0 = fB1) {
|
|
197993
|
-
lsB.pointAt(ib, pointB1);
|
|
197994
|
-
fB1 = ib * dfB;
|
|
197995
|
-
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);
|
|
197996
|
-
}
|
|
197997
|
-
}
|
|
197998
|
-
}
|
|
198003
|
+
this.computeLineStringLineString(lsA, lsB, false);
|
|
197999
198004
|
}
|
|
198000
198005
|
else if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d) {
|
|
198001
198006
|
this.computeSegmentLineString(this._geometryB, this._extendB, lsA, this._extendA, true);
|
|
@@ -198088,14 +198093,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
198088
198093
|
/* harmony export */ CurveCurveIntersectXYZ: () => (/* binding */ CurveCurveIntersectXYZ)
|
|
198089
198094
|
/* harmony export */ });
|
|
198090
198095
|
/* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
|
|
198091
|
-
/* harmony import */ var
|
|
198096
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
198092
198097
|
/* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
|
|
198093
198098
|
/* harmony import */ var _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../geometry3d/Plane3dByOriginAndUnitNormal */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js");
|
|
198094
198099
|
/* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
|
|
198095
198100
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
198096
198101
|
/* harmony import */ var _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../numerics/Polynomials */ "../../core/geometry/lib/esm/numerics/Polynomials.js");
|
|
198097
198102
|
/* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
198098
|
-
/* harmony import */ var
|
|
198103
|
+
/* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
|
|
198099
198104
|
/* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
198100
198105
|
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
198101
198106
|
/*---------------------------------------------------------------------------------------------
|
|
@@ -198124,9 +198129,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
198124
198129
|
* @internal
|
|
198125
198130
|
*/
|
|
198126
198131
|
class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_0__.NullGeometryHandler {
|
|
198127
|
-
reinitialize() {
|
|
198128
|
-
this._results = new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_1__.CurveLocationDetailArrayPair();
|
|
198129
|
-
}
|
|
198130
198132
|
/**
|
|
198131
198133
|
* @param extendA flag to enable using extension of the other geometry.
|
|
198132
198134
|
* @param geometryB second curve for intersection. Saved for reference by specific handler methods.
|
|
@@ -198137,16 +198139,16 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198137
198139
|
this._extendA = extendA;
|
|
198138
198140
|
this._geometryB = geometryB;
|
|
198139
198141
|
this._extendB = extendB;
|
|
198140
|
-
this.
|
|
198142
|
+
this._results = [];
|
|
198141
198143
|
}
|
|
198142
198144
|
/**
|
|
198143
|
-
*
|
|
198145
|
+
* Return the results structure for the intersection calculation, structured as an array of CurveLocationDetailPair.
|
|
198144
198146
|
* @param reinitialize if true, a new results structure is created for use by later calls.
|
|
198145
198147
|
*/
|
|
198146
|
-
|
|
198148
|
+
grabPairedResults(reinitialize = false) {
|
|
198147
198149
|
const result = this._results;
|
|
198148
198150
|
if (reinitialize)
|
|
198149
|
-
this.
|
|
198151
|
+
this._results = [];
|
|
198150
198152
|
return result;
|
|
198151
198153
|
}
|
|
198152
198154
|
acceptFraction(extend0, fraction, extend1) {
|
|
@@ -198162,23 +198164,22 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198162
198164
|
* Reject if evaluated points do not match coordinates (e.g. close approach point).
|
|
198163
198165
|
* Record with fraction mapping.
|
|
198164
198166
|
*/
|
|
198165
|
-
recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB,
|
|
198166
|
-
|
|
198167
|
-
const
|
|
198168
|
-
const globalFractionB = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionB0, localFractionB, fractionB1);
|
|
198167
|
+
recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, cpB, fractionB0, fractionB1, reversed) {
|
|
198168
|
+
const globalFractionA = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(fractionA0, localFractionA, fractionA1);
|
|
198169
|
+
const globalFractionB = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(fractionB0, localFractionB, fractionB1);
|
|
198169
198170
|
// ignore duplicate of most recent point . ..
|
|
198170
|
-
const numPrevious = this._results.
|
|
198171
|
+
const numPrevious = this._results.length;
|
|
198171
198172
|
if (numPrevious > 0) {
|
|
198172
|
-
const topFractionA = this._results
|
|
198173
|
-
const topFractionB = this._results
|
|
198173
|
+
const topFractionA = this._results[numPrevious - 1].detailA.fraction;
|
|
198174
|
+
const topFractionB = this._results[numPrevious - 1].detailB.fraction;
|
|
198174
198175
|
if (reversed) {
|
|
198175
|
-
if (
|
|
198176
|
-
|
|
198176
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isAlmostEqualNumber(topFractionA, globalFractionB) &&
|
|
198177
|
+
_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isAlmostEqualNumber(topFractionB, globalFractionA))
|
|
198177
198178
|
return;
|
|
198178
198179
|
}
|
|
198179
198180
|
else {
|
|
198180
|
-
if (
|
|
198181
|
-
|
|
198181
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isAlmostEqualNumber(topFractionA, globalFractionA) &&
|
|
198182
|
+
_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isAlmostEqualNumber(topFractionB, globalFractionB))
|
|
198182
198183
|
return;
|
|
198183
198184
|
}
|
|
198184
198185
|
}
|
|
@@ -198186,17 +198187,17 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198186
198187
|
const pointB = cpB.fractionToPoint(globalFractionB);
|
|
198187
198188
|
if (!pointA.isAlmostEqualMetric(pointB))
|
|
198188
198189
|
return;
|
|
198189
|
-
const detailA =
|
|
198190
|
-
detailA.setIntervalRole(
|
|
198191
|
-
const detailB =
|
|
198192
|
-
detailB.setIntervalRole(
|
|
198190
|
+
const detailA = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__.CurveLocationDetail.createCurveFractionPoint(cpA, globalFractionA, pointA);
|
|
198191
|
+
detailA.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__.CurveIntervalRole.isolated);
|
|
198192
|
+
const detailB = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__.CurveLocationDetail.createCurveFractionPoint(cpB, globalFractionB, pointB);
|
|
198193
|
+
detailB.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__.CurveIntervalRole.isolated);
|
|
198193
198194
|
if (reversed) {
|
|
198194
|
-
|
|
198195
|
-
this._results.
|
|
198195
|
+
const pair = new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__.CurveLocationDetailPair(detailB, detailA);
|
|
198196
|
+
this._results.push(pair);
|
|
198196
198197
|
}
|
|
198197
198198
|
else {
|
|
198198
|
-
|
|
198199
|
-
this._results.
|
|
198199
|
+
const pair = new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_2__.CurveLocationDetailPair(detailA, detailB);
|
|
198200
|
+
this._results.push(pair);
|
|
198200
198201
|
}
|
|
198201
198202
|
}
|
|
198202
198203
|
/**
|
|
@@ -198212,8 +198213,8 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198212
198213
|
}
|
|
198213
198214
|
}
|
|
198214
198215
|
// Caller accesses data from a line segment and passes to here.
|
|
198215
|
-
//
|
|
198216
|
-
// allow all combinations to be passed in
|
|
198216
|
+
// The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
|
|
198217
|
+
// The fraction and extend parameters allow all combinations to be passed in.
|
|
198217
198218
|
// This method applies transform.
|
|
198218
198219
|
dispatchSegmentSegment(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {
|
|
198219
198220
|
this.computeSegmentSegment3D(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed);
|
|
@@ -198228,12 +198229,12 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198228
198229
|
* @param origin plane origin
|
|
198229
198230
|
* @param vectorA vector which must be in the plane.
|
|
198230
198231
|
* @param cosineValue largest cosine of the angle theta between vectorA and vectorB to prefer their cross product, e.g.
|
|
198231
|
-
*
|
|
198232
|
+
* passing 0.94 ~ cos(20deg) will switch to using vectorC in the cross product if theta < ~20deg or theta > ~160deg.
|
|
198232
198233
|
* @param vectorB first candidate for additional in-plane vector
|
|
198233
198234
|
* @param vectorC second candidate for additional in-plane vector
|
|
198234
198235
|
*/
|
|
198235
198236
|
createPlaneWithPreferredPerpendicular(origin, vectorA, cosineValue, vectorB, vectorC) {
|
|
198236
|
-
cosineValue =
|
|
198237
|
+
cosineValue = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.restrictToInterval(Math.abs(cosineValue), 0.0, 1.0 - _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallFraction);
|
|
198237
198238
|
const dotAA = vectorA.magnitudeSquared();
|
|
198238
198239
|
const dotBB = vectorB.magnitudeSquared();
|
|
198239
198240
|
const dotAB = Math.abs(vectorA.dotProduct(vectorB));
|
|
@@ -198243,8 +198244,8 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198243
198244
|
return undefined;
|
|
198244
198245
|
}
|
|
198245
198246
|
// Caller accesses data from a linestring or segment and passes it here.
|
|
198246
|
-
//
|
|
198247
|
-
// allow all combinations to be passed in
|
|
198247
|
+
// The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
|
|
198248
|
+
// The fraction and extend parameters allow all combinations to be passed in.
|
|
198248
198249
|
dispatchSegmentArc(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, arc, extendB0, extendB1, reversed) {
|
|
198249
198250
|
const lineVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Vector3d.createStartEnd(pointA0, pointA1);
|
|
198250
198251
|
const plane = this.createPlaneWithPreferredPerpendicular(pointA0, lineVector, 0.94, arc.perpendicularVector, arc.vector0);
|
|
@@ -198279,7 +198280,7 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198279
198280
|
_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_3__.TrigPolynomial.solveUnitCircleHomogeneousEllipseIntersection(otherVectors.center.x, otherVectors.center.y, 1.0, otherVectors.vector0.x, otherVectors.vector0.y, 0.0, otherVectors.vector90.x, otherVectors.vector90.y, 0.0, ellipseRadians, circleRadians);
|
|
198280
198281
|
for (let i = 0; i < ellipseRadians.length; i++) {
|
|
198281
198282
|
const fractionA = cpA.sweep.radiansToSignedPeriodicFraction(circleRadians[i]);
|
|
198282
|
-
const fractionB =
|
|
198283
|
+
const fractionB = cpB.sweep.radiansToSignedPeriodicFraction(ellipseRadians[i]);
|
|
198283
198284
|
// hm .. do we really need to check the fractions? We know they are internal to the beziers
|
|
198284
198285
|
if (this.acceptFraction(extendA, fractionA, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {
|
|
198285
198286
|
this.recordPointWithLocalFractions(fractionA, cpA, 0, 1, fractionB, cpB, 0, 1, reversed);
|
|
@@ -198288,13 +198289,13 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198288
198289
|
}
|
|
198289
198290
|
}
|
|
198290
198291
|
// Caller accesses data from two arcs.
|
|
198291
|
-
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
198292
|
-
// Solves the arc-arc equations
|
|
198292
|
+
// Selects the best conditioned arc (in xy parts) as "circle after inversion".
|
|
198293
|
+
// Solves the arc-arc equations.
|
|
198293
198294
|
dispatchArcArc(cpA, extendA, cpB, extendB, reversed) {
|
|
198294
198295
|
// If arcs are in different planes:
|
|
198295
198296
|
// 1) Intersect each plane with the other arc (quadratic)
|
|
198296
198297
|
// 2) accept points that appear in both intersection sets.
|
|
198297
|
-
// If arcs are in parallel planes -- no intersections
|
|
198298
|
+
// If arcs are in parallel planes -- no intersections.
|
|
198298
198299
|
// If arcs are in the same plane -- xy intersection in that plane.
|
|
198299
198300
|
const planeA = _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_4__.Plane3dByOriginAndUnitNormal.create(cpA.center, cpA.perpendicularVector);
|
|
198300
198301
|
const planeB = _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_4__.Plane3dByOriginAndUnitNormal.create(cpB.center, cpB.perpendicularVector);
|
|
@@ -198302,7 +198303,7 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198302
198303
|
return;
|
|
198303
198304
|
if (planeA.getNormalRef().isParallelTo(planeB.getNormalRef())) {
|
|
198304
198305
|
if (planeA.isPointInPlane(planeB.getOriginRef()) && planeB.isPointInPlane(planeA.getOriginRef())) {
|
|
198305
|
-
// coplanar
|
|
198306
|
+
// coplanar
|
|
198306
198307
|
this.dispatchArcArcInPlane(cpA, extendA, cpB, extendB, reversed);
|
|
198307
198308
|
}
|
|
198308
198309
|
}
|
|
@@ -198324,8 +198325,8 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198324
198325
|
}
|
|
198325
198326
|
}
|
|
198326
198327
|
// Caller accesses data from two arcs.
|
|
198327
|
-
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
198328
|
-
// Solves the arc-arc equations
|
|
198328
|
+
// Selects the best conditioned arc (in xy parts) as "circle after inversion".
|
|
198329
|
+
// Solves the arc-arc equations.
|
|
198329
198330
|
dispatchArcBsplineCurve3d(_arc, _extendA, _cpB, _extendB, _reversed) {
|
|
198330
198331
|
/*
|
|
198331
198332
|
// Arc: X = C + cU + sV
|
|
@@ -198333,7 +198334,9 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198333
198334
|
let matrixA: Matrix3d;
|
|
198334
198335
|
if (this._worldToLocalPerspective) {
|
|
198335
198336
|
const dataA = cpA.toTransformedPoint4d(this._worldToLocalPerspective);
|
|
198336
|
-
matrixA = Matrix3d.createColumnsXYW(
|
|
198337
|
+
matrixA = Matrix3d.createColumnsXYW(
|
|
198338
|
+
dataA.vector0, dataA.vector0.w, dataA.vector90, dataA.vector90.w, dataA.center, dataA.center.w,
|
|
198339
|
+
);
|
|
198337
198340
|
} else {
|
|
198338
198341
|
const dataA = cpA.toTransformedVectors(this._worldToLocalAffine);
|
|
198339
198342
|
matrixA = Matrix3d.createColumnsXYW(dataA.vector0, 0, dataA.vector90, 0, dataA.center, 1);
|
|
@@ -198345,12 +198348,21 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198345
198348
|
const matrixAInverse = matrixA.inverse();
|
|
198346
198349
|
if (matrixAInverse) {
|
|
198347
198350
|
const orderF = cpB.order; // order of the beziers for simple coordinates
|
|
198348
|
-
const orderG = 2 * orderF - 1;
|
|
198351
|
+
const orderG = 2 * orderF - 1; // order of the (single) bezier for squared coordinates.
|
|
198349
198352
|
const coffF = new Float64Array(orderF);
|
|
198350
198353
|
const univariateBezierG = new UnivariateBezier(orderG);
|
|
198351
|
-
const axx = matrixAInverse.at(0, 0);
|
|
198352
|
-
const
|
|
198353
|
-
const
|
|
198354
|
+
const axx = matrixAInverse.at(0, 0);
|
|
198355
|
+
const axy = matrixAInverse.at(0, 1);
|
|
198356
|
+
const axz = 0.0;
|
|
198357
|
+
const axw = matrixAInverse.at(0, 2);
|
|
198358
|
+
const ayx = matrixAInverse.at(1, 0);
|
|
198359
|
+
const ayy = matrixAInverse.at(1, 1);
|
|
198360
|
+
const ayz = 0.0;
|
|
198361
|
+
const ayw = matrixAInverse.at(1, 2);
|
|
198362
|
+
const awx = matrixAInverse.at(2, 0);
|
|
198363
|
+
const awy = matrixAInverse.at(2, 1);
|
|
198364
|
+
const awz = 0.0;
|
|
198365
|
+
const aww = matrixAInverse.at(2, 2);
|
|
198354
198366
|
|
|
198355
198367
|
if (matrixAInverse) {
|
|
198356
198368
|
let bezier: BezierCurve3dH | undefined;
|
|
@@ -198377,9 +198389,11 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198377
198389
|
const c = bcurvePoint4d.dotProductXYZW(axx, axy, axz, axw);
|
|
198378
198390
|
const s = bcurvePoint4d.dotProductXYZW(ayx, ayy, ayz, ayw);
|
|
198379
198391
|
const arcFraction = cpA.sweep.radiansToSignedPeriodicFraction(Math.atan2(s, c));
|
|
198380
|
-
if (this.acceptFraction(extendA, arcFraction, extendA) &&
|
|
198381
|
-
this.
|
|
198382
|
-
|
|
198392
|
+
if (this.acceptFraction(extendA, arcFraction, extendA) &&
|
|
198393
|
+
this.acceptFraction(extendB, fractionB, extendB)) {
|
|
198394
|
+
this.recordPointWithLocalFractions(
|
|
198395
|
+
arcFraction, cpA, 0, 1, fractionB, cpB, 0, 1, reversed,
|
|
198396
|
+
);
|
|
198383
198397
|
}
|
|
198384
198398
|
}
|
|
198385
198399
|
}
|
|
@@ -198389,8 +198403,8 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198389
198403
|
*/
|
|
198390
198404
|
}
|
|
198391
198405
|
/*
|
|
198392
|
-
//
|
|
198393
|
-
private transformBeziers(beziers: BezierCurve3dH[]) {
|
|
198406
|
+
// Apply the transformation to bezier curves. Optionally construct ranges.
|
|
198407
|
+
private transformBeziers(beziers: BezierCurve3dH[]): void {
|
|
198394
198408
|
if (this._worldToLocalAffine) {
|
|
198395
198409
|
for (const bezier of beziers) bezier.tryTransformInPlace(this._worldToLocalAffine);
|
|
198396
198410
|
} else if (this._worldToLocalPerspective) {
|
|
@@ -198407,11 +198421,6 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198407
198421
|
}
|
|
198408
198422
|
return ranges;
|
|
198409
198423
|
}
|
|
198410
|
-
private _xyzwA0?: Point4d;
|
|
198411
|
-
private _xyzwA1?: Point4d;
|
|
198412
|
-
private _xyzwPlane?: Point4d;
|
|
198413
|
-
private _xyzwB?: Point4d;
|
|
198414
|
-
|
|
198415
198424
|
private dispatchBezierBezierStrokeFirst(
|
|
198416
198425
|
bezierA: BezierCurve3dH,
|
|
198417
198426
|
bcurveA: BSplineCurve3dBase,
|
|
@@ -198420,11 +198429,16 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198420
198429
|
bcurveB: BSplineCurve3dBase,
|
|
198421
198430
|
_strokeCountB: number,
|
|
198422
198431
|
univariateBezierB: UnivariateBezier, // caller-allocated for univariate coefficients.
|
|
198423
|
-
reversed: boolean
|
|
198424
|
-
|
|
198425
|
-
if (!this.
|
|
198426
|
-
|
|
198427
|
-
if (!this.
|
|
198432
|
+
reversed: boolean,
|
|
198433
|
+
) {
|
|
198434
|
+
if (!this._xyzwA0)
|
|
198435
|
+
this._xyzwA0 = Point4d.create();
|
|
198436
|
+
if (!this._xyzwA1)
|
|
198437
|
+
this._xyzwA1 = Point4d.create();
|
|
198438
|
+
if (!this._xyzwPlane)
|
|
198439
|
+
this._xyzwPlane = Point4d.create();
|
|
198440
|
+
if (!this._xyzwB)
|
|
198441
|
+
this._xyzwB = Point4d.create();
|
|
198428
198442
|
const roots = univariateBezierG.roots(0.0, true);
|
|
198429
198443
|
if (roots) {
|
|
198430
198444
|
for (const root of roots) {
|
|
@@ -198435,8 +198449,9 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198435
198449
|
const s = bcurvePoint4d.dotProductXYZW(ayx, ayy, ayz, ayw);
|
|
198436
198450
|
const arcFraction = cpA.sweep.radiansToSignedPeriodicFraction(Math.atan2(s, c));
|
|
198437
198451
|
if (this.acceptFraction(extendA, arcFraction, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {
|
|
198438
|
-
this.recordPointWithLocalFractions(
|
|
198439
|
-
fractionB, cpB, 0, 1, reversed
|
|
198452
|
+
this.recordPointWithLocalFractions(
|
|
198453
|
+
arcFraction, cpA, 0, 1, fractionB, cpB, 0, 1, reversed,
|
|
198454
|
+
);
|
|
198440
198455
|
}
|
|
198441
198456
|
}
|
|
198442
198457
|
bezierA.fractionToPoint4d(0.0, this._xyzwA0);
|
|
@@ -198448,7 +198463,9 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198448
198463
|
f1 = i * df;
|
|
198449
198464
|
bezierA.fractionToPoint4d(f1, this._xyzwA1);
|
|
198450
198465
|
Point4d.createPlanePointPointZ(this._xyzwA0, this._xyzwA1, this._xyzwPlane);
|
|
198451
|
-
bezierB.poleProductsXYZW(
|
|
198466
|
+
bezierB.poleProductsXYZW(
|
|
198467
|
+
univariateBezierB.coffs, this._xyzwPlane.x, this._xyzwPlane.y, this._xyzwPlane.z, this._xyzwPlane.w,
|
|
198468
|
+
);
|
|
198452
198469
|
let errors = 0;
|
|
198453
198470
|
const roots = univariateBezierB.roots(0.0, true);
|
|
198454
198471
|
if (roots)
|
|
@@ -198458,7 +198475,7 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198458
198475
|
const segmentAFraction = SmallSystem.lineSegment3dHXYClosestPointUnbounded(this._xyzwA0, this._xyzwA1, this._xyzwB);
|
|
198459
198476
|
if (segmentAFraction && Geometry.isIn01WithTolerance(segmentAFraction, intervalTolerance)) {
|
|
198460
198477
|
const bezierAFraction = Geometry.interpolate(f0, segmentAFraction, f1);
|
|
198461
|
-
|
|
198478
|
+
// TODO implement newton search
|
|
198462
198479
|
const xyMatchingFunction = new BezierBezierIntersectionXYRRToRRD(bezierA, bezierB);
|
|
198463
198480
|
const newtonSearcher = new Newton2dUnboundedWithDerivative(xyMatchingFunction);
|
|
198464
198481
|
newtonSearcher.setUV(bezierAFraction, bezierBFraction);
|
|
@@ -198483,9 +198500,11 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198483
198500
|
errors++;
|
|
198484
198501
|
if (errors > 0 && !xyzA1.isAlmostEqual(xyzB1))
|
|
198485
198502
|
errors++;
|
|
198486
|
-
if (this.acceptFraction(false, bcurveAFraction, false) &&
|
|
198487
|
-
this.
|
|
198488
|
-
|
|
198503
|
+
if (this.acceptFraction(false, bcurveAFraction, false) &&
|
|
198504
|
+
this.acceptFraction(false, bcurveBFraction, false)) {
|
|
198505
|
+
this.recordPointWithLocalFractions(
|
|
198506
|
+
bcurveAFraction, bcurveA, 0, 1, bcurveBFraction, bcurveB, 0, 1, reversed,
|
|
198507
|
+
);
|
|
198489
198508
|
}
|
|
198490
198509
|
}
|
|
198491
198510
|
}
|
|
@@ -198493,8 +198512,8 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198493
198512
|
}
|
|
198494
198513
|
*/
|
|
198495
198514
|
// Caller accesses data from two arcs.
|
|
198496
|
-
// Selects the best conditioned arc (in xy parts) as "circle after inversion"
|
|
198497
|
-
// Solves the arc-arc equations
|
|
198515
|
+
// Selects the best conditioned arc (in xy parts) as "circle after inversion".
|
|
198516
|
+
// Solves the arc-arc equations.
|
|
198498
198517
|
dispatchBSplineCurve3dBSplineCurve3d(_bcurveA, _bcurveB, _reversed) {
|
|
198499
198518
|
/*
|
|
198500
198519
|
const bezierSpanA = bcurveA.collectBezierSpans(true) as BezierCurve3dH[];
|
|
@@ -198515,9 +198534,13 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198515
198534
|
const strokeCountA = bezierSpanA[a].computeStrokeCountForOptions();
|
|
198516
198535
|
const strokeCountB = bezierSpanB[b].computeStrokeCountForOptions();
|
|
198517
198536
|
if (strokeCountA < strokeCountB)
|
|
198518
|
-
this.dispatchBezierBezierStrokeFirst(
|
|
198537
|
+
this.dispatchBezierBezierStrokeFirst(
|
|
198538
|
+
bezierSpanA[a], bcurveA, strokeCountA, bezierSpanB[b], bcurveB, strokeCountB, univariateCoffsB, _reversed,
|
|
198539
|
+
);
|
|
198519
198540
|
else
|
|
198520
|
-
this.dispatchBezierBezierStrokeFirst(
|
|
198541
|
+
this.dispatchBezierBezierStrokeFirst(
|
|
198542
|
+
bezierSpanB[b], bcurveB, strokeCountB, bezierSpanA[a], bcurveA, strokeCountA, univariateCoffsA, !_reversed,
|
|
198543
|
+
);
|
|
198521
198544
|
}
|
|
198522
198545
|
}
|
|
198523
198546
|
}
|
|
@@ -198525,9 +198548,9 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198525
198548
|
}
|
|
198526
198549
|
/*
|
|
198527
198550
|
/**
|
|
198528
|
-
* Apply the projection transform (if any) to (xyz, w)
|
|
198551
|
+
* Apply the projection transform (if any) to (xyz, w).
|
|
198529
198552
|
* @param xyz xyz parts of input point.
|
|
198530
|
-
* @param w
|
|
198553
|
+
* @param w weight to use for homogeneous effects.
|
|
198531
198554
|
*/
|
|
198532
198555
|
/*
|
|
198533
198556
|
private projectPoint(xyz: XYAndZ, w: number = 1.0): Point4d {
|
|
@@ -198564,16 +198587,19 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198564
198587
|
// NOW .. we have a plane in world space. Intersect it with the bspline:
|
|
198565
198588
|
const intersections: CurveLocationDetail[] = [];
|
|
198566
198589
|
bcurve.appendPlaneIntersectionPoints(planeCoffs, intersections);
|
|
198567
|
-
// intersections has WORLD points with bspline fractions.
|
|
198590
|
+
// intersections has WORLD points with bspline fractions.
|
|
198591
|
+
// (the bspline fractions are all good 0..1 fractions within the spline).
|
|
198568
198592
|
// accept those that are within the segment range.
|
|
198569
198593
|
for (const detail of intersections) {
|
|
198570
198594
|
const fractionB = detail.fraction;
|
|
198571
198595
|
const curvePoint = detail.point;
|
|
198572
198596
|
const curvePointH = this.projectPoint(curvePoint);
|
|
198573
198597
|
const lineFraction = SmallSystem.lineSegment3dHXYClosestPointUnbounded(pointA0H, pointA1H, curvePointH);
|
|
198574
|
-
if (lineFraction !== undefined && this.acceptFraction(extendA0, lineFraction, extendA1) &&
|
|
198575
|
-
this.
|
|
198576
|
-
|
|
198598
|
+
if (lineFraction !== undefined && this.acceptFraction(extendA0, lineFraction, extendA1) &&
|
|
198599
|
+
this.acceptFraction(extendB, fractionB, extendB)) {
|
|
198600
|
+
this.recordPointWithLocalFractions(
|
|
198601
|
+
lineFraction, cpA, fractionA0, fractionA1, fractionB, bcurve, 0, 1, reversed,
|
|
198602
|
+
);
|
|
198577
198603
|
}
|
|
198578
198604
|
}
|
|
198579
198605
|
*/
|
|
@@ -198590,7 +198616,7 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198590
198616
|
const pointA0 = CurveCurveIntersectXYZ._workPointA0;
|
|
198591
198617
|
const pointA1 = CurveCurveIntersectXYZ._workPointA1;
|
|
198592
198618
|
lsA.pointAt(0, pointA0);
|
|
198593
|
-
for (let iA = 1; iA < numA; iA
|
|
198619
|
+
for (let iA = 1; iA < numA; iA++, pointA0.setFrom(pointA1), fA0 = fA1) {
|
|
198594
198620
|
lsA.pointAt(iA, pointA1);
|
|
198595
198621
|
fA1 = iA * dfA;
|
|
198596
198622
|
this.dispatchSegmentBsplineCurve(
|
|
@@ -198641,6 +198667,38 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198641
198667
|
}
|
|
198642
198668
|
return undefined;
|
|
198643
198669
|
}
|
|
198670
|
+
/** Detail computation for linestring intersecting linestring. */
|
|
198671
|
+
computeLineStringLineString(lsA, lsB, reversed) {
|
|
198672
|
+
const pointA0 = CurveCurveIntersectXYZ._workPointAA0;
|
|
198673
|
+
const pointA1 = CurveCurveIntersectXYZ._workPointAA1;
|
|
198674
|
+
const pointB0 = CurveCurveIntersectXYZ._workPointBB0;
|
|
198675
|
+
const pointB1 = CurveCurveIntersectXYZ._workPointBB1;
|
|
198676
|
+
const numA = lsA.numPoints();
|
|
198677
|
+
const numB = lsB.numPoints();
|
|
198678
|
+
if (numA > 1 && numB > 1) {
|
|
198679
|
+
lsA.pointAt(0, pointA0);
|
|
198680
|
+
const dfA = 1.0 / (numA - 1);
|
|
198681
|
+
const dfB = 1.0 / (numB - 1);
|
|
198682
|
+
let fA0 = 0.0;
|
|
198683
|
+
let fB0;
|
|
198684
|
+
let fA1;
|
|
198685
|
+
let fB1;
|
|
198686
|
+
const extendA = this._extendA;
|
|
198687
|
+
const extendB = this._extendB;
|
|
198688
|
+
lsA.pointAt(0, pointA0);
|
|
198689
|
+
for (let ia = 1; ia < numA; ia++, pointA0.setFrom(pointA1), fA0 = fA1) {
|
|
198690
|
+
fA1 = ia * dfA;
|
|
198691
|
+
fB0 = 0.0;
|
|
198692
|
+
lsA.pointAt(ia, pointA1);
|
|
198693
|
+
lsB.pointAt(0, pointB0);
|
|
198694
|
+
for (let ib = 1; ib < numB; ib++, pointB0.setFrom(pointB1), fB0 = fB1) {
|
|
198695
|
+
lsB.pointAt(ib, pointB1);
|
|
198696
|
+
fB1 = ib * dfB;
|
|
198697
|
+
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);
|
|
198698
|
+
}
|
|
198699
|
+
}
|
|
198700
|
+
}
|
|
198701
|
+
}
|
|
198644
198702
|
/** Double dispatch handler for strongly typed segment. */
|
|
198645
198703
|
handleLineSegment3d(segmentA) {
|
|
198646
198704
|
if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_6__.LineSegment3d) {
|
|
@@ -198656,38 +198714,13 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198656
198714
|
else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_9__.BSplineCurve3d) {
|
|
198657
198715
|
this.dispatchSegmentBsplineCurve(segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA, this._geometryB, this._extendB, false);
|
|
198658
198716
|
}
|
|
198717
|
+
return undefined;
|
|
198659
198718
|
}
|
|
198660
|
-
/** double dispatch handler for strongly typed linestring
|
|
198719
|
+
/** double dispatch handler for strongly typed linestring. */
|
|
198661
198720
|
handleLineString3d(lsA) {
|
|
198662
198721
|
if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
198663
198722
|
const lsB = this._geometryB;
|
|
198664
|
-
|
|
198665
|
-
const pointA1 = CurveCurveIntersectXYZ._workPointAA1;
|
|
198666
|
-
const pointB0 = CurveCurveIntersectXYZ._workPointBB0;
|
|
198667
|
-
const pointB1 = CurveCurveIntersectXYZ._workPointBB1;
|
|
198668
|
-
const numA = lsA.numPoints();
|
|
198669
|
-
const numB = lsB.numPoints();
|
|
198670
|
-
if (numA > 1 && numB > 1) {
|
|
198671
|
-
lsA.pointAt(0, pointA0);
|
|
198672
|
-
const dfA = 1.0 / (numA - 1);
|
|
198673
|
-
const dfB = 1.0 / (numB - 1);
|
|
198674
|
-
let fA0 = 0.0;
|
|
198675
|
-
let fA1, fB0, fB1;
|
|
198676
|
-
const extendA = this._extendA;
|
|
198677
|
-
const extendB = this._extendB;
|
|
198678
|
-
lsA.pointAt(0, pointA0);
|
|
198679
|
-
for (let ia = 1; ia < numA; ia++, pointA0.setFrom(pointA1), fA0 = fA1) {
|
|
198680
|
-
fA1 = ia * dfA;
|
|
198681
|
-
fB0 = 0.0;
|
|
198682
|
-
lsA.pointAt(ia, pointA1);
|
|
198683
|
-
lsB.pointAt(0, pointB0);
|
|
198684
|
-
for (let ib = 1; ib < numB; ib++, pointB0.setFrom(pointB1), fB0 = fB1) {
|
|
198685
|
-
lsB.pointAt(ib, pointB1);
|
|
198686
|
-
fB1 = ib * dfB;
|
|
198687
|
-
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);
|
|
198688
|
-
}
|
|
198689
|
-
}
|
|
198690
|
-
}
|
|
198723
|
+
this.computeLineStringLineString(lsA, lsB, false);
|
|
198691
198724
|
}
|
|
198692
198725
|
else if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_6__.LineSegment3d) {
|
|
198693
198726
|
this.computeSegmentLineString(this._geometryB, this._extendB, lsA, this._extendA, true);
|
|
@@ -198716,7 +198749,7 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198716
198749
|
}
|
|
198717
198750
|
return undefined;
|
|
198718
198751
|
}
|
|
198719
|
-
/** Double dispatch handler for strongly typed bspline curve
|
|
198752
|
+
/** Double dispatch handler for strongly typed bspline curve. */
|
|
198720
198753
|
handleBSplineCurve3d(curve) {
|
|
198721
198754
|
if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_6__.LineSegment3d) {
|
|
198722
198755
|
this.dispatchSegmentBsplineCurve(this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB, curve, this._extendA, true);
|
|
@@ -223534,7 +223567,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
223534
223567
|
|
|
223535
223568
|
|
|
223536
223569
|
|
|
223537
|
-
/**
|
|
223570
|
+
/**
|
|
223571
|
+
* Map4 carries two Matrix4d which are inverses of each other.
|
|
223538
223572
|
* @public
|
|
223539
223573
|
*/
|
|
223540
223574
|
class Map4d {
|
|
@@ -223543,16 +223577,23 @@ class Map4d {
|
|
|
223543
223577
|
this._matrix1 = matrix1;
|
|
223544
223578
|
}
|
|
223545
223579
|
/** Return a reference to (not copy of) the "forward" Matrix4d */
|
|
223546
|
-
get transform0() {
|
|
223580
|
+
get transform0() {
|
|
223581
|
+
return this._matrix0;
|
|
223582
|
+
}
|
|
223547
223583
|
/** Return a reference to (not copy of) the "reverse" Matrix4d */
|
|
223548
|
-
get transform1() {
|
|
223584
|
+
get transform1() {
|
|
223585
|
+
return this._matrix1;
|
|
223586
|
+
}
|
|
223549
223587
|
/** Create a Map4d, capturing the references to the two matrices. */
|
|
223550
223588
|
static createRefs(matrix0, matrix1) {
|
|
223551
223589
|
return new Map4d(matrix0, matrix1);
|
|
223552
223590
|
}
|
|
223553
223591
|
/** Create an identity map. */
|
|
223554
|
-
static createIdentity() {
|
|
223555
|
-
|
|
223592
|
+
static createIdentity() {
|
|
223593
|
+
return new Map4d(_Matrix4d__WEBPACK_IMPORTED_MODULE_0__.Matrix4d.createIdentity(), _Matrix4d__WEBPACK_IMPORTED_MODULE_0__.Matrix4d.createIdentity());
|
|
223594
|
+
}
|
|
223595
|
+
/**
|
|
223596
|
+
* Create a Map4d with given transform pair.
|
|
223556
223597
|
* @returns undefined if the transforms are not inverses of each other.
|
|
223557
223598
|
*/
|
|
223558
223599
|
static createTransform(transform0, transform1) {
|
|
@@ -223586,11 +223627,19 @@ class Map4d {
|
|
|
223586
223627
|
return undefined;
|
|
223587
223628
|
}
|
|
223588
223629
|
/** Copy contents from another Map4d */
|
|
223589
|
-
setFrom(other) {
|
|
223630
|
+
setFrom(other) {
|
|
223631
|
+
this._matrix0.setFrom(other._matrix0);
|
|
223632
|
+
this._matrix1.setFrom(other._matrix1);
|
|
223633
|
+
}
|
|
223590
223634
|
/** Return a clone of this Map4d */
|
|
223591
|
-
clone() {
|
|
223635
|
+
clone() {
|
|
223636
|
+
return new Map4d(this._matrix0.clone(), this._matrix1.clone());
|
|
223637
|
+
}
|
|
223592
223638
|
/** Reinitialize this Map4d as an identity. */
|
|
223593
|
-
setIdentity() {
|
|
223639
|
+
setIdentity() {
|
|
223640
|
+
this._matrix0.setIdentity();
|
|
223641
|
+
this._matrix1.setIdentity();
|
|
223642
|
+
}
|
|
223594
223643
|
/** Set this map4d from a json object that the two Matrix4d values as properties named matrix0 and matrix1 */
|
|
223595
223644
|
setFromJSON(json) {
|
|
223596
223645
|
if (json.matrix0 && json.matrix1) {
|
|
@@ -223607,15 +223656,18 @@ class Map4d {
|
|
|
223607
223656
|
return result;
|
|
223608
223657
|
}
|
|
223609
223658
|
/** Return a json object `{matrix0: value0, matrix1: value1}` */
|
|
223610
|
-
toJSON() {
|
|
223659
|
+
toJSON() {
|
|
223660
|
+
return { matrix0: this._matrix0.toJSON(), matrix1: this._matrix1.toJSON() };
|
|
223661
|
+
}
|
|
223611
223662
|
/** Test if both matrices are almost equal to those */
|
|
223612
223663
|
isAlmostEqual(other) {
|
|
223613
223664
|
return this._matrix0.isAlmostEqual(other._matrix0) && this._matrix1.isAlmostEqual(other._matrix1);
|
|
223614
223665
|
}
|
|
223615
|
-
/**
|
|
223666
|
+
/**
|
|
223667
|
+
* Create a map between a frustum and world coordinates.
|
|
223616
223668
|
* @param origin lower left of frustum
|
|
223617
|
-
* @param uVector Vector from lower left rear to lower right rear
|
|
223618
|
-
* @param vVector Vector from lower left rear to upper left rear
|
|
223669
|
+
* @param uVector Vector from lower left rear to lower right rear.
|
|
223670
|
+
* @param vVector Vector from lower left rear to upper left rear.
|
|
223619
223671
|
* @param wVector Vector from lower left rear to lower left front, i.e. lower left rear towards eye.
|
|
223620
223672
|
* @param fraction front size divided by rear size.
|
|
223621
223673
|
*/
|
|
@@ -223644,7 +223696,8 @@ class Map4d {
|
|
|
223644
223696
|
*/
|
|
223645
223697
|
return result;
|
|
223646
223698
|
}
|
|
223647
|
-
/**
|
|
223699
|
+
/**
|
|
223700
|
+
* Multiply this*other. The output matrices are
|
|
223648
223701
|
* * output matrix0 = `this.matrix0 * other.matrix0`
|
|
223649
223702
|
* * output matrix1 = 'other.matrix1 * this.matrix1`
|
|
223650
223703
|
*/
|
|
@@ -223657,19 +223710,21 @@ class Map4d {
|
|
|
223657
223710
|
this._matrix0 = this._matrix1;
|
|
223658
223711
|
this._matrix1 = temp;
|
|
223659
223712
|
}
|
|
223660
|
-
/**
|
|
223713
|
+
/**
|
|
223714
|
+
* Return a Map4d whose transform0 is
|
|
223661
223715
|
* other.transform0 * this.transform0 * other.transform1
|
|
223662
223716
|
*/
|
|
223663
223717
|
sandwich0This1(other) {
|
|
223664
223718
|
return new Map4d(other._matrix0.multiplyMatrixMatrix(this._matrix0.multiplyMatrixMatrix(other._matrix1)), other._matrix0.multiplyMatrixMatrix(this._matrix1.multiplyMatrixMatrix(other._matrix1)));
|
|
223665
223719
|
}
|
|
223666
|
-
/**
|
|
223720
|
+
/**
|
|
223721
|
+
* Return a Map4d whose transform0 is
|
|
223667
223722
|
* other.transform1 * this.transform0 * other.transform0
|
|
223668
223723
|
*/
|
|
223669
223724
|
sandwich1This0(other) {
|
|
223670
223725
|
return new Map4d(other._matrix1.multiplyMatrixMatrix(this._matrix0.multiplyMatrixMatrix(other._matrix0)), other._matrix1.multiplyMatrixMatrix(this._matrix1.multiplyMatrixMatrix(other._matrix0)));
|
|
223671
223726
|
}
|
|
223672
|
-
}
|
|
223727
|
+
}
|
|
223673
223728
|
|
|
223674
223729
|
|
|
223675
223730
|
/***/ }),
|
|
@@ -233585,7 +233640,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
233585
233640
|
|
|
233586
233641
|
|
|
233587
233642
|
|
|
233588
|
-
/* eslint-disable @typescript-eslint/naming-convention, @typescript-eslint/prefer-for-of */
|
|
233589
233643
|
/**
|
|
233590
233644
|
* A FacetSector
|
|
233591
233645
|
* * initially holds coordinate data for a place where xyz and sectionDerivative are known
|
|
@@ -234728,16 +234782,14 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
234728
234782
|
this.addBetweenLineStringsWithStoredIndices(strokeA, strokeB);
|
|
234729
234783
|
}
|
|
234730
234784
|
else if (stroke0 instanceof _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_12__.ParityRegion) {
|
|
234731
|
-
for (
|
|
234732
|
-
this.addBetweenRotatedStrokeSets(
|
|
234785
|
+
for (const child of stroke0.children) {
|
|
234786
|
+
this.addBetweenRotatedStrokeSets(child, transformA, vA, transformB, vB);
|
|
234733
234787
|
}
|
|
234734
234788
|
}
|
|
234735
234789
|
else if (stroke0 instanceof _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_13__.CurveChain) {
|
|
234736
|
-
const
|
|
234737
|
-
|
|
234738
|
-
|
|
234739
|
-
if (cpA instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d) {
|
|
234740
|
-
this.addBetweenRotatedStrokeSets(cpA, transformA, vA, transformB, vB);
|
|
234790
|
+
for (const child of stroke0.children) {
|
|
234791
|
+
if (child instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d) {
|
|
234792
|
+
this.addBetweenRotatedStrokeSets(child, transformA, vA, transformB, vB);
|
|
234741
234793
|
}
|
|
234742
234794
|
}
|
|
234743
234795
|
}
|
|
@@ -234772,8 +234824,8 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
234772
234824
|
let stroke0;
|
|
234773
234825
|
let stroke1;
|
|
234774
234826
|
const sectionMaps = [];
|
|
234775
|
-
for (
|
|
234776
|
-
sectionMaps.push(_curve_Query_StrokeCountChain__WEBPACK_IMPORTED_MODULE_16__.StrokeCountSection.createForParityRegionOrChain(
|
|
234827
|
+
for (const contour of contours) {
|
|
234828
|
+
sectionMaps.push(_curve_Query_StrokeCountChain__WEBPACK_IMPORTED_MODULE_16__.StrokeCountSection.createForParityRegionOrChain(contour.curves, this._options));
|
|
234777
234829
|
}
|
|
234778
234830
|
if (_curve_Query_StrokeCountChain__WEBPACK_IMPORTED_MODULE_16__.StrokeCountSection.enforceStrokeCountCompatibility(sectionMaps)) {
|
|
234779
234831
|
_curve_Query_StrokeCountChain__WEBPACK_IMPORTED_MODULE_16__.StrokeCountSection.enforceCompatibleDistanceSums(sectionMaps);
|
|
@@ -280503,7 +280555,7 @@ class TestContext {
|
|
|
280503
280555
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
280504
280556
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
280505
280557
|
await core_frontend_1.NoRenderApp.startup({
|
|
280506
|
-
applicationVersion: "4.2.0-dev.
|
|
280558
|
+
applicationVersion: "4.2.0-dev.33",
|
|
280507
280559
|
applicationId: this.settings.gprid,
|
|
280508
280560
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
|
|
280509
280561
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -299911,7 +299963,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
|
299911
299963
|
/***/ ((module) => {
|
|
299912
299964
|
|
|
299913
299965
|
"use strict";
|
|
299914
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.2.0-dev.
|
|
299966
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.2.0-dev.33","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.2.0-dev.33","@itwin/core-bentley":"workspace:^4.2.0-dev.33","@itwin/core-common":"workspace:^4.2.0-dev.33","@itwin/core-geometry":"workspace:^4.2.0-dev.33","@itwin/core-orbitgt":"workspace:^4.2.0-dev.33","@itwin/core-quantity":"workspace:^4.2.0-dev.33"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"18.16.1","@types/sinon":"^10.0.15","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^15.0.4","source-map-loader":"^4.0.0","typescript":"~5.0.2","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.1.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
|
|
299915
299967
|
|
|
299916
299968
|
/***/ }),
|
|
299917
299969
|
|