@itwin/rpcinterface-full-stack-tests 5.3.0-dev.12 → 5.3.0-dev.16
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/bundled-tests.js +537 -494
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -127044,7 +127044,9 @@ class ViewManager {
|
|
|
127044
127044
|
get selectedView() { return this._selectedView; }
|
|
127045
127045
|
/** Get the first opened view. */
|
|
127046
127046
|
getFirstOpenView() { return this._viewports.length > 0 ? this._viewports[0] : undefined; }
|
|
127047
|
-
/** Check if only a single viewport is being used. If so, render directly on-screen using its WebGL canvas. Otherwise, render each view offscreen.
|
|
127047
|
+
/** Check if only a single viewport is being used. If so, render directly on-screen using its WebGL canvas. Otherwise, render each view offscreen.
|
|
127048
|
+
* @internal
|
|
127049
|
+
*/
|
|
127048
127050
|
updateRenderToScreen() {
|
|
127049
127051
|
const renderToScreen = 1 === this._viewports.length;
|
|
127050
127052
|
for (const vp of this)
|
|
@@ -135667,6 +135669,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
135667
135669
|
/** @packageDocumentation
|
|
135668
135670
|
* @module Utils
|
|
135669
135671
|
*/
|
|
135672
|
+
/** @internal */
|
|
135670
135673
|
const _implementationProhibited = Symbol.for("Implementations of this interface can only be obtained from the containing package");
|
|
135671
135674
|
function sym(name) {
|
|
135672
135675
|
return `${name}_core-frontend_INTERNAL_ONLY_DO_NOT_USE`;
|
|
@@ -141607,6 +141610,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
141607
141610
|
/* harmony export */ WorkerGraphicDescriptionContext: () => (/* reexport safe */ _common__WEBPACK_IMPORTED_MODULE_10__.WorkerGraphicDescriptionContext),
|
|
141608
141611
|
/* harmony export */ ZoomViewTool: () => (/* reexport safe */ _tools_ViewTool__WEBPACK_IMPORTED_MODULE_114__.ZoomViewTool),
|
|
141609
141612
|
/* harmony export */ _callIpcChannel: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_122__._callIpcChannel),
|
|
141613
|
+
/* harmony export */ _implementationProhibited: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_122__._implementationProhibited),
|
|
141610
141614
|
/* harmony export */ _scheduleScriptReference: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_122__._scheduleScriptReference),
|
|
141611
141615
|
/* harmony export */ acquireImdlDecoder: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_122__.acquireImdlDecoder),
|
|
141612
141616
|
/* harmony export */ appendQueryParams: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_122__.appendQueryParams),
|
|
@@ -143175,6 +143179,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
143175
143179
|
/* harmony export */ Target: () => (/* reexport safe */ _render_webgl_Target__WEBPACK_IMPORTED_MODULE_3__.Target),
|
|
143176
143180
|
/* harmony export */ WmsUtilities: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_8__.WmsUtilities),
|
|
143177
143181
|
/* harmony export */ _callIpcChannel: () => (/* reexport safe */ _common_internal_Symbols__WEBPACK_IMPORTED_MODULE_0__._callIpcChannel),
|
|
143182
|
+
/* harmony export */ _implementationProhibited: () => (/* reexport safe */ _common_internal_Symbols__WEBPACK_IMPORTED_MODULE_0__._implementationProhibited),
|
|
143178
143183
|
/* harmony export */ _scheduleScriptReference: () => (/* reexport safe */ _common_internal_Symbols__WEBPACK_IMPORTED_MODULE_0__._scheduleScriptReference),
|
|
143179
143184
|
/* harmony export */ acquireImdlDecoder: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_8__.acquireImdlDecoder),
|
|
143180
143185
|
/* harmony export */ appendQueryParams: () => (/* reexport safe */ _tile_internal__WEBPACK_IMPORTED_MODULE_8__.appendQueryParams),
|
|
@@ -143218,6 +143223,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
143218
143223
|
|
|
143219
143224
|
|
|
143220
143225
|
|
|
143226
|
+
|
|
143221
143227
|
/***/ }),
|
|
143222
143228
|
|
|
143223
143229
|
/***/ "../../core/frontend/lib/esm/internal/render/AnimationBranchState.js":
|
|
@@ -229470,6 +229476,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
229470
229476
|
/* harmony export */ IndexedPolyfaceSubsetVisitor: () => (/* reexport safe */ _polyface_IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_116__.IndexedPolyfaceSubsetVisitor),
|
|
229471
229477
|
/* harmony export */ IndexedPolyfaceVisitor: () => (/* reexport safe */ _polyface_IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_116__.IndexedPolyfaceVisitor),
|
|
229472
229478
|
/* harmony export */ IndexedPolyfaceWalker: () => (/* reexport safe */ _polyface_IndexedPolyfaceWalker__WEBPACK_IMPORTED_MODULE_117__.IndexedPolyfaceWalker),
|
|
229479
|
+
/* harmony export */ IndexedReadWriteXYCollection: () => (/* reexport safe */ _geometry3d_IndexedXYCollection__WEBPACK_IMPORTED_MODULE_14__.IndexedReadWriteXYCollection),
|
|
229473
229480
|
/* harmony export */ IndexedReadWriteXYZCollection: () => (/* reexport safe */ _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_15__.IndexedReadWriteXYZCollection),
|
|
229474
229481
|
/* harmony export */ IndexedXYCollection: () => (/* reexport safe */ _geometry3d_IndexedXYCollection__WEBPACK_IMPORTED_MODULE_14__.IndexedXYCollection),
|
|
229475
229482
|
/* harmony export */ IndexedXYZCollection: () => (/* reexport safe */ _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_15__.IndexedXYZCollection),
|
|
@@ -233333,32 +233340,33 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
233333
233340
|
/* harmony export */ CurveFactory: () => (/* binding */ CurveFactory),
|
|
233334
233341
|
/* harmony export */ MiteredSweepOutputSelect: () => (/* binding */ MiteredSweepOutputSelect)
|
|
233335
233342
|
/* harmony export */ });
|
|
233336
|
-
/* harmony import */ var
|
|
233337
|
-
/* harmony import */ var
|
|
233338
|
-
/* harmony import */ var
|
|
233339
|
-
/* harmony import */ var
|
|
233340
|
-
/* harmony import */ var
|
|
233341
|
-
/* harmony import */ var
|
|
233342
|
-
/* harmony import */ var
|
|
233343
|
-
/* harmony import */ var
|
|
233344
|
-
/* harmony import */ var
|
|
233345
|
-
/* harmony import */ var
|
|
233346
|
-
/* harmony import */ var
|
|
233347
|
-
/* harmony import */ var
|
|
233348
|
-
/* harmony import */ var
|
|
233349
|
-
/* harmony import */ var
|
|
233350
|
-
/* harmony import */ var
|
|
233351
|
-
/* harmony import */ var
|
|
233352
|
-
/* harmony import */ var
|
|
233353
|
-
/* harmony import */ var
|
|
233354
|
-
/* harmony import */ var
|
|
233355
|
-
/* harmony import */ var
|
|
233356
|
-
/* harmony import */ var
|
|
233357
|
-
/* harmony import */ var
|
|
233358
|
-
/* harmony import */ var
|
|
233359
|
-
/* harmony import */ var
|
|
233360
|
-
/* harmony import */ var
|
|
233361
|
-
/* harmony import */ var
|
|
233343
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
233344
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
233345
|
+
/* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
233346
|
+
/* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
|
|
233347
|
+
/* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
|
|
233348
|
+
/* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
|
|
233349
|
+
/* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
|
|
233350
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
233351
|
+
/* harmony import */ var _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../geometry3d/PolylineOps */ "../../core/geometry/lib/esm/geometry3d/PolylineOps.js");
|
|
233352
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
233353
|
+
/* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
|
|
233354
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
233355
|
+
/* harmony import */ var _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../numerics/SmallSystem */ "../../core/geometry/lib/esm/numerics/SmallSystem.js");
|
|
233356
|
+
/* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
|
|
233357
|
+
/* harmony import */ var _solid_Cone__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../solid/Cone */ "../../core/geometry/lib/esm/solid/Cone.js");
|
|
233358
|
+
/* harmony import */ var _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../solid/RuledSweep */ "../../core/geometry/lib/esm/solid/RuledSweep.js");
|
|
233359
|
+
/* harmony import */ var _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../solid/TorusPipe */ "../../core/geometry/lib/esm/solid/TorusPipe.js");
|
|
233360
|
+
/* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
233361
|
+
/* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
233362
|
+
/* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
|
|
233363
|
+
/* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
233364
|
+
/* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
233365
|
+
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
233366
|
+
/* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
233367
|
+
/* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
|
|
233368
|
+
/* harmony import */ var _RegionOps__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
|
|
233369
|
+
/* harmony import */ var _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
|
|
233362
233370
|
/*---------------------------------------------------------------------------------------------
|
|
233363
233371
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
233364
233372
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -233390,6 +233398,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
233390
233398
|
|
|
233391
233399
|
|
|
233392
233400
|
|
|
233401
|
+
|
|
233393
233402
|
|
|
233394
233403
|
|
|
233395
233404
|
/**
|
|
@@ -233414,8 +233423,8 @@ class CurveFactory {
|
|
|
233414
233423
|
/** (Cautiously) construct and save a line segment between fractional positions. */
|
|
233415
233424
|
static addPartialSegment(path, allowBackup, pointA, pointB, fraction0, fraction1) {
|
|
233416
233425
|
if (allowBackup || (fraction1 > fraction0)) {
|
|
233417
|
-
if (pointA !== undefined && pointB !== undefined && !
|
|
233418
|
-
path.tryAddChild(
|
|
233426
|
+
if (pointA !== undefined && pointB !== undefined && !_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isAlmostEqualNumber(fraction0, fraction1))
|
|
233427
|
+
path.tryAddChild(_LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d.create(pointA.interpolate(fraction0, pointB), pointA.interpolate(fraction1, pointB)));
|
|
233419
233428
|
}
|
|
233420
233429
|
}
|
|
233421
233430
|
/**
|
|
@@ -233424,8 +233433,8 @@ class CurveFactory {
|
|
|
233424
233433
|
* * If tangent is parallel to line segment from start to end, return `undefined`.
|
|
233425
233434
|
*/
|
|
233426
233435
|
static createArcPointTangentPoint(start, tangentAtStart, end) {
|
|
233427
|
-
const ret =
|
|
233428
|
-
if (ret instanceof
|
|
233436
|
+
const ret = _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d.createCircularStartTangentEnd(start, tangentAtStart, end);
|
|
233437
|
+
if (ret instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d)
|
|
233429
233438
|
return ret;
|
|
233430
233439
|
else
|
|
233431
233440
|
return undefined;
|
|
@@ -233434,77 +233443,72 @@ class CurveFactory {
|
|
|
233434
233443
|
* Construct a sequence of alternating lines and arcs with the arcs creating tangent transition between consecutive edges.
|
|
233435
233444
|
* * If the radius parameter is a number, that radius is used throughout.
|
|
233436
233445
|
* * If the radius parameter is an array of numbers, `radius[i]` is applied at `point[i]`.
|
|
233437
|
-
*
|
|
233438
|
-
*
|
|
233439
|
-
* @param points point source
|
|
233446
|
+
* * A zero radius for any point indicates to leave the as a simple corner.
|
|
233447
|
+
* @param points point source.
|
|
233440
233448
|
* @param radius fillet radius or array of radii indexed to correspond to the points.
|
|
233441
|
-
* @param
|
|
233449
|
+
* @param allowCuspOrOptions flag to allow cusps in output (default `true`), or a list of extended options.
|
|
233442
233450
|
*/
|
|
233443
|
-
static createFilletsInLineString(points, radius,
|
|
233451
|
+
static createFilletsInLineString(points, radius, allowCuspOrOptions = true) {
|
|
233444
233452
|
if (Array.isArray(points))
|
|
233445
|
-
return this.createFilletsInLineString(new
|
|
233446
|
-
if (points instanceof
|
|
233447
|
-
return this.createFilletsInLineString(points.packedPoints, radius,
|
|
233448
|
-
|
|
233453
|
+
return this.createFilletsInLineString(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_4__.Point3dArrayCarrier(points), radius, allowCuspOrOptions);
|
|
233454
|
+
if (points instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_5__.LineString3d)
|
|
233455
|
+
return this.createFilletsInLineString(points.packedPoints, radius, allowCuspOrOptions);
|
|
233456
|
+
let allowCusp = true;
|
|
233457
|
+
let filletClosure = false;
|
|
233458
|
+
if (typeof allowCuspOrOptions === "boolean") {
|
|
233459
|
+
allowCusp = allowCuspOrOptions;
|
|
233460
|
+
}
|
|
233461
|
+
else {
|
|
233462
|
+
allowCusp = allowCuspOrOptions.allowCusp ?? true;
|
|
233463
|
+
filletClosure = allowCuspOrOptions.filletClosure ?? false;
|
|
233464
|
+
}
|
|
233465
|
+
let n = points.length;
|
|
233466
|
+
if (filletClosure && points.almostEqualIndexIndex(0, n - 1))
|
|
233467
|
+
n--; // ignore closure point
|
|
233449
233468
|
if (n <= 1)
|
|
233450
233469
|
return undefined;
|
|
233451
|
-
const pointA =
|
|
233452
|
-
const pointB =
|
|
233453
|
-
|
|
233470
|
+
const pointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
|
|
233471
|
+
const pointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
|
|
233472
|
+
const pointC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
|
|
233454
233473
|
const blendArray = [];
|
|
233455
|
-
//
|
|
233456
|
-
|
|
233457
|
-
|
|
233458
|
-
|
|
233459
|
-
|
|
233460
|
-
if (
|
|
233461
|
-
|
|
233462
|
-
|
|
233463
|
-
|
|
233464
|
-
|
|
233465
|
-
|
|
233466
|
-
|
|
233467
|
-
blendArray.push(
|
|
233468
|
-
|
|
233469
|
-
blendArray.push({ fraction10: 0.0, fraction12: 0.0, point: pointB.clone() });
|
|
233470
|
-
pointA.setFromPoint3d(pointB);
|
|
233471
|
-
pointB.setFromPoint3d(pointC);
|
|
233474
|
+
// remark: n=2 and n=3 cases should fall out from loop logic
|
|
233475
|
+
for (let i = 0; i < n; i++) {
|
|
233476
|
+
let thisRadius = Math.abs(Array.isArray(radius) ? (i < radius.length ? radius[i] : 0) : radius);
|
|
233477
|
+
if (!Number.isFinite(thisRadius))
|
|
233478
|
+
thisRadius = 0;
|
|
233479
|
+
if (thisRadius === 0 || (!filletClosure && (i === 0 || i === n - 1))) {
|
|
233480
|
+
blendArray.push({ fraction10: 0, fraction12: 0, point: points.getPoint3dAtUncheckedPointIndex(i) });
|
|
233481
|
+
}
|
|
233482
|
+
else {
|
|
233483
|
+
points.getPoint3dAtUncheckedPointIndex(_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.modulo(i - 1, n), pointA);
|
|
233484
|
+
points.getPoint3dAtUncheckedPointIndex(i, pointB);
|
|
233485
|
+
points.getPoint3dAtUncheckedPointIndex(_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.modulo(i + 1, n), pointC);
|
|
233486
|
+
blendArray.push(_Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d.createFilletArc(pointA, pointB, pointC, thisRadius));
|
|
233487
|
+
}
|
|
233472
233488
|
}
|
|
233473
|
-
|
|
233474
|
-
if (!
|
|
233475
|
-
// suppress arcs that
|
|
233476
|
-
for (let i =
|
|
233477
|
-
const
|
|
233478
|
-
if (
|
|
233479
|
-
|
|
233480
|
-
|
|
233481
|
-
|
|
233482
|
-
|
|
233483
|
-
|
|
233484
|
-
|
|
233485
|
-
}
|
|
233486
|
-
}
|
|
233487
|
-
/* The "1-b" logic above prevents this loop from ever doing anything.
|
|
233488
|
-
// on edge with conflict, suppress the arc with larger fraction
|
|
233489
|
-
for (let i = 1; i < n; i++) {
|
|
233490
|
-
const b0 = blendArray[i - 1];
|
|
233491
|
-
const b1 = blendArray[i];
|
|
233492
|
-
if (b0.fraction12 > 1 - b1.fraction10) {
|
|
233493
|
-
const b = b0.fraction12 > b1.fraction12 ? b1 : b0;
|
|
233494
|
-
b.fraction10 = 0.0;
|
|
233495
|
-
b.fraction12 = 0.0;
|
|
233496
|
-
blendArray[i].arc = undefined;
|
|
233497
|
-
}
|
|
233498
|
-
} */
|
|
233489
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(blendArray.length === n);
|
|
233490
|
+
if (!allowCusp) {
|
|
233491
|
+
// suppress arcs that overlap a neighboring arc, or that consume the entire segment
|
|
233492
|
+
for (let i = 0; i < n; i++) {
|
|
233493
|
+
const bB = blendArray[i];
|
|
233494
|
+
if (!bB.arc)
|
|
233495
|
+
continue;
|
|
233496
|
+
const bA = blendArray[_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.modulo(i - 1, n)];
|
|
233497
|
+
const bC = blendArray[_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.modulo(i + 1, n)];
|
|
233498
|
+
if (bB.fraction10 > 1 || bB.fraction12 > 1 || 1 - bB.fraction10 < bA.fraction12 || bB.fraction12 > 1 - bC.fraction10) {
|
|
233499
|
+
bB.fraction10 = bB.fraction12 = 0;
|
|
233500
|
+
bB.arc = undefined;
|
|
233501
|
+
}
|
|
233502
|
+
}
|
|
233499
233503
|
}
|
|
233500
|
-
const path =
|
|
233501
|
-
|
|
233502
|
-
// add each path and successor edge ...
|
|
233503
|
-
for (let i = 1; i + 1 < points.length; i++) {
|
|
233504
|
+
const path = _Path__WEBPACK_IMPORTED_MODULE_7__.Path.create();
|
|
233505
|
+
for (let i = 0; i < n; i++) {
|
|
233504
233506
|
const b0 = blendArray[i];
|
|
233505
|
-
const b1 = blendArray[i + 1];
|
|
233506
233507
|
path.tryAddChild(b0.arc);
|
|
233507
|
-
|
|
233508
|
+
if (i + 1 < n || filletClosure) {
|
|
233509
|
+
const b1 = blendArray[_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.modulo(i + 1, n)];
|
|
233510
|
+
this.addPartialSegment(path, allowCusp, b0.point, b1.point, b0.fraction12, 1 - b1.fraction10);
|
|
233511
|
+
}
|
|
233508
233512
|
}
|
|
233509
233513
|
return path;
|
|
233510
233514
|
}
|
|
@@ -233514,43 +233518,43 @@ class CurveFactory {
|
|
|
233514
233518
|
* * If the radius is too large for the outer rectangle size, it is reduced to half of the the smaller x or y size.
|
|
233515
233519
|
*/
|
|
233516
233520
|
static createRectangleXY(x0, y0, x1, y1, z = 0, filletRadius) {
|
|
233517
|
-
let radius =
|
|
233521
|
+
let radius = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.correctSmallMetricDistance(filletRadius);
|
|
233518
233522
|
const xMin = Math.min(x0, x1);
|
|
233519
233523
|
const xMax = Math.max(x0, x1);
|
|
233520
233524
|
const yMin = Math.min(y0, y1);
|
|
233521
233525
|
const yMax = Math.max(y0, y1);
|
|
233522
233526
|
radius = Math.min(Math.abs(radius), 0.5 * (xMax - xMin), 0.5 * (yMax - yMin));
|
|
233523
233527
|
if (radius === 0.0)
|
|
233524
|
-
return
|
|
233525
|
-
|
|
233526
|
-
|
|
233527
|
-
|
|
233528
|
-
|
|
233529
|
-
|
|
233528
|
+
return _Loop__WEBPACK_IMPORTED_MODULE_8__.Loop.createPolygon([
|
|
233529
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(xMin, yMin, z),
|
|
233530
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(xMax, yMin, z),
|
|
233531
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(xMax, yMax, z),
|
|
233532
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(xMin, yMax, z),
|
|
233533
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(xMin, yMin, z),
|
|
233530
233534
|
]);
|
|
233531
233535
|
else {
|
|
233532
|
-
const vectorU =
|
|
233533
|
-
const vectorV =
|
|
233536
|
+
const vectorU = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.create(radius, 0, 0);
|
|
233537
|
+
const vectorV = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.create(0, radius, 0);
|
|
233534
233538
|
const x0A = xMin + radius;
|
|
233535
233539
|
const y0A = yMin + radius;
|
|
233536
233540
|
const x1A = xMax - radius;
|
|
233537
233541
|
const y1A = yMax - radius;
|
|
233538
233542
|
const centers = [
|
|
233539
|
-
|
|
233540
|
-
|
|
233541
|
-
|
|
233542
|
-
|
|
233543
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(x1A, y1A, z),
|
|
233544
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(x0A, y1A, z),
|
|
233545
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(x0A, y0A, z),
|
|
233546
|
+
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create(x1A, y0A, z),
|
|
233543
233547
|
];
|
|
233544
|
-
const loop =
|
|
233548
|
+
const loop = _Loop__WEBPACK_IMPORTED_MODULE_8__.Loop.create();
|
|
233545
233549
|
for (let i = 0; i < 4; i++) {
|
|
233546
233550
|
const center = centers[i];
|
|
233547
233551
|
const nextCenter = centers[(i + 1) % 4];
|
|
233548
|
-
const edgeVector =
|
|
233549
|
-
const arc =
|
|
233552
|
+
const edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(center, nextCenter);
|
|
233553
|
+
const arc = _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d.create(center, vectorU, vectorV, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_9__.AngleSweep.createStartEndDegrees(0, 90));
|
|
233550
233554
|
loop.tryAddChild(arc);
|
|
233551
233555
|
const arcEnd = arc.endPoint();
|
|
233552
233556
|
if (!edgeVector.isAlmostZero)
|
|
233553
|
-
loop.tryAddChild(
|
|
233557
|
+
loop.tryAddChild(_LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d.create(arcEnd, arcEnd.plus(edgeVector)));
|
|
233554
233558
|
vectorU.rotate90CCWXY(vectorU);
|
|
233555
233559
|
vectorV.rotate90CCWXY(vectorV);
|
|
233556
233560
|
}
|
|
@@ -233566,9 +233570,9 @@ class CurveFactory {
|
|
|
233566
233570
|
* @param tolerance optional coordinate tolerance for point equality (default is `Geometry.smallMetricDistance`).
|
|
233567
233571
|
* @returns whether `arcA` was modified.
|
|
233568
233572
|
*/
|
|
233569
|
-
static appendToArcInPlace(arcA, arcB, allowReverse = false, tolerance =
|
|
233573
|
+
static appendToArcInPlace(arcA, arcB, allowReverse = false, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
233570
233574
|
if (arcA.center.isAlmostEqual(arcB.center, tolerance)) {
|
|
233571
|
-
const sweepSign =
|
|
233575
|
+
const sweepSign = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.split3WaySign(arcA.sweep.sweepRadians * arcB.sweep.sweepRadians, -1, 0, 1);
|
|
233572
233576
|
// evaluate derivatives wrt radians (not fraction!), but adjust direction for sweep signs
|
|
233573
233577
|
const endA = arcA.angleToPointAndDerivative(arcA.sweep.fractionToAngle(1.0));
|
|
233574
233578
|
if (arcA.sweep.sweepRadians < 0)
|
|
@@ -233600,7 +233604,7 @@ class CurveFactory {
|
|
|
233600
233604
|
* @param fractionForIntermediateNormal fractional position for surface normal used to create the section plane.
|
|
233601
233605
|
*/
|
|
233602
233606
|
static assembleArcChainOnEllipsoid(ellipsoid, pathPoints, fractionForIntermediateNormal = 0.5) {
|
|
233603
|
-
const arcPath =
|
|
233607
|
+
const arcPath = _Path__WEBPACK_IMPORTED_MODULE_7__.Path.create();
|
|
233604
233608
|
for (let i = 0; i + 1 < pathPoints.length; i++) {
|
|
233605
233609
|
const arc = ellipsoid.sectionArcWithIntermediateNormal(pathPoints[i].toAngles(), fractionForIntermediateNormal, pathPoints[i + 1].toAngles());
|
|
233606
233610
|
arcPath.tryAddChild(arc);
|
|
@@ -233608,7 +233612,7 @@ class CurveFactory {
|
|
|
233608
233612
|
return arcPath;
|
|
233609
233613
|
}
|
|
233610
233614
|
static appendGeometryQueryArray(candidate, result) {
|
|
233611
|
-
if (candidate instanceof
|
|
233615
|
+
if (candidate instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_10__.GeometryQuery)
|
|
233612
233616
|
result.push(candidate);
|
|
233613
233617
|
else if (Array.isArray(candidate)) {
|
|
233614
233618
|
for (const p of candidate)
|
|
@@ -233621,18 +233625,18 @@ class CurveFactory {
|
|
|
233621
233625
|
* @param pipeRadius radius of pipe.
|
|
233622
233626
|
*/
|
|
233623
233627
|
static createPipeSegments(centerline, pipeRadius) {
|
|
233624
|
-
if (centerline instanceof
|
|
233625
|
-
return
|
|
233628
|
+
if (centerline instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d) {
|
|
233629
|
+
return _solid_Cone__WEBPACK_IMPORTED_MODULE_11__.Cone.createAxisPoints(centerline.startPoint(), centerline.endPoint(), pipeRadius, pipeRadius, false);
|
|
233626
233630
|
}
|
|
233627
|
-
else if (centerline instanceof
|
|
233628
|
-
return
|
|
233631
|
+
else if (centerline instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d) {
|
|
233632
|
+
return _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_12__.TorusPipe.createAlongArc(centerline, pipeRadius, false);
|
|
233629
233633
|
}
|
|
233630
|
-
else if (centerline instanceof
|
|
233631
|
-
const builder =
|
|
233634
|
+
else if (centerline instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_13__.CurvePrimitive) {
|
|
233635
|
+
const builder = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_14__.PolyfaceBuilder.create();
|
|
233632
233636
|
builder.addMiteredPipes(centerline, pipeRadius);
|
|
233633
233637
|
return builder.claimPolyface();
|
|
233634
233638
|
}
|
|
233635
|
-
else if (centerline instanceof
|
|
233639
|
+
else if (centerline instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_15__.CurveChain) {
|
|
233636
233640
|
const result = [];
|
|
233637
233641
|
for (const p of centerline.children) {
|
|
233638
233642
|
const pipe = this.createPipeSegments(p, pipeRadius);
|
|
@@ -233644,13 +233648,13 @@ class CurveFactory {
|
|
|
233644
233648
|
}
|
|
233645
233649
|
/** Get start point and tangent for variant curve data. */
|
|
233646
233650
|
static startPointAndTangent(curve) {
|
|
233647
|
-
if (curve instanceof
|
|
233651
|
+
if (curve instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_13__.CurvePrimitive)
|
|
233648
233652
|
return curve.fractionToPointAndDerivative(0.0);
|
|
233649
233653
|
if (curve.length < 2)
|
|
233650
233654
|
return undefined;
|
|
233651
233655
|
if (Array.isArray(curve))
|
|
233652
|
-
curve = new
|
|
233653
|
-
const ray =
|
|
233656
|
+
curve = new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_4__.Point3dArrayCarrier(curve);
|
|
233657
|
+
const ray = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_16__.Ray3d.createZero();
|
|
233654
233658
|
curve.getPoint3dAtUncheckedPointIndex(0, ray.origin);
|
|
233655
233659
|
curve.vectorIndexIndex(0, 1, ray.direction);
|
|
233656
233660
|
return ray;
|
|
@@ -233662,19 +233666,19 @@ class CurveFactory {
|
|
|
233662
233666
|
if (!ray)
|
|
233663
233667
|
return undefined;
|
|
233664
233668
|
let arc;
|
|
233665
|
-
if (sectionData instanceof
|
|
233669
|
+
if (sectionData instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d) {
|
|
233666
233670
|
arc = sectionData.clone();
|
|
233667
233671
|
arc.center = ray.origin;
|
|
233668
233672
|
}
|
|
233669
233673
|
else {
|
|
233670
|
-
const vector0 =
|
|
233671
|
-
const vector90 =
|
|
233674
|
+
const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.create();
|
|
233675
|
+
const vector90 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.create();
|
|
233672
233676
|
const length0 = (typeof sectionData === "number") ? sectionData : sectionData.x;
|
|
233673
233677
|
const length90 = (typeof sectionData === "number") ? sectionData : sectionData.y;
|
|
233674
|
-
const baseFrame =
|
|
233678
|
+
const baseFrame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_17__.Matrix3d.createRigidHeadsUp(ray.direction, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.ZXY);
|
|
233675
233679
|
baseFrame.columnX(vector0).scaleInPlace(length0);
|
|
233676
233680
|
baseFrame.columnY(vector90).scaleInPlace(length90);
|
|
233677
|
-
arc =
|
|
233681
|
+
arc = _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d.create(ray.origin, vector0, vector90);
|
|
233678
233682
|
}
|
|
233679
233683
|
if (arc.binormalVector().dotProduct(ray.direction) < 0.0)
|
|
233680
233684
|
arc.reverseInPlace();
|
|
@@ -233712,14 +233716,14 @@ class CurveFactory {
|
|
|
233712
233716
|
/** For a smooth curve, stroke and return unnormalized start/end tangents. */
|
|
233713
233717
|
static strokeSmoothCurve(curve, options) {
|
|
233714
233718
|
let startTangent, endTangent;
|
|
233715
|
-
if (curve instanceof
|
|
233719
|
+
if (curve instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_13__.CurvePrimitive) {
|
|
233716
233720
|
startTangent = curve.fractionToPointAndDerivative(0.0).direction;
|
|
233717
233721
|
endTangent = curve.fractionToPointAndDerivative(1.0).direction;
|
|
233718
|
-
const strokes =
|
|
233722
|
+
const strokes = _LineString3d__WEBPACK_IMPORTED_MODULE_5__.LineString3d.create();
|
|
233719
233723
|
curve.emitStrokes(strokes, options);
|
|
233720
233724
|
curve = strokes.packedPoints;
|
|
233721
233725
|
}
|
|
233722
|
-
else if (curve instanceof
|
|
233726
|
+
else if (curve instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_15__.CurveChain) {
|
|
233723
233727
|
startTangent = curve.startPointAndDerivative()?.direction;
|
|
233724
233728
|
endTangent = curve.endPointAndDerivative()?.direction;
|
|
233725
233729
|
const strokes = curve.getPackedStrokes(options);
|
|
@@ -233728,7 +233732,7 @@ class CurveFactory {
|
|
|
233728
233732
|
curve = strokes;
|
|
233729
233733
|
}
|
|
233730
233734
|
else if (Array.isArray(curve))
|
|
233731
|
-
curve = new
|
|
233735
|
+
curve = new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_4__.Point3dArrayCarrier(curve);
|
|
233732
233736
|
return { strokes: curve, startTangent, endTangent };
|
|
233733
233737
|
}
|
|
233734
233738
|
/**
|
|
@@ -233754,18 +233758,18 @@ class CurveFactory {
|
|
|
233754
233758
|
/** Reverse a closed curve or region if necessary so that its orientation is CCW with respect to the plane normal. */
|
|
233755
233759
|
static alignClosedCurveToPlane(curve, planeNormal) {
|
|
233756
233760
|
let closedCurve;
|
|
233757
|
-
if (curve instanceof
|
|
233761
|
+
if (curve instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_13__.CurvePrimitive) {
|
|
233758
233762
|
if (curve.startPoint().isAlmostEqual(curve.endPoint()))
|
|
233759
|
-
closedCurve =
|
|
233763
|
+
closedCurve = _Loop__WEBPACK_IMPORTED_MODULE_8__.Loop.create(curve);
|
|
233760
233764
|
}
|
|
233761
233765
|
else if (curve.isAnyRegion())
|
|
233762
233766
|
closedCurve = curve;
|
|
233763
233767
|
if (closedCurve) {
|
|
233764
233768
|
// The alignment condition is equivalent to positive projected curve area computed wrt to the plane normal.
|
|
233765
|
-
const toLocal =
|
|
233766
|
-
const projection = closedCurve.cloneTransformed(
|
|
233769
|
+
const toLocal = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_17__.Matrix3d.createRigidHeadsUp(planeNormal).transpose();
|
|
233770
|
+
const projection = closedCurve.cloneTransformed(_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createOriginAndMatrix(undefined, toLocal));
|
|
233767
233771
|
if (projection) { // now we can ignore z-coords
|
|
233768
|
-
const areaXY =
|
|
233772
|
+
const areaXY = _RegionOps__WEBPACK_IMPORTED_MODULE_19__.RegionOps.computeXYArea(projection);
|
|
233769
233773
|
if (areaXY && areaXY < 0)
|
|
233770
233774
|
curve.reverseInPlace();
|
|
233771
233775
|
}
|
|
@@ -233777,8 +233781,8 @@ class CurveFactory {
|
|
|
233777
233781
|
* * If unsuccessful, leave the output arrays alone and return the input section.
|
|
233778
233782
|
*/
|
|
233779
233783
|
static doSweepToPlane(output, edgePlane0, edgePlane1, targetPlane, section) {
|
|
233780
|
-
const sweepVector =
|
|
233781
|
-
const transform =
|
|
233784
|
+
const sweepVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(edgePlane0.getOriginRef(), edgePlane1.getOriginRef());
|
|
233785
|
+
const transform = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createFlattenAlongVectorToPlane(sweepVector, targetPlane.getOriginRef(), targetPlane.getNormalRef());
|
|
233782
233786
|
if (transform === undefined)
|
|
233783
233787
|
return section;
|
|
233784
233788
|
const transformedSection = section.cloneTransformed(transform);
|
|
@@ -233814,7 +233818,7 @@ class CurveFactory {
|
|
|
233814
233818
|
const rail = this.strokeSmoothCurve(centerline, options.strokeOptions);
|
|
233815
233819
|
if (!rail)
|
|
233816
233820
|
return undefined;
|
|
233817
|
-
const planes =
|
|
233821
|
+
const planes = _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_20__.PolylineOps.createBisectorPlanesForDistinctPoints(rail.strokes);
|
|
233818
233822
|
if (!planes || planes.length < 2)
|
|
233819
233823
|
return undefined;
|
|
233820
233824
|
this.alignFirstAndLastBisectorPlanes(planes[0], planes[planes.length - 1], rail, options);
|
|
@@ -233826,11 +233830,11 @@ class CurveFactory {
|
|
|
233826
233830
|
for (let i = 1; i < planes.length; i++)
|
|
233827
233831
|
currentSection = this.doSweepToPlane(sectionData, planes[i - 1], planes[i], planes[i], currentSection);
|
|
233828
233832
|
if (options.outputSelect) {
|
|
233829
|
-
const ruledSweep =
|
|
233833
|
+
const ruledSweep = _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_21__.RuledSweep.create(sectionData.sections, options.capped ?? false);
|
|
233830
233834
|
if (ruledSweep) {
|
|
233831
233835
|
sectionData.ruledSweep = ruledSweep;
|
|
233832
233836
|
if (MiteredSweepOutputSelect.AlsoMesh === options.outputSelect) {
|
|
233833
|
-
const builder =
|
|
233837
|
+
const builder = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_14__.PolyfaceBuilder.create(options.strokeOptions);
|
|
233834
233838
|
builder.addRuledSweep(ruledSweep);
|
|
233835
233839
|
sectionData.mesh = builder.claimPolyface();
|
|
233836
233840
|
}
|
|
@@ -233848,7 +233852,7 @@ class CurveFactory {
|
|
|
233848
233852
|
* @param sweep angular range. If single `Angle` is given, start angle is at 0 degrees (the start point).
|
|
233849
233853
|
*/
|
|
233850
233854
|
static createArcPointTangentRadius(start, tangentAtStart, radius, upVector, sweep) {
|
|
233851
|
-
return
|
|
233855
|
+
return _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d.createCircularStartTangentRadius(start, tangentAtStart, radius, upVector, sweep);
|
|
233852
233856
|
}
|
|
233853
233857
|
/**
|
|
233854
233858
|
* Compute 2 spirals (all in XY) for a symmetric line-to-line transition.
|
|
@@ -233861,32 +233865,32 @@ class CurveFactory {
|
|
|
233861
233865
|
* @return array with the computed spirals, or undefined if failure.
|
|
233862
233866
|
*/
|
|
233863
233867
|
static createLineSpiralSpiralLine(spiralType, startPoint, shoulderPoint, targetPoint) {
|
|
233864
|
-
const vectorAB =
|
|
233865
|
-
const vectorBC0 =
|
|
233868
|
+
const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(startPoint, shoulderPoint);
|
|
233869
|
+
const vectorBC0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(shoulderPoint, targetPoint);
|
|
233866
233870
|
const referenceLength = vectorAB.magnitude();
|
|
233867
233871
|
const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);
|
|
233868
233872
|
const lineTurnRadians = vectorAB.angleToXY(vectorBC0);
|
|
233869
233873
|
const spiralTurnRadians = 0.5 * lineTurnRadians.radians;
|
|
233870
233874
|
const radiansBC = radiansAB + lineTurnRadians.radians;
|
|
233871
|
-
const axesA =
|
|
233872
|
-
const frameA =
|
|
233875
|
+
const axesA = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_17__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(radiansAB));
|
|
233876
|
+
const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createRefs(startPoint.clone(), axesA);
|
|
233873
233877
|
// We know how much it has to turn, and but not the length or end radius.
|
|
233874
233878
|
// make a spiral of referenceLength and scale it back to the junction line
|
|
233875
|
-
const spiralARefLength =
|
|
233879
|
+
const spiralARefLength = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(0), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(spiralTurnRadians), referenceLength, undefined, frameA);
|
|
233876
233880
|
if (spiralARefLength) {
|
|
233877
233881
|
const midPlanePerpendicularRadians = radiansAB + spiralTurnRadians;
|
|
233878
|
-
const midPlanePerpendicularVector =
|
|
233882
|
+
const midPlanePerpendicularVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createPolar(1.0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(midPlanePerpendicularRadians));
|
|
233879
233883
|
const altitudeB = midPlanePerpendicularVector.dotProductStartEnd(startPoint, shoulderPoint);
|
|
233880
233884
|
const altitudeSpiralEnd = midPlanePerpendicularVector.dotProductStartEnd(startPoint, spiralARefLength.endPoint());
|
|
233881
233885
|
const scaleFactor = altitudeB / altitudeSpiralEnd;
|
|
233882
|
-
const spiralA =
|
|
233886
|
+
const spiralA = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0.0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(0), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(spiralTurnRadians), referenceLength * scaleFactor, undefined, frameA);
|
|
233883
233887
|
const distanceAB = vectorAB.magnitude();
|
|
233884
|
-
const vectorBC =
|
|
233888
|
+
const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(shoulderPoint, targetPoint);
|
|
233885
233889
|
vectorBC.scaleToLength(distanceAB, vectorBC);
|
|
233886
233890
|
const pointC = shoulderPoint.plus(vectorBC);
|
|
233887
|
-
const axesC =
|
|
233888
|
-
const frameC =
|
|
233889
|
-
const spiralC =
|
|
233891
|
+
const axesC = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_17__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(radiansBC + Math.PI));
|
|
233892
|
+
const frameC = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createRefs(pointC, axesC);
|
|
233893
|
+
const spiralC = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, -spiralA.radius01.x1, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.zero(), undefined, spiralA.curveLength(), _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_24__.Segment1d.create(1, 0), frameC);
|
|
233890
233894
|
return [spiralA, spiralC];
|
|
233891
233895
|
}
|
|
233892
233896
|
return undefined;
|
|
@@ -233902,14 +233906,14 @@ class CurveFactory {
|
|
|
233902
233906
|
* @return array with the computed spirals, or undefined if failure.
|
|
233903
233907
|
*/
|
|
233904
233908
|
static createLineSpiralSpiralLineWithSpiralLength(spiralType, pointA, pointB, pointC, spiralLength) {
|
|
233905
|
-
const vectorAB =
|
|
233906
|
-
const vectorBC =
|
|
233909
|
+
const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(pointA, pointB);
|
|
233910
|
+
const vectorBC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(pointB, pointC);
|
|
233907
233911
|
const radiansAB = Math.atan2(vectorAB.y, vectorAB.x);
|
|
233908
233912
|
const lineTurnAngle = vectorAB.angleToXY(vectorBC);
|
|
233909
233913
|
const spiralTurnRadians = 0.5 * lineTurnAngle.radians;
|
|
233910
233914
|
const bisectorRadians = 0.5 * (Math.PI - lineTurnAngle.radians);
|
|
233911
233915
|
const radiansCB = Math.atan2(-vectorBC.y, -vectorBC.x);
|
|
233912
|
-
const spiralAB0 =
|
|
233916
|
+
const spiralAB0 = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.zero(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(spiralTurnRadians), spiralLength, undefined, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createIdentity());
|
|
233913
233917
|
if (spiralAB0) {
|
|
233914
233918
|
const localEndPoint = spiralAB0.fractionToPoint(1);
|
|
233915
233919
|
const distanceAB = pointA.distance(pointB);
|
|
@@ -233917,17 +233921,17 @@ class CurveFactory {
|
|
|
233917
233921
|
// The spiral eventually has to end on the bisector, at localEndPoint.y height from the inbound line
|
|
233918
233922
|
// distance from shoulder to projection of that point to point E on the inbound line is
|
|
233919
233923
|
const distanceBE = localEndPoint.y / Math.tan(bisectorRadians);
|
|
233920
|
-
const xFractionAB =
|
|
233921
|
-
const xFractionCB =
|
|
233924
|
+
const xFractionAB = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.conditionalDivideFraction(distanceAB - distanceBE - localEndPoint.x, distanceAB);
|
|
233925
|
+
const xFractionCB = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.conditionalDivideFraction(distanceCB - distanceBE - localEndPoint.x, distanceCB);
|
|
233922
233926
|
if (xFractionAB !== undefined && xFractionCB !== undefined) {
|
|
233923
|
-
const axesA =
|
|
233927
|
+
const axesA = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_17__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(radiansAB));
|
|
233924
233928
|
const frameAOrigin = pointA.interpolate(xFractionAB, pointB);
|
|
233925
|
-
const frameA =
|
|
233926
|
-
const spiralAB =
|
|
233927
|
-
const axesB =
|
|
233929
|
+
const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createRefs(frameAOrigin, axesA);
|
|
233930
|
+
const spiralAB = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.zero(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(spiralTurnRadians), spiralLength, undefined, frameA);
|
|
233931
|
+
const axesB = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_17__.Matrix3d.createRotationAroundAxisIndex(_Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisIndex.Z, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(radiansCB));
|
|
233928
233932
|
const frameBOrigin = pointC.interpolate(xFractionCB, pointB);
|
|
233929
|
-
const frameB =
|
|
233930
|
-
const spiralBC =
|
|
233933
|
+
const frameB = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createRefs(frameBOrigin, axesB);
|
|
233934
|
+
const spiralBC = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, undefined, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.zero(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.createRadians(-spiralTurnRadians), spiralLength, undefined, frameB);
|
|
233931
233935
|
return [spiralAB, spiralBC];
|
|
233932
233936
|
}
|
|
233933
233937
|
}
|
|
@@ -233944,9 +233948,9 @@ class CurveFactory {
|
|
|
233944
233948
|
* @return array with the computed spirals, or undefined if failure.
|
|
233945
233949
|
*/
|
|
233946
233950
|
static createLineSpiralArcSpiralLine(spiralType, pointA, pointB, pointC, lengthA, lengthB, arcRadius) {
|
|
233947
|
-
const vectorAB =
|
|
233951
|
+
const vectorAB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(pointA, pointB);
|
|
233948
233952
|
vectorAB.z = 0;
|
|
233949
|
-
const vectorCB =
|
|
233953
|
+
const vectorCB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(pointC, pointB);
|
|
233950
233954
|
vectorCB.z = 0;
|
|
233951
233955
|
const unitAB = vectorAB.normalize();
|
|
233952
233956
|
const unitCB = vectorCB.normalize();
|
|
@@ -233955,12 +233959,12 @@ class CurveFactory {
|
|
|
233955
233959
|
const unitPerpAB = unitAB.unitPerpendicularXY();
|
|
233956
233960
|
const unitPerpCB = unitCB.unitPerpendicularXY();
|
|
233957
233961
|
const thetaABC = vectorAB.angleToXY(vectorCB);
|
|
233958
|
-
const sideA =
|
|
233962
|
+
const sideA = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.split3WaySign(thetaABC.radians, 1, -1, -1);
|
|
233959
233963
|
const sideB = -sideA;
|
|
233960
233964
|
const radiusA = sideA * Math.abs(arcRadius);
|
|
233961
233965
|
const radiusB = sideB * Math.abs(arcRadius);
|
|
233962
|
-
const spiralA =
|
|
233963
|
-
const spiralB =
|
|
233966
|
+
const spiralA = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, radiusA, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.zero(), undefined, lengthA, undefined, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createIdentity());
|
|
233967
|
+
const spiralB = _spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_23__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, 0, radiusB, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_22__.Angle.zero(), undefined, lengthB, undefined, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createIdentity());
|
|
233964
233968
|
const spiralEndA = spiralA.fractionToPointAndUnitTangent(1.0);
|
|
233965
233969
|
const spiralEndB = spiralB.fractionToPointAndUnitTangent(1.0);
|
|
233966
233970
|
// From the end of spiral, step away to arc center (and this is in local coordinates of each spiral)
|
|
@@ -233969,14 +233973,14 @@ class CurveFactory {
|
|
|
233969
233973
|
const sB = spiralEndB.origin.x - radiusB * spiralEndB.direction.y;
|
|
233970
233974
|
const tB = spiralEndB.origin.y + radiusB * spiralEndB.direction.x;
|
|
233971
233975
|
// Those local coordinates are rotated to unitAB and unitBC ...
|
|
233972
|
-
const vectorA =
|
|
233973
|
-
const vectorB =
|
|
233974
|
-
const uv =
|
|
233975
|
-
if (
|
|
233976
|
+
const vectorA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createAdd2Scaled(unitAB, sA, unitPerpAB, tA);
|
|
233977
|
+
const vectorB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createAdd2Scaled(unitCB, sB, unitPerpCB, tB);
|
|
233978
|
+
const uv = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_25__.Vector2d.create();
|
|
233979
|
+
if (_numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_26__.SmallSystem.linearSystem2d(unitAB.x, -unitCB.x, unitAB.y, -unitCB.y, vectorB.x - vectorA.x, vectorB.y - vectorA.y, uv)) {
|
|
233976
233980
|
const tangencyAB = pointB.plusScaled(unitAB, uv.x);
|
|
233977
233981
|
const tangencyCB = pointB.plusScaled(unitCB, uv.y);
|
|
233978
|
-
const frameA =
|
|
233979
|
-
const frameB =
|
|
233982
|
+
const frameA = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createOriginAndMatrixColumns(tangencyAB, unitAB, unitPerpAB, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.unitZ());
|
|
233983
|
+
const frameB = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createOriginAndMatrixColumns(tangencyCB, unitCB, unitPerpCB, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.unitZ());
|
|
233980
233984
|
spiralA.tryTransformInPlace(frameA);
|
|
233981
233985
|
spiralB.tryTransformInPlace(frameB);
|
|
233982
233986
|
const rayA1 = spiralA.fractionToPointAndUnitTangent(1.0);
|
|
@@ -234000,12 +234004,12 @@ class CurveFactory {
|
|
|
234000
234004
|
const normalBx = planeB.normalX();
|
|
234001
234005
|
const normalBy = planeB.normalY();
|
|
234002
234006
|
const normalBz = planeB.normalZ();
|
|
234003
|
-
const normalCx =
|
|
234004
|
-
const normalCy =
|
|
234005
|
-
const normalCz =
|
|
234006
|
-
const rayOrigin =
|
|
234007
|
+
const normalCx = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.crossProductXYXY(normalAy, normalAz, normalBy, normalBz);
|
|
234008
|
+
const normalCy = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.crossProductXYXY(normalAz, normalAx, normalBz, normalBx);
|
|
234009
|
+
const normalCz = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.crossProductXYXY(normalAx, normalAy, normalBx, normalBy);
|
|
234010
|
+
const rayOrigin = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_26__.SmallSystem.linearSystem3d(normalAx, normalAy, normalAz, normalBx, normalBy, normalBz, normalCx, normalCy, normalCz, -altitudeA, -altitudeB, 0.0);
|
|
234007
234011
|
if (rayOrigin !== undefined) {
|
|
234008
|
-
return
|
|
234012
|
+
return _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_16__.Ray3d.createXYZUVW(rayOrigin.x, rayOrigin.y, rayOrigin.z, normalCx, normalCy, normalCz);
|
|
234009
234013
|
}
|
|
234010
234014
|
return undefined;
|
|
234011
234015
|
}
|
|
@@ -256820,42 +256824,38 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
256820
256824
|
|
|
256821
256825
|
|
|
256822
256826
|
|
|
256823
|
-
/**
|
|
256827
|
+
/**
|
|
256828
|
+
* `GrowableXYArray` manages a (possibly growing) Float64Array to pack xy coordinates.
|
|
256824
256829
|
* @public
|
|
256825
256830
|
*/
|
|
256826
|
-
class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
256827
|
-
/**
|
|
256828
|
-
* array of packed xy xy xy components
|
|
256829
|
-
*/
|
|
256831
|
+
class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.IndexedReadWriteXYCollection {
|
|
256832
|
+
/** Array of packed xy xy xy components. */
|
|
256830
256833
|
_data;
|
|
256831
|
-
/**
|
|
256832
|
-
* Number of xy tuples (not floats) in the array
|
|
256833
|
-
*/
|
|
256834
|
+
/** Number of xy tuples (not floats) in the array. */
|
|
256834
256835
|
_xyInUse;
|
|
256835
|
-
/**
|
|
256836
|
-
* capacity in xy tuples. (not floats)
|
|
256837
|
-
*/
|
|
256836
|
+
/** Capacity in xy tuples. (not floats). */
|
|
256838
256837
|
_xyCapacity;
|
|
256839
|
-
/**
|
|
256840
|
-
* multiplier used by ensureCapacity to expand requested reallocation size
|
|
256841
|
-
*/
|
|
256838
|
+
/** Multiplier used by ensureCapacity to expand requested reallocation size. */
|
|
256842
256839
|
_growthFactor;
|
|
256843
|
-
/**
|
|
256844
|
-
*
|
|
256845
|
-
* @param
|
|
256840
|
+
/**
|
|
256841
|
+
* Construct a new GrowablePoint2d array.
|
|
256842
|
+
* @param numPoints initial capacity in xy tuples (default 8).
|
|
256843
|
+
* @param growthFactor used by ensureCapacity to expand requested reallocation size (default 1.5).
|
|
256844
|
+
* @param data optional pre-existing Float64Array to use as the backing memory. If supplied, numPoints is ignored.
|
|
256846
256845
|
*/
|
|
256847
|
-
constructor(numPoints = 8, growthFactor) {
|
|
256846
|
+
constructor(numPoints = 8, growthFactor, data) {
|
|
256848
256847
|
super();
|
|
256849
|
-
this._data = new Float64Array(numPoints * 2); // 2 values per point
|
|
256848
|
+
this._data = data || new Float64Array(numPoints * 2); // 2 values per point
|
|
256850
256849
|
this._xyInUse = 0;
|
|
256851
|
-
this._xyCapacity = numPoints;
|
|
256850
|
+
this._xyCapacity = data ? data.length / 2 : numPoints;
|
|
256852
256851
|
this._growthFactor = (undefined !== growthFactor && growthFactor >= 1.0) ? growthFactor : 1.5;
|
|
256853
256852
|
}
|
|
256854
|
-
/**
|
|
256855
|
-
*
|
|
256856
|
-
* @param
|
|
256857
|
-
* @param
|
|
256858
|
-
* @
|
|
256853
|
+
/**
|
|
256854
|
+
* Copy xy points from source array. Does not reallocate or change active point count.
|
|
256855
|
+
* @param source array to copy from.
|
|
256856
|
+
* @param sourceCount copy the first sourceCount points; all points if undefined.
|
|
256857
|
+
* @param destOffset copy to instance array starting at this point index; zero if undefined.
|
|
256858
|
+
* @return count and offset of points copied.
|
|
256859
256859
|
*/
|
|
256860
256860
|
copyData(source, sourceCount, destOffset) {
|
|
256861
256861
|
// validate inputs and convert from points to entries
|
|
@@ -256884,30 +256884,45 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
256884
256884
|
return { count: myCount / 2, offset: myOffset / 2 };
|
|
256885
256885
|
}
|
|
256886
256886
|
/** The number of points in use. When the length is increased, the array is padded with zeroes. */
|
|
256887
|
-
get length() {
|
|
256888
|
-
|
|
256887
|
+
get length() {
|
|
256888
|
+
return this._xyInUse;
|
|
256889
|
+
}
|
|
256890
|
+
set length(newLength) {
|
|
256891
|
+
this.resize(newLength, true);
|
|
256892
|
+
}
|
|
256889
256893
|
/** Return the number of float64 in use. */
|
|
256890
|
-
get float64Length() {
|
|
256891
|
-
|
|
256894
|
+
get float64Length() {
|
|
256895
|
+
return this._xyInUse * 2;
|
|
256896
|
+
}
|
|
256897
|
+
/**
|
|
256898
|
+
* Return the raw packed data.
|
|
256892
256899
|
* * Note that the length of the returned Float64Array is a count of doubles, and includes the excess capacity
|
|
256893
256900
|
*/
|
|
256894
|
-
float64Data() {
|
|
256895
|
-
|
|
256901
|
+
float64Data() {
|
|
256902
|
+
return this._data;
|
|
256903
|
+
}
|
|
256904
|
+
/** If necessary, increase the capacity to a new pointCount. Current coordinates and point count (length) are unchanged. */
|
|
256896
256905
|
ensureCapacity(pointCapacity, applyGrowthFactor = true) {
|
|
256897
256906
|
if (pointCapacity > this._xyCapacity) {
|
|
256898
256907
|
if (applyGrowthFactor)
|
|
256899
|
-
pointCapacity
|
|
256908
|
+
pointCapacity = Math.trunc(pointCapacity * this._growthFactor);
|
|
256900
256909
|
const prevData = this._data;
|
|
256901
|
-
this._data
|
|
256910
|
+
if (this._data.buffer instanceof ArrayBuffer)
|
|
256911
|
+
this._data = new Float64Array(new ArrayBuffer(pointCapacity * 2 * this._data.BYTES_PER_ELEMENT));
|
|
256912
|
+
else
|
|
256913
|
+
this._data = new Float64Array(new SharedArrayBuffer(pointCapacity * 2 * this._data.BYTES_PER_ELEMENT));
|
|
256902
256914
|
this.copyData(prevData, this._xyInUse);
|
|
256903
256915
|
this._xyCapacity = pointCapacity;
|
|
256904
256916
|
}
|
|
256905
256917
|
}
|
|
256906
256918
|
/**
|
|
256907
|
-
*
|
|
256908
|
-
* * If pointCount is
|
|
256909
|
-
*
|
|
256910
|
-
*
|
|
256919
|
+
* Resize the internal storage to hold a new number of points.
|
|
256920
|
+
* * If pointCount is less than current length, just reset current length to pointCount, effectively trimming active
|
|
256921
|
+
* points but preserving original capacity.
|
|
256922
|
+
* * If pointCount is greater than current length, reallocate to exactly pointCount, copy existing points, and
|
|
256923
|
+
* optionally pad excess with zero.
|
|
256924
|
+
* @param pointCount new number of active points in array.
|
|
256925
|
+
* @param padWithZero when increasing point count, whether to zero out new points (default false).
|
|
256911
256926
|
*/
|
|
256912
256927
|
resize(pointCount, padWithZero) {
|
|
256913
256928
|
if (pointCount >= 0 && pointCount < this._xyInUse)
|
|
@@ -256919,10 +256934,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
256919
256934
|
this._xyInUse = pointCount;
|
|
256920
256935
|
}
|
|
256921
256936
|
}
|
|
256922
|
-
/**
|
|
256923
|
-
* Make a copy of the (active) points in this array.
|
|
256924
|
-
* (The clone does NOT get excess capacity)
|
|
256925
|
-
*/
|
|
256937
|
+
/** Make a copy of the (active) points in this array (the clone does NOT get excess capacity). */
|
|
256926
256938
|
clone() {
|
|
256927
256939
|
const newPoints = new GrowableXYArray(this.length);
|
|
256928
256940
|
newPoints.copyData(this._data, this.length);
|
|
@@ -256940,7 +256952,9 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
256940
256952
|
* * A GrowableXYArray
|
|
256941
256953
|
* * Any json object satisfying Point3d.isXAndY
|
|
256942
256954
|
* * A Float64Array of doubles, interpreted as xyxy
|
|
256943
|
-
* * An array of any of the above
|
|
256955
|
+
* * An array of any of the above.
|
|
256956
|
+
* @param data source points.
|
|
256957
|
+
* @param result optional pre-allocated GrowableXYArray to clear and fill.
|
|
256944
256958
|
*/
|
|
256945
256959
|
static create(data, result) {
|
|
256946
256960
|
if (result) {
|
|
@@ -256953,23 +256967,32 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
256953
256967
|
result.pushFrom(data);
|
|
256954
256968
|
return result;
|
|
256955
256969
|
}
|
|
256956
|
-
/**
|
|
256970
|
+
/**
|
|
256971
|
+
* Create a new GrowableXYArray capturing the provided data. The data is not copied, just referenced.
|
|
256972
|
+
* @param data source data to capture.
|
|
256973
|
+
* @returns a new GrowableXYArray object that references the provided data.
|
|
256974
|
+
*/
|
|
256975
|
+
static createCapture(data) {
|
|
256976
|
+
return new GrowableXYArray(0, undefined, data);
|
|
256977
|
+
}
|
|
256978
|
+
/**
|
|
256979
|
+
* Restructure MultiLineStringDataVariant as array of GrowableXYZArray
|
|
256957
256980
|
* @deprecated in 4.2.0 - will not be removed until after 2026-06-13. Moved to GrowableXYZArray class.
|
|
256958
256981
|
*/
|
|
256959
256982
|
static createArrayOfGrowableXYZArray(data) {
|
|
256960
256983
|
return _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_1__.GrowableXYZArray.createArrayOfGrowableXYZArray(data);
|
|
256961
256984
|
}
|
|
256962
|
-
/**
|
|
256985
|
+
/** Push a point to the end of the array. */
|
|
256963
256986
|
push(toPush) {
|
|
256964
256987
|
this.pushXY(toPush.x, toPush.y);
|
|
256965
256988
|
}
|
|
256966
|
-
/**
|
|
256989
|
+
/** Push all points of an array. */
|
|
256967
256990
|
pushAll(points) {
|
|
256968
256991
|
this.ensureCapacity(this._xyInUse + points.length, false);
|
|
256969
256992
|
for (const p of points)
|
|
256970
256993
|
this.push(p);
|
|
256971
256994
|
}
|
|
256972
|
-
/**
|
|
256995
|
+
/** Push all points of an array. */
|
|
256973
256996
|
pushAllXYAndZ(points) {
|
|
256974
256997
|
this.ensureCapacity(this._xyInUse + points.length, false);
|
|
256975
256998
|
if (points instanceof _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_1__.GrowableXYZArray) {
|
|
@@ -256983,7 +257006,8 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
256983
257006
|
this.pushXY(p.x, p.y);
|
|
256984
257007
|
}
|
|
256985
257008
|
}
|
|
256986
|
-
/**
|
|
257009
|
+
/**
|
|
257010
|
+
* Push copies of points from variant sources.
|
|
256987
257011
|
* Valid inputs are:
|
|
256988
257012
|
* * Point2d
|
|
256989
257013
|
* * Point3d
|
|
@@ -256992,7 +257016,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
256992
257016
|
* * A GrowableXYZArray
|
|
256993
257017
|
* * Any json object satisfying Point3d.isXAndY
|
|
256994
257018
|
* * A Float64Array of doubles, interpreted as xyxy
|
|
256995
|
-
* * An array of any of the above
|
|
257019
|
+
* * An array of any of the above.
|
|
256996
257020
|
*/
|
|
256997
257021
|
pushFrom(p) {
|
|
256998
257022
|
if (p instanceof _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d) {
|
|
@@ -257014,7 +257038,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257014
257038
|
this.pushXY(p[0], p[1]);
|
|
257015
257039
|
}
|
|
257016
257040
|
else if (Array.isArray(p)) {
|
|
257017
|
-
// direct recursion re-wraps p and goes infinite
|
|
257041
|
+
// direct recursion re-wraps p and goes infinite; unroll here.
|
|
257018
257042
|
for (const q of p)
|
|
257019
257043
|
this.pushFrom(q);
|
|
257020
257044
|
}
|
|
@@ -257030,7 +257054,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257030
257054
|
}
|
|
257031
257055
|
/**
|
|
257032
257056
|
* Replicate numWrap xy values from the front of the array as new values at the end.
|
|
257033
|
-
* @param numWrap number of xy values to replicate
|
|
257057
|
+
* @param numWrap number of xy values to replicate.
|
|
257034
257058
|
*/
|
|
257035
257059
|
pushWrap(numWrap) {
|
|
257036
257060
|
if (this._xyInUse >= numWrap) {
|
|
@@ -257049,16 +257073,17 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257049
257073
|
this._data[index + 1] = y;
|
|
257050
257074
|
this._xyInUse++;
|
|
257051
257075
|
}
|
|
257052
|
-
/**
|
|
257076
|
+
/**
|
|
257077
|
+
* Remove one point from the back.
|
|
257053
257078
|
* * NOTE that (in the manner of std::vector native) this is "just" removing the point -- no point is NOT returned.
|
|
257054
|
-
* * Use `back ()` to get the last x,y assembled into a `Point2d
|
|
257079
|
+
* * Use `back ()` to get the last x,y assembled into a `Point2d`.
|
|
257055
257080
|
*/
|
|
257056
257081
|
pop() {
|
|
257057
257082
|
if (this._xyInUse > 0)
|
|
257058
257083
|
this._xyInUse--;
|
|
257059
257084
|
}
|
|
257060
257085
|
/**
|
|
257061
|
-
* Test if index is valid for an xy (point or vector) within this array
|
|
257086
|
+
* Test if index is valid for an xy (point or vector) within this array.
|
|
257062
257087
|
* @param index xy index to test.
|
|
257063
257088
|
*/
|
|
257064
257089
|
isIndexValid(index) {
|
|
@@ -257066,38 +257091,34 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257066
257091
|
return false;
|
|
257067
257092
|
return true;
|
|
257068
257093
|
}
|
|
257069
|
-
/**
|
|
257070
|
-
* Clear all xy data, but leave capacity unchanged.
|
|
257071
|
-
*/
|
|
257094
|
+
/** Clear all xy data, but leave capacity unchanged. */
|
|
257072
257095
|
clear() {
|
|
257073
257096
|
this._xyInUse = 0;
|
|
257074
257097
|
}
|
|
257075
257098
|
/**
|
|
257076
|
-
* Get a point by index, strongly typed as a Point2d
|
|
257077
|
-
* @param pointIndex index to access
|
|
257078
|
-
* @param result optional result
|
|
257099
|
+
* Get a point by index, strongly typed as a `Point2d`. This is unchecked. Use atPoint2dIndex to have validity test.
|
|
257100
|
+
* @param pointIndex index to access.
|
|
257101
|
+
* @param result optional result.
|
|
257079
257102
|
*/
|
|
257080
257103
|
getPoint2dAtUncheckedPointIndex(pointIndex, result) {
|
|
257081
257104
|
const index = 2 * pointIndex;
|
|
257082
257105
|
return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Point2d.create(this._data[index], this._data[index + 1], result);
|
|
257083
257106
|
}
|
|
257084
257107
|
/**
|
|
257085
|
-
* Get x coordinate by point index, with no index checking
|
|
257086
|
-
* @param pointIndex index to access
|
|
257108
|
+
* Get x coordinate by point index, with no index checking.
|
|
257109
|
+
* @param pointIndex index to access.
|
|
257087
257110
|
*/
|
|
257088
257111
|
getXAtUncheckedPointIndex(pointIndex) {
|
|
257089
257112
|
return this._data[2 * pointIndex];
|
|
257090
257113
|
}
|
|
257091
257114
|
/**
|
|
257092
|
-
* Get y coordinate by point index, with no index checking
|
|
257093
|
-
* @param pointIndex index to access
|
|
257115
|
+
* Get y coordinate by point index, with no index checking.
|
|
257116
|
+
* @param pointIndex index to access.
|
|
257094
257117
|
*/
|
|
257095
257118
|
getYAtUncheckedPointIndex(pointIndex) {
|
|
257096
257119
|
return this._data[2 * pointIndex + 1];
|
|
257097
257120
|
}
|
|
257098
|
-
/**
|
|
257099
|
-
* Gather all points as a Point2d[]
|
|
257100
|
-
*/
|
|
257121
|
+
/** Gather all points as a Point2d[]. */
|
|
257101
257122
|
getPoint2dArray() {
|
|
257102
257123
|
const n = 2 * this._xyInUse;
|
|
257103
257124
|
const result = [];
|
|
@@ -257106,7 +257127,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257106
257127
|
result.push(_Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Point2d.create(data[i], data[i + 1]));
|
|
257107
257128
|
return result;
|
|
257108
257129
|
}
|
|
257109
|
-
/**
|
|
257130
|
+
/** Copy xy into strongly typed Point2d. */
|
|
257110
257131
|
getPoint2dAtCheckedPointIndex(pointIndex, result) {
|
|
257111
257132
|
if (this.isIndexValid(pointIndex)) {
|
|
257112
257133
|
const index = 2 * pointIndex;
|
|
@@ -257114,7 +257135,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257114
257135
|
}
|
|
257115
257136
|
return undefined;
|
|
257116
257137
|
}
|
|
257117
|
-
/**
|
|
257138
|
+
/** Copy xy into strongly typed Vector2d. */
|
|
257118
257139
|
getVector2dAtCheckedVectorIndex(vectorIndex, result) {
|
|
257119
257140
|
if (this.isIndexValid(vectorIndex)) {
|
|
257120
257141
|
const index = 2 * vectorIndex;
|
|
@@ -257124,9 +257145,9 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257124
257145
|
}
|
|
257125
257146
|
/**
|
|
257126
257147
|
* Read coordinates from source array, place them at index within this array.
|
|
257127
|
-
* @param destIndex point index where coordinates are to be placed in this array
|
|
257128
|
-
* @param source source array
|
|
257129
|
-
* @param sourceIndex point index in source array
|
|
257148
|
+
* @param destIndex point index where coordinates are to be placed in this array.
|
|
257149
|
+
* @param source source array.
|
|
257150
|
+
* @param sourceIndex point index in source array.
|
|
257130
257151
|
* @returns true if destIndex and sourceIndex are both valid.
|
|
257131
257152
|
*/
|
|
257132
257153
|
transferFromGrowableXYArray(destIndex, source, sourceIndex) {
|
|
@@ -257140,13 +257161,13 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257140
257161
|
return false;
|
|
257141
257162
|
}
|
|
257142
257163
|
/**
|
|
257143
|
-
*
|
|
257144
|
-
* @param source source array
|
|
257145
|
-
* @param sourceIndex xy index within the source. If undefined, push entire contents of source
|
|
257164
|
+
* Push coordinates from the source array to the end of this array.
|
|
257165
|
+
* @param source source array.
|
|
257166
|
+
* @param sourceIndex xy index within the source. If undefined, push entire contents of source.
|
|
257146
257167
|
* @returns number of points pushed.
|
|
257147
257168
|
*/
|
|
257148
257169
|
pushFromGrowableXYArray(source, sourceIndex) {
|
|
257149
|
-
// full array push
|
|
257170
|
+
// full array push
|
|
257150
257171
|
if (sourceIndex === undefined) {
|
|
257151
257172
|
const numXYAdd = source.length;
|
|
257152
257173
|
this.ensureCapacity(this.length + numXYAdd, false);
|
|
@@ -257154,7 +257175,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257154
257175
|
this._xyInUse += numXYAdd;
|
|
257155
257176
|
return numXYAdd;
|
|
257156
257177
|
}
|
|
257157
|
-
// single point push
|
|
257178
|
+
// single point push
|
|
257158
257179
|
if (source.isIndexValid(sourceIndex)) {
|
|
257159
257180
|
const j = sourceIndex * 2;
|
|
257160
257181
|
this.pushXY(source._data[j], source._data[j + 1]);
|
|
@@ -257163,8 +257184,8 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257163
257184
|
return 0;
|
|
257164
257185
|
}
|
|
257165
257186
|
/**
|
|
257166
|
-
* * Compute a point at fractional coordinate between points i and j of source
|
|
257167
|
-
* *
|
|
257187
|
+
* * Compute a point at fractional coordinate between points i and j of source.
|
|
257188
|
+
* * Push onto this array.
|
|
257168
257189
|
*/
|
|
257169
257190
|
pushInterpolatedFromGrowableXYArray(source, i, fraction, j) {
|
|
257170
257191
|
if (source.isIndexValid(i) && source.isIndexValid(j)) {
|
|
@@ -257177,7 +257198,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257177
257198
|
}
|
|
257178
257199
|
/**
|
|
257179
257200
|
* Create an array of xy points from source xyz points.
|
|
257180
|
-
* @param source source array of xyz
|
|
257201
|
+
* @param source source array of xyz.
|
|
257181
257202
|
* @param transform optional transform to apply to xyz points.
|
|
257182
257203
|
* @param dest optional result.
|
|
257183
257204
|
*/
|
|
@@ -257205,17 +257226,13 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257205
257226
|
}
|
|
257206
257227
|
return dest;
|
|
257207
257228
|
}
|
|
257208
|
-
/**
|
|
257209
|
-
* Return the first point, or undefined if the array is empty.
|
|
257210
|
-
*/
|
|
257229
|
+
/** Return the first point, or undefined if the array is empty. */
|
|
257211
257230
|
front(result) {
|
|
257212
257231
|
if (this._xyInUse === 0)
|
|
257213
257232
|
return undefined;
|
|
257214
257233
|
return this.getPoint2dAtUncheckedPointIndex(0, result);
|
|
257215
257234
|
}
|
|
257216
|
-
/**
|
|
257217
|
-
* Return the last point, or undefined if the array is empty.
|
|
257218
|
-
*/
|
|
257235
|
+
/** Return the last point, or undefined if the array is empty. */
|
|
257219
257236
|
back(result) {
|
|
257220
257237
|
if (this._xyInUse < 1)
|
|
257221
257238
|
return undefined;
|
|
@@ -257223,8 +257240,8 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257223
257240
|
}
|
|
257224
257241
|
/**
|
|
257225
257242
|
* Set the coordinates of a single point.
|
|
257226
|
-
* @param pointIndex index of point to set
|
|
257227
|
-
* @param value coordinates to set
|
|
257243
|
+
* @param pointIndex index of point to set.
|
|
257244
|
+
* @param value coordinates to set.
|
|
257228
257245
|
*/
|
|
257229
257246
|
setAtCheckedPointIndex(pointIndex, value) {
|
|
257230
257247
|
if (!this.isIndexValid(pointIndex))
|
|
@@ -257236,9 +257253,9 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257236
257253
|
}
|
|
257237
257254
|
/**
|
|
257238
257255
|
* Set the coordinates of a single point given as coordinates.
|
|
257239
|
-
* @param pointIndex index of point to set
|
|
257240
|
-
* @param x x coordinate
|
|
257241
|
-
* @param y y coordinate
|
|
257256
|
+
* @param pointIndex index of point to set.
|
|
257257
|
+
* @param x x coordinate.
|
|
257258
|
+
* @param y y coordinate.
|
|
257242
257259
|
*/
|
|
257243
257260
|
setXYAtCheckedPointIndex(pointIndex, x, y) {
|
|
257244
257261
|
if (!this.isIndexValid(pointIndex))
|
|
@@ -257248,9 +257265,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257248
257265
|
this._data[index + 1] = y;
|
|
257249
257266
|
return true;
|
|
257250
257267
|
}
|
|
257251
|
-
/**
|
|
257252
|
-
* Copy all points into a simple array of Point3d with given z.
|
|
257253
|
-
*/
|
|
257268
|
+
/** Copy all points into a simple array of Point3d with given z. */
|
|
257254
257269
|
getPoint3dArray(z = 0) {
|
|
257255
257270
|
const n = 2 * this._xyInUse;
|
|
257256
257271
|
const result = [];
|
|
@@ -257259,7 +257274,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257259
257274
|
result.push(_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(data[i], data[i + 1], z));
|
|
257260
257275
|
return result;
|
|
257261
257276
|
}
|
|
257262
|
-
/**
|
|
257277
|
+
/** Reverse the order of points. */
|
|
257263
257278
|
reverseInPlace() {
|
|
257264
257279
|
const n = this.length;
|
|
257265
257280
|
let j0, j1;
|
|
@@ -257278,7 +257293,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257278
257293
|
data[j1] = a;
|
|
257279
257294
|
}
|
|
257280
257295
|
}
|
|
257281
|
-
/**
|
|
257296
|
+
/** Multiply each point by the transform, replace values. */
|
|
257282
257297
|
multiplyTransformInPlace(transform) {
|
|
257283
257298
|
const data = this._data;
|
|
257284
257299
|
const nDouble = this.float64Length;
|
|
@@ -257295,7 +257310,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257295
257310
|
data[i + 1] = coffs[3] * x + coffs[4] * y + y0;
|
|
257296
257311
|
}
|
|
257297
257312
|
}
|
|
257298
|
-
/**
|
|
257313
|
+
/** Multiply each xy (as a vector) by matrix, replace values. */
|
|
257299
257314
|
multiplyMatrix3dInPlace(matrix) {
|
|
257300
257315
|
const data = this._data;
|
|
257301
257316
|
const nDouble = this.float64Length;
|
|
@@ -257309,7 +257324,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257309
257324
|
data[i + 1] = coffs[3] * x + coffs[4] * y;
|
|
257310
257325
|
}
|
|
257311
257326
|
}
|
|
257312
|
-
/**
|
|
257327
|
+
/** Multiply each point by the transform, replace values. */
|
|
257313
257328
|
tryTransformInverseInPlace(transform) {
|
|
257314
257329
|
const data = this._data;
|
|
257315
257330
|
const nDouble = this.float64Length;
|
|
@@ -257344,7 +257359,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257344
257359
|
rangeToExtend.extendXY(data[i], data[i + 1]);
|
|
257345
257360
|
}
|
|
257346
257361
|
}
|
|
257347
|
-
/**
|
|
257362
|
+
/** Sum the lengths of segments between points. */
|
|
257348
257363
|
sumLengths() {
|
|
257349
257364
|
let sum = 0.0;
|
|
257350
257365
|
const n = 2 * (this._xyInUse - 1); // Length already takes into account what specifically is in use
|
|
@@ -257355,7 +257370,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257355
257370
|
}
|
|
257356
257371
|
/**
|
|
257357
257372
|
* Multiply each x,y by the scale factor.
|
|
257358
|
-
* @param factor
|
|
257373
|
+
* @param factor scale factor.
|
|
257359
257374
|
*/
|
|
257360
257375
|
scaleInPlace(factor) {
|
|
257361
257376
|
if (this._data) {
|
|
@@ -257364,7 +257379,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257364
257379
|
this._data[i] = this._data[i] * factor;
|
|
257365
257380
|
}
|
|
257366
257381
|
}
|
|
257367
|
-
/** Compute a point at fractional coordinate between points i and j */
|
|
257382
|
+
/** Compute a point at fractional coordinate between points i and j. */
|
|
257368
257383
|
interpolate(i, fraction, j, result) {
|
|
257369
257384
|
if (this.isIndexValid(i) && this.isIndexValid(j)) {
|
|
257370
257385
|
const fraction0 = 1.0 - fraction;
|
|
@@ -257375,10 +257390,10 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257375
257390
|
}
|
|
257376
257391
|
return undefined;
|
|
257377
257392
|
}
|
|
257378
|
-
/** Sum the signed areas of the projection to xy plane */
|
|
257393
|
+
/** Sum the signed areas of the projection to xy plane. */
|
|
257379
257394
|
areaXY() {
|
|
257380
257395
|
let area = 0.0;
|
|
257381
|
-
const n = 2 * this._xyInUse; // float count
|
|
257396
|
+
const n = 2 * this._xyInUse; // float count
|
|
257382
257397
|
if (n > 4) {
|
|
257383
257398
|
const x0 = this._data[n - 2];
|
|
257384
257399
|
const y0 = this._data[n - 1];
|
|
@@ -257394,7 +257409,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257394
257409
|
}
|
|
257395
257410
|
return 0.5 * area;
|
|
257396
257411
|
}
|
|
257397
|
-
/** Compute a vector from index origin i to indexed target j
|
|
257412
|
+
/** Compute a vector from index origin i to indexed target j. */
|
|
257398
257413
|
vectorIndexIndex(i, j, result) {
|
|
257399
257414
|
if (!this.isIndexValid(i) || !this.isIndexValid(j))
|
|
257400
257415
|
return undefined;
|
|
@@ -257403,7 +257418,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257403
257418
|
j = 2 * j;
|
|
257404
257419
|
return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Vector2d.create(data[j] - data[i], data[j + 1] - data[i + 1], result);
|
|
257405
257420
|
}
|
|
257406
|
-
/** Compute a vector from origin to indexed target j */
|
|
257421
|
+
/** Compute a vector from origin to indexed target j. */
|
|
257407
257422
|
vectorXAndYIndex(origin, j, result) {
|
|
257408
257423
|
if (this.isIndexValid(j)) {
|
|
257409
257424
|
const data = this._data;
|
|
@@ -257412,7 +257427,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257412
257427
|
}
|
|
257413
257428
|
return undefined;
|
|
257414
257429
|
}
|
|
257415
|
-
/** Compute the cross product of vectors from from indexed origin to indexed targets i and j */
|
|
257430
|
+
/** Compute the cross product of vectors from from indexed origin to indexed targets i and j. */
|
|
257416
257431
|
crossProductIndexIndexIndex(originIndex, targetAIndex, targetBIndex) {
|
|
257417
257432
|
if (this.isIndexValid(originIndex) && this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {
|
|
257418
257433
|
const i = originIndex * 2;
|
|
@@ -257423,7 +257438,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257423
257438
|
}
|
|
257424
257439
|
return undefined;
|
|
257425
257440
|
}
|
|
257426
|
-
/** Compute the cross product of vectors from from origin to indexed targets i and j */
|
|
257441
|
+
/** Compute the cross product of vectors from from origin to indexed targets i and j. */
|
|
257427
257442
|
crossProductXAndYIndexIndex(origin, targetAIndex, targetBIndex) {
|
|
257428
257443
|
if (this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {
|
|
257429
257444
|
const j = targetAIndex * 2;
|
|
@@ -257463,7 +257478,7 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257463
257478
|
// if both are null it is equal, otherwise unequal
|
|
257464
257479
|
return (!dataA && !dataB);
|
|
257465
257480
|
}
|
|
257466
|
-
/** Return an array of block indices sorted per compareLexicalBlock function */
|
|
257481
|
+
/** Return an array of block indices sorted per compareLexicalBlock function. */
|
|
257467
257482
|
sortIndicesLexical() {
|
|
257468
257483
|
const n = this._xyInUse;
|
|
257469
257484
|
// let numCompare = 0;
|
|
@@ -257489,13 +257504,13 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
257489
257504
|
if (ax < bx)
|
|
257490
257505
|
return -1;
|
|
257491
257506
|
}
|
|
257492
|
-
return ia - ib; // so original order is maintained among duplicates
|
|
257507
|
+
return ia - ib; // so original order is maintained among duplicates
|
|
257493
257508
|
}
|
|
257494
|
-
/** Access a single double at offset within a block.
|
|
257509
|
+
/** Access a single double at offset within a block. This has no index checking. */
|
|
257495
257510
|
component(pointIndex, componentIndex) {
|
|
257496
257511
|
return this._data[2 * pointIndex + componentIndex];
|
|
257497
257512
|
}
|
|
257498
|
-
/** Toleranced equality test */
|
|
257513
|
+
/** Toleranced equality test. */
|
|
257499
257514
|
isAlmostEqual(other, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.smallMetricDistance) {
|
|
257500
257515
|
const numXY = this._xyInUse;
|
|
257501
257516
|
if (other._xyInUse !== numXY)
|
|
@@ -257545,42 +257560,38 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
257545
257560
|
|
|
257546
257561
|
|
|
257547
257562
|
|
|
257548
|
-
/**
|
|
257563
|
+
/**
|
|
257564
|
+
* `GrowableXYZArray` manages a (possibly growing) Float64Array to pack xyz coordinates.
|
|
257549
257565
|
* @public
|
|
257550
257566
|
*/
|
|
257551
257567
|
class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0__.IndexedReadWriteXYZCollection {
|
|
257552
|
-
/**
|
|
257553
|
-
* array of packed xyz xyz xyz components
|
|
257554
|
-
*/
|
|
257568
|
+
/** Array of packed xyz xyz xyz components. */
|
|
257555
257569
|
_data;
|
|
257556
|
-
/**
|
|
257557
|
-
* Number of xyz triples (not floats) in the array
|
|
257558
|
-
*/
|
|
257570
|
+
/** Number of xyz triples (not floats) in the array. */
|
|
257559
257571
|
_xyzInUse;
|
|
257560
|
-
/**
|
|
257561
|
-
* capacity in xyz triples. (not floats)
|
|
257562
|
-
*/
|
|
257572
|
+
/** Capacity in xyz triples (not floats). */
|
|
257563
257573
|
_xyzCapacity;
|
|
257564
|
-
/**
|
|
257565
|
-
* multiplier used by ensureCapacity to expand requested reallocation size
|
|
257566
|
-
*/
|
|
257574
|
+
/** Multiplier used by ensureCapacity to expand requested reallocation size. */
|
|
257567
257575
|
_growthFactor;
|
|
257568
|
-
/**
|
|
257569
|
-
*
|
|
257570
|
-
* @param
|
|
257576
|
+
/**
|
|
257577
|
+
* Construct a new GrowablePoint3d array.
|
|
257578
|
+
* @param numPoints initial capacity in xyz triples (default 8).
|
|
257579
|
+
* @param growthFactor used by ensureCapacity to expand requested reallocation size (default 1.5).
|
|
257580
|
+
* @param data optional pre-existing Float64Array to use as the backing memory. If supplied, numPoints is ignored.
|
|
257571
257581
|
*/
|
|
257572
|
-
constructor(numPoints = 8, growthFactor) {
|
|
257582
|
+
constructor(numPoints = 8, growthFactor, data) {
|
|
257573
257583
|
super();
|
|
257574
|
-
this._data = new Float64Array(numPoints * 3); // 3 values per point
|
|
257584
|
+
this._data = data || new Float64Array(numPoints * 3); // 3 values per point
|
|
257575
257585
|
this._xyzInUse = 0;
|
|
257576
|
-
this._xyzCapacity = numPoints;
|
|
257586
|
+
this._xyzCapacity = data ? data.length / 3 : numPoints;
|
|
257577
257587
|
this._growthFactor = (undefined !== growthFactor && growthFactor >= 1.0) ? growthFactor : 1.5;
|
|
257578
257588
|
}
|
|
257579
|
-
/**
|
|
257580
|
-
*
|
|
257581
|
-
* @param
|
|
257582
|
-
* @param
|
|
257583
|
-
* @
|
|
257589
|
+
/**
|
|
257590
|
+
* Copy xyz points from source array. Does not reallocate or change active point count.
|
|
257591
|
+
* @param source array to copy from.
|
|
257592
|
+
* @param sourceCount copy the first sourceCount points; all points if undefined.
|
|
257593
|
+
* @param destOffset copy to instance array starting at this point index; zero if undefined.
|
|
257594
|
+
* @return count and offset of points copied.
|
|
257584
257595
|
*/
|
|
257585
257596
|
copyData(source, sourceCount, destOffset) {
|
|
257586
257597
|
// validate inputs and convert from points to entries
|
|
@@ -257609,30 +257620,47 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257609
257620
|
return { count: myCount / 3, offset: myOffset / 3 };
|
|
257610
257621
|
}
|
|
257611
257622
|
/** The number of points in use. When the length is increased, the array is padded with zeroes. */
|
|
257612
|
-
get length() {
|
|
257613
|
-
|
|
257623
|
+
get length() {
|
|
257624
|
+
return this._xyzInUse;
|
|
257625
|
+
}
|
|
257626
|
+
set length(newLength) {
|
|
257627
|
+
this.resize(newLength, true);
|
|
257628
|
+
}
|
|
257614
257629
|
/** Return the number of float64 in use. */
|
|
257615
|
-
get float64Length() {
|
|
257616
|
-
|
|
257630
|
+
get float64Length() {
|
|
257631
|
+
return this._xyzInUse * 3;
|
|
257632
|
+
}
|
|
257633
|
+
/**
|
|
257634
|
+
* Return the raw packed data.
|
|
257617
257635
|
* * Note that the length of the returned Float64Array is a count of doubles, and includes the excess capacity
|
|
257618
257636
|
*/
|
|
257619
|
-
float64Data() {
|
|
257620
|
-
|
|
257637
|
+
float64Data() {
|
|
257638
|
+
return this._data;
|
|
257639
|
+
}
|
|
257640
|
+
/**
|
|
257641
|
+
* If necessary, increase the capacity to the new number of points. Current coordinates and point count (length) are
|
|
257642
|
+
* unchanged.
|
|
257643
|
+
*/
|
|
257621
257644
|
ensureCapacity(pointCapacity, applyGrowthFactor = true) {
|
|
257622
257645
|
if (pointCapacity > this._xyzCapacity) {
|
|
257623
257646
|
if (applyGrowthFactor)
|
|
257624
|
-
pointCapacity
|
|
257647
|
+
pointCapacity = Math.trunc(pointCapacity * this._growthFactor);
|
|
257625
257648
|
const prevData = this._data;
|
|
257626
|
-
this._data
|
|
257649
|
+
if (this._data.buffer instanceof ArrayBuffer)
|
|
257650
|
+
this._data = new Float64Array(new ArrayBuffer(pointCapacity * 3 * this._data.BYTES_PER_ELEMENT));
|
|
257651
|
+
else
|
|
257652
|
+
this._data = new Float64Array(new SharedArrayBuffer(pointCapacity * 3 * this._data.BYTES_PER_ELEMENT));
|
|
257627
257653
|
this.copyData(prevData, this._xyzInUse);
|
|
257628
257654
|
this._xyzCapacity = pointCapacity;
|
|
257629
257655
|
}
|
|
257630
257656
|
}
|
|
257631
257657
|
/**
|
|
257632
|
-
* * If pointCount is less than current length, just reset current length to pointCount, effectively trimming active
|
|
257633
|
-
*
|
|
257634
|
-
*
|
|
257635
|
-
*
|
|
257658
|
+
* * If pointCount is less than current length, just reset current length to pointCount, effectively trimming active
|
|
257659
|
+
* points but preserving original capacity.
|
|
257660
|
+
* * If pointCount is greater than current length, reallocate to exactly pointCount, copy existing points, and
|
|
257661
|
+
* optionally pad excess with zero.
|
|
257662
|
+
* @param pointCount new number of active points in array.
|
|
257663
|
+
* @param padWithZero when increasing point count, whether to zero out new points (default false).
|
|
257636
257664
|
*/
|
|
257637
257665
|
resize(pointCount, padWithZero) {
|
|
257638
257666
|
if (pointCount >= 0 && pointCount < this._xyzInUse)
|
|
@@ -257644,10 +257672,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257644
257672
|
this._xyzInUse = pointCount;
|
|
257645
257673
|
}
|
|
257646
257674
|
}
|
|
257647
|
-
/**
|
|
257648
|
-
* Make a copy of the (active) points in this array.
|
|
257649
|
-
* (The clone does NOT get excess capacity)
|
|
257650
|
-
*/
|
|
257675
|
+
/** Make a copy of the (active) points in this array (the clone does NOT get excess capacity). */
|
|
257651
257676
|
clone(result) {
|
|
257652
257677
|
if (!result)
|
|
257653
257678
|
result = new GrowableXYZArray(this.length);
|
|
@@ -257663,11 +257688,11 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257663
257688
|
/**
|
|
257664
257689
|
* Clone the input array with each successive duplicate point removed.
|
|
257665
257690
|
* * First and last points are always preserved.
|
|
257666
|
-
* @param source the source array
|
|
257667
|
-
* @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])
|
|
257691
|
+
* @param source the source array.
|
|
257692
|
+
* @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]]).
|
|
257668
257693
|
* @param result optional pre-allocated object to populate and return. Can be a reference to `source`, in
|
|
257669
257694
|
* which case the array is compressed in place and returned.
|
|
257670
|
-
* @see [[cloneCompressed]], [[compressInPlace]], [[PolylineOps.compressShortEdges]]
|
|
257695
|
+
* @see [[cloneCompressed]], [[compressInPlace]], [[PolylineOps.compressShortEdges]].
|
|
257671
257696
|
*/
|
|
257672
257697
|
static createCompressed(source, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance, result) {
|
|
257673
257698
|
const dupIndices = source.findOrderedDuplicates(tolerance, true);
|
|
@@ -257701,9 +257726,9 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257701
257726
|
/**
|
|
257702
257727
|
* Compress the input array by removing successive duplicate points.
|
|
257703
257728
|
* * First and last points are always preserved.
|
|
257704
|
-
* @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])
|
|
257729
|
+
* @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]]).
|
|
257705
257730
|
* @returns the instance array.
|
|
257706
|
-
* @see [[createCompressed]], [[cloneCompressed]], [[PolylineOps.compressShortEdges]]
|
|
257731
|
+
* @see [[createCompressed]], [[cloneCompressed]], [[PolylineOps.compressShortEdges]].
|
|
257707
257732
|
*/
|
|
257708
257733
|
compressInPlace(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
257709
257734
|
return GrowableXYZArray.createCompressed(this, tolerance, this);
|
|
@@ -257734,23 +257759,32 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257734
257759
|
result.pushFrom(data);
|
|
257735
257760
|
return result;
|
|
257736
257761
|
}
|
|
257737
|
-
/**
|
|
257762
|
+
/**
|
|
257763
|
+
* Create a new GrowableXYZArray capturing the provided data. The data is not copied, just referenced.
|
|
257764
|
+
* @param data source data to capture.
|
|
257765
|
+
* @returns a new GrowableXYZArray object that references the provided data.
|
|
257766
|
+
*/
|
|
257767
|
+
static createCapture(data) {
|
|
257768
|
+
return new GrowableXYZArray(0, undefined, data);
|
|
257769
|
+
}
|
|
257770
|
+
/** Restructure MultiLineStringDataVariant as array of GrowableXYZArray. */
|
|
257738
257771
|
static createArrayOfGrowableXYZArray(data) {
|
|
257739
257772
|
const collector = new _PointStreaming__WEBPACK_IMPORTED_MODULE_2__.PointStreamGrowableXYZArrayCollector();
|
|
257740
257773
|
_PointStreaming__WEBPACK_IMPORTED_MODULE_2__.VariantPointDataStream.streamXYZ(data, collector);
|
|
257741
257774
|
return collector.claimArrayOfGrowableXYZArray();
|
|
257742
257775
|
}
|
|
257743
|
-
/**
|
|
257776
|
+
/** Push a point to the end of the array. */
|
|
257744
257777
|
push(toPush) {
|
|
257745
257778
|
this.pushXYZ(toPush.x, toPush.y, toPush.z);
|
|
257746
257779
|
}
|
|
257747
|
-
/**
|
|
257780
|
+
/** Push all points of an array. */
|
|
257748
257781
|
pushAll(points) {
|
|
257749
257782
|
this.ensureCapacity(this._xyzInUse + points.length, false);
|
|
257750
257783
|
for (const p of points)
|
|
257751
257784
|
this.push(p);
|
|
257752
257785
|
}
|
|
257753
|
-
/**
|
|
257786
|
+
/**
|
|
257787
|
+
* Push copies of points from variant sources.
|
|
257754
257788
|
* Valid inputs are:
|
|
257755
257789
|
* * Point2d
|
|
257756
257790
|
* * Point3d
|
|
@@ -257760,7 +257794,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257760
257794
|
* * Any json object satisfying Point3d.isXYAndZ
|
|
257761
257795
|
* * Any json object satisfying Point3d.isXAndY
|
|
257762
257796
|
* * A Float64Array of doubles, interpreted as xyzxyz
|
|
257763
|
-
* * An array of any of the above
|
|
257797
|
+
* * An array of any of the above.
|
|
257764
257798
|
*/
|
|
257765
257799
|
pushFrom(p) {
|
|
257766
257800
|
if (p instanceof _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d)
|
|
@@ -257780,7 +257814,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257780
257814
|
else if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(p, 2))
|
|
257781
257815
|
this.pushXYZ(p[0], p[1], 0.0);
|
|
257782
257816
|
else if (Array.isArray(p)) {
|
|
257783
|
-
// direct recursion re-wraps p and goes infinite
|
|
257817
|
+
// direct recursion re-wraps p and goes infinite; unroll here.
|
|
257784
257818
|
for (const q of p)
|
|
257785
257819
|
this.pushFrom(q);
|
|
257786
257820
|
}
|
|
@@ -257797,7 +257831,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257797
257831
|
}
|
|
257798
257832
|
/**
|
|
257799
257833
|
* Replicate numWrap xyz values from the front of the array as new values at the end.
|
|
257800
|
-
* @param numWrap number of xyz values to replicate
|
|
257834
|
+
* @param numWrap number of xyz values to replicate.
|
|
257801
257835
|
*/
|
|
257802
257836
|
pushWrap(numWrap) {
|
|
257803
257837
|
if (this._xyzInUse >= numWrap) {
|
|
@@ -257808,7 +257842,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257808
257842
|
}
|
|
257809
257843
|
}
|
|
257810
257844
|
}
|
|
257811
|
-
/**
|
|
257845
|
+
/** Append a new point with given x,y,z. */
|
|
257812
257846
|
pushXYZ(x, y, z) {
|
|
257813
257847
|
this.ensureCapacity(this._xyzInUse + 1);
|
|
257814
257848
|
const index = this._xyzInUse * 3;
|
|
@@ -257817,10 +257851,11 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257817
257851
|
this._data[index + 2] = z;
|
|
257818
257852
|
this._xyzInUse++;
|
|
257819
257853
|
}
|
|
257820
|
-
/**
|
|
257854
|
+
/**
|
|
257855
|
+
* Shift all data forward to make space for numPoints at the front.
|
|
257821
257856
|
* * Leading (3*numPoints) doubles are left with prior contents.
|
|
257822
|
-
* * _xyzInUse count is increased
|
|
257823
|
-
|
|
257857
|
+
* * _xyzInUse count is increased.
|
|
257858
|
+
*/
|
|
257824
257859
|
shiftForward(numPoints) {
|
|
257825
257860
|
if (numPoints <= 0)
|
|
257826
257861
|
return;
|
|
@@ -257830,7 +257865,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257830
257865
|
this._data.copyWithin(numAddedDouble, 0, lastIndex);
|
|
257831
257866
|
this._xyzInUse += numPoints;
|
|
257832
257867
|
}
|
|
257833
|
-
/**
|
|
257868
|
+
/**
|
|
257869
|
+
* Prepend a new point with given x,y,z
|
|
257834
257870
|
* * Remark: this copies all content forward.
|
|
257835
257871
|
*/
|
|
257836
257872
|
pushFrontXYZ(x, y, z) {
|
|
@@ -257839,13 +257875,12 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257839
257875
|
this._data[1] = y;
|
|
257840
257876
|
this._data[2] = z;
|
|
257841
257877
|
}
|
|
257842
|
-
/**
|
|
257843
|
-
*
|
|
257844
|
-
*/
|
|
257878
|
+
/** Prepend a new point at the front of the array. */
|
|
257845
257879
|
pushFront(toPush) {
|
|
257846
257880
|
this.pushFrontXYZ(toPush.x, toPush.y, toPush.z);
|
|
257847
257881
|
}
|
|
257848
|
-
/**
|
|
257882
|
+
/**
|
|
257883
|
+
* Move the coordinates at fromIndex to toIndex.
|
|
257849
257884
|
* * No action if either index is invalid.
|
|
257850
257885
|
*/
|
|
257851
257886
|
moveIndexToIndex(fromIndex, toIndex) {
|
|
@@ -257857,7 +257892,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257857
257892
|
this._data[iB] = this._data[iA];
|
|
257858
257893
|
}
|
|
257859
257894
|
}
|
|
257860
|
-
/**
|
|
257895
|
+
/**
|
|
257896
|
+
* Remove one point from the back.
|
|
257861
257897
|
* * NOTE that (in the manner of std::vector native) this is "just" removing the point -- no point is NOT returned.
|
|
257862
257898
|
* * Use `back ()` to get the last x,y,z assembled into a `Point3d `
|
|
257863
257899
|
*/
|
|
@@ -257865,40 +257901,41 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257865
257901
|
if (this._xyzInUse > 0)
|
|
257866
257902
|
this._xyzInUse--;
|
|
257867
257903
|
}
|
|
257868
|
-
/**
|
|
257869
|
-
* Clear all xyz data, but leave capacity unchanged.
|
|
257870
|
-
*/
|
|
257904
|
+
/** Clear all xyz data, but leave capacity unchanged. */
|
|
257871
257905
|
clear() {
|
|
257872
257906
|
this._xyzInUse = 0;
|
|
257873
257907
|
}
|
|
257874
257908
|
/**
|
|
257875
|
-
* Get a point by index, strongly typed as a Point3d.
|
|
257876
|
-
*
|
|
257877
|
-
* @param
|
|
257909
|
+
* Get a point by index, strongly typed as a Point3d. This is unchecked. Use [[getPoint3dAtCheckedPointIndex]] to
|
|
257910
|
+
* have validity test.
|
|
257911
|
+
* @param pointIndex index to access.
|
|
257912
|
+
* @param result optional result.
|
|
257878
257913
|
*/
|
|
257879
257914
|
getPoint3dAtUncheckedPointIndex(pointIndex, result) {
|
|
257880
257915
|
const index = 3 * pointIndex;
|
|
257881
257916
|
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
|
|
257882
257917
|
}
|
|
257883
257918
|
/**
|
|
257884
|
-
* Get a point by index, strongly typed as a Point2d. This is unchecked. Use [[getPoint2dAtCheckedPointIndex]] to
|
|
257885
|
-
*
|
|
257886
|
-
* @param
|
|
257919
|
+
* Get a point by index, strongly typed as a Point2d. This is unchecked. Use [[getPoint2dAtCheckedPointIndex]] to
|
|
257920
|
+
* have validity test.
|
|
257921
|
+
* @param pointIndex index to access.
|
|
257922
|
+
* @param result optional result.
|
|
257887
257923
|
*/
|
|
257888
257924
|
getPoint2dAtUncheckedPointIndex(pointIndex, result) {
|
|
257889
257925
|
const index = 3 * pointIndex;
|
|
257890
257926
|
return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_4__.Point2d.create(this._data[index], this._data[index + 1], result);
|
|
257891
257927
|
}
|
|
257892
257928
|
/**
|
|
257893
|
-
* Get a vector by index, strongly typed as a Vector3d. This is unchecked. Use [[getVector3dAtCheckedVectorIndex]]
|
|
257894
|
-
*
|
|
257895
|
-
* @param
|
|
257929
|
+
* Get a vector by index, strongly typed as a Vector3d. This is unchecked. Use [[getVector3dAtCheckedVectorIndex]]
|
|
257930
|
+
* to have validity test.
|
|
257931
|
+
* @param vectorIndex index to access.
|
|
257932
|
+
* @param result optional result.
|
|
257896
257933
|
*/
|
|
257897
257934
|
getVector3dAtUncheckedVectorIndex(vectorIndex, result) {
|
|
257898
257935
|
const index = 3 * vectorIndex;
|
|
257899
257936
|
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Vector3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
|
|
257900
257937
|
}
|
|
257901
|
-
/**
|
|
257938
|
+
/** Copy xyz into strongly typed Point3d. */
|
|
257902
257939
|
getPoint3dAtCheckedPointIndex(pointIndex, result) {
|
|
257903
257940
|
if (this.isIndexValid(pointIndex)) {
|
|
257904
257941
|
const index = 3 * pointIndex;
|
|
@@ -257906,22 +257943,22 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257906
257943
|
}
|
|
257907
257944
|
return undefined;
|
|
257908
257945
|
}
|
|
257909
|
-
/**
|
|
257946
|
+
/** Access x of indexed point. */
|
|
257910
257947
|
getXAtUncheckedPointIndex(pointIndex) {
|
|
257911
257948
|
const index = 3 * pointIndex;
|
|
257912
257949
|
return this._data[index];
|
|
257913
257950
|
}
|
|
257914
|
-
/**
|
|
257951
|
+
/** Access y of indexed point. */
|
|
257915
257952
|
getYAtUncheckedPointIndex(pointIndex) {
|
|
257916
257953
|
const index = 3 * pointIndex;
|
|
257917
257954
|
return this._data[index + 1];
|
|
257918
257955
|
}
|
|
257919
|
-
/**
|
|
257956
|
+
/** Access z of indexed point. */
|
|
257920
257957
|
getZAtUncheckedPointIndex(pointIndex) {
|
|
257921
257958
|
const index = 3 * pointIndex;
|
|
257922
257959
|
return this._data[index + 2];
|
|
257923
257960
|
}
|
|
257924
|
-
/**
|
|
257961
|
+
/** Copy xy into strongly typed Point2d. */
|
|
257925
257962
|
getPoint2dAtCheckedPointIndex(pointIndex, result) {
|
|
257926
257963
|
if (this.isIndexValid(pointIndex)) {
|
|
257927
257964
|
const index = 3 * pointIndex;
|
|
@@ -257929,7 +257966,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257929
257966
|
}
|
|
257930
257967
|
return undefined;
|
|
257931
257968
|
}
|
|
257932
|
-
/**
|
|
257969
|
+
/** Copy xyz into strongly typed Vector3d. */
|
|
257933
257970
|
getVector3dAtCheckedVectorIndex(vectorIndex, result) {
|
|
257934
257971
|
if (this.isIndexValid(vectorIndex)) {
|
|
257935
257972
|
const index = 3 * vectorIndex;
|
|
@@ -257939,9 +257976,9 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257939
257976
|
}
|
|
257940
257977
|
/**
|
|
257941
257978
|
* Read coordinates from source array, place them at index within this array.
|
|
257942
|
-
* @param destIndex point index where coordinates are to be placed in this array
|
|
257943
|
-
* @param source source array
|
|
257944
|
-
* @param sourceIndex point index in source array
|
|
257979
|
+
* @param destIndex point index where coordinates are to be placed in this array.
|
|
257980
|
+
* @param source source array.
|
|
257981
|
+
* @param sourceIndex point index in source array.
|
|
257945
257982
|
* @returns true if destIndex and sourceIndex are both valid.
|
|
257946
257983
|
*/
|
|
257947
257984
|
transferFromGrowableXYZArray(destIndex, source, sourceIndex) {
|
|
@@ -257955,13 +257992,13 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257955
257992
|
return false;
|
|
257956
257993
|
}
|
|
257957
257994
|
/**
|
|
257958
|
-
*
|
|
257959
|
-
* @param source source array
|
|
257960
|
-
* @param sourceIndex xyz index within the source.
|
|
257995
|
+
* Push coordinates from the source array to the end of this array.
|
|
257996
|
+
* @param source source array.
|
|
257997
|
+
* @param sourceIndex xyz index within the source. If undefined, entire source is pushed.
|
|
257961
257998
|
* @returns number of points pushed.
|
|
257962
257999
|
*/
|
|
257963
258000
|
pushFromGrowableXYZArray(source, sourceIndex) {
|
|
257964
|
-
// full array push
|
|
258001
|
+
// full array push
|
|
257965
258002
|
if (sourceIndex === undefined) {
|
|
257966
258003
|
const numXYZAdd = source.length;
|
|
257967
258004
|
this.ensureCapacity(this.length + numXYZAdd, false);
|
|
@@ -257969,7 +258006,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257969
258006
|
this._xyzInUse += numXYZAdd;
|
|
257970
258007
|
return numXYZAdd;
|
|
257971
258008
|
}
|
|
257972
|
-
// single point push
|
|
258009
|
+
// single point push
|
|
257973
258010
|
if (source.isIndexValid(sourceIndex)) {
|
|
257974
258011
|
const j = sourceIndex * 3;
|
|
257975
258012
|
this.pushXYZ(source._data[j], source._data[j + 1], source._data[j + 2]);
|
|
@@ -257979,8 +258016,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257979
258016
|
}
|
|
257980
258017
|
/**
|
|
257981
258018
|
* Set the coordinates of a single point.
|
|
257982
|
-
* @param pointIndex index of point to set
|
|
257983
|
-
* @param value coordinates to set
|
|
258019
|
+
* @param pointIndex index of point to set.
|
|
258020
|
+
* @param value coordinates to set.
|
|
257984
258021
|
*/
|
|
257985
258022
|
setAtCheckedPointIndex(pointIndex, value) {
|
|
257986
258023
|
if (!this.isIndexValid(pointIndex))
|
|
@@ -257992,11 +258029,11 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
257992
258029
|
return true;
|
|
257993
258030
|
}
|
|
257994
258031
|
/**
|
|
257995
|
-
* Set the coordinates of a single point given as coordinates
|
|
257996
|
-
* @param pointIndex index of point to set
|
|
257997
|
-
* @param x x coordinate
|
|
257998
|
-
* @param y y coordinate
|
|
257999
|
-
* @param z z coordinate
|
|
258032
|
+
* Set the coordinates of a single point given as coordinates.
|
|
258033
|
+
* @param pointIndex index of point to set.
|
|
258034
|
+
* @param x x coordinate.
|
|
258035
|
+
* @param y y coordinate.
|
|
258036
|
+
* @param z z coordinate.
|
|
258000
258037
|
*/
|
|
258001
258038
|
setXYZAtCheckedPointIndex(pointIndex, x, y, z) {
|
|
258002
258039
|
if (!this.isIndexValid(pointIndex))
|
|
@@ -258007,9 +258044,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258007
258044
|
this._data[index] = z;
|
|
258008
258045
|
return true;
|
|
258009
258046
|
}
|
|
258010
|
-
/**
|
|
258011
|
-
* Copy all points into a simple array of Point3d
|
|
258012
|
-
*/
|
|
258047
|
+
/** Copy all points into a simple array of Point3. */
|
|
258013
258048
|
getPoint3dArray() {
|
|
258014
258049
|
const n = 3 * this._xyzInUse;
|
|
258015
258050
|
const result = [];
|
|
@@ -258018,7 +258053,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258018
258053
|
result.push(_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(data[i], data[i + 1], data[i + 2]));
|
|
258019
258054
|
return result;
|
|
258020
258055
|
}
|
|
258021
|
-
/**
|
|
258056
|
+
/** Multiply each point by the transform, replace values. */
|
|
258022
258057
|
static multiplyTransformInPlace(transform, data) {
|
|
258023
258058
|
if (Array.isArray(data)) {
|
|
258024
258059
|
for (const d of data)
|
|
@@ -258028,7 +258063,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258028
258063
|
data.multiplyTransformInPlace(transform);
|
|
258029
258064
|
}
|
|
258030
258065
|
}
|
|
258031
|
-
/**
|
|
258066
|
+
/** Multiply each point by the transform, replace values. */
|
|
258032
258067
|
multiplyTransformInPlace(transform) {
|
|
258033
258068
|
const data = this._data;
|
|
258034
258069
|
const nDouble = this.float64Length;
|
|
@@ -258049,7 +258084,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258049
258084
|
data[i + 2] = coffs[6] * x + coffs[7] * y + coffs[8] * z + z0;
|
|
258050
258085
|
}
|
|
258051
258086
|
}
|
|
258052
|
-
/**
|
|
258087
|
+
/** Reverse the order of points. */
|
|
258053
258088
|
reverseInPlace() {
|
|
258054
258089
|
const n = this.length;
|
|
258055
258090
|
let j0, j1;
|
|
@@ -258073,7 +258108,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258073
258108
|
data[j1] = a;
|
|
258074
258109
|
}
|
|
258075
258110
|
}
|
|
258076
|
-
/**
|
|
258111
|
+
/** Multiply each xyz (as a vector) by matrix, replace values. */
|
|
258077
258112
|
multiplyMatrix3dInPlace(matrix) {
|
|
258078
258113
|
const data = this._data;
|
|
258079
258114
|
const nDouble = this.float64Length;
|
|
@@ -258090,9 +258125,10 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258090
258125
|
data[i + 2] = coffs[6] * x + coffs[7] * y + coffs[8] * z;
|
|
258091
258126
|
}
|
|
258092
258127
|
}
|
|
258093
|
-
/**
|
|
258094
|
-
*
|
|
258095
|
-
*
|
|
258128
|
+
/**
|
|
258129
|
+
* Multiply each xyz (as a vector) by matrix inverse transpose, renormalize the vector, replace values.
|
|
258130
|
+
* * This is the way to apply a matrix (possibly with skew and scale) to a surface normal, and have it end up
|
|
258131
|
+
* perpendicular to the transformed in-surface vectors.
|
|
258096
258132
|
* * Return false if matrix is not invertible or if any normalization fails.
|
|
258097
258133
|
*/
|
|
258098
258134
|
multiplyAndRenormalizeMatrix3dInverseTransposeInPlace(matrix) {
|
|
@@ -258120,7 +258156,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258120
258156
|
z1 = coffs[2] * x + coffs[5] * y + coffs[8] * z;
|
|
258121
258157
|
a = x1 * x1 + y1 * y1 + z1 * z1;
|
|
258122
258158
|
if (a < tol) {
|
|
258123
|
-
// put the originals back
|
|
258159
|
+
// put the originals back
|
|
258124
258160
|
x1 = x;
|
|
258125
258161
|
y1 = y;
|
|
258126
258162
|
z1 = z;
|
|
@@ -258131,16 +258167,14 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258131
258167
|
x1 *= q;
|
|
258132
258168
|
y1 *= q;
|
|
258133
258169
|
z1 *= q;
|
|
258134
|
-
} // else
|
|
258170
|
+
} // else if q is near 1, no need to do the division
|
|
258135
258171
|
data[i] = x1;
|
|
258136
258172
|
data[i + 1] = y1;
|
|
258137
258173
|
data[i + 2] = z1;
|
|
258138
258174
|
}
|
|
258139
258175
|
return numFail === 0;
|
|
258140
258176
|
}
|
|
258141
|
-
/**
|
|
258142
|
-
*
|
|
258143
|
-
*/
|
|
258177
|
+
/** Multiply each xyz (as a point) by a homogeneous matrix and update as the normalized point. */
|
|
258144
258178
|
multiplyMatrix4dAndQuietRenormalizeMatrix4d(matrix) {
|
|
258145
258179
|
const data = this._data;
|
|
258146
258180
|
const nDouble = this.float64Length;
|
|
@@ -258152,7 +258186,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258152
258186
|
data[i + 2] = xyz1.z;
|
|
258153
258187
|
}
|
|
258154
258188
|
}
|
|
258155
|
-
/**
|
|
258189
|
+
/** Multiply each point by the transform, replace values. */
|
|
258156
258190
|
tryTransformInverseInPlace(transform) {
|
|
258157
258191
|
const data = this._data;
|
|
258158
258192
|
const nDouble = this.float64Length;
|
|
@@ -258191,7 +258225,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258191
258225
|
rangeToExtend.extendXYZ(data[i], data[i + 1], data[i + 2]);
|
|
258192
258226
|
}
|
|
258193
258227
|
}
|
|
258194
|
-
/**
|
|
258228
|
+
/** Get range of points. */
|
|
258195
258229
|
getRange(transform, result) {
|
|
258196
258230
|
let range = result;
|
|
258197
258231
|
if (range)
|
|
@@ -258209,7 +258243,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258209
258243
|
/** Sum the lengths of segments between points. */
|
|
258210
258244
|
sumLengths() {
|
|
258211
258245
|
let sum = 0.0;
|
|
258212
|
-
const n = 3 * (this._xyzInUse - 1); //
|
|
258246
|
+
const n = 3 * (this._xyzInUse - 1); // length already takes into account what specifically is in use
|
|
258213
258247
|
const data = this._data;
|
|
258214
258248
|
for (let i = 0; i < n; i += 3)
|
|
258215
258249
|
sum += _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseXYZ(data[i + 3] - data[i], data[i + 4] - data[i + 1], data[i + 5] - data[i + 2]);
|
|
@@ -258217,7 +258251,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258217
258251
|
}
|
|
258218
258252
|
/**
|
|
258219
258253
|
* Multiply each x,y,z by the scale factor.
|
|
258220
|
-
* @param factor
|
|
258254
|
+
* @param factor scale factor.
|
|
258221
258255
|
*/
|
|
258222
258256
|
scaleInPlace(factor) {
|
|
258223
258257
|
if (this._data) {
|
|
@@ -258226,7 +258260,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258226
258260
|
this._data[i] = this._data[i] * factor;
|
|
258227
258261
|
}
|
|
258228
258262
|
}
|
|
258229
|
-
/**
|
|
258263
|
+
/** Test if all points are within tolerance of a plane. */
|
|
258230
258264
|
isCloseToPlane(plane, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
258231
258265
|
const numCoordinate = 3 * this._xyzInUse;
|
|
258232
258266
|
const data = this._data;
|
|
@@ -258237,13 +258271,12 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258237
258271
|
}
|
|
258238
258272
|
/**
|
|
258239
258273
|
* * If not already closed, push a copy of the first point.
|
|
258240
|
-
* * If already closed within tolerance, force exact copy
|
|
258241
|
-
* *
|
|
258274
|
+
* * If already closed within tolerance, force exact copy.
|
|
258275
|
+
* * Otherwise leave unchanged.
|
|
258242
258276
|
*/
|
|
258243
258277
|
forceClosure(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
258244
258278
|
const d = this.distanceIndexIndex(0, this.length - 1);
|
|
258245
|
-
// leave the empty array alone
|
|
258246
|
-
// Note that singleton will generate 0 distance and do nothing.
|
|
258279
|
+
// leave the empty array alone; note that singleton will generate 0 distance and do nothing
|
|
258247
258280
|
if (d === undefined) {
|
|
258248
258281
|
}
|
|
258249
258282
|
else if (d > tolerance)
|
|
@@ -258255,7 +258288,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258255
258288
|
this._data[i0 + i] = this._data[i];
|
|
258256
258289
|
}
|
|
258257
258290
|
}
|
|
258258
|
-
/** Compute a point at fractional coordinate between points i and j */
|
|
258291
|
+
/** Compute a point at fractional coordinate between points i and j. */
|
|
258259
258292
|
interpolate(i, fraction, j, result) {
|
|
258260
258293
|
if (this.isIndexValid(i) && this.isIndexValid(j)) {
|
|
258261
258294
|
const fraction0 = 1.0 - fraction;
|
|
@@ -258266,10 +258299,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258266
258299
|
}
|
|
258267
258300
|
return undefined;
|
|
258268
258301
|
}
|
|
258269
|
-
/**
|
|
258270
|
-
* * Compute a point at fractional coordinate between points i and j of source
|
|
258271
|
-
* * push onto this array.
|
|
258272
|
-
*/
|
|
258302
|
+
/** Compute a point at fractional coordinate between points i and j of source and push onto this array. */
|
|
258273
258303
|
pushInterpolatedFromGrowableXYZArray(source, i, fraction, j) {
|
|
258274
258304
|
if (source.isIndexValid(i) && source.isIndexValid(j)) {
|
|
258275
258305
|
const fraction0 = 1.0 - fraction;
|
|
@@ -258279,10 +258309,10 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258279
258309
|
this.pushXYZ(fraction0 * data[i] + fraction * data[j], fraction0 * data[i + 1] + fraction * data[j + 1], fraction0 * data[i + 2] + fraction * data[j + 2]);
|
|
258280
258310
|
}
|
|
258281
258311
|
}
|
|
258282
|
-
/** Sum the signed areas of the projection to xy plane */
|
|
258312
|
+
/** Sum the signed areas of the projection to xy plane. */
|
|
258283
258313
|
areaXY() {
|
|
258284
258314
|
let area = 0.0;
|
|
258285
|
-
const n = 3 * this._xyzInUse; // float count
|
|
258315
|
+
const n = 3 * this._xyzInUse; // float count
|
|
258286
258316
|
if (n > 6) {
|
|
258287
258317
|
const x0 = this._data[n - 3];
|
|
258288
258318
|
const y0 = this._data[n - 2];
|
|
@@ -258327,21 +258357,21 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258327
258357
|
}
|
|
258328
258358
|
return undefined;
|
|
258329
258359
|
}
|
|
258330
|
-
/** Compute the dot product of pointIndex with [x,y,z] */
|
|
258360
|
+
/** Compute the dot product of pointIndex with [x,y,z]. */
|
|
258331
258361
|
evaluateUncheckedIndexDotProductXYZ(pointIndex, x, y, z) {
|
|
258332
258362
|
const i = pointIndex * 3;
|
|
258333
258363
|
const data = this._data;
|
|
258334
258364
|
return data[i] * x + data[i + 1] * y + data[i + 2] * z;
|
|
258335
258365
|
}
|
|
258336
|
-
/** Compute the dot product of pointIndex with [x,y,z] */
|
|
258366
|
+
/** Compute the dot product of pointIndex with [x,y,z]. */
|
|
258337
258367
|
evaluateUncheckedIndexPlaneAltitude(pointIndex, plane) {
|
|
258338
258368
|
const i = pointIndex * 3;
|
|
258339
258369
|
const data = this._data;
|
|
258340
258370
|
return plane.altitudeXYZ(data[i], data[i + 1], data[i + 2]);
|
|
258341
258371
|
}
|
|
258342
258372
|
/**
|
|
258343
|
-
*
|
|
258344
|
-
* *
|
|
258373
|
+
* Compute the cross product from indexed origin t indexed targets targetAIndex and targetB index.
|
|
258374
|
+
* * Accumulate it to the result.
|
|
258345
258375
|
*/
|
|
258346
258376
|
accumulateCrossProductIndexIndexIndex(originIndex, targetAIndex, targetBIndex, result) {
|
|
258347
258377
|
if (this.isIndexValid(originIndex) && this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {
|
|
@@ -258353,8 +258383,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258353
258383
|
}
|
|
258354
258384
|
}
|
|
258355
258385
|
/**
|
|
258356
|
-
*
|
|
258357
|
-
* *
|
|
258386
|
+
* Compute the cross product from indexed origin t indexed targets targetAIndex and targetB index.
|
|
258387
|
+
* * Accumulate it to the result.
|
|
258358
258388
|
*/
|
|
258359
258389
|
accumulateScaledXYZ(index, scale, sum) {
|
|
258360
258390
|
if (this.isIndexValid(index)) {
|
|
@@ -258365,7 +258395,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258365
258395
|
sum.z += scale * data[i + 2];
|
|
258366
258396
|
}
|
|
258367
258397
|
}
|
|
258368
|
-
/** Compute the cross product of vectors from from origin to indexed targets i and j */
|
|
258398
|
+
/** Compute the cross product of vectors from from origin to indexed targets i and j. */
|
|
258369
258399
|
crossProductXYAndZIndexIndex(origin, targetAIndex, targetBIndex, result) {
|
|
258370
258400
|
if (this.isIndexValid(targetAIndex) && this.isIndexValid(targetBIndex)) {
|
|
258371
258401
|
const j = targetAIndex * 3;
|
|
@@ -258385,8 +258415,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258385
258415
|
}
|
|
258386
258416
|
/**
|
|
258387
258417
|
* Return distance squared between indicated points.
|
|
258388
|
-
* @param i first point index
|
|
258389
|
-
* @param j second point index
|
|
258418
|
+
* @param i first point index.
|
|
258419
|
+
* @param j second point index.
|
|
258390
258420
|
*/
|
|
258391
258421
|
distanceSquaredIndexIndex(i, j) {
|
|
258392
258422
|
if (this.isIndexValid(i) && this.isIndexValid(j)) {
|
|
@@ -258398,8 +258428,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258398
258428
|
}
|
|
258399
258429
|
/**
|
|
258400
258430
|
* Return distance between indicated points.
|
|
258401
|
-
* @param i first point index
|
|
258402
|
-
* @param j second point index
|
|
258431
|
+
* @param i first point index.
|
|
258432
|
+
* @param j second point index.
|
|
258403
258433
|
*/
|
|
258404
258434
|
distanceIndexIndex(i, j) {
|
|
258405
258435
|
if (this.isIndexValid(i) && this.isIndexValid(j)) {
|
|
@@ -258418,7 +258448,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258418
258448
|
}
|
|
258419
258449
|
return undefined;
|
|
258420
258450
|
}
|
|
258421
|
-
/**
|
|
258451
|
+
/** Test for near equality between two `GrowableXYZArray`. */
|
|
258422
258452
|
static isAlmostEqual(dataA, dataB) {
|
|
258423
258453
|
if (dataA && dataB) {
|
|
258424
258454
|
if (dataA.length !== dataB.length)
|
|
@@ -258431,7 +258461,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258431
258461
|
// if both are null it is equal, otherwise unequal
|
|
258432
258462
|
return (!dataA && !dataB);
|
|
258433
258463
|
}
|
|
258434
|
-
/** Return an array of block indices sorted per compareLexicalBlock function */
|
|
258464
|
+
/** Return an array of block indices sorted per compareLexicalBlock function. */
|
|
258435
258465
|
sortIndicesLexical() {
|
|
258436
258466
|
const n = this._xyzInUse;
|
|
258437
258467
|
// let numCompare = 0;
|
|
@@ -258445,7 +258475,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258445
258475
|
// console.log (n, numCompare);
|
|
258446
258476
|
return result;
|
|
258447
258477
|
}
|
|
258448
|
-
/**
|
|
258478
|
+
/** Compare two blocks in simple lexical order. */
|
|
258449
258479
|
compareLexicalBlock(ia, ib) {
|
|
258450
258480
|
let ax = 0;
|
|
258451
258481
|
let bx = 0;
|
|
@@ -258457,19 +258487,13 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258457
258487
|
if (ax < bx)
|
|
258458
258488
|
return -1;
|
|
258459
258489
|
}
|
|
258460
|
-
return ia - ib; // so original order is maintained among duplicates
|
|
258490
|
+
return ia - ib; // so original order is maintained among duplicates
|
|
258461
258491
|
}
|
|
258462
|
-
/** Access a single double at offset within a block.
|
|
258492
|
+
/** Access a single double at offset within a block. This has no index checking. */
|
|
258463
258493
|
component(pointIndex, componentIndex) {
|
|
258464
258494
|
return this._data[3 * pointIndex + componentIndex];
|
|
258465
258495
|
}
|
|
258466
|
-
/**
|
|
258467
|
-
* add points at regular steps from `other`
|
|
258468
|
-
* @param source
|
|
258469
|
-
* @param pointIndex0
|
|
258470
|
-
* @param step
|
|
258471
|
-
* @param numAdd
|
|
258472
|
-
*/
|
|
258496
|
+
/** Add points at regular steps from `other`. */
|
|
258473
258497
|
addSteppedPoints(other, pointIndex0, step, numAdd) {
|
|
258474
258498
|
const dataB = other._data;
|
|
258475
258499
|
let b0 = pointIndex0 * 3;
|
|
@@ -258483,9 +258507,9 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258483
258507
|
}
|
|
258484
258508
|
}
|
|
258485
258509
|
/**
|
|
258486
|
-
*
|
|
258487
|
-
* @param arrayA first array
|
|
258488
|
-
* @param arrayB second array
|
|
258510
|
+
* Find the min and max distance between corresponding indexed points. Excess points are ignored.
|
|
258511
|
+
* @param arrayA first array.
|
|
258512
|
+
* @param arrayB second array.
|
|
258489
258513
|
*/
|
|
258490
258514
|
static distanceRangeBetweenCorrespondingPoints(arrayA, arrayB) {
|
|
258491
258515
|
const dataA = arrayA._data;
|
|
@@ -258501,11 +258525,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258501
258525
|
}
|
|
258502
258526
|
return range;
|
|
258503
258527
|
}
|
|
258504
|
-
/**
|
|
258505
|
-
* remove trailing point(s) within tolerance of the start point.
|
|
258506
|
-
* @param points
|
|
258507
|
-
* @param tolerance
|
|
258508
|
-
*/
|
|
258528
|
+
/** Remove trailing point(s) within tolerance of the start point. */
|
|
258509
258529
|
static removeClosure(points, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
258510
258530
|
while (points.length > 1 && points.distanceIndexIndex(0, points.length - 1) < tolerance)
|
|
258511
258531
|
points.pop();
|
|
@@ -258513,8 +258533,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258513
258533
|
/**
|
|
258514
258534
|
* Compute frame for a triangle formed by three (unchecked!) points identified by index.
|
|
258515
258535
|
* * z direction of frame is 001.
|
|
258516
|
-
* * Transform axes from origin to targetA and targetB
|
|
258517
|
-
* * in local coordinates (u,v,w) the xy interior of the triangle is `u>=0, v>= 0, w>= 0, u+v+w<1
|
|
258536
|
+
* * Transform axes from origin to targetA and targetB.
|
|
258537
|
+
* * in local coordinates (u,v,w) the xy interior of the triangle is `u>=0, v>= 0, w>= 0, u+v+w<1`.
|
|
258518
258538
|
* * Return undefined if transform is not invertible, e.g. if points are in a vertical plane.
|
|
258519
258539
|
*/
|
|
258520
258540
|
fillLocalXYTriangleFrame(originIndex, targetAIndex, targetBIndex, result) {
|
|
@@ -258540,7 +258560,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
258540
258560
|
/**
|
|
258541
258561
|
* Pass the (x,y,z) of each point to a function which returns a replacement for one of the 3 components.
|
|
258542
258562
|
* @param componentIndex Index (0,1,2) of component to be replaced.
|
|
258543
|
-
* @param func function to be called as `func(x,y,z)`, returning a replacement value for componentIndex
|
|
258563
|
+
* @param func function to be called as `func(x,y,z)`, returning a replacement value for componentIndex.
|
|
258544
258564
|
*/
|
|
258545
258565
|
mapComponent(componentIndex, func) {
|
|
258546
258566
|
const n = this._data.length;
|
|
@@ -258704,6 +258724,7 @@ class IndexedXYZCollectionInterval extends IndexedCollectionInterval {
|
|
|
258704
258724
|
"use strict";
|
|
258705
258725
|
__webpack_require__.r(__webpack_exports__);
|
|
258706
258726
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
258727
|
+
/* harmony export */ IndexedReadWriteXYCollection: () => (/* binding */ IndexedReadWriteXYCollection),
|
|
258707
258728
|
/* harmony export */ IndexedXYCollection: () => (/* binding */ IndexedXYCollection)
|
|
258708
258729
|
/* harmony export */ });
|
|
258709
258730
|
/* harmony import */ var _Point2dVector2d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
|
|
@@ -258716,7 +258737,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
258716
258737
|
*/
|
|
258717
258738
|
|
|
258718
258739
|
/**
|
|
258719
|
-
*
|
|
258740
|
+
* Abstract base class for access to XY data with indexed reference.
|
|
258720
258741
|
* * This allows algorithms to work with Point2d[] or GrowableXY.
|
|
258721
258742
|
* * GrowableXYArray implements these for its data.
|
|
258722
258743
|
* * Point2dArrayCarrier carries a (reference to) a Point2d[] and implements the methods with calls on that array reference.
|
|
@@ -258726,7 +258747,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
258726
258747
|
*/
|
|
258727
258748
|
class IndexedXYCollection {
|
|
258728
258749
|
static _workPoint;
|
|
258729
|
-
/**
|
|
258750
|
+
/**
|
|
258751
|
+
* Access x of indexed point.
|
|
258730
258752
|
* * Subclasses may wish to override with a more efficient implementation.
|
|
258731
258753
|
*/
|
|
258732
258754
|
getXAtUncheckedPointIndex(pointIndex) {
|
|
@@ -258735,7 +258757,8 @@ class IndexedXYCollection {
|
|
|
258735
258757
|
IndexedXYCollection._workPoint = pt; // allocate the cache
|
|
258736
258758
|
return pt ? pt.x : 0.0;
|
|
258737
258759
|
}
|
|
258738
|
-
/**
|
|
258760
|
+
/**
|
|
258761
|
+
* Access y of indexed point.
|
|
258739
258762
|
* * Subclasses may wish to override with a more efficient implementation.
|
|
258740
258763
|
*/
|
|
258741
258764
|
getYAtUncheckedPointIndex(pointIndex) {
|
|
@@ -258744,9 +258767,10 @@ class IndexedXYCollection {
|
|
|
258744
258767
|
IndexedXYCollection._workPoint = pt; // allocate the cache
|
|
258745
258768
|
return pt ? pt.y : 0.0;
|
|
258746
258769
|
}
|
|
258747
|
-
/**
|
|
258770
|
+
/**
|
|
258771
|
+
* Compute the linear combination s of the indexed p_i and given scales s_i.
|
|
258748
258772
|
* @param scales array of scales. For best results, scales should have same length as the instance.
|
|
258749
|
-
* @param result optional pre-allocated object to fill and return
|
|
258773
|
+
* @param result optional pre-allocated object to fill and return.
|
|
258750
258774
|
* @return s = sum(p_i * s_i), where i ranges from 0 to min(this.length, scales.length).
|
|
258751
258775
|
*/
|
|
258752
258776
|
linearCombination(scales, result) {
|
|
@@ -258759,6 +258783,12 @@ class IndexedXYCollection {
|
|
|
258759
258783
|
return sum;
|
|
258760
258784
|
}
|
|
258761
258785
|
}
|
|
258786
|
+
/**
|
|
258787
|
+
* Abstract base class extends [[IndexedXYCollection]] with methods that modify the collection.
|
|
258788
|
+
* @public
|
|
258789
|
+
*/
|
|
258790
|
+
class IndexedReadWriteXYCollection extends IndexedXYCollection {
|
|
258791
|
+
}
|
|
258762
258792
|
|
|
258763
258793
|
|
|
258764
258794
|
/***/ }),
|
|
@@ -258796,7 +258826,8 @@ class PointsIterator {
|
|
|
258796
258826
|
}
|
|
258797
258827
|
next() {
|
|
258798
258828
|
if (++this._curIndex >= this._collection.length) {
|
|
258799
|
-
//
|
|
258829
|
+
// the ECMAScript spec states that value=undefined is valid if done=true
|
|
258830
|
+
// the TypeScript interface violates the spec hence the cast to any and back below
|
|
258800
258831
|
return { done: true };
|
|
258801
258832
|
}
|
|
258802
258833
|
return {
|
|
@@ -258817,11 +258848,11 @@ class PointsIterator {
|
|
|
258817
258848
|
*/
|
|
258818
258849
|
class IndexedXYZCollection {
|
|
258819
258850
|
/**
|
|
258820
|
-
* Return a vector from the point at `indexA` to `target
|
|
258821
|
-
* @param indexA index of point within the array
|
|
258822
|
-
* @param target target for vector
|
|
258851
|
+
* Return a vector from the point at `indexA` to `target`.
|
|
258852
|
+
* @param indexA index of point within the array.
|
|
258853
|
+
* @param target target for vector.
|
|
258823
258854
|
* @param result caller-allocated vector.
|
|
258824
|
-
* @returns undefined if index is out of bounds
|
|
258855
|
+
* @returns undefined if index is out of bounds.
|
|
258825
258856
|
*/
|
|
258826
258857
|
vectorIndexXYAndZ(indexA, target, result) {
|
|
258827
258858
|
const reversed = this.vectorXYAndZIndex(target, indexA, result);
|
|
@@ -258829,10 +258860,10 @@ class IndexedXYZCollection {
|
|
|
258829
258860
|
}
|
|
258830
258861
|
/**
|
|
258831
258862
|
* Return the dot product of the vectors from the point at `origin` to the points at `indexA` and `indexB`.
|
|
258832
|
-
* @param origin index of point within the array; origin of both vectors
|
|
258833
|
-
* @param indexA index of point within the array; target of the first vector
|
|
258834
|
-
* @param
|
|
258835
|
-
* @returns undefined if index is out of bounds
|
|
258863
|
+
* @param origin index of point within the array; origin of both vectors.
|
|
258864
|
+
* @param indexA index of point within the array; target of the first vector.
|
|
258865
|
+
* @param indexB index of point within the array; target of the second vector.
|
|
258866
|
+
* @returns undefined if index is out of bounds.
|
|
258836
258867
|
*/
|
|
258837
258868
|
dotProductIndexIndexIndex(origin, indexA, indexB) {
|
|
258838
258869
|
if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length || indexB < 0 || indexB >= this.length)
|
|
@@ -258846,10 +258877,10 @@ class IndexedXYZCollection {
|
|
|
258846
258877
|
}
|
|
258847
258878
|
/**
|
|
258848
258879
|
* Return the dot product of the vectors from the point at `origin` to the point at `indexA` and to `targetB`.
|
|
258849
|
-
* @param origin index of point within the array; origin of both vectors
|
|
258850
|
-
* @param indexA index of point within the array; target of the first vector
|
|
258851
|
-
* @param targetB target for second vector
|
|
258852
|
-
* @returns undefined if index is out of bounds
|
|
258880
|
+
* @param origin index of point within the array; origin of both vectors.
|
|
258881
|
+
* @param indexA index of point within the array; target of the first vector.
|
|
258882
|
+
* @param targetB target for second vector.
|
|
258883
|
+
* @returns undefined if index is out of bounds.
|
|
258853
258884
|
*/
|
|
258854
258885
|
dotProductIndexIndexXYAndZ(origin, indexA, targetB) {
|
|
258855
258886
|
if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)
|
|
@@ -258862,12 +258893,12 @@ class IndexedXYZCollection {
|
|
|
258862
258893
|
(this.getZAtUncheckedPointIndex(indexA) - z0) * (targetB.z - z0);
|
|
258863
258894
|
}
|
|
258864
258895
|
/**
|
|
258865
|
-
* Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB
|
|
258866
|
-
* @param origin index of point within the array; origin of both vectors
|
|
258867
|
-
* @param indexA index of point within the array; target of the first vector
|
|
258868
|
-
* @param targetB target of second vector
|
|
258869
|
-
* @param result optional caller-allocated result to fill and return
|
|
258870
|
-
* @returns undefined if an index is out of bounds
|
|
258896
|
+
* Return the cross product of the vectors from `origin` to the point at `indexA` and to `targetB`.
|
|
258897
|
+
* @param origin index of point within the array; origin of both vectors.
|
|
258898
|
+
* @param indexA index of point within the array; target of the first vector.
|
|
258899
|
+
* @param targetB target of second vector.
|
|
258900
|
+
* @param result optional caller-allocated result to fill and return.
|
|
258901
|
+
* @returns undefined if an index is out of bounds.
|
|
258871
258902
|
*/
|
|
258872
258903
|
crossProductIndexIndexXYAndZ(origin, indexA, targetB, result) {
|
|
258873
258904
|
if (origin < 0 || origin >= this.length || indexA < 0 || indexA >= this.length)
|
|
@@ -258879,8 +258910,8 @@ class IndexedXYZCollection {
|
|
|
258879
258910
|
}
|
|
258880
258911
|
/**
|
|
258881
258912
|
* Return distance squared between the point at index0 and target.
|
|
258882
|
-
* @param index0 first point index
|
|
258883
|
-
* @param target second point
|
|
258913
|
+
* @param index0 first point index.
|
|
258914
|
+
* @param target second point.
|
|
258884
258915
|
*/
|
|
258885
258916
|
distanceSquaredIndexXYAndZ(index0, target) {
|
|
258886
258917
|
if (index0 < 0 || index0 >= this.length)
|
|
@@ -258917,9 +258948,9 @@ class IndexedXYZCollection {
|
|
|
258917
258948
|
* For each subset of `k` successive points within tolerance of the first point in the subset, return the indices of
|
|
258918
258949
|
* the last `k-1` duplicates.
|
|
258919
258950
|
* * Index `0` is never returned.
|
|
258920
|
-
* @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]])
|
|
258951
|
+
* @param tolerance optional distance tol for compression (default [[Geometry.smallMetricDistance]]).
|
|
258921
258952
|
* @param preserveLast if the last `k < this.length` points of the instance are duplicates, whether to return the
|
|
258922
|
-
* indices of the *first* `k-1` duplicates for this last run. If true, index `this.length - 1` is not returned
|
|
258953
|
+
* indices of the *first* `k-1` duplicates for this last run. If true, index `this.length - 1` is not returned.
|
|
258923
258954
|
* unless all points are duplicates, in which case all indices but `0` are returned. Default value is false.
|
|
258924
258955
|
* @return ordered array of 0-based indices of duplicate points
|
|
258925
258956
|
*/
|
|
@@ -258942,7 +258973,8 @@ class IndexedXYZCollection {
|
|
|
258942
258973
|
}
|
|
258943
258974
|
return indices;
|
|
258944
258975
|
}
|
|
258945
|
-
/**
|
|
258976
|
+
/**
|
|
258977
|
+
* Compute the linear combination s of the indexed p_i and given scales s_i.
|
|
258946
258978
|
* @param scales array of scales. For best results, scales should have same length as the instance.
|
|
258947
258979
|
* @param result optional pre-allocated object to fill and return
|
|
258948
258980
|
* @return s = sum(p_i * s_i), where i ranges from 0 to min(this.length, scales.length).
|
|
@@ -258959,18 +258991,19 @@ class IndexedXYZCollection {
|
|
|
258959
258991
|
}
|
|
258960
258992
|
/**
|
|
258961
258993
|
* Interpolate the points at the given indices.
|
|
258962
|
-
* @param index0 index of point p0 within the array
|
|
258963
|
-
* @param fraction fraction f such that returned point is p0 + f * (p1 - p0)
|
|
258964
|
-
* @param index1 index of point p1 within the array
|
|
258965
|
-
* @param result optional caller-allocated result to fill and return
|
|
258966
|
-
* @returns undefined if an index is out of bounds
|
|
258994
|
+
* @param index0 index of point p0 within the array.
|
|
258995
|
+
* @param fraction fraction f such that returned point is p0 + f * (p1 - p0).
|
|
258996
|
+
* @param index1 index of point p1 within the array.
|
|
258997
|
+
* @param result optional caller-allocated result to fill and return.
|
|
258998
|
+
* @returns undefined if an index is out of bounds.
|
|
258967
258999
|
*/
|
|
258968
259000
|
interpolateIndexIndex(index0, fraction, index1, result) {
|
|
258969
259001
|
if (index0 < 0 || index0 >= this.length || index1 < 0 || index1 >= this.length)
|
|
258970
259002
|
return undefined;
|
|
258971
259003
|
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create(_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(this.getXAtUncheckedPointIndex(index0), fraction, this.getXAtUncheckedPointIndex(index1)), _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(this.getYAtUncheckedPointIndex(index0), fraction, this.getYAtUncheckedPointIndex(index1)), _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(this.getZAtUncheckedPointIndex(index0), fraction, this.getZAtUncheckedPointIndex(index1)), result);
|
|
258972
259004
|
}
|
|
258973
|
-
/**
|
|
259005
|
+
/**
|
|
259006
|
+
* Return iterator over the points in this collection. Usage:
|
|
258974
259007
|
* ```ts
|
|
258975
259008
|
* for (const point: Point3d of collection.points) { ... }
|
|
258976
259009
|
* ```
|
|
@@ -258978,7 +259011,7 @@ class IndexedXYZCollection {
|
|
|
258978
259011
|
get points() {
|
|
258979
259012
|
return new PointsIterator(this);
|
|
258980
259013
|
}
|
|
258981
|
-
/**
|
|
259014
|
+
/** Convert to Point3d[]. */
|
|
258982
259015
|
getArray() {
|
|
258983
259016
|
const result = [];
|
|
258984
259017
|
for (const p of this.points)
|
|
@@ -258999,8 +259032,8 @@ class IndexedXYZCollection {
|
|
|
258999
259032
|
}
|
|
259000
259033
|
/**
|
|
259001
259034
|
* Test whether the indexed points are equal within tolerance.
|
|
259002
|
-
* @param index0 index of first point
|
|
259003
|
-
* @param index1 index of second point
|
|
259035
|
+
* @param index0 index of first point.
|
|
259036
|
+
* @param index1 index of second point.
|
|
259004
259037
|
* @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.
|
|
259005
259038
|
* @returns whether the points are equal within tolerance, or `undefined` if either index is invalid.
|
|
259006
259039
|
*/
|
|
@@ -259013,8 +259046,8 @@ class IndexedXYZCollection {
|
|
|
259013
259046
|
}
|
|
259014
259047
|
/**
|
|
259015
259048
|
* Test whether the xy-coordinates of the indexed points are equal within tolerance. The z-coordinates are ignored.
|
|
259016
|
-
* @param index0 index of first point
|
|
259017
|
-
* @param index1 index of second point
|
|
259049
|
+
* @param index0 index of first point.
|
|
259050
|
+
* @param index1 index of second point.
|
|
259018
259051
|
* @param tolerance max coordinate difference to be considered equal. For exact test, pass 0. Defaults to `Geometry.smallMetricDistance`.
|
|
259019
259052
|
* @returns whether the xy-coordinates of the points are equal within tolerance, or `undefined` if either index is invalid.
|
|
259020
259053
|
*/
|
|
@@ -336727,6 +336760,9 @@ class Parser {
|
|
|
336727
336760
|
if (unitConversion !== undefined)
|
|
336728
336761
|
return unitConversion;
|
|
336729
336762
|
}
|
|
336763
|
+
// if there were unique unit labels but not matched to any units, throw an error
|
|
336764
|
+
if (uniqueUnitLabels.length > 0)
|
|
336765
|
+
throw new _Exception__WEBPACK_IMPORTED_MODULE_1__.QuantityError(_Exception__WEBPACK_IMPORTED_MODULE_1__.QuantityStatus.UnitLabelSuppliedButNotMatched, `The unit label(s) ${uniqueUnitLabels.join(", ")} could not be matched to a known unit.`);
|
|
336730
336766
|
}
|
|
336731
336767
|
return unitConversion;
|
|
336732
336768
|
}
|
|
@@ -336774,7 +336810,14 @@ class Parser {
|
|
|
336774
336810
|
return { ok: false, error: ParseError.UnableToConvertParseTokensToQuantity };
|
|
336775
336811
|
}
|
|
336776
336812
|
const defaultUnit = format.units && format.units.length > 0 ? format.units[0][0] : undefined;
|
|
336777
|
-
|
|
336813
|
+
try {
|
|
336814
|
+
defaultUnitConversion = defaultUnitConversion ? defaultUnitConversion : Parser.getDefaultUnitConversion(tokens, unitsConversions, defaultUnit);
|
|
336815
|
+
}
|
|
336816
|
+
catch (e) {
|
|
336817
|
+
// If we failed to get the default unit conversion, we need to return an error.
|
|
336818
|
+
if (e instanceof _Exception__WEBPACK_IMPORTED_MODULE_1__.QuantityError && e.errorNumber === _Exception__WEBPACK_IMPORTED_MODULE_1__.QuantityStatus.UnitLabelSuppliedButNotMatched)
|
|
336819
|
+
return { ok: false, error: ParseError.UnitLabelSuppliedButNotMatched };
|
|
336820
|
+
}
|
|
336778
336821
|
if (format.type === _Formatter_FormatEnums__WEBPACK_IMPORTED_MODULE_2__.FormatType.Bearing && format.units !== undefined && format.units.length > 0) {
|
|
336779
336822
|
const units = format.units;
|
|
336780
336823
|
const desiredNumberOfTokens = units.length;
|
|
@@ -338429,7 +338472,7 @@ class TestContext {
|
|
|
338429
338472
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
338430
338473
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
338431
338474
|
await core_frontend_1.NoRenderApp.startup({
|
|
338432
|
-
applicationVersion: "5.3.0-dev.
|
|
338475
|
+
applicationVersion: "5.3.0-dev.16",
|
|
338433
338476
|
applicationId: this.settings.gprid,
|
|
338434
338477
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
|
|
338435
338478
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -363696,7 +363739,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
363696
363739
|
/***/ ((module) => {
|
|
363697
363740
|
|
|
363698
363741
|
"use strict";
|
|
363699
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.3.0-dev.
|
|
363742
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.3.0-dev.16","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 && npm run -s copy:draco","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 ES2022 --outDir lib/esm","clean":"rimraf -g 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","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./lib/public/scripts","docs":"betools docs --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 --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","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:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//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/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"5.2.2-dev.2","@types/chai-as-promised":"^7","@types/draco3d":"^1.4.10","@types/sinon":"^17.0.2","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.31.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","sinon":"^17.0.2","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//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/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.3.4","@loaders.gl/draco":"^4.3.4","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
363700
363743
|
|
|
363701
363744
|
/***/ }),
|
|
363702
363745
|
|