@itwin/ecschema-rpcinterface-tests 5.0.0-dev.4 → 5.0.0-dev.5
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 +534 -323
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -71410,40 +71410,42 @@ class SchemaGraph {
|
|
|
71410
71410
|
|
|
71411
71411
|
/***/ }),
|
|
71412
71412
|
|
|
71413
|
-
/***/ "../../core/ecschema-rpc/common/lib/
|
|
71413
|
+
/***/ "../../core/ecschema-rpc/common/lib/esm/ECSchemaRpcInterface.js":
|
|
71414
71414
|
/*!**********************************************************************!*\
|
|
71415
|
-
!*** ../../core/ecschema-rpc/common/lib/
|
|
71415
|
+
!*** ../../core/ecschema-rpc/common/lib/esm/ECSchemaRpcInterface.js ***!
|
|
71416
71416
|
\**********************************************************************/
|
|
71417
|
-
/***/ (
|
|
71417
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
71418
71418
|
|
|
71419
71419
|
"use strict";
|
|
71420
|
-
|
|
71421
|
-
|
|
71420
|
+
__webpack_require__.r(__webpack_exports__);
|
|
71421
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
71422
|
+
/* harmony export */ "ECSchemaRpcInterface": () => (/* binding */ ECSchemaRpcInterface)
|
|
71423
|
+
/* harmony export */ });
|
|
71424
|
+
/* harmony import */ var _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-common */ "../../core/common/lib/esm/core-common.js");
|
|
71425
|
+
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
71422
71426
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
71423
71427
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
71424
71428
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
71425
71429
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
71426
71430
|
};
|
|
71427
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
71428
|
-
exports.ECSchemaRpcInterface = void 0;
|
|
71429
71431
|
/*---------------------------------------------------------------------------------------------
|
|
71430
71432
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
71431
71433
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
71432
71434
|
*--------------------------------------------------------------------------------------------*/
|
|
71433
|
-
|
|
71435
|
+
|
|
71434
71436
|
/***
|
|
71435
71437
|
* Defines an RPC interface to get schema information from a given iModel context.
|
|
71436
71438
|
* Method @see getSchemaNames will return the names of schemas that live in this iModel.
|
|
71437
71439
|
* The actual schemas can be downloaded using @see getSchemaJSON to get the schema as JSON props.
|
|
71438
71440
|
* @internal
|
|
71439
71441
|
*/
|
|
71440
|
-
class ECSchemaRpcInterface extends
|
|
71442
|
+
class ECSchemaRpcInterface extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcInterface {
|
|
71441
71443
|
/**
|
|
71442
71444
|
* Returns the RPC client instance for the frontend.
|
|
71443
71445
|
* @returns A client to communicate with the RPC Interface.
|
|
71444
71446
|
*/
|
|
71445
71447
|
static getClient() {
|
|
71446
|
-
return
|
|
71448
|
+
return _itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcManager.getClientForInterface(ECSchemaRpcInterface);
|
|
71447
71449
|
}
|
|
71448
71450
|
/**
|
|
71449
71451
|
* Returns an array of SchemaKeyProps that exists in the current iModel context. The client can call
|
|
@@ -71465,37 +71467,39 @@ class ECSchemaRpcInterface extends core_common_1.RpcInterface {
|
|
|
71465
71467
|
return this.forward.apply(this, [arguments]);
|
|
71466
71468
|
}
|
|
71467
71469
|
}
|
|
71468
|
-
exports.ECSchemaRpcInterface = ECSchemaRpcInterface;
|
|
71469
71470
|
/** The version of the RPC Interface. */
|
|
71470
71471
|
ECSchemaRpcInterface.version = "2.0.0";
|
|
71471
71472
|
ECSchemaRpcInterface.interfaceName = "ECSchemaRpcInterface";
|
|
71472
71473
|
ECSchemaRpcInterface.interfaceVersion = ECSchemaRpcInterface.version;
|
|
71473
71474
|
__decorate([
|
|
71474
|
-
|
|
71475
|
+
_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.allowResponseCaching(_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcResponseCacheControl.Immutable)
|
|
71475
71476
|
], ECSchemaRpcInterface.prototype, "getSchemaKeys", null);
|
|
71476
71477
|
__decorate([
|
|
71477
|
-
|
|
71478
|
+
_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcOperation.allowResponseCaching(_itwin_core_common__WEBPACK_IMPORTED_MODULE_0__.RpcResponseCacheControl.Immutable)
|
|
71478
71479
|
], ECSchemaRpcInterface.prototype, "getSchemaJSON", null);
|
|
71479
71480
|
|
|
71480
71481
|
|
|
71481
71482
|
/***/ }),
|
|
71482
71483
|
|
|
71483
|
-
/***/ "../../core/ecschema-rpc/common/lib/
|
|
71484
|
+
/***/ "../../core/ecschema-rpc/common/lib/esm/ECSchemaRpcLocater.js":
|
|
71484
71485
|
/*!********************************************************************!*\
|
|
71485
|
-
!*** ../../core/ecschema-rpc/common/lib/
|
|
71486
|
+
!*** ../../core/ecschema-rpc/common/lib/esm/ECSchemaRpcLocater.js ***!
|
|
71486
71487
|
\********************************************************************/
|
|
71487
|
-
/***/ ((__unused_webpack_module,
|
|
71488
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
71488
71489
|
|
|
71489
71490
|
"use strict";
|
|
71490
|
-
|
|
71491
|
-
|
|
71492
|
-
|
|
71491
|
+
__webpack_require__.r(__webpack_exports__);
|
|
71492
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
71493
|
+
/* harmony export */ "ECSchemaRpcLocater": () => (/* binding */ ECSchemaRpcLocater)
|
|
71494
|
+
/* harmony export */ });
|
|
71495
|
+
/* harmony import */ var _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/ecschema-metadata */ "../../core/ecschema-metadata/lib/esm/ecschema-metadata.js");
|
|
71496
|
+
/* harmony import */ var _ECSchemaRpcInterface__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ECSchemaRpcInterface */ "../../core/ecschema-rpc/common/lib/esm/ECSchemaRpcInterface.js");
|
|
71493
71497
|
/*---------------------------------------------------------------------------------------------
|
|
71494
71498
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
71495
71499
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
71496
71500
|
*--------------------------------------------------------------------------------------------*/
|
|
71497
|
-
|
|
71498
|
-
|
|
71501
|
+
|
|
71502
|
+
|
|
71499
71503
|
/**
|
|
71500
71504
|
* Defines a schema locater that retrieves schemas using an RPC interface.
|
|
71501
71505
|
* @beta
|
|
@@ -71520,8 +71524,8 @@ class ECSchemaRpcLocater {
|
|
|
71520
71524
|
* @param matchType The match type to use when locating the schema
|
|
71521
71525
|
*/
|
|
71522
71526
|
async getSchemaInfo(schemaKey, matchType, context) {
|
|
71523
|
-
const schemaJson = await
|
|
71524
|
-
const schemaInfo = await
|
|
71527
|
+
const schemaJson = await _ECSchemaRpcInterface__WEBPACK_IMPORTED_MODULE_1__.ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name);
|
|
71528
|
+
const schemaInfo = await _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__.Schema.startLoadingFromJson(schemaJson, context || new _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__.SchemaContext());
|
|
71525
71529
|
if (schemaInfo !== undefined && schemaInfo.schemaKey.matches(schemaKey, matchType)) {
|
|
71526
71530
|
return schemaInfo;
|
|
71527
71531
|
}
|
|
@@ -71534,50 +71538,40 @@ class ECSchemaRpcLocater {
|
|
|
71534
71538
|
* @param context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
|
|
71535
71539
|
*/
|
|
71536
71540
|
getSchemaSync(schemaKey, matchType, context) {
|
|
71537
|
-
const schemaJson =
|
|
71541
|
+
const schemaJson = _ECSchemaRpcInterface__WEBPACK_IMPORTED_MODULE_1__.ECSchemaRpcInterface.getClient().getSchemaJSON(this.token, schemaKey.name).then((props) => {
|
|
71538
71542
|
return props;
|
|
71539
71543
|
});
|
|
71540
|
-
const schema =
|
|
71544
|
+
const schema = _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__.Schema.fromJsonSync(schemaJson, context || new _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__.SchemaContext());
|
|
71541
71545
|
if (schema !== undefined && schema.schemaKey.matches(schemaKey, matchType)) {
|
|
71542
71546
|
return schema;
|
|
71543
71547
|
}
|
|
71544
71548
|
return undefined;
|
|
71545
71549
|
}
|
|
71546
71550
|
}
|
|
71547
|
-
exports.ECSchemaRpcLocater = ECSchemaRpcLocater;
|
|
71548
71551
|
|
|
71549
71552
|
|
|
71550
71553
|
/***/ }),
|
|
71551
71554
|
|
|
71552
|
-
/***/ "../../core/ecschema-rpc/common/lib/
|
|
71555
|
+
/***/ "../../core/ecschema-rpc/common/lib/esm/ecschema-rpc-interface.js":
|
|
71553
71556
|
/*!************************************************************************!*\
|
|
71554
|
-
!*** ../../core/ecschema-rpc/common/lib/
|
|
71557
|
+
!*** ../../core/ecschema-rpc/common/lib/esm/ecschema-rpc-interface.js ***!
|
|
71555
71558
|
\************************************************************************/
|
|
71556
|
-
/***/ (
|
|
71559
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
71557
71560
|
|
|
71558
71561
|
"use strict";
|
|
71559
|
-
|
|
71560
|
-
|
|
71561
|
-
|
|
71562
|
-
|
|
71563
|
-
|
|
71564
|
-
|
|
71565
|
-
|
|
71566
|
-
Object.defineProperty(o, k2, desc);
|
|
71567
|
-
}) : (function(o, m, k, k2) {
|
|
71568
|
-
if (k2 === undefined) k2 = k;
|
|
71569
|
-
o[k2] = m[k];
|
|
71570
|
-
}));
|
|
71571
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
71572
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
71573
|
-
};
|
|
71574
|
-
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
71562
|
+
__webpack_require__.r(__webpack_exports__);
|
|
71563
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
71564
|
+
/* harmony export */ "ECSchemaRpcInterface": () => (/* reexport safe */ _ECSchemaRpcInterface__WEBPACK_IMPORTED_MODULE_0__.ECSchemaRpcInterface),
|
|
71565
|
+
/* harmony export */ "ECSchemaRpcLocater": () => (/* reexport safe */ _ECSchemaRpcLocater__WEBPACK_IMPORTED_MODULE_1__.ECSchemaRpcLocater)
|
|
71566
|
+
/* harmony export */ });
|
|
71567
|
+
/* harmony import */ var _ECSchemaRpcInterface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ECSchemaRpcInterface */ "../../core/ecschema-rpc/common/lib/esm/ECSchemaRpcInterface.js");
|
|
71568
|
+
/* harmony import */ var _ECSchemaRpcLocater__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ECSchemaRpcLocater */ "../../core/ecschema-rpc/common/lib/esm/ECSchemaRpcLocater.js");
|
|
71575
71569
|
/*---------------------------------------------------------------------------------------------
|
|
71576
71570
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
71577
71571
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
71578
71572
|
*--------------------------------------------------------------------------------------------*/
|
|
71579
|
-
|
|
71580
|
-
|
|
71573
|
+
|
|
71574
|
+
|
|
71581
71575
|
|
|
71582
71576
|
|
|
71583
71577
|
/***/ }),
|
|
@@ -188441,6 +188435,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
188441
188435
|
/* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
188442
188436
|
/* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
|
|
188443
188437
|
/* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
|
|
188438
|
+
/* harmony import */ var _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndUnitNormal */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js");
|
|
188444
188439
|
/* harmony import */ var _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndVectors */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndVectors.js");
|
|
188445
188440
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
188446
188441
|
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
@@ -188450,13 +188445,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
188450
188445
|
/* harmony import */ var _CurveExtendMode__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./CurveExtendMode */ "../../core/geometry/lib/esm/curve/CurveExtendMode.js");
|
|
188451
188446
|
/* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
|
|
188452
188447
|
/* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
|
|
188453
|
-
/* harmony import */ var
|
|
188454
|
-
/* harmony import */ var
|
|
188455
|
-
/* harmony import */ var
|
|
188448
|
+
/* harmony import */ var _internalContexts_CurveOffsetXYHandler__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./internalContexts/CurveOffsetXYHandler */ "../../core/geometry/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js");
|
|
188449
|
+
/* harmony import */ var _internalContexts_EllipticalArcApproximationContext__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./internalContexts/EllipticalArcApproximationContext */ "../../core/geometry/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js");
|
|
188450
|
+
/* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
|
|
188456
188451
|
/* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
188457
188452
|
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
188458
|
-
/* harmony import */ var
|
|
188459
|
-
/* harmony import */ var
|
|
188453
|
+
/* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
|
|
188454
|
+
/* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
|
|
188460
188455
|
/* harmony import */ var _StrokeOptions__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
|
|
188461
188456
|
/*---------------------------------------------------------------------------------------------
|
|
188462
188457
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
@@ -188482,6 +188477,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
188482
188477
|
|
|
188483
188478
|
|
|
188484
188479
|
|
|
188480
|
+
|
|
188485
188481
|
|
|
188486
188482
|
|
|
188487
188483
|
/**
|
|
@@ -189220,7 +189216,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
189220
189216
|
const axy = this._matrix.columnXDotColumnY();
|
|
189221
189217
|
return _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_8__.Angle.isPerpendicularDotSet(axx, ayy, axy) && _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isSameCoordinateSquared(axx, ayy);
|
|
189222
189218
|
}
|
|
189223
|
-
/** Return radius if the vector0 and vector90 are of equal length and perpendicular. */
|
|
189219
|
+
/** Return radius if the vector0 and vector90 are of equal length and perpendicular. Ignores z. */
|
|
189224
189220
|
circularRadiusXY() {
|
|
189225
189221
|
const ux = this._matrix.at(0, 0);
|
|
189226
189222
|
const uy = this._matrix.at(1, 0);
|
|
@@ -189362,7 +189358,12 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
189362
189358
|
setVector0Vector90(vector0, vector90) {
|
|
189363
189359
|
this._matrix.setColumns(vector0, vector90, vector0.unitCrossProductWithDefault(vector90, 0, 0, 0));
|
|
189364
189360
|
}
|
|
189365
|
-
/**
|
|
189361
|
+
/**
|
|
189362
|
+
* Return the symmetric definition of the arc, with rigid axes and radii.
|
|
189363
|
+
* * The caller can send the returned data into [[createScaledXYColumns]] to construct the major-minor axis
|
|
189364
|
+
* version of the instance arc. This formulation of the arc has the same shape, but has perpendicular axes,
|
|
189365
|
+
* from which the arc's symmetry is readily apparent.
|
|
189366
|
+
*/
|
|
189366
189367
|
toScaledMatrix3d() {
|
|
189367
189368
|
const angleData = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_8__.Angle.dotProductsToHalfAngleTrigValues(this._matrix.columnXMagnitudeSquared(), this._matrix.columnYMagnitudeSquared(), this._matrix.columnXDotColumnY(), true);
|
|
189368
189369
|
const vector0A = this._matrix.multiplyXY(angleData.c, angleData.s);
|
|
@@ -189502,9 +189503,9 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
189502
189503
|
}
|
|
189503
189504
|
/**
|
|
189504
189505
|
* Return an arc whose basis vectors are rotated by given angle within the current basis space.
|
|
189505
|
-
* *
|
|
189506
|
-
*
|
|
189507
|
-
*
|
|
189506
|
+
* * The returned arc will have `vector0 = this.vector0 * cos(theta) + this.vector90 * sin(theta)`.
|
|
189507
|
+
* * The returned arc has the same shape as the instance.
|
|
189508
|
+
* * In other words, the arc's sweep is adjusted so that all fractional parameters evaluate to the same points.
|
|
189508
189509
|
* * Specifically, theta is subtracted from the original start and end angles.
|
|
189509
189510
|
* @param theta the angle (in the input arc space) which is to become the 0-degree point in the new arc.
|
|
189510
189511
|
*/
|
|
@@ -189517,6 +189518,39 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
189517
189518
|
const arcB = Arc3d.create(this._center.clone(), vector0, vector90, newSweep);
|
|
189518
189519
|
return arcB;
|
|
189519
189520
|
}
|
|
189521
|
+
/**
|
|
189522
|
+
* Return a cloned arc with basis rotated to align with the global axes. The arc's shape is unchanged.
|
|
189523
|
+
* * This method is most useful when the instance is an xy-circular arc, for then the aligned arc's stored sweep
|
|
189524
|
+
* angles can be understood as being measured from the global positive x-axis to the arc's start/end. This is *not*
|
|
189525
|
+
* the case for xy-elliptical arcs: the parameter angle difference between two points on an ellipse is in general
|
|
189526
|
+
* not the same as the angle measured between their radials.
|
|
189527
|
+
* * For an xy instance, the output arc will have:
|
|
189528
|
+
* * vector0 is in the same direction as the positive x-axis
|
|
189529
|
+
* * perpendicularVector is in the same direction as the positive z-axis
|
|
189530
|
+
* * For a general instance, the output arc will have:
|
|
189531
|
+
* * vector0 is in the same direction as the projection of the positive x-axis vector onto the arc plane
|
|
189532
|
+
* * perpendicularVector lies in the halfspace z >= 0
|
|
189533
|
+
* @returns cloned arc, or undefined (if the instance normal is parallel to the x-axis, or its matrix is singular)
|
|
189534
|
+
*/
|
|
189535
|
+
cloneAxisAligned() {
|
|
189536
|
+
const plane = _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_17__.Plane3dByOriginAndUnitNormal.create(this.center, this.perpendicularVector.crossProduct(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.unitX()));
|
|
189537
|
+
if (!plane)
|
|
189538
|
+
return undefined;
|
|
189539
|
+
const axisPts = [];
|
|
189540
|
+
if (2 !== this.appendPlaneIntersectionPoints(plane, axisPts))
|
|
189541
|
+
return undefined;
|
|
189542
|
+
const iAxisPt = plane.getNormalRef().dotProduct(this.perpendicularVector.crossProductStartEnd(this.center, axisPts[0].point)) > 0.0 ? 0 : 1;
|
|
189543
|
+
const toUnitX = this.sweep.fractionToAngle(axisPts[iAxisPt].fraction);
|
|
189544
|
+
const arc1 = this.cloneInRotatedBasis(toUnitX); // rotate in arc's plane
|
|
189545
|
+
if (this.perpendicularVector.dotProduct(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_4__.Vector3d.unitZ()) < -_Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.smallAngleRadians) {
|
|
189546
|
+
if (this.matrixRef.isSingular())
|
|
189547
|
+
return undefined;
|
|
189548
|
+
const flip = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__.Matrix3d.createRowValues(1, 0, 0, 0, -1, 0, 0, 0, -1); // rotate 180 degrees around arc's local x-axis
|
|
189549
|
+
arc1.matrixRef.multiplyMatrixMatrix(flip, arc1.matrixRef);
|
|
189550
|
+
arc1.sweep.setStartEndDegrees(-arc1.sweep.startDegrees, -arc1.sweep.endDegrees); // rotation alone is insufficient to flip
|
|
189551
|
+
}
|
|
189552
|
+
return arc1;
|
|
189553
|
+
}
|
|
189520
189554
|
/**
|
|
189521
189555
|
* Find intervals of this CurvePrimitive that are interior to a clipper.
|
|
189522
189556
|
* @param clipper clip structure (e.g.clip planes).
|
|
@@ -189616,7 +189650,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
189616
189650
|
* @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object.
|
|
189617
189651
|
*/
|
|
189618
189652
|
constructOffsetXY(offsetDistanceOrOptions) {
|
|
189619
|
-
const options =
|
|
189653
|
+
const options = _OffsetOptions__WEBPACK_IMPORTED_MODULE_18__.OffsetOptions.create(offsetDistanceOrOptions);
|
|
189620
189654
|
if (this.isCircular || options.preserveEllipticalArcs) {
|
|
189621
189655
|
const arcXY = this.cloneAtZ();
|
|
189622
189656
|
const sign = arcXY.sweep.sweepRadians * arcXY.matrixRef.coffs[8] >= 0.0 ? 1.0 : -1.0;
|
|
@@ -189638,7 +189672,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
189638
189672
|
}
|
|
189639
189673
|
}
|
|
189640
189674
|
// default impl
|
|
189641
|
-
const handler = new
|
|
189675
|
+
const handler = new _internalContexts_CurveOffsetXYHandler__WEBPACK_IMPORTED_MODULE_19__.CurveOffsetXYHandler(this, options.leftOffsetDistance);
|
|
189642
189676
|
this.emitStrokableParts(handler, options.strokeOptions);
|
|
189643
189677
|
return handler.claimResult();
|
|
189644
189678
|
}
|
|
@@ -189649,7 +189683,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
189649
189683
|
* @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the end of the ray.
|
|
189650
189684
|
*/
|
|
189651
189685
|
projectedParameterRange(ray, lowHigh) {
|
|
189652
|
-
return
|
|
189686
|
+
return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_20__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
|
|
189653
189687
|
}
|
|
189654
189688
|
/**
|
|
189655
189689
|
* Construct a circular arc chain approximation to the instance elliptical arc.
|
|
@@ -189659,10 +189693,10 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
189659
189693
|
constructCircularArcChainApproximation(options) {
|
|
189660
189694
|
if (!options)
|
|
189661
189695
|
options = EllipticalArcApproximationOptions.create();
|
|
189662
|
-
const context =
|
|
189696
|
+
const context = _internalContexts_EllipticalArcApproximationContext__WEBPACK_IMPORTED_MODULE_21__.EllipticalArcApproximationContext.create(this);
|
|
189663
189697
|
const result = context.constructCircularArcChainApproximation(options);
|
|
189664
189698
|
if (!result && this.isCircular)
|
|
189665
|
-
return (this.sweep.isFullCircle && options.forcePath) ?
|
|
189699
|
+
return (this.sweep.isFullCircle && options.forcePath) ? _Path__WEBPACK_IMPORTED_MODULE_22__.Path.create(this) : this;
|
|
189666
189700
|
return result;
|
|
189667
189701
|
}
|
|
189668
189702
|
}
|
|
@@ -190828,6 +190862,11 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
190828
190862
|
}
|
|
190829
190863
|
return detailA;
|
|
190830
190864
|
}
|
|
190865
|
+
/** Reverse the collection's data so that each child curve's fractional stroking moves in the opposite direction. */
|
|
190866
|
+
reverseInPlace() {
|
|
190867
|
+
for (const curve of this.children)
|
|
190868
|
+
curve.reverseInPlace();
|
|
190869
|
+
}
|
|
190831
190870
|
/**
|
|
190832
190871
|
* Return the max gap between adjacent primitives in Path and Loop collections.
|
|
190833
190872
|
* * In a Path, gaps are computed between consecutive primitives.
|
|
@@ -191067,14 +191106,18 @@ class CurveChain extends CurveCollection {
|
|
|
191067
191106
|
curve.extendRange(range, transform);
|
|
191068
191107
|
}
|
|
191069
191108
|
/**
|
|
191070
|
-
* Reverse each child curve (in place)
|
|
191071
|
-
* Reverse the order of the children
|
|
191109
|
+
* Reverse each child curve (in place).
|
|
191110
|
+
* Reverse the order of the children array.
|
|
191072
191111
|
*/
|
|
191073
191112
|
reverseChildrenInPlace() {
|
|
191074
191113
|
for (const curve of this._curves)
|
|
191075
191114
|
curve.reverseInPlace();
|
|
191076
191115
|
this._curves.reverse();
|
|
191077
191116
|
}
|
|
191117
|
+
/** Same as [[reverseChildrenInPlace]]. */
|
|
191118
|
+
reverseInPlace() {
|
|
191119
|
+
this.reverseChildrenInPlace();
|
|
191120
|
+
}
|
|
191078
191121
|
/**
|
|
191079
191122
|
* Return the index where target is found in the array of children.
|
|
191080
191123
|
* @param alsoSearchProxies whether to also check proxy curves of the children
|
|
@@ -194339,34 +194382,34 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePri
|
|
|
194339
194382
|
}
|
|
194340
194383
|
/**
|
|
194341
194384
|
* Return array of fraction parameters.
|
|
194342
|
-
* * These
|
|
194385
|
+
* * These are only present during certain constructions such as faceting.
|
|
194343
194386
|
* * When present, these fractions are fractions of some other curve being stroked, and are NOT related to the
|
|
194344
194387
|
* linestring fraction parameters.
|
|
194345
194388
|
*/
|
|
194346
194389
|
get fractions() {
|
|
194347
194390
|
return this._fractions;
|
|
194348
194391
|
}
|
|
194349
|
-
/** Return the (optional) array of derivatives. These
|
|
194392
|
+
/** Return the (optional) array of derivatives. These are only present during certain constructions such as faceting. */
|
|
194350
194393
|
get packedDerivatives() {
|
|
194351
194394
|
return this._derivatives;
|
|
194352
194395
|
}
|
|
194353
|
-
/** Return the (optional) array of uv
|
|
194396
|
+
/** Return the (optional) array of uv parameters. These are only present during certain constructions such as faceting. */
|
|
194354
194397
|
get packedUVParams() {
|
|
194355
194398
|
return this._uvParams;
|
|
194356
194399
|
}
|
|
194357
|
-
/** Return the (optional) array of surface normals. These
|
|
194400
|
+
/** Return the (optional) array of surface normals. These are only present during certain constructions such as faceting. */
|
|
194358
194401
|
get packedSurfaceNormals() {
|
|
194359
194402
|
return this._surfaceNormals;
|
|
194360
194403
|
}
|
|
194361
|
-
/** Return the (optional) array of normal indices. These
|
|
194404
|
+
/** Return the (optional) array of normal indices. These are only present during certain constructions such as faceting. */
|
|
194362
194405
|
get normalIndices() {
|
|
194363
194406
|
return this._normalIndices;
|
|
194364
194407
|
}
|
|
194365
|
-
/** Return the (optional) array of
|
|
194408
|
+
/** Return the (optional) array of uv parameter indices. These are only present during certain constructions such as faceting. */
|
|
194366
194409
|
get paramIndices() {
|
|
194367
194410
|
return this._uvIndices;
|
|
194368
194411
|
}
|
|
194369
|
-
/** Return the (optional) array of point indices. These
|
|
194412
|
+
/** Return the (optional) array of point indices. These are only present during certain constructions such as faceting. */
|
|
194370
194413
|
get pointIndices() {
|
|
194371
194414
|
return this._pointIndices;
|
|
194372
194415
|
}
|
|
@@ -194948,11 +194991,32 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePri
|
|
|
194948
194991
|
reverseInPlace() {
|
|
194949
194992
|
if (this._points.length >= 2) {
|
|
194950
194993
|
this._points.reverseInPlace();
|
|
194994
|
+
if (this._fractions) {
|
|
194995
|
+
this._fractions.reverseInPlace();
|
|
194996
|
+
for (let i = 0; i < this._fractions.length; ++i)
|
|
194997
|
+
this._fractions.reassign(i, 1.0 - this._fractions.atUncheckedIndex(i));
|
|
194998
|
+
}
|
|
194951
194999
|
if (this._uvParams)
|
|
194952
195000
|
this._uvParams.reverseInPlace();
|
|
195001
|
+
if (this._derivatives) {
|
|
195002
|
+
this._derivatives.reverseInPlace();
|
|
195003
|
+
this._derivatives.scaleInPlace(-1.0);
|
|
195004
|
+
}
|
|
195005
|
+
if (this._surfaceNormals)
|
|
195006
|
+
this._surfaceNormals.reverseInPlace();
|
|
195007
|
+
if (this._pointIndices)
|
|
195008
|
+
this._pointIndices.reverseInPlace();
|
|
195009
|
+
if (this._uvIndices)
|
|
195010
|
+
this._uvIndices.reverseInPlace();
|
|
195011
|
+
if (this._normalIndices)
|
|
195012
|
+
this._normalIndices.reverseInPlace();
|
|
194953
195013
|
}
|
|
194954
195014
|
}
|
|
194955
|
-
/**
|
|
195015
|
+
/**
|
|
195016
|
+
* Apply `transform` to each point of this linestring.
|
|
195017
|
+
* * Note that this method always returns true. If transforming the surface normals fails (due to singular matrix or zero
|
|
195018
|
+
* normal), the original normal(s) are left unchanged.
|
|
195019
|
+
*/
|
|
194956
195020
|
tryTransformInPlace(transform) {
|
|
194957
195021
|
this._points.multiplyTransformInPlace(transform);
|
|
194958
195022
|
if (this._derivatives)
|
|
@@ -195778,7 +195842,6 @@ class Loop extends _CurveCollection__WEBPACK_IMPORTED_MODULE_0__.CurveChain {
|
|
|
195778
195842
|
isSameGeometryClass(other) {
|
|
195779
195843
|
return other instanceof Loop;
|
|
195780
195844
|
}
|
|
195781
|
-
/** Test if `other` is an instance of `Loop` */
|
|
195782
195845
|
constructor() {
|
|
195783
195846
|
super();
|
|
195784
195847
|
/** String name for schema properties */
|
|
@@ -195787,8 +195850,10 @@ class Loop extends _CurveCollection__WEBPACK_IMPORTED_MODULE_0__.CurveChain {
|
|
|
195787
195850
|
this.isInner = false;
|
|
195788
195851
|
}
|
|
195789
195852
|
/**
|
|
195790
|
-
* Create a loop from variable length list of
|
|
195791
|
-
*
|
|
195853
|
+
* Create a loop from a variable length list of [[CurvePrimitive]]s.
|
|
195854
|
+
* * A significant gap between the end of one curve and the start of the next, or between chain start and end,
|
|
195855
|
+
* is not bridged and may cause unexpected behavior.
|
|
195856
|
+
* @param curves array of individual curve primitives, assumed to form a closed planar loop.
|
|
195792
195857
|
*/
|
|
195793
195858
|
static create(...curves) {
|
|
195794
195859
|
const result = new Loop();
|
|
@@ -195801,13 +195866,18 @@ class Loop extends _CurveCollection__WEBPACK_IMPORTED_MODULE_0__.CurveChain {
|
|
|
195801
195866
|
return result;
|
|
195802
195867
|
}
|
|
195803
195868
|
/**
|
|
195804
|
-
* Create a loop from an array of
|
|
195805
|
-
*
|
|
195869
|
+
* Create a loop from an array of [[CurvePrimitive]]s.
|
|
195870
|
+
* * A significant gap between the end of one curve and the start of the next, or between chain start and end,
|
|
195871
|
+
* is not bridged and may cause unexpected behavior.
|
|
195872
|
+
* @param curves array of individual curve primitives, assumed to form a closed planar loop.
|
|
195806
195873
|
*/
|
|
195807
195874
|
static createArray(curves) {
|
|
195808
195875
|
return this.create(...curves);
|
|
195809
195876
|
}
|
|
195810
|
-
/**
|
|
195877
|
+
/**
|
|
195878
|
+
* Create a loop from an array of coplanar points.
|
|
195879
|
+
* @param points vertices of polygon, closure point optional.
|
|
195880
|
+
*/
|
|
195811
195881
|
static createPolygon(points) {
|
|
195812
195882
|
const linestring = _LineString3d__WEBPACK_IMPORTED_MODULE_2__.LineString3d.create(points);
|
|
195813
195883
|
linestring.addClosurePoint();
|
|
@@ -196972,14 +197042,16 @@ class CylindricalRangeQuery extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
196972
197042
|
return accumulator._perpVector.clone();
|
|
196973
197043
|
}
|
|
196974
197044
|
/**
|
|
196975
|
-
* Recurse through geometry.children to find linestrings.
|
|
196976
|
-
*
|
|
197045
|
+
* Recurse through `geometry.children` to find linestrings.
|
|
197046
|
+
* For each linestring, compute and store the normal of the rotational surface resulting from sweeping the
|
|
197047
|
+
* geometry around `axis` through a positive angle, using:
|
|
196977
197048
|
* * the curve tangent stored in the linestring
|
|
196978
197049
|
* * the axis of rotation
|
|
196979
|
-
* * a default V vector to be used when the linestring point is close to the axis
|
|
196980
|
-
* @param geometry
|
|
196981
|
-
*
|
|
196982
|
-
* @param
|
|
197050
|
+
* * a default V vector to be used when the linestring point is close to the axis
|
|
197051
|
+
* @param geometry profile curve (e.g., linestring, parity region). The orientation of the curve should be such that
|
|
197052
|
+
* the computed normal lies in the same half-space as the rotational sweep direction.
|
|
197053
|
+
* @param axis rotational axis
|
|
197054
|
+
* @param defaultVectorFromAxis default vector perpendicular to `axis` (e.g., sweepVector)
|
|
196983
197055
|
*/
|
|
196984
197056
|
static buildRotationalNormalsInLineStrings(geometry, axis, defaultVectorFromAxis) {
|
|
196985
197057
|
if (geometry instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d) {
|
|
@@ -196988,18 +197060,20 @@ class CylindricalRangeQuery extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
196988
197060
|
const normals = geometry.ensureEmptySurfaceNormals();
|
|
196989
197061
|
if (derivatives && normals) {
|
|
196990
197062
|
const vectorU = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
196991
|
-
const vectorV = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
197063
|
+
const vectorV = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
196992
197064
|
const xyz = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
196993
197065
|
const n = points.length;
|
|
196994
197066
|
for (let i = 0; i < n; i++) {
|
|
196995
197067
|
points.getPoint3dAtUncheckedPointIndex(i, xyz);
|
|
196996
197068
|
axis.perpendicularPartOfVectorToTarget(xyz, vectorU);
|
|
197069
|
+
// compute the positive sweep direction. ASSUME: the rotational sweep angle is positive!
|
|
196997
197070
|
if (vectorU.isAlmostZero)
|
|
196998
197071
|
axis.direction.crossProduct(defaultVectorFromAxis, vectorV);
|
|
196999
197072
|
else
|
|
197000
197073
|
axis.direction.crossProduct(vectorU, vectorV);
|
|
197001
|
-
|
|
197002
|
-
|
|
197074
|
+
// ASSUME: orientation-based profile normal is in the same half-space as vectorV
|
|
197075
|
+
geometry.packedDerivatives.getVector3dAtCheckedVectorIndex(i, vectorU); // reuse vectorU
|
|
197076
|
+
vectorU.crossProduct(vectorV, vectorV); // reuse vectorV
|
|
197003
197077
|
vectorV.normalizeInPlace();
|
|
197004
197078
|
normals.push(vectorV);
|
|
197005
197079
|
}
|
|
@@ -204013,16 +204087,19 @@ class ArcChainErrorProcessor extends QuadrantFractionsProcessor {
|
|
|
204013
204087
|
}
|
|
204014
204088
|
}
|
|
204015
204089
|
/**
|
|
204016
|
-
* Processor for
|
|
204017
|
-
*
|
|
204018
|
-
*
|
|
204019
|
-
* `q
|
|
204020
|
-
*
|
|
204021
|
-
*
|
|
204022
|
-
*
|
|
204023
|
-
* * This processor
|
|
204024
|
-
*
|
|
204025
|
-
*
|
|
204090
|
+
* Processor for computing an optimal refinement of a single Q1 ordered interval [f0,f1] by perturbing an interior
|
|
204091
|
+
* seed fraction f.
|
|
204092
|
+
* * Typically the caller (cf. [[AdaptiveSubdivisionQ1ErrorProcessor.announceArc]] processes a
|
|
204093
|
+
* QuadrantFractions `q` with `q.quadrant` = 1 until convergence. The `q.fractions` array is expected to have
|
|
204094
|
+
* one of two forms:
|
|
204095
|
+
* * [fPrev, f0, f, f1], where fPrev is from the adjacent interval (possibly just refined), or
|
|
204096
|
+
* * [f0, f, f1], if `q.interpolateStartTangent === true`.
|
|
204097
|
+
* * This processor implements a bisection algorithm that iteratively shrinks a sub-interval that brackets f,
|
|
204098
|
+
* starting with [f0,f1]:
|
|
204099
|
+
* * During processing, `announceArc` will be called twice to compute the approximation errors of the circular
|
|
204100
|
+
* arcs on either side of f in the current bracket.
|
|
204101
|
+
* * In `announceQuadrantEnd` if these two errors are almost equal, we are done refining [f0,f1]. Otherwise,
|
|
204102
|
+
* we move f halfway to the endpoint of the bracket that decreases the error delta, and shrink our bracket.
|
|
204026
204103
|
* @internal
|
|
204027
204104
|
*/
|
|
204028
204105
|
class AdaptiveSubdivisionQ1IntervalErrorProcessor extends QuadrantFractionsProcessor {
|
|
@@ -204094,14 +204171,17 @@ class AdaptiveSubdivisionQ1IntervalErrorProcessor extends QuadrantFractionsProce
|
|
|
204094
204171
|
/**
|
|
204095
204172
|
* Processor for computing samples in Q1 for a subdivision-based arc chain approximation.
|
|
204096
204173
|
* * The basic idea is to build a refinement of `q.fractions` for a QuadrantFractions q with q.quadrant = 1.
|
|
204097
|
-
* *
|
|
204098
|
-
* *
|
|
204099
|
-
*
|
|
204100
|
-
*
|
|
204101
|
-
*
|
|
204102
|
-
*
|
|
204103
|
-
*
|
|
204104
|
-
*
|
|
204174
|
+
* * In `announceQuadrantBegin` we start off the refinement with a copy of `q.fractions`.
|
|
204175
|
+
* * In `announceArc` we are called to process the interval [f0,f1] in `q.fractions`. First we test if the
|
|
204176
|
+
* announced arc's approximation error over [f0,f1] exceeds maxError.
|
|
204177
|
+
* * If so, we employ [[AdaptiveSubdivisionQ1IntervalErrorProcessor]] to compute an interior fraction f
|
|
204178
|
+
* that best refines the interval, which becomes [f0,f,f1].
|
|
204179
|
+
* * Otherwise, the fraction span [f0,f1] is unchanged---no additional samples are needed to decrease the
|
|
204180
|
+
* approximation error.
|
|
204181
|
+
* * In `announceQuadrantEnd`, `q.fractions` is updated in place with the computed refinement.
|
|
204182
|
+
* * The caller (e.g., [[AdaptiveSubdivisionSampler.computeRadiansStrictlyInsideQuadrant1]]) typically
|
|
204183
|
+
* re-processes `q` until `isRefined` returns false, at which point construction of an approximation that is
|
|
204184
|
+
* guaranteed not to exceed the desired error can commence.
|
|
204105
204185
|
* @internal
|
|
204106
204186
|
*/
|
|
204107
204187
|
class AdaptiveSubdivisionQ1ErrorProcessor extends QuadrantFractionsProcessor {
|
|
@@ -210253,16 +210333,22 @@ class BarycentricTriangle {
|
|
|
210253
210333
|
}
|
|
210254
210334
|
/**
|
|
210255
210335
|
* Compute the intersection of a line (parameterized as a ray) with the plane of this triangle.
|
|
210256
|
-
* *
|
|
210336
|
+
* * Intersection data is returned for the line-plane intersection.
|
|
210337
|
+
* * No intersection is returned if the line is parallel to the plane.
|
|
210338
|
+
* * As for the *ray*, it intersects this triangle if and only if the returned detail `d` has
|
|
210339
|
+
* `d.isValid === true` and `d.a >= 0` and `d.isInsideOrOn === true`.
|
|
210340
|
+
* * This method is slower than `Ray3d.intersectionWithTriangle` but returns more information about the intersection.
|
|
210257
210341
|
* @param ray infinite line to intersect, as a ray
|
|
210258
210342
|
* @param result optional pre-allocated object to fill and return
|
|
210259
|
-
* @returns details d of the line
|
|
210260
|
-
* * `d.
|
|
210261
|
-
* *
|
|
210262
|
-
* *
|
|
210263
|
-
* *
|
|
210264
|
-
*
|
|
210265
|
-
* * `d.
|
|
210343
|
+
* @returns details `d` of the intersection point `p` of the line and the plane of this triangle:
|
|
210344
|
+
* * `d.isValid`: false if and only if `ray.direction` is parallel to the plane, or the ray or triangle is degenerate.
|
|
210345
|
+
* * `d.world`: coordinates of `p`.
|
|
210346
|
+
* * `d.local`: barycentric coordinates of `p`.
|
|
210347
|
+
* * `d.a`: the intersection parameter of `p` along the ray. Negative means `p` is behind the ray origin.
|
|
210348
|
+
* * `d.classify`: where `p` lies with respect to the triangle.
|
|
210349
|
+
* * `d.isInsideOrOn`: whether `p` is inside or on the triangle.
|
|
210350
|
+
* * `d.closestEdgeIndex`: the index of the triangle edge `e` onto which `p` projects.
|
|
210351
|
+
* * `d.closestEdgeParam`: the edge parameter at which `p` projects onto `e`.
|
|
210266
210352
|
* * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/RayTriangleIntersection
|
|
210267
210353
|
* @see [[pointToFraction]]
|
|
210268
210354
|
*/
|
|
@@ -210279,6 +210365,9 @@ class BarycentricTriangle {
|
|
|
210279
210365
|
const d = ray.direction;
|
|
210280
210366
|
const u = BarycentricTriangle._workVector0 = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createStartEnd(this.points[0], this.points[1], BarycentricTriangle._workVector0);
|
|
210281
210367
|
const v = BarycentricTriangle._workVector1 = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createStartEnd(this.points[0], this.points[2], BarycentricTriangle._workVector1);
|
|
210368
|
+
const scaledVolume = d.tripleProduct(u, v);
|
|
210369
|
+
if (scaledVolume * scaledVolume <= u.dotProduct(u) * v.dotProduct(v) * d.dotProduct(d) * _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallAngleRadiansSquared)
|
|
210370
|
+
return result; // parallel (no solution)
|
|
210282
210371
|
const M = BarycentricTriangle._workMatrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_4__.Matrix3d.createColumns(u, v, d, BarycentricTriangle._workMatrix);
|
|
210283
210372
|
const c = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createStartEnd(this.points[0], r0, BarycentricTriangle._workVector0); // reuse workVector0
|
|
210284
210373
|
const solution = BarycentricTriangle._workVector1; // reuse workVector1
|
|
@@ -213320,6 +213409,10 @@ class GrowableFloat64Array {
|
|
|
213320
213409
|
}
|
|
213321
213410
|
this._inUse = numAccepted;
|
|
213322
213411
|
}
|
|
213412
|
+
/** reverse the order of values. */
|
|
213413
|
+
reverseInPlace() {
|
|
213414
|
+
this._data.reverse();
|
|
213415
|
+
}
|
|
213323
213416
|
}
|
|
213324
213417
|
|
|
213325
213418
|
|
|
@@ -215595,9 +215688,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
215595
215688
|
/* harmony export */ });
|
|
215596
215689
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
215597
215690
|
/* harmony import */ var _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry4d/Point4d */ "../../core/geometry/lib/esm/geometry4d/Point4d.js");
|
|
215598
|
-
/* harmony import */ var
|
|
215691
|
+
/* harmony import */ var _Angle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
215599
215692
|
/* harmony import */ var _Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
|
|
215600
|
-
/* harmony import */ var
|
|
215693
|
+
/* harmony import */ var _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
215601
215694
|
/* harmony import */ var _Transform__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
215602
215695
|
/*---------------------------------------------------------------------------------------------
|
|
215603
215696
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
@@ -215897,32 +215990,35 @@ class Matrix3d {
|
|
|
215897
215990
|
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isDistanceWithinTol(max, tol);
|
|
215898
215991
|
}
|
|
215899
215992
|
/**
|
|
215900
|
-
*
|
|
215901
|
-
*
|
|
215902
|
-
* *
|
|
215903
|
-
*
|
|
215993
|
+
* A matrix equivalence test, returning true if and only if the matrices are almost equal,
|
|
215994
|
+
* or all of the following column comparisons hold:
|
|
215995
|
+
* * z columns are almost equal, and
|
|
215996
|
+
* * x columns differ only by a rotation of angle t around the z column, and
|
|
215997
|
+
* * y columns differ only by a rotation of the same angle t around the z column.
|
|
215998
|
+
* @param other matrix to compare
|
|
215999
|
+
* @param tol optional distance tolerance, for comparisons by Geometry.isDistanceWithinTol
|
|
216000
|
+
* @return whether matrices are almost equal modulo a rotation around their common nonzero z-column.
|
|
215904
216001
|
*/
|
|
215905
216002
|
isAlmostEqualAllowZRotation(other, tol) {
|
|
215906
216003
|
if (this.isAlmostEqual(other, tol))
|
|
215907
216004
|
return true;
|
|
215908
|
-
if (this.isAlmostEqualColumn(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, other, tol))
|
|
215909
|
-
|
|
215910
|
-
|
|
215911
|
-
|
|
215912
|
-
|
|
215913
|
-
|
|
215914
|
-
|
|
215915
|
-
|
|
215916
|
-
|
|
215917
|
-
|
|
215918
|
-
|
|
215919
|
-
|
|
215920
|
-
|
|
215921
|
-
|
|
215922
|
-
|
|
215923
|
-
|
|
215924
|
-
|
|
215925
|
-
return false;
|
|
216005
|
+
if (!this.isAlmostEqualColumn(_Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisIndex.Z, other, tol))
|
|
216006
|
+
return false;
|
|
216007
|
+
const columnX = this.columnX();
|
|
216008
|
+
const columnY = this.columnY();
|
|
216009
|
+
const columnZ = this.columnZ();
|
|
216010
|
+
const toOtherColumnX = columnX.signedAngleTo(other.columnX(), columnZ);
|
|
216011
|
+
let testColumn = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createRotateVectorAroundVector(columnX, columnZ, toOtherColumnX);
|
|
216012
|
+
if (!testColumn)
|
|
216013
|
+
return false; // columnZ is zero length
|
|
216014
|
+
if (!other.isAlmostEqualColumnXYZ(0, testColumn.x, testColumn.y, testColumn.z, tol))
|
|
216015
|
+
return false; // columnX rotated around columnZ by angle doesn't end up at other.columnX
|
|
216016
|
+
testColumn = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createRotateVectorAroundVector(columnY, columnZ, toOtherColumnX);
|
|
216017
|
+
if (!testColumn)
|
|
216018
|
+
return false;
|
|
216019
|
+
if (!other.isAlmostEqualColumnXYZ(1, testColumn.x, testColumn.y, testColumn.z, tol))
|
|
216020
|
+
return false; // columnY rotated around columnZ by angle doesn't end up at other.columnY
|
|
216021
|
+
return true;
|
|
215926
216022
|
}
|
|
215927
216023
|
/** Test for exact (bitwise) equality with other. */
|
|
215928
216024
|
isExactEqual(other) {
|
|
@@ -216198,10 +216294,10 @@ class Matrix3d {
|
|
|
216198
216294
|
const b = a / scale;
|
|
216199
216295
|
// if vectorA is close to the Z axis
|
|
216200
216296
|
if (Math.abs(vectorA.x) < b && Math.abs(vectorA.y) < b) {
|
|
216201
|
-
return
|
|
216297
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createCrossProduct(vectorA.x, vectorA.y, vectorA.z, 0, -1, 0, result);
|
|
216202
216298
|
}
|
|
216203
216299
|
// if vectorA is NOT close to the Z axis
|
|
216204
|
-
return
|
|
216300
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createCrossProduct(0, 0, 1, vectorA.x, vectorA.y, vectorA.z, result);
|
|
216205
216301
|
}
|
|
216206
216302
|
/**
|
|
216207
216303
|
* Return a vector that is perpendicular to the input `vectorA`.
|
|
@@ -216422,7 +216518,7 @@ class Matrix3d {
|
|
|
216422
216518
|
let c = Math.sqrt(0.5);
|
|
216423
216519
|
let s = leftNoneRight < 0.0 ? -c : c;
|
|
216424
216520
|
if (Math.abs(leftNoneRight) !== 1.0) {
|
|
216425
|
-
const radians =
|
|
216521
|
+
const radians = _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.degreesToRadians(45.0 * leftNoneRight);
|
|
216426
216522
|
c = Math.cos(radians);
|
|
216427
216523
|
s = Math.sin(radians);
|
|
216428
216524
|
}
|
|
@@ -216516,7 +216612,7 @@ class Matrix3d {
|
|
|
216516
216612
|
const sij = lambda.at(i, j);
|
|
216517
216613
|
if (Math.abs(sij) < _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallFloatingPoint * (sii + sjj))
|
|
216518
216614
|
return 0.0;
|
|
216519
|
-
const jacobi =
|
|
216615
|
+
const jacobi = _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.trigValuesToHalfAngleTrigValues(sii - sjj, 2.0 * sij);
|
|
216520
216616
|
const c = jacobi.c;
|
|
216521
216617
|
const s = jacobi.s;
|
|
216522
216618
|
/**
|
|
@@ -216596,7 +216692,7 @@ class Matrix3d {
|
|
|
216596
216692
|
const sij = this.coffs[indexIJ];
|
|
216597
216693
|
if (Math.abs(sij) < _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallFloatingPoint * (sii + sjj))
|
|
216598
216694
|
return 0.0;
|
|
216599
|
-
const jacobi =
|
|
216695
|
+
const jacobi = _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.trigValuesToHalfAngleTrigValues(sii - sjj, 2.0 * sij);
|
|
216600
216696
|
const c = jacobi.c;
|
|
216601
216697
|
const s = jacobi.s;
|
|
216602
216698
|
const cc = c * c;
|
|
@@ -216660,12 +216756,12 @@ class Matrix3d {
|
|
|
216660
216756
|
const e = c * c + s * s - 1.0; // s^2 + c^2 = 1
|
|
216661
216757
|
// if s^2 + c^2 != 1 then we have a bad matrix so return false
|
|
216662
216758
|
if (Math.abs(e) > _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallAngleRadians) {
|
|
216663
|
-
return { axis:
|
|
216759
|
+
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(0, 0, 1), angle: _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(0), ok: false };
|
|
216664
216760
|
}
|
|
216665
216761
|
// sin is close to 0 then we got to special cases (angle 0 or 180) which needs to be handled differently
|
|
216666
216762
|
if (Math.abs(s) < _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallAngleRadians) {
|
|
216667
216763
|
if (c > 0) // sin = 0 and cos = 1 so angle = 0 (i.e., no rotation)
|
|
216668
|
-
return { axis:
|
|
216764
|
+
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(0, 0, 1), angle: _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(0), ok: true };
|
|
216669
216765
|
/**
|
|
216670
216766
|
* If sin = 0 and cos = -1 then angle = 180 (i.e., 180 degree rotation around some axis)
|
|
216671
216767
|
* then the rotation matrix becomes
|
|
@@ -216683,34 +216779,34 @@ class Matrix3d {
|
|
|
216683
216779
|
const azz = this.coffs[8];
|
|
216684
216780
|
// Look for a pair of "-1" entries on the diagonal (for rotation around the basis X,Y,Z axis)
|
|
216685
216781
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1.0, ayy) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1, azz)) {
|
|
216686
|
-
return { axis:
|
|
216782
|
+
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(1, 0, 0), angle: _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(180), ok: true };
|
|
216687
216783
|
}
|
|
216688
216784
|
else if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1.0, axx) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1, azz)) {
|
|
216689
|
-
return { axis:
|
|
216785
|
+
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(0, 1, 0), angle: _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(180), ok: true };
|
|
216690
216786
|
}
|
|
216691
216787
|
else if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1.0, axx) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1, ayy)) {
|
|
216692
|
-
return { axis:
|
|
216788
|
+
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(0, 0, 1), angle: _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(180), ok: true };
|
|
216693
216789
|
}
|
|
216694
216790
|
// Look for eigenvector with eigenvalue = 1
|
|
216695
216791
|
const eigenvectors = Matrix3d.createIdentity();
|
|
216696
|
-
const eigenvalues =
|
|
216792
|
+
const eigenvalues = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(0, 0, 0);
|
|
216697
216793
|
if (this.fastSymmetricEigenvalues(eigenvectors, eigenvalues)) { // note: this matrix is "symmetric"
|
|
216698
216794
|
for (let axisIndex = 0; axisIndex < 2; axisIndex++) {
|
|
216699
216795
|
const lambda = eigenvalues.at(axisIndex);
|
|
216700
216796
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(1, lambda))
|
|
216701
|
-
return { axis: eigenvectors.getColumn(axisIndex), angle:
|
|
216797
|
+
return { axis: eigenvectors.getColumn(axisIndex), angle: _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(180), ok: true };
|
|
216702
216798
|
}
|
|
216703
216799
|
// if no eigenvalue = 1 was found return false
|
|
216704
|
-
return { axis:
|
|
216800
|
+
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(0, 0, 1), angle: _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(0), ok: false };
|
|
216705
216801
|
}
|
|
216706
216802
|
// if no axis was found return false
|
|
216707
|
-
return { axis:
|
|
216803
|
+
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(0, 0, 1), angle: _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(0), ok: false };
|
|
216708
216804
|
}
|
|
216709
216805
|
// good matrix and non-zero sine
|
|
216710
216806
|
const a = 1.0 / (2.0 * s);
|
|
216711
216807
|
const result = {
|
|
216712
|
-
axis:
|
|
216713
|
-
angle:
|
|
216808
|
+
axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(skewYZ * a, skewZX * a, skewXY * a),
|
|
216809
|
+
angle: _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createAtan2(s, c),
|
|
216714
216810
|
ok: true,
|
|
216715
216811
|
};
|
|
216716
216812
|
return result;
|
|
@@ -216734,7 +216830,7 @@ class Matrix3d {
|
|
|
216734
216830
|
const uDotV = this.coffs[i] * this.coffs[j]
|
|
216735
216831
|
+ this.coffs[i + 3] * this.coffs[j + 3]
|
|
216736
216832
|
+ this.coffs[i + 6] * this.coffs[j + 6];
|
|
216737
|
-
const jacobi =
|
|
216833
|
+
const jacobi = _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.trigValuesToHalfAngleTrigValues(uDotU - vDotV, 2.0 * uDotV);
|
|
216738
216834
|
const c = jacobi.c;
|
|
216739
216835
|
const s = jacobi.s;
|
|
216740
216836
|
if (Math.abs(s) < 2.0e-15)
|
|
@@ -216822,7 +216918,7 @@ class Matrix3d {
|
|
|
216822
216918
|
let upVector = vectorA.unitCrossProduct(vectorB);
|
|
216823
216919
|
// the usual case (both vectors and also their cross product is non-zero)
|
|
216824
216920
|
if (upVector) {
|
|
216825
|
-
return Matrix3d.createRotationAroundVector(upVector,
|
|
216921
|
+
return Matrix3d.createRotationAroundVector(upVector, _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(fraction * vectorA.planarAngleTo(vectorB, upVector).radians));
|
|
216826
216922
|
}
|
|
216827
216923
|
// if either vector is zero
|
|
216828
216924
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(vectorA.magnitude())
|
|
@@ -216833,7 +216929,7 @@ class Matrix3d {
|
|
|
216833
216929
|
return Matrix3d.createIdentity(result);
|
|
216834
216930
|
// opposing vectors (cross product = 0, dot product < 0)
|
|
216835
216931
|
upVector = Matrix3d.createPerpendicularVectorFavorPlaneContainingZ(vectorA, upVector);
|
|
216836
|
-
return Matrix3d.createRotationAroundVector(upVector,
|
|
216932
|
+
return Matrix3d.createRotationAroundVector(upVector, _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(fraction * Math.PI));
|
|
216837
216933
|
}
|
|
216838
216934
|
/** Returns a matrix that rotates from vectorA to vectorB. */
|
|
216839
216935
|
static createRotationVectorToVector(vectorA, vectorB, result) {
|
|
@@ -216860,15 +216956,15 @@ class Matrix3d {
|
|
|
216860
216956
|
}
|
|
216861
216957
|
/** Return (a copy of) the X column */
|
|
216862
216958
|
columnX(result) {
|
|
216863
|
-
return
|
|
216959
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(this.coffs[0], this.coffs[3], this.coffs[6], result);
|
|
216864
216960
|
}
|
|
216865
216961
|
/** Return (a copy of) the Y column */
|
|
216866
216962
|
columnY(result) {
|
|
216867
|
-
return
|
|
216963
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(this.coffs[1], this.coffs[4], this.coffs[7], result);
|
|
216868
216964
|
}
|
|
216869
216965
|
/** Return (a copy of) the Z column */
|
|
216870
216966
|
columnZ(result) {
|
|
216871
|
-
return
|
|
216967
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(this.coffs[2], this.coffs[5], this.coffs[8], result);
|
|
216872
216968
|
}
|
|
216873
216969
|
/** Return the X column magnitude squared */
|
|
216874
216970
|
columnXMagnitudeSquared() {
|
|
@@ -216940,15 +217036,15 @@ class Matrix3d {
|
|
|
216940
217036
|
}
|
|
216941
217037
|
/** Return (a copy of) the X row */
|
|
216942
217038
|
rowX(result) {
|
|
216943
|
-
return
|
|
217039
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(this.coffs[0], this.coffs[1], this.coffs[2], result);
|
|
216944
217040
|
}
|
|
216945
217041
|
/** Return (a copy of) the Y row */
|
|
216946
217042
|
rowY(result) {
|
|
216947
|
-
return
|
|
217043
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(this.coffs[3], this.coffs[4], this.coffs[5], result);
|
|
216948
217044
|
}
|
|
216949
217045
|
/** Return (a copy of) the Z row */
|
|
216950
217046
|
rowZ(result) {
|
|
216951
|
-
return
|
|
217047
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(this.coffs[6], this.coffs[7], this.coffs[8], result);
|
|
216952
217048
|
}
|
|
216953
217049
|
/** Return the dot product of the vector parameter with the X column. */
|
|
216954
217050
|
dotColumnX(vector) {
|
|
@@ -217045,7 +217141,7 @@ class Matrix3d {
|
|
|
217045
217141
|
*/
|
|
217046
217142
|
getColumn(columnIndex, result) {
|
|
217047
217143
|
const index = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.cyclic3dAxis(columnIndex);
|
|
217048
|
-
return
|
|
217144
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(this.coffs[index], this.coffs[index + 3], this.coffs[index + 6], result);
|
|
217049
217145
|
}
|
|
217050
217146
|
/**
|
|
217051
217147
|
* Return a (copy of) a row of the matrix.
|
|
@@ -217054,7 +217150,7 @@ class Matrix3d {
|
|
|
217054
217150
|
*/
|
|
217055
217151
|
getRow(columnIndex, result) {
|
|
217056
217152
|
const index = 3 * _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.cyclic3dAxis(columnIndex);
|
|
217057
|
-
return
|
|
217153
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(this.coffs[index], this.coffs[index + 1], this.coffs[index + 2], result);
|
|
217058
217154
|
}
|
|
217059
217155
|
/**
|
|
217060
217156
|
* Create a matrix from row vectors.
|
|
@@ -217136,7 +217232,7 @@ class Matrix3d {
|
|
|
217136
217232
|
const x = point.x;
|
|
217137
217233
|
const y = point.y;
|
|
217138
217234
|
const z = point.z;
|
|
217139
|
-
return
|
|
217235
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(this.coffs[0] * x + this.coffs[1] * y + this.coffs[2] * z, this.coffs[3] * x + this.coffs[4] * y + this.coffs[5] * z, this.coffs[6] * x + this.coffs[7] * y + this.coffs[8] * z, result);
|
|
217140
217236
|
}
|
|
217141
217237
|
/**
|
|
217142
217238
|
* Multiply `matrix * vector`, treating the vector is a column vector on the right.
|
|
@@ -217150,7 +217246,7 @@ class Matrix3d {
|
|
|
217150
217246
|
const x = vectorU.x;
|
|
217151
217247
|
const y = vectorU.y;
|
|
217152
217248
|
const z = vectorU.z;
|
|
217153
|
-
return
|
|
217249
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(this.coffs[0] * x + this.coffs[1] * y + this.coffs[2] * z, this.coffs[3] * x + this.coffs[4] * y + this.coffs[5] * z, this.coffs[6] * x + this.coffs[7] * y + this.coffs[8] * z, result);
|
|
217154
217250
|
}
|
|
217155
217251
|
/**
|
|
217156
217252
|
* Multiply `matrix * vector` in place for vector in the array, i.e. treating the vector is a column
|
|
@@ -217166,7 +217262,7 @@ class Matrix3d {
|
|
|
217166
217262
|
const x = vector.x;
|
|
217167
217263
|
const y = vector.y;
|
|
217168
217264
|
const z = vector.z;
|
|
217169
|
-
return
|
|
217265
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(origin.x - (matrix.coffs[0] * x + matrix.coffs[1] * y + matrix.coffs[2] * z), origin.y - (matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z), origin.z - (matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z), result);
|
|
217170
217266
|
}
|
|
217171
217267
|
/** Compute `origin + matrix * vector` using only the xy parts of the inputs. */
|
|
217172
217268
|
static xyPlusMatrixTimesXY(origin, matrix, vector, result) {
|
|
@@ -217179,7 +217275,7 @@ class Matrix3d {
|
|
|
217179
217275
|
const x = vector.x;
|
|
217180
217276
|
const y = vector.y;
|
|
217181
217277
|
const z = vector.z;
|
|
217182
|
-
return
|
|
217278
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(origin.x + matrix.coffs[0] * x + matrix.coffs[1] * y + matrix.coffs[2] * z, origin.y + matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z, origin.z + matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z, result);
|
|
217183
217279
|
}
|
|
217184
217280
|
/** Updates vector to be `origin + matrix * vector` using all xyz parts of the inputs. */
|
|
217185
217281
|
static xyzPlusMatrixTimesXYZInPlace(origin, matrix, vector) {
|
|
@@ -217192,7 +217288,7 @@ class Matrix3d {
|
|
|
217192
217288
|
}
|
|
217193
217289
|
/** Compute `origin + matrix * vector` where the final vector is given as direct x,y,z coordinates */
|
|
217194
217290
|
static xyzPlusMatrixTimesCoordinates(origin, matrix, x, y, z, result) {
|
|
217195
|
-
return
|
|
217291
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(origin.x + matrix.coffs[0] * x + matrix.coffs[1] * y + matrix.coffs[2] * z, origin.y + matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z, origin.z + matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z, result);
|
|
217196
217292
|
}
|
|
217197
217293
|
/**
|
|
217198
217294
|
* Treat the 3x3 matrix and origin as upper 3x4 part of a 4x4 matrix, with 0001 as the final row.
|
|
@@ -217271,7 +217367,7 @@ class Matrix3d {
|
|
|
217271
217367
|
* @param result the vector result (optional)
|
|
217272
217368
|
*/
|
|
217273
217369
|
multiplyTransposeVector(vector, result) {
|
|
217274
|
-
result = result ? result : new
|
|
217370
|
+
result = result ? result : new _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d();
|
|
217275
217371
|
const x = vector.x;
|
|
217276
217372
|
const y = vector.y;
|
|
217277
217373
|
const z = vector.z;
|
|
@@ -217285,7 +217381,7 @@ class Matrix3d {
|
|
|
217285
217381
|
* @param result the vector result (optional)
|
|
217286
217382
|
*/
|
|
217287
217383
|
multiplyXYZ(x, y, z, result) {
|
|
217288
|
-
result = result ? result : new
|
|
217384
|
+
result = result ? result : new _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d();
|
|
217289
217385
|
result.x = this.coffs[0] * x + this.coffs[1] * y + this.coffs[2] * z;
|
|
217290
217386
|
result.y = this.coffs[3] * x + this.coffs[4] * y + this.coffs[5] * z;
|
|
217291
217387
|
result.z = this.coffs[6] * x + this.coffs[7] * y + this.coffs[8] * z;
|
|
@@ -217310,7 +217406,7 @@ class Matrix3d {
|
|
|
217310
217406
|
* @param result the vector result (optional)
|
|
217311
217407
|
*/
|
|
217312
217408
|
multiplyXY(x, y, result) {
|
|
217313
|
-
result = result ? result : new
|
|
217409
|
+
result = result ? result : new _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d();
|
|
217314
217410
|
result.x = this.coffs[0] * x + this.coffs[1] * y;
|
|
217315
217411
|
result.y = this.coffs[3] * x + this.coffs[4] * y;
|
|
217316
217412
|
result.z = this.coffs[6] * x + this.coffs[7] * y;
|
|
@@ -217321,7 +217417,7 @@ class Matrix3d {
|
|
|
217321
217417
|
* @param result the Point3d result (optional)
|
|
217322
217418
|
*/
|
|
217323
217419
|
originPlusMatrixTimesXY(origin, x, y, result) {
|
|
217324
|
-
return
|
|
217420
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(origin.x + this.coffs[0] * x + this.coffs[1] * y, origin.y + this.coffs[3] * x + this.coffs[4] * y, origin.z + this.coffs[6] * x + this.coffs[7] * y, result);
|
|
217325
217421
|
}
|
|
217326
217422
|
/**
|
|
217327
217423
|
* Multiply the matrix * (x,y,z) in place, i.e. the vector (x,y,z) is a column vector on the right and
|
|
@@ -217364,7 +217460,7 @@ class Matrix3d {
|
|
|
217364
217460
|
* @param result the vector result (optional)
|
|
217365
217461
|
*/
|
|
217366
217462
|
multiplyTransposeXYZ(x, y, z, result) {
|
|
217367
|
-
result = result ? result : new
|
|
217463
|
+
result = result ? result : new _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d();
|
|
217368
217464
|
result.x = this.coffs[0] * x + this.coffs[3] * y + this.coffs[6] * z;
|
|
217369
217465
|
result.y = this.coffs[1] * x + this.coffs[4] * y + this.coffs[7] * z;
|
|
217370
217466
|
result.z = this.coffs[2] * x + this.coffs[5] * y + this.coffs[8] * z;
|
|
@@ -217381,7 +217477,7 @@ class Matrix3d {
|
|
|
217381
217477
|
const x = vector.x;
|
|
217382
217478
|
const y = vector.y;
|
|
217383
217479
|
const z = vector.z;
|
|
217384
|
-
return
|
|
217480
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(this.inverseCoffs[0] * x + this.inverseCoffs[1] * y + this.inverseCoffs[2] * z, this.inverseCoffs[3] * x + this.inverseCoffs[4] * y + this.inverseCoffs[5] * z, this.inverseCoffs[6] * x + this.inverseCoffs[7] * y + this.inverseCoffs[8] * z, result);
|
|
217385
217481
|
}
|
|
217386
217482
|
return undefined;
|
|
217387
217483
|
}
|
|
@@ -217396,7 +217492,7 @@ class Matrix3d {
|
|
|
217396
217492
|
const x = vector.x;
|
|
217397
217493
|
const y = vector.y;
|
|
217398
217494
|
const z = vector.z;
|
|
217399
|
-
return
|
|
217495
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(this.inverseCoffs[0] * x + this.inverseCoffs[3] * y + this.inverseCoffs[6] * z, this.inverseCoffs[1] * x + this.inverseCoffs[4] * y + this.inverseCoffs[7] * z, this.inverseCoffs[2] * x + this.inverseCoffs[5] * y + this.inverseCoffs[8] * z, result);
|
|
217400
217496
|
}
|
|
217401
217497
|
return undefined;
|
|
217402
217498
|
}
|
|
@@ -217409,7 +217505,7 @@ class Matrix3d {
|
|
|
217409
217505
|
multiplyInverseXYZAsVector3d(x, y, z, result) {
|
|
217410
217506
|
this.computeCachedInverse(true);
|
|
217411
217507
|
if (this.inverseCoffs) {
|
|
217412
|
-
return
|
|
217508
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(this.inverseCoffs[0] * x + this.inverseCoffs[1] * y + this.inverseCoffs[2] * z, this.inverseCoffs[3] * x + this.inverseCoffs[4] * y + this.inverseCoffs[5] * z, this.inverseCoffs[6] * x + this.inverseCoffs[7] * y + this.inverseCoffs[8] * z, result);
|
|
217413
217509
|
}
|
|
217414
217510
|
return undefined;
|
|
217415
217511
|
}
|
|
@@ -217434,7 +217530,7 @@ class Matrix3d {
|
|
|
217434
217530
|
multiplyInverseXYZAsPoint3d(x, y, z, result) {
|
|
217435
217531
|
this.computeCachedInverse(true);
|
|
217436
217532
|
if (this.inverseCoffs) {
|
|
217437
|
-
return
|
|
217533
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(this.inverseCoffs[0] * x + this.inverseCoffs[1] * y + this.inverseCoffs[2] * z, this.inverseCoffs[3] * x + this.inverseCoffs[4] * y + this.inverseCoffs[5] * z, this.inverseCoffs[6] * x + this.inverseCoffs[7] * y + this.inverseCoffs[8] * z, result);
|
|
217438
217534
|
}
|
|
217439
217535
|
return undefined;
|
|
217440
217536
|
}
|
|
@@ -224327,7 +224423,10 @@ class PolygonOps {
|
|
|
224327
224423
|
* * Compare to [[closestPoint]].
|
|
224328
224424
|
* @param polygon points of the polygon, closure point optional
|
|
224329
224425
|
* @param testPoint point p to project onto the polygon edges. Works best when p is in the plane of the polygon.
|
|
224330
|
-
* @param tolerance optional
|
|
224426
|
+
* @param tolerance optional tolerance(s) to determine point-vertex and point-edge coincidence. A single number
|
|
224427
|
+
* is interpreted as distance tolerance. If an array is given, the first number is interpreted as distance tolerance;
|
|
224428
|
+
* the second, as parametric tolerance. Default values are [[Geometry.smallMetricDistance]] for distance tolerance
|
|
224429
|
+
* and 0.0 for parameter tolerance.
|
|
224331
224430
|
* @param result optional pre-allocated object to fill and return
|
|
224332
224431
|
* @returns details d of the closest point `d.point`:
|
|
224333
224432
|
* * `d.isValid()` returns true if and only if the polygon is nontrivial.
|
|
@@ -224339,7 +224438,9 @@ class PolygonOps {
|
|
|
224339
224438
|
static closestPointOnBoundary(polygon, testPoint, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, result) {
|
|
224340
224439
|
if (!(polygon instanceof _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_5__.IndexedXYZCollection))
|
|
224341
224440
|
return this.closestPointOnBoundary(new _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_4__.Point3dArrayCarrier(polygon), testPoint, tolerance, result);
|
|
224342
|
-
const
|
|
224441
|
+
const distTol = Array.isArray(tolerance) ? tolerance[0] : tolerance;
|
|
224442
|
+
const paramTol = Array.isArray(tolerance) ? Math.abs(tolerance[1]) : 0.0;
|
|
224443
|
+
const distTol2 = distTol * distTol;
|
|
224343
224444
|
let numPoints = polygon.length;
|
|
224344
224445
|
while (numPoints > 1) {
|
|
224345
224446
|
if (polygon.distanceSquaredIndexIndex(0, numPoints - 1) > distTol2)
|
|
@@ -224349,29 +224450,59 @@ class PolygonOps {
|
|
|
224349
224450
|
result = PolygonLocationDetail.create(result);
|
|
224350
224451
|
if (0 === numPoints)
|
|
224351
224452
|
return result; // invalid
|
|
224352
|
-
|
|
224353
|
-
polygon.getPoint3dAtUncheckedPointIndex(
|
|
224453
|
+
const constructSingletonPoint = (index) => {
|
|
224454
|
+
polygon.getPoint3dAtUncheckedPointIndex(index, result.point);
|
|
224354
224455
|
result.a = result.point.distance(testPoint);
|
|
224355
224456
|
result.v.setZero();
|
|
224356
224457
|
result.code = _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonVertex;
|
|
224357
|
-
result.closestEdgeIndex =
|
|
224458
|
+
result.closestEdgeIndex = index;
|
|
224358
224459
|
result.closestEdgeParam = 0.0;
|
|
224359
224460
|
return result;
|
|
224360
|
-
}
|
|
224461
|
+
};
|
|
224462
|
+
if (1 === numPoints)
|
|
224463
|
+
return constructSingletonPoint(0);
|
|
224464
|
+
// lambda for computing edge parameter at which testPoint projects onto the edge starting at iEdgeStart
|
|
224465
|
+
const projectToEdge = (iEdgeStart) => {
|
|
224466
|
+
let isValid = false;
|
|
224467
|
+
let edgeParam = 0.0;
|
|
224468
|
+
let uDotU = 0.0;
|
|
224469
|
+
let vDotV = 0.0;
|
|
224470
|
+
if (iEdgeStart >= 0 && iEdgeStart < numPoints) {
|
|
224471
|
+
let iEdgeEnd = iEdgeStart + 1;
|
|
224472
|
+
if (iEdgeEnd === numPoints)
|
|
224473
|
+
iEdgeEnd = 0;
|
|
224474
|
+
uDotU = polygon.distanceSquaredIndexIndex(iEdgeStart, iEdgeEnd);
|
|
224475
|
+
if (uDotU > distTol2) { // nontrivial edge
|
|
224476
|
+
vDotV = polygon.distanceSquaredIndexXYAndZ(iEdgeStart, testPoint);
|
|
224477
|
+
const uDotV = polygon.dotProductIndexIndexXYAndZ(iEdgeStart, iEdgeEnd, testPoint);
|
|
224478
|
+
edgeParam = uDotV / uDotU; // param of projection of testPoint onto edge [iEdgeStart, iEdgeEnd]
|
|
224479
|
+
isValid = true;
|
|
224480
|
+
}
|
|
224481
|
+
}
|
|
224482
|
+
return { isValid, edgeParam, uDotU, vDotV };
|
|
224483
|
+
};
|
|
224484
|
+
// find the previous nontrivial edge's projection status before processing the first edge
|
|
224485
|
+
let projBeyondPrevEdge = false;
|
|
224361
224486
|
let iPrev = numPoints - 1;
|
|
224487
|
+
for (; iPrev > 0; --iPrev) {
|
|
224488
|
+
const projData = projectToEdge(iPrev);
|
|
224489
|
+
if (projData.isValid) {
|
|
224490
|
+
projBeyondPrevEdge = projData.edgeParam > 1.0 + paramTol;
|
|
224491
|
+
break;
|
|
224492
|
+
}
|
|
224493
|
+
}
|
|
224494
|
+
if (iPrev <= 0) // all segments trivial, so treat like single point case
|
|
224495
|
+
return constructSingletonPoint(0);
|
|
224362
224496
|
let minDist2 = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.largeCoordinateResult;
|
|
224363
224497
|
for (let iBase = 0; iBase < numPoints; ++iBase) {
|
|
224364
224498
|
let iNext = iBase + 1;
|
|
224365
224499
|
if (iNext === numPoints)
|
|
224366
224500
|
iNext = 0;
|
|
224367
|
-
const
|
|
224368
|
-
if (
|
|
224369
|
-
continue; // ignore trivial polygon edge (keep iPrev)
|
|
224370
|
-
|
|
224371
|
-
|
|
224372
|
-
const edgeParam = uDotV / uDotU; // param of projection of testPoint onto this edge
|
|
224373
|
-
if (edgeParam <= 0.0) { // testPoint projects to/before edge start
|
|
224374
|
-
const distToStart2 = vDotV;
|
|
224501
|
+
const projData = projectToEdge(iBase);
|
|
224502
|
+
if (!projData.isValid)
|
|
224503
|
+
continue; // ignore trivial polygon edge (keep iPrev, projBeyondPrevEdge)
|
|
224504
|
+
if (projData.edgeParam <= paramTol) { // testPoint projects to/before edge start
|
|
224505
|
+
const distToStart2 = projData.vDotV;
|
|
224375
224506
|
if (distToStart2 <= distTol2) {
|
|
224376
224507
|
// testPoint is at edge start; we are done
|
|
224377
224508
|
polygon.getPoint3dAtUncheckedPointIndex(iBase, result.point);
|
|
@@ -224382,25 +224513,25 @@ class PolygonOps {
|
|
|
224382
224513
|
result.closestEdgeParam = 0.0;
|
|
224383
224514
|
return result;
|
|
224384
224515
|
}
|
|
224385
|
-
if (distToStart2 < minDist2) {
|
|
224386
|
-
|
|
224387
|
-
|
|
224388
|
-
|
|
224389
|
-
|
|
224390
|
-
|
|
224391
|
-
|
|
224392
|
-
|
|
224393
|
-
|
|
224394
|
-
minDist2 = distToStart2;
|
|
224395
|
-
}
|
|
224516
|
+
if (distToStart2 < minDist2 && projBeyondPrevEdge) {
|
|
224517
|
+
// update candidate (to edge start) only if testPoint projected beyond previous edge end
|
|
224518
|
+
polygon.getPoint3dAtUncheckedPointIndex(iBase, result.point);
|
|
224519
|
+
result.a = Math.sqrt(distToStart2);
|
|
224520
|
+
polygon.crossProductIndexIndexIndex(iBase, iPrev, iNext, result.v);
|
|
224521
|
+
result.code = _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonVertex;
|
|
224522
|
+
result.closestEdgeIndex = iBase;
|
|
224523
|
+
result.closestEdgeParam = 0.0;
|
|
224524
|
+
minDist2 = distToStart2;
|
|
224396
224525
|
}
|
|
224526
|
+
projBeyondPrevEdge = false;
|
|
224397
224527
|
}
|
|
224398
|
-
else if (edgeParam <= 1.0) { // testPoint projects inside edge, or to edge end
|
|
224399
|
-
|
|
224528
|
+
else if (projData.edgeParam <= 1.0 + paramTol) { // testPoint projects inside edge, or to edge end
|
|
224529
|
+
projData.edgeParam = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.clamp(projData.edgeParam, 0.0, 1.0);
|
|
224530
|
+
const projDist2 = projData.vDotV - projData.edgeParam * projData.edgeParam * projData.uDotU;
|
|
224400
224531
|
if (projDist2 <= distTol2) {
|
|
224401
224532
|
// testPoint is on edge; we are done
|
|
224402
|
-
const distToStart2 = vDotV;
|
|
224403
|
-
if (edgeParam <= 0.5 && distToStart2 <= distTol2) {
|
|
224533
|
+
const distToStart2 = projData.vDotV;
|
|
224534
|
+
if (projData.edgeParam <= 0.5 && distToStart2 <= distTol2) {
|
|
224404
224535
|
// testPoint is at edge start
|
|
224405
224536
|
polygon.getPoint3dAtUncheckedPointIndex(iBase, result.point);
|
|
224406
224537
|
result.a = Math.sqrt(distToStart2);
|
|
@@ -224410,8 +224541,8 @@ class PolygonOps {
|
|
|
224410
224541
|
result.closestEdgeParam = 0.0;
|
|
224411
224542
|
return result;
|
|
224412
224543
|
}
|
|
224413
|
-
const distToEnd2 = projDist2 + (1.0 - edgeParam) * (1.0 - edgeParam) * uDotU;
|
|
224414
|
-
if (edgeParam > 0.5 && distToEnd2 <= distTol2) {
|
|
224544
|
+
const distToEnd2 = projDist2 + (1.0 - projData.edgeParam) * (1.0 - projData.edgeParam) * projData.uDotU;
|
|
224545
|
+
if (projData.edgeParam > 0.5 && distToEnd2 <= distTol2) {
|
|
224415
224546
|
// testPoint is at edge end
|
|
224416
224547
|
polygon.getPoint3dAtUncheckedPointIndex(iNext, result.point);
|
|
224417
224548
|
result.a = Math.sqrt(distToEnd2);
|
|
@@ -224422,27 +224553,29 @@ class PolygonOps {
|
|
|
224422
224553
|
return result;
|
|
224423
224554
|
}
|
|
224424
224555
|
// testPoint is on edge interior
|
|
224425
|
-
polygon.interpolateIndexIndex(iBase, edgeParam, iNext, result.point);
|
|
224556
|
+
polygon.interpolateIndexIndex(iBase, projData.edgeParam, iNext, result.point);
|
|
224426
224557
|
result.a = Math.sqrt(projDist2);
|
|
224427
224558
|
result.v.setZero();
|
|
224428
224559
|
result.code = _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonEdgeInterior;
|
|
224429
224560
|
result.closestEdgeIndex = iBase;
|
|
224430
|
-
result.closestEdgeParam = edgeParam;
|
|
224561
|
+
result.closestEdgeParam = projData.edgeParam;
|
|
224431
224562
|
return result;
|
|
224432
224563
|
}
|
|
224433
224564
|
if (projDist2 < minDist2) {
|
|
224434
|
-
// update candidate
|
|
224435
|
-
polygon.interpolateIndexIndex(iBase, edgeParam, iNext, result.point);
|
|
224565
|
+
// update candidate
|
|
224566
|
+
polygon.interpolateIndexIndex(iBase, projData.edgeParam, iNext, result.point);
|
|
224436
224567
|
result.a = Math.sqrt(projDist2);
|
|
224437
224568
|
polygon.crossProductIndexIndexXYAndZ(iBase, iNext, testPoint, result.v);
|
|
224438
|
-
result.code = _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonEdgeInterior;
|
|
224569
|
+
result.code = projData.edgeParam < 1.0 ? _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonEdgeInterior : _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonVertex;
|
|
224570
|
+
;
|
|
224439
224571
|
result.closestEdgeIndex = iBase;
|
|
224440
|
-
result.closestEdgeParam = edgeParam;
|
|
224572
|
+
result.closestEdgeParam = projData.edgeParam;
|
|
224441
224573
|
minDist2 = projDist2;
|
|
224442
224574
|
}
|
|
224575
|
+
projBeyondPrevEdge = false;
|
|
224443
224576
|
}
|
|
224444
|
-
else {
|
|
224445
|
-
|
|
224577
|
+
else {
|
|
224578
|
+
projBeyondPrevEdge = true; // to be handled by next edge
|
|
224446
224579
|
}
|
|
224447
224580
|
iPrev = iBase;
|
|
224448
224581
|
}
|
|
@@ -224486,7 +224619,10 @@ class PolygonOps {
|
|
|
224486
224619
|
/** Compute the intersection of a line (parameterized as a ray) with the plane of this polygon.
|
|
224487
224620
|
* @param polygon points of the polygon, closure point optional
|
|
224488
224621
|
* @param ray infinite line to intersect, as a ray
|
|
224489
|
-
* @param tolerance optional
|
|
224622
|
+
* @param tolerance optional tolerance(s) to determine point-vertex and point-edge coincidence. A single number
|
|
224623
|
+
* is interpreted as distance tolerance. If an array is given, the first number is interpreted as distance tolerance;
|
|
224624
|
+
* the second, as parametric tolerance. Default values are [[Geometry.smallMetricDistance]] for distance tolerance
|
|
224625
|
+
* and 0.0 for parameter tolerance.
|
|
224490
224626
|
* @param result optional pre-allocated object to fill and return
|
|
224491
224627
|
* @returns details d of the line-plane intersection `d.point`:
|
|
224492
224628
|
* * `d.isValid()` returns true if and only if the line intersects the plane.
|
|
@@ -224513,11 +224649,18 @@ class PolygonOps {
|
|
|
224513
224649
|
// NOOP: intersectionPoint is on the polygon, so result.code already classifies it
|
|
224514
224650
|
}
|
|
224515
224651
|
else {
|
|
224516
|
-
// intersectionPoint is not on polygon, so result.code refers to the closest point
|
|
224517
|
-
|
|
224518
|
-
|
|
224519
|
-
|
|
224520
|
-
|
|
224652
|
+
// intersectionPoint is not on the polygon, so result.code refers to the closest point;
|
|
224653
|
+
// update it to refer to intersectionPoint.
|
|
224654
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonVertex === result.code) {
|
|
224655
|
+
result.code = (dot > 0.0)
|
|
224656
|
+
? _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.InsidePolygonProjectsToVertex
|
|
224657
|
+
: _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OutsidePolygonProjectsToVertex;
|
|
224658
|
+
}
|
|
224659
|
+
else if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OnPolygonEdgeInterior === result.code) {
|
|
224660
|
+
result.code = (dot > 0.0)
|
|
224661
|
+
? _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.InsidePolygonProjectsToEdgeInterior
|
|
224662
|
+
: _Geometry__WEBPACK_IMPORTED_MODULE_2__.PolygonLocation.OutsidePolygonProjectsToEdgeInterior;
|
|
224663
|
+
}
|
|
224521
224664
|
}
|
|
224522
224665
|
}
|
|
224523
224666
|
return result;
|
|
@@ -235836,11 +235979,11 @@ class AnalyticRoots {
|
|
|
235836
235979
|
* * -1 -- beta, gamma are zero, alpha is not.There is no line defined.There are no solutions.
|
|
235837
235980
|
* * 0 -- the line is well defined, but passes completely outside the unit circle.
|
|
235838
235981
|
* * In this case, (c1, s1) is the circle point closest to the line and(c2, s2) is the line point closest to the circle.
|
|
235839
|
-
*
|
|
235840
|
-
*
|
|
235841
|
-
*
|
|
235842
|
-
*
|
|
235843
|
-
*
|
|
235982
|
+
* * 1 -- the line is tangent to the unit circle.
|
|
235983
|
+
* * Tangency is determined by tolerances, which calls a "close approach" point a tangency.
|
|
235984
|
+
* * (c1, s1) is the closest circle point
|
|
235985
|
+
* * (c2, s2) is the line point.
|
|
235986
|
+
* * 2 -- two simple intersections.
|
|
235844
235987
|
* @param alpha constant coefficient on line
|
|
235845
235988
|
* @param beta x cosine coefficient on line
|
|
235846
235989
|
* @param gamma y sine coefficient on line
|
|
@@ -235972,7 +236115,7 @@ class TrigPolynomial {
|
|
|
235972
236115
|
degree--;
|
|
235973
236116
|
const roots = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_6__.GrowableFloat64Array();
|
|
235974
236117
|
if (degree === -1) {
|
|
235975
|
-
// do nothing
|
|
236118
|
+
// p(t) is identically zero (degenerate); do nothing.
|
|
235976
236119
|
}
|
|
235977
236120
|
else {
|
|
235978
236121
|
if (degree === 0) {
|
|
@@ -237851,8 +237994,8 @@ var AuxChannelDataType;
|
|
|
237851
237994
|
* When the host Polyface is transformed the displacements are rotated and scaled accordingly.
|
|
237852
237995
|
*/
|
|
237853
237996
|
AuxChannelDataType[AuxChannelDataType["Vector"] = 2] = "Vector";
|
|
237854
|
-
/** (X, Y, Z) normal vectors that replace the host [[Polyface]]'s own normals.
|
|
237855
|
-
* When the Polyface is transformed the normals are rotated accordingly.
|
|
237997
|
+
/** (X, Y, Z) unit normal vectors that replace the host [[Polyface]]'s own normals.
|
|
237998
|
+
* When the Polyface is transformed the normals are rotated and renormalized accordingly.
|
|
237856
237999
|
*/
|
|
237857
238000
|
AuxChannelDataType[AuxChannelDataType["Normal"] = 3] = "Normal";
|
|
237858
238001
|
})(AuxChannelDataType || (AuxChannelDataType = {}));
|
|
@@ -238041,7 +238184,15 @@ class PolyfaceAuxData {
|
|
|
238041
238184
|
inverseRot = inverseRot ?? rot.inverse();
|
|
238042
238185
|
if (!inverseRot)
|
|
238043
238186
|
return false;
|
|
238044
|
-
transformPoints(data.values, (point) =>
|
|
238187
|
+
transformPoints(data.values, (point) => {
|
|
238188
|
+
inverseRot.multiplyTransposeVectorInPlace(point);
|
|
238189
|
+
const dot = point.magnitudeSquared();
|
|
238190
|
+
const tol = 1.0e-15; // cf. GrowableXYZArray.multiplyAndRenormalizeMatrix3dInverseTransposeInPlace
|
|
238191
|
+
if (dot > tol && Math.abs(dot - 1.0) > tol) { // only renormalize if magnitude is not near 0 or 1
|
|
238192
|
+
const mag = 1.0 / Math.sqrt(dot);
|
|
238193
|
+
point.scaleInPlace(mag);
|
|
238194
|
+
}
|
|
238195
|
+
});
|
|
238045
238196
|
break;
|
|
238046
238197
|
}
|
|
238047
238198
|
case AuxChannelDataType.Vector: {
|
|
@@ -239890,20 +240041,14 @@ class IndexedPolyface extends Polyface {
|
|
|
239890
240041
|
}
|
|
239891
240042
|
/**
|
|
239892
240043
|
* Transform the mesh.
|
|
239893
|
-
* *
|
|
239894
|
-
* *
|
|
239895
|
-
*
|
|
239896
|
-
* * negate normals
|
|
239897
|
-
* * reverse index order around each facet.
|
|
240044
|
+
* * If `transform` is a mirror, also reverse the index order around each facet.
|
|
240045
|
+
* * Note that this method always returns true. If transforming the normals fails (due to singular matrix or zero
|
|
240046
|
+
* normal), the original normal(s) are left unchanged.
|
|
239898
240047
|
*/
|
|
239899
240048
|
tryTransformInPlace(transform) {
|
|
239900
|
-
|
|
239901
|
-
|
|
239902
|
-
const determinant = transform.matrix.determinant();
|
|
239903
|
-
if (determinant < 0) {
|
|
240049
|
+
this.data.tryTransformInPlace(transform);
|
|
240050
|
+
if (transform.matrix.determinant() < 0)
|
|
239904
240051
|
this.reverseIndices();
|
|
239905
|
-
this.reverseNormals();
|
|
239906
|
-
}
|
|
239907
240052
|
return true;
|
|
239908
240053
|
}
|
|
239909
240054
|
/** Reverse indices for a single facet. */
|
|
@@ -239912,8 +240057,7 @@ class IndexedPolyface extends Polyface {
|
|
|
239912
240057
|
}
|
|
239913
240058
|
/** Return a deep clone. */
|
|
239914
240059
|
clone() {
|
|
239915
|
-
|
|
239916
|
-
return result;
|
|
240060
|
+
return new IndexedPolyface(this.data.clone(), this._facetStart.slice(), this._facetToFaceData.slice());
|
|
239917
240061
|
}
|
|
239918
240062
|
/**
|
|
239919
240063
|
* Return a deep clone with transformed points and normals.
|
|
@@ -241494,17 +241638,28 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
241494
241638
|
}
|
|
241495
241639
|
/** Construct facets for a rotational sweep. */
|
|
241496
241640
|
addRotationalSweep(surface) {
|
|
241497
|
-
const contour = surface.
|
|
241498
|
-
const section0 = _curve_Query_StrokeCountChain__WEBPACK_IMPORTED_MODULE_16__.StrokeCountSection.createForParityRegionOrChain(contour, this._options);
|
|
241641
|
+
const contour = surface.getSweepContourRef();
|
|
241642
|
+
const section0 = _curve_Query_StrokeCountChain__WEBPACK_IMPORTED_MODULE_16__.StrokeCountSection.createForParityRegionOrChain(contour.getCurves(), this._options);
|
|
241499
241643
|
const baseStrokes = section0.getStrokes();
|
|
241644
|
+
// ensure sweep is positive for buildRotationalNormalsInLineStrings
|
|
241500
241645
|
const axis = surface.cloneAxisRay();
|
|
241646
|
+
const sweepAngle = surface.getSweep();
|
|
241647
|
+
if (sweepAngle.radians < 0.0) {
|
|
241648
|
+
axis.direction.scaleInPlace(-1);
|
|
241649
|
+
sweepAngle.setRadians(-sweepAngle.radians);
|
|
241650
|
+
}
|
|
241651
|
+
// swingVector points in the direction of positive sweep
|
|
241501
241652
|
const perpendicularVector = _curve_Query_CylindricalRange__WEBPACK_IMPORTED_MODULE_17__.CylindricalRangeQuery.computeMaxVectorFromRay(axis, baseStrokes);
|
|
241502
241653
|
const swingVector = axis.direction.crossProduct(perpendicularVector);
|
|
241654
|
+
// ensure contour computed normal is aligned with swingVector for buildRotationalNormalsInLineStrings
|
|
241655
|
+
const contourNormalAgreesWithSwingDir = contour.localToWorld.matrix.dotColumnZ(swingVector) > 0;
|
|
241656
|
+
if (!contourNormalAgreesWithSwingDir)
|
|
241657
|
+
baseStrokes.reverseInPlace();
|
|
241503
241658
|
if (this._options.needNormals)
|
|
241504
241659
|
_curve_Query_CylindricalRange__WEBPACK_IMPORTED_MODULE_17__.CylindricalRangeQuery.buildRotationalNormalsInLineStrings(baseStrokes, axis, swingVector);
|
|
241505
241660
|
const maxDistance = perpendicularVector.magnitude();
|
|
241506
|
-
const maxPath = Math.abs(maxDistance *
|
|
241507
|
-
let numStep = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_4__.StrokeOptions.applyAngleTol(this._options, 1,
|
|
241661
|
+
const maxPath = Math.abs(maxDistance * sweepAngle.radians);
|
|
241662
|
+
let numStep = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_4__.StrokeOptions.applyAngleTol(this._options, 1, sweepAngle.radians, undefined);
|
|
241508
241663
|
numStep = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_4__.StrokeOptions.applyMaxEdgeLength(this._options, numStep, maxPath);
|
|
241509
241664
|
for (let i = 1; i <= numStep; i++) {
|
|
241510
241665
|
const transformA = surface.getFractionalRotationTransform((i - 1) / numStep);
|
|
@@ -241512,11 +241667,10 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
241512
241667
|
this.addBetweenRotatedStrokeSets(baseStrokes, transformA, i - 1, transformB, i);
|
|
241513
241668
|
}
|
|
241514
241669
|
if (surface.capped) {
|
|
241515
|
-
|
|
241516
|
-
|
|
241517
|
-
|
|
241518
|
-
|
|
241519
|
-
capContour.emitFacets(this, false, surface.getFractionalRotationTransform(1.0));
|
|
241670
|
+
contour.purgeFacets();
|
|
241671
|
+
const reverseNearCap = contourNormalAgreesWithSwingDir;
|
|
241672
|
+
contour.emitFacets(this, reverseNearCap, undefined);
|
|
241673
|
+
contour.emitFacets(this, !reverseNearCap, surface.getFractionalRotationTransform(1.0));
|
|
241520
241674
|
}
|
|
241521
241675
|
}
|
|
241522
241676
|
/** Construct facets for any planar region. */
|
|
@@ -241580,9 +241734,9 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
241580
241734
|
const normalIndices = ls.ensureEmptyNormalIndices();
|
|
241581
241735
|
const normalIndex0 = this.findOrAddNormalInLineString(ls, 0, transform);
|
|
241582
241736
|
normalIndices.push(normalIndex0);
|
|
241583
|
-
let normalIndexA = normalIndex0;
|
|
241584
|
-
let normalIndexB;
|
|
241585
241737
|
if (n > 1) {
|
|
241738
|
+
let normalIndexA = normalIndex0;
|
|
241739
|
+
let normalIndexB;
|
|
241586
241740
|
for (let i = 1; i + 1 < n; i++) {
|
|
241587
241741
|
normalIndexB = this.findOrAddNormalInLineString(ls, i, transform, normalIndexA);
|
|
241588
241742
|
normalIndices.push(normalIndexB);
|
|
@@ -241597,9 +241751,9 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
241597
241751
|
const uvIndices = ls.ensureEmptyUVIndices();
|
|
241598
241752
|
const uvIndex0 = this.findOrAddParamInLineString(ls, 0, vParam);
|
|
241599
241753
|
uvIndices.push(uvIndex0);
|
|
241600
|
-
let uvIndexA = uvIndex0;
|
|
241601
|
-
let uvIndexB;
|
|
241602
241754
|
if (n > 1) {
|
|
241755
|
+
let uvIndexA = uvIndex0;
|
|
241756
|
+
let uvIndexB;
|
|
241603
241757
|
for (let i = 1; i + 1 < n; i++) {
|
|
241604
241758
|
uvIndexB = this.findOrAddParamInLineString(ls, i, vParam, uvIndexA);
|
|
241605
241759
|
uvIndices.push(uvIndexB);
|
|
@@ -243528,15 +243682,32 @@ class PolyfaceData {
|
|
|
243528
243682
|
return result;
|
|
243529
243683
|
}
|
|
243530
243684
|
/**
|
|
243531
|
-
* Apply
|
|
243532
|
-
* *
|
|
243533
|
-
*
|
|
243685
|
+
* Apply a transform to the mesh data.
|
|
243686
|
+
* * Transform the data as follows:
|
|
243687
|
+
* * apply `transform` to points.
|
|
243688
|
+
* * apply inverse transpose of `transform` to normals and renormalize. This preserves normals perpendicular
|
|
243689
|
+
* to transformed facets, and keeps them pointing outward, e.g, if the mesh is closed. If the transform is not
|
|
243690
|
+
* invertible or a normal has zero length, the normal(s) are left unchanged, and this error is silently ignored.
|
|
243691
|
+
* * apply `transform` to auxData.
|
|
243692
|
+
* * scale faceData distances by the cube root of the absolute value of the determinant of `transform.matrix`.
|
|
243693
|
+
* * Note that if the transform is a mirror, this method does NOT reverse index order. This is the caller's
|
|
243694
|
+
* responsibility. This base class is just a data carrier: PolyfaceData does not know if the index order has
|
|
243695
|
+
* special meaning.
|
|
243696
|
+
* * Note that this method always returns true. If transforming normals fails (due to singular matrix or zero
|
|
243697
|
+
* normal), the original normal(s) are left unchanged.
|
|
243534
243698
|
*/
|
|
243535
243699
|
tryTransformInPlace(transform) {
|
|
243536
243700
|
this.point.multiplyTransformInPlace(transform);
|
|
243537
243701
|
if (this.normal && !transform.matrix.isIdentity)
|
|
243538
243702
|
this.normal.multiplyAndRenormalizeMatrix3dInverseTransposeInPlace(transform.matrix);
|
|
243539
|
-
|
|
243703
|
+
if (this.face.length > 0) {
|
|
243704
|
+
const distScale = Math.cbrt(Math.abs(transform.matrix.determinant()));
|
|
243705
|
+
for (const faceData of this.face)
|
|
243706
|
+
faceData.scaleDistances(distScale);
|
|
243707
|
+
}
|
|
243708
|
+
if (this.auxData)
|
|
243709
|
+
this.auxData.tryTransformInPlace(transform);
|
|
243710
|
+
return true;
|
|
243540
243711
|
}
|
|
243541
243712
|
/**
|
|
243542
243713
|
* Compress the instance by equating duplicate data.
|
|
@@ -245472,8 +245643,8 @@ class PolyfaceQuery {
|
|
|
245472
245643
|
/**
|
|
245473
245644
|
* Search facets for the first one that intersects the infinite line.
|
|
245474
245645
|
* * To process _all_ intersections, callers can supply an `options.acceptIntersection` callback that always
|
|
245475
|
-
* returns `false`.
|
|
245476
|
-
*
|
|
245646
|
+
* returns `false`. In this case, `intersectRay3d` will return `undefined`, but the callback will be invoked for
|
|
245647
|
+
* each intersection.
|
|
245477
245648
|
* * Example callback logic:
|
|
245478
245649
|
* * Accept the first found facet that intersects the half-line specified by the ray: `return detail.a >= 0.0;`
|
|
245479
245650
|
* * Collect all intersections: `myIntersections.push(detail.clone()); return false;` Then after `intersectRay3d`
|
|
@@ -245491,6 +245662,7 @@ class PolyfaceQuery {
|
|
|
245491
245662
|
if (visitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
|
|
245492
245663
|
return PolyfaceQuery.intersectRay3d(visitor.createVisitor(0), ray, options);
|
|
245493
245664
|
let detail;
|
|
245665
|
+
const tol = options ? [options.distanceTolerance, options.parameterTolerance] : undefined;
|
|
245494
245666
|
visitor.setNumWrap(0);
|
|
245495
245667
|
while (visitor.moveToNextFacet()) {
|
|
245496
245668
|
const numEdges = visitor.pointCount; // #vertices = #edges since numWrap is zero
|
|
@@ -245502,7 +245674,7 @@ class PolyfaceQuery {
|
|
|
245502
245674
|
detail = this._workFacetDetail3 = _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_37__.TriangularFacetLocationDetail.create(visitor.currentReadIndex(), detail3, this._workFacetDetail3);
|
|
245503
245675
|
}
|
|
245504
245676
|
else {
|
|
245505
|
-
const detailN = this._workPolyDetail = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.intersectRay3d(vertices, ray,
|
|
245677
|
+
const detailN = this._workPolyDetail = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.intersectRay3d(vertices, ray, tol, this._workPolyDetail);
|
|
245506
245678
|
if (_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.isConvex(vertices))
|
|
245507
245679
|
detail = this._workFacetDetailC = _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_37__.ConvexFacetLocationDetail.create(visitor.currentReadIndex(), numEdges, detailN, this._workFacetDetailC);
|
|
245508
245680
|
else
|
|
@@ -261165,8 +261337,10 @@ class Box extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
|
|
|
261165
261337
|
getConstructiveFrame() {
|
|
261166
261338
|
return this._localToWorld.cloneRigid();
|
|
261167
261339
|
}
|
|
261168
|
-
/**
|
|
261340
|
+
/**
|
|
261341
|
+
* Apply the transform to the box's `localToWorld` frame.
|
|
261169
261342
|
* * Note that this may make the frame nonrigid.
|
|
261343
|
+
* * This fails if the transformation is singular.
|
|
261170
261344
|
*/
|
|
261171
261345
|
tryTransformInPlace(transform) {
|
|
261172
261346
|
if (transform.matrix.isSingular())
|
|
@@ -261174,11 +261348,14 @@ class Box extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
|
|
|
261174
261348
|
transform.multiplyTransformTransform(this._localToWorld, this._localToWorld);
|
|
261175
261349
|
return true;
|
|
261176
261350
|
}
|
|
261177
|
-
/**
|
|
261351
|
+
/**
|
|
261352
|
+
* Clone the box and immediately apply `transform` to the local frame of the clone.
|
|
261353
|
+
* * Note that this may make the frame nonrigid.
|
|
261354
|
+
* * This fails if the transformation is singular.
|
|
261355
|
+
*/
|
|
261178
261356
|
cloneTransformed(transform) {
|
|
261179
261357
|
const result = this.clone();
|
|
261180
|
-
|
|
261181
|
-
return result;
|
|
261358
|
+
return result.tryTransformInPlace(transform) ? result : undefined;
|
|
261182
261359
|
}
|
|
261183
261360
|
/**
|
|
261184
261361
|
* Create a new box from vector and size daa.
|
|
@@ -261213,7 +261390,7 @@ class Box extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
|
|
|
261213
261390
|
}
|
|
261214
261391
|
/**
|
|
261215
261392
|
* Create an axis-aligned `Box` primitive for a range.
|
|
261216
|
-
* @param range range
|
|
261393
|
+
* @param range range low point is origin of base rectangle, range extents are box extents
|
|
261217
261394
|
* @param capped true to define top and bottom closure caps
|
|
261218
261395
|
*/
|
|
261219
261396
|
static createRange(range, capped) {
|
|
@@ -261421,7 +261598,7 @@ class Cone extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
|
|
|
261421
261598
|
getConstructiveFrame() {
|
|
261422
261599
|
return this._localToWorld.cloneRigid();
|
|
261423
261600
|
}
|
|
261424
|
-
/** Apply the transform to this cone's
|
|
261601
|
+
/** Apply the transform to this cone's local to world coordinates.
|
|
261425
261602
|
* * Note that the radii are not changed. Scaling is absorbed into the frame.
|
|
261426
261603
|
* * This fails if the transformation is singular.
|
|
261427
261604
|
*/
|
|
@@ -261433,11 +261610,11 @@ class Cone extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
|
|
|
261433
261610
|
}
|
|
261434
261611
|
/**
|
|
261435
261612
|
* Create a clone and immediately transform the clone.
|
|
261613
|
+
* * This fails if the transformation is singular.
|
|
261436
261614
|
*/
|
|
261437
261615
|
cloneTransformed(transform) {
|
|
261438
261616
|
const result = this.clone();
|
|
261439
|
-
|
|
261440
|
-
return result;
|
|
261617
|
+
return result.tryTransformInPlace(transform) ? result : undefined;
|
|
261441
261618
|
}
|
|
261442
261619
|
/** create a cylinder or cone from two endpoints and their radii. The circular cross sections are perpendicular to the axis line
|
|
261443
261620
|
* from start to end point.
|
|
@@ -261736,7 +261913,10 @@ class LinearSweep extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrim
|
|
|
261736
261913
|
clone() {
|
|
261737
261914
|
return new LinearSweep(this._contour.clone(), this._direction.clone(), this.capped);
|
|
261738
261915
|
}
|
|
261739
|
-
/**
|
|
261916
|
+
/**
|
|
261917
|
+
* Apply a transform to the curves and sweep vector
|
|
261918
|
+
* * This fails if the transformation is singular.
|
|
261919
|
+
*/
|
|
261740
261920
|
tryTransformInPlace(transform) {
|
|
261741
261921
|
if (transform.matrix.isSingular())
|
|
261742
261922
|
return false;
|
|
@@ -261754,11 +261934,13 @@ class LinearSweep extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrim
|
|
|
261754
261934
|
getConstructiveFrame() {
|
|
261755
261935
|
return this._contour.localToWorld.cloneRigid();
|
|
261756
261936
|
}
|
|
261757
|
-
/**
|
|
261937
|
+
/**
|
|
261938
|
+
* Return a transformed clone.
|
|
261939
|
+
* * This fails if the transformation is singular.
|
|
261940
|
+
*/
|
|
261758
261941
|
cloneTransformed(transform) {
|
|
261759
261942
|
const result = this.clone();
|
|
261760
|
-
result.tryTransformInPlace(transform);
|
|
261761
|
-
return result;
|
|
261943
|
+
return result.tryTransformInPlace(transform) ? result : undefined;
|
|
261762
261944
|
}
|
|
261763
261945
|
/** Test for near-equality of coordinates in `other` */
|
|
261764
261946
|
isAlmostEqual(other) {
|
|
@@ -261857,7 +262039,12 @@ class RotationalSweep extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.Solid
|
|
|
261857
262039
|
this.capped = capped;
|
|
261858
262040
|
this._sweepAngle = sweepAngle;
|
|
261859
262041
|
}
|
|
261860
|
-
/** Create a rotational sweep.
|
|
262042
|
+
/** Create a rotational sweep.
|
|
262043
|
+
* @param contour profile to sweep, coplanar with axis. CAPTURED
|
|
262044
|
+
* @param axis rotation axis
|
|
262045
|
+
* @param sweepAngle signed angular sweep
|
|
262046
|
+
* @param capped whether to cap the surface to make a solid
|
|
262047
|
+
*/
|
|
261861
262048
|
static create(contour, axis, sweepAngle, capped) {
|
|
261862
262049
|
if (!axis.direction.normalizeInPlace())
|
|
261863
262050
|
return undefined;
|
|
@@ -261902,20 +262089,28 @@ class RotationalSweep extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.Solid
|
|
|
261902
262089
|
clone() {
|
|
261903
262090
|
return new RotationalSweep(this._contour.clone(), this._normalizedAxis.clone(), this._sweepAngle.clone(), this.capped);
|
|
261904
262091
|
}
|
|
261905
|
-
/**
|
|
262092
|
+
/**
|
|
262093
|
+
* Transform the contour and axis.
|
|
262094
|
+
* * This fails if the transformation is singular.
|
|
262095
|
+
*/
|
|
261906
262096
|
tryTransformInPlace(transform) {
|
|
261907
|
-
if (
|
|
261908
|
-
|
|
262097
|
+
if (transform.matrix.isSingular())
|
|
262098
|
+
return false;
|
|
262099
|
+
if (this._contour.tryTransformInPlace(transform)) {
|
|
261909
262100
|
this._normalizedAxis.transformInPlace(transform);
|
|
262101
|
+
if (transform.matrix.determinant() < 0.0)
|
|
262102
|
+
this._sweepAngle.setRadians(-this._sweepAngle.radians);
|
|
261910
262103
|
return this._normalizedAxis.direction.normalizeInPlace();
|
|
261911
262104
|
}
|
|
261912
262105
|
return false;
|
|
261913
262106
|
}
|
|
261914
|
-
/**
|
|
262107
|
+
/**
|
|
262108
|
+
* Return a transformed clone.
|
|
262109
|
+
* * This fails if the transformation is singular.
|
|
262110
|
+
*/
|
|
261915
262111
|
cloneTransformed(transform) {
|
|
261916
262112
|
const result = this.clone();
|
|
261917
|
-
result.tryTransformInPlace(transform);
|
|
261918
|
-
return result;
|
|
262113
|
+
return result.tryTransformInPlace(transform) ? result : undefined;
|
|
261919
262114
|
}
|
|
261920
262115
|
/** Dispatch to strongly typed handler `handler.handleRotationalSweep(this)` */
|
|
261921
262116
|
dispatchToGeometryHandler(handler) {
|
|
@@ -262051,20 +262246,26 @@ class RuledSweep extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimi
|
|
|
262051
262246
|
clone() {
|
|
262052
262247
|
return new RuledSweep(this.cloneSweepContours(), this.capped);
|
|
262053
262248
|
}
|
|
262054
|
-
/**
|
|
262249
|
+
/**
|
|
262250
|
+
* Transform all contours in place.
|
|
262251
|
+
* * This fails if the transformation is singular.
|
|
262252
|
+
*/
|
|
262055
262253
|
tryTransformInPlace(transform) {
|
|
262056
262254
|
if (transform.matrix.isSingular())
|
|
262057
262255
|
return false;
|
|
262058
262256
|
for (const contour of this._contours) {
|
|
262059
|
-
contour.tryTransformInPlace(transform)
|
|
262257
|
+
if (!contour.tryTransformInPlace(transform))
|
|
262258
|
+
return false;
|
|
262060
262259
|
}
|
|
262061
262260
|
return true;
|
|
262062
262261
|
}
|
|
262063
|
-
/**
|
|
262262
|
+
/**
|
|
262263
|
+
* Return a transformed clone.
|
|
262264
|
+
* * This fails if the transformation is singular.
|
|
262265
|
+
*/
|
|
262064
262266
|
cloneTransformed(transform) {
|
|
262065
262267
|
const result = this.clone();
|
|
262066
|
-
result.tryTransformInPlace(transform);
|
|
262067
|
-
return result;
|
|
262268
|
+
return result.tryTransformInPlace(transform) ? result : undefined;
|
|
262068
262269
|
}
|
|
262069
262270
|
/** Return a coordinate frame (right handed unit vectors)
|
|
262070
262271
|
* * origin on base contour
|
|
@@ -262245,12 +262446,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
262245
262446
|
/* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
262246
262447
|
/* harmony import */ var _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../curve/StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
|
|
262247
262448
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
262248
|
-
/* harmony import */ var
|
|
262249
|
-
/* harmony import */ var
|
|
262449
|
+
/* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
|
|
262450
|
+
/* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
|
|
262250
262451
|
/* harmony import */ var _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndVectors */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndVectors.js");
|
|
262251
262452
|
/* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
|
|
262252
262453
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
262253
|
-
/* harmony import */ var
|
|
262454
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
262254
262455
|
/* harmony import */ var _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SolidPrimitive */ "../../core/geometry/lib/esm/solid/SolidPrimitive.js");
|
|
262255
262456
|
/*---------------------------------------------------------------------------------------------
|
|
262256
262457
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
@@ -262294,32 +262495,32 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
262294
262495
|
/** String name for schema properties */
|
|
262295
262496
|
this.solidPrimitiveType = "sphere";
|
|
262296
262497
|
this._localToWorld = localToWorld;
|
|
262297
|
-
this._latitudeSweep = latitudeSweep
|
|
262498
|
+
this._latitudeSweep = latitudeSweep;
|
|
262298
262499
|
this._latitudeSweep.capLatitudeInPlace();
|
|
262299
262500
|
}
|
|
262300
262501
|
/** return a deep clone */
|
|
262301
262502
|
clone() {
|
|
262302
262503
|
return new Sphere(this._localToWorld.clone(), this._latitudeSweep.clone(), this.capped);
|
|
262303
262504
|
}
|
|
262304
|
-
/**
|
|
262505
|
+
/**
|
|
262506
|
+
* Transform the sphere in place.
|
|
262305
262507
|
* * Fails if the transform is singular.
|
|
262306
262508
|
*/
|
|
262307
262509
|
tryTransformInPlace(transform) {
|
|
262308
262510
|
if (transform.matrix.isSingular())
|
|
262309
262511
|
return false;
|
|
262310
262512
|
transform.multiplyTransformTransform(this._localToWorld, this._localToWorld);
|
|
262513
|
+
if (transform.matrix.determinant() < 0.0)
|
|
262514
|
+
this._latitudeSweep.reverseInPlace();
|
|
262311
262515
|
return true;
|
|
262312
262516
|
}
|
|
262313
|
-
/**
|
|
262517
|
+
/**
|
|
262518
|
+
* Return a transformed clone.
|
|
262519
|
+
* * Fails if the transform is singular.
|
|
262520
|
+
*/
|
|
262314
262521
|
cloneTransformed(transform) {
|
|
262315
|
-
const
|
|
262316
|
-
|
|
262317
|
-
if (transform.matrix.determinant() < 0.0) {
|
|
262318
|
-
if (sphere1._latitudeSweep !== undefined) {
|
|
262319
|
-
sphere1._latitudeSweep.reverseInPlace();
|
|
262320
|
-
}
|
|
262321
|
-
}
|
|
262322
|
-
return sphere1;
|
|
262522
|
+
const result = this.clone();
|
|
262523
|
+
return result.tryTransformInPlace(transform) ? result : undefined;
|
|
262323
262524
|
}
|
|
262324
262525
|
/** Return a coordinate frame (right handed, unit axes)
|
|
262325
262526
|
* * origin at sphere center
|
|
@@ -262333,8 +262534,8 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
262333
262534
|
get latitudeSweepFraction() { return this._latitudeSweep.sweepRadians / Math.PI; }
|
|
262334
262535
|
/** Create from center and radius, with optional restricted latitudes. */
|
|
262335
262536
|
static createCenterRadius(center, radius, latitudeSweep) {
|
|
262336
|
-
const localToWorld =
|
|
262337
|
-
return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() :
|
|
262537
|
+
const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__.Transform.createOriginAndMatrix(center, _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createUniformScale(radius));
|
|
262538
|
+
return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.createFullLatitude(), false);
|
|
262338
262539
|
}
|
|
262339
262540
|
/** Create an ellipsoid which is a unit sphere mapped to position by an (arbitrary, possibly skewed and scaled) transform. */
|
|
262340
262541
|
static createEllipsoid(localToWorld, latitudeSweep, capped) {
|
|
@@ -262344,18 +262545,18 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
262344
262545
|
static createDgnSphere(center, vectorX, vectorZ, radiusXY, radiusZ, latitudeSweep, capped) {
|
|
262345
262546
|
const vectorY = vectorX.rotate90Around(vectorZ);
|
|
262346
262547
|
if (vectorY && !vectorX.isParallelTo(vectorZ)) {
|
|
262347
|
-
const matrix =
|
|
262548
|
+
const matrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createColumns(vectorX, vectorY, vectorZ);
|
|
262348
262549
|
matrix.scaleColumns(radiusXY, radiusXY, radiusZ, matrix);
|
|
262349
|
-
const frame =
|
|
262550
|
+
const frame = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__.Transform.createOriginAndMatrix(center, matrix);
|
|
262350
262551
|
return new Sphere(frame, latitudeSweep.clone(), capped);
|
|
262351
262552
|
}
|
|
262352
262553
|
return undefined;
|
|
262353
262554
|
}
|
|
262354
262555
|
/** Create a sphere from the typical parameters of the Dgn file */
|
|
262355
262556
|
static createFromAxesAndScales(center, axes, radiusX, radiusY, radiusZ, latitudeSweep, capped) {
|
|
262356
|
-
const localToWorld =
|
|
262557
|
+
const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__.Transform.createOriginAndMatrix(center, axes);
|
|
262357
262558
|
localToWorld.matrix.scaleColumnsInPlace(radiusX, radiusY, radiusZ);
|
|
262358
|
-
return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() :
|
|
262559
|
+
return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.createFullLatitude(), capped);
|
|
262359
262560
|
}
|
|
262360
262561
|
/** return (copy of) sphere center */
|
|
262361
262562
|
cloneCenter() { return this._localToWorld.getOrigin(); }
|
|
@@ -262401,10 +262602,16 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
262401
262602
|
return false;
|
|
262402
262603
|
}
|
|
262403
262604
|
/**
|
|
262404
|
-
*
|
|
262405
|
-
* *
|
|
262406
|
-
*
|
|
262407
|
-
*
|
|
262605
|
+
* Return strokes for the elliptical arc cross-section at latitude sweep fraction v.
|
|
262606
|
+
* * Optional inputs control the number of strokes along the cross-section:
|
|
262607
|
+
* * If `fixedStrokeCount` is supplied, it is taken as the cross-section stroke count.
|
|
262608
|
+
* * If `fixedStrokeCount` is undefined, stroke count is computed by applying `options` to the cross-section.
|
|
262609
|
+
* * If neither input is supplied, the stroke count default is 16.
|
|
262610
|
+
* * In any case, stroke count is clamped to the interval [4,64].
|
|
262611
|
+
* @param v fractional position along the sphere axis
|
|
262612
|
+
* @param fixedStrokeCount optional stroke count in u-direction
|
|
262613
|
+
* @param options optional stroke options in u-direction
|
|
262614
|
+
* @return strokes as line string
|
|
262408
262615
|
*/
|
|
262409
262616
|
strokeConstantVSection(v, fixedStrokeCount, options) {
|
|
262410
262617
|
let strokeCount = 16;
|
|
@@ -262420,7 +262627,7 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
262420
262627
|
const c1 = Math.cos(phi);
|
|
262421
262628
|
const s1 = Math.sin(phi);
|
|
262422
262629
|
let c0, s0;
|
|
262423
|
-
const result = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_6__.LineString3d.createForStrokes(
|
|
262630
|
+
const result = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_6__.LineString3d.createForStrokes(strokeCount, options);
|
|
262424
262631
|
const deltaRadians = Math.PI * 2.0 / strokeCount;
|
|
262425
262632
|
const fractions = result.fractions; // possibly undefined !!!
|
|
262426
262633
|
const derivatives = result.packedDerivatives; // possibly undefined !!!
|
|
@@ -262647,7 +262854,7 @@ class SweepContour {
|
|
|
262647
262854
|
return undefined;
|
|
262648
262855
|
}
|
|
262649
262856
|
/** Create for rotational sweep.
|
|
262650
|
-
* @param contour curve to sweep, CAPTURED. For best results, contour should be
|
|
262857
|
+
* @param contour curve to sweep, CAPTURED. For best results, contour should be coplanar with axis.
|
|
262651
262858
|
* @param axis rotation axis
|
|
262652
262859
|
*/
|
|
262653
262860
|
static createForRotation(contour, axis) {
|
|
@@ -262905,19 +263112,23 @@ class TorusPipe extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimit
|
|
|
262905
263112
|
result._isReversed = this._isReversed;
|
|
262906
263113
|
return result;
|
|
262907
263114
|
}
|
|
262908
|
-
/**
|
|
263115
|
+
/**
|
|
263116
|
+
* Apply `transform` to the local coordinate system.
|
|
263117
|
+
* * Fails if the transformation is singular.
|
|
263118
|
+
*/
|
|
262909
263119
|
tryTransformInPlace(transform) {
|
|
262910
263120
|
if (transform.matrix.isSingular())
|
|
262911
263121
|
return false;
|
|
262912
263122
|
transform.multiplyTransformTransform(this._localToWorld, this._localToWorld);
|
|
262913
263123
|
return true;
|
|
262914
263124
|
}
|
|
262915
|
-
/**
|
|
263125
|
+
/**
|
|
263126
|
+
* Clone this TorusPipe and transform the clone.
|
|
263127
|
+
* * Fails if the transformation is singular.
|
|
263128
|
+
*/
|
|
262916
263129
|
cloneTransformed(transform) {
|
|
262917
263130
|
const result = this.clone();
|
|
262918
|
-
|
|
262919
|
-
return undefined;
|
|
262920
|
-
return result;
|
|
263131
|
+
return result.tryTransformInPlace(transform) ? result : undefined;
|
|
262921
263132
|
}
|
|
262922
263133
|
/** Create a new `TorusPipe`
|
|
262923
263134
|
* @param frame local to world transformation. For best results, the matrix part should be a pure rotation.
|
|
@@ -290394,7 +290605,7 @@ exports.getRpcInterfaces = getRpcInterfaces;
|
|
|
290394
290605
|
*--------------------------------------------------------------------------------------------*/
|
|
290395
290606
|
const core_bentley_1 = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
290396
290607
|
const core_common_1 = __webpack_require__(/*! @itwin/core-common */ "../../core/common/lib/esm/core-common.js");
|
|
290397
|
-
const ecschema_rpcinterface_common_1 = __webpack_require__(/*! @itwin/ecschema-rpcinterface-common */ "../../core/ecschema-rpc/common/lib/
|
|
290608
|
+
const ecschema_rpcinterface_common_1 = __webpack_require__(/*! @itwin/ecschema-rpcinterface-common */ "../../core/ecschema-rpc/common/lib/esm/ecschema-rpc-interface.js");
|
|
290398
290609
|
function getRpcInterfaces() {
|
|
290399
290610
|
const rpcInterfaces = [];
|
|
290400
290611
|
rpcInterfaces.push(core_common_1.IModelReadRpcInterface);
|
|
@@ -304646,7 +304857,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
304646
304857
|
/***/ ((module) => {
|
|
304647
304858
|
|
|
304648
304859
|
"use strict";
|
|
304649
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.
|
|
304860
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.5","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --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","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 --coverage","test:debug":"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:^5.0.0-dev.5","@itwin/core-bentley":"workspace:^5.0.0-dev.5","@itwin/core-common":"workspace:^5.0.0-dev.5","@itwin/core-geometry":"workspace:^5.0.0-dev.5","@itwin/core-orbitgt":"workspace:^5.0.0-dev.5","@itwin/core-quantity":"workspace:^5.0.0-dev.5"},"//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/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^2.1.0","@vitest/coverage-v8":"^2.1.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","cpx2":"^3.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^3.0.2","source-map-loader":"^4.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^2.1.0","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"1.0.6","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.2.5","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","meshoptimizer":"~0.20.0","wms-capabilities":"0.4.0"}}');
|
|
304650
304861
|
|
|
304651
304862
|
/***/ })
|
|
304652
304863
|
|
|
@@ -304955,7 +305166,7 @@ var exports = __webpack_exports__;
|
|
|
304955
305166
|
*--------------------------------------------------------------------------------------------*/
|
|
304956
305167
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
304957
305168
|
const chai_1 = __webpack_require__(/*! chai */ "../../common/temp/node_modules/.pnpm/chai@4.3.10/node_modules/chai/index.js");
|
|
304958
|
-
const ecschema_rpcinterface_common_1 = __webpack_require__(/*! @itwin/ecschema-rpcinterface-common */ "../../core/ecschema-rpc/common/lib/
|
|
305169
|
+
const ecschema_rpcinterface_common_1 = __webpack_require__(/*! @itwin/ecschema-rpcinterface-common */ "../../core/ecschema-rpc/common/lib/esm/ecschema-rpc-interface.js");
|
|
304959
305170
|
const TestContext_1 = __webpack_require__(/*! ./setup/TestContext */ "./lib/frontend/setup/TestContext.js");
|
|
304960
305171
|
const ecschema_metadata_1 = __webpack_require__(/*! @itwin/ecschema-metadata */ "../../core/ecschema-metadata/lib/esm/ecschema-metadata.js");
|
|
304961
305172
|
describe("Schema RPC Interface", () => {
|