@itwin/ecschema-rpcinterface-tests 5.0.0-dev.82 → 5.0.0-dev.83
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 +299 -175
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -35100,10 +35100,15 @@ class IModelVersion {
|
|
|
35100
35100
|
"use strict";
|
|
35101
35101
|
__webpack_require__.r(__webpack_exports__);
|
|
35102
35102
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
35103
|
-
/* harmony export */
|
|
35104
|
-
/* harmony export */
|
|
35103
|
+
/* harmony export */ constructDetailedError: () => (/* binding */ constructDetailedError),
|
|
35104
|
+
/* harmony export */ constructITwinError: () => (/* binding */ constructITwinError),
|
|
35105
|
+
/* harmony export */ createITwinErrorTypeAsserter: () => (/* binding */ createITwinErrorTypeAsserter),
|
|
35106
|
+
/* harmony export */ getITwinErrorMetaData: () => (/* binding */ getITwinErrorMetaData),
|
|
35107
|
+
/* harmony export */ iTwinErrorKeys: () => (/* binding */ iTwinErrorKeys),
|
|
35108
|
+
/* harmony export */ iTwinErrorMessages: () => (/* binding */ iTwinErrorMessages),
|
|
35109
|
+
/* harmony export */ iTwinjsCoreNamespace: () => (/* binding */ iTwinjsCoreNamespace),
|
|
35110
|
+
/* harmony export */ isITwinError: () => (/* binding */ isITwinError)
|
|
35105
35111
|
/* harmony export */ });
|
|
35106
|
-
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
35107
35112
|
/*---------------------------------------------------------------------------------------------
|
|
35108
35113
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
35109
35114
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -35111,50 +35116,93 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
35111
35116
|
/** @packageDocumentation
|
|
35112
35117
|
* @module iModels
|
|
35113
35118
|
*/
|
|
35114
|
-
|
|
35115
|
-
|
|
35116
|
-
|
|
35117
|
-
|
|
35118
|
-
|
|
35119
|
-
|
|
35120
|
-
|
|
35121
|
-
|
|
35122
|
-
|
|
35123
|
-
|
|
35124
|
-
|
|
35125
|
-
|
|
35126
|
-
|
|
35127
|
-
|
|
35128
|
-
|
|
35129
|
-
|
|
35130
|
-
|
|
35131
|
-
|
|
35132
|
-
|
|
35133
|
-
|
|
35134
|
-
|
|
35135
|
-
|
|
35136
|
-
|
|
35137
|
-
|
|
35138
|
-
|
|
35139
|
-
|
|
35140
|
-
|
|
35141
|
-
|
|
35142
|
-
|
|
35143
|
-
|
|
35144
|
-
|
|
35145
|
-
|
|
35146
|
-
|
|
35147
|
-
|
|
35148
|
-
|
|
35149
|
-
}
|
|
35150
|
-
|
|
35151
|
-
|
|
35152
|
-
|
|
35153
|
-
|
|
35154
|
-
|
|
35155
|
-
|
|
35156
|
-
}
|
|
35157
|
-
|
|
35119
|
+
/**
|
|
35120
|
+
* iTwinjs Core namespace namespace for a developer/application.
|
|
35121
|
+
* @beta
|
|
35122
|
+
*/
|
|
35123
|
+
const iTwinjsCoreNamespace = "itwinjs-core";
|
|
35124
|
+
/**
|
|
35125
|
+
* error keys object used to describe an error keys for a developer/application.
|
|
35126
|
+
* @beta
|
|
35127
|
+
*/
|
|
35128
|
+
const iTwinErrorKeys = {
|
|
35129
|
+
inUseLocks: "in-use-locks",
|
|
35130
|
+
channelNest: "channel-may-not-nest",
|
|
35131
|
+
channelNotAllowed: "channel-not-allowed",
|
|
35132
|
+
channelRootExists: "channel-root-exists"
|
|
35133
|
+
};
|
|
35134
|
+
/**
|
|
35135
|
+
* Record for all itwin error messages.
|
|
35136
|
+
* @beta
|
|
35137
|
+
*/
|
|
35138
|
+
const iTwinErrorMessages = {
|
|
35139
|
+
"inUseLocks": () => 'Objects are locked by another briefcase',
|
|
35140
|
+
"channelNest": (id) => `Channel ${id} may not nest`,
|
|
35141
|
+
"channelNotAllowed": (id) => `Channel ${id} is not allowed`,
|
|
35142
|
+
"channelRootExists": (id) => `Channel ${id} root already exist`,
|
|
35143
|
+
};
|
|
35144
|
+
/**
|
|
35145
|
+
* A function which will be used to construct an [[ITwinError]].
|
|
35146
|
+
* @param namespace The namespace associated with the error.
|
|
35147
|
+
* @param errorKey The errorKey associated with the error.
|
|
35148
|
+
* @param message The message associated with the error.
|
|
35149
|
+
* @param metadata Metadata associated with the error.
|
|
35150
|
+
* @beta
|
|
35151
|
+
*/
|
|
35152
|
+
function constructITwinError(namespace, errorKey, message, metadata) {
|
|
35153
|
+
const error = new Error();
|
|
35154
|
+
error.message = message ?? `${errorKey} occurred`;
|
|
35155
|
+
error.name = `${namespace}:${errorKey}`;
|
|
35156
|
+
error.namespace = namespace;
|
|
35157
|
+
error.errorKey = errorKey;
|
|
35158
|
+
error.metadata = metadata;
|
|
35159
|
+
Error.captureStackTrace(error, constructITwinError); // Optional, but this would hide constructITwinError from stack.
|
|
35160
|
+
return error;
|
|
35161
|
+
}
|
|
35162
|
+
/**
|
|
35163
|
+
* A function which constructs a detailed error for example [[ InUseLocksError ]] above.
|
|
35164
|
+
* @param namespace The namespace associated with the error.
|
|
35165
|
+
* @param errorKey The errorKey associated with the error.
|
|
35166
|
+
* @param details Other details associated with the error.
|
|
35167
|
+
* @param message The message associated with the error.
|
|
35168
|
+
* @param metadata Metadata associated with the error.
|
|
35169
|
+
* @beta
|
|
35170
|
+
*/
|
|
35171
|
+
function constructDetailedError(namespace, errorKey, details, message, metadata) {
|
|
35172
|
+
const baseError = constructITwinError(namespace, errorKey, message, metadata);
|
|
35173
|
+
Error.captureStackTrace(baseError, constructDetailedError); // Optional, but this would hide constructDetailedError from stack.
|
|
35174
|
+
return Object.assign(baseError, details);
|
|
35175
|
+
}
|
|
35176
|
+
/**
|
|
35177
|
+
* a high level function that returns a type asserter function which would return whether or not the passed in parameter is an [[ITwinError]]
|
|
35178
|
+
* @param namespace The namespace associated with the error.
|
|
35179
|
+
* @param errorKey The errorKey associated with the error.
|
|
35180
|
+
* @beta
|
|
35181
|
+
*/
|
|
35182
|
+
function createITwinErrorTypeAsserter(namespace, errorKey) {
|
|
35183
|
+
return (error) => isITwinError(error, namespace, errorKey);
|
|
35184
|
+
}
|
|
35185
|
+
/**
|
|
35186
|
+
* get the meta data associated with this ITwinError, if any.
|
|
35187
|
+
* @param error The error for which metadata is required.
|
|
35188
|
+
* @beta
|
|
35189
|
+
*/
|
|
35190
|
+
function getITwinErrorMetaData(error) {
|
|
35191
|
+
return (typeof error.metadata === "function") ? error.metadata() : error.metadata;
|
|
35192
|
+
}
|
|
35193
|
+
/**
|
|
35194
|
+
* type guard function that returns whether or not the passed in parameter is an [[ITwinError]]
|
|
35195
|
+
* @param error The error which is to ve verified.
|
|
35196
|
+
* @param namespace The namespace associated with the error.
|
|
35197
|
+
* @param errorKey The errorKey associated with the error.
|
|
35198
|
+
* @beta
|
|
35199
|
+
*/
|
|
35200
|
+
function isITwinError(error, namespace, errorKey) {
|
|
35201
|
+
return error !== undefined && error !== null && typeof error === "object"
|
|
35202
|
+
&& "namespace" in error && "errorKey" in error && "message" in error
|
|
35203
|
+
&& (namespace === undefined || error.namespace === namespace)
|
|
35204
|
+
&& (errorKey === undefined || error.errorKey === errorKey);
|
|
35205
|
+
}
|
|
35158
35206
|
|
|
35159
35207
|
|
|
35160
35208
|
/***/ }),
|
|
@@ -44348,7 +44396,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
44348
44396
|
/* harmony export */ IModelTileRpcInterface: () => (/* reexport safe */ _rpc_IModelTileRpcInterface__WEBPACK_IMPORTED_MODULE_136__.IModelTileRpcInterface),
|
|
44349
44397
|
/* harmony export */ IModelVersion: () => (/* reexport safe */ _IModelVersion__WEBPACK_IMPORTED_MODULE_69__.IModelVersion),
|
|
44350
44398
|
/* harmony export */ INSTANCE: () => (/* reexport safe */ _rpc_core_RpcRegistry__WEBPACK_IMPORTED_MODULE_128__.INSTANCE),
|
|
44351
|
-
/* harmony export */ ITwinError: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.ITwinError),
|
|
44352
44399
|
/* harmony export */ ImageBuffer: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_66__.ImageBuffer),
|
|
44353
44400
|
/* harmony export */ ImageBufferFormat: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_66__.ImageBufferFormat),
|
|
44354
44401
|
/* harmony export */ ImageGraphic: () => (/* reexport safe */ _geometry_ImageGraphic__WEBPACK_IMPORTED_MODULE_51__.ImageGraphic),
|
|
@@ -44358,7 +44405,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
44358
44405
|
/* harmony export */ ImageSourceFormat: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_66__.ImageSourceFormat),
|
|
44359
44406
|
/* harmony export */ ImdlFlags: () => (/* reexport safe */ _tile_IModelTileIO__WEBPACK_IMPORTED_MODULE_152__.ImdlFlags),
|
|
44360
44407
|
/* harmony export */ ImdlHeader: () => (/* reexport safe */ _tile_IModelTileIO__WEBPACK_IMPORTED_MODULE_152__.ImdlHeader),
|
|
44361
|
-
/* harmony export */ InUseLocksError: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.InUseLocksError),
|
|
44362
44408
|
/* harmony export */ InternetConnectivityStatus: () => (/* reexport safe */ _NativeAppProps__WEBPACK_IMPORTED_MODULE_85__.InternetConnectivityStatus),
|
|
44363
44409
|
/* harmony export */ Interpolation: () => (/* reexport safe */ _Tween__WEBPACK_IMPORTED_MODULE_115__.Interpolation),
|
|
44364
44410
|
/* harmony export */ IpcSession: () => (/* reexport safe */ _ipc_IpcSession__WEBPACK_IMPORTED_MODULE_74__.IpcSession),
|
|
@@ -44564,16 +44610,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
44564
44610
|
/* harmony export */ computeChildTileProps: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.computeChildTileProps),
|
|
44565
44611
|
/* harmony export */ computeChildTileRanges: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.computeChildTileRanges),
|
|
44566
44612
|
/* harmony export */ computeTileChordTolerance: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.computeTileChordTolerance),
|
|
44613
|
+
/* harmony export */ constructDetailedError: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.constructDetailedError),
|
|
44614
|
+
/* harmony export */ constructITwinError: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.constructITwinError),
|
|
44615
|
+
/* harmony export */ createITwinErrorTypeAsserter: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.createITwinErrorTypeAsserter),
|
|
44567
44616
|
/* harmony export */ decodeTileContentDescription: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.decodeTileContentDescription),
|
|
44568
44617
|
/* harmony export */ defaultTileOptions: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.defaultTileOptions),
|
|
44618
|
+
/* harmony export */ getITwinErrorMetaData: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.getITwinErrorMetaData),
|
|
44569
44619
|
/* harmony export */ getMaximumMajorTileFormatVersion: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.getMaximumMajorTileFormatVersion),
|
|
44570
44620
|
/* harmony export */ getPullChangesIpcChannel: () => (/* reexport safe */ _IpcAppProps__WEBPACK_IMPORTED_MODULE_75__.getPullChangesIpcChannel),
|
|
44571
44621
|
/* harmony export */ getTileObjectReference: () => (/* reexport safe */ _TileProps__WEBPACK_IMPORTED_MODULE_114__.getTileObjectReference),
|
|
44572
44622
|
/* harmony export */ iModelTileTreeIdToString: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.iModelTileTreeIdToString),
|
|
44573
44623
|
/* harmony export */ iTwinChannel: () => (/* reexport safe */ _ipc_IpcSocket__WEBPACK_IMPORTED_MODULE_71__.iTwinChannel),
|
|
44624
|
+
/* harmony export */ iTwinErrorKeys: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.iTwinErrorKeys),
|
|
44625
|
+
/* harmony export */ iTwinErrorMessages: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.iTwinErrorMessages),
|
|
44626
|
+
/* harmony export */ iTwinjsCoreNamespace: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.iTwinjsCoreNamespace),
|
|
44574
44627
|
/* harmony export */ initializeRpcRequest: () => (/* reexport safe */ _rpc_core_RpcRequest__WEBPACK_IMPORTED_MODULE_129__.initializeRpcRequest),
|
|
44575
44628
|
/* harmony export */ ipcAppChannels: () => (/* reexport safe */ _IpcAppProps__WEBPACK_IMPORTED_MODULE_75__.ipcAppChannels),
|
|
44576
44629
|
/* harmony export */ isBinaryImageSource: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_66__.isBinaryImageSource),
|
|
44630
|
+
/* harmony export */ isITwinError: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.isITwinError),
|
|
44577
44631
|
/* harmony export */ isKnownTileFormat: () => (/* reexport safe */ _tile_TileIO__WEBPACK_IMPORTED_MODULE_154__.isKnownTileFormat),
|
|
44578
44632
|
/* harmony export */ isPlacement2dProps: () => (/* reexport safe */ _ElementProps__WEBPACK_IMPORTED_MODULE_29__.isPlacement2dProps),
|
|
44579
44633
|
/* harmony export */ isPlacement3dProps: () => (/* reexport safe */ _ElementProps__WEBPACK_IMPORTED_MODULE_29__.isPlacement3dProps),
|
|
@@ -179942,10 +179996,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
179942
179996
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
179943
179997
|
/**
|
|
179944
179998
|
* Enumeration of the 6 possible orderings of XYZ axis order
|
|
179945
|
-
* *
|
|
179946
|
-
*
|
|
179947
|
-
* product of the i_th axis in an ordering (i=0,1,2), with the i+1_th in that ordering, will produce the i+2_th
|
|
179948
|
-
* axis in that ordering.
|
|
179999
|
+
* * AxisOrder encodes handedness as well. There are 3 right-handed axis orderings (XYZ, YZX, ZXY) and 3 left-handed orderings (XZY, YXZ, ZYX).
|
|
180000
|
+
* * Given an axis ordering, the cross product of axis _i_ with axis _i+1_ yields axis _i+2_.
|
|
179949
180001
|
* @public
|
|
179950
180002
|
*/
|
|
179951
180003
|
var AxisOrder;
|
|
@@ -214432,7 +214484,7 @@ class AngleSweep {
|
|
|
214432
214484
|
else
|
|
214433
214485
|
return AngleSweep.createStartEndRadians(this.endRadians, this.startRadians + s * Math.PI, result);
|
|
214434
214486
|
}
|
|
214435
|
-
/** Restrict start and end angles
|
|
214487
|
+
/** Restrict start and end angles to the degree range [-90,+90]. */
|
|
214436
214488
|
capLatitudeInPlace() {
|
|
214437
214489
|
const limit = 0.5 * Math.PI;
|
|
214438
214490
|
this._radians0 = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.clampToStartEnd(this._radians0, -limit, limit);
|
|
@@ -226910,14 +226962,14 @@ class Vector3d extends XYZ {
|
|
|
226910
226962
|
}
|
|
226911
226963
|
/**
|
|
226912
226964
|
* Rotate this vector 90 degrees around an axis vector.
|
|
226913
|
-
* * Note that simple cross is in the plane perpendicular to axis -- it loses the part
|
|
226914
|
-
* of "this" that is along the axis. The unit and scale is supposed to fix that.
|
|
226915
|
-
* This matches with Rodrigues' rotation formula because cos(theta) = 0 and sin(theta) = 1
|
|
226916
226965
|
* @returns the (new or optionally reused result) rotated vector, or undefined if the axis
|
|
226917
226966
|
* vector cannot be normalized.
|
|
226918
226967
|
*/
|
|
226919
226968
|
rotate90Around(axis, result) {
|
|
226920
226969
|
const unitNormal = axis.normalize();
|
|
226970
|
+
// The cross product is in the plane perpendicular to axis -- it loses the part
|
|
226971
|
+
// of "this" that is along the axis. The unit and scale is supposed to fix that.
|
|
226972
|
+
// This matches with Rodrigues' rotation formula because cos(theta) = 0 and sin(theta) = 1.
|
|
226921
226973
|
return unitNormal ? unitNormal.crossProduct(this).plusScaled(unitNormal, unitNormal.dotProduct(this), result) : undefined;
|
|
226922
226974
|
}
|
|
226923
226975
|
/**
|
|
@@ -227389,7 +227441,7 @@ class Vector3d extends XYZ {
|
|
|
227389
227441
|
* * The input tolerances in `options`, if given, are considered to be squared for efficiency's sake,
|
|
227390
227442
|
* so if you have a distance or angle tolerance t, you should pass in t * t.
|
|
227391
227443
|
* @param other second vector in comparison
|
|
227392
|
-
* @param returnValueIfAnInputIsZeroLength if either vector is near zero length, return this value.
|
|
227444
|
+
* @param returnValueIfAnInputIsZeroLength if either vector is near zero length, return this value (default false).
|
|
227393
227445
|
* @param options optional radian and distance tolerances.
|
|
227394
227446
|
*/
|
|
227395
227447
|
isPerpendicularTo(other, returnValueIfAnInputIsZeroLength = false, options) {
|
|
@@ -234347,7 +234399,7 @@ class Transform {
|
|
|
234347
234399
|
}
|
|
234348
234400
|
/**
|
|
234349
234401
|
* Return a modified copy of `this` Transform so that its `matrix` part is rigid (`origin` part is untouched).
|
|
234350
|
-
*
|
|
234402
|
+
* @see [[Matrix3d.axisOrderCrossProductsInPlace]] documentation for details of how the matrix is modified to rigid.
|
|
234351
234403
|
*/
|
|
234352
234404
|
cloneRigid(axisOrder = _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.XYZ) {
|
|
234353
234405
|
const modifiedMatrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidFromMatrix3d(this.matrix, axisOrder);
|
|
@@ -265727,10 +265779,19 @@ var IModelJson;
|
|
|
265727
265779
|
return defaultValue;
|
|
265728
265780
|
}
|
|
265729
265781
|
static parseAxesFromVectors(json, axisOrder, createDefaultIdentity) {
|
|
265730
|
-
if (Array.isArray(json)
|
|
265731
|
-
|
|
265732
|
-
|
|
265733
|
-
|
|
265782
|
+
if (Array.isArray(json)) {
|
|
265783
|
+
let matrix;
|
|
265784
|
+
if (json.length === 2) { // square and normalize
|
|
265785
|
+
const xVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[0]);
|
|
265786
|
+
const yVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[1]);
|
|
265787
|
+
matrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createRigidFromColumns(xVector, yVector, axisOrder);
|
|
265788
|
+
}
|
|
265789
|
+
else if (json.length === 3) { // preserve axes
|
|
265790
|
+
const xVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[0]);
|
|
265791
|
+
const yVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[1]);
|
|
265792
|
+
const zVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[2]);
|
|
265793
|
+
matrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createColumnsInAxisOrder(axisOrder, xVector, yVector, zVector);
|
|
265794
|
+
}
|
|
265734
265795
|
if (matrix)
|
|
265735
265796
|
return matrix;
|
|
265736
265797
|
}
|
|
@@ -265740,23 +265801,23 @@ var IModelJson;
|
|
|
265740
265801
|
}
|
|
265741
265802
|
/**
|
|
265742
265803
|
* Look for orientation data and convert to Matrix3d.
|
|
265743
|
-
* * Search order
|
|
265744
|
-
* * *
|
|
265745
|
-
* * *
|
|
265746
|
-
* * *
|
|
265804
|
+
* * Search order and interpretation:
|
|
265805
|
+
* * * xyzVectors - general matrix, axes preserved
|
|
265806
|
+
* * * yawPitchRollAngles - right-handed rotation via axial rotations
|
|
265807
|
+
* * * xyVectors - right-handed rotation, xy-plane specified, axes squared and normalized
|
|
265808
|
+
* * * zxVectors - right-handed rotation, zx-plane specified, axes squared and normalized
|
|
265747
265809
|
* @param json [in] json source data
|
|
265748
265810
|
* @param createDefaultIdentity [in] If true and no orientation is present, return an identity matrix. If false and no orientation is present, return undefined.
|
|
265749
265811
|
*/
|
|
265750
265812
|
static parseOrientation(json, createDefaultIdentity) {
|
|
265751
|
-
if (json.
|
|
265813
|
+
if (json.xyzVectors)
|
|
265814
|
+
return Reader.parseAxesFromVectors(json.xyzVectors, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.XYZ, createDefaultIdentity);
|
|
265815
|
+
if (json.yawPitchRollAngles)
|
|
265752
265816
|
return Reader.parseYawPitchRollAnglesToMatrix3d(json.yawPitchRollAngles);
|
|
265753
|
-
|
|
265754
|
-
else if (json.xyVectors) {
|
|
265817
|
+
if (json.xyVectors)
|
|
265755
265818
|
return Reader.parseAxesFromVectors(json.xyVectors, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.XYZ, createDefaultIdentity);
|
|
265756
|
-
|
|
265757
|
-
else if (json.zxVectors) {
|
|
265819
|
+
if (json.zxVectors)
|
|
265758
265820
|
return Reader.parseAxesFromVectors(json.zxVectors, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.ZXY, createDefaultIdentity);
|
|
265759
|
-
}
|
|
265760
265821
|
if (createDefaultIdentity)
|
|
265761
265822
|
return _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createIdentity();
|
|
265762
265823
|
return undefined;
|
|
@@ -266000,11 +266061,8 @@ var IModelJson;
|
|
|
266000
266061
|
const radius = Reader.parseNumberProperty(json, "radius");
|
|
266001
266062
|
const startRadius = Reader.parseNumberProperty(json, "startRadius", radius);
|
|
266002
266063
|
const endRadius = Reader.parseNumberProperty(json, "endRadius", startRadius);
|
|
266003
|
-
const capped = Reader.parseBooleanProperty(json, "capped"
|
|
266004
|
-
if (start
|
|
266005
|
-
&& end
|
|
266006
|
-
&& startRadius !== undefined
|
|
266007
|
-
&& endRadius !== undefined) {
|
|
266064
|
+
const capped = Reader.parseBooleanProperty(json, "capped");
|
|
266065
|
+
if (start && end && startRadius !== undefined && endRadius !== undefined) {
|
|
266008
266066
|
if (axes === undefined) {
|
|
266009
266067
|
const axisVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(start, end);
|
|
266010
266068
|
const frame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createRigidHeadsUp(axisVector, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.ZXY);
|
|
@@ -266012,9 +266070,7 @@ var IModelJson;
|
|
|
266012
266070
|
const vectorY = frame.columnY();
|
|
266013
266071
|
return _solid_Cone__WEBPACK_IMPORTED_MODULE_24__.Cone.createBaseAndTarget(start, end, vectorX, vectorY, startRadius, endRadius, capped);
|
|
266014
266072
|
}
|
|
266015
|
-
|
|
266016
|
-
return _solid_Cone__WEBPACK_IMPORTED_MODULE_24__.Cone.createBaseAndTarget(start, end, axes.columnX(), axes.columnY(), startRadius, endRadius, capped);
|
|
266017
|
-
}
|
|
266073
|
+
return _solid_Cone__WEBPACK_IMPORTED_MODULE_24__.Cone.createBaseAndTarget(start, end, axes.columnX(), axes.columnY(), startRadius, endRadius, capped);
|
|
266018
266074
|
}
|
|
266019
266075
|
return undefined;
|
|
266020
266076
|
}
|
|
@@ -266100,23 +266156,15 @@ var IModelJson;
|
|
|
266100
266156
|
/** Parse `SphereProps` to `Sphere` instance. */
|
|
266101
266157
|
static parseSphere(json) {
|
|
266102
266158
|
const center = Reader.parsePoint3dProperty(json, "center");
|
|
266103
|
-
// optional unqualified radius . . .
|
|
266104
266159
|
const radius = Reader.parseNumberProperty(json, "radius");
|
|
266105
|
-
// optional specific X
|
|
266106
266160
|
const radiusX = Reader.parseNumberProperty(json, "radiusX", radius);
|
|
266107
|
-
// missing Y and Z both pick up radiusX (which may have already been defaulted from unqualified radius)
|
|
266108
266161
|
const radiusY = Reader.parseNumberProperty(json, "radiusY", radiusX);
|
|
266109
|
-
const radiusZ = Reader.parseNumberProperty(json, "radiusZ",
|
|
266110
|
-
const latitudeStartEnd = Reader.parseAngleSweepProps(json, "latitudeStartEnd");
|
|
266111
|
-
const axes = Reader.parseOrientation(json,
|
|
266112
|
-
const capped = Reader.parseBooleanProperty(json, "capped"
|
|
266113
|
-
if (center
|
|
266114
|
-
&& radiusX !== undefined
|
|
266115
|
-
&& radiusY !== undefined
|
|
266116
|
-
&& radiusZ !== undefined
|
|
266117
|
-
&& capped !== undefined) {
|
|
266162
|
+
const radiusZ = Reader.parseNumberProperty(json, "radiusZ", radiusY);
|
|
266163
|
+
const latitudeStartEnd = Reader.parseAngleSweepProps(json, "latitudeStartEnd");
|
|
266164
|
+
const axes = Reader.parseOrientation(json, false);
|
|
266165
|
+
const capped = Reader.parseBooleanProperty(json, "capped");
|
|
266166
|
+
if (center && radiusX && radiusY && radiusZ)
|
|
266118
266167
|
return _solid_Sphere__WEBPACK_IMPORTED_MODULE_30__.Sphere.createFromAxesAndScales(center, axes, radiusX, radiusY, radiusZ, latitudeStartEnd, capped);
|
|
266119
|
-
}
|
|
266120
266168
|
return undefined;
|
|
266121
266169
|
}
|
|
266122
266170
|
/** Parse RuledSweepProps to RuledSweep instance. */
|
|
@@ -266241,11 +266289,6 @@ var IModelJson;
|
|
|
266241
266289
|
}
|
|
266242
266290
|
}
|
|
266243
266291
|
IModelJson.Reader = Reader;
|
|
266244
|
-
// ISSUE: include 3d in names?
|
|
266245
|
-
// ISSUE: would like shorter term than lineSegment
|
|
266246
|
-
// ISSUE: is arc clear?
|
|
266247
|
-
// ISSUE: label center, vectorX, vector90 on arc?
|
|
266248
|
-
// ISSUE: sweep data on arc -- serialize as AngleSweep?
|
|
266249
266292
|
/**
|
|
266250
266293
|
* Class to deserialize json objects into GeometryQuery objects
|
|
266251
266294
|
* @public
|
|
@@ -266394,63 +266437,86 @@ var IModelJson;
|
|
|
266394
266437
|
const centerB = data.getCenterB();
|
|
266395
266438
|
const vectorX = data.getVectorX();
|
|
266396
266439
|
const vectorY = data.getVectorY();
|
|
266440
|
+
const xMag = vectorX.magnitude();
|
|
266441
|
+
const yMag = vectorY.magnitude();
|
|
266442
|
+
const xySameLength = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(xMag, yMag);
|
|
266397
266443
|
const axisVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(centerA, centerB);
|
|
266444
|
+
// special case of cylinder
|
|
266398
266445
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(radiusA, radiusB)
|
|
266399
266446
|
&& vectorX.isPerpendicularTo(axisVector)
|
|
266400
266447
|
&& vectorY.isPerpendicularTo(axisVector)
|
|
266401
|
-
&&
|
|
266402
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(
|
|
266448
|
+
&& xySameLength
|
|
266449
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(xMag, 1.0)) {
|
|
266403
266450
|
return {
|
|
266404
266451
|
cylinder: {
|
|
266405
266452
|
capped: data.capped,
|
|
266406
|
-
start:
|
|
266407
|
-
end:
|
|
266453
|
+
start: centerA.toJSON(),
|
|
266454
|
+
end: centerB.toJSON(),
|
|
266408
266455
|
radius: radiusA,
|
|
266409
266456
|
},
|
|
266410
266457
|
};
|
|
266411
266458
|
}
|
|
266459
|
+
const coneProps = {
|
|
266460
|
+
capped: data.capped,
|
|
266461
|
+
start: centerA.toJSON(),
|
|
266462
|
+
end: centerB.toJSON(),
|
|
266463
|
+
};
|
|
266464
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(radiusA, radiusB)) {
|
|
266465
|
+
coneProps.radius = radiusA;
|
|
266466
|
+
}
|
|
266412
266467
|
else {
|
|
266413
|
-
|
|
266414
|
-
|
|
266415
|
-
start: data.getCenterA().toJSON(),
|
|
266416
|
-
end: data.getCenterB().toJSON(),
|
|
266417
|
-
startRadius: data.getRadiusA(),
|
|
266418
|
-
endRadius: data.getRadiusB(),
|
|
266419
|
-
};
|
|
266420
|
-
Writer.insertOrientationFromXYVectors(coneProps, vectorX, vectorY, false);
|
|
266421
|
-
return { cone: coneProps };
|
|
266468
|
+
coneProps.startRadius = radiusA;
|
|
266469
|
+
coneProps.endRadius = radiusB;
|
|
266422
266470
|
}
|
|
266471
|
+
// always specify an orthogonal frame for backwards compatibility
|
|
266472
|
+
Writer.insertOrientationFromXYVectors(coneProps, vectorX, vectorY, false);
|
|
266473
|
+
// specify a general matrix if elliptical sections
|
|
266474
|
+
const ellipticalSections = !xySameLength || !vectorX.isPerpendicularTo(vectorY, true);
|
|
266475
|
+
if (ellipticalSections)
|
|
266476
|
+
coneProps.xyzVectors = [vectorX.toJSON(), vectorY.toJSON(), axisVector.toJSON()];
|
|
266477
|
+
return { cone: coneProps };
|
|
266423
266478
|
}
|
|
266424
266479
|
/** Convert strongly typed instance to tagged json */
|
|
266425
266480
|
handleSphere(data) {
|
|
266426
266481
|
const xData = data.cloneVectorX().normalizeWithLength();
|
|
266427
266482
|
const yData = data.cloneVectorY().normalizeWithLength();
|
|
266428
266483
|
const zData = data.cloneVectorZ().normalizeWithLength();
|
|
266484
|
+
if (!xData.v || !yData.v || !zData.v)
|
|
266485
|
+
return undefined;
|
|
266486
|
+
const rigid = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createIdentity();
|
|
266487
|
+
const skew = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createIdentity();
|
|
266488
|
+
if (!data.cloneLocalToWorld().matrix.factorRigidSkew(rigid, skew))
|
|
266489
|
+
return undefined;
|
|
266490
|
+
const value = { center: data.cloneCenter().toJSON() };
|
|
266491
|
+
// always specify an orthogonal frame if !identity for backwards compatibility
|
|
266492
|
+
if (!rigid.isIdentity)
|
|
266493
|
+
value.zxVectors = [zData.v.toJSON(), xData.v.toJSON()];
|
|
266494
|
+
// specify a general matrix if skew/mirror local frame
|
|
266495
|
+
if (!skew.isDiagonal || skew.determinant() < 0.0)
|
|
266496
|
+
value.xyzVectors = [xData.v.toJSON(), yData.v.toJSON(), zData.v.toJSON()];
|
|
266429
266497
|
const latitudeSweep = data.cloneLatitudeSweep();
|
|
266498
|
+
const fullSweep = latitudeSweep.isFullLatitudeSweep;
|
|
266499
|
+
if (data.capped && !fullSweep)
|
|
266500
|
+
value.capped = data.capped;
|
|
266501
|
+
if (!fullSweep)
|
|
266502
|
+
value.latitudeStartEnd = latitudeSweep.toJSON();
|
|
266430
266503
|
const rX = xData.mag;
|
|
266431
266504
|
const rY = yData.mag;
|
|
266432
266505
|
const rZ = zData.mag;
|
|
266433
|
-
if (
|
|
266434
|
-
|
|
266435
|
-
center: data.cloneCenter().toJSON(),
|
|
266436
|
-
};
|
|
266437
|
-
if (!(data.getConstructiveFrame()).matrix.isIdentity)
|
|
266438
|
-
value.zxVectors = [zData.v.toJSON(), xData.v.toJSON()];
|
|
266439
|
-
const fullSweep = latitudeSweep.isFullLatitudeSweep;
|
|
266440
|
-
if (data.capped && !fullSweep)
|
|
266441
|
-
value.capped = data.capped;
|
|
266442
|
-
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(rX, rY) && _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(rX, rZ))
|
|
266506
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(rX, rY)) {
|
|
266507
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(rX, rZ))
|
|
266443
266508
|
value.radius = rX;
|
|
266444
|
-
else {
|
|
266509
|
+
else { // radiusY will pick up radiusX
|
|
266445
266510
|
value.radiusX = rX;
|
|
266446
|
-
value.radiusY = rY;
|
|
266447
266511
|
value.radiusZ = rZ;
|
|
266448
266512
|
}
|
|
266449
|
-
if (!fullSweep)
|
|
266450
|
-
value.latitudeStartEnd = latitudeSweep.toJSON();
|
|
266451
|
-
return { sphere: value };
|
|
266452
266513
|
}
|
|
266453
|
-
|
|
266514
|
+
else {
|
|
266515
|
+
value.radiusX = rX;
|
|
266516
|
+
value.radiusY = rY;
|
|
266517
|
+
value.radiusZ = rZ;
|
|
266518
|
+
}
|
|
266519
|
+
return { sphere: value };
|
|
266454
266520
|
}
|
|
266455
266521
|
/** Convert strongly typed instance to tagged json */
|
|
266456
266522
|
handleTorusPipe(data) {
|
|
@@ -267828,20 +267894,31 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
267828
267894
|
|
|
267829
267895
|
|
|
267830
267896
|
/**
|
|
267831
|
-
* A cone with axis along the z
|
|
267832
|
-
*
|
|
267833
|
-
* *
|
|
267834
|
-
* * Either
|
|
267835
|
-
* *
|
|
267897
|
+
* A cone with axis along the z-axis of a (possibly skewed) local coordinate system.
|
|
267898
|
+
* * The curved surface of the cone `C` with axis `vectorZ = centerB - centerA` is parameterized over (u,v) in [0,1]x[0,1] by
|
|
267899
|
+
* `C(u,v) = centerA + vFractionToRadius(v) * (cos(u * 2pi) * vectorX + sin(u * 2pi) * vectorY) + v * vectorZ`.
|
|
267900
|
+
* * Either radius may be zero, but they may not both be zero.
|
|
267901
|
+
* * Cross section size is determined by the lengths of `vectorX`, `vectorY`, and the radii.
|
|
267902
|
+
* * If `vectorX` and `vectorY` are orthonormal, the cross sections are circular, with sections at v = 0 and v = 1 having radius
|
|
267903
|
+
* `radiusA` and `radiusB`, respectively; otherwise, the cross sections are elliptical.
|
|
267904
|
+
* * The stored matrix encapsulates `vectorX`, `vectorY`, and `vectorZ` in the respective columns. Typically the first two columns
|
|
267905
|
+
* are orthogonal and unit length, and the last is full length.
|
|
267906
|
+
* * Creating a Cone without orthogonal xy-axes of equal length is possible, but not recommended, for the resulting geometry
|
|
267907
|
+
* lacks portability; for example, such a Cone cannot be represented as a DGN element (see [[createDgnCone]]).
|
|
267836
267908
|
* @public
|
|
267837
267909
|
*/
|
|
267838
267910
|
class Cone extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
|
|
267839
267911
|
/** String name for schema properties */
|
|
267840
267912
|
solidPrimitiveType = "cone";
|
|
267841
|
-
|
|
267842
|
-
|
|
267843
|
-
|
|
267844
|
-
|
|
267913
|
+
/** Local to world transform. Axes may have any nonzero length and may be non-perpendicular. */
|
|
267914
|
+
_localToWorld;
|
|
267915
|
+
/** Nominal cross sectional radius at z=0 (scales the cone's xy-axes). */
|
|
267916
|
+
_radiusA;
|
|
267917
|
+
/** Nominal cross sectional radius at z=1 (scales the cone's xy-axes). */
|
|
267918
|
+
_radiusB;
|
|
267919
|
+
/** Maximum of _radiusA and _radiusB. */
|
|
267920
|
+
_maxRadius;
|
|
267921
|
+
/** Constructor, inputs CONSUMED. */
|
|
267845
267922
|
constructor(map, radiusA, radiusB, capped) {
|
|
267846
267923
|
super(capped);
|
|
267847
267924
|
this._localToWorld = map;
|
|
@@ -267879,10 +267956,11 @@ class Cone extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
|
|
|
267879
267956
|
const result = this.clone();
|
|
267880
267957
|
return result.tryTransformInPlace(transform) ? result : undefined;
|
|
267881
267958
|
}
|
|
267882
|
-
/**
|
|
267883
|
-
* from
|
|
267884
|
-
* *
|
|
267885
|
-
* *
|
|
267959
|
+
/**
|
|
267960
|
+
* Create a right circular cylinder or cone from the given base centers and radii.
|
|
267961
|
+
* * The circular cross sections are perpendicular to the axis line between the centers.
|
|
267962
|
+
* * Both radii must be of the same sign, and at least one radius must be nonzero.
|
|
267963
|
+
* * Negative radii are accepted to create an interior surface, however the downstream effects of this, combined with capping, may be problematic.
|
|
267886
267964
|
*/
|
|
267887
267965
|
static createAxisPoints(centerA, centerB, radiusA, radiusB, capped) {
|
|
267888
267966
|
const zDirection = centerA.vectorTo(centerB);
|
|
@@ -267901,17 +267979,37 @@ class Cone extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
|
|
|
267901
267979
|
const matrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidHeadsUp(zDirection);
|
|
267902
267980
|
matrix.scaleColumns(1.0, 1.0, a, matrix);
|
|
267903
267981
|
const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_3__.Transform.createOriginAndMatrix(centerA, matrix);
|
|
267904
|
-
return new Cone(localToWorld, radiusA, radiusB, capped);
|
|
267982
|
+
return new Cone(localToWorld, radiusA, radiusB, capped ?? false);
|
|
267905
267983
|
}
|
|
267906
|
-
/**
|
|
267907
|
-
* to the
|
|
267984
|
+
/**
|
|
267985
|
+
* Create a general cone from cross sections parallel to the plane spanned by the given vectors.
|
|
267986
|
+
* * Circular cross sections are indicated by perpendicular vectors of the same length.
|
|
267987
|
+
* * Elliptical cross sections are indicated by non-perpendicular vectors, or vectors of different lengths.
|
|
267988
|
+
* * Cross sectional planes do not have to be perpendicular to the axis line between centers.
|
|
267989
|
+
* * Cross section size is affected both by the given vector lengths and radii. To avoid unexpected scaling,
|
|
267990
|
+
* pass orthonormal vectors for circular cross sections, or unit radii for elliptical cross sections.
|
|
267991
|
+
* * There is no validation of the input radii. For best results, they should be nonnegative, and at least one should be nonzero.
|
|
267908
267992
|
*/
|
|
267909
267993
|
static createBaseAndTarget(centerA, centerB, vectorX, vectorY, radiusA, radiusB, capped) {
|
|
267910
267994
|
radiusA = Math.abs(_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.correctSmallMetricDistance(radiusA));
|
|
267911
267995
|
radiusB = Math.abs(_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.correctSmallMetricDistance(radiusB));
|
|
267912
267996
|
const vectorZ = centerA.vectorTo(centerB);
|
|
267913
267997
|
const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_3__.Transform.createOriginAndMatrixColumns(centerA, vectorX, vectorY, vectorZ);
|
|
267914
|
-
return new Cone(localToWorld, radiusA, radiusB, capped);
|
|
267998
|
+
return new Cone(localToWorld, radiusA, radiusB, capped ?? false);
|
|
267999
|
+
}
|
|
268000
|
+
/**
|
|
268001
|
+
* Create a circular cone from the typical parameters of the DGN file.
|
|
268002
|
+
* * This method calls [[createBaseAndTarget]] with normalized vectors, `vectorY` squared against `vectorX`, and
|
|
268003
|
+
* `radiusA` and `radiusB` scaled by the original length of `vectorX`.
|
|
268004
|
+
* * These restrictions allow the cone to be represented by an element in the DGN file.
|
|
268005
|
+
*/
|
|
268006
|
+
static createDgnCone(centerA, centerB, vectorX, vectorY, radiusA, radiusB, capped) {
|
|
268007
|
+
const rigidMatrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidFromColumns(vectorX, vectorY, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.XYZ);
|
|
268008
|
+
if (rigidMatrix) {
|
|
268009
|
+
const vectorXMag = vectorX.magnitude();
|
|
268010
|
+
return this.createBaseAndTarget(centerA, centerB, rigidMatrix.columnX(), rigidMatrix.columnY(), radiusA * vectorXMag, radiusB * vectorXMag, capped);
|
|
268011
|
+
}
|
|
268012
|
+
return undefined;
|
|
267915
268013
|
}
|
|
267916
268014
|
/** (Property accessor) Return the center point at the base plane */
|
|
267917
268015
|
getCenterA() { return this._localToWorld.multiplyXYZ(0, 0, 0); }
|
|
@@ -267925,7 +268023,7 @@ class Cone extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
|
|
|
267925
268023
|
getRadiusA() { return this._radiusA; }
|
|
267926
268024
|
/** (Property accessor) return the radius at the top plane */
|
|
267927
268025
|
getRadiusB() { return this._radiusB; }
|
|
267928
|
-
/** (Property accessor) return the larger of
|
|
268026
|
+
/** (Property accessor) return the larger of radiusA and radiusB */
|
|
267929
268027
|
getMaxRadius() { return this._maxRadius; }
|
|
267930
268028
|
/** (Property accessor) return the radius at fraction `v` along the axis */
|
|
267931
268029
|
vFractionToRadius(v) { return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(this._radiusA, v, this._radiusB); }
|
|
@@ -268724,13 +268822,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
268724
268822
|
/* harmony export */ });
|
|
268725
268823
|
/* harmony import */ var _curve_Arc3d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../curve/Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
268726
268824
|
/* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
268727
|
-
/* harmony import */ var
|
|
268825
|
+
/* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
268728
268826
|
/* harmony import */ var _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../curve/StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
|
|
268729
268827
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
268828
|
+
/* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
268730
268829
|
/* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
|
|
268731
268830
|
/* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
|
|
268732
|
-
/* harmony import */ var
|
|
268733
|
-
/* harmony import */ var
|
|
268831
|
+
/* harmony import */ var _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndVectors */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndVectors.js");
|
|
268832
|
+
/* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
|
|
268734
268833
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
268735
268834
|
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
268736
268835
|
/* harmony import */ var _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SolidPrimitive */ "../../core/geometry/lib/esm/solid/SolidPrimitive.js");
|
|
@@ -268753,12 +268852,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
268753
268852
|
|
|
268754
268853
|
|
|
268755
268854
|
|
|
268855
|
+
|
|
268756
268856
|
/**
|
|
268757
|
-
* A
|
|
268758
|
-
*
|
|
268759
|
-
*
|
|
268760
|
-
* *
|
|
268761
|
-
*
|
|
268857
|
+
* A sphere mapped by an arbitrary transform.
|
|
268858
|
+
* * Typically, the stored matrix has orthogonal columns. In this case, if two columns have equal length, the
|
|
268859
|
+
* resulting geometry is ellipsoidal; if all three columns have equal length, the resulting geometry is a sphere.
|
|
268860
|
+
* * Creating a Sphere without orthogonal columns is possible, but not recommended, for the resulting geometry
|
|
268861
|
+
* lacks portability; for example, such a Sphere cannot be represented as a DGN element (see [[createDgnSphere]]).
|
|
268762
268862
|
* @public
|
|
268763
268863
|
*/
|
|
268764
268864
|
class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
|
|
@@ -268805,10 +268905,10 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
268805
268905
|
const result = this.clone();
|
|
268806
268906
|
return result.tryTransformInPlace(transform) ? result : undefined;
|
|
268807
268907
|
}
|
|
268808
|
-
/**
|
|
268809
|
-
*
|
|
268810
|
-
* *
|
|
268811
|
-
* *
|
|
268908
|
+
/**
|
|
268909
|
+
* Construct a rigid coordinate frame from the local coordinate frame.
|
|
268910
|
+
* * The returned frame is right-handed, with perpendicular unit axes.
|
|
268911
|
+
* * Compare to [[cloneLocalToWorld]].
|
|
268812
268912
|
*/
|
|
268813
268913
|
getConstructiveFrame() {
|
|
268814
268914
|
return this._localToWorld.cloneRigid();
|
|
@@ -268816,30 +268916,37 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
268816
268916
|
/** Return the latitude sweep as fraction of south pole to north pole. */
|
|
268817
268917
|
get latitudeSweepFraction() { return this._latitudeSweep.sweepRadians / Math.PI; }
|
|
268818
268918
|
/** Create from center and radius, with optional restricted latitudes. */
|
|
268819
|
-
static createCenterRadius(center, radius, latitudeSweep) {
|
|
268919
|
+
static createCenterRadius(center, radius, latitudeSweep, capped) {
|
|
268820
268920
|
const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__.Transform.createOriginAndMatrix(center, _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createUniformScale(radius));
|
|
268821
|
-
return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.createFullLatitude(), false);
|
|
268921
|
+
return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.createFullLatitude(), capped ?? false);
|
|
268822
268922
|
}
|
|
268823
268923
|
/** Create an ellipsoid which is a unit sphere mapped to position by an (arbitrary, possibly skewed and scaled) transform. */
|
|
268824
268924
|
static createEllipsoid(localToWorld, latitudeSweep, capped) {
|
|
268825
|
-
return new Sphere(localToWorld.clone(), latitudeSweep.clone(), capped);
|
|
268925
|
+
return new Sphere(localToWorld.clone(), latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.createFullLatitude(), capped ?? false);
|
|
268826
268926
|
}
|
|
268827
|
-
/**
|
|
268927
|
+
/**
|
|
268928
|
+
* Create a sphere from the typical parameters of the DGN file.
|
|
268929
|
+
* * This method normalizes the input vectors, squares `vectorX` against `vectorZ`, and scales the radii by the vectors' original lengths.
|
|
268930
|
+
* * These restrictions allow the sphere to be represented by an element in the DGN file.
|
|
268931
|
+
*/
|
|
268828
268932
|
static createDgnSphere(center, vectorX, vectorZ, radiusXY, radiusZ, latitudeSweep, capped) {
|
|
268829
|
-
const
|
|
268830
|
-
if (
|
|
268831
|
-
|
|
268832
|
-
|
|
268833
|
-
const frame = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__.Transform.createOriginAndMatrix(center,
|
|
268834
|
-
return new Sphere(frame, latitudeSweep.clone(), capped);
|
|
268933
|
+
const rigidMatrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidFromColumns(vectorZ, vectorX, _Geometry__WEBPACK_IMPORTED_MODULE_4__.AxisOrder.ZXY);
|
|
268934
|
+
if (rigidMatrix) {
|
|
268935
|
+
radiusXY *= vectorX.magnitude();
|
|
268936
|
+
rigidMatrix.scaleColumns(radiusXY, radiusXY, radiusZ * vectorZ.magnitude(), rigidMatrix);
|
|
268937
|
+
const frame = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__.Transform.createOriginAndMatrix(center, rigidMatrix);
|
|
268938
|
+
return new Sphere(frame, latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.createFullLatitude(), capped ?? false);
|
|
268835
268939
|
}
|
|
268836
268940
|
return undefined;
|
|
268837
268941
|
}
|
|
268838
|
-
/**
|
|
268942
|
+
/**
|
|
268943
|
+
* Create a sphere.
|
|
268944
|
+
* * If `axes` is supplied, its columns are scaled by the radii to form the sphere's local frame.
|
|
268945
|
+
*/
|
|
268839
268946
|
static createFromAxesAndScales(center, axes, radiusX, radiusY, radiusZ, latitudeSweep, capped) {
|
|
268840
268947
|
const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__.Transform.createOriginAndMatrix(center, axes);
|
|
268841
268948
|
localToWorld.matrix.scaleColumnsInPlace(radiusX, radiusY, radiusZ);
|
|
268842
|
-
return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.createFullLatitude(), capped);
|
|
268949
|
+
return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.createFullLatitude(), capped ?? false);
|
|
268843
268950
|
}
|
|
268844
268951
|
/** return (copy of) sphere center */
|
|
268845
268952
|
cloneCenter() { return this._localToWorld.getOrigin(); }
|
|
@@ -268869,8 +268976,11 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
268869
268976
|
}
|
|
268870
268977
|
/**
|
|
268871
268978
|
* Return a (clone of) the sphere's local to world transformation.
|
|
268979
|
+
* * Compare to [[getConstructiveFrame]].
|
|
268872
268980
|
*/
|
|
268873
|
-
cloneLocalToWorld() {
|
|
268981
|
+
cloneLocalToWorld() {
|
|
268982
|
+
return this._localToWorld.clone();
|
|
268983
|
+
}
|
|
268874
268984
|
/** Test if `other` is a `Sphere` */
|
|
268875
268985
|
isSameGeometryClass(other) { return other instanceof Sphere; }
|
|
268876
268986
|
/** Test for same geometry in `other` */
|
|
@@ -268951,6 +269061,20 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
268951
269061
|
dispatchToGeometryHandler(handler) {
|
|
268952
269062
|
return handler.handleSphere(this);
|
|
268953
269063
|
}
|
|
269064
|
+
/**
|
|
269065
|
+
* Return the Arc3d section at uFraction. For the sphere, this is a meridian arc.
|
|
269066
|
+
* @param uFraction fractional position along the equator.
|
|
269067
|
+
*/
|
|
269068
|
+
constantUSection(uFraction) {
|
|
269069
|
+
const phi = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.fractionToSignedPeriodicFractionStartEnd(uFraction, 0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_8__.Angle.pi2Radians, false);
|
|
269070
|
+
const s1 = Math.sin(phi);
|
|
269071
|
+
const c1 = Math.cos(phi);
|
|
269072
|
+
const transform = this._localToWorld;
|
|
269073
|
+
const center = transform.getOrigin();
|
|
269074
|
+
const vector0 = transform.matrix.multiplyXYZ(c1, s1, 0);
|
|
269075
|
+
const vector90 = transform.matrix.multiplyXYZ(0, 0, 1);
|
|
269076
|
+
return _curve_Arc3d__WEBPACK_IMPORTED_MODULE_9__.Arc3d.create(center, vector0, vector90, this._latitudeSweep);
|
|
269077
|
+
}
|
|
268954
269078
|
/**
|
|
268955
269079
|
* Return the Arc3d section at vFraction. For the sphere, this is a latitude circle.
|
|
268956
269080
|
* @param vFraction fractional position along the sweep direction
|
|
@@ -268963,7 +269087,7 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
268963
269087
|
const center = transform.multiplyXYZ(0, 0, s1);
|
|
268964
269088
|
const vector0 = transform.matrix.multiplyXYZ(c1, 0, 0);
|
|
268965
269089
|
const vector90 = transform.matrix.multiplyXYZ(0, c1, 0);
|
|
268966
|
-
return
|
|
269090
|
+
return _curve_Loop__WEBPACK_IMPORTED_MODULE_10__.Loop.create(_curve_Arc3d__WEBPACK_IMPORTED_MODULE_9__.Arc3d.create(center, vector0, vector90));
|
|
268967
269091
|
}
|
|
268968
269092
|
/** Extend a range to contain this sphere. */
|
|
268969
269093
|
extendRange(range, transform) {
|
|
@@ -269007,7 +269131,7 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
269007
269131
|
const sinTheta = Math.sin(thetaRadians);
|
|
269008
269132
|
const sinPhi = Math.sin(phiRadians);
|
|
269009
269133
|
const cosPhi = Math.cos(phiRadians);
|
|
269010
|
-
return
|
|
269134
|
+
return _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_11__.Plane3dByOriginAndVectors.createOriginAndVectors(this._localToWorld.multiplyXYZ(cosTheta * cosPhi, sinTheta * cosPhi, sinPhi), this._localToWorld.matrix.multiplyXYZ(-fTheta * sinTheta, fTheta * cosTheta, 0), // !!! note cosTheta term is omitted -- scale is wrong, but remains non-zero at poles.
|
|
269011
269135
|
this._localToWorld.matrix.multiplyXYZ(-fPhi * cosTheta * sinPhi, -fPhi * sinTheta * sinPhi, fPhi * cosPhi), result);
|
|
269012
269136
|
}
|
|
269013
269137
|
/**
|
|
@@ -269034,7 +269158,7 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
269034
269158
|
if (!this._latitudeSweep.isRadiansInSweep(0.0))
|
|
269035
269159
|
dMaxU *= Math.max(Math.cos(Math.abs(this._latitudeSweep.startRadians)), Math.cos(Math.abs(this._latitudeSweep.endRadians)));
|
|
269036
269160
|
const dMaxV = Math.max(rMaxU, rZ) * Math.abs(this._latitudeSweep.sweepRadians);
|
|
269037
|
-
return
|
|
269161
|
+
return _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_12__.Vector2d.create(dMaxU, dMaxV);
|
|
269038
269162
|
}
|
|
269039
269163
|
}
|
|
269040
269164
|
|
|
@@ -310662,7 +310786,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
310662
310786
|
/***/ ((module) => {
|
|
310663
310787
|
|
|
310664
310788
|
"use strict";
|
|
310665
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.
|
|
310789
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.83","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 ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*"},"//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":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.3.0","@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
310666
310790
|
|
|
310667
310791
|
/***/ })
|
|
310668
310792
|
|