@itwin/rpcinterface-full-stack-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.
@@ -51556,10 +51556,15 @@ class IModelVersion {
51556
51556
  "use strict";
51557
51557
  __webpack_require__.r(__webpack_exports__);
51558
51558
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
51559
- /* harmony export */ ITwinError: () => (/* binding */ ITwinError),
51560
- /* harmony export */ InUseLocksError: () => (/* binding */ InUseLocksError)
51559
+ /* harmony export */ constructDetailedError: () => (/* binding */ constructDetailedError),
51560
+ /* harmony export */ constructITwinError: () => (/* binding */ constructITwinError),
51561
+ /* harmony export */ createITwinErrorTypeAsserter: () => (/* binding */ createITwinErrorTypeAsserter),
51562
+ /* harmony export */ getITwinErrorMetaData: () => (/* binding */ getITwinErrorMetaData),
51563
+ /* harmony export */ iTwinErrorKeys: () => (/* binding */ iTwinErrorKeys),
51564
+ /* harmony export */ iTwinErrorMessages: () => (/* binding */ iTwinErrorMessages),
51565
+ /* harmony export */ iTwinjsCoreNamespace: () => (/* binding */ iTwinjsCoreNamespace),
51566
+ /* harmony export */ isITwinError: () => (/* binding */ isITwinError)
51561
51567
  /* harmony export */ });
51562
- /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
51563
51568
  /*---------------------------------------------------------------------------------------------
51564
51569
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
51565
51570
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -51567,50 +51572,93 @@ __webpack_require__.r(__webpack_exports__);
51567
51572
  /** @packageDocumentation
51568
51573
  * @module iModels
51569
51574
  */
51570
-
51571
- /** @beta */
51572
- var InUseLocksError;
51573
- (function (InUseLocksError) {
51574
- /**
51575
- * type guard function that returns whether or not the passed in parameter is an [[InUseLocksError]].
51576
- * it first checks [[ITwinError.isITwinError]] and then checks that the namespace property is "itwinjs-core" and the errorKey property is "in-use-locks".
51577
- */
51578
- function isInUseLocksError(error) {
51579
- return ITwinError.isITwinError(error) && error.namespace === "itwinjs-core" && error.errorKey === "in-use-locks";
51580
- }
51581
- InUseLocksError.isInUseLocksError = isInUseLocksError;
51582
- /** throws an error which passes the [[InUseLocksError.isInUseLocksError]] type guard function */
51583
- function throwInUseLocksError(inUseLocks, message, metadata) {
51584
- const errorObject = new Error();
51585
- errorObject.name = "InUseLocksError"; // optional but makes it so that when the error is thrown and not caught we see InUseLocksError: 'message' instead of Error: 'message'
51586
- Error.captureStackTrace(errorObject, throwInUseLocksError); // optional: whether we want to hide throwInUseLocksError or not from the stack. not super important
51587
- const lockError = {
51588
- namespace: "itwinjs-core",
51589
- errorKey: "in-use-locks",
51590
- message: message ?? "One or more objects are already locked by another briefcase.",
51591
- metadata,
51592
- inUseLocks,
51593
- };
51594
- Object.assign(errorObject, lockError);
51595
- throw errorObject;
51596
- }
51597
- InUseLocksError.throwInUseLocksError = throwInUseLocksError;
51598
- })(InUseLocksError || (InUseLocksError = {}));
51599
- /** @beta */
51600
- var ITwinError;
51601
- (function (ITwinError) {
51602
- /** type guard function that returns whether or not the passed in parameter is an [[ITwinError]] */
51603
- function isITwinError(error) {
51604
- return error !== undefined && error !== null && typeof error === "object" && "namespace" in error && "errorKey" in error && "message" in error;
51605
- }
51606
- ITwinError.isITwinError = isITwinError;
51607
- /** get the meta data associated with this ITwinError, if any. */
51608
- function getMetaData(err) {
51609
- return _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getMetaData(err.metadata);
51610
- }
51611
- ITwinError.getMetaData = getMetaData;
51612
- })(ITwinError || (ITwinError = {}));
51613
- ;
51575
+ /**
51576
+ * iTwinjs Core namespace namespace for a developer/application.
51577
+ * @beta
51578
+ */
51579
+ const iTwinjsCoreNamespace = "itwinjs-core";
51580
+ /**
51581
+ * error keys object used to describe an error keys for a developer/application.
51582
+ * @beta
51583
+ */
51584
+ const iTwinErrorKeys = {
51585
+ inUseLocks: "in-use-locks",
51586
+ channelNest: "channel-may-not-nest",
51587
+ channelNotAllowed: "channel-not-allowed",
51588
+ channelRootExists: "channel-root-exists"
51589
+ };
51590
+ /**
51591
+ * Record for all itwin error messages.
51592
+ * @beta
51593
+ */
51594
+ const iTwinErrorMessages = {
51595
+ "inUseLocks": () => 'Objects are locked by another briefcase',
51596
+ "channelNest": (id) => `Channel ${id} may not nest`,
51597
+ "channelNotAllowed": (id) => `Channel ${id} is not allowed`,
51598
+ "channelRootExists": (id) => `Channel ${id} root already exist`,
51599
+ };
51600
+ /**
51601
+ * A function which will be used to construct an [[ITwinError]].
51602
+ * @param namespace The namespace associated with the error.
51603
+ * @param errorKey The errorKey associated with the error.
51604
+ * @param message The message associated with the error.
51605
+ * @param metadata Metadata associated with the error.
51606
+ * @beta
51607
+ */
51608
+ function constructITwinError(namespace, errorKey, message, metadata) {
51609
+ const error = new Error();
51610
+ error.message = message ?? `${errorKey} occurred`;
51611
+ error.name = `${namespace}:${errorKey}`;
51612
+ error.namespace = namespace;
51613
+ error.errorKey = errorKey;
51614
+ error.metadata = metadata;
51615
+ Error.captureStackTrace(error, constructITwinError); // Optional, but this would hide constructITwinError from stack.
51616
+ return error;
51617
+ }
51618
+ /**
51619
+ * A function which constructs a detailed error for example [[ InUseLocksError ]] above.
51620
+ * @param namespace The namespace associated with the error.
51621
+ * @param errorKey The errorKey associated with the error.
51622
+ * @param details Other details associated with the error.
51623
+ * @param message The message associated with the error.
51624
+ * @param metadata Metadata associated with the error.
51625
+ * @beta
51626
+ */
51627
+ function constructDetailedError(namespace, errorKey, details, message, metadata) {
51628
+ const baseError = constructITwinError(namespace, errorKey, message, metadata);
51629
+ Error.captureStackTrace(baseError, constructDetailedError); // Optional, but this would hide constructDetailedError from stack.
51630
+ return Object.assign(baseError, details);
51631
+ }
51632
+ /**
51633
+ * a high level function that returns a type asserter function which would return whether or not the passed in parameter is an [[ITwinError]]
51634
+ * @param namespace The namespace associated with the error.
51635
+ * @param errorKey The errorKey associated with the error.
51636
+ * @beta
51637
+ */
51638
+ function createITwinErrorTypeAsserter(namespace, errorKey) {
51639
+ return (error) => isITwinError(error, namespace, errorKey);
51640
+ }
51641
+ /**
51642
+ * get the meta data associated with this ITwinError, if any.
51643
+ * @param error The error for which metadata is required.
51644
+ * @beta
51645
+ */
51646
+ function getITwinErrorMetaData(error) {
51647
+ return (typeof error.metadata === "function") ? error.metadata() : error.metadata;
51648
+ }
51649
+ /**
51650
+ * type guard function that returns whether or not the passed in parameter is an [[ITwinError]]
51651
+ * @param error The error which is to ve verified.
51652
+ * @param namespace The namespace associated with the error.
51653
+ * @param errorKey The errorKey associated with the error.
51654
+ * @beta
51655
+ */
51656
+ function isITwinError(error, namespace, errorKey) {
51657
+ return error !== undefined && error !== null && typeof error === "object"
51658
+ && "namespace" in error && "errorKey" in error && "message" in error
51659
+ && (namespace === undefined || error.namespace === namespace)
51660
+ && (errorKey === undefined || error.errorKey === errorKey);
51661
+ }
51614
51662
 
51615
51663
 
51616
51664
  /***/ }),
@@ -60804,7 +60852,6 @@ __webpack_require__.r(__webpack_exports__);
60804
60852
  /* harmony export */ IModelTileRpcInterface: () => (/* reexport safe */ _rpc_IModelTileRpcInterface__WEBPACK_IMPORTED_MODULE_136__.IModelTileRpcInterface),
60805
60853
  /* harmony export */ IModelVersion: () => (/* reexport safe */ _IModelVersion__WEBPACK_IMPORTED_MODULE_69__.IModelVersion),
60806
60854
  /* harmony export */ INSTANCE: () => (/* reexport safe */ _rpc_core_RpcRegistry__WEBPACK_IMPORTED_MODULE_128__.INSTANCE),
60807
- /* harmony export */ ITwinError: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.ITwinError),
60808
60855
  /* harmony export */ ImageBuffer: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_66__.ImageBuffer),
60809
60856
  /* harmony export */ ImageBufferFormat: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_66__.ImageBufferFormat),
60810
60857
  /* harmony export */ ImageGraphic: () => (/* reexport safe */ _geometry_ImageGraphic__WEBPACK_IMPORTED_MODULE_51__.ImageGraphic),
@@ -60814,7 +60861,6 @@ __webpack_require__.r(__webpack_exports__);
60814
60861
  /* harmony export */ ImageSourceFormat: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_66__.ImageSourceFormat),
60815
60862
  /* harmony export */ ImdlFlags: () => (/* reexport safe */ _tile_IModelTileIO__WEBPACK_IMPORTED_MODULE_152__.ImdlFlags),
60816
60863
  /* harmony export */ ImdlHeader: () => (/* reexport safe */ _tile_IModelTileIO__WEBPACK_IMPORTED_MODULE_152__.ImdlHeader),
60817
- /* harmony export */ InUseLocksError: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.InUseLocksError),
60818
60864
  /* harmony export */ InternetConnectivityStatus: () => (/* reexport safe */ _NativeAppProps__WEBPACK_IMPORTED_MODULE_85__.InternetConnectivityStatus),
60819
60865
  /* harmony export */ Interpolation: () => (/* reexport safe */ _Tween__WEBPACK_IMPORTED_MODULE_115__.Interpolation),
60820
60866
  /* harmony export */ IpcSession: () => (/* reexport safe */ _ipc_IpcSession__WEBPACK_IMPORTED_MODULE_74__.IpcSession),
@@ -61020,16 +61066,24 @@ __webpack_require__.r(__webpack_exports__);
61020
61066
  /* harmony export */ computeChildTileProps: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.computeChildTileProps),
61021
61067
  /* harmony export */ computeChildTileRanges: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.computeChildTileRanges),
61022
61068
  /* harmony export */ computeTileChordTolerance: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.computeTileChordTolerance),
61069
+ /* harmony export */ constructDetailedError: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.constructDetailedError),
61070
+ /* harmony export */ constructITwinError: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.constructITwinError),
61071
+ /* harmony export */ createITwinErrorTypeAsserter: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.createITwinErrorTypeAsserter),
61023
61072
  /* harmony export */ decodeTileContentDescription: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.decodeTileContentDescription),
61024
61073
  /* harmony export */ defaultTileOptions: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.defaultTileOptions),
61074
+ /* harmony export */ getITwinErrorMetaData: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.getITwinErrorMetaData),
61025
61075
  /* harmony export */ getMaximumMajorTileFormatVersion: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.getMaximumMajorTileFormatVersion),
61026
61076
  /* harmony export */ getPullChangesIpcChannel: () => (/* reexport safe */ _IpcAppProps__WEBPACK_IMPORTED_MODULE_75__.getPullChangesIpcChannel),
61027
61077
  /* harmony export */ getTileObjectReference: () => (/* reexport safe */ _TileProps__WEBPACK_IMPORTED_MODULE_114__.getTileObjectReference),
61028
61078
  /* harmony export */ iModelTileTreeIdToString: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.iModelTileTreeIdToString),
61029
61079
  /* harmony export */ iTwinChannel: () => (/* reexport safe */ _ipc_IpcSocket__WEBPACK_IMPORTED_MODULE_71__.iTwinChannel),
61080
+ /* harmony export */ iTwinErrorKeys: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.iTwinErrorKeys),
61081
+ /* harmony export */ iTwinErrorMessages: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.iTwinErrorMessages),
61082
+ /* harmony export */ iTwinjsCoreNamespace: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.iTwinjsCoreNamespace),
61030
61083
  /* harmony export */ initializeRpcRequest: () => (/* reexport safe */ _rpc_core_RpcRequest__WEBPACK_IMPORTED_MODULE_129__.initializeRpcRequest),
61031
61084
  /* harmony export */ ipcAppChannels: () => (/* reexport safe */ _IpcAppProps__WEBPACK_IMPORTED_MODULE_75__.ipcAppChannels),
61032
61085
  /* harmony export */ isBinaryImageSource: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_66__.isBinaryImageSource),
61086
+ /* harmony export */ isITwinError: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.isITwinError),
61033
61087
  /* harmony export */ isKnownTileFormat: () => (/* reexport safe */ _tile_TileIO__WEBPACK_IMPORTED_MODULE_154__.isKnownTileFormat),
61034
61088
  /* harmony export */ isPlacement2dProps: () => (/* reexport safe */ _ElementProps__WEBPACK_IMPORTED_MODULE_29__.isPlacement2dProps),
61035
61089
  /* harmony export */ isPlacement3dProps: () => (/* reexport safe */ _ElementProps__WEBPACK_IMPORTED_MODULE_29__.isPlacement3dProps),
@@ -196231,10 +196285,8 @@ __webpack_require__.r(__webpack_exports__);
196231
196285
  /* eslint-disable @typescript-eslint/naming-convention */
196232
196286
  /**
196233
196287
  * Enumeration of the 6 possible orderings of XYZ axis order
196234
- * * **Note:** There are 3 axis order with right hand system (XYZ = 0, YZX = 1, ZXY = 2) and 3 axis order with
196235
- * left hand system (XZY = 4, YXZ = 5, ZYX = 6). Note that `AxisOrder` is encoding the handedness as well. Cross
196236
- * 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
196237
- * axis in that ordering.
196288
+ * * AxisOrder encodes handedness as well. There are 3 right-handed axis orderings (XYZ, YZX, ZXY) and 3 left-handed orderings (XZY, YXZ, ZYX).
196289
+ * * Given an axis ordering, the cross product of axis _i_ with axis _i+1_ yields axis _i+2_.
196238
196290
  * @public
196239
196291
  */
196240
196292
  var AxisOrder;
@@ -230721,7 +230773,7 @@ class AngleSweep {
230721
230773
  else
230722
230774
  return AngleSweep.createStartEndRadians(this.endRadians, this.startRadians + s * Math.PI, result);
230723
230775
  }
230724
- /** Restrict start and end angles into the range (-90,+90) in degrees. */
230776
+ /** Restrict start and end angles to the degree range [-90,+90]. */
230725
230777
  capLatitudeInPlace() {
230726
230778
  const limit = 0.5 * Math.PI;
230727
230779
  this._radians0 = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.clampToStartEnd(this._radians0, -limit, limit);
@@ -243199,14 +243251,14 @@ class Vector3d extends XYZ {
243199
243251
  }
243200
243252
  /**
243201
243253
  * Rotate this vector 90 degrees around an axis vector.
243202
- * * Note that simple cross is in the plane perpendicular to axis -- it loses the part
243203
- * of "this" that is along the axis. The unit and scale is supposed to fix that.
243204
- * This matches with Rodrigues' rotation formula because cos(theta) = 0 and sin(theta) = 1
243205
243254
  * @returns the (new or optionally reused result) rotated vector, or undefined if the axis
243206
243255
  * vector cannot be normalized.
243207
243256
  */
243208
243257
  rotate90Around(axis, result) {
243209
243258
  const unitNormal = axis.normalize();
243259
+ // The cross product is in the plane perpendicular to axis -- it loses the part
243260
+ // of "this" that is along the axis. The unit and scale is supposed to fix that.
243261
+ // This matches with Rodrigues' rotation formula because cos(theta) = 0 and sin(theta) = 1.
243210
243262
  return unitNormal ? unitNormal.crossProduct(this).plusScaled(unitNormal, unitNormal.dotProduct(this), result) : undefined;
243211
243263
  }
243212
243264
  /**
@@ -243678,7 +243730,7 @@ class Vector3d extends XYZ {
243678
243730
  * * The input tolerances in `options`, if given, are considered to be squared for efficiency's sake,
243679
243731
  * so if you have a distance or angle tolerance t, you should pass in t * t.
243680
243732
  * @param other second vector in comparison
243681
- * @param returnValueIfAnInputIsZeroLength if either vector is near zero length, return this value.
243733
+ * @param returnValueIfAnInputIsZeroLength if either vector is near zero length, return this value (default false).
243682
243734
  * @param options optional radian and distance tolerances.
243683
243735
  */
243684
243736
  isPerpendicularTo(other, returnValueIfAnInputIsZeroLength = false, options) {
@@ -250636,7 +250688,7 @@ class Transform {
250636
250688
  }
250637
250689
  /**
250638
250690
  * Return a modified copy of `this` Transform so that its `matrix` part is rigid (`origin` part is untouched).
250639
- * * @see [[Matrix3d.axisOrderCrossProductsInPlace]] documentation for details of how the matrix is modified to rigid.
250691
+ * @see [[Matrix3d.axisOrderCrossProductsInPlace]] documentation for details of how the matrix is modified to rigid.
250640
250692
  */
250641
250693
  cloneRigid(axisOrder = _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.XYZ) {
250642
250694
  const modifiedMatrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidFromMatrix3d(this.matrix, axisOrder);
@@ -282016,10 +282068,19 @@ var IModelJson;
282016
282068
  return defaultValue;
282017
282069
  }
282018
282070
  static parseAxesFromVectors(json, axisOrder, createDefaultIdentity) {
282019
- if (Array.isArray(json) && json.length === 2) {
282020
- const xVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[0]);
282021
- const yVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[1]);
282022
- const matrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createRigidFromColumns(xVector, yVector, axisOrder);
282071
+ if (Array.isArray(json)) {
282072
+ let matrix;
282073
+ if (json.length === 2) { // square and normalize
282074
+ const xVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[0]);
282075
+ const yVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[1]);
282076
+ matrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createRigidFromColumns(xVector, yVector, axisOrder);
282077
+ }
282078
+ else if (json.length === 3) { // preserve axes
282079
+ const xVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[0]);
282080
+ const yVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[1]);
282081
+ const zVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[2]);
282082
+ matrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createColumnsInAxisOrder(axisOrder, xVector, yVector, zVector);
282083
+ }
282023
282084
  if (matrix)
282024
282085
  return matrix;
282025
282086
  }
@@ -282029,23 +282090,23 @@ var IModelJson;
282029
282090
  }
282030
282091
  /**
282031
282092
  * Look for orientation data and convert to Matrix3d.
282032
- * * Search order is:
282033
- * * * yawPitchRollAngles
282034
- * * * xyVectors
282035
- * * * zxVectors
282093
+ * * Search order and interpretation:
282094
+ * * * xyzVectors - general matrix, axes preserved
282095
+ * * * yawPitchRollAngles - right-handed rotation via axial rotations
282096
+ * * * xyVectors - right-handed rotation, xy-plane specified, axes squared and normalized
282097
+ * * * zxVectors - right-handed rotation, zx-plane specified, axes squared and normalized
282036
282098
  * @param json [in] json source data
282037
282099
  * @param createDefaultIdentity [in] If true and no orientation is present, return an identity matrix. If false and no orientation is present, return undefined.
282038
282100
  */
282039
282101
  static parseOrientation(json, createDefaultIdentity) {
282040
- if (json.yawPitchRollAngles) {
282102
+ if (json.xyzVectors)
282103
+ return Reader.parseAxesFromVectors(json.xyzVectors, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.XYZ, createDefaultIdentity);
282104
+ if (json.yawPitchRollAngles)
282041
282105
  return Reader.parseYawPitchRollAnglesToMatrix3d(json.yawPitchRollAngles);
282042
- }
282043
- else if (json.xyVectors) {
282106
+ if (json.xyVectors)
282044
282107
  return Reader.parseAxesFromVectors(json.xyVectors, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.XYZ, createDefaultIdentity);
282045
- }
282046
- else if (json.zxVectors) {
282108
+ if (json.zxVectors)
282047
282109
  return Reader.parseAxesFromVectors(json.zxVectors, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.ZXY, createDefaultIdentity);
282048
- }
282049
282110
  if (createDefaultIdentity)
282050
282111
  return _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createIdentity();
282051
282112
  return undefined;
@@ -282289,11 +282350,8 @@ var IModelJson;
282289
282350
  const radius = Reader.parseNumberProperty(json, "radius");
282290
282351
  const startRadius = Reader.parseNumberProperty(json, "startRadius", radius);
282291
282352
  const endRadius = Reader.parseNumberProperty(json, "endRadius", startRadius);
282292
- const capped = Reader.parseBooleanProperty(json, "capped", false);
282293
- if (start
282294
- && end
282295
- && startRadius !== undefined
282296
- && endRadius !== undefined) {
282353
+ const capped = Reader.parseBooleanProperty(json, "capped");
282354
+ if (start && end && startRadius !== undefined && endRadius !== undefined) {
282297
282355
  if (axes === undefined) {
282298
282356
  const axisVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(start, end);
282299
282357
  const frame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createRigidHeadsUp(axisVector, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.ZXY);
@@ -282301,9 +282359,7 @@ var IModelJson;
282301
282359
  const vectorY = frame.columnY();
282302
282360
  return _solid_Cone__WEBPACK_IMPORTED_MODULE_24__.Cone.createBaseAndTarget(start, end, vectorX, vectorY, startRadius, endRadius, capped);
282303
282361
  }
282304
- else {
282305
- return _solid_Cone__WEBPACK_IMPORTED_MODULE_24__.Cone.createBaseAndTarget(start, end, axes.columnX(), axes.columnY(), startRadius, endRadius, capped);
282306
- }
282362
+ return _solid_Cone__WEBPACK_IMPORTED_MODULE_24__.Cone.createBaseAndTarget(start, end, axes.columnX(), axes.columnY(), startRadius, endRadius, capped);
282307
282363
  }
282308
282364
  return undefined;
282309
282365
  }
@@ -282389,23 +282445,15 @@ var IModelJson;
282389
282445
  /** Parse `SphereProps` to `Sphere` instance. */
282390
282446
  static parseSphere(json) {
282391
282447
  const center = Reader.parsePoint3dProperty(json, "center");
282392
- // optional unqualified radius . . .
282393
282448
  const radius = Reader.parseNumberProperty(json, "radius");
282394
- // optional specific X
282395
282449
  const radiusX = Reader.parseNumberProperty(json, "radiusX", radius);
282396
- // missing Y and Z both pick up radiusX (which may have already been defaulted from unqualified radius)
282397
282450
  const radiusY = Reader.parseNumberProperty(json, "radiusY", radiusX);
282398
- const radiusZ = Reader.parseNumberProperty(json, "radiusZ", radiusX);
282399
- const latitudeStartEnd = Reader.parseAngleSweepProps(json, "latitudeStartEnd"); // this may be undefined!!
282400
- const axes = Reader.parseOrientation(json, true);
282401
- const capped = Reader.parseBooleanProperty(json, "capped", false);
282402
- if (center !== undefined
282403
- && radiusX !== undefined
282404
- && radiusY !== undefined
282405
- && radiusZ !== undefined
282406
- && capped !== undefined) {
282451
+ const radiusZ = Reader.parseNumberProperty(json, "radiusZ", radiusY);
282452
+ const latitudeStartEnd = Reader.parseAngleSweepProps(json, "latitudeStartEnd");
282453
+ const axes = Reader.parseOrientation(json, false);
282454
+ const capped = Reader.parseBooleanProperty(json, "capped");
282455
+ if (center && radiusX && radiusY && radiusZ)
282407
282456
  return _solid_Sphere__WEBPACK_IMPORTED_MODULE_30__.Sphere.createFromAxesAndScales(center, axes, radiusX, radiusY, radiusZ, latitudeStartEnd, capped);
282408
- }
282409
282457
  return undefined;
282410
282458
  }
282411
282459
  /** Parse RuledSweepProps to RuledSweep instance. */
@@ -282530,11 +282578,6 @@ var IModelJson;
282530
282578
  }
282531
282579
  }
282532
282580
  IModelJson.Reader = Reader;
282533
- // ISSUE: include 3d in names?
282534
- // ISSUE: would like shorter term than lineSegment
282535
- // ISSUE: is arc clear?
282536
- // ISSUE: label center, vectorX, vector90 on arc?
282537
- // ISSUE: sweep data on arc -- serialize as AngleSweep?
282538
282581
  /**
282539
282582
  * Class to deserialize json objects into GeometryQuery objects
282540
282583
  * @public
@@ -282683,63 +282726,86 @@ var IModelJson;
282683
282726
  const centerB = data.getCenterB();
282684
282727
  const vectorX = data.getVectorX();
282685
282728
  const vectorY = data.getVectorY();
282729
+ const xMag = vectorX.magnitude();
282730
+ const yMag = vectorY.magnitude();
282731
+ const xySameLength = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(xMag, yMag);
282686
282732
  const axisVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(centerA, centerB);
282733
+ // special case of cylinder
282687
282734
  if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(radiusA, radiusB)
282688
282735
  && vectorX.isPerpendicularTo(axisVector)
282689
282736
  && vectorY.isPerpendicularTo(axisVector)
282690
- && _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(vectorX.magnitude(), 1.0)
282691
- && _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(vectorY.magnitude(), 1.0)) {
282737
+ && xySameLength
282738
+ && _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(xMag, 1.0)) {
282692
282739
  return {
282693
282740
  cylinder: {
282694
282741
  capped: data.capped,
282695
- start: data.getCenterA().toJSON(),
282696
- end: data.getCenterB().toJSON(),
282742
+ start: centerA.toJSON(),
282743
+ end: centerB.toJSON(),
282697
282744
  radius: radiusA,
282698
282745
  },
282699
282746
  };
282700
282747
  }
282748
+ const coneProps = {
282749
+ capped: data.capped,
282750
+ start: centerA.toJSON(),
282751
+ end: centerB.toJSON(),
282752
+ };
282753
+ if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(radiusA, radiusB)) {
282754
+ coneProps.radius = radiusA;
282755
+ }
282701
282756
  else {
282702
- const coneProps = {
282703
- capped: data.capped,
282704
- start: data.getCenterA().toJSON(),
282705
- end: data.getCenterB().toJSON(),
282706
- startRadius: data.getRadiusA(),
282707
- endRadius: data.getRadiusB(),
282708
- };
282709
- Writer.insertOrientationFromXYVectors(coneProps, vectorX, vectorY, false);
282710
- return { cone: coneProps };
282757
+ coneProps.startRadius = radiusA;
282758
+ coneProps.endRadius = radiusB;
282711
282759
  }
282760
+ // always specify an orthogonal frame for backwards compatibility
282761
+ Writer.insertOrientationFromXYVectors(coneProps, vectorX, vectorY, false);
282762
+ // specify a general matrix if elliptical sections
282763
+ const ellipticalSections = !xySameLength || !vectorX.isPerpendicularTo(vectorY, true);
282764
+ if (ellipticalSections)
282765
+ coneProps.xyzVectors = [vectorX.toJSON(), vectorY.toJSON(), axisVector.toJSON()];
282766
+ return { cone: coneProps };
282712
282767
  }
282713
282768
  /** Convert strongly typed instance to tagged json */
282714
282769
  handleSphere(data) {
282715
282770
  const xData = data.cloneVectorX().normalizeWithLength();
282716
282771
  const yData = data.cloneVectorY().normalizeWithLength();
282717
282772
  const zData = data.cloneVectorZ().normalizeWithLength();
282773
+ if (!xData.v || !yData.v || !zData.v)
282774
+ return undefined;
282775
+ const rigid = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createIdentity();
282776
+ const skew = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createIdentity();
282777
+ if (!data.cloneLocalToWorld().matrix.factorRigidSkew(rigid, skew))
282778
+ return undefined;
282779
+ const value = { center: data.cloneCenter().toJSON() };
282780
+ // always specify an orthogonal frame if !identity for backwards compatibility
282781
+ if (!rigid.isIdentity)
282782
+ value.zxVectors = [zData.v.toJSON(), xData.v.toJSON()];
282783
+ // specify a general matrix if skew/mirror local frame
282784
+ if (!skew.isDiagonal || skew.determinant() < 0.0)
282785
+ value.xyzVectors = [xData.v.toJSON(), yData.v.toJSON(), zData.v.toJSON()];
282718
282786
  const latitudeSweep = data.cloneLatitudeSweep();
282787
+ const fullSweep = latitudeSweep.isFullLatitudeSweep;
282788
+ if (data.capped && !fullSweep)
282789
+ value.capped = data.capped;
282790
+ if (!fullSweep)
282791
+ value.latitudeStartEnd = latitudeSweep.toJSON();
282719
282792
  const rX = xData.mag;
282720
282793
  const rY = yData.mag;
282721
282794
  const rZ = zData.mag;
282722
- if (xData.v && zData.v) {
282723
- const value = {
282724
- center: data.cloneCenter().toJSON(),
282725
- };
282726
- if (!(data.getConstructiveFrame()).matrix.isIdentity)
282727
- value.zxVectors = [zData.v.toJSON(), xData.v.toJSON()];
282728
- const fullSweep = latitudeSweep.isFullLatitudeSweep;
282729
- if (data.capped && !fullSweep)
282730
- value.capped = data.capped;
282731
- if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(rX, rY) && _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(rX, rZ))
282795
+ if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(rX, rY)) {
282796
+ if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(rX, rZ))
282732
282797
  value.radius = rX;
282733
- else {
282798
+ else { // radiusY will pick up radiusX
282734
282799
  value.radiusX = rX;
282735
- value.radiusY = rY;
282736
282800
  value.radiusZ = rZ;
282737
282801
  }
282738
- if (!fullSweep)
282739
- value.latitudeStartEnd = latitudeSweep.toJSON();
282740
- return { sphere: value };
282741
282802
  }
282742
- return undefined;
282803
+ else {
282804
+ value.radiusX = rX;
282805
+ value.radiusY = rY;
282806
+ value.radiusZ = rZ;
282807
+ }
282808
+ return { sphere: value };
282743
282809
  }
282744
282810
  /** Convert strongly typed instance to tagged json */
282745
282811
  handleTorusPipe(data) {
@@ -284117,20 +284183,31 @@ __webpack_require__.r(__webpack_exports__);
284117
284183
 
284118
284184
 
284119
284185
  /**
284120
- * A cone with axis along the z axis of a (possibly skewed) local coordinate system.
284121
- *
284122
- * * In local coordinates, the sections at z=0 and z=1 are circles of radius r0 and r1.
284123
- * * Either one individually may be zero, but they may not both be zero.
284124
- * * The stored matrix has unit vectors in the xy columns, and full-length z column.
284186
+ * A cone with axis along the z-axis of a (possibly skewed) local coordinate system.
284187
+ * * The curved surface of the cone `C` with axis `vectorZ = centerB - centerA` is parameterized over (u,v) in [0,1]x[0,1] by
284188
+ * `C(u,v) = centerA + vFractionToRadius(v) * (cos(u * 2pi) * vectorX + sin(u * 2pi) * vectorY) + v * vectorZ`.
284189
+ * * Either radius may be zero, but they may not both be zero.
284190
+ * * Cross section size is determined by the lengths of `vectorX`, `vectorY`, and the radii.
284191
+ * * If `vectorX` and `vectorY` are orthonormal, the cross sections are circular, with sections at v = 0 and v = 1 having radius
284192
+ * `radiusA` and `radiusB`, respectively; otherwise, the cross sections are elliptical.
284193
+ * * The stored matrix encapsulates `vectorX`, `vectorY`, and `vectorZ` in the respective columns. Typically the first two columns
284194
+ * are orthogonal and unit length, and the last is full length.
284195
+ * * Creating a Cone without orthogonal xy-axes of equal length is possible, but not recommended, for the resulting geometry
284196
+ * lacks portability; for example, such a Cone cannot be represented as a DGN element (see [[createDgnCone]]).
284125
284197
  * @public
284126
284198
  */
284127
284199
  class Cone extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
284128
284200
  /** String name for schema properties */
284129
284201
  solidPrimitiveType = "cone";
284130
- _localToWorld; // Transform from local to global.
284131
- _radiusA; // nominal radius at z=0. skewed axes may make it an ellipse
284132
- _radiusB; // radius at z=1. skewed axes may make it an ellipse
284133
- _maxRadius; // maximum radius anywhere on the cone.
284202
+ /** Local to world transform. Axes may have any nonzero length and may be non-perpendicular. */
284203
+ _localToWorld;
284204
+ /** Nominal cross sectional radius at z=0 (scales the cone's xy-axes). */
284205
+ _radiusA;
284206
+ /** Nominal cross sectional radius at z=1 (scales the cone's xy-axes). */
284207
+ _radiusB;
284208
+ /** Maximum of _radiusA and _radiusB. */
284209
+ _maxRadius;
284210
+ /** Constructor, inputs CONSUMED. */
284134
284211
  constructor(map, radiusA, radiusB, capped) {
284135
284212
  super(capped);
284136
284213
  this._localToWorld = map;
@@ -284168,10 +284245,11 @@ class Cone extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
284168
284245
  const result = this.clone();
284169
284246
  return result.tryTransformInPlace(transform) ? result : undefined;
284170
284247
  }
284171
- /** create a cylinder or cone from two endpoints and their radii. The circular cross sections are perpendicular to the axis line
284172
- * from start to end point.
284173
- * * both radii must be of the same sign.
284174
- * * negative radius is accepted to create interior surface. Downstream effects of that combined with capping may be a problem.
284248
+ /**
284249
+ * Create a right circular cylinder or cone from the given base centers and radii.
284250
+ * * The circular cross sections are perpendicular to the axis line between the centers.
284251
+ * * Both radii must be of the same sign, and at least one radius must be nonzero.
284252
+ * * Negative radii are accepted to create an interior surface, however the downstream effects of this, combined with capping, may be problematic.
284175
284253
  */
284176
284254
  static createAxisPoints(centerA, centerB, radiusA, radiusB, capped) {
284177
284255
  const zDirection = centerA.vectorTo(centerB);
@@ -284190,17 +284268,37 @@ class Cone extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
284190
284268
  const matrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidHeadsUp(zDirection);
284191
284269
  matrix.scaleColumns(1.0, 1.0, a, matrix);
284192
284270
  const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_3__.Transform.createOriginAndMatrix(centerA, matrix);
284193
- return new Cone(localToWorld, radiusA, radiusB, capped);
284271
+ return new Cone(localToWorld, radiusA, radiusB, capped ?? false);
284194
284272
  }
284195
- /** create a cylinder or cone from axis start and end with cross section defined by vectors that do not need to be perpendicular to each other or
284196
- * to the axis.
284273
+ /**
284274
+ * Create a general cone from cross sections parallel to the plane spanned by the given vectors.
284275
+ * * Circular cross sections are indicated by perpendicular vectors of the same length.
284276
+ * * Elliptical cross sections are indicated by non-perpendicular vectors, or vectors of different lengths.
284277
+ * * Cross sectional planes do not have to be perpendicular to the axis line between centers.
284278
+ * * Cross section size is affected both by the given vector lengths and radii. To avoid unexpected scaling,
284279
+ * pass orthonormal vectors for circular cross sections, or unit radii for elliptical cross sections.
284280
+ * * There is no validation of the input radii. For best results, they should be nonnegative, and at least one should be nonzero.
284197
284281
  */
284198
284282
  static createBaseAndTarget(centerA, centerB, vectorX, vectorY, radiusA, radiusB, capped) {
284199
284283
  radiusA = Math.abs(_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.correctSmallMetricDistance(radiusA));
284200
284284
  radiusB = Math.abs(_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.correctSmallMetricDistance(radiusB));
284201
284285
  const vectorZ = centerA.vectorTo(centerB);
284202
284286
  const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_3__.Transform.createOriginAndMatrixColumns(centerA, vectorX, vectorY, vectorZ);
284203
- return new Cone(localToWorld, radiusA, radiusB, capped);
284287
+ return new Cone(localToWorld, radiusA, radiusB, capped ?? false);
284288
+ }
284289
+ /**
284290
+ * Create a circular cone from the typical parameters of the DGN file.
284291
+ * * This method calls [[createBaseAndTarget]] with normalized vectors, `vectorY` squared against `vectorX`, and
284292
+ * `radiusA` and `radiusB` scaled by the original length of `vectorX`.
284293
+ * * These restrictions allow the cone to be represented by an element in the DGN file.
284294
+ */
284295
+ static createDgnCone(centerA, centerB, vectorX, vectorY, radiusA, radiusB, capped) {
284296
+ const rigidMatrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidFromColumns(vectorX, vectorY, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.XYZ);
284297
+ if (rigidMatrix) {
284298
+ const vectorXMag = vectorX.magnitude();
284299
+ return this.createBaseAndTarget(centerA, centerB, rigidMatrix.columnX(), rigidMatrix.columnY(), radiusA * vectorXMag, radiusB * vectorXMag, capped);
284300
+ }
284301
+ return undefined;
284204
284302
  }
284205
284303
  /** (Property accessor) Return the center point at the base plane */
284206
284304
  getCenterA() { return this._localToWorld.multiplyXYZ(0, 0, 0); }
@@ -284214,7 +284312,7 @@ class Cone extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
284214
284312
  getRadiusA() { return this._radiusA; }
284215
284313
  /** (Property accessor) return the radius at the top plane */
284216
284314
  getRadiusB() { return this._radiusB; }
284217
- /** (Property accessor) return the larger of the base and top plane radii */
284315
+ /** (Property accessor) return the larger of radiusA and radiusB */
284218
284316
  getMaxRadius() { return this._maxRadius; }
284219
284317
  /** (Property accessor) return the radius at fraction `v` along the axis */
284220
284318
  vFractionToRadius(v) { return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolate(this._radiusA, v, this._radiusB); }
@@ -285013,13 +285111,14 @@ __webpack_require__.r(__webpack_exports__);
285013
285111
  /* harmony export */ });
285014
285112
  /* harmony import */ var _curve_Arc3d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../curve/Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
285015
285113
  /* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
285016
- /* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
285114
+ /* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
285017
285115
  /* harmony import */ var _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../curve/StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
285018
285116
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
285117
+ /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
285019
285118
  /* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
285020
285119
  /* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
285021
- /* harmony import */ var _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndVectors */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndVectors.js");
285022
- /* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
285120
+ /* harmony import */ var _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndVectors */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndVectors.js");
285121
+ /* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
285023
285122
  /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
285024
285123
  /* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
285025
285124
  /* harmony import */ var _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SolidPrimitive */ "../../core/geometry/lib/esm/solid/SolidPrimitive.js");
@@ -285042,12 +285141,13 @@ __webpack_require__.r(__webpack_exports__);
285042
285141
 
285043
285142
 
285044
285143
 
285144
+
285045
285145
  /**
285046
- * A Sphere is
285047
- *
285048
- * * A unit sphere (but read on ....)
285049
- * * mapped by an arbitrary (possibly skewed, non-uniform scaled) transform
285050
- * * hence possibly the final geometry is ellipsoidal
285146
+ * A sphere mapped by an arbitrary transform.
285147
+ * * Typically, the stored matrix has orthogonal columns. In this case, if two columns have equal length, the
285148
+ * resulting geometry is ellipsoidal; if all three columns have equal length, the resulting geometry is a sphere.
285149
+ * * Creating a Sphere without orthogonal columns is possible, but not recommended, for the resulting geometry
285150
+ * lacks portability; for example, such a Sphere cannot be represented as a DGN element (see [[createDgnSphere]]).
285051
285151
  * @public
285052
285152
  */
285053
285153
  class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
@@ -285094,10 +285194,10 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
285094
285194
  const result = this.clone();
285095
285195
  return result.tryTransformInPlace(transform) ? result : undefined;
285096
285196
  }
285097
- /** Return a coordinate frame (right handed, unit axes)
285098
- * * origin at sphere center
285099
- * * equator in xy plane
285100
- * * z axis perpendicular
285197
+ /**
285198
+ * Construct a rigid coordinate frame from the local coordinate frame.
285199
+ * * The returned frame is right-handed, with perpendicular unit axes.
285200
+ * * Compare to [[cloneLocalToWorld]].
285101
285201
  */
285102
285202
  getConstructiveFrame() {
285103
285203
  return this._localToWorld.cloneRigid();
@@ -285105,30 +285205,37 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
285105
285205
  /** Return the latitude sweep as fraction of south pole to north pole. */
285106
285206
  get latitudeSweepFraction() { return this._latitudeSweep.sweepRadians / Math.PI; }
285107
285207
  /** Create from center and radius, with optional restricted latitudes. */
285108
- static createCenterRadius(center, radius, latitudeSweep) {
285208
+ static createCenterRadius(center, radius, latitudeSweep, capped) {
285109
285209
  const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__.Transform.createOriginAndMatrix(center, _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createUniformScale(radius));
285110
- return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.createFullLatitude(), false);
285210
+ return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.createFullLatitude(), capped ?? false);
285111
285211
  }
285112
285212
  /** Create an ellipsoid which is a unit sphere mapped to position by an (arbitrary, possibly skewed and scaled) transform. */
285113
285213
  static createEllipsoid(localToWorld, latitudeSweep, capped) {
285114
- return new Sphere(localToWorld.clone(), latitudeSweep.clone(), capped);
285214
+ return new Sphere(localToWorld.clone(), latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.createFullLatitude(), capped ?? false);
285115
285215
  }
285116
- /** Create a sphere from the typical parameters of the Dgn file */
285216
+ /**
285217
+ * Create a sphere from the typical parameters of the DGN file.
285218
+ * * This method normalizes the input vectors, squares `vectorX` against `vectorZ`, and scales the radii by the vectors' original lengths.
285219
+ * * These restrictions allow the sphere to be represented by an element in the DGN file.
285220
+ */
285117
285221
  static createDgnSphere(center, vectorX, vectorZ, radiusXY, radiusZ, latitudeSweep, capped) {
285118
- const vectorY = vectorX.rotate90Around(vectorZ);
285119
- if (vectorY && !vectorX.isParallelTo(vectorZ)) {
285120
- const matrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createColumns(vectorX, vectorY, vectorZ);
285121
- matrix.scaleColumns(radiusXY, radiusXY, radiusZ, matrix);
285122
- const frame = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__.Transform.createOriginAndMatrix(center, matrix);
285123
- return new Sphere(frame, latitudeSweep.clone(), capped);
285222
+ const rigidMatrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidFromColumns(vectorZ, vectorX, _Geometry__WEBPACK_IMPORTED_MODULE_4__.AxisOrder.ZXY);
285223
+ if (rigidMatrix) {
285224
+ radiusXY *= vectorX.magnitude();
285225
+ rigidMatrix.scaleColumns(radiusXY, radiusXY, radiusZ * vectorZ.magnitude(), rigidMatrix);
285226
+ const frame = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__.Transform.createOriginAndMatrix(center, rigidMatrix);
285227
+ return new Sphere(frame, latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.createFullLatitude(), capped ?? false);
285124
285228
  }
285125
285229
  return undefined;
285126
285230
  }
285127
- /** Create a sphere from the typical parameters of the Dgn file */
285231
+ /**
285232
+ * Create a sphere.
285233
+ * * If `axes` is supplied, its columns are scaled by the radii to form the sphere's local frame.
285234
+ */
285128
285235
  static createFromAxesAndScales(center, axes, radiusX, radiusY, radiusZ, latitudeSweep, capped) {
285129
285236
  const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__.Transform.createOriginAndMatrix(center, axes);
285130
285237
  localToWorld.matrix.scaleColumnsInPlace(radiusX, radiusY, radiusZ);
285131
- return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.createFullLatitude(), capped);
285238
+ return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.createFullLatitude(), capped ?? false);
285132
285239
  }
285133
285240
  /** return (copy of) sphere center */
285134
285241
  cloneCenter() { return this._localToWorld.getOrigin(); }
@@ -285158,8 +285265,11 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
285158
285265
  }
285159
285266
  /**
285160
285267
  * Return a (clone of) the sphere's local to world transformation.
285268
+ * * Compare to [[getConstructiveFrame]].
285161
285269
  */
285162
- cloneLocalToWorld() { return this._localToWorld.clone(); }
285270
+ cloneLocalToWorld() {
285271
+ return this._localToWorld.clone();
285272
+ }
285163
285273
  /** Test if `other` is a `Sphere` */
285164
285274
  isSameGeometryClass(other) { return other instanceof Sphere; }
285165
285275
  /** Test for same geometry in `other` */
@@ -285240,6 +285350,20 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
285240
285350
  dispatchToGeometryHandler(handler) {
285241
285351
  return handler.handleSphere(this);
285242
285352
  }
285353
+ /**
285354
+ * Return the Arc3d section at uFraction. For the sphere, this is a meridian arc.
285355
+ * @param uFraction fractional position along the equator.
285356
+ */
285357
+ constantUSection(uFraction) {
285358
+ const phi = _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_3__.AngleSweep.fractionToSignedPeriodicFractionStartEnd(uFraction, 0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_8__.Angle.pi2Radians, false);
285359
+ const s1 = Math.sin(phi);
285360
+ const c1 = Math.cos(phi);
285361
+ const transform = this._localToWorld;
285362
+ const center = transform.getOrigin();
285363
+ const vector0 = transform.matrix.multiplyXYZ(c1, s1, 0);
285364
+ const vector90 = transform.matrix.multiplyXYZ(0, 0, 1);
285365
+ return _curve_Arc3d__WEBPACK_IMPORTED_MODULE_9__.Arc3d.create(center, vector0, vector90, this._latitudeSweep);
285366
+ }
285243
285367
  /**
285244
285368
  * Return the Arc3d section at vFraction. For the sphere, this is a latitude circle.
285245
285369
  * @param vFraction fractional position along the sweep direction
@@ -285252,7 +285376,7 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
285252
285376
  const center = transform.multiplyXYZ(0, 0, s1);
285253
285377
  const vector0 = transform.matrix.multiplyXYZ(c1, 0, 0);
285254
285378
  const vector90 = transform.matrix.multiplyXYZ(0, c1, 0);
285255
- return _curve_Loop__WEBPACK_IMPORTED_MODULE_8__.Loop.create(_curve_Arc3d__WEBPACK_IMPORTED_MODULE_9__.Arc3d.create(center, vector0, vector90));
285379
+ return _curve_Loop__WEBPACK_IMPORTED_MODULE_10__.Loop.create(_curve_Arc3d__WEBPACK_IMPORTED_MODULE_9__.Arc3d.create(center, vector0, vector90));
285256
285380
  }
285257
285381
  /** Extend a range to contain this sphere. */
285258
285382
  extendRange(range, transform) {
@@ -285296,7 +285420,7 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
285296
285420
  const sinTheta = Math.sin(thetaRadians);
285297
285421
  const sinPhi = Math.sin(phiRadians);
285298
285422
  const cosPhi = Math.cos(phiRadians);
285299
- return _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_10__.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.
285423
+ 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.
285300
285424
  this._localToWorld.matrix.multiplyXYZ(-fPhi * cosTheta * sinPhi, -fPhi * sinTheta * sinPhi, fPhi * cosPhi), result);
285301
285425
  }
285302
285426
  /**
@@ -285323,7 +285447,7 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
285323
285447
  if (!this._latitudeSweep.isRadiansInSweep(0.0))
285324
285448
  dMaxU *= Math.max(Math.cos(Math.abs(this._latitudeSweep.startRadians)), Math.cos(Math.abs(this._latitudeSweep.endRadians)));
285325
285449
  const dMaxV = Math.max(rMaxU, rZ) * Math.abs(this._latitudeSweep.sweepRadians);
285326
- return _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_11__.Vector2d.create(dMaxU, dMaxV);
285450
+ return _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_12__.Vector2d.create(dMaxU, dMaxV);
285327
285451
  }
285328
285452
  }
285329
285453
 
@@ -314343,7 +314467,7 @@ class TestContext {
314343
314467
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
314344
314468
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
314345
314469
  await core_frontend_1.NoRenderApp.startup({
314346
- applicationVersion: "5.0.0-dev.82",
314470
+ applicationVersion: "5.0.0-dev.83",
314347
314471
  applicationId: this.settings.gprid,
314348
314472
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
314349
314473
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -340419,7 +340543,7 @@ function __rewriteRelativeImportExtension(path, preserveJsx) {
340419
340543
  /***/ ((module) => {
340420
340544
 
340421
340545
  "use strict";
340422
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.82","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"}}');
340546
+ 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"}}');
340423
340547
 
340424
340548
  /***/ }),
340425
340549