@itwin/ecschema-rpcinterface-tests 5.0.0-dev.93 → 5.0.0-dev.94
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 +726 -475
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -18479,11 +18479,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18479
18479
|
/* harmony export */ HttpStatus: () => (/* binding */ HttpStatus),
|
|
18480
18480
|
/* harmony export */ IModelHubStatus: () => (/* binding */ IModelHubStatus),
|
|
18481
18481
|
/* harmony export */ IModelStatus: () => (/* binding */ IModelStatus),
|
|
18482
|
+
/* harmony export */ ITwinError: () => (/* binding */ ITwinError),
|
|
18482
18483
|
/* harmony export */ RealityDataStatus: () => (/* binding */ RealityDataStatus),
|
|
18483
18484
|
/* harmony export */ RpcInterfaceStatus: () => (/* binding */ RpcInterfaceStatus)
|
|
18484
18485
|
/* harmony export */ });
|
|
18485
18486
|
/* harmony import */ var _BeSQLite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BeSQLite */ "../../core/bentley/lib/esm/BeSQLite.js");
|
|
18486
18487
|
/* harmony import */ var _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./internal/RepositoryStatus */ "../../core/bentley/lib/esm/internal/RepositoryStatus.js");
|
|
18488
|
+
/* harmony import */ var _JsonUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./JsonUtils */ "../../core/bentley/lib/esm/JsonUtils.js");
|
|
18487
18489
|
/*---------------------------------------------------------------------------------------------
|
|
18488
18490
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
18489
18491
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -18493,6 +18495,41 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18493
18495
|
*/
|
|
18494
18496
|
|
|
18495
18497
|
|
|
18498
|
+
|
|
18499
|
+
/** @beta */
|
|
18500
|
+
var ITwinError;
|
|
18501
|
+
(function (ITwinError) {
|
|
18502
|
+
/** Instantiate a new `ITwinError` or subtype thereof.
|
|
18503
|
+
* @see [[ITwinError.throwError]] to conveniently instantiate and throw the error.
|
|
18504
|
+
*/
|
|
18505
|
+
function create(args) {
|
|
18506
|
+
const err = new Error(args.message);
|
|
18507
|
+
Object.assign(err, args);
|
|
18508
|
+
err.name = args.iTwinErrorId.key; // helpful because this is used by `toString` for Error class
|
|
18509
|
+
return err;
|
|
18510
|
+
}
|
|
18511
|
+
ITwinError.create = create;
|
|
18512
|
+
/** Instantiate and immediately throw an `ITwinError`.
|
|
18513
|
+
* @see [[ITwinError.create]] to instantiate an error without throwing it.
|
|
18514
|
+
*/
|
|
18515
|
+
function throwError(args) {
|
|
18516
|
+
throw create(args);
|
|
18517
|
+
}
|
|
18518
|
+
ITwinError.throwError = throwError;
|
|
18519
|
+
/**
|
|
18520
|
+
* Determine whether an error object was thrown by iTwin.js and has a specific scope and key.
|
|
18521
|
+
*
|
|
18522
|
+
* If the test succeeds, the type of `error` is coerced to `T`
|
|
18523
|
+
* @param error The error to ve verified.
|
|
18524
|
+
* @param scope value for `error.iTwinErrorId.scope`
|
|
18525
|
+
* @param key value for `error.iTwinErrorId.key`
|
|
18526
|
+
*/
|
|
18527
|
+
function isError(error, scope, key) {
|
|
18528
|
+
return _JsonUtils__WEBPACK_IMPORTED_MODULE_2__.JsonUtils.isObject(error) && "iTwinErrorId" in error && _JsonUtils__WEBPACK_IMPORTED_MODULE_2__.JsonUtils.isObject(error.iTwinErrorId)
|
|
18529
|
+
&& error.iTwinErrorId.scope === scope && (undefined === key || error.iTwinErrorId.key === key);
|
|
18530
|
+
}
|
|
18531
|
+
ITwinError.isError = isError;
|
|
18532
|
+
})(ITwinError || (ITwinError = {}));
|
|
18496
18533
|
/** Standard status code.
|
|
18497
18534
|
* This status code should be rarely used.
|
|
18498
18535
|
* Prefer to throw an exception to indicate an error, rather than returning a special status code.
|
|
@@ -18782,14 +18819,14 @@ var RealityDataStatus;
|
|
|
18782
18819
|
RealityDataStatus[RealityDataStatus["REALITYDATA_ERROR_BASE"] = 151552] = "REALITYDATA_ERROR_BASE";
|
|
18783
18820
|
RealityDataStatus[RealityDataStatus["InvalidData"] = 151553] = "InvalidData";
|
|
18784
18821
|
})(RealityDataStatus || (RealityDataStatus = {}));
|
|
18785
|
-
|
|
18786
|
-
|
|
18787
|
-
|
|
18788
|
-
/** Base exception class for iTwin.js exceptions.
|
|
18822
|
+
/**
|
|
18823
|
+
* Base exception class for legacy iTwin.js errors.
|
|
18824
|
+
* For backwards compatibility only. Do not create new subclasses of BentleyError. Instead use [[ITwinError]].
|
|
18789
18825
|
* @public
|
|
18790
18826
|
*/
|
|
18791
18827
|
class BentleyError extends Error {
|
|
18792
18828
|
errorNumber;
|
|
18829
|
+
static iTwinErrorScope = "bentley-error";
|
|
18793
18830
|
_metaData;
|
|
18794
18831
|
/**
|
|
18795
18832
|
* @param errorNumber The a number that identifies of the problem.
|
|
@@ -18803,6 +18840,23 @@ class BentleyError extends Error {
|
|
|
18803
18840
|
this._metaData = metaData;
|
|
18804
18841
|
this.name = this._initName();
|
|
18805
18842
|
}
|
|
18843
|
+
/** supply the value for iTwinErrorId */
|
|
18844
|
+
get iTwinErrorId() {
|
|
18845
|
+
return { scope: BentleyError.iTwinErrorScope, key: this.name };
|
|
18846
|
+
}
|
|
18847
|
+
/** value for logging metadata */
|
|
18848
|
+
get loggingMetadata() { return this.getMetaData(); }
|
|
18849
|
+
/**
|
|
18850
|
+
* Determine if an error object implements the `LegacyITwinErrorWithNumber` interface.
|
|
18851
|
+
*
|
|
18852
|
+
* If the test succeeds, the type of `error` is coerced to `T`
|
|
18853
|
+
* @note this method does *not* test that the object is an `instanceOf BentleyError`.
|
|
18854
|
+
* @beta
|
|
18855
|
+
*/
|
|
18856
|
+
static isError(error, errorNumber) {
|
|
18857
|
+
return ITwinError.isError(error, BentleyError.iTwinErrorScope) &&
|
|
18858
|
+
typeof error.errorNumber === "number" && (errorNumber === undefined || error.errorNumber === errorNumber);
|
|
18859
|
+
}
|
|
18806
18860
|
/** Returns true if this BentleyError includes (optional) metadata. */
|
|
18807
18861
|
get hasMetaData() { return undefined !== this._metaData; }
|
|
18808
18862
|
/** get the meta data associated with this BentleyError, if any. */
|
|
@@ -18815,7 +18869,11 @@ class BentleyError extends Error {
|
|
|
18815
18869
|
}
|
|
18816
18870
|
/** This function returns the name of each error status. Override this method to handle more error status codes. */
|
|
18817
18871
|
_initName() {
|
|
18818
|
-
|
|
18872
|
+
return BentleyError.getErrorKey(this.errorNumber);
|
|
18873
|
+
}
|
|
18874
|
+
/** This function returns the name of each error status. */
|
|
18875
|
+
static getErrorKey(errorNumber) {
|
|
18876
|
+
switch (errorNumber) {
|
|
18819
18877
|
case IModelStatus.AlreadyLoaded: return "Already Loaded";
|
|
18820
18878
|
case IModelStatus.AlreadyOpen: return "Already Open";
|
|
18821
18879
|
case IModelStatus.BadArg: return "Bad Arg";
|
|
@@ -19090,7 +19148,7 @@ class BentleyError extends Error {
|
|
|
19090
19148
|
case BentleyStatus.SUCCESS:
|
|
19091
19149
|
return "Success";
|
|
19092
19150
|
default:
|
|
19093
|
-
return `Error (${
|
|
19151
|
+
return `Error (${errorNumber})`;
|
|
19094
19152
|
}
|
|
19095
19153
|
}
|
|
19096
19154
|
/** Use run-time type checking to safely get a useful string summary of an unknown error value, or `""` if none exists.
|
|
@@ -19102,7 +19160,7 @@ class BentleyError extends Error {
|
|
|
19102
19160
|
return error;
|
|
19103
19161
|
if (error instanceof Error)
|
|
19104
19162
|
return error.toString();
|
|
19105
|
-
if (isObject(error)) {
|
|
19163
|
+
if (_JsonUtils__WEBPACK_IMPORTED_MODULE_2__.JsonUtils.isObject(error)) {
|
|
19106
19164
|
if (typeof error.message === "string")
|
|
19107
19165
|
return error.message;
|
|
19108
19166
|
if (typeof error.msg === "string")
|
|
@@ -19118,7 +19176,7 @@ class BentleyError extends Error {
|
|
|
19118
19176
|
* @public
|
|
19119
19177
|
*/
|
|
19120
19178
|
static getErrorStack(error) {
|
|
19121
|
-
if (isObject(error) && typeof error.stack === "string")
|
|
19179
|
+
if (_JsonUtils__WEBPACK_IMPORTED_MODULE_2__.JsonUtils.isObject(error) && typeof error.stack === "string")
|
|
19122
19180
|
return error.stack;
|
|
19123
19181
|
return undefined;
|
|
19124
19182
|
}
|
|
@@ -19128,7 +19186,7 @@ class BentleyError extends Error {
|
|
|
19128
19186
|
* @public
|
|
19129
19187
|
*/
|
|
19130
19188
|
static getErrorMetadata(error) {
|
|
19131
|
-
if (isObject(error) && typeof error.getMetaData === "function") {
|
|
19189
|
+
if (_JsonUtils__WEBPACK_IMPORTED_MODULE_2__.JsonUtils.isObject(error) && typeof error.getMetaData === "function") {
|
|
19132
19190
|
const metadata = error.getMetaData();
|
|
19133
19191
|
if (typeof metadata === "object" && metadata !== null)
|
|
19134
19192
|
return metadata;
|
|
@@ -21292,12 +21350,17 @@ var JsonUtils;
|
|
|
21292
21350
|
json[key] = val;
|
|
21293
21351
|
}
|
|
21294
21352
|
JsonUtils.setOrRemoveBoolean = setOrRemoveBoolean;
|
|
21353
|
+
/** Returns `true` if `json` is a non-null object. */
|
|
21354
|
+
function isObject(json) {
|
|
21355
|
+
return json !== null && "object" === typeof json;
|
|
21356
|
+
}
|
|
21357
|
+
JsonUtils.isObject = isObject;
|
|
21295
21358
|
/** Determine if a Javascript object is equivalent to `{}`.
|
|
21296
21359
|
* @param json The JSON object to test.
|
|
21297
21360
|
* @returns true if `json` is an Object with no keys.
|
|
21298
21361
|
*/
|
|
21299
21362
|
function isEmptyObject(json) {
|
|
21300
|
-
return
|
|
21363
|
+
return isObject(json) && 0 === Object.keys(json).length;
|
|
21301
21364
|
}
|
|
21302
21365
|
JsonUtils.isEmptyObject = isEmptyObject;
|
|
21303
21366
|
/** Determine if the input is undefined or an empty Javascript object.
|
|
@@ -21941,14 +22004,19 @@ class Logger {
|
|
|
21941
22004
|
const stack = Logger.logExceptionCallstacks ? `\n${_BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.getErrorStack(err)}` : "";
|
|
21942
22005
|
return _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.getErrorMessage(err) + stack;
|
|
21943
22006
|
}
|
|
21944
|
-
/** Log the specified exception.
|
|
22007
|
+
/** Log the specified exception.
|
|
22008
|
+
* For legacy [[BentleyError]] exceptions, the special "exceptionType" property will be added as metadata. Otherwise, all enumerable members of the exception are logged as metadata.
|
|
21945
22009
|
* @param category The category of the message.
|
|
21946
22010
|
* @param err The exception object.
|
|
21947
22011
|
* @param log The logger output function to use - defaults to Logger.logError
|
|
21948
22012
|
*/
|
|
21949
22013
|
static logException(category, err, log = (_category, message, metaData) => Logger.logError(_category, message, metaData)) {
|
|
21950
22014
|
log(category, Logger.getExceptionMessage(err), () => {
|
|
21951
|
-
|
|
22015
|
+
// For backwards compatibility, log BentleyError old way
|
|
22016
|
+
if (_BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.isError(err))
|
|
22017
|
+
return { ..._BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.getErrorMetadata(err), exceptionType: err?.constructor?.name ?? "<Unknown>" };
|
|
22018
|
+
// return a copy of the error, with non-enumerable members `message` and `stack` removed, as "metadata" for log.
|
|
22019
|
+
return { ...err };
|
|
21952
22020
|
});
|
|
21953
22021
|
}
|
|
21954
22022
|
/** Log the specified message to the **warning** stream.
|
|
@@ -24467,6 +24535,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
24467
24535
|
/* harmony export */ HttpStatus: () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.HttpStatus),
|
|
24468
24536
|
/* harmony export */ IModelHubStatus: () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.IModelHubStatus),
|
|
24469
24537
|
/* harmony export */ IModelStatus: () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.IModelStatus),
|
|
24538
|
+
/* harmony export */ ITwinError: () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.ITwinError),
|
|
24470
24539
|
/* harmony export */ Id64: () => (/* reexport safe */ _Id__WEBPACK_IMPORTED_MODULE_13__.Id64),
|
|
24471
24540
|
/* harmony export */ IndexMap: () => (/* reexport safe */ _IndexMap__WEBPACK_IMPORTED_MODULE_14__.IndexMap),
|
|
24472
24541
|
/* harmony export */ IndexedValue: () => (/* reexport safe */ _IndexMap__WEBPACK_IMPORTED_MODULE_14__.IndexedValue),
|
|
@@ -34370,7 +34439,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34370
34439
|
*/
|
|
34371
34440
|
|
|
34372
34441
|
/** The error type thrown by this module.
|
|
34373
|
-
* Creating subclasses of IModelError should be avoided. Instead use [[ITwinError]].
|
|
34374
34442
|
* @see [[ITwinError]]
|
|
34375
34443
|
* @see [[IModelErrorNumber]] for commonly-used error codes.
|
|
34376
34444
|
* @public
|
|
@@ -34397,12 +34465,14 @@ var LockState;
|
|
|
34397
34465
|
/**
|
|
34398
34466
|
* An error raised when there is a lock conflict detected.
|
|
34399
34467
|
* Typically this error would be thrown by [LockControl.acquireLocks]($backend) when you are requesting a lock on an element that is already held by another briefcase.
|
|
34400
|
-
* @public
|
|
34468
|
+
* @public
|
|
34401
34469
|
*/
|
|
34402
34470
|
class ConflictingLocksError extends IModelError {
|
|
34403
|
-
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
34404
34471
|
conflictingLocks;
|
|
34405
|
-
|
|
34472
|
+
/** @beta */
|
|
34473
|
+
static isError(error) {
|
|
34474
|
+
return _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyError.isError(error, _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.IModelHubStatus.LockOwnedByAnotherBriefcase);
|
|
34475
|
+
}
|
|
34406
34476
|
constructor(message, getMetaData, conflictingLocks) {
|
|
34407
34477
|
super(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.IModelHubStatus.LockOwnedByAnotherBriefcase, message, getMetaData);
|
|
34408
34478
|
this.conflictingLocks = conflictingLocks;
|
|
@@ -34535,24 +34605,18 @@ class IModelVersion {
|
|
|
34535
34605
|
|
|
34536
34606
|
/***/ }),
|
|
34537
34607
|
|
|
34538
|
-
/***/ "../../core/common/lib/esm/
|
|
34539
|
-
|
|
34540
|
-
!*** ../../core/common/lib/esm/
|
|
34541
|
-
|
|
34608
|
+
/***/ "../../core/common/lib/esm/ITwinCoreErrors.js":
|
|
34609
|
+
/*!****************************************************!*\
|
|
34610
|
+
!*** ../../core/common/lib/esm/ITwinCoreErrors.js ***!
|
|
34611
|
+
\****************************************************/
|
|
34542
34612
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
34543
34613
|
|
|
34544
34614
|
"use strict";
|
|
34545
34615
|
__webpack_require__.r(__webpack_exports__);
|
|
34546
34616
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
34547
|
-
/* harmony export */
|
|
34548
|
-
/* harmony export */ constructITwinError: () => (/* binding */ constructITwinError),
|
|
34549
|
-
/* harmony export */ createITwinErrorTypeAsserter: () => (/* binding */ createITwinErrorTypeAsserter),
|
|
34550
|
-
/* harmony export */ getITwinErrorMetaData: () => (/* binding */ getITwinErrorMetaData),
|
|
34551
|
-
/* harmony export */ iTwinErrorKeys: () => (/* binding */ iTwinErrorKeys),
|
|
34552
|
-
/* harmony export */ iTwinErrorMessages: () => (/* binding */ iTwinErrorMessages),
|
|
34553
|
-
/* harmony export */ iTwinjsCoreNamespace: () => (/* binding */ iTwinjsCoreNamespace),
|
|
34554
|
-
/* harmony export */ isITwinError: () => (/* binding */ isITwinError)
|
|
34617
|
+
/* harmony export */ ChannelError: () => (/* binding */ ChannelError)
|
|
34555
34618
|
/* harmony export */ });
|
|
34619
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
34556
34620
|
/*---------------------------------------------------------------------------------------------
|
|
34557
34621
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
34558
34622
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -34560,93 +34624,23 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
34560
34624
|
/** @packageDocumentation
|
|
34561
34625
|
* @module iModels
|
|
34562
34626
|
*/
|
|
34563
|
-
|
|
34564
|
-
|
|
34565
|
-
|
|
34566
|
-
|
|
34567
|
-
|
|
34568
|
-
|
|
34569
|
-
|
|
34570
|
-
|
|
34571
|
-
|
|
34572
|
-
|
|
34573
|
-
|
|
34574
|
-
|
|
34575
|
-
|
|
34576
|
-
|
|
34577
|
-
}
|
|
34578
|
-
|
|
34579
|
-
|
|
34580
|
-
* @beta
|
|
34581
|
-
*/
|
|
34582
|
-
const iTwinErrorMessages = {
|
|
34583
|
-
"inUseLocks": () => 'Objects are locked by another briefcase',
|
|
34584
|
-
"channelNest": (id) => `Channel ${id} may not nest`,
|
|
34585
|
-
"channelNotAllowed": (id) => `Channel ${id} is not allowed`,
|
|
34586
|
-
"channelRootExists": (id) => `Channel ${id} root already exist`,
|
|
34587
|
-
};
|
|
34588
|
-
/**
|
|
34589
|
-
* A function which will be used to construct an [[ITwinError]].
|
|
34590
|
-
* @param namespace The namespace associated with the error.
|
|
34591
|
-
* @param errorKey The errorKey associated with the error.
|
|
34592
|
-
* @param message The message associated with the error.
|
|
34593
|
-
* @param metadata Metadata associated with the error.
|
|
34594
|
-
* @beta
|
|
34595
|
-
*/
|
|
34596
|
-
function constructITwinError(namespace, errorKey, message, metadata) {
|
|
34597
|
-
const error = new Error();
|
|
34598
|
-
error.message = message ?? `${errorKey} occurred`;
|
|
34599
|
-
error.name = `${namespace}:${errorKey}`;
|
|
34600
|
-
error.namespace = namespace;
|
|
34601
|
-
error.errorKey = errorKey;
|
|
34602
|
-
error.metadata = metadata;
|
|
34603
|
-
Error.captureStackTrace(error, constructITwinError); // Optional, but this would hide constructITwinError from stack.
|
|
34604
|
-
return error;
|
|
34605
|
-
}
|
|
34606
|
-
/**
|
|
34607
|
-
* A function which constructs a detailed error for example [[ InUseLocksError ]] above.
|
|
34608
|
-
* @param namespace The namespace associated with the error.
|
|
34609
|
-
* @param errorKey The errorKey associated with the error.
|
|
34610
|
-
* @param details Other details associated with the error.
|
|
34611
|
-
* @param message The message associated with the error.
|
|
34612
|
-
* @param metadata Metadata associated with the error.
|
|
34613
|
-
* @beta
|
|
34614
|
-
*/
|
|
34615
|
-
function constructDetailedError(namespace, errorKey, details, message, metadata) {
|
|
34616
|
-
const baseError = constructITwinError(namespace, errorKey, message, metadata);
|
|
34617
|
-
Error.captureStackTrace(baseError, constructDetailedError); // Optional, but this would hide constructDetailedError from stack.
|
|
34618
|
-
return Object.assign(baseError, details);
|
|
34619
|
-
}
|
|
34620
|
-
/**
|
|
34621
|
-
* a high level function that returns a type asserter function which would return whether or not the passed in parameter is an [[ITwinError]]
|
|
34622
|
-
* @param namespace The namespace associated with the error.
|
|
34623
|
-
* @param errorKey The errorKey associated with the error.
|
|
34624
|
-
* @beta
|
|
34625
|
-
*/
|
|
34626
|
-
function createITwinErrorTypeAsserter(namespace, errorKey) {
|
|
34627
|
-
return (error) => isITwinError(error, namespace, errorKey);
|
|
34628
|
-
}
|
|
34629
|
-
/**
|
|
34630
|
-
* get the meta data associated with this ITwinError, if any.
|
|
34631
|
-
* @param error The error for which metadata is required.
|
|
34632
|
-
* @beta
|
|
34633
|
-
*/
|
|
34634
|
-
function getITwinErrorMetaData(error) {
|
|
34635
|
-
return (typeof error.metadata === "function") ? error.metadata() : error.metadata;
|
|
34636
|
-
}
|
|
34637
|
-
/**
|
|
34638
|
-
* type guard function that returns whether or not the passed in parameter is an [[ITwinError]]
|
|
34639
|
-
* @param error The error which is to ve verified.
|
|
34640
|
-
* @param namespace The namespace associated with the error.
|
|
34641
|
-
* @param errorKey The errorKey associated with the error.
|
|
34642
|
-
* @beta
|
|
34643
|
-
*/
|
|
34644
|
-
function isITwinError(error, namespace, errorKey) {
|
|
34645
|
-
return error !== undefined && error !== null && typeof error === "object"
|
|
34646
|
-
&& "namespace" in error && "errorKey" in error && "message" in error
|
|
34647
|
-
&& (namespace === undefined || error.namespace === namespace)
|
|
34648
|
-
&& (errorKey === undefined || error.errorKey === errorKey);
|
|
34649
|
-
}
|
|
34627
|
+
|
|
34628
|
+
/** @beta */
|
|
34629
|
+
var ChannelError;
|
|
34630
|
+
(function (ChannelError) {
|
|
34631
|
+
// the scope for all `ChannelError`s.
|
|
34632
|
+
ChannelError.scope = "itwin-channel-errors";
|
|
34633
|
+
/** Instantiate and throw a ChannelError */
|
|
34634
|
+
function throwError(key, message, channelKey) {
|
|
34635
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.ITwinError.throwError({ iTwinErrorId: { scope: ChannelError.scope, key }, message, channelKey });
|
|
34636
|
+
}
|
|
34637
|
+
ChannelError.throwError = throwError;
|
|
34638
|
+
/** Determine whether an error object is a ChannelError */
|
|
34639
|
+
function isError(error, key) {
|
|
34640
|
+
return _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.ITwinError.isError(error, ChannelError.scope, key) && typeof error.channelKey === "string";
|
|
34641
|
+
}
|
|
34642
|
+
ChannelError.isError = isError;
|
|
34643
|
+
})(ChannelError || (ChannelError = {}));
|
|
34650
34644
|
|
|
34651
34645
|
|
|
34652
34646
|
/***/ }),
|
|
@@ -43763,9 +43757,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43763
43757
|
/* harmony export */ Cartographic: () => (/* reexport safe */ _geometry_Cartographic__WEBPACK_IMPORTED_MODULE_44__.Cartographic),
|
|
43764
43758
|
/* harmony export */ CartographicRange: () => (/* reexport safe */ _geometry_Cartographic__WEBPACK_IMPORTED_MODULE_44__.CartographicRange),
|
|
43765
43759
|
/* harmony export */ CesiumTerrainAssetId: () => (/* reexport safe */ _TerrainSettings__WEBPACK_IMPORTED_MODULE_108__.CesiumTerrainAssetId),
|
|
43766
|
-
/* harmony export */ ChangeOpCode: () => (/* reexport safe */
|
|
43767
|
-
/* harmony export */ ChangedValueState: () => (/* reexport safe */
|
|
43760
|
+
/* harmony export */ ChangeOpCode: () => (/* reexport safe */ _ECSqlTypes__WEBPACK_IMPORTED_MODULE_27__.ChangeOpCode),
|
|
43761
|
+
/* harmony export */ ChangedValueState: () => (/* reexport safe */ _ECSqlTypes__WEBPACK_IMPORTED_MODULE_27__.ChangedValueState),
|
|
43768
43762
|
/* harmony export */ ChangesetType: () => (/* reexport safe */ _ChangesetProps__WEBPACK_IMPORTED_MODULE_16__.ChangesetType),
|
|
43763
|
+
/* harmony export */ ChannelError: () => (/* reexport safe */ _ITwinCoreErrors__WEBPACK_IMPORTED_MODULE_70__.ChannelError),
|
|
43769
43764
|
/* harmony export */ ClipIntersectionStyle: () => (/* reexport safe */ _ClipStyle__WEBPACK_IMPORTED_MODULE_17__.ClipIntersectionStyle),
|
|
43770
43765
|
/* harmony export */ ClipStyle: () => (/* reexport safe */ _ClipStyle__WEBPACK_IMPORTED_MODULE_17__.ClipStyle),
|
|
43771
43766
|
/* harmony export */ Code: () => (/* reexport safe */ _Code__WEBPACK_IMPORTED_MODULE_18__.Code),
|
|
@@ -43800,10 +43795,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
43800
43795
|
/* harmony export */ DisplayStyle3dSettings: () => (/* reexport safe */ _DisplayStyleSettings__WEBPACK_IMPORTED_MODULE_23__.DisplayStyle3dSettings),
|
|
43801
43796
|
/* harmony export */ DisplayStyleSettings: () => (/* reexport safe */ _DisplayStyleSettings__WEBPACK_IMPORTED_MODULE_23__.DisplayStyleSettings),
|
|
43802
43797
|
/* harmony export */ DomainOptions: () => (/* reexport safe */ _BriefcaseTypes__WEBPACK_IMPORTED_MODULE_12__.DomainOptions),
|
|
43803
|
-
/* harmony export */ ECJsNames: () => (/* reexport safe */
|
|
43798
|
+
/* harmony export */ ECJsNames: () => (/* reexport safe */ _ECSqlTypes__WEBPACK_IMPORTED_MODULE_27__.ECJsNames),
|
|
43804
43799
|
/* harmony export */ ECSqlReader: () => (/* reexport safe */ _ECSqlReader__WEBPACK_IMPORTED_MODULE_88__.ECSqlReader),
|
|
43805
|
-
/* harmony export */ ECSqlSystemProperty: () => (/* reexport safe */
|
|
43806
|
-
/* harmony export */ ECSqlValueType: () => (/* reexport safe */
|
|
43800
|
+
/* harmony export */ ECSqlSystemProperty: () => (/* reexport safe */ _ECSqlTypes__WEBPACK_IMPORTED_MODULE_27__.ECSqlSystemProperty),
|
|
43801
|
+
/* harmony export */ ECSqlValueType: () => (/* reexport safe */ _ECSqlTypes__WEBPACK_IMPORTED_MODULE_27__.ECSqlValueType),
|
|
43807
43802
|
/* harmony export */ Easing: () => (/* reexport safe */ _Tween__WEBPACK_IMPORTED_MODULE_115__.Easing),
|
|
43808
43803
|
/* harmony export */ EcefLocation: () => (/* reexport safe */ _IModel__WEBPACK_IMPORTED_MODULE_67__.EcefLocation),
|
|
43809
43804
|
/* harmony export */ EdgeArgs: () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_158__.EdgeArgs),
|
|
@@ -44089,24 +44084,16 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
44089
44084
|
/* harmony export */ computeChildTileProps: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.computeChildTileProps),
|
|
44090
44085
|
/* harmony export */ computeChildTileRanges: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.computeChildTileRanges),
|
|
44091
44086
|
/* harmony export */ computeTileChordTolerance: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.computeTileChordTolerance),
|
|
44092
|
-
/* harmony export */ constructDetailedError: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.constructDetailedError),
|
|
44093
|
-
/* harmony export */ constructITwinError: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.constructITwinError),
|
|
44094
|
-
/* harmony export */ createITwinErrorTypeAsserter: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.createITwinErrorTypeAsserter),
|
|
44095
44087
|
/* harmony export */ decodeTileContentDescription: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.decodeTileContentDescription),
|
|
44096
44088
|
/* harmony export */ defaultTileOptions: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.defaultTileOptions),
|
|
44097
|
-
/* harmony export */ getITwinErrorMetaData: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.getITwinErrorMetaData),
|
|
44098
44089
|
/* harmony export */ getMaximumMajorTileFormatVersion: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.getMaximumMajorTileFormatVersion),
|
|
44099
44090
|
/* harmony export */ getPullChangesIpcChannel: () => (/* reexport safe */ _IpcAppProps__WEBPACK_IMPORTED_MODULE_75__.getPullChangesIpcChannel),
|
|
44100
44091
|
/* harmony export */ getTileObjectReference: () => (/* reexport safe */ _TileProps__WEBPACK_IMPORTED_MODULE_114__.getTileObjectReference),
|
|
44101
44092
|
/* harmony export */ iModelTileTreeIdToString: () => (/* reexport safe */ _tile_TileMetadata__WEBPACK_IMPORTED_MODULE_155__.iModelTileTreeIdToString),
|
|
44102
44093
|
/* harmony export */ iTwinChannel: () => (/* reexport safe */ _ipc_IpcSocket__WEBPACK_IMPORTED_MODULE_71__.iTwinChannel),
|
|
44103
|
-
/* harmony export */ iTwinErrorKeys: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.iTwinErrorKeys),
|
|
44104
|
-
/* harmony export */ iTwinErrorMessages: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.iTwinErrorMessages),
|
|
44105
|
-
/* harmony export */ iTwinjsCoreNamespace: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.iTwinjsCoreNamespace),
|
|
44106
44094
|
/* harmony export */ initializeRpcRequest: () => (/* reexport safe */ _rpc_core_RpcRequest__WEBPACK_IMPORTED_MODULE_129__.initializeRpcRequest),
|
|
44107
44095
|
/* harmony export */ ipcAppChannels: () => (/* reexport safe */ _IpcAppProps__WEBPACK_IMPORTED_MODULE_75__.ipcAppChannels),
|
|
44108
44096
|
/* harmony export */ isBinaryImageSource: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_66__.isBinaryImageSource),
|
|
44109
|
-
/* harmony export */ isITwinError: () => (/* reexport safe */ _ITwinError__WEBPACK_IMPORTED_MODULE_70__.isITwinError),
|
|
44110
44097
|
/* harmony export */ isKnownTileFormat: () => (/* reexport safe */ _tile_TileIO__WEBPACK_IMPORTED_MODULE_154__.isKnownTileFormat),
|
|
44111
44098
|
/* harmony export */ isPlacement2dProps: () => (/* reexport safe */ _ElementProps__WEBPACK_IMPORTED_MODULE_29__.isPlacement2dProps),
|
|
44112
44099
|
/* harmony export */ isPlacement3dProps: () => (/* reexport safe */ _ElementProps__WEBPACK_IMPORTED_MODULE_29__.isPlacement3dProps),
|
|
@@ -44148,8 +44135,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
44148
44135
|
/* harmony import */ var _DisplayStyleSettings__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./DisplayStyleSettings */ "../../core/common/lib/esm/DisplayStyleSettings.js");
|
|
44149
44136
|
/* harmony import */ var _domains_FunctionalElementProps__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./domains/FunctionalElementProps */ "../../core/common/lib/esm/domains/FunctionalElementProps.js");
|
|
44150
44137
|
/* harmony import */ var _domains_GenericElementProps__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./domains/GenericElementProps */ "../../core/common/lib/esm/domains/GenericElementProps.js");
|
|
44151
|
-
/* harmony import */ var
|
|
44152
|
-
/* harmony import */ var
|
|
44138
|
+
/* harmony import */ var _ECSchemaProps__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./ECSchemaProps */ "../../core/common/lib/esm/ECSchemaProps.js");
|
|
44139
|
+
/* harmony import */ var _ECSqlTypes__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./ECSqlTypes */ "../../core/common/lib/esm/ECSqlTypes.js");
|
|
44153
44140
|
/* harmony import */ var _ElementMesh__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./ElementMesh */ "../../core/common/lib/esm/ElementMesh.js");
|
|
44154
44141
|
/* harmony import */ var _ElementProps__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./ElementProps */ "../../core/common/lib/esm/ElementProps.js");
|
|
44155
44142
|
/* harmony import */ var _EmphasizeElementsProps__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./EmphasizeElementsProps */ "../../core/common/lib/esm/EmphasizeElementsProps.js");
|
|
@@ -44192,7 +44179,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
44192
44179
|
/* harmony import */ var _IModel__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./IModel */ "../../core/common/lib/esm/IModel.js");
|
|
44193
44180
|
/* harmony import */ var _IModelError__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./IModelError */ "../../core/common/lib/esm/IModelError.js");
|
|
44194
44181
|
/* harmony import */ var _IModelVersion__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./IModelVersion */ "../../core/common/lib/esm/IModelVersion.js");
|
|
44195
|
-
/* harmony import */ var
|
|
44182
|
+
/* harmony import */ var _ITwinCoreErrors__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./ITwinCoreErrors */ "../../core/common/lib/esm/ITwinCoreErrors.js");
|
|
44196
44183
|
/* harmony import */ var _ipc_IpcSocket__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./ipc/IpcSocket */ "../../core/common/lib/esm/ipc/IpcSocket.js");
|
|
44197
44184
|
/* harmony import */ var _ipc_IpcWebSocket__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./ipc/IpcWebSocket */ "../../core/common/lib/esm/ipc/IpcWebSocket.js");
|
|
44198
44185
|
/* harmony import */ var _ipc_IpcWebSocketTransport__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./ipc/IpcWebSocketTransport */ "../../core/common/lib/esm/ipc/IpcWebSocketTransport.js");
|
|
@@ -84620,8 +84607,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
84620
84607
|
/* harmony export */ });
|
|
84621
84608
|
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
84622
84609
|
/* harmony import */ var _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-common */ "../../core/common/lib/esm/core-common.js");
|
|
84623
|
-
/* harmony import */ var
|
|
84624
|
-
/* harmony import */ var
|
|
84610
|
+
/* harmony import */ var _common_internal_Symbols__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./common/internal/Symbols */ "../../core/frontend/lib/esm/common/internal/Symbols.js");
|
|
84611
|
+
/* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
|
|
84625
84612
|
/*---------------------------------------------------------------------------------------------
|
|
84626
84613
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
84627
84614
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -84691,32 +84678,32 @@ class IpcApp {
|
|
|
84691
84678
|
* @param methodName the name of a method implemented by the backend handler.
|
|
84692
84679
|
* @param args arguments to `methodName`
|
|
84693
84680
|
* @return a Promise with the return value from `methodName`
|
|
84694
|
-
* @note If the backend implementation throws an exception, this method will throw
|
|
84695
|
-
* with the `errorNumber` and `message` from the backend.
|
|
84696
|
-
* @note Ipc is only supported if [[isValid]] is true.
|
|
84681
|
+
* @note If the backend implementation throws an exception, this method will throw an exception with its contents
|
|
84697
84682
|
* @internal Use [[makeIpcProxy]] for a type-safe interface.
|
|
84698
84683
|
*/
|
|
84699
|
-
static async [
|
|
84684
|
+
static async [_common_internal_Symbols__WEBPACK_IMPORTED_MODULE_2__._callIpcChannel](channelName, methodName, ...args) {
|
|
84700
84685
|
const retVal = (await this.invoke(channelName, methodName, ...args));
|
|
84701
|
-
if (
|
|
84702
|
-
|
|
84703
|
-
|
|
84704
|
-
|
|
84705
|
-
|
|
84706
|
-
|
|
84707
|
-
|
|
84708
|
-
|
|
84709
|
-
|
|
84710
|
-
|
|
84711
|
-
throw err;
|
|
84712
|
-
}
|
|
84713
|
-
|
|
84686
|
+
if (retVal.error === undefined)
|
|
84687
|
+
return retVal.result; // method was successful
|
|
84688
|
+
// backend threw an exception, rethrow one on frontend
|
|
84689
|
+
const err = retVal.error;
|
|
84690
|
+
if (!_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.JsonUtils.isObject(err)) {
|
|
84691
|
+
// Exception wasn't an object?
|
|
84692
|
+
throw retVal.error; // eslint-disable-line @typescript-eslint/only-throw-error
|
|
84693
|
+
}
|
|
84694
|
+
// Note: for backwards compatibility, if the exception was from a BentleyError on the backend, throw an exception of type `BackendError`.
|
|
84695
|
+
if (!_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyError.isError(err))
|
|
84696
|
+
throw Object.assign(new Error(typeof err.message === "string" ? err.message : "unknown error"), err);
|
|
84697
|
+
const trimErr = { ...err };
|
|
84698
|
+
delete trimErr.iTwinErrorId; // these are methods on BackendError and will cause Object.assign to fail.
|
|
84699
|
+
delete trimErr.loggingMetadata;
|
|
84700
|
+
throw Object.assign(new _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.BackendError(err.errorNumber, err.iTwinErrorId.key, err.message, err.loggingMetadata), trimErr);
|
|
84714
84701
|
}
|
|
84715
84702
|
/** @internal
|
|
84716
84703
|
* @deprecated in 4.8. Use [[makeIpcProxy]] for a type-safe interface.
|
|
84717
84704
|
*/
|
|
84718
84705
|
static async callIpcChannel(channelName, methodName, ...args) {
|
|
84719
|
-
return this[
|
|
84706
|
+
return this[_common_internal_Symbols__WEBPACK_IMPORTED_MODULE_2__._callIpcChannel](channelName, methodName, ...args);
|
|
84720
84707
|
}
|
|
84721
84708
|
/** Create a type safe Proxy object to make IPC calls to a registered backend interface.
|
|
84722
84709
|
* @param channelName the channel registered by the backend handler.
|
|
@@ -84724,7 +84711,7 @@ class IpcApp {
|
|
|
84724
84711
|
static makeIpcProxy(channelName) {
|
|
84725
84712
|
return new Proxy({}, {
|
|
84726
84713
|
get(_target, methodName) {
|
|
84727
|
-
return async (...args) => IpcApp[
|
|
84714
|
+
return async (...args) => IpcApp[_common_internal_Symbols__WEBPACK_IMPORTED_MODULE_2__._callIpcChannel](channelName, methodName, ...args);
|
|
84728
84715
|
},
|
|
84729
84716
|
});
|
|
84730
84717
|
}
|
|
@@ -84735,7 +84722,7 @@ class IpcApp {
|
|
|
84735
84722
|
static makeIpcFunctionProxy(channelName, functionName) {
|
|
84736
84723
|
return new Proxy({}, {
|
|
84737
84724
|
get(_target, methodName) {
|
|
84738
|
-
return async (...args) => IpcApp[
|
|
84725
|
+
return async (...args) => IpcApp[_common_internal_Symbols__WEBPACK_IMPORTED_MODULE_2__._callIpcChannel](channelName, functionName, methodName, ...args);
|
|
84739
84726
|
},
|
|
84740
84727
|
});
|
|
84741
84728
|
}
|
|
@@ -84746,12 +84733,12 @@ class IpcApp {
|
|
|
84746
84733
|
static async startup(ipc, opts) {
|
|
84747
84734
|
this._ipc = ipc;
|
|
84748
84735
|
IpcAppNotifyHandler.register(); // receives notifications from backend
|
|
84749
|
-
await
|
|
84736
|
+
await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.startup(opts?.iModelApp);
|
|
84750
84737
|
}
|
|
84751
84738
|
/** @internal */
|
|
84752
84739
|
static async shutdown() {
|
|
84753
84740
|
this._ipc = undefined;
|
|
84754
|
-
await
|
|
84741
|
+
await _IModelApp__WEBPACK_IMPORTED_MODULE_3__.IModelApp.shutdown();
|
|
84755
84742
|
}
|
|
84756
84743
|
}
|
|
84757
84744
|
/**
|
|
@@ -204851,9 +204838,14 @@ class StrokeOptions {
|
|
|
204851
204838
|
set needNormals(value) {
|
|
204852
204839
|
this._needNormals = value;
|
|
204853
204840
|
}
|
|
204854
|
-
/**
|
|
204841
|
+
/**
|
|
204842
|
+
* Whether to request facets that are viewable from the back.
|
|
204843
|
+
* * Default value is true.
|
|
204844
|
+
* * Set to false only if the requested facets are expected to form a closed volume with outward normals,
|
|
204845
|
+
* indicating they are amenable to backface culling for improved display performance.
|
|
204846
|
+
*/
|
|
204855
204847
|
get needTwoSided() {
|
|
204856
|
-
return this._needTwoSided !== undefined ? this._needTwoSided :
|
|
204848
|
+
return this._needTwoSided !== undefined ? this._needTwoSided : true;
|
|
204857
204849
|
}
|
|
204858
204850
|
set needTwoSided(value) {
|
|
204859
204851
|
this._needTwoSided = value;
|
|
@@ -216274,24 +216266,25 @@ class EllipsoidComponentExtrema {
|
|
|
216274
216266
|
}
|
|
216275
216267
|
}
|
|
216276
216268
|
/**
|
|
216277
|
-
*
|
|
216269
|
+
* A complete unit sphere mapped by an arbitrary [[Transform]].
|
|
216278
216270
|
* * The (unit) sphere parameterization with respect to longitude `theta` and latitude `phi` is
|
|
216279
216271
|
* * `u = cos(theta) * cos (phi)`
|
|
216280
216272
|
* * `v = sin(theta) * cos(phi)`
|
|
216281
216273
|
* * `w = sin(phi)`
|
|
216282
|
-
*
|
|
216274
|
+
* * The sphere (u,v,w) multiply the x,y,z columns of the Ellipsoid transform.
|
|
216275
|
+
* * Compare to [[Sphere]], which has the same parameterization, but is a [[SolidPrimitive]] with latitude sweep.
|
|
216283
216276
|
* @public
|
|
216284
216277
|
*/
|
|
216285
216278
|
class Ellipsoid {
|
|
216286
216279
|
_transform;
|
|
216287
|
-
|
|
216288
|
-
|
|
216280
|
+
_workUnitVectorA;
|
|
216281
|
+
_workUnitVectorB;
|
|
216289
216282
|
_workPointA;
|
|
216290
216283
|
_workPointB;
|
|
216291
216284
|
constructor(transform) {
|
|
216292
216285
|
this._transform = transform;
|
|
216293
|
-
this.
|
|
216294
|
-
this.
|
|
216286
|
+
this._workUnitVectorA = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Vector3d.create();
|
|
216287
|
+
this._workUnitVectorB = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Vector3d.create();
|
|
216295
216288
|
this._workPointA = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create();
|
|
216296
216289
|
this._workPointB = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create();
|
|
216297
216290
|
}
|
|
@@ -216503,11 +216496,11 @@ class Ellipsoid {
|
|
|
216503
216496
|
* @param result optional preallocated result
|
|
216504
216497
|
*/
|
|
216505
216498
|
radiansPairToGreatArc(thetaARadians, phiARadians, thetaBRadians, phiBRadians, result) {
|
|
216506
|
-
_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_1__.SphereImplicit.radiansToUnitSphereXYZ(thetaARadians, phiARadians, this.
|
|
216507
|
-
_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_1__.SphereImplicit.radiansToUnitSphereXYZ(thetaBRadians, phiBRadians, this.
|
|
216508
|
-
const sweepAngle = this.
|
|
216499
|
+
_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_1__.SphereImplicit.radiansToUnitSphereXYZ(thetaARadians, phiARadians, this._workUnitVectorA);
|
|
216500
|
+
_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_1__.SphereImplicit.radiansToUnitSphereXYZ(thetaBRadians, phiBRadians, this._workUnitVectorB);
|
|
216501
|
+
const sweepAngle = this._workUnitVectorA.angleTo(this._workUnitVectorB);
|
|
216509
216502
|
// the unit vectors (on unit sphere) are never 0, so this cannot fail.
|
|
216510
|
-
const matrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_5__.Matrix3d.createRigidFromColumns(this.
|
|
216503
|
+
const matrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_5__.Matrix3d.createRigidFromColumns(this._workUnitVectorA, this._workUnitVectorB, _Geometry__WEBPACK_IMPORTED_MODULE_8__.AxisOrder.XYZ);
|
|
216511
216504
|
if (matrix !== undefined) {
|
|
216512
216505
|
const matrix1 = this._transform.matrix.multiplyMatrixMatrix(matrix);
|
|
216513
216506
|
return _curve_Arc3d__WEBPACK_IMPORTED_MODULE_7__.Arc3d.create(this._transform.getOrigin(), matrix1.columnX(), matrix1.columnY(), _AngleSweep__WEBPACK_IMPORTED_MODULE_2__.AngleSweep.createStartEndRadians(0.0, sweepAngle.radians), result);
|
|
@@ -216592,9 +216585,9 @@ class Ellipsoid {
|
|
|
216592
216585
|
* @param result optional preallocated result
|
|
216593
216586
|
*/
|
|
216594
216587
|
radiansPairToEquatorialEllipsoid(thetaARadians, phiARadians, thetaBRadians, phiBRadians, result) {
|
|
216595
|
-
_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_1__.SphereImplicit.radiansToUnitSphereXYZ(thetaARadians, phiARadians, this.
|
|
216596
|
-
_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_1__.SphereImplicit.radiansToUnitSphereXYZ(thetaBRadians, phiBRadians, this.
|
|
216597
|
-
const matrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_5__.Matrix3d.createRigidFromColumns(this.
|
|
216588
|
+
_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_1__.SphereImplicit.radiansToUnitSphereXYZ(thetaARadians, phiARadians, this._workUnitVectorA);
|
|
216589
|
+
_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_1__.SphereImplicit.radiansToUnitSphereXYZ(thetaBRadians, phiBRadians, this._workUnitVectorB);
|
|
216590
|
+
const matrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_5__.Matrix3d.createRigidFromColumns(this._workUnitVectorA, this._workUnitVectorB, _Geometry__WEBPACK_IMPORTED_MODULE_8__.AxisOrder.XYZ);
|
|
216598
216591
|
if (matrix) {
|
|
216599
216592
|
if (result) {
|
|
216600
216593
|
this._transform.multiplyTransformMatrix3d(matrix, result._transform);
|
|
@@ -216771,14 +216764,14 @@ class Ellipsoid {
|
|
|
216771
216764
|
result.direction.setFromPoint3d(result.origin);
|
|
216772
216765
|
return result;
|
|
216773
216766
|
}
|
|
216774
|
-
/**
|
|
216767
|
+
/** Implementation of [[Clipper.isPointOnOrInside]]. */
|
|
216775
216768
|
isPointOnOrInside(point) {
|
|
216776
216769
|
const localPoint = this._transform.multiplyInversePoint3d(point, this._workPointA);
|
|
216777
216770
|
if (localPoint !== undefined)
|
|
216778
216771
|
return localPoint.magnitude() <= 1.0;
|
|
216779
216772
|
return false;
|
|
216780
216773
|
}
|
|
216781
|
-
/** Announce "in" portions of a line segment.
|
|
216774
|
+
/** Announce "in" portions of a line segment. Implementation of [[Clipper.announceClippedSegmentIntervals]]. */
|
|
216782
216775
|
announceClippedSegmentIntervals(f0, f1, pointA, pointB, announce) {
|
|
216783
216776
|
const localA = this._transform.multiplyInversePoint3d(pointA, this._workPointA);
|
|
216784
216777
|
const localB = this._transform.multiplyInversePoint3d(pointB, this._workPointB);
|
|
@@ -216817,7 +216810,7 @@ class Ellipsoid {
|
|
|
216817
216810
|
}
|
|
216818
216811
|
return false;
|
|
216819
216812
|
}
|
|
216820
|
-
/** Announce "in" portions of a line segment.
|
|
216813
|
+
/** Announce "in" portions of a line segment. Implementation of [[Clipper.announceClippedArcIntervals]] */
|
|
216821
216814
|
announceClippedArcIntervals(arc, announce) {
|
|
216822
216815
|
const arcData = arc.toVectors();
|
|
216823
216816
|
let numAnnounce = 0;
|
|
@@ -227857,6 +227850,27 @@ class NumberArray {
|
|
|
227857
227850
|
}
|
|
227858
227851
|
return bytes[0] | bytes[1] | bytes[2] | bytes[3];
|
|
227859
227852
|
}
|
|
227853
|
+
/**
|
|
227854
|
+
* Given an array of strictly increasing numbers, find the index of the largest number that is less than or equal
|
|
227855
|
+
* to `value`.
|
|
227856
|
+
* * Get an initial estimate by proportions of `value` and the first and last entries.
|
|
227857
|
+
* * Linear search from there for final value.
|
|
227858
|
+
* * For regularly spaced numbers (e.g., `data` is the `_facetStart` indices for a triangulated [[IndexedPolyface]]),
|
|
227859
|
+
* the proportional estimate will be immediately correct.
|
|
227860
|
+
* @param data the array of strictly increasing numbers
|
|
227861
|
+
* @param value the value to search for
|
|
227862
|
+
*/
|
|
227863
|
+
static searchStrictlyIncreasingNumbers(data, value) {
|
|
227864
|
+
const lastQ = data.length - 1;
|
|
227865
|
+
if (lastQ <= 0 || value < 0 || value >= data[lastQ])
|
|
227866
|
+
return undefined;
|
|
227867
|
+
let q = Math.floor((value * lastQ) / data[lastQ]);
|
|
227868
|
+
while (data[q] > value)
|
|
227869
|
+
q--;
|
|
227870
|
+
while (data[q + 1] <= value)
|
|
227871
|
+
q++;
|
|
227872
|
+
return q;
|
|
227873
|
+
}
|
|
227860
227874
|
}
|
|
227861
227875
|
/**
|
|
227862
227876
|
* The `Point2dArray` class contains static methods that act on arrays of 2d points.
|
|
@@ -245396,6 +245410,8 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
245396
245410
|
this._numWrap = numWrap;
|
|
245397
245411
|
if (polyface.data.auxData)
|
|
245398
245412
|
this.auxData = polyface.data.auxData.createForVisitor();
|
|
245413
|
+
if (polyface.data.edgeMateIndex)
|
|
245414
|
+
this.edgeMateIndex = [];
|
|
245399
245415
|
this.reset();
|
|
245400
245416
|
this._numEdges = 0;
|
|
245401
245417
|
this._nextFacetIndex = 0;
|
|
@@ -245507,7 +245523,7 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
245507
245523
|
clientAuxIndex(i) {
|
|
245508
245524
|
return this.auxData ? this.auxData.indices[i] : -1;
|
|
245509
245525
|
}
|
|
245510
|
-
/** Clear the contents of
|
|
245526
|
+
/** Clear the contents of the data arrays. */
|
|
245511
245527
|
clearArrays() {
|
|
245512
245528
|
this.point.length = 0;
|
|
245513
245529
|
this.edgeVisible.length = 0;
|
|
@@ -245517,7 +245533,7 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
245517
245533
|
this.normal.length = 0;
|
|
245518
245534
|
if (this.color !== undefined)
|
|
245519
245535
|
this.color.length = 0;
|
|
245520
|
-
// TODO:
|
|
245536
|
+
// TODO: auxData? taggedNumericData?
|
|
245521
245537
|
}
|
|
245522
245538
|
/** Transfer data from a specified `index` of the `other` visitor as new data in this visitor. */
|
|
245523
245539
|
pushDataFrom(other, index) {
|
|
@@ -245529,7 +245545,7 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
245529
245545
|
this.normal.pushFromGrowableXYZArray(other.normal, index);
|
|
245530
245546
|
if (this.color && other.color && index < other.color.length)
|
|
245531
245547
|
this.color.push(other.color[index]);
|
|
245532
|
-
// TODO:
|
|
245548
|
+
// TODO: auxData? taggedNumericData?
|
|
245533
245549
|
}
|
|
245534
245550
|
/**
|
|
245535
245551
|
* Transfer interpolated data from the other visitor.
|
|
@@ -246037,8 +246053,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
246037
246053
|
/* harmony import */ var _geometry3d_GrowableXYArray__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/GrowableXYArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYArray.js");
|
|
246038
246054
|
/* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
|
|
246039
246055
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
246040
|
-
/* harmony import */ var
|
|
246041
|
-
/* harmony import */ var
|
|
246056
|
+
/* harmony import */ var _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/PointHelpers */ "../../core/geometry/lib/esm/geometry3d/PointHelpers.js");
|
|
246057
|
+
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
246042
246058
|
/* harmony import */ var _FacetFaceData__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./FacetFaceData */ "../../core/geometry/lib/esm/polyface/FacetFaceData.js");
|
|
246043
246059
|
/* harmony import */ var _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./IndexedPolyfaceVisitor */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceVisitor.js");
|
|
246044
246060
|
/* harmony import */ var _PolyfaceData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PolyfaceData */ "../../core/geometry/lib/esm/polyface/PolyfaceData.js");
|
|
@@ -246075,7 +246091,9 @@ class Polyface extends _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometr
|
|
|
246075
246091
|
super();
|
|
246076
246092
|
this.data = data;
|
|
246077
246093
|
}
|
|
246078
|
-
/**
|
|
246094
|
+
/**
|
|
246095
|
+
* The [[PolyfaceData.twoSided]] flag.
|
|
246096
|
+
*/
|
|
246079
246097
|
get twoSided() {
|
|
246080
246098
|
return this.data.twoSided;
|
|
246081
246099
|
}
|
|
@@ -246162,48 +246180,22 @@ class IndexedPolyface extends Polyface {
|
|
|
246162
246180
|
else
|
|
246163
246181
|
this._facetToFaceData = [];
|
|
246164
246182
|
}
|
|
246165
|
-
/**
|
|
246166
|
-
* Given an array of strictly increasing numbers, find the index of the largest number that is less than or equal
|
|
246167
|
-
* to `value`.
|
|
246168
|
-
* * Get an initial estimate by proportions of `value` and the first and last entries.
|
|
246169
|
-
* * Linear search from there for final value.
|
|
246170
|
-
* * For regularly spaced numbers (e.g., `data` is the `_facetStart` indices for a triangulated mesh or a quad mesh),
|
|
246171
|
-
* the proportional estimate will be immediately correct.
|
|
246172
|
-
*/
|
|
246173
|
-
static searchStrictlyIncreasingNumbers(data, value) {
|
|
246174
|
-
const lastQ = data.length - 1;
|
|
246175
|
-
if (lastQ <= 0 || value < 0 || value >= data[lastQ])
|
|
246176
|
-
return undefined;
|
|
246177
|
-
let q = Math.floor((value * lastQ) / data[lastQ]);
|
|
246178
|
-
while (data[q] > value)
|
|
246179
|
-
q--;
|
|
246180
|
-
while (data[q + 1] <= value)
|
|
246181
|
-
q++;
|
|
246182
|
-
return q;
|
|
246183
|
-
}
|
|
246184
246183
|
/** Given an edgeIndex (index into `data.pointIndex`), return the index of the facet containing the edge. */
|
|
246185
246184
|
edgeIndexToFacetIndex(k) {
|
|
246186
246185
|
if (k === undefined)
|
|
246187
246186
|
return undefined;
|
|
246188
|
-
return
|
|
246187
|
+
return _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_1__.NumberArray.searchStrictlyIncreasingNumbers(this._facetStart, k);
|
|
246189
246188
|
}
|
|
246190
246189
|
/**
|
|
246191
246190
|
* Given an edgeIndex (index into `data.pointIndex`), return the range of the edgeIndices of the containing facet.
|
|
246192
|
-
* * A "face loop" is a contiguous block of edgeIndices in the polyface index arrays representing a facet.
|
|
246193
246191
|
* * If an edge with edgeIndex `k` is found in the facet with facetIndex `f`, then the returned range `r` satisfies
|
|
246194
246192
|
* `r.low = this.facetIndex0(f) <= k < this.facetIndex1(f) = r.high` and can be used to iterate the facet's face
|
|
246195
|
-
* loop
|
|
246196
|
-
* ````
|
|
246197
|
-
* for (let k1 = r.low; k1 < r.high; k1++) {
|
|
246198
|
-
* const edgeIndex = myPolyface.data.pointIndex[k1];
|
|
246199
|
-
* // process this edge
|
|
246200
|
-
* }
|
|
246201
|
-
* ````
|
|
246193
|
+
* loop. See [[facetIndex0]].
|
|
246202
246194
|
*/
|
|
246203
246195
|
edgeIndexToFaceLoop(k) {
|
|
246204
246196
|
const q = this.edgeIndexToFacetIndex(k);
|
|
246205
246197
|
if (q !== undefined)
|
|
246206
|
-
return
|
|
246198
|
+
return _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__.Range1d.createXX(this.facetIndex0(q), this.facetIndex1(q));
|
|
246207
246199
|
return undefined;
|
|
246208
246200
|
}
|
|
246209
246201
|
/** Test if other is an instance of `IndexedPolyface` */
|
|
@@ -246214,8 +246206,8 @@ class IndexedPolyface extends Polyface {
|
|
|
246214
246206
|
isAlmostEqual(other) {
|
|
246215
246207
|
if (other instanceof IndexedPolyface) {
|
|
246216
246208
|
return this.data.isAlmostEqual(other.data) &&
|
|
246217
|
-
|
|
246218
|
-
|
|
246209
|
+
_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_1__.NumberArray.isExactEqual(this._facetStart, other._facetStart) &&
|
|
246210
|
+
_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_1__.NumberArray.isExactEqual(this._facetToFaceData, other._facetToFaceData);
|
|
246219
246211
|
}
|
|
246220
246212
|
return false;
|
|
246221
246213
|
}
|
|
@@ -246396,9 +246388,9 @@ class IndexedPolyface extends Polyface {
|
|
|
246396
246388
|
* @param needNormals `true` to allocate empty normal data and index arrays; `false` (default) to leave undefined.
|
|
246397
246389
|
* @param needParams `true` to allocate empty uv parameter data and index arrays; `false` (default) to leave undefined.
|
|
246398
246390
|
* @param needColors `true` to allocate empty color data and index arrays; `false` (default) to leave undefined.
|
|
246399
|
-
* @param twoSided `true` if the facets are to be considered viewable from the back; `false`
|
|
246391
|
+
* @param twoSided `true` (default) if the facets are to be considered viewable from the back; `false` if they are amenable to backface culling.
|
|
246400
246392
|
*/
|
|
246401
|
-
static create(needNormals = false, needParams = false, needColors = false, twoSided =
|
|
246393
|
+
static create(needNormals = false, needParams = false, needColors = false, twoSided = true) {
|
|
246402
246394
|
return new IndexedPolyface(new _PolyfaceData__WEBPACK_IMPORTED_MODULE_4__.PolyfaceData(needNormals, needParams, needColors, twoSided));
|
|
246403
246395
|
}
|
|
246404
246396
|
/**
|
|
@@ -246547,6 +246539,14 @@ class IndexedPolyface extends Polyface {
|
|
|
246547
246539
|
validateAllIndices(index0 = 0, errors) {
|
|
246548
246540
|
const numPointIndices = this.data.pointIndex.length;
|
|
246549
246541
|
const messages = errors ?? [];
|
|
246542
|
+
if (0 === numPointIndices) {
|
|
246543
|
+
messages.push("empty pointIndex array");
|
|
246544
|
+
return false;
|
|
246545
|
+
}
|
|
246546
|
+
if (index0 < 0 || index0 >= numPointIndices) {
|
|
246547
|
+
messages.push("invalid input offset");
|
|
246548
|
+
return false;
|
|
246549
|
+
}
|
|
246550
246550
|
if (this.data.normalIndex && this.data.normalIndex.length !== numPointIndices)
|
|
246551
246551
|
messages.push("normalIndex count must match pointIndex count");
|
|
246552
246552
|
if (this.data.paramIndex && this.data.paramIndex.length !== numPointIndices)
|
|
@@ -246556,13 +246556,19 @@ class IndexedPolyface extends Polyface {
|
|
|
246556
246556
|
if (this.data.edgeVisible.length !== numPointIndices)
|
|
246557
246557
|
messages.push("visibleIndex count must equal pointIndex count");
|
|
246558
246558
|
if (!Polyface.areIndicesValid(this.data.pointIndex, index0, numPointIndices, this.data.point, this.data.point ? this.data.point.length : 0))
|
|
246559
|
-
messages.push("invalid point
|
|
246559
|
+
messages.push("invalid point index encountered");
|
|
246560
246560
|
if (!Polyface.areIndicesValid(this.data.normalIndex, index0, numPointIndices, this.data.normal, this.data.normal ? this.data.normal.length : 0))
|
|
246561
|
-
messages.push("invalid normal
|
|
246561
|
+
messages.push("invalid normal index encountered");
|
|
246562
246562
|
if (!Polyface.areIndicesValid(this.data.paramIndex, index0, numPointIndices, this.data.param, this.data.param ? this.data.param.length : 0))
|
|
246563
|
-
messages.push("invalid param
|
|
246563
|
+
messages.push("invalid param index encountered");
|
|
246564
246564
|
if (!Polyface.areIndicesValid(this.data.colorIndex, index0, numPointIndices, this.data.color, this.data.color ? this.data.color.length : 0))
|
|
246565
|
-
messages.push("invalid color
|
|
246565
|
+
messages.push("invalid color index encountered");
|
|
246566
|
+
if (this.data.edgeMateIndex) {
|
|
246567
|
+
if (this.data.edgeMateIndex.length !== numPointIndices)
|
|
246568
|
+
messages.push("edgeMateIndex count must equal pointIndex count");
|
|
246569
|
+
else if (!this.data.edgeMateIndex.every((i) => i === undefined || this.data.isValidEdgeIndex(i)))
|
|
246570
|
+
messages.push("invalid edgeMate encountered");
|
|
246571
|
+
}
|
|
246566
246572
|
return 0 === messages.length;
|
|
246567
246573
|
}
|
|
246568
246574
|
/**
|
|
@@ -246626,14 +246632,34 @@ class IndexedPolyface extends Polyface {
|
|
|
246626
246632
|
return this._facetStart[facetIndex + 1] - this._facetStart[facetIndex];
|
|
246627
246633
|
return 0;
|
|
246628
246634
|
}
|
|
246629
|
-
/**
|
|
246635
|
+
/**
|
|
246636
|
+
* Given a valid facet index, return the index at which its face loop starts in the index arrays.
|
|
246637
|
+
* * A "face loop" is a contiguous block of indices into the parallel polyface index arrays.
|
|
246638
|
+
* * Each of these indices represents an edge of a facet, thus it is sometimes called an "edgeIndex".
|
|
246639
|
+
* * Together with [[facetIndex1]], this method can be used to iterate the face loop of the facet
|
|
246640
|
+
* with index `iFacet` as follows:
|
|
246641
|
+
* ````
|
|
246642
|
+
* for (let iEdge = this.facetIndex0(iFacet); iEdge < this.facetIndex1(iFacet); iEdge++) {
|
|
246643
|
+
* const iPoint = this.data.pointIndex[iEdge];
|
|
246644
|
+
* const p = this.data.point[iPoint];
|
|
246645
|
+
* // ... process the edge of this facet starting at point p
|
|
246646
|
+
* }
|
|
246647
|
+
* ````
|
|
246648
|
+
*/
|
|
246630
246649
|
facetIndex0(facetIndex) {
|
|
246631
246650
|
return this._facetStart[facetIndex];
|
|
246632
246651
|
}
|
|
246633
|
-
/**
|
|
246652
|
+
/**
|
|
246653
|
+
* Given a valid facet index, return one past the index at which its face loop ends in the index arrays.
|
|
246654
|
+
* * For details, see [[facetIndex0]].
|
|
246655
|
+
*/
|
|
246634
246656
|
facetIndex1(facetIndex) {
|
|
246635
246657
|
return this._facetStart[facetIndex + 1];
|
|
246636
246658
|
}
|
|
246659
|
+
/** Return a readonly reference to the facetStart array accessed by [[facetIndex0]] and [[facetIndex1]]. */
|
|
246660
|
+
get facetStart() {
|
|
246661
|
+
return this._facetStart;
|
|
246662
|
+
}
|
|
246637
246663
|
/** create a visitor for this polyface */
|
|
246638
246664
|
createVisitor(numWrap = 0) {
|
|
246639
246665
|
return _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_8__.IndexedPolyfaceVisitor.create(this, numWrap);
|
|
@@ -249463,7 +249489,7 @@ class PolyfaceData {
|
|
|
249463
249489
|
* shared edge is hidden, then the mesh has `edgeVisible = [true,true,false, false,true,true]`.
|
|
249464
249490
|
*/
|
|
249465
249491
|
edgeVisible;
|
|
249466
|
-
/**
|
|
249492
|
+
/** The [[twoSided]] flag. */
|
|
249467
249493
|
_twoSided;
|
|
249468
249494
|
/**
|
|
249469
249495
|
* Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).
|
|
@@ -249512,9 +249538,9 @@ class PolyfaceData {
|
|
|
249512
249538
|
* @param needNormals `true` to allocate empty normal data and index arrays; `false` (default) to leave undefined.
|
|
249513
249539
|
* @param needParams `true` to allocate empty uv parameter data and index arrays; `false` (default) to leave undefined.
|
|
249514
249540
|
* @param needColors `true` to allocate empty color data and index arrays; `false` (default) to leave undefined.
|
|
249515
|
-
* @param twoSided `true` if the facets are to be considered viewable from the back; `false`
|
|
249541
|
+
* @param twoSided `true` (default) if the facets are to be considered viewable from the back; `false` if they are amenable to backface culling.
|
|
249516
249542
|
*/
|
|
249517
|
-
constructor(needNormals = false, needParams = false, needColors = false, twoSided =
|
|
249543
|
+
constructor(needNormals = false, needParams = false, needColors = false, twoSided = true) {
|
|
249518
249544
|
this.point = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_0__.GrowableXYZArray();
|
|
249519
249545
|
this.pointIndex = [];
|
|
249520
249546
|
if (needNormals) {
|
|
@@ -249559,6 +249585,8 @@ class PolyfaceData {
|
|
|
249559
249585
|
result.edgeVisible = this.edgeVisible.slice();
|
|
249560
249586
|
result.twoSided = this.twoSided;
|
|
249561
249587
|
result.expectedClosure = this.expectedClosure;
|
|
249588
|
+
if (this.edgeMateIndex)
|
|
249589
|
+
result.edgeMateIndex = this.edgeMateIndex.slice();
|
|
249562
249590
|
return result;
|
|
249563
249591
|
}
|
|
249564
249592
|
/** Test for equal indices and nearly equal coordinates. */
|
|
@@ -249589,6 +249617,8 @@ class PolyfaceData {
|
|
|
249589
249617
|
return false;
|
|
249590
249618
|
if (this.expectedClosure !== other.expectedClosure)
|
|
249591
249619
|
return false;
|
|
249620
|
+
if (!_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.NumberArray.isExactEqual(this.edgeMateIndex, other.edgeMateIndex))
|
|
249621
|
+
return false;
|
|
249592
249622
|
return true;
|
|
249593
249623
|
}
|
|
249594
249624
|
/** Ask if normals are required in this mesh. */
|
|
@@ -249651,7 +249681,12 @@ class PolyfaceData {
|
|
|
249651
249681
|
getEdgeVisible(i) {
|
|
249652
249682
|
return this.edgeVisible[i];
|
|
249653
249683
|
}
|
|
249654
|
-
/**
|
|
249684
|
+
/**
|
|
249685
|
+
* Boolean flag indicating if the facets are viewable from the back.
|
|
249686
|
+
* * Default value is true.
|
|
249687
|
+
* * Set to false only if the mesh is known to be a closed volume with outward normals,
|
|
249688
|
+
* indicating it is amenable to backface culling for improved display performance.
|
|
249689
|
+
*/
|
|
249655
249690
|
get twoSided() {
|
|
249656
249691
|
return this._twoSided;
|
|
249657
249692
|
}
|
|
@@ -249780,6 +249815,13 @@ class PolyfaceData {
|
|
|
249780
249815
|
for (let i = 0; i < numWrap; i++)
|
|
249781
249816
|
this.auxData.indices[numEdge + i] = this.auxData.indices[i];
|
|
249782
249817
|
}
|
|
249818
|
+
// copy wrapped edgeMateIndex
|
|
249819
|
+
if (this.edgeMateIndex && other.edgeMateIndex) {
|
|
249820
|
+
for (let i = 0; i < numEdge; i++)
|
|
249821
|
+
this.edgeMateIndex[i] = other.edgeMateIndex[index0 + i];
|
|
249822
|
+
for (let i = 0; i < numWrap; i++)
|
|
249823
|
+
this.edgeMateIndex[numEdge + i] = this.edgeMateIndex[i];
|
|
249824
|
+
}
|
|
249783
249825
|
}
|
|
249784
249826
|
/** Trim the `data` arrays to the stated `length`. */
|
|
249785
249827
|
static trimArray(data, length) {
|
|
@@ -249803,6 +249845,7 @@ class PolyfaceData {
|
|
|
249803
249845
|
PolyfaceData.trimArray(data.values, channel.entriesPerValue * length);
|
|
249804
249846
|
}
|
|
249805
249847
|
}
|
|
249848
|
+
PolyfaceData.trimArray(this.edgeMateIndex, length);
|
|
249806
249849
|
}
|
|
249807
249850
|
/**
|
|
249808
249851
|
* Resize all data and index arrays to the specified `length`.
|
|
@@ -249844,6 +249887,9 @@ class PolyfaceData {
|
|
|
249844
249887
|
if (this.auxData.indices)
|
|
249845
249888
|
this.auxData.indices.push(-1);
|
|
249846
249889
|
}
|
|
249890
|
+
if (this.edgeMateIndex)
|
|
249891
|
+
while (this.edgeMateIndex.length < length)
|
|
249892
|
+
this.edgeMateIndex.push(undefined);
|
|
249847
249893
|
}
|
|
249848
249894
|
else if (length < this.point.length) {
|
|
249849
249895
|
this.point.resize(length);
|
|
@@ -249870,6 +249916,8 @@ class PolyfaceData {
|
|
|
249870
249916
|
if (this.auxData.indices)
|
|
249871
249917
|
this.auxData.indices.length = length;
|
|
249872
249918
|
}
|
|
249919
|
+
if (this.edgeMateIndex)
|
|
249920
|
+
this.edgeMateIndex.length = length;
|
|
249873
249921
|
}
|
|
249874
249922
|
}
|
|
249875
249923
|
/**
|
|
@@ -255972,20 +256020,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
255972
256020
|
/* harmony import */ var flatbuffers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flatbuffers */ "../../common/temp/node_modules/.pnpm/flatbuffers@1.12.0/node_modules/flatbuffers/js/flatbuffers.mjs");
|
|
255973
256021
|
/*---------------------------------------------------------------------------------------------
|
|
255974
256022
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
255975
|
-
* See LICENSE.md in the
|
|
256023
|
+
* See LICENSE.md in the repository root for full copyright notice.
|
|
255976
256024
|
*--------------------------------------------------------------------------------------------*/
|
|
255977
|
-
/** @packageDocumentation
|
|
255978
|
-
* @module Serialization
|
|
255979
|
-
*/
|
|
255980
256025
|
|
|
255981
256026
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
255982
256027
|
/* eslint-disable @typescript-eslint/explicit-member-accessibility */
|
|
255983
|
-
// cspell:word flatbuffers
|
|
255984
|
-
// cspell:word Akima
|
|
255985
256028
|
/* eslint-disable @itwin/prefer-get */
|
|
255986
|
-
// cspell:word flatbuffers
|
|
255987
|
-
/**
|
|
255988
|
-
* @
|
|
256029
|
+
// cspell:word flatbuffers, Akima
|
|
256030
|
+
/**
|
|
256031
|
+
* @internal
|
|
255989
256032
|
*/
|
|
255990
256033
|
var BGFBAccessors;
|
|
255991
256034
|
(function (BGFBAccessors) {
|
|
@@ -257758,12 +257801,12 @@ var BGFBAccessors;
|
|
|
257758
257801
|
return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
|
|
257759
257802
|
}
|
|
257760
257803
|
/**
|
|
257761
|
-
* @param
|
|
257762
|
-
* @returns
|
|
257804
|
+
* @param DVector3d= obj
|
|
257805
|
+
* @returns DVector3d|null
|
|
257763
257806
|
*/
|
|
257764
257807
|
startTangent(obj) {
|
|
257765
257808
|
const offset = this.bb.__offset(this.bb_pos, 16);
|
|
257766
|
-
return offset ? (obj || new
|
|
257809
|
+
return offset ? (obj || new DVector3d()).__init(this.bb_pos + offset, this.bb) : null;
|
|
257767
257810
|
}
|
|
257768
257811
|
/**
|
|
257769
257812
|
* @param DVector3d= obj
|
|
@@ -260378,7 +260421,7 @@ var BGFBAccessors;
|
|
|
260378
260421
|
*/
|
|
260379
260422
|
intColor(index) {
|
|
260380
260423
|
const offset = this.bb.__offset(this.bb_pos, 12);
|
|
260381
|
-
return offset ? this.bb.
|
|
260424
|
+
return offset ? this.bb.readUint32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
|
|
260382
260425
|
}
|
|
260383
260426
|
/**
|
|
260384
260427
|
* @returns number
|
|
@@ -260599,11 +260642,33 @@ var BGFBAccessors;
|
|
|
260599
260642
|
const offset = this.bb.__offset(this.bb_pos, 40);
|
|
260600
260643
|
return offset ? (obj || new TaggedNumericData()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
|
|
260601
260644
|
}
|
|
260645
|
+
/**
|
|
260646
|
+
* @param number index
|
|
260647
|
+
* @returns number
|
|
260648
|
+
*/
|
|
260649
|
+
edgeMateIndex(index) {
|
|
260650
|
+
const offset = this.bb.__offset(this.bb_pos, 42);
|
|
260651
|
+
return offset ? this.bb.readInt32(this.bb.__vector(this.bb_pos + offset) + index * 4) : 0;
|
|
260652
|
+
}
|
|
260653
|
+
/**
|
|
260654
|
+
* @returns number
|
|
260655
|
+
*/
|
|
260656
|
+
edgeMateIndexLength() {
|
|
260657
|
+
const offset = this.bb.__offset(this.bb_pos, 42);
|
|
260658
|
+
return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
|
|
260659
|
+
}
|
|
260660
|
+
/**
|
|
260661
|
+
* @returns Int32Array
|
|
260662
|
+
*/
|
|
260663
|
+
edgeMateIndexArray() {
|
|
260664
|
+
const offset = this.bb.__offset(this.bb_pos, 42);
|
|
260665
|
+
return offset ? new Int32Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset)) : null;
|
|
260666
|
+
}
|
|
260602
260667
|
/**
|
|
260603
260668
|
* @param flatbuffers.Builder builder
|
|
260604
260669
|
*/
|
|
260605
260670
|
static startPolyface(builder) {
|
|
260606
|
-
builder.startObject(
|
|
260671
|
+
builder.startObject(20);
|
|
260607
260672
|
}
|
|
260608
260673
|
/**
|
|
260609
260674
|
* @param flatbuffers.Builder builder
|
|
@@ -260966,6 +261031,32 @@ var BGFBAccessors;
|
|
|
260966
261031
|
static addTaggedNumericData(builder, taggedNumericDataOffset) {
|
|
260967
261032
|
builder.addFieldOffset(18, taggedNumericDataOffset, 0);
|
|
260968
261033
|
}
|
|
261034
|
+
/**
|
|
261035
|
+
* @param flatbuffers.Builder builder
|
|
261036
|
+
* @param flatbuffers.Offset edgeMateIndexOffset
|
|
261037
|
+
*/
|
|
261038
|
+
static addEdgeMateIndex(builder, edgeMateIndexOffset) {
|
|
261039
|
+
builder.addFieldOffset(19, edgeMateIndexOffset, 0);
|
|
261040
|
+
}
|
|
261041
|
+
/**
|
|
261042
|
+
* @param flatbuffers.Builder builder
|
|
261043
|
+
* @param Array.<number> data
|
|
261044
|
+
* @returns flatbuffers.Offset
|
|
261045
|
+
*/
|
|
261046
|
+
static createEdgeMateIndexVector(builder, data) {
|
|
261047
|
+
builder.startVector(4, data.length, 4);
|
|
261048
|
+
for (let i = data.length - 1; i >= 0; i--) {
|
|
261049
|
+
builder.addInt32(data[i]);
|
|
261050
|
+
}
|
|
261051
|
+
return builder.endVector();
|
|
261052
|
+
}
|
|
261053
|
+
/**
|
|
261054
|
+
* @param flatbuffers.Builder builder
|
|
261055
|
+
* @param number numElems
|
|
261056
|
+
*/
|
|
261057
|
+
static startEdgeMateIndexVector(builder, numElems) {
|
|
261058
|
+
builder.startVector(4, numElems, 4);
|
|
261059
|
+
}
|
|
260969
261060
|
/**
|
|
260970
261061
|
* @param flatbuffers.Builder builder
|
|
260971
261062
|
* @returns flatbuffers.Offset
|
|
@@ -260974,7 +261065,7 @@ var BGFBAccessors;
|
|
|
260974
261065
|
const offset = builder.endObject();
|
|
260975
261066
|
return offset;
|
|
260976
261067
|
}
|
|
260977
|
-
static createPolyface(builder, pointOffset, paramOffset, normalOffset, doubleColorOffset, intColorOffset, pointIndexOffset, paramIndexOffset, normalIndexOffset, colorIndexOffset, colorTableOffset, numPerFace, numPerRow, meshStyle, twoSided, faceIndexOffset, faceDataOffset, auxDataOffset, expectedClosure, taggedNumericDataOffset) {
|
|
261068
|
+
static createPolyface(builder, pointOffset, paramOffset, normalOffset, doubleColorOffset, intColorOffset, pointIndexOffset, paramIndexOffset, normalIndexOffset, colorIndexOffset, colorTableOffset, numPerFace, numPerRow, meshStyle, twoSided, faceIndexOffset, faceDataOffset, auxDataOffset, expectedClosure, taggedNumericDataOffset, edgeMateIndexOffset) {
|
|
260978
261069
|
Polyface.startPolyface(builder);
|
|
260979
261070
|
Polyface.addPoint(builder, pointOffset);
|
|
260980
261071
|
Polyface.addParam(builder, paramOffset);
|
|
@@ -260995,6 +261086,7 @@ var BGFBAccessors;
|
|
|
260995
261086
|
Polyface.addAuxData(builder, auxDataOffset);
|
|
260996
261087
|
Polyface.addExpectedClosure(builder, expectedClosure);
|
|
260997
261088
|
Polyface.addTaggedNumericData(builder, taggedNumericDataOffset);
|
|
261089
|
+
Polyface.addEdgeMateIndex(builder, edgeMateIndexOffset);
|
|
260998
261090
|
return Polyface.endPolyface(builder);
|
|
260999
261091
|
}
|
|
261000
261092
|
}
|
|
@@ -261585,7 +261677,7 @@ class BGFBReader {
|
|
|
261585
261677
|
}
|
|
261586
261678
|
/**
|
|
261587
261679
|
* Extract an interpolating curve
|
|
261588
|
-
* @param
|
|
261680
|
+
* @param header read position in the flat buffer.
|
|
261589
261681
|
*/
|
|
261590
261682
|
readInterpolationCurve3d(header) {
|
|
261591
261683
|
const xyzArray = header.fitPointsArray();
|
|
@@ -261601,7 +261693,7 @@ class BGFBReader {
|
|
|
261601
261693
|
}
|
|
261602
261694
|
/**
|
|
261603
261695
|
* Extract an akima curve
|
|
261604
|
-
* @param
|
|
261696
|
+
* @param header read position in the flat buffer.
|
|
261605
261697
|
*/
|
|
261606
261698
|
readAkimaCurve3d(header) {
|
|
261607
261699
|
const xyzArray = header.pointsArray();
|
|
@@ -261900,15 +261992,21 @@ class BGFBReader {
|
|
|
261900
261992
|
const paramIndexI32 = nullToUndefined(polyfaceHeader.paramIndexArray());
|
|
261901
261993
|
const normalIndexI32 = nullToUndefined(polyfaceHeader.normalIndexArray());
|
|
261902
261994
|
const colorIndexI32 = nullToUndefined(polyfaceHeader.colorIndexArray());
|
|
261995
|
+
const edgeMateIndexI32 = nullToUndefined(polyfaceHeader.edgeMateIndexArray());
|
|
261903
261996
|
const taggedNumericDataOffset = polyfaceHeader.taggedNumericData();
|
|
261997
|
+
// FB polyfaces are always indexed face loop style, but we recognize both variable and fixed-size face loops.
|
|
261998
|
+
// (BGFBWriter only writes variable-sized face loops, but native FBWriter can write both.)
|
|
261904
261999
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__.assert)(meshStyle === 1, "Unrecognized flatbuffer mesh style");
|
|
261905
|
-
// The flatbuffer data is one based.
|
|
261906
|
-
// If numPerFace is less than 2, facets are variable size and zero terminated
|
|
261907
|
-
// If numPerFace is 2 or more, indices are blocked
|
|
261908
262000
|
if (meshStyle === 1 && pointF64 && pointIndexI32) {
|
|
261909
262001
|
const polyface = _polyface_Polyface__WEBPACK_IMPORTED_MODULE_24__.IndexedPolyface.create();
|
|
261910
262002
|
polyface.twoSided = twoSided;
|
|
261911
262003
|
polyface.expectedClosure = expectedClosure;
|
|
262004
|
+
// Flatbuffer parallel index array values are:
|
|
262005
|
+
// * signed 1-based index into the respective data array
|
|
262006
|
+
// * 0 indicates variable-sized face loop terminator (numPerFace < 2)
|
|
262007
|
+
// * 0 indicates fixed-sized face loop padding (numPerFace >= 2)
|
|
262008
|
+
// Native format is the same as flatbuffer.
|
|
262009
|
+
// TypeScript format is 0-based indices sans terminator/padding
|
|
261912
262010
|
if (normalF64 && normalIndexI32) {
|
|
261913
262011
|
for (let i = 0; i + 2 < normalF64.length; i += 3)
|
|
261914
262012
|
polyface.addNormalXYZ(normalF64[i], normalF64[i + 1], normalF64[i + 2]);
|
|
@@ -261924,9 +262022,21 @@ class BGFBReader {
|
|
|
261924
262022
|
polyface.addColor(c);
|
|
261925
262023
|
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(colorIndexI32, numPerFace, (i) => { polyface.addColorIndex(i); });
|
|
261926
262024
|
}
|
|
262025
|
+
// the second callback below builds up the facetStart array as we process the main point index array
|
|
261927
262026
|
for (let i = 0; i + 2 < pointF64.length; i += 3)
|
|
261928
262027
|
polyface.addPointXYZ(pointF64[i], pointF64[i + 1], pointF64[i + 2]);
|
|
261929
262028
|
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(pointIndexI32, numPerFace, (i, v) => { polyface.addPointIndex(i, v); }, () => { polyface.terminateFacet(false); });
|
|
262029
|
+
// FB/JSON/native edgeMateIndex array format:
|
|
262030
|
+
// 0-based edgeMate indices into the parallel Polyface index arrays (and edgeMateIndex!),
|
|
262031
|
+
// -1 terminator/pad, not present in TypeScript,
|
|
262032
|
+
// -2 for "no edgeMate", maps to `undefined` in TypeScript
|
|
262033
|
+
if (edgeMateIndexI32) {
|
|
262034
|
+
const edgeMateIndex = [];
|
|
262035
|
+
if (!_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceCompressedZeroBasedReflexiveIndices(edgeMateIndexI32, numPerFace, _SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.EdgeMateIndex.BlockSeparator, _SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.EdgeMateIndex.NoEdgeMate, (i) => edgeMateIndex.push(i))) {
|
|
262036
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__.assert)(false, "unable to deserialize flatbuffer edgeMateIndex array");
|
|
262037
|
+
}
|
|
262038
|
+
polyface.data.edgeMateIndex = edgeMateIndex;
|
|
262039
|
+
}
|
|
261930
262040
|
if (!polyface.validateAllIndices())
|
|
261931
262041
|
return undefined;
|
|
261932
262042
|
polyface.data.auxData = this.readPolyfaceAuxData(polyfaceHeader, polyfaceHeader.auxData());
|
|
@@ -261938,6 +262048,7 @@ class BGFBReader {
|
|
|
261938
262048
|
polyface.data.setTaggedNumericData(taggedNumericData);
|
|
261939
262049
|
}
|
|
261940
262050
|
}
|
|
262051
|
+
// NOTE: faceData is ignored
|
|
261941
262052
|
return polyface;
|
|
261942
262053
|
}
|
|
261943
262054
|
}
|
|
@@ -262070,53 +262181,47 @@ class BGFBReader {
|
|
|
262070
262181
|
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagBsplineCurve:
|
|
262071
262182
|
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagTransitionSpiral:
|
|
262072
262183
|
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagInterpolationCurve:
|
|
262073
|
-
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagAkimaCurve:
|
|
262074
|
-
|
|
262075
|
-
|
|
262076
|
-
|
|
262077
|
-
|
|
262078
|
-
|
|
262079
|
-
|
|
262080
|
-
|
|
262081
|
-
|
|
262082
|
-
{
|
|
262083
|
-
return this.readPolyfaceFromVariant(variant);
|
|
262084
|
-
}
|
|
262184
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagAkimaCurve: {
|
|
262185
|
+
return this.readCurvePrimitiveFromVariant(variant);
|
|
262186
|
+
}
|
|
262187
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagCurveVector: {
|
|
262188
|
+
return this.readCurveCollectionFromVariantGeometry(variant);
|
|
262189
|
+
}
|
|
262190
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagPolyface: {
|
|
262191
|
+
return this.readPolyfaceFromVariant(variant);
|
|
262192
|
+
}
|
|
262085
262193
|
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnBox:
|
|
262086
262194
|
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnCone:
|
|
262087
262195
|
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnTorusPipe:
|
|
262088
262196
|
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnSphere:
|
|
262089
262197
|
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnExtrusion:
|
|
262090
262198
|
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnRotationalSweep:
|
|
262091
|
-
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnRuledSweep:
|
|
262092
|
-
|
|
262093
|
-
|
|
262094
|
-
|
|
262095
|
-
|
|
262096
|
-
|
|
262097
|
-
|
|
262098
|
-
const
|
|
262099
|
-
|
|
262100
|
-
const
|
|
262101
|
-
if (
|
|
262102
|
-
|
|
262103
|
-
|
|
262104
|
-
|
|
262105
|
-
|
|
262106
|
-
else if (Array.isArray(childGeometry)) {
|
|
262107
|
-
geometry.push(...childGeometry);
|
|
262108
|
-
}
|
|
262199
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnRuledSweep: {
|
|
262200
|
+
return this.readSolidPrimitiveFromVariant(variant);
|
|
262201
|
+
}
|
|
262202
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagVectorOfVariantGeometry: {
|
|
262203
|
+
const geometry = [];
|
|
262204
|
+
const offsetToVectorOfVariantGeometry = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VectorOfVariantGeometry());
|
|
262205
|
+
for (let i = 0; i < offsetToVectorOfVariantGeometry.membersLength(); i++) {
|
|
262206
|
+
const child = offsetToVectorOfVariantGeometry.members(i);
|
|
262207
|
+
if (child !== null) {
|
|
262208
|
+
const childGeometry = this.readGeometryQueryFromVariant(child);
|
|
262209
|
+
if (childGeometry instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_33__.GeometryQuery) {
|
|
262210
|
+
geometry.push(childGeometry);
|
|
262211
|
+
}
|
|
262212
|
+
else if (Array.isArray(childGeometry)) {
|
|
262213
|
+
geometry.push(...childGeometry);
|
|
262109
262214
|
}
|
|
262110
262215
|
}
|
|
262111
|
-
return geometry;
|
|
262112
262216
|
}
|
|
262217
|
+
return geometry;
|
|
262218
|
+
}
|
|
262113
262219
|
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagBsplineSurface: {
|
|
262114
262220
|
return this.readBSplineSurfaceFromVariant(variant);
|
|
262115
262221
|
}
|
|
262116
|
-
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagPointString:
|
|
262117
|
-
|
|
262118
|
-
|
|
262119
|
-
}
|
|
262222
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagPointString: {
|
|
262223
|
+
return this.readPointStringFromVariant(variant);
|
|
262224
|
+
}
|
|
262120
262225
|
}
|
|
262121
262226
|
return undefined;
|
|
262122
262227
|
}
|
|
@@ -262223,41 +262328,42 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
262223
262328
|
/* harmony export */ BGFBWriter: () => (/* binding */ BGFBWriter)
|
|
262224
262329
|
/* harmony export */ });
|
|
262225
262330
|
/* harmony import */ var flatbuffers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flatbuffers */ "../../common/temp/node_modules/.pnpm/flatbuffers@1.12.0/node_modules/flatbuffers/js/flatbuffers.mjs");
|
|
262226
|
-
/* harmony import */ var
|
|
262227
|
-
/* harmony import */ var
|
|
262228
|
-
/* harmony import */ var
|
|
262229
|
-
/* harmony import */ var
|
|
262230
|
-
/* harmony import */ var
|
|
262231
|
-
/* harmony import */ var
|
|
262232
|
-
/* harmony import */ var
|
|
262233
|
-
/* harmony import */ var
|
|
262234
|
-
/* harmony import */ var
|
|
262235
|
-
/* harmony import */ var
|
|
262236
|
-
/* harmony import */ var
|
|
262237
|
-
/* harmony import */ var
|
|
262238
|
-
/* harmony import */ var
|
|
262239
|
-
/* harmony import */ var
|
|
262240
|
-
/* harmony import */ var
|
|
262241
|
-
/* harmony import */ var
|
|
262242
|
-
/* harmony import */ var
|
|
262243
|
-
/* harmony import */ var
|
|
262244
|
-
/* harmony import */ var
|
|
262245
|
-
/* harmony import */ var
|
|
262246
|
-
/* harmony import */ var
|
|
262247
|
-
/* harmony import */ var
|
|
262248
|
-
/* harmony import */ var
|
|
262249
|
-
/* harmony import */ var
|
|
262250
|
-
/* harmony import */ var
|
|
262251
|
-
/* harmony import */ var
|
|
262252
|
-
/* harmony import */ var
|
|
262253
|
-
/* harmony import */ var
|
|
262254
|
-
/* harmony import */ var
|
|
262255
|
-
/* harmony import */ var
|
|
262256
|
-
/* harmony import */ var
|
|
262257
|
-
/* harmony import */ var
|
|
262258
|
-
/* harmony import */ var
|
|
262259
|
-
/* harmony import */ var
|
|
262260
|
-
/* harmony import */ var
|
|
262331
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
262332
|
+
/* harmony import */ var _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../bspline/AkimaCurve3d */ "../../core/geometry/lib/esm/bspline/AkimaCurve3d.js");
|
|
262333
|
+
/* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
|
|
262334
|
+
/* harmony import */ var _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../bspline/BSplineCurve3dH */ "../../core/geometry/lib/esm/bspline/BSplineCurve3dH.js");
|
|
262335
|
+
/* harmony import */ var _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../bspline/BSplineSurface */ "../../core/geometry/lib/esm/bspline/BSplineSurface.js");
|
|
262336
|
+
/* harmony import */ var _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../bspline/InterpolationCurve3d */ "../../core/geometry/lib/esm/bspline/InterpolationCurve3d.js");
|
|
262337
|
+
/* harmony import */ var _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../bspline/KnotVector */ "../../core/geometry/lib/esm/bspline/KnotVector.js");
|
|
262338
|
+
/* harmony import */ var _curve_Arc3d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../curve/Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
262339
|
+
/* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
262340
|
+
/* harmony import */ var _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../curve/CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
|
|
262341
|
+
/* harmony import */ var _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../curve/GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
262342
|
+
/* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
262343
|
+
/* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
262344
|
+
/* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
262345
|
+
/* harmony import */ var _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../curve/ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
|
|
262346
|
+
/* harmony import */ var _curve_Path__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../curve/Path */ "../../core/geometry/lib/esm/curve/Path.js");
|
|
262347
|
+
/* harmony import */ var _curve_PointString3d__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../curve/PointString3d */ "../../core/geometry/lib/esm/curve/PointString3d.js");
|
|
262348
|
+
/* harmony import */ var _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../curve/spiral/DirectSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/DirectSpiral3d.js");
|
|
262349
|
+
/* harmony import */ var _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../curve/spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
|
|
262350
|
+
/* harmony import */ var _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../curve/spiral/TransitionSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/TransitionSpiral3d.js");
|
|
262351
|
+
/* harmony import */ var _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../curve/UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
|
|
262352
|
+
/* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
|
|
262353
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
262354
|
+
/* harmony import */ var _polyface_AuxData__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../polyface/AuxData */ "../../core/geometry/lib/esm/polyface/AuxData.js");
|
|
262355
|
+
/* harmony import */ var _polyface_Polyface__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../polyface/Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
262356
|
+
/* harmony import */ var _solid_Box__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../solid/Box */ "../../core/geometry/lib/esm/solid/Box.js");
|
|
262357
|
+
/* harmony import */ var _solid_Cone__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../solid/Cone */ "../../core/geometry/lib/esm/solid/Cone.js");
|
|
262358
|
+
/* harmony import */ var _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../solid/LinearSweep */ "../../core/geometry/lib/esm/solid/LinearSweep.js");
|
|
262359
|
+
/* harmony import */ var _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../solid/RotationalSweep */ "../../core/geometry/lib/esm/solid/RotationalSweep.js");
|
|
262360
|
+
/* harmony import */ var _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../solid/RuledSweep */ "../../core/geometry/lib/esm/solid/RuledSweep.js");
|
|
262361
|
+
/* harmony import */ var _solid_SolidPrimitive__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../solid/SolidPrimitive */ "../../core/geometry/lib/esm/solid/SolidPrimitive.js");
|
|
262362
|
+
/* harmony import */ var _solid_Sphere__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../solid/Sphere */ "../../core/geometry/lib/esm/solid/Sphere.js");
|
|
262363
|
+
/* harmony import */ var _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../solid/TorusPipe */ "../../core/geometry/lib/esm/solid/TorusPipe.js");
|
|
262364
|
+
/* harmony import */ var _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./BGFBAccessors */ "../../core/geometry/lib/esm/serialization/BGFBAccessors.js");
|
|
262365
|
+
/* harmony import */ var _BGFBReader__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./BGFBReader */ "../../core/geometry/lib/esm/serialization/BGFBReader.js");
|
|
262366
|
+
/* harmony import */ var _SerializationHelpers__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./SerializationHelpers */ "../../core/geometry/lib/esm/serialization/SerializationHelpers.js");
|
|
262261
262367
|
/*---------------------------------------------------------------------------------------------
|
|
262262
262368
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
262263
262369
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -262299,6 +262405,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
262299
262405
|
|
|
262300
262406
|
|
|
262301
262407
|
|
|
262408
|
+
|
|
262302
262409
|
|
|
262303
262410
|
|
|
262304
262411
|
/**
|
|
@@ -262371,109 +262478,109 @@ class BGFBWriter {
|
|
|
262371
262478
|
writeCurveCollectionAsFBCurveVector(cv) {
|
|
262372
262479
|
const childrenOffsets = [];
|
|
262373
262480
|
for (const child of cv.children) {
|
|
262374
|
-
if (child instanceof
|
|
262481
|
+
if (child instanceof _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__.CurvePrimitive) {
|
|
262375
262482
|
const childOffset = this.writeCurvePrimitiveAsFBVariantGeometry(child);
|
|
262376
262483
|
if (childOffset)
|
|
262377
262484
|
childrenOffsets.push(childOffset);
|
|
262378
262485
|
}
|
|
262379
|
-
else if (child instanceof
|
|
262486
|
+
else if (child instanceof _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_3__.CurveCollection) {
|
|
262380
262487
|
const childOffset = this.writeCurveCollectionAsFBVariantGeometry(child);
|
|
262381
262488
|
if (childOffset)
|
|
262382
262489
|
childrenOffsets.push(childOffset);
|
|
262383
262490
|
}
|
|
262384
262491
|
}
|
|
262385
|
-
const childrenVectorOffset =
|
|
262492
|
+
const childrenVectorOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.CurveVector.createCurvesVector(this.builder, childrenOffsets);
|
|
262386
262493
|
let cvType = 0;
|
|
262387
|
-
if (cv instanceof
|
|
262494
|
+
if (cv instanceof _curve_Path__WEBPACK_IMPORTED_MODULE_5__.Path)
|
|
262388
262495
|
cvType = 1;
|
|
262389
|
-
else if (cv instanceof
|
|
262496
|
+
else if (cv instanceof _curve_Loop__WEBPACK_IMPORTED_MODULE_6__.Loop) {
|
|
262390
262497
|
cvType = cv.isInner ? 3 : 2;
|
|
262391
262498
|
}
|
|
262392
|
-
else if (cv instanceof
|
|
262499
|
+
else if (cv instanceof _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_7__.ParityRegion)
|
|
262393
262500
|
cvType = 4;
|
|
262394
|
-
else if (cv instanceof
|
|
262501
|
+
else if (cv instanceof _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_8__.UnionRegion)
|
|
262395
262502
|
cvType = 5;
|
|
262396
|
-
const curveVectorOffset =
|
|
262503
|
+
const curveVectorOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.CurveVector.createCurveVector(this.builder, cvType, childrenVectorOffset);
|
|
262397
262504
|
return curveVectorOffset;
|
|
262398
262505
|
}
|
|
262399
262506
|
writeCurveCollectionAsFBVariantGeometry(cv) {
|
|
262400
262507
|
const curveVectorOffset = this.writeCurveCollectionAsFBCurveVector(cv);
|
|
262401
262508
|
if (curveVectorOffset === undefined)
|
|
262402
262509
|
return undefined;
|
|
262403
|
-
return
|
|
262510
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagCurveVector, curveVectorOffset, 0);
|
|
262404
262511
|
}
|
|
262405
262512
|
writeInterpolationCurve3dAsFBVariantGeometry(curve) {
|
|
262406
262513
|
const props = curve.cloneProps();
|
|
262407
262514
|
const fitPointsOffset = this.writeDoubleArray(curve.copyFitPointsFloat64Array());
|
|
262408
262515
|
const knotOffset = props.knots ? this.writeDoubleArray(props.knots) : 0;
|
|
262409
|
-
|
|
262410
|
-
|
|
262516
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.InterpolationCurve.startInterpolationCurve(this.builder);
|
|
262517
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.InterpolationCurve.addFitPoints(this.builder, fitPointsOffset);
|
|
262411
262518
|
if (props.order)
|
|
262412
|
-
|
|
262519
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.InterpolationCurve.addOrder(this.builder, props.order);
|
|
262413
262520
|
if (props.closed)
|
|
262414
|
-
|
|
262521
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.InterpolationCurve.addClosed(this.builder, props.closed);
|
|
262415
262522
|
if (props.isChordLenKnots)
|
|
262416
|
-
|
|
262523
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.InterpolationCurve.addIsChordLenKnots(this.builder, props.isChordLenKnots);
|
|
262417
262524
|
if (props.isColinearTangents)
|
|
262418
|
-
|
|
262525
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.InterpolationCurve.addIsColinearTangents(this.builder, props.isColinearTangents);
|
|
262419
262526
|
if (props.isChordLenKnots)
|
|
262420
|
-
|
|
262527
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.InterpolationCurve.addIsChordLenKnots(this.builder, props.isChordLenKnots);
|
|
262421
262528
|
if (props.isNaturalTangents)
|
|
262422
|
-
|
|
262529
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.InterpolationCurve.addIsNaturalTangents(this.builder, props.isNaturalTangents);
|
|
262423
262530
|
// REMARK: some native or flatbuffer quirk made startTangent a point and endTangent a vector.
|
|
262424
262531
|
if (props.startTangent !== undefined) {
|
|
262425
|
-
const startTangentOffset =
|
|
262426
|
-
|
|
262532
|
+
const startTangentOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DPoint3d.createDPoint3d(this.builder, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_9__.XYZ.x(props.startTangent), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_9__.XYZ.y(props.startTangent), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_9__.XYZ.z(props.startTangent));
|
|
262533
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.InterpolationCurve.addStartTangent(this.builder, startTangentOffset);
|
|
262427
262534
|
}
|
|
262428
262535
|
if (props.endTangent !== undefined) {
|
|
262429
|
-
const endTangentOffset =
|
|
262430
|
-
|
|
262536
|
+
const endTangentOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DVector3d.createDVector3d(this.builder, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_9__.XYZ.x(props.endTangent), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_9__.XYZ.y(props.endTangent), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_9__.XYZ.z(props.endTangent));
|
|
262537
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.InterpolationCurve.addEndTangent(this.builder, endTangentOffset);
|
|
262431
262538
|
}
|
|
262432
262539
|
if (knotOffset !== 0)
|
|
262433
|
-
|
|
262434
|
-
const headerOffset =
|
|
262435
|
-
return
|
|
262540
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.InterpolationCurve.addKnots(this.builder, knotOffset);
|
|
262541
|
+
const headerOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.InterpolationCurve.endInterpolationCurve(this.builder);
|
|
262542
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagInterpolationCurve, headerOffset, 0);
|
|
262436
262543
|
}
|
|
262437
262544
|
writeAkimaCurve3dAsFBVariantGeometry(curve) {
|
|
262438
262545
|
const fitPointsOffset = this.writeDoubleArray(curve.copyFitPointsFloat64Array());
|
|
262439
|
-
|
|
262440
|
-
|
|
262441
|
-
const headerOffset =
|
|
262442
|
-
return
|
|
262546
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.AkimaCurve.startAkimaCurve(this.builder);
|
|
262547
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.AkimaCurve.addPoints(this.builder, fitPointsOffset);
|
|
262548
|
+
const headerOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.AkimaCurve.endAkimaCurve(this.builder);
|
|
262549
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagAkimaCurve, headerOffset, 0);
|
|
262443
262550
|
}
|
|
262444
262551
|
writeBsplineCurve3dAsFBVariantGeometry(bcurve) {
|
|
262445
|
-
const data =
|
|
262552
|
+
const data = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_10__.SerializationHelpers.createBSplineCurveData(bcurve.polesRef, bcurve.poleDimension, bcurve.knotsRef, bcurve.numPoles, bcurve.order);
|
|
262446
262553
|
const wrapMode = bcurve.getWrappable();
|
|
262447
|
-
if (
|
|
262554
|
+
if (_bspline_KnotVector__WEBPACK_IMPORTED_MODULE_11__.BSplineWrapMode.None !== wrapMode)
|
|
262448
262555
|
data.params.wrapMode = wrapMode;
|
|
262449
|
-
if (!
|
|
262556
|
+
if (!_SerializationHelpers__WEBPACK_IMPORTED_MODULE_10__.SerializationHelpers.Export.prepareBSplineCurveData(data, { jsonPoles: false }))
|
|
262450
262557
|
return undefined;
|
|
262451
262558
|
const closed = !!data.params.closed;
|
|
262452
262559
|
const polesOffset = this.writeDoubleArray(data.poles);
|
|
262453
262560
|
const weightsOffset = 0;
|
|
262454
262561
|
const knotsOffset = this.writeDoubleArray(data.params.knots);
|
|
262455
|
-
const headerOffset =
|
|
262456
|
-
return
|
|
262562
|
+
const headerOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.BsplineCurve.createBsplineCurve(this.builder, data.params.order, closed, polesOffset, weightsOffset, knotsOffset);
|
|
262563
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagBsplineCurve, headerOffset, 0);
|
|
262457
262564
|
}
|
|
262458
262565
|
writeBSplineSurfaceAsFBVariantGeometry(bsurf) {
|
|
262459
262566
|
let poles = bsurf.coffs;
|
|
262460
262567
|
let weights;
|
|
262461
262568
|
let dim = bsurf.poleDimension;
|
|
262462
|
-
if (bsurf instanceof
|
|
262569
|
+
if (bsurf instanceof _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_12__.BSplineSurface3dH) {
|
|
262463
262570
|
poles = bsurf.copyXYZToFloat64Array(false);
|
|
262464
262571
|
weights = bsurf.copyWeightsToFloat64Array();
|
|
262465
262572
|
dim = 3;
|
|
262466
262573
|
}
|
|
262467
|
-
const data =
|
|
262574
|
+
const data = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_10__.SerializationHelpers.createBSplineSurfaceData(poles, dim, bsurf.knots[_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_12__.UVSelect.uDirection].knots, bsurf.numPolesUV(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_12__.UVSelect.uDirection), bsurf.orderUV(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_12__.UVSelect.uDirection), bsurf.knots[_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_12__.UVSelect.vDirection].knots, bsurf.numPolesUV(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_12__.UVSelect.vDirection), bsurf.orderUV(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_12__.UVSelect.vDirection));
|
|
262468
262575
|
if (weights)
|
|
262469
262576
|
data.weights = weights;
|
|
262470
|
-
const wrapModeU = bsurf.getWrappable(
|
|
262471
|
-
const wrapModeV = bsurf.getWrappable(
|
|
262472
|
-
if (
|
|
262577
|
+
const wrapModeU = bsurf.getWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_12__.UVSelect.uDirection);
|
|
262578
|
+
const wrapModeV = bsurf.getWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_12__.UVSelect.vDirection);
|
|
262579
|
+
if (_bspline_KnotVector__WEBPACK_IMPORTED_MODULE_11__.BSplineWrapMode.None !== wrapModeU)
|
|
262473
262580
|
data.uParams.wrapMode = wrapModeU;
|
|
262474
|
-
if (
|
|
262581
|
+
if (_bspline_KnotVector__WEBPACK_IMPORTED_MODULE_11__.BSplineWrapMode.None !== wrapModeV)
|
|
262475
262582
|
data.vParams.wrapMode = wrapModeV;
|
|
262476
|
-
if (!
|
|
262583
|
+
if (!_SerializationHelpers__WEBPACK_IMPORTED_MODULE_10__.SerializationHelpers.Export.prepareBSplineSurfaceData(data, { jsonPoles: false }))
|
|
262477
262584
|
return undefined;
|
|
262478
262585
|
// TypeScript B-spline surfaces do not support trim curves or isoline counts
|
|
262479
262586
|
const holeOrigin = 0;
|
|
@@ -262486,64 +262593,64 @@ class BGFBWriter {
|
|
|
262486
262593
|
const weightsOffset = data.weights ? this.writeDoubleArray(data.weights) : 0;
|
|
262487
262594
|
const uKnotsOffset = this.writeDoubleArray(data.uParams.knots);
|
|
262488
262595
|
const vKnotsOffset = this.writeDoubleArray(data.vParams.knots);
|
|
262489
|
-
const headerOffset =
|
|
262490
|
-
return
|
|
262596
|
+
const headerOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.BsplineSurface.createBsplineSurface(this.builder, polesOffset, weightsOffset, uKnotsOffset, vKnotsOffset, data.uParams.numPoles, data.vParams.numPoles, data.uParams.order, data.vParams.order, numRulesU, numRulesV, holeOrigin, boundariesOffset, closedU, closedV);
|
|
262597
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagBsplineSurface, headerOffset, 0);
|
|
262491
262598
|
}
|
|
262492
262599
|
writeBsplineCurve3dHAsFBVariantGeometry(bcurve) {
|
|
262493
262600
|
const poles = bcurve.copyXYZFloat64Array(false);
|
|
262494
262601
|
const weights = bcurve.copyWeightsFloat64Array();
|
|
262495
262602
|
const dim = 3;
|
|
262496
|
-
const data =
|
|
262603
|
+
const data = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_10__.SerializationHelpers.createBSplineCurveData(poles, dim, bcurve.knotsRef, bcurve.numPoles, bcurve.order);
|
|
262497
262604
|
data.weights = weights;
|
|
262498
262605
|
const wrapMode = bcurve.getWrappable();
|
|
262499
|
-
if (
|
|
262606
|
+
if (_bspline_KnotVector__WEBPACK_IMPORTED_MODULE_11__.BSplineWrapMode.None !== wrapMode)
|
|
262500
262607
|
data.params.wrapMode = wrapMode;
|
|
262501
|
-
if (!
|
|
262608
|
+
if (!_SerializationHelpers__WEBPACK_IMPORTED_MODULE_10__.SerializationHelpers.Export.prepareBSplineCurveData(data, { jsonPoles: false }))
|
|
262502
262609
|
return undefined;
|
|
262503
262610
|
const closed = !!data.params.closed;
|
|
262504
262611
|
const polesOffset = this.writeDoubleArray(data.poles);
|
|
262505
262612
|
const weightsOffset = this.writeDoubleArray(data.weights);
|
|
262506
262613
|
const knotsOffset = this.writeDoubleArray(data.params.knots);
|
|
262507
|
-
const headerOffset =
|
|
262508
|
-
return
|
|
262614
|
+
const headerOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.BsplineCurve.createBsplineCurve(this.builder, data.params.order, closed, polesOffset, weightsOffset, knotsOffset);
|
|
262615
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagBsplineCurve, headerOffset, 0);
|
|
262509
262616
|
}
|
|
262510
262617
|
writeCurvePrimitiveAsFBVariantGeometry(curvePrimitive) {
|
|
262511
|
-
if (curvePrimitive instanceof
|
|
262512
|
-
const segmentDataOffset =
|
|
262513
|
-
const lineSegmentOffset =
|
|
262514
|
-
return
|
|
262618
|
+
if (curvePrimitive instanceof _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_13__.LineSegment3d) {
|
|
262619
|
+
const segmentDataOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DSegment3d.createDSegment3d(this.builder, curvePrimitive.point0Ref.x, curvePrimitive.point0Ref.y, curvePrimitive.point0Ref.z, curvePrimitive.point1Ref.x, curvePrimitive.point1Ref.y, curvePrimitive.point1Ref.z);
|
|
262620
|
+
const lineSegmentOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.LineSegment.createLineSegment(this.builder, segmentDataOffset);
|
|
262621
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagLineSegment, lineSegmentOffset, 0);
|
|
262515
262622
|
}
|
|
262516
|
-
else if (curvePrimitive instanceof
|
|
262623
|
+
else if (curvePrimitive instanceof _curve_Arc3d__WEBPACK_IMPORTED_MODULE_14__.Arc3d) {
|
|
262517
262624
|
const data = curvePrimitive.toVectors();
|
|
262518
|
-
const arcDataOffset =
|
|
262519
|
-
const arcOffset =
|
|
262520
|
-
return
|
|
262625
|
+
const arcDataOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DEllipse3d.createDEllipse3d(this.builder, data.center.x, data.center.y, data.center.z, data.vector0.x, data.vector0.y, data.vector0.z, data.vector90.x, data.vector90.y, data.vector90.z, data.sweep.startRadians, data.sweep.sweepRadians);
|
|
262626
|
+
const arcOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.EllipticArc.createEllipticArc(this.builder, arcDataOffset);
|
|
262627
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagEllipticArc, arcOffset, 0);
|
|
262521
262628
|
}
|
|
262522
|
-
else if (curvePrimitive instanceof
|
|
262629
|
+
else if (curvePrimitive instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_15__.LineString3d) {
|
|
262523
262630
|
const coordinates = extractNumberArray(curvePrimitive.packedPoints);
|
|
262524
|
-
const lineStringOffset =
|
|
262525
|
-
return
|
|
262631
|
+
const lineStringOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.LineString.createLineString(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.LineString.createPointsVector(this.builder, coordinates));
|
|
262632
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagLineString, lineStringOffset, 0);
|
|
262526
262633
|
}
|
|
262527
|
-
else if (curvePrimitive instanceof
|
|
262634
|
+
else if (curvePrimitive instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_16__.BSplineCurve3d) {
|
|
262528
262635
|
return this.writeBsplineCurve3dAsFBVariantGeometry(curvePrimitive);
|
|
262529
262636
|
}
|
|
262530
|
-
else if (curvePrimitive instanceof
|
|
262637
|
+
else if (curvePrimitive instanceof _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_17__.BSplineCurve3dH) {
|
|
262531
262638
|
return this.writeBsplineCurve3dHAsFBVariantGeometry(curvePrimitive);
|
|
262532
262639
|
}
|
|
262533
|
-
else if (curvePrimitive instanceof
|
|
262640
|
+
else if (curvePrimitive instanceof _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_18__.InterpolationCurve3d) {
|
|
262534
262641
|
return this.writeInterpolationCurve3dAsFBVariantGeometry(curvePrimitive);
|
|
262535
262642
|
}
|
|
262536
|
-
else if (curvePrimitive instanceof
|
|
262643
|
+
else if (curvePrimitive instanceof _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_19__.AkimaCurve3d) {
|
|
262537
262644
|
return this.writeAkimaCurve3dAsFBVariantGeometry(curvePrimitive);
|
|
262538
262645
|
}
|
|
262539
|
-
else if (curvePrimitive instanceof
|
|
262646
|
+
else if (curvePrimitive instanceof _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_20__.IntegratedSpiral3d) {
|
|
262540
262647
|
const placement = curvePrimitive.localToWorld;
|
|
262541
|
-
const typeCode =
|
|
262542
|
-
const spiralDetailOffset =
|
|
262543
|
-
const transitionTableOffset =
|
|
262544
|
-
return
|
|
262648
|
+
const typeCode = _BGFBReader__WEBPACK_IMPORTED_MODULE_21__.DgnSpiralTypeQueries.stringToTypeCode(curvePrimitive.spiralType, true);
|
|
262649
|
+
const spiralDetailOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.TransitionSpiralDetail.createTransitionSpiralDetail(this.builder, placement.matrix.coffs[0], placement.matrix.coffs[1], placement.matrix.coffs[2], placement.origin.x, placement.matrix.coffs[3], placement.matrix.coffs[4], placement.matrix.coffs[5], placement.origin.y, placement.matrix.coffs[6], placement.matrix.coffs[5], placement.matrix.coffs[8], placement.origin.z, curvePrimitive.activeFractionInterval.x0, curvePrimitive.activeFractionInterval.x1, curvePrimitive.bearing01.startRadians, curvePrimitive.bearing01.endRadians, _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_22__.TransitionSpiral3d.radiusToCurvature(curvePrimitive.radius01.x0), _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_22__.TransitionSpiral3d.radiusToCurvature(curvePrimitive.radius01.x1), typeCode, 0);
|
|
262650
|
+
const transitionTableOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.TransitionSpiral.createTransitionSpiral(this.builder, spiralDetailOffset, 0, 0);
|
|
262651
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagTransitionSpiral, transitionTableOffset, 0);
|
|
262545
262652
|
}
|
|
262546
|
-
else if (curvePrimitive instanceof
|
|
262653
|
+
else if (curvePrimitive instanceof _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_23__.DirectSpiral3d) {
|
|
262547
262654
|
const placement = curvePrimitive.localToWorld;
|
|
262548
262655
|
// direct spirals always inflect at the origin of the local frame ..
|
|
262549
262656
|
// spiral
|
|
@@ -262553,26 +262660,26 @@ class BGFBWriter {
|
|
|
262553
262660
|
const radius1 = curvePrimitive.nominalR1; // which is 1/curvature1
|
|
262554
262661
|
const nominalLength = curvePrimitive.nominalL1;
|
|
262555
262662
|
const bearing0Radians = 0.0;
|
|
262556
|
-
const bearing1Radians =
|
|
262557
|
-
const typeCode =
|
|
262558
|
-
const spiralDetailOffset =
|
|
262559
|
-
const transitionTableOffset =
|
|
262560
|
-
return
|
|
262663
|
+
const bearing1Radians = _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_22__.TransitionSpiral3d.radiusRadiusLengthToSweepRadians(radius0, radius1, nominalLength);
|
|
262664
|
+
const typeCode = _BGFBReader__WEBPACK_IMPORTED_MODULE_21__.DgnSpiralTypeQueries.stringToTypeCode(curvePrimitive.spiralType, true);
|
|
262665
|
+
const spiralDetailOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.TransitionSpiralDetail.createTransitionSpiralDetail(this.builder, placement.matrix.coffs[0], placement.matrix.coffs[1], placement.matrix.coffs[2], placement.origin.x, placement.matrix.coffs[3], placement.matrix.coffs[4], placement.matrix.coffs[5], placement.origin.y, placement.matrix.coffs[6], placement.matrix.coffs[5], placement.matrix.coffs[8], placement.origin.z, curvePrimitive.activeFractionInterval.x0, curvePrimitive.activeFractionInterval.x1, bearing0Radians, bearing1Radians, curvature0, curvature1, typeCode, 0);
|
|
262666
|
+
const transitionTableOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.TransitionSpiral.createTransitionSpiral(this.builder, spiralDetailOffset, 0, 0);
|
|
262667
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagTransitionSpiral, transitionTableOffset, 0);
|
|
262561
262668
|
}
|
|
262562
262669
|
return undefined;
|
|
262563
262670
|
}
|
|
262564
262671
|
writePointString3dAsFBVariantGeometry(pointString) {
|
|
262565
|
-
if (pointString instanceof
|
|
262672
|
+
if (pointString instanceof _curve_PointString3d__WEBPACK_IMPORTED_MODULE_24__.PointString3d) {
|
|
262566
262673
|
const coordinates = extractNumberArray(pointString.points);
|
|
262567
|
-
const headerOffset =
|
|
262568
|
-
return
|
|
262674
|
+
const headerOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.PointString.createPointString(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.PointString.createPointsVector(this.builder, coordinates));
|
|
262675
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagPointString, headerOffset, 0);
|
|
262569
262676
|
}
|
|
262570
262677
|
return undefined;
|
|
262571
262678
|
}
|
|
262572
262679
|
writeSolidPrimitiveAsFBVariantGeometry(solid) {
|
|
262573
262680
|
// NOTE: Box, Sphere, Cone, and TorusPipe have "detail" within a "table"
|
|
262574
262681
|
// BUT: linear, rotational, and ruled sweeps have their contour and numerics directly within their table.
|
|
262575
|
-
if (solid instanceof
|
|
262682
|
+
if (solid instanceof _solid_Box__WEBPACK_IMPORTED_MODULE_25__.Box) {
|
|
262576
262683
|
const originA = solid.getBaseOrigin();
|
|
262577
262684
|
const originB = solid.getTopOrigin();
|
|
262578
262685
|
const vectorX = solid.getVectorX();
|
|
@@ -262581,55 +262688,55 @@ class BGFBWriter {
|
|
|
262581
262688
|
const baseY = solid.getBaseY();
|
|
262582
262689
|
const topX = solid.getTopX();
|
|
262583
262690
|
const topY = solid.getTopY();
|
|
262584
|
-
const detailOffset =
|
|
262585
|
-
const carrierOffset =
|
|
262586
|
-
return
|
|
262691
|
+
const detailOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnBoxDetail.createDgnBoxDetail(this.builder, originA.x, originA.y, originA.z, originB.x, originB.y, originB.z, vectorX.x, vectorX.y, vectorX.z, vectorY.x, vectorY.y, vectorY.z, baseX, baseY, topX, topY, solid.capped);
|
|
262692
|
+
const carrierOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnBox.createDgnBox(this.builder, detailOffset);
|
|
262693
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagDgnBox, carrierOffset, 0);
|
|
262587
262694
|
}
|
|
262588
|
-
else if (solid instanceof
|
|
262695
|
+
else if (solid instanceof _solid_Sphere__WEBPACK_IMPORTED_MODULE_26__.Sphere) {
|
|
262589
262696
|
const localToWorld = solid.cloneLocalToWorld();
|
|
262590
262697
|
const sweep = solid.cloneLatitudeSweep();
|
|
262591
|
-
const detailOffset =
|
|
262592
|
-
const carrierOffset =
|
|
262593
|
-
return
|
|
262698
|
+
const detailOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnSphereDetail.createDgnSphereDetail(this.builder, localToWorld.matrix.coffs[0], localToWorld.matrix.coffs[1], localToWorld.matrix.coffs[2], localToWorld.origin.x, localToWorld.matrix.coffs[3], localToWorld.matrix.coffs[4], localToWorld.matrix.coffs[5], localToWorld.origin.y, localToWorld.matrix.coffs[6], localToWorld.matrix.coffs[7], localToWorld.matrix.coffs[8], localToWorld.origin.z, sweep.startRadians, sweep.sweepRadians, solid.capped);
|
|
262699
|
+
const carrierOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnSphere.createDgnSphere(this.builder, detailOffset);
|
|
262700
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagDgnSphere, carrierOffset, 0);
|
|
262594
262701
|
}
|
|
262595
|
-
else if (solid instanceof
|
|
262702
|
+
else if (solid instanceof _solid_Cone__WEBPACK_IMPORTED_MODULE_27__.Cone) {
|
|
262596
262703
|
const centerA = solid.getCenterA();
|
|
262597
262704
|
const centerB = solid.getCenterB();
|
|
262598
262705
|
const vectorX = solid.getVectorX();
|
|
262599
262706
|
const vectorY = solid.getVectorY();
|
|
262600
262707
|
const radiusA = solid.getRadiusA();
|
|
262601
262708
|
const radiusB = solid.getRadiusB();
|
|
262602
|
-
const detailOffset =
|
|
262603
|
-
const carrierOffset =
|
|
262604
|
-
return
|
|
262709
|
+
const detailOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnConeDetail.createDgnConeDetail(this.builder, centerA.x, centerA.y, centerA.z, centerB.x, centerB.y, centerB.z, vectorX.x, vectorX.y, vectorX.z, vectorY.x, vectorY.y, vectorY.z, radiusA, radiusB, solid.capped);
|
|
262710
|
+
const carrierOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnCone.createDgnCone(this.builder, detailOffset);
|
|
262711
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagDgnCone, carrierOffset, 0);
|
|
262605
262712
|
}
|
|
262606
|
-
else if (solid instanceof
|
|
262713
|
+
else if (solid instanceof _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_28__.TorusPipe) {
|
|
262607
262714
|
const center = solid.cloneCenter();
|
|
262608
262715
|
const vectorX = solid.cloneVectorX();
|
|
262609
262716
|
const vectorY = solid.cloneVectorY();
|
|
262610
262717
|
const minorRadius = solid.getMinorRadius();
|
|
262611
262718
|
const majorRadius = solid.getMajorRadius();
|
|
262612
262719
|
const sweepRadians = solid.getSweepAngle().radians;
|
|
262613
|
-
const detailOffset =
|
|
262614
|
-
const carrierOffset =
|
|
262615
|
-
return
|
|
262720
|
+
const detailOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnTorusPipeDetail.createDgnTorusPipeDetail(this.builder, center.x, center.y, center.z, vectorX.x, vectorX.y, vectorX.z, vectorY.x, vectorY.y, vectorY.z, majorRadius, minorRadius, sweepRadians, solid.capped);
|
|
262721
|
+
const carrierOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnTorusPipe.createDgnTorusPipe(this.builder, detailOffset);
|
|
262722
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagDgnTorusPipe, carrierOffset, 0);
|
|
262616
262723
|
}
|
|
262617
|
-
else if (solid instanceof
|
|
262724
|
+
else if (solid instanceof _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_29__.LinearSweep) {
|
|
262618
262725
|
const baseCurveOffset = this.writeCurveCollectionAsFBCurveVector(solid.getSweepContourRef().getCurves());
|
|
262619
262726
|
const sweepVector = solid.cloneSweepVector();
|
|
262620
262727
|
// const sweepVectorOffset = BGFBAccessors.DVector3d.createDVector3d(this.builder, sweepVector.x, sweepVector.y, sweepVector.z);
|
|
262621
262728
|
// const carrierOffset = BGFBAccessors.DgnExtrusion.createDgnExtrusion(this.builder, contourOffset, sweepVectorOffset, solid.capped);
|
|
262622
262729
|
// WOW -- the machine generated createDgnExtrusion expects an offset for the sweepVector, but then
|
|
262623
262730
|
// chokes trying to add it.
|
|
262624
|
-
|
|
262625
|
-
|
|
262626
|
-
const extrusionVectorOffset =
|
|
262627
|
-
|
|
262628
|
-
|
|
262629
|
-
const dgnExtrusionOffset =
|
|
262630
|
-
return
|
|
262631
|
-
}
|
|
262632
|
-
else if (solid instanceof
|
|
262731
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnExtrusion.startDgnExtrusion(this.builder);
|
|
262732
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnExtrusion.addBaseCurve(this.builder, baseCurveOffset);
|
|
262733
|
+
const extrusionVectorOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DVector3d.createDVector3d(this.builder, sweepVector.x, sweepVector.y, sweepVector.z);
|
|
262734
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnExtrusion.addExtrusionVector(this.builder, extrusionVectorOffset);
|
|
262735
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnExtrusion.addCapped(this.builder, solid.capped);
|
|
262736
|
+
const dgnExtrusionOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnExtrusion.endDgnExtrusion(this.builder);
|
|
262737
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagDgnExtrusion, dgnExtrusionOffset, 0);
|
|
262738
|
+
}
|
|
262739
|
+
else if (solid instanceof _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_30__.RotationalSweep) {
|
|
262633
262740
|
const baseCurveOffset = this.writeCurveCollectionAsFBCurveVector(solid.getSweepContourRef().getCurves());
|
|
262634
262741
|
const axis = solid.cloneAxisRay();
|
|
262635
262742
|
const sweepAngle = solid.getSweep();
|
|
@@ -262637,16 +262744,16 @@ class BGFBWriter {
|
|
|
262637
262744
|
// const carrierOffset = BGFBAccessors.DgnExtrusion.createDgnExtrusion(this.builder, contourOffset, sweepVectorOffset, solid.capped);
|
|
262638
262745
|
// WOW -- the machine generated createDgnExtrusion expects an offset for the sweepVector, but then
|
|
262639
262746
|
// chokes trying to add it.
|
|
262640
|
-
|
|
262641
|
-
|
|
262642
|
-
const axisRayOffset =
|
|
262643
|
-
|
|
262644
|
-
|
|
262645
|
-
|
|
262646
|
-
const dgnRotationalSweepOffset =
|
|
262647
|
-
return
|
|
262648
|
-
}
|
|
262649
|
-
else if (solid instanceof
|
|
262747
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnRotationalSweep.startDgnRotationalSweep(this.builder);
|
|
262748
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnRotationalSweep.addBaseCurve(this.builder, baseCurveOffset);
|
|
262749
|
+
const axisRayOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DRay3d.createDRay3d(this.builder, axis.origin.x, axis.origin.y, axis.origin.z, axis.direction.x, axis.direction.y, axis.direction.z);
|
|
262750
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnRotationalSweep.addAxis(this.builder, axisRayOffset);
|
|
262751
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnRotationalSweep.addSweepRadians(this.builder, sweepAngle.radians);
|
|
262752
|
+
_BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnRotationalSweep.addCapped(this.builder, solid.capped);
|
|
262753
|
+
const dgnRotationalSweepOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnRotationalSweep.endDgnRotationalSweep(this.builder);
|
|
262754
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagDgnRotationalSweep, dgnRotationalSweepOffset, 0);
|
|
262755
|
+
}
|
|
262756
|
+
else if (solid instanceof _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_31__.RuledSweep) {
|
|
262650
262757
|
const contours = solid.sweepContoursRef();
|
|
262651
262758
|
const contourOffsets = [];
|
|
262652
262759
|
for (const contour of contours) {
|
|
@@ -262654,42 +262761,42 @@ class BGFBWriter {
|
|
|
262654
262761
|
if (contourOffset !== undefined)
|
|
262655
262762
|
contourOffsets.push(contourOffset);
|
|
262656
262763
|
}
|
|
262657
|
-
const contoursVectorOffset =
|
|
262658
|
-
const ruledSweepTable =
|
|
262659
|
-
return
|
|
262764
|
+
const contoursVectorOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnRuledSweep.createCurvesVector(this.builder, contourOffsets);
|
|
262765
|
+
const ruledSweepTable = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.DgnRuledSweep.createDgnRuledSweep(this.builder, contoursVectorOffset, solid.capped);
|
|
262766
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagDgnRuledSweep, ruledSweepTable, 0);
|
|
262660
262767
|
}
|
|
262661
262768
|
return undefined;
|
|
262662
262769
|
}
|
|
262663
262770
|
writePolyfaceAuxChannelDataAsFBVariantGeometry(channelData) {
|
|
262664
|
-
if (channelData instanceof
|
|
262665
|
-
const valuesOffset =
|
|
262666
|
-
return
|
|
262771
|
+
if (channelData instanceof _polyface_AuxData__WEBPACK_IMPORTED_MODULE_32__.AuxChannelData) {
|
|
262772
|
+
const valuesOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.PolyfaceAuxChannelData.createValuesVector(this.builder, channelData.values);
|
|
262773
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.PolyfaceAuxChannelData.createPolyfaceAuxChannelData(this.builder, channelData.input, valuesOffset);
|
|
262667
262774
|
}
|
|
262668
262775
|
return undefined;
|
|
262669
262776
|
}
|
|
262670
262777
|
writePolyfaceAuxChannelAsFBVariantGeometry(channel) {
|
|
262671
|
-
if (channel instanceof
|
|
262778
|
+
if (channel instanceof _polyface_AuxData__WEBPACK_IMPORTED_MODULE_32__.AuxChannel) {
|
|
262672
262779
|
const channelDataOffsets = [];
|
|
262673
262780
|
for (const channelData of channel.data) {
|
|
262674
262781
|
channelDataOffsets.push(this.writePolyfaceAuxChannelDataAsFBVariantGeometry(channelData));
|
|
262675
262782
|
}
|
|
262676
|
-
const valuesOffset =
|
|
262783
|
+
const valuesOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.PolyfaceAuxChannel.createDataVector(this.builder, channelDataOffsets);
|
|
262677
262784
|
const nameOffset = channel.name ? this.builder.createString(channel.name) : 0;
|
|
262678
262785
|
const inputNameOffset = channel.inputName ? this.builder.createString(channel.inputName) : 0;
|
|
262679
|
-
return
|
|
262786
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.PolyfaceAuxChannel.createPolyfaceAuxChannel(this.builder, channel.dataType, nameOffset, inputNameOffset, valuesOffset);
|
|
262680
262787
|
}
|
|
262681
262788
|
return undefined;
|
|
262682
262789
|
}
|
|
262683
262790
|
writePolyfaceAuxDataAsFBVariantGeometry(mesh, data) {
|
|
262684
|
-
if (data instanceof
|
|
262791
|
+
if (data instanceof _polyface_AuxData__WEBPACK_IMPORTED_MODULE_32__.PolyfaceAuxData) {
|
|
262685
262792
|
const channelOffsets = [];
|
|
262686
262793
|
for (const channel of data.channels)
|
|
262687
262794
|
channelOffsets.push(this.writePolyfaceAuxChannelAsFBVariantGeometry(channel));
|
|
262688
|
-
const channelOffsetsOffset =
|
|
262795
|
+
const channelOffsetsOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.PolyfaceAuxChannel.createDataVector(this.builder, channelOffsets);
|
|
262689
262796
|
const indexArray = [];
|
|
262690
262797
|
this.fillOneBasedIndexArray(mesh, data.indices, undefined, 0, indexArray);
|
|
262691
|
-
const indicesOffset =
|
|
262692
|
-
return
|
|
262798
|
+
const indicesOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.PolyfaceAuxData.createIndicesVector(this.builder, indexArray);
|
|
262799
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.PolyfaceAuxData.createPolyfaceAuxData(this.builder, indicesOffset, channelOffsetsOffset);
|
|
262693
262800
|
}
|
|
262694
262801
|
return undefined;
|
|
262695
262802
|
}
|
|
@@ -262697,17 +262804,17 @@ class BGFBWriter {
|
|
|
262697
262804
|
if (data) {
|
|
262698
262805
|
const intDataOffset = this.writeIntArray(data.intData);
|
|
262699
262806
|
const doubleDataOffset = this.writeDoubleArray(data.doubleData);
|
|
262700
|
-
return
|
|
262807
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.TaggedNumericData.createTaggedNumericData(this.builder, data.tagA, data.tagB, intDataOffset, doubleDataOffset);
|
|
262701
262808
|
}
|
|
262702
262809
|
return 0;
|
|
262703
262810
|
}
|
|
262704
262811
|
writePolyfaceAsFBVariantGeometry(mesh) {
|
|
262705
|
-
if (mesh instanceof
|
|
262812
|
+
if (mesh instanceof _polyface_Polyface__WEBPACK_IMPORTED_MODULE_33__.IndexedPolyface) {
|
|
262706
262813
|
// WE KNOW . . . . the polyface has blocks of zero-based indices.
|
|
262707
262814
|
const indexArray = []; // and this will really be integers.
|
|
262708
262815
|
const numberArray = []; // and this will really be doubles.
|
|
262709
262816
|
copyToPackedNumberArray(numberArray, mesh.data.point.float64Data(), mesh.data.point.float64Length);
|
|
262710
|
-
const pointOffset =
|
|
262817
|
+
const pointOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.Polyface.createPointVector(this.builder, numberArray);
|
|
262711
262818
|
let paramIndexOffset = 0;
|
|
262712
262819
|
let normalIndexOffset = 0;
|
|
262713
262820
|
let colorIndexOffset = 0;
|
|
@@ -262716,45 +262823,58 @@ class BGFBWriter {
|
|
|
262716
262823
|
let paramOffset = 0;
|
|
262717
262824
|
let auxDataOffset = 0;
|
|
262718
262825
|
let taggedNumericDataOffset = 0;
|
|
262719
|
-
|
|
262720
|
-
const
|
|
262826
|
+
let edgeMateIndexOffset = 0;
|
|
262827
|
+
const meshStyle = 1; // always write MESH_ELM_STYLE_INDEXED_FACE_LOOPS
|
|
262828
|
+
const numPerFace = 0; // always write variable sized, 0-terminated face loops
|
|
262721
262829
|
this.fillOneBasedIndexArray(mesh, mesh.data.pointIndex, mesh.data.edgeVisible, 0, indexArray);
|
|
262722
262830
|
const twoSided = mesh.twoSided;
|
|
262723
|
-
const pointIndexOffset =
|
|
262831
|
+
const pointIndexOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.Polyface.createPointIndexVector(this.builder, indexArray);
|
|
262724
262832
|
if (mesh.data.paramIndex !== undefined && mesh.data.paramIndex.length > 0) {
|
|
262725
262833
|
this.fillOneBasedIndexArray(mesh, mesh.data.paramIndex, undefined, 0, indexArray);
|
|
262726
|
-
paramIndexOffset =
|
|
262834
|
+
paramIndexOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.Polyface.createParamIndexVector(this.builder, indexArray);
|
|
262727
262835
|
}
|
|
262728
262836
|
if (mesh.data.normalIndex !== undefined && mesh.data.normalIndex.length > 0) {
|
|
262729
262837
|
this.fillOneBasedIndexArray(mesh, mesh.data.normalIndex, undefined, 0, indexArray);
|
|
262730
|
-
normalIndexOffset =
|
|
262838
|
+
normalIndexOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.Polyface.createNormalIndexVector(this.builder, indexArray);
|
|
262731
262839
|
}
|
|
262732
262840
|
if (mesh.data.colorIndex !== undefined && mesh.data.colorIndex.length > 0) {
|
|
262733
262841
|
this.fillOneBasedIndexArray(mesh, mesh.data.colorIndex, undefined, 0, indexArray);
|
|
262734
|
-
colorIndexOffset =
|
|
262842
|
+
colorIndexOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.Polyface.createColorIndexVector(this.builder, indexArray);
|
|
262735
262843
|
}
|
|
262844
|
+
// only int colors are persistent
|
|
262736
262845
|
if (mesh.data.color !== undefined && mesh.data.color.length > 0) {
|
|
262737
|
-
intColorOffset =
|
|
262846
|
+
intColorOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.Polyface.createIntColorVector(this.builder, mesh.data.color);
|
|
262738
262847
|
}
|
|
262739
262848
|
if (mesh.data.normal) {
|
|
262740
262849
|
copyToPackedNumberArray(numberArray, mesh.data.normal.float64Data(), mesh.data.normal.float64Length);
|
|
262741
|
-
normalOffset =
|
|
262850
|
+
normalOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.Polyface.createNormalVector(this.builder, numberArray);
|
|
262742
262851
|
}
|
|
262743
262852
|
if (mesh.data.param) {
|
|
262744
262853
|
copyToPackedNumberArray(numberArray, mesh.data.param.float64Data(), mesh.data.param.float64Length);
|
|
262745
|
-
paramOffset =
|
|
262854
|
+
paramOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.Polyface.createPointVector(this.builder, numberArray);
|
|
262746
262855
|
}
|
|
262747
262856
|
if (mesh.data.auxData)
|
|
262748
262857
|
auxDataOffset = this.writePolyfaceAuxDataAsFBVariantGeometry(mesh, mesh.data.auxData);
|
|
262749
262858
|
if (mesh.data.taggedNumericData)
|
|
262750
262859
|
taggedNumericDataOffset = this.writeTaggedNumericDataArray(mesh.data.taggedNumericData);
|
|
262751
262860
|
const expectedClosure = mesh.expectedClosure;
|
|
262861
|
+
if (mesh.data.edgeMateIndex) {
|
|
262862
|
+
indexArray.length = 0;
|
|
262863
|
+
if (!_SerializationHelpers__WEBPACK_IMPORTED_MODULE_10__.SerializationHelpers.announceUncompressedZeroBasedReflexiveIndices(mesh.data.edgeMateIndex, mesh.facetStart, _SerializationHelpers__WEBPACK_IMPORTED_MODULE_10__.SerializationHelpers.EdgeMateIndex.BlockSeparator, _SerializationHelpers__WEBPACK_IMPORTED_MODULE_10__.SerializationHelpers.EdgeMateIndex.NoEdgeMate, (i) => indexArray.push(i))) {
|
|
262864
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__.assert)(false, "unable to serialize edgeMateIndex array to flatbuffer");
|
|
262865
|
+
}
|
|
262866
|
+
edgeMateIndexOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.Polyface.createEdgeMateIndexVector(this.builder, indexArray);
|
|
262867
|
+
}
|
|
262752
262868
|
// NOTE: mesh.data.face is not persistent
|
|
262753
|
-
const polyfaceOffset =
|
|
262754
|
-
return
|
|
262869
|
+
const polyfaceOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.Polyface.createPolyface(this.builder, pointOffset, paramOffset, normalOffset, 0, intColorOffset, pointIndexOffset, paramIndexOffset, normalIndexOffset, colorIndexOffset, 0, numPerFace, 0, meshStyle, twoSided, 0, 0, auxDataOffset, expectedClosure, taggedNumericDataOffset, edgeMateIndexOffset);
|
|
262870
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagPolyface, polyfaceOffset, 0);
|
|
262755
262871
|
}
|
|
262756
262872
|
return undefined;
|
|
262757
262873
|
}
|
|
262874
|
+
/**
|
|
262875
|
+
* @param sourceIndex a map that takes zeroBasedDataIndex -> zeroBasedDataIndex, packed into unterminated face loops delineated by `mesh.facetIndex0/1`
|
|
262876
|
+
* @param destIndex a map that takes zeroBasedDataIndex -> signedOneBasedDataIndex, packed into optionally terminated face loops
|
|
262877
|
+
*/
|
|
262758
262878
|
fillOneBasedIndexArray(mesh, sourceIndex, visible, facetTerminator, destIndex) {
|
|
262759
262879
|
destIndex.length = 0;
|
|
262760
262880
|
const numFacet = mesh.facetCount;
|
|
@@ -262773,19 +262893,19 @@ class BGFBWriter {
|
|
|
262773
262893
|
}
|
|
262774
262894
|
writeGeometryQueryAsFBVariantGeometry(g) {
|
|
262775
262895
|
let offset;
|
|
262776
|
-
if (g instanceof
|
|
262896
|
+
if (g instanceof _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__.CurvePrimitive && (offset = this.writeCurvePrimitiveAsFBVariantGeometry(g)) !== undefined)
|
|
262777
262897
|
return offset;
|
|
262778
|
-
if (g instanceof
|
|
262898
|
+
if (g instanceof _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_3__.CurveCollection && (offset = this.writeCurveCollectionAsFBVariantGeometry(g)) !== undefined)
|
|
262779
262899
|
return offset;
|
|
262780
|
-
if (g instanceof
|
|
262900
|
+
if (g instanceof _polyface_Polyface__WEBPACK_IMPORTED_MODULE_33__.IndexedPolyface && (offset = this.writePolyfaceAsFBVariantGeometry(g)) !== undefined)
|
|
262781
262901
|
return offset;
|
|
262782
|
-
if (g instanceof
|
|
262902
|
+
if (g instanceof _solid_SolidPrimitive__WEBPACK_IMPORTED_MODULE_34__.SolidPrimitive && (offset = this.writeSolidPrimitiveAsFBVariantGeometry(g)) !== undefined)
|
|
262783
262903
|
return offset;
|
|
262784
|
-
if (g instanceof
|
|
262904
|
+
if (g instanceof _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_12__.BSplineSurface3d && (offset = this.writeBSplineSurfaceAsFBVariantGeometry(g)) !== undefined)
|
|
262785
262905
|
return offset;
|
|
262786
|
-
if (g instanceof
|
|
262906
|
+
if (g instanceof _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_12__.BSplineSurface3dH && (offset = this.writeBSplineSurfaceAsFBVariantGeometry(g)) !== undefined)
|
|
262787
262907
|
return offset;
|
|
262788
|
-
if (g instanceof
|
|
262908
|
+
if (g instanceof _curve_PointString3d__WEBPACK_IMPORTED_MODULE_24__.PointString3d && (offset = this.writePointString3dAsFBVariantGeometry(g)) !== undefined)
|
|
262789
262909
|
return offset;
|
|
262790
262910
|
// if (g instanceof CoordinateXYZ) // TODO
|
|
262791
262911
|
return undefined;
|
|
@@ -262799,12 +262919,12 @@ class BGFBWriter {
|
|
|
262799
262919
|
allOffsets.push(offset);
|
|
262800
262920
|
}
|
|
262801
262921
|
if (allOffsets.length > 0) {
|
|
262802
|
-
const membersOffset =
|
|
262803
|
-
const vectorOffset =
|
|
262804
|
-
return
|
|
262922
|
+
const membersOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VectorOfVariantGeometry.createMembersVector(this.builder, allOffsets);
|
|
262923
|
+
const vectorOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VectorOfVariantGeometry.createVectorOfVariantGeometry(this.builder, membersOffset);
|
|
262924
|
+
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_4__.BGFBAccessors.VariantGeometryUnion.tagVectorOfVariantGeometry, vectorOffset, 0);
|
|
262805
262925
|
}
|
|
262806
262926
|
}
|
|
262807
|
-
else if (allGeometry instanceof
|
|
262927
|
+
else if (allGeometry instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_35__.GeometryQuery)
|
|
262808
262928
|
return this.writeGeometryQueryAsFBVariantGeometry(allGeometry);
|
|
262809
262929
|
return undefined;
|
|
262810
262930
|
}
|
|
@@ -262846,7 +262966,7 @@ class BGFBWriter {
|
|
|
262846
262966
|
}
|
|
262847
262967
|
function extractNumberArray(data) {
|
|
262848
262968
|
const result = [];
|
|
262849
|
-
if (data instanceof
|
|
262969
|
+
if (data instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_36__.GrowableXYZArray) {
|
|
262850
262970
|
// ugh -- accessors only deal with number[] ..
|
|
262851
262971
|
const numCoordinate = 3 * data.length;
|
|
262852
262972
|
const source = data.float64Data();
|
|
@@ -262907,6 +263027,7 @@ class BentleyGeometryFlatBuffer {
|
|
|
262907
263027
|
return _BGFBReader__WEBPACK_IMPORTED_MODULE_1__.BGFBReader.bytesToGeometry(justTheBytes, hasVersionSignature ? signatureBytes : undefined);
|
|
262908
263028
|
}
|
|
262909
263029
|
}
|
|
263030
|
+
/** "bg0001fb" header, persisted in iModel FB geometry streams */
|
|
262910
263031
|
const signatureBytes = new Uint8Array([98, 103, 48, 48, 48, 49, 102, 98]);
|
|
262911
263032
|
|
|
262912
263033
|
|
|
@@ -266035,12 +266156,8 @@ var IModelJson;
|
|
|
266035
266156
|
&& data.hasOwnProperty("pointIndex") && Array.isArray(data.pointIndex)) {
|
|
266036
266157
|
const polyface = _polyface_Polyface__WEBPACK_IMPORTED_MODULE_21__.IndexedPolyface.create();
|
|
266037
266158
|
const numPerFace = data.hasOwnProperty("numPerFace") ? data.numPerFace : 0;
|
|
266038
|
-
|
|
266039
|
-
|
|
266040
|
-
if (q === true || q === false) {
|
|
266041
|
-
polyface.twoSided = q;
|
|
266042
|
-
}
|
|
266043
|
-
}
|
|
266159
|
+
// default value is true!!
|
|
266160
|
+
polyface.twoSided = this.parseBooleanProperty(data, "twoSided", true) ?? true;
|
|
266044
266161
|
if (data.hasOwnProperty("expectedClosure")) {
|
|
266045
266162
|
const q = data.expectedClosure;
|
|
266046
266163
|
if (Number.isFinite(q)) {
|
|
@@ -266071,12 +266188,20 @@ var IModelJson;
|
|
|
266071
266188
|
for (const p of data.point)
|
|
266072
266189
|
polyface.addPointXYZ(p[0], p[1], p[2]);
|
|
266073
266190
|
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.pointIndex, numPerFace, (i, v) => { polyface.addPointIndex(i, v); }, () => { polyface.terminateFacet(false); });
|
|
266191
|
+
if (data.hasOwnProperty("edgeMateIndex") && Array.isArray(data.edgeMateIndex)) {
|
|
266192
|
+
const edgeMateIndex = [];
|
|
266193
|
+
if (!_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceCompressedZeroBasedReflexiveIndices(data.edgeMateIndex, numPerFace, _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.EdgeMateIndex.BlockSeparator, _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.EdgeMateIndex.NoEdgeMate, (i) => edgeMateIndex.push(i))) {
|
|
266194
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "unable to deserialize json edgeMateIndex array");
|
|
266195
|
+
}
|
|
266196
|
+
polyface.data.edgeMateIndex = edgeMateIndex;
|
|
266197
|
+
}
|
|
266074
266198
|
if (!polyface.validateAllIndices())
|
|
266075
266199
|
return undefined;
|
|
266076
266200
|
if (data.hasOwnProperty("auxData"))
|
|
266077
266201
|
polyface.data.auxData = Reader.parsePolyfaceAuxData(data.auxData, numPerFace);
|
|
266078
266202
|
if (data.hasOwnProperty("tags"))
|
|
266079
266203
|
polyface.data.taggedNumericData = Reader.parseTaggedNumericProps(data.tags);
|
|
266204
|
+
// NOTE: faceData is ignored
|
|
266080
266205
|
return polyface;
|
|
266081
266206
|
}
|
|
266082
266207
|
return undefined;
|
|
@@ -266789,6 +266914,7 @@ var IModelJson;
|
|
|
266789
266914
|
const normalIndex = [];
|
|
266790
266915
|
const paramIndex = [];
|
|
266791
266916
|
const colorIndex = [];
|
|
266917
|
+
const edgeMateIndex = [];
|
|
266792
266918
|
let n;
|
|
266793
266919
|
while (visitor.moveToNextFacet()) {
|
|
266794
266920
|
n = visitor.indexCount;
|
|
@@ -266820,12 +266946,15 @@ var IModelJson;
|
|
|
266820
266946
|
if (pf.data.taggedNumericData) {
|
|
266821
266947
|
taggedNumericData = this.handleTaggedNumericData(pf.data.taggedNumericData);
|
|
266822
266948
|
}
|
|
266823
|
-
|
|
266949
|
+
if (pf.data.edgeMateIndex) {
|
|
266950
|
+
if (!_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceUncompressedZeroBasedReflexiveIndices(pf.data.edgeMateIndex, pf.facetStart, _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.EdgeMateIndex.BlockSeparator, _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.EdgeMateIndex.NoEdgeMate, (i) => edgeMateIndex.push(i))) {
|
|
266951
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "unable to serialize edgeMateIndex array to json");
|
|
266952
|
+
}
|
|
266953
|
+
}
|
|
266824
266954
|
const contents = {};
|
|
266825
266955
|
if (pf.expectedClosure !== 0)
|
|
266826
266956
|
contents.expectedClosure = pf.expectedClosure;
|
|
266827
|
-
|
|
266828
|
-
contents.twoSided = true;
|
|
266957
|
+
contents.twoSided = pf.twoSided;
|
|
266829
266958
|
if (pf.data.auxData)
|
|
266830
266959
|
contents.auxData = this.handlePolyfaceAuxData(pf.data.auxData, pf);
|
|
266831
266960
|
if (pf.data.color)
|
|
@@ -266844,6 +266973,9 @@ var IModelJson;
|
|
|
266844
266973
|
contents.pointIndex = pointIndex;
|
|
266845
266974
|
if (taggedNumericData)
|
|
266846
266975
|
contents.tags = taggedNumericData;
|
|
266976
|
+
if (pf.data.edgeMateIndex)
|
|
266977
|
+
contents.edgeMateIndex = edgeMateIndex;
|
|
266978
|
+
// NOTE: pf.data.face is not persistent
|
|
266847
266979
|
return { indexedMesh: contents };
|
|
266848
266980
|
}
|
|
266849
266981
|
handleBSplineCurve(curve) {
|
|
@@ -267297,6 +267429,123 @@ var SerializationHelpers;
|
|
|
267297
267429
|
}
|
|
267298
267430
|
}
|
|
267299
267431
|
SerializationHelpers.announceZeroBasedIndicesWithExternalBlocking = announceZeroBasedIndicesWithExternalBlocking;
|
|
267432
|
+
/** Special values for persistent zero-based edge mate indices. */
|
|
267433
|
+
let EdgeMateIndex;
|
|
267434
|
+
(function (EdgeMateIndex) {
|
|
267435
|
+
/** Separates face loops. */
|
|
267436
|
+
EdgeMateIndex[EdgeMateIndex["BlockSeparator"] = -1] = "BlockSeparator";
|
|
267437
|
+
/** Indicates no edge mate. */
|
|
267438
|
+
EdgeMateIndex[EdgeMateIndex["NoEdgeMate"] = -2] = "NoEdgeMate";
|
|
267439
|
+
})(EdgeMateIndex = SerializationHelpers.EdgeMateIndex || (SerializationHelpers.EdgeMateIndex = {}));
|
|
267440
|
+
;
|
|
267441
|
+
/**
|
|
267442
|
+
* Build two index arrays into a source array:
|
|
267443
|
+
* * `sourceStarts[k]` is the first index of the k_th block in `sourceIndices`.
|
|
267444
|
+
* * `compressedStarts[k]` is the first index of the k_th block in a compressed clone `C` of `sourceIndices`
|
|
267445
|
+
* with all pads/terminators removed.
|
|
267446
|
+
* * The last entry of `sourceStarts`/`compressedStarts` is the length of `sourceIndices`/`C`.
|
|
267447
|
+
* @returns `undefined` if invalid inputs, or the two computed arrays of block start indices.
|
|
267448
|
+
*/
|
|
267449
|
+
function buildBlockStartIndices(sourceIndices, numPerBlock, blockSeparator) {
|
|
267450
|
+
if (sourceIndices.length === 0 || sourceIndices[0] === blockSeparator)
|
|
267451
|
+
return undefined;
|
|
267452
|
+
const sourceStarts = [];
|
|
267453
|
+
const compressedStarts = [];
|
|
267454
|
+
sourceStarts.push(0);
|
|
267455
|
+
compressedStarts.push(0);
|
|
267456
|
+
const getBlockLength = (iBlockStart) => {
|
|
267457
|
+
if (sourceIndices[iBlockStart] === blockSeparator)
|
|
267458
|
+
return 0;
|
|
267459
|
+
for (let i = iBlockStart + 1; i < sourceIndices.length; i++) {
|
|
267460
|
+
if ((sourceIndices[i - 1] !== blockSeparator && sourceIndices[i] === blockSeparator) || (numPerBlock > 2 && (i % numPerBlock === 0)))
|
|
267461
|
+
return i - iBlockStart;
|
|
267462
|
+
if (i === sourceIndices.length - 1) // last fixed block, or unterminated last variable block
|
|
267463
|
+
return sourceIndices.length - iBlockStart;
|
|
267464
|
+
}
|
|
267465
|
+
return 0;
|
|
267466
|
+
};
|
|
267467
|
+
for (let i = 0; i < sourceIndices.length;) {
|
|
267468
|
+
const blockLength = getBlockLength(i);
|
|
267469
|
+
if (blockLength <= 0)
|
|
267470
|
+
return undefined;
|
|
267471
|
+
i += blockLength;
|
|
267472
|
+
for (; i < sourceIndices.length && sourceIndices[i] === blockSeparator; i++)
|
|
267473
|
+
;
|
|
267474
|
+
sourceStarts.push(i);
|
|
267475
|
+
compressedStarts.push(compressedStarts[compressedStarts.length - 1] + blockLength);
|
|
267476
|
+
}
|
|
267477
|
+
return { sourceStarts, compressedStarts };
|
|
267478
|
+
}
|
|
267479
|
+
/**
|
|
267480
|
+
* Compress a 0-based blocked index array by removing block separators/pads and remapping each index.
|
|
267481
|
+
* * The entries of `sourceIndices` are reflexive indices, i.e., they index `sourceIndices`.
|
|
267482
|
+
* * The remapped index `j` must refer to the same block location in the compressed array to which the
|
|
267483
|
+
* original index `i >= 0` refers in `sourceIndices`; therefore `j` is obtained from `i` by subtracting the
|
|
267484
|
+
* number of block separators/pads preceding `sourceIndices[i]`.
|
|
267485
|
+
* @param sourceIndices array of blocked indices to process. Each entry is a 0-based reflexive index, `nullValue`, or `blockSeparator`.
|
|
267486
|
+
* @param numPerBlock index blocking for sourceIndices: padded block size > 2 or variable-sized terminated blocks.
|
|
267487
|
+
* @param blockSeparator negative value that terminates/pads blocks in sourceIndices, e.g. -1. This value is not announced.
|
|
267488
|
+
* @param nullValue negative value that represents "no index" in sourceIndices, e.g., -2. This value is announced as "undefined".
|
|
267489
|
+
* @param announceRemappedIndex callback to receive a remapped index.
|
|
267490
|
+
* @returns true if and only if the mapping was successful.
|
|
267491
|
+
*/
|
|
267492
|
+
function announceCompressedZeroBasedReflexiveIndices(sourceIndices, numPerBlock, blockSeparator, nullValue, announceRemappedIndex) {
|
|
267493
|
+
if (!sourceIndices.length || blockSeparator >= 0 || nullValue >= 0 || (blockSeparator === nullValue))
|
|
267494
|
+
return false;
|
|
267495
|
+
// remapped index = source index - # preceding terminators/pads in sourceIndices
|
|
267496
|
+
// Instead of counting terminators/pads, we use a pair of block start index arrays
|
|
267497
|
+
const blocking = buildBlockStartIndices(sourceIndices, numPerBlock, blockSeparator);
|
|
267498
|
+
if (!blocking)
|
|
267499
|
+
return false;
|
|
267500
|
+
for (const index of sourceIndices) {
|
|
267501
|
+
if (index === nullValue)
|
|
267502
|
+
announceRemappedIndex(undefined);
|
|
267503
|
+
else if (index >= 0) {
|
|
267504
|
+
const iBlock = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_0__.NumberArray.searchStrictlyIncreasingNumbers(blocking.sourceStarts, index);
|
|
267505
|
+
if (iBlock === undefined)
|
|
267506
|
+
return false;
|
|
267507
|
+
const blockOffset = index - blocking.sourceStarts[iBlock];
|
|
267508
|
+
announceRemappedIndex(blocking.compressedStarts[iBlock] + blockOffset);
|
|
267509
|
+
}
|
|
267510
|
+
}
|
|
267511
|
+
return true;
|
|
267512
|
+
}
|
|
267513
|
+
SerializationHelpers.announceCompressedZeroBasedReflexiveIndices = announceCompressedZeroBasedReflexiveIndices;
|
|
267514
|
+
/**
|
|
267515
|
+
* Uncompress a 0-based index array by inserting block separators and remapping each index.
|
|
267516
|
+
* * Defined entries of `sourceIndices` are reflexive indices, i.e., they index `sourceIndices`.
|
|
267517
|
+
* * The remapped index `j` must refer to the same block location in the uncompressed array to which the
|
|
267518
|
+
* original defined index `i` refers in `sourceIndices`; therefore `j` is obtained from `i` by adding the
|
|
267519
|
+
* number of full blocks preceding `sourceIndices[i]`.
|
|
267520
|
+
* @param sourceIndices array of compressed indices to process. Each entry is a 0-based reflexive index, or `undefined`.
|
|
267521
|
+
* @param sourceStarts sourceStarts[k] is the first index of the k_th block in `sourceIndices`; its last entry is the
|
|
267522
|
+
* length of `sourceIndices`.
|
|
267523
|
+
* @param blockSeparator negative value that represents an announced block terminator, e.g. -1.
|
|
267524
|
+
* @param nullValue negative value to announce for an undefined source index, e.g., -2.
|
|
267525
|
+
* @param announceRemappedIndex callback to receive a remapped index.
|
|
267526
|
+
* @returns true if and only if the mapping was successful.
|
|
267527
|
+
*/
|
|
267528
|
+
function announceUncompressedZeroBasedReflexiveIndices(sourceIndices, sourceStarts, blockSeparator, nullValue, announceRemappedIndex) {
|
|
267529
|
+
if (!sourceIndices.length || sourceStarts.length < 2 || blockSeparator >= 0 || nullValue >= 0 || (blockSeparator === nullValue))
|
|
267530
|
+
return false;
|
|
267531
|
+
// remapped index = source index + # preceding blocks in sourceIndices
|
|
267532
|
+
for (let i = 0; i < sourceStarts.length - 1; i++) {
|
|
267533
|
+
for (let j = sourceStarts[i]; j < sourceStarts[i + 1]; j++) {
|
|
267534
|
+
const index = sourceIndices[j];
|
|
267535
|
+
if (index === undefined)
|
|
267536
|
+
announceRemappedIndex(nullValue);
|
|
267537
|
+
else if (index >= 0) {
|
|
267538
|
+
const iBlock = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_0__.NumberArray.searchStrictlyIncreasingNumbers(sourceStarts, index);
|
|
267539
|
+
if (iBlock === undefined)
|
|
267540
|
+
return false;
|
|
267541
|
+
announceRemappedIndex(index + iBlock);
|
|
267542
|
+
}
|
|
267543
|
+
}
|
|
267544
|
+
announceRemappedIndex(blockSeparator);
|
|
267545
|
+
}
|
|
267546
|
+
return true;
|
|
267547
|
+
}
|
|
267548
|
+
SerializationHelpers.announceUncompressedZeroBasedReflexiveIndices = announceUncompressedZeroBasedReflexiveIndices;
|
|
267300
267549
|
/** Helper class for preparing geometry data for import. */
|
|
267301
267550
|
class Import {
|
|
267302
267551
|
/** copy knots, with options to control destination type and extraneous knot removal */
|
|
@@ -268925,11 +269174,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
268925
269174
|
|
|
268926
269175
|
|
|
268927
269176
|
/**
|
|
268928
|
-
* A sphere mapped by an arbitrary
|
|
269177
|
+
* A unit sphere mapped by an arbitrary [[Transform]].
|
|
268929
269178
|
* * Typically, the stored matrix has orthogonal columns. In this case, if two columns have equal length, the
|
|
268930
269179
|
* resulting geometry is ellipsoidal; if all three columns have equal length, the resulting geometry is a sphere.
|
|
268931
|
-
* * Creating a Sphere without orthogonal columns is possible
|
|
269180
|
+
* * Creating a Sphere without orthogonal columns is possible but not recommended, for the resulting geometry
|
|
268932
269181
|
* lacks portability; for example, such a Sphere cannot be represented as a DGN element (see [[createDgnSphere]]).
|
|
269182
|
+
* * An optional latitude sweep allows for partial spheres with or without caps.
|
|
269183
|
+
* * Compare to [[Ellipsoid]], which has the same parameterization, but acts as a closed [[Clipper]].
|
|
268933
269184
|
* @public
|
|
268934
269185
|
*/
|
|
268935
269186
|
class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
|
|
@@ -310794,7 +311045,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
310794
311045
|
/***/ ((module) => {
|
|
310795
311046
|
|
|
310796
311047
|
"use strict";
|
|
310797
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.
|
|
311048
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.94","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"}}');
|
|
310798
311049
|
|
|
310799
311050
|
/***/ })
|
|
310800
311051
|
|