@itwin/rpcinterface-full-stack-tests 4.7.0-dev.8 → 4.7.0
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/_bea9.bundled-tests.js.map +1 -1
- package/lib/dist/bundled-tests.js +289 -206
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_1_6_node_modules_loaders_gl_draco_di-0642a6.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_meshoptimizer_0_20_0_node_modules_meshoptimizer_index_m-a5ae61.bundled-tests.js.map +1 -1
- package/package.json +14 -14
|
@@ -34486,6 +34486,8 @@ var ChangesetType;
|
|
|
34486
34486
|
ChangesetType[ChangesetType["Regular"] = 0] = "Regular";
|
|
34487
34487
|
/** changeset *does* contain schema changes. */
|
|
34488
34488
|
ChangesetType[ChangesetType["Schema"] = 1] = "Schema";
|
|
34489
|
+
/** Schema changeset pushed by iModel with SchemaSync enabled */
|
|
34490
|
+
ChangesetType[ChangesetType["SchemaSync"] = 65] = "SchemaSync";
|
|
34489
34491
|
})(ChangesetType || (ChangesetType = {}));
|
|
34490
34492
|
|
|
34491
34493
|
|
|
@@ -63310,6 +63312,8 @@ class RpcRequest {
|
|
|
63310
63312
|
return this.reject(new _IModelError__WEBPACK_IMPORTED_MODULE_1__.NoContentError());
|
|
63311
63313
|
}
|
|
63312
63314
|
handleNotFound(status, value) {
|
|
63315
|
+
if (RpcRequest.notFoundHandlers.numberOfListeners === 0)
|
|
63316
|
+
this.handleRejected(value);
|
|
63313
63317
|
const response = _RpcMarshaling__WEBPACK_IMPORTED_MODULE_4__.RpcMarshaling.deserialize(this.protocol, value);
|
|
63314
63318
|
this.setStatus(status);
|
|
63315
63319
|
let resubmitted = false;
|
|
@@ -63317,8 +63321,8 @@ class RpcRequest {
|
|
|
63317
63321
|
if (resubmitted)
|
|
63318
63322
|
throw new _IModelError__WEBPACK_IMPORTED_MODULE_1__.IModelError(_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyStatus.ERROR, `Already resubmitted using this handler.`);
|
|
63319
63323
|
resubmitted = true;
|
|
63320
|
-
this.submit();
|
|
63321
|
-
}, (reason) => this.reject(reason));
|
|
63324
|
+
void this.submit();
|
|
63325
|
+
}, (reason) => reason ? this.reject(reason) : this.handleRejected(value));
|
|
63322
63326
|
return;
|
|
63323
63327
|
}
|
|
63324
63328
|
resolve(result) {
|
|
@@ -74573,7 +74577,8 @@ class SchemaJsonLocater {
|
|
|
74573
74577
|
* @throws [ECObjectsError]($ecschema-metadata) if the schema exists, but cannot be loaded.
|
|
74574
74578
|
*/
|
|
74575
74579
|
async getSchema(schemaKey, matchType, context) {
|
|
74576
|
-
|
|
74580
|
+
await this.getSchemaInfo(schemaKey, matchType, context);
|
|
74581
|
+
return await context.getCachedSchema(schemaKey, matchType);
|
|
74577
74582
|
}
|
|
74578
74583
|
/**
|
|
74579
74584
|
* Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.
|
|
@@ -74581,7 +74586,13 @@ class SchemaJsonLocater {
|
|
|
74581
74586
|
* @param matchType The match type to use when locating the schema
|
|
74582
74587
|
*/
|
|
74583
74588
|
async getSchemaInfo(schemaKey, matchType, context) {
|
|
74584
|
-
|
|
74589
|
+
const schemaProps = this._getSchema(schemaKey.name);
|
|
74590
|
+
if (!schemaProps)
|
|
74591
|
+
return undefined;
|
|
74592
|
+
const schemaInfo = await Schema_1.Schema.startLoadingFromJson(schemaProps, context);
|
|
74593
|
+
if (schemaInfo !== undefined && schemaInfo.schemaKey.matches(schemaKey, matchType))
|
|
74594
|
+
return schemaInfo;
|
|
74595
|
+
return undefined;
|
|
74585
74596
|
}
|
|
74586
74597
|
/** Get a schema by [SchemaKey] synchronously.
|
|
74587
74598
|
* @param schemaKey The [SchemaKey] that identifies the schema.
|
|
@@ -82163,10 +82174,10 @@ class CheckpointConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_4_
|
|
|
82163
82174
|
super(props);
|
|
82164
82175
|
this._reopenConnectionHandler = async (request, response, resubmit, reject) => {
|
|
82165
82176
|
if (!response.hasOwnProperty("isIModelNotFoundResponse"))
|
|
82166
|
-
|
|
82177
|
+
reject();
|
|
82167
82178
|
const iModelRpcProps = request.parameters[0];
|
|
82168
82179
|
if (this._fileKey !== iModelRpcProps.key)
|
|
82169
|
-
|
|
82180
|
+
reject(); // The handler is called for a different connection than this
|
|
82170
82181
|
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Logger.logTrace(loggerCategory, "Attempting to reopen connection", () => iModelRpcProps);
|
|
82171
82182
|
try {
|
|
82172
82183
|
const openResponse = await CheckpointConnection.callOpen(iModelRpcProps, this.routingContext);
|
|
@@ -93603,7 +93614,7 @@ class SubCategoriesCache {
|
|
|
93603
93614
|
(function (SubCategoriesCache) {
|
|
93604
93615
|
class Request {
|
|
93605
93616
|
get wasCanceled() { return this._canceled || this._imodel.isClosed; }
|
|
93606
|
-
constructor(categoryIds, imodel, maxCategoriesPerQuery =
|
|
93617
|
+
constructor(categoryIds, imodel, maxCategoriesPerQuery = 2500) {
|
|
93607
93618
|
this._categoryIds = [];
|
|
93608
93619
|
this._result = [];
|
|
93609
93620
|
this._canceled = false;
|
|
@@ -172335,7 +172346,9 @@ class ToolAdmin {
|
|
|
172335
172346
|
*/
|
|
172336
172347
|
this.manipulatorToolEvent = new _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
|
|
172337
172348
|
}
|
|
172338
|
-
/** The name of the [[PrimitiveTool]] to use as the default tool.
|
|
172349
|
+
/** The name of the [[PrimitiveTool]] to use as the default tool.
|
|
172350
|
+
* Defaults to "Select", referring to [[SelectionTool]].
|
|
172351
|
+
* @note An empty string signifies no default tool allowing more events to be handled by [[idleTool]].
|
|
172339
172352
|
* @see [[startDefaultTool]] to activate the default tool.
|
|
172340
172353
|
* @see [[defaultToolArgs]] to supply arguments when starting the tool.
|
|
172341
172354
|
*/
|
|
@@ -173301,9 +173314,15 @@ class ToolAdmin {
|
|
|
173301
173314
|
this.onActiveToolChanged(newTool, StartOrResume.Start);
|
|
173302
173315
|
}
|
|
173303
173316
|
/** @internal */
|
|
173317
|
+
setEditCommandHandler(handler) {
|
|
173318
|
+
this._editCommandHandler = handler;
|
|
173319
|
+
}
|
|
173320
|
+
/** @internal */
|
|
173304
173321
|
async setPrimitiveTool(newTool) {
|
|
173305
173322
|
if (undefined !== this._primitiveTool) {
|
|
173306
173323
|
await this._primitiveTool.onCleanup();
|
|
173324
|
+
if (undefined !== this._editCommandHandler)
|
|
173325
|
+
await this._editCommandHandler.finishCommand();
|
|
173307
173326
|
this._primitiveTool = undefined;
|
|
173308
173327
|
}
|
|
173309
173328
|
this._primitiveTool = newTool;
|
|
@@ -173387,15 +173406,25 @@ class ToolAdmin {
|
|
|
173387
173406
|
}
|
|
173388
173407
|
}
|
|
173389
173408
|
/**
|
|
173390
|
-
* Starts the default [[
|
|
173391
|
-
* @note The default tool
|
|
173392
|
-
* an active [[ViewTool]] or [[InputCollector]] and replace or clear the current [[PrimitiveTool]].
|
|
173409
|
+
* Starts the default [[PrimitiveTool]], if any. Generally invoked automatically when other tools exit, so shouldn't be called directly.
|
|
173410
|
+
* @note The default tool, when specified, must be a subclass of [[PrimitiveTool]]. A call to startDefaultTool is required to terminate
|
|
173411
|
+
* an active [[ViewTool]] or [[InputCollector]] and replace or clear the current [[PrimitiveTool]]. The default tool can not be
|
|
173412
|
+
* a subclass of [[ViewTool]] as view tools replace each other and aren't suspended. This means [[ViewTool.exitTool]] would
|
|
173413
|
+
* result in the active tool being undefined instead of making the default tool active.
|
|
173393
173414
|
* The tool's [[Tool.run]] method is invoked with arguments specified by [[defaultToolArgs]].
|
|
173394
173415
|
* @see [[defaultToolId]] to configure the default tool.
|
|
173395
173416
|
*/
|
|
173396
173417
|
async startDefaultTool() {
|
|
173397
|
-
|
|
173398
|
-
|
|
173418
|
+
const tool = _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.tools.create(this.defaultToolId, this.defaultToolArgs);
|
|
173419
|
+
if (tool instanceof _PrimitiveTool__WEBPACK_IMPORTED_MODULE_12__.PrimitiveTool) {
|
|
173420
|
+
if (!await tool.run(this.defaultToolArgs))
|
|
173421
|
+
return this.startPrimitiveTool(undefined);
|
|
173422
|
+
}
|
|
173423
|
+
else {
|
|
173424
|
+
await this.startPrimitiveTool(undefined); // Ensure active primitive tool is terminated...
|
|
173425
|
+
if (undefined !== tool)
|
|
173426
|
+
throw new Error("Default tool must be a subclass of PrimitiveTool");
|
|
173427
|
+
}
|
|
173399
173428
|
}
|
|
173400
173429
|
/**
|
|
173401
173430
|
* Call from external events or immediate tools that may have invalidated the current primitive tool's state.
|
|
@@ -209628,11 +209657,12 @@ class Angle {
|
|
|
209628
209657
|
&& dotUV * dotUV <= _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallAngleRadiansSquared * dotUU * dotVV;
|
|
209629
209658
|
}
|
|
209630
209659
|
/**
|
|
209631
|
-
*
|
|
209632
|
-
* * This function assumes the input arguments are related to an angle between -PI and PI
|
|
209633
|
-
* * This function returns an angle between -PI and PI
|
|
209634
|
-
* @param rCos2A cosine value
|
|
209635
|
-
* @param rSin2A sine value
|
|
209660
|
+
* Compute the angle A given r*cos(2A) and r*sin(2A) for some nonnegative scalar r.
|
|
209661
|
+
* * This function assumes the input arguments are related to an angle between -PI and PI.
|
|
209662
|
+
* * This function returns an angle between -PI and PI.
|
|
209663
|
+
* @param rCos2A scaled cosine value of twice the angle A.
|
|
209664
|
+
* @param rSin2A scaled sine value of twice the angle A.
|
|
209665
|
+
* @return cos(A), sin(A) and A in radians
|
|
209636
209666
|
*/
|
|
209637
209667
|
static trigValuesToHalfAngleTrigValues(rCos2A, rSin2A) {
|
|
209638
209668
|
const r = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXY(rCos2A, rSin2A);
|
|
@@ -209642,41 +209672,25 @@ class Angle {
|
|
|
209642
209672
|
else {
|
|
209643
209673
|
/* If the caller really gave you sine and cosine values, r should be 1. However,
|
|
209644
209674
|
* to allow scaled values -- e.g. the x and y components of any vector -- we normalize
|
|
209645
|
-
* right here. This adds an extra sqrt and
|
|
209675
|
+
* right here. This adds an extra sqrt and two divisions, but improves
|
|
209646
209676
|
* both the usefulness and robustness of the computation.
|
|
209647
209677
|
*/
|
|
209648
209678
|
let cosA;
|
|
209649
209679
|
let sinA = 0.0;
|
|
209650
209680
|
const cos2A = rCos2A / r;
|
|
209651
209681
|
const sin2A = rSin2A / r;
|
|
209652
|
-
//
|
|
209653
|
-
|
|
209654
|
-
|
|
209655
|
-
* We know cos2A = (cosA)^2 - (sinA)^2 and 1 = (cosA)^2 + (sinA)^2
|
|
209656
|
-
* so 1 + cos2A = 2(cosA)^2 and therefore, cosA = sqrt((1+cos2A)/2)
|
|
209657
|
-
* cosine is positive in NE and SE quadrants so we use +sqrt
|
|
209658
|
-
*/
|
|
209659
|
-
cosA = Math.sqrt(0.5 * (1.0 + cos2A));
|
|
209660
|
-
// We know sin2A = 2 sinA cosA so sinA = sin2A/(2*cosA)
|
|
209661
|
-
sinA = sin2A / (2.0 * cosA);
|
|
209682
|
+
if (cos2A >= 0.0) { // 2A is in NE and SE quadrants, A in same quadrant
|
|
209683
|
+
cosA = Math.sqrt(0.5 * (1.0 + cos2A)); // half angle formula. Use +root since cosA >= 0
|
|
209684
|
+
sinA = sin2A / (2.0 * cosA); // double angle formula
|
|
209662
209685
|
}
|
|
209663
209686
|
else {
|
|
209664
|
-
//
|
|
209665
|
-
|
|
209666
|
-
/*
|
|
209667
|
-
* We know cos2A = (cosA)^2 - (sinA)^2 and 1 = (cosA)^2 + (sinA)^2
|
|
209668
|
-
* so 1 - cos2A = 2(sinA)^2 and therefore, sinA = sqrt((1-cos2A)/2)
|
|
209669
|
-
* sine is positive in NE quadrant so we use +sqrt
|
|
209670
|
-
*/
|
|
209671
|
-
sinA = Math.sqrt(0.5 * (1.0 - cos2A));
|
|
209672
|
-
// Original angle in SW quadrant. Half angle in SE quadrant
|
|
209687
|
+
if (sin2A > 0.0) { // 2A in NW quadrant. A in NE quadrant
|
|
209688
|
+
sinA = Math.sqrt(0.5 * (1.0 - cos2A)); // half angle formula. Use +root since sinA > 0
|
|
209673
209689
|
}
|
|
209674
|
-
else {
|
|
209675
|
-
|
|
209676
|
-
sinA = -Math.sqrt(0.5 * (1.0 - cos2A));
|
|
209690
|
+
else { // 2A in SW quadrant. A in SE quadrant
|
|
209691
|
+
sinA = -Math.sqrt(0.5 * (1.0 - cos2A)); // half angle formula. Use -root since sinA <= 0
|
|
209677
209692
|
}
|
|
209678
|
-
|
|
209679
|
-
cosA = sin2A / (2.0 * sinA); // always positive
|
|
209693
|
+
cosA = sin2A / (2.0 * sinA); // double angle formula
|
|
209680
209694
|
}
|
|
209681
209695
|
return { c: cosA, s: sinA, radians: Math.atan2(sinA, cosA) };
|
|
209682
209696
|
}
|
|
@@ -209695,18 +209709,19 @@ class Angle {
|
|
|
209695
209709
|
return value;
|
|
209696
209710
|
}
|
|
209697
209711
|
/**
|
|
209698
|
-
* Return the half angle cosine, sine, and radians for given dot products
|
|
209699
|
-
*
|
|
209700
|
-
*
|
|
209701
|
-
*
|
|
209702
|
-
* * Given ellipse x(t) = c + U cos(t) + V sin(t), find t0 such that radial vector W(t0) = x(t0) - c is
|
|
209703
|
-
* perpendicular to the ellipse.
|
|
209712
|
+
* Return the half angle cosine, sine, and radians for the given vector dot products.
|
|
209713
|
+
* * These values arise e.g. in the computation performed in `Arc3d.toScaledMatrix3d`.
|
|
209714
|
+
* * Let vectors U and V define the ellipse x(t) = c + U cos(t) + V sin(t). We seek an angle t0
|
|
209715
|
+
* such that the radial vector W(t0) := x(t0) - c is perpendicular to the ellipse.
|
|
209704
209716
|
* * Then 0 = W(t0).x'(t0) = (U cos(t0) + V sin(t0)).(V cos(t0) - U sin(t0)) = U.V cos(2t0) + 0.5 (V.V - U.U) sin(2t0)
|
|
209705
|
-
* implies sin(2t0) / cos(2t0) = 2 U.V / (U.U - V.V), i.e., t0 can be computed given the
|
|
209706
|
-
*
|
|
209717
|
+
* implies tan(2t0) = sin(2t0) / cos(2t0) = 2 U.V / (U.U - V.V), i.e., t0 can be computed given the input dot products.
|
|
209718
|
+
* Math details can be found at docs/learning/geometry/Angle.md
|
|
209707
209719
|
* @param dotUU dot product of vectorU with itself
|
|
209708
209720
|
* @param dotVV dot product of vectorV with itself
|
|
209709
209721
|
* @param dotUV dot product of vectorU with vectorV
|
|
209722
|
+
* @param favorZero whether to allow a tight tolerance for returning t0 = 0 (default true).
|
|
209723
|
+
* When dotUV is near zero, U and V are nearly perpendicular, and the returned angle is near zero.
|
|
209724
|
+
* @return the angle t0 and its cosine and sine.
|
|
209710
209725
|
*/
|
|
209711
209726
|
static dotProductsToHalfAngleTrigValues(dotUU, dotVV, dotUV, favorZero = true) {
|
|
209712
209727
|
const cos2t0 = dotUU - dotVV;
|
|
@@ -239885,6 +239900,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
239885
239900
|
/* harmony export */ "IndexedPolyfaceVisitor": () => (/* binding */ IndexedPolyfaceVisitor)
|
|
239886
239901
|
/* harmony export */ });
|
|
239887
239902
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
239903
|
+
/* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
239904
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
239905
|
+
/* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
|
|
239906
|
+
/* harmony import */ var _Polyface__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
239888
239907
|
/* harmony import */ var _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PolyfaceData */ "../../core/geometry/lib/esm/polyface/PolyfaceData.js");
|
|
239889
239908
|
/*---------------------------------------------------------------------------------------------
|
|
239890
239909
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
@@ -239895,6 +239914,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
239895
239914
|
*/
|
|
239896
239915
|
|
|
239897
239916
|
|
|
239917
|
+
|
|
239918
|
+
|
|
239919
|
+
|
|
239920
|
+
|
|
239898
239921
|
/* eslint-disable @itwin/prefer-get */
|
|
239899
239922
|
/**
|
|
239900
239923
|
* An `IndexedPolyfaceVisitor` is an iterator-like object that "visits" facets of a mesh.
|
|
@@ -239918,6 +239941,10 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
239918
239941
|
clientPolyface() {
|
|
239919
239942
|
return this._polyface;
|
|
239920
239943
|
}
|
|
239944
|
+
/** Return the number of facets this visitor is able to visit. */
|
|
239945
|
+
getVisitableFacetCount() {
|
|
239946
|
+
return this._polyface.facetCount;
|
|
239947
|
+
}
|
|
239921
239948
|
/**
|
|
239922
239949
|
* Set the number of vertices replicated in visitor arrays (both data and index arrays).
|
|
239923
239950
|
* * 0,1,2 are the most common as numWrap.
|
|
@@ -240062,53 +240089,99 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
240062
240089
|
/**
|
|
240063
240090
|
* An `IndexedPolyfaceSubsetVisitor` is an `IndexedPolyfaceVisitor` which only visits a subset of facets in the polyface.
|
|
240064
240091
|
* * The subset is defined by an array of facet indices provided when this visitor is created.
|
|
240065
|
-
* *
|
|
240066
|
-
* * `moveToNextFacet` moves only within the subset.
|
|
240067
|
-
* * `moveToReadIndex(i)` moves underlying visitor's `parentFacetIndex(i)`.
|
|
240092
|
+
* * Input indices (e.g., for `moveToReadIndex`) are understood to be indices into the subset array.
|
|
240068
240093
|
* @public
|
|
240069
240094
|
*/
|
|
240070
240095
|
class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {
|
|
240071
240096
|
constructor(polyface, activeFacetIndices, numWrap) {
|
|
240072
240097
|
super(polyface, numWrap);
|
|
240073
240098
|
this._parentFacetIndices = activeFacetIndices.slice();
|
|
240099
|
+
this._currentActiveIndex = -1;
|
|
240074
240100
|
this._nextActiveIndex = 0;
|
|
240075
240101
|
}
|
|
240102
|
+
isValidSubsetIndex(index) {
|
|
240103
|
+
return (undefined !== this._parentFacetIndices) && index >= 0 && index < this._parentFacetIndices.length;
|
|
240104
|
+
}
|
|
240076
240105
|
/**
|
|
240077
240106
|
* Create a visitor for iterating a subset of the facets of `polyface`.
|
|
240078
|
-
*
|
|
240107
|
+
* @param polyface reference to the client polyface, supplying facets
|
|
240108
|
+
* @param activeFacetIndices array of indices of facets in the client polyface to visit. This array is cloned.
|
|
240109
|
+
* @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.
|
|
240079
240110
|
*/
|
|
240080
|
-
static createSubsetVisitor(polyface, activeFacetIndices, numWrap) {
|
|
240111
|
+
static createSubsetVisitor(polyface, activeFacetIndices, numWrap = 0) {
|
|
240081
240112
|
return new IndexedPolyfaceSubsetVisitor(polyface, activeFacetIndices, numWrap);
|
|
240082
240113
|
}
|
|
240083
|
-
/**
|
|
240114
|
+
/**
|
|
240115
|
+
* Advance the iterator to a particular facet in the subset of client polyface facets.
|
|
240116
|
+
* @param activeIndex the index of the facet within the subset, not to be confused with the index of the facet within the client polyface.
|
|
240117
|
+
* @return whether the iterator was successfully moved.
|
|
240118
|
+
*/
|
|
240084
240119
|
moveToReadIndex(activeIndex) {
|
|
240085
|
-
if (
|
|
240086
|
-
this.
|
|
240087
|
-
|
|
240120
|
+
if (this.isValidSubsetIndex(activeIndex)) {
|
|
240121
|
+
this._currentActiveIndex = activeIndex;
|
|
240122
|
+
this._nextActiveIndex = activeIndex + 1;
|
|
240123
|
+
return super.moveToReadIndex(this._parentFacetIndices[activeIndex]);
|
|
240088
240124
|
}
|
|
240089
240125
|
return false;
|
|
240090
240126
|
}
|
|
240091
|
-
/**
|
|
240127
|
+
/**
|
|
240128
|
+
* Advance the iterator to the next facet in the subset of client polyface facets.
|
|
240129
|
+
* @return whether the iterator was successfully moved.
|
|
240130
|
+
*/
|
|
240092
240131
|
moveToNextFacet() {
|
|
240093
|
-
if (this._nextActiveIndex
|
|
240094
|
-
|
|
240095
|
-
|
|
240096
|
-
|
|
240097
|
-
return true;
|
|
240098
|
-
}
|
|
240099
|
-
}
|
|
240100
|
-
return false;
|
|
240132
|
+
if (this._nextActiveIndex !== this._currentActiveIndex)
|
|
240133
|
+
return this.moveToReadIndex(this._nextActiveIndex);
|
|
240134
|
+
this._nextActiveIndex++;
|
|
240135
|
+
return true;
|
|
240101
240136
|
}
|
|
240102
|
-
/** Reset the iterator to start at the first active facet in the polyface. */
|
|
240137
|
+
/** Reset the iterator to start at the first active facet in the subset of client polyface facets. */
|
|
240103
240138
|
reset() {
|
|
240104
|
-
this.
|
|
240139
|
+
this.moveToReadIndex(0);
|
|
240140
|
+
this._nextActiveIndex = 0; // so immediate moveToNextFacet stays here.
|
|
240105
240141
|
}
|
|
240106
|
-
/**
|
|
240142
|
+
/**
|
|
240143
|
+
* Return the parent facet index of the indicated index within the subset of client polyface facets.
|
|
240144
|
+
* @param activeIndex index of the facet within the subset. Default is the active facet.
|
|
240145
|
+
* @return valid client polyface facet index, or `undefined` if invalid input index.
|
|
240146
|
+
*/
|
|
240107
240147
|
parentFacetIndex(activeIndex) {
|
|
240108
|
-
if (
|
|
240109
|
-
|
|
240148
|
+
if (undefined === activeIndex)
|
|
240149
|
+
activeIndex = this._currentActiveIndex;
|
|
240150
|
+
return this.isValidSubsetIndex(activeIndex) ? this._parentFacetIndices[activeIndex] : undefined;
|
|
240151
|
+
}
|
|
240152
|
+
/** Return the number of facets this visitor is able to visit. */
|
|
240153
|
+
getVisitableFacetCount() {
|
|
240154
|
+
return this._parentFacetIndices ? this._parentFacetIndices.length : 0;
|
|
240155
|
+
}
|
|
240156
|
+
/**
|
|
240157
|
+
* Create a visitor for those mesh facets with normal in the same half-space as the given vector.
|
|
240158
|
+
* * For example, to visit the top facets of a tiled terrain mesh but skip the "skirt" facets, pass
|
|
240159
|
+
* `compareVector = Vector3d.unitZ()` and a suitable `sideAngle` tolerance. Note that this will also
|
|
240160
|
+
* filter out *interior* facets that are nearly vertical, not just the "skirt" facets on the boundary.
|
|
240161
|
+
* @param mesh the mesh from which to select facets
|
|
240162
|
+
* @param compareVector vector to which to compare facet normals. The visitor will visit only those facets
|
|
240163
|
+
* with normals in the same half-space as this vector. Default is 001.
|
|
240164
|
+
* @param sideAngle optional angular tolerance to filter the facets near the border between half-spaces.
|
|
240165
|
+
* The visitor will *not* visit facets whose normals are nearly perpendicular to `compareVector`.
|
|
240166
|
+
* Default is [[Geometry.smallAngleRadians]].
|
|
240167
|
+
* @param numWrap optional number of entries replicated in visitor arrays. Default is 0.
|
|
240168
|
+
*/
|
|
240169
|
+
static createNormalComparison(mesh, compareVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.unitZ(), sideAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createSmallAngle(), numWrap = 0) {
|
|
240170
|
+
if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_4__.IndexedPolyface)
|
|
240171
|
+
return this.createNormalComparison(mesh.createVisitor(), compareVector, sideAngle, numWrap);
|
|
240172
|
+
const visitor = mesh;
|
|
240173
|
+
const facets = [];
|
|
240174
|
+
const facetNormal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createZero();
|
|
240175
|
+
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
240176
|
+
if (!_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_5__.PolygonOps.unitNormal(visitor.point, facetNormal))
|
|
240177
|
+
continue; // degenerate facet
|
|
240178
|
+
if (facetNormal.dotProduct(compareVector) < 0.0)
|
|
240179
|
+
continue; // ignore facet facing other half-space
|
|
240180
|
+
if (facetNormal.angleFromPerpendicular(compareVector).isMagnitudeLessThanOrEqual(sideAngle))
|
|
240181
|
+
continue; // ignore side facet
|
|
240182
|
+
facets.push(visitor.currentReadIndex());
|
|
240110
240183
|
}
|
|
240111
|
-
return
|
|
240184
|
+
return IndexedPolyfaceSubsetVisitor.createSubsetVisitor(visitor.clientPolyface(), facets, numWrap);
|
|
240112
240185
|
}
|
|
240113
240186
|
}
|
|
240114
240187
|
|
|
@@ -244452,40 +244525,22 @@ class PolyfaceQuery {
|
|
|
244452
244525
|
return true;
|
|
244453
244526
|
}
|
|
244454
244527
|
/**
|
|
244455
|
-
*
|
|
244456
|
-
* *
|
|
244457
|
-
*
|
|
244458
|
-
* * See [[dihedralAngleSummary]] for the definition of "dihedral angle".
|
|
244459
|
-
* * With `ignoreBoundaries` true, this may be a useful test when all the facets are in a single edge-connected
|
|
244460
|
-
* component, such as a pyramid with no underside.
|
|
244461
|
-
* * It is not a correct test if there are multiple, disjoint components.
|
|
244462
|
-
* * Take the above-mentioned pyramid with no underside.
|
|
244463
|
-
* * Within the same mesh, have a second pyramid placed to the side, still facing upward.
|
|
244464
|
-
* * The angles will pass the dihedral convexity test, but the composite thing surely is not convex.
|
|
244528
|
+
* Compute a number summarizing the dihedral angles in the mesh.
|
|
244529
|
+
* * A dihedral angle is the signed angle between adjacent facets' normals. This angle is positive when the cross
|
|
244530
|
+
* product `normalA x normalB` has the same direction as facetA's traversal of the facets' shared edge.
|
|
244465
244531
|
* @param source mesh.
|
|
244466
244532
|
* @param ignoreBoundaries if `true` ignore simple boundary edges, i.e., allow unclosed meshes. Default is `false`.
|
|
244467
|
-
*
|
|
244533
|
+
* See [[isConvexByDihedralAngleCount]] for comments about passing true when there are multiple
|
|
244534
|
+
* connected components.
|
|
244535
|
+
* * Return `0` if all dihedral angles are zero (and `ignoreBoundaries === true`). The mesh is planar.
|
|
244536
|
+
* * Otherwise, return `1` if all dihedral angles are non-negative. The mesh probably encloses a convex volume and
|
|
244537
|
+
* has outward normals.
|
|
244538
|
+
* * Otherwise, return `-1` if all dihedral angles are non-positive. The mesh probably encloses a convex volume and
|
|
244539
|
+
* has inward normals.
|
|
244540
|
+
* * Otherwise, return `-2`. Also return `-2` if a non-manifold condition was detected, or a facet normal could not
|
|
244541
|
+
* be computed. A non-manifold condition is a positive-length edge adjacent to more than 2 facets or (if
|
|
244542
|
+
* `ignoreBoundaries` is false) adjacent to exactly one facet.
|
|
244468
244543
|
*/
|
|
244469
|
-
static isConvexByDihedralAngleCount(source, ignoreBoundaries = false) {
|
|
244470
|
-
return this.dihedralAngleSummary(source, ignoreBoundaries) > 0;
|
|
244471
|
-
}
|
|
244472
|
-
/**
|
|
244473
|
-
* Compute a number summarizing the dihedral angles in the mesh.
|
|
244474
|
-
* * A dihedral angle is the signed angle between adjacent facets' normals. This angle is positive when the cross
|
|
244475
|
-
* product `normalA x normalB` has the same direction as facetA's traversal of the facets' shared edge.
|
|
244476
|
-
* @param source mesh.
|
|
244477
|
-
* @param ignoreBoundaries if `true` ignore simple boundary edges, i.e., allow unclosed meshes. Default is `false`.
|
|
244478
|
-
* See [[isConvexByDihedralAngleCount]] for comments about passing true when there are multiple
|
|
244479
|
-
* connected components.
|
|
244480
|
-
* * Return `0` if all dihedral angles are zero (and `ignoreBoundaries === true`). The mesh is planar.
|
|
244481
|
-
* * Otherwise, return `1` if all dihedral angles are non-negative. The mesh probably encloses a convex volume and
|
|
244482
|
-
* has outward normals.
|
|
244483
|
-
* * Otherwise, return `-1` if all dihedral angles are non-positive. The mesh probably encloses a convex volume and
|
|
244484
|
-
* has inward normals.
|
|
244485
|
-
* * Otherwise, return `-2`. Also return `-2` if a non-manifold condition was detected, or a facet normal could not
|
|
244486
|
-
* be computed. A non-manifold condition is a positive-length edge adjacent to more than 2 facets or (if
|
|
244487
|
-
* `ignoreBoundaries` is false) adjacent to exactly one facet.
|
|
244488
|
-
*/
|
|
244489
244544
|
static dihedralAngleSummary(source, ignoreBoundaries = false) {
|
|
244490
244545
|
// more info can be found at geometry/internaldocs/Polyface.md
|
|
244491
244546
|
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
|
|
@@ -244541,9 +244596,23 @@ class PolyfaceQuery {
|
|
|
244541
244596
|
return 0;
|
|
244542
244597
|
return -2;
|
|
244543
244598
|
}
|
|
244544
|
-
/**
|
|
244545
|
-
|
|
244546
|
-
|
|
244599
|
+
/**
|
|
244600
|
+
* Test for convex volume by dihedral angle tests on all edges.
|
|
244601
|
+
* * This tests if all dihedral angles of the mesh are positive.
|
|
244602
|
+
* * In a closed solid, this is a strong test for overall mesh convexity with outward facing normals.
|
|
244603
|
+
* * See [[dihedralAngleSummary]] for the definition of "dihedral angle".
|
|
244604
|
+
* * With `ignoreBoundaries` true, this may be a useful test when all the facets are in a single edge-connected
|
|
244605
|
+
* component, such as a pyramid with no underside.
|
|
244606
|
+
* * It is not a correct test if there are multiple, disjoint components.
|
|
244607
|
+
* * Take the above-mentioned pyramid with no underside.
|
|
244608
|
+
* * Within the same mesh, have a second pyramid placed to the side, still facing upward.
|
|
244609
|
+
* * The angles will pass the dihedral convexity test, but the composite thing surely is not convex.
|
|
244610
|
+
* @param source mesh.
|
|
244611
|
+
* @param ignoreBoundaries if `true` ignore simple boundary edges, i.e., allow unclosed meshes. Default is `false`.
|
|
244612
|
+
* @returns true if all dihedral angles of the mesh are positive.
|
|
244613
|
+
*/
|
|
244614
|
+
static isConvexByDihedralAngleCount(source, ignoreBoundaries = false) {
|
|
244615
|
+
return this.dihedralAngleSummary(source, ignoreBoundaries) > 0;
|
|
244547
244616
|
}
|
|
244548
244617
|
/**
|
|
244549
244618
|
* Test edges pairing in `source` mesh.
|
|
@@ -244567,36 +244636,9 @@ class PolyfaceQuery {
|
|
|
244567
244636
|
edges.sortAndCollectClusters(undefined, allowSimpleBoundaries ? undefined : badClusters, undefined, badClusters);
|
|
244568
244637
|
return badClusters.length === 0;
|
|
244569
244638
|
}
|
|
244570
|
-
/**
|
|
244571
|
-
|
|
244572
|
-
|
|
244573
|
-
* @param source polyface or visitor.
|
|
244574
|
-
* @param includeTypical true to in include typical boundary edges with a single adjacent facet.
|
|
244575
|
-
* @param includeMismatch true to include edges with more than 2 adjacent facets.
|
|
244576
|
-
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
244577
|
-
*/
|
|
244578
|
-
static boundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
244579
|
-
const result = new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_5__.BagOfCurves();
|
|
244580
|
-
const announceEdge = (pointA, pointB, _indexA, _indexB, _readIndex) => {
|
|
244581
|
-
result.tryAddChild(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(pointA, pointB));
|
|
244582
|
-
};
|
|
244583
|
-
PolyfaceQuery.announceBoundaryEdges(source, announceEdge, includeTypical, includeMismatch, includeNull);
|
|
244584
|
-
if (result.children.length === 0)
|
|
244585
|
-
return undefined;
|
|
244586
|
-
return result;
|
|
244587
|
-
}
|
|
244588
|
-
/**
|
|
244589
|
-
* Collect boundary edges.
|
|
244590
|
-
* * Return the edges as the simplest collection of chains of line segments.
|
|
244591
|
-
* @param source polyface or visitor.
|
|
244592
|
-
* @param includeTypical true to in include typical boundary edges with a single adjacent facet.
|
|
244593
|
-
* @param includeMismatch true to include edges with more than 2 adjacent facets.
|
|
244594
|
-
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
244595
|
-
*/
|
|
244596
|
-
static collectBoundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
244597
|
-
const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_12__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
|
|
244598
|
-
PolyfaceQuery.announceBoundaryEdges(source, (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(ptA, ptB)), includeTypical, includeMismatch, includeNull);
|
|
244599
|
-
return collector.grabResult(true);
|
|
244639
|
+
/** Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume. */
|
|
244640
|
+
static isPolyfaceClosedByEdgePairing(source) {
|
|
244641
|
+
return this.isPolyfaceManifold(source, false);
|
|
244600
244642
|
}
|
|
244601
244643
|
/**
|
|
244602
244644
|
* Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume.
|
|
@@ -244647,6 +244689,37 @@ class PolyfaceQuery {
|
|
|
244647
244689
|
}
|
|
244648
244690
|
}
|
|
244649
244691
|
}
|
|
244692
|
+
/**
|
|
244693
|
+
* Construct a CurveCollection containing boundary edges.
|
|
244694
|
+
* * Each edge is a LineSegment3d.
|
|
244695
|
+
* @param source polyface or visitor.
|
|
244696
|
+
* @param includeTypical true to in include typical boundary edges with a single adjacent facet.
|
|
244697
|
+
* @param includeMismatch true to include edges with more than 2 adjacent facets.
|
|
244698
|
+
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
244699
|
+
*/
|
|
244700
|
+
static boundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
244701
|
+
const result = new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_5__.BagOfCurves();
|
|
244702
|
+
const announceEdge = (pointA, pointB, _indexA, _indexB, _readIndex) => {
|
|
244703
|
+
result.tryAddChild(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(pointA, pointB));
|
|
244704
|
+
};
|
|
244705
|
+
PolyfaceQuery.announceBoundaryEdges(source, announceEdge, includeTypical, includeMismatch, includeNull);
|
|
244706
|
+
if (result.children.length === 0)
|
|
244707
|
+
return undefined;
|
|
244708
|
+
return result;
|
|
244709
|
+
}
|
|
244710
|
+
/**
|
|
244711
|
+
* Collect boundary edges.
|
|
244712
|
+
* * Return the edges as the simplest collection of chains of line segments.
|
|
244713
|
+
* @param source polyface or visitor.
|
|
244714
|
+
* @param includeTypical true to in include typical boundary edges with a single adjacent facet.
|
|
244715
|
+
* @param includeMismatch true to include edges with more than 2 adjacent facets.
|
|
244716
|
+
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
244717
|
+
*/
|
|
244718
|
+
static collectBoundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
244719
|
+
const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_12__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
|
|
244720
|
+
PolyfaceQuery.announceBoundaryEdges(source, (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(ptA, ptB)), includeTypical, includeMismatch, includeNull);
|
|
244721
|
+
return collector.grabResult(true);
|
|
244722
|
+
}
|
|
244650
244723
|
/**
|
|
244651
244724
|
* Load all half edges from a mesh to an IndexedEdgeMatcher.
|
|
244652
244725
|
* @param polyface a mesh or a visitor assumed to have numWrap === 1.
|
|
@@ -245092,13 +245165,17 @@ class PolyfaceQuery {
|
|
|
245092
245165
|
}
|
|
245093
245166
|
return builder.claimPolyface(true);
|
|
245094
245167
|
}
|
|
245095
|
-
/**
|
|
245168
|
+
/**
|
|
245169
|
+
* Return the point count of the `source`.
|
|
245170
|
+
* * If `source` is a visitor, this is an upper bound on the number of addressed mesh vertices.
|
|
245171
|
+
*/
|
|
245096
245172
|
static visitorClientPointCount(source) {
|
|
245097
245173
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
245098
245174
|
return source.data.point.length;
|
|
245099
245175
|
const polyface = source.clientPolyface();
|
|
245100
245176
|
if (polyface !== undefined)
|
|
245101
245177
|
return polyface.data.point.length;
|
|
245178
|
+
const saveReadIndex = source.currentReadIndex();
|
|
245102
245179
|
source.reset();
|
|
245103
245180
|
let maxIndex = -1;
|
|
245104
245181
|
while (source.moveToNextFacet()) {
|
|
@@ -245106,22 +245183,30 @@ class PolyfaceQuery {
|
|
|
245106
245183
|
if (pointIndex > maxIndex)
|
|
245107
245184
|
maxIndex = pointIndex;
|
|
245108
245185
|
}
|
|
245186
|
+
source.moveToReadIndex(saveReadIndex);
|
|
245109
245187
|
return maxIndex + 1;
|
|
245110
245188
|
}
|
|
245111
|
-
/**
|
|
245189
|
+
/**
|
|
245190
|
+
* Return the facet count of the `source`.
|
|
245191
|
+
* * If `source` is a visitor, this is the number of facets it can visit.
|
|
245192
|
+
*/
|
|
245112
245193
|
static visitorClientFacetCount(source) {
|
|
245113
245194
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
245114
245195
|
if (source.facetCount !== undefined)
|
|
245115
245196
|
return source.facetCount;
|
|
245116
245197
|
source = source.createVisitor(0);
|
|
245117
245198
|
}
|
|
245199
|
+
if (source.getVisitableFacetCount)
|
|
245200
|
+
return source.getVisitableFacetCount();
|
|
245118
245201
|
const polyface = source.clientPolyface();
|
|
245119
245202
|
if (polyface !== undefined && polyface.facetCount !== undefined)
|
|
245120
245203
|
return polyface.facetCount;
|
|
245204
|
+
const saveReadIndex = source.currentReadIndex();
|
|
245121
245205
|
let facetCount = 0;
|
|
245122
245206
|
source.reset();
|
|
245123
245207
|
while (source.moveToNextFacet())
|
|
245124
245208
|
++facetCount;
|
|
245209
|
+
source.moveToReadIndex(saveReadIndex);
|
|
245125
245210
|
return facetCount;
|
|
245126
245211
|
}
|
|
245127
245212
|
/**
|
|
@@ -245426,21 +245511,6 @@ class PolyfaceQuery {
|
|
|
245426
245511
|
}
|
|
245427
245512
|
return 0;
|
|
245428
245513
|
}
|
|
245429
|
-
/**
|
|
245430
|
-
* Collect facet duplicates.
|
|
245431
|
-
* @param polyface the polyface.
|
|
245432
|
-
* @param includeSingletons if true, non-duplicated facets are included in the output.
|
|
245433
|
-
* @returns an array of arrays describing facet duplication. Each array `entry` in the output contains read
|
|
245434
|
-
* indices of a cluster of facets with the same vertex indices.
|
|
245435
|
-
*/
|
|
245436
|
-
static collectDuplicateFacetIndices(polyface, includeSingletons = false) {
|
|
245437
|
-
const result = [];
|
|
245438
|
-
this.announceDuplicateFacetIndices(polyface, (clusterFacetIndices) => {
|
|
245439
|
-
if (includeSingletons || clusterFacetIndices.length > 1)
|
|
245440
|
-
result.push(clusterFacetIndices.slice());
|
|
245441
|
-
});
|
|
245442
|
-
return result;
|
|
245443
|
-
}
|
|
245444
245514
|
/**
|
|
245445
245515
|
* Announce facet duplicates.
|
|
245446
245516
|
* @returns an array of arrays describing facet duplication. Each array `entry` in the output contains read
|
|
@@ -245489,10 +245559,25 @@ class PolyfaceQuery {
|
|
|
245489
245559
|
}
|
|
245490
245560
|
}
|
|
245491
245561
|
/**
|
|
245492
|
-
*
|
|
245562
|
+
* Collect facet duplicates.
|
|
245563
|
+
* @param polyface the polyface.
|
|
245564
|
+
* @param includeSingletons if true, non-duplicated facets are included in the output.
|
|
245565
|
+
* @returns an array of arrays describing facet duplication. Each array `entry` in the output contains read
|
|
245566
|
+
* indices of a cluster of facets with the same vertex indices.
|
|
245567
|
+
*/
|
|
245568
|
+
static collectDuplicateFacetIndices(polyface, includeSingletons = false) {
|
|
245569
|
+
const result = [];
|
|
245570
|
+
this.announceDuplicateFacetIndices(polyface, (clusterFacetIndices) => {
|
|
245571
|
+
if (includeSingletons || clusterFacetIndices.length > 1)
|
|
245572
|
+
result.push(clusterFacetIndices.slice());
|
|
245573
|
+
});
|
|
245574
|
+
return result;
|
|
245575
|
+
}
|
|
245576
|
+
/**
|
|
245577
|
+
* Return a new facet set from the source facets, specifying how to copy duplicate facets.
|
|
245493
245578
|
* @param source the polyface.
|
|
245494
245579
|
* @param includeSingletons true to copy facets that only appear once
|
|
245495
|
-
* @param clusterSelector indicates whether
|
|
245580
|
+
* @param clusterSelector indicates whether to copy 0, 1, or all facets in each cluster of duplicate facets.
|
|
245496
245581
|
*/
|
|
245497
245582
|
static cloneByFacetDuplication(source, includeSingletons, clusterSelector) {
|
|
245498
245583
|
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
@@ -263130,8 +263215,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
263130
263215
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
263131
263216
|
/* harmony export */ "TorusPipe": () => (/* binding */ TorusPipe)
|
|
263132
263217
|
/* harmony export */ });
|
|
263133
|
-
/* harmony import */ var
|
|
263134
|
-
/* harmony import */ var
|
|
263218
|
+
/* harmony import */ var _curve_Arc3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../curve/Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
263219
|
+
/* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
263135
263220
|
/* harmony import */ var _curve_Path__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../curve/Path */ "../../core/geometry/lib/esm/curve/Path.js");
|
|
263136
263221
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
263137
263222
|
/* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
@@ -263158,23 +263243,27 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
263158
263243
|
|
|
263159
263244
|
|
|
263160
263245
|
/**
|
|
263161
|
-
* A torus pipe is a partial torus (donut).
|
|
263162
|
-
* *
|
|
263163
|
-
* * The "major hoop" arc
|
|
263164
|
-
* * vectorTheta0 = (radiusA, 0, 0)
|
|
263165
|
-
* * vectorTheta90 = (0, radiusA, 0)
|
|
263166
|
-
* *
|
|
263167
|
-
* * The minor hoop
|
|
263168
|
-
*
|
|
263246
|
+
* A torus pipe is a partial torus (donut).
|
|
263247
|
+
* * In its local coordinate system, the z-axis passes through the donut hole.
|
|
263248
|
+
* * The "major hoop" circular arc is defined for theta in the angular sweep. Its formula in local coordinates:
|
|
263249
|
+
* * `vectorTheta0 = (radiusA, 0, 0)`
|
|
263250
|
+
* * `vectorTheta90 = (0, radiusA, 0)`
|
|
263251
|
+
* * `M(theta) = vectorTheta0 * cos(theta) + vectorTheta90 * sin(theta)`
|
|
263252
|
+
* * The "minor hoop" circular arc is defined for phi in [0,2pi]. Its formula, centered at the origin:
|
|
263253
|
+
* * `vectorPhi0 = (radiusB * cos(theta), radiusB * sin(theta), 0)`
|
|
263254
|
+
* * `vectorPhi90 = (0, 0, radiusB)`
|
|
263255
|
+
* * `m(phi) = vectorPhi0 * cos(phi) + vectorPhi90 * sin(phi)`
|
|
263256
|
+
* * Thus the torus pipe in local coordinates has the formula:
|
|
263257
|
+
* * `T(theta, phi) = M(theta) + m(phi)`
|
|
263169
263258
|
* * The stored form of the torus pipe is oriented for positive volume:
|
|
263170
263259
|
* * Both radii are positive, with radiusA >= radiusB > 0
|
|
263171
263260
|
* * The sweep is positive
|
|
263172
263261
|
* * The coordinate system has positive determinant.
|
|
263173
263262
|
* * For uv parameterization,
|
|
263174
|
-
* * u is around the minor hoop, with
|
|
263175
|
-
* * v is along the major hoop with
|
|
263263
|
+
* * u is around the minor hoop, with u in [0,1] mapping to phi in [0, 2pi]
|
|
263264
|
+
* * v is along the major hoop, with v in [0,1] mapping to theta in the angular sweep
|
|
263176
263265
|
* * a constant v section is a full circle
|
|
263177
|
-
* * a constant u section is an arc with sweep
|
|
263266
|
+
* * a constant u section is an arc with the same angular sweep as the torusPipe
|
|
263178
263267
|
* @public
|
|
263179
263268
|
*/
|
|
263180
263269
|
class TorusPipe extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
|
|
@@ -263253,14 +263342,22 @@ class TorusPipe extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimit
|
|
|
263253
263342
|
const frame = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createOriginAndMatrixColumns(center, vectorX, vectorY, vectorZ);
|
|
263254
263343
|
return TorusPipe.createInFrame(frame, majorRadius, minorRadius, sweep, capped);
|
|
263255
263344
|
}
|
|
263256
|
-
/**
|
|
263345
|
+
/**
|
|
263346
|
+
* Create a TorusPipe from major arc and minor radius.
|
|
263347
|
+
* For best results, `arc` should be circular; otherwise, circularity is coerced.
|
|
263348
|
+
*/
|
|
263257
263349
|
static createAlongArc(arc, minorRadius, capped) {
|
|
263258
263350
|
if (!_geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.isAlmostEqualRadiansAllowPeriodShift(0.0, arc.sweep.startRadians))
|
|
263259
263351
|
arc = arc.cloneInRotatedBasis(arc.sweep.startAngle);
|
|
263260
|
-
|
|
263352
|
+
if (!arc.isCircular) { // ensure circularity by squaring the axes and equating their lengths
|
|
263353
|
+
const perpVector90 = arc.perpendicularVector.sizedCrossProduct(arc.vector0, arc.matrixRef.columnXMagnitude());
|
|
263354
|
+
if (!perpVector90)
|
|
263355
|
+
return undefined;
|
|
263356
|
+
arc = _curve_Arc3d__WEBPACK_IMPORTED_MODULE_4__.Arc3d.create(arc.center, arc.vector0, perpVector90, arc.sweep);
|
|
263357
|
+
}
|
|
263261
263358
|
const data = arc.toScaledMatrix3d();
|
|
263262
|
-
const
|
|
263263
|
-
return TorusPipe.createInFrame(
|
|
263359
|
+
const rigidFrame = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createOriginAndMatrix(arc.center, data.axes);
|
|
263360
|
+
return TorusPipe.createInFrame(rigidFrame, data.r0, minorRadius, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createRadians(arc.sweep.sweepRadians), capped);
|
|
263264
263361
|
}
|
|
263265
263362
|
/** Return a coordinate frame (right handed, unit axes)
|
|
263266
263363
|
* * origin at center of major circle
|
|
@@ -263347,7 +263444,7 @@ class TorusPipe extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimit
|
|
|
263347
263444
|
const center = this._localToWorld.multiplyXYZ(majorRadius * c0, majorRadius * s0, 0);
|
|
263348
263445
|
const vector0 = this._localToWorld.multiplyVectorXYZ(minorRadius * c0, minorRadius * s0, 0);
|
|
263349
263446
|
const vector90 = this._localToWorld.multiplyVectorXYZ(0, 0, minorRadius);
|
|
263350
|
-
return
|
|
263447
|
+
return _curve_Loop__WEBPACK_IMPORTED_MODULE_5__.Loop.create(_curve_Arc3d__WEBPACK_IMPORTED_MODULE_4__.Arc3d.create(center, vector0, vector90));
|
|
263351
263448
|
}
|
|
263352
263449
|
/** Return an arc at constant u, and arc sweep matching this TorusPipe sweep. */
|
|
263353
263450
|
constantUSection(uFraction) {
|
|
@@ -263361,7 +263458,7 @@ class TorusPipe extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimit
|
|
|
263361
263458
|
const rxy = majorRadius + minorRadius * Math.cos(phiRadians);
|
|
263362
263459
|
const vector0 = axes.multiplyXYZ(rxy, 0, 0);
|
|
263363
263460
|
const vector90 = axes.multiplyXYZ(0, rxy, 0);
|
|
263364
|
-
return _curve_Path__WEBPACK_IMPORTED_MODULE_6__.Path.create(
|
|
263461
|
+
return _curve_Path__WEBPACK_IMPORTED_MODULE_6__.Path.create(_curve_Arc3d__WEBPACK_IMPORTED_MODULE_4__.Arc3d.create(center, vector0, vector90, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_7__.AngleSweep.createStartEndRadians(0.0, theta1Radians)));
|
|
263365
263462
|
}
|
|
263366
263463
|
/** extend `rangeToExtend` to include this `TorusPipe` */
|
|
263367
263464
|
extendRange(rangeToExtend, transform) {
|
|
@@ -288639,6 +288736,10 @@ class Parser {
|
|
|
288639
288736
|
}
|
|
288640
288737
|
// common case where single value and single label are supplied
|
|
288641
288738
|
if (tokens.length === 2) {
|
|
288739
|
+
// unit specification comes before value (like currency)
|
|
288740
|
+
if (tokens[1].isNumber && tokens[0].isString) {
|
|
288741
|
+
tokens = [tokens[1], tokens[0]];
|
|
288742
|
+
}
|
|
288642
288743
|
if (tokens[0].isNumber && tokens[1].isString) {
|
|
288643
288744
|
const unit = await this.lookupUnitByLabel(tokens[1].value, format, unitsProvider, altUnitLabelsProvider);
|
|
288644
288745
|
if (undefined === defaultUnit)
|
|
@@ -288652,21 +288753,6 @@ class Parser {
|
|
|
288652
288753
|
return new _Quantity__WEBPACK_IMPORTED_MODULE_2__.Quantity(defaultUnit, mag);
|
|
288653
288754
|
}
|
|
288654
288755
|
}
|
|
288655
|
-
else { // unit specification comes before value (like currency)
|
|
288656
|
-
if (tokens[1].isNumber && tokens[0].isString) {
|
|
288657
|
-
const unit = await this.lookupUnitByLabel(tokens[0].value, format, unitsProvider, altUnitLabelsProvider);
|
|
288658
|
-
if (undefined === defaultUnit)
|
|
288659
|
-
defaultUnit = unit;
|
|
288660
|
-
if (defaultUnit && defaultUnit.name === unit.name) {
|
|
288661
|
-
return new _Quantity__WEBPACK_IMPORTED_MODULE_2__.Quantity(defaultUnit, tokens[1].value);
|
|
288662
|
-
}
|
|
288663
|
-
else if (defaultUnit) {
|
|
288664
|
-
const conversion = await unitsProvider.getConversion(unit, defaultUnit);
|
|
288665
|
-
const mag = ((tokens[1].value * conversion.factor)) + conversion.offset;
|
|
288666
|
-
return new _Quantity__WEBPACK_IMPORTED_MODULE_2__.Quantity(defaultUnit, mag);
|
|
288667
|
-
}
|
|
288668
|
-
}
|
|
288669
|
-
}
|
|
288670
288756
|
}
|
|
288671
288757
|
// common case where there are multiple value/label pairs
|
|
288672
288758
|
if (tokens.length % 2 === 0) {
|
|
@@ -288778,8 +288864,16 @@ class Parser {
|
|
|
288778
288864
|
}
|
|
288779
288865
|
// common case where single value and single label are supplied
|
|
288780
288866
|
if (tokens.length === 2) {
|
|
288867
|
+
// unit specification comes before value (like currency)
|
|
288868
|
+
if (tokens[1].isNumber && tokens[0].isString) {
|
|
288869
|
+
tokens = [tokens[1], tokens[0]];
|
|
288870
|
+
}
|
|
288781
288871
|
if (tokens[0].isNumber && tokens[1].isString) {
|
|
288782
|
-
|
|
288872
|
+
let conversion = Parser.tryFindUnitConversion(tokens[1].value, unitsConversions, defaultUnit);
|
|
288873
|
+
// if no conversion, ignore value in second token. If we have defaultUnit, use it.
|
|
288874
|
+
if (!conversion && defaultUnit) {
|
|
288875
|
+
conversion = Parser.tryFindUnitConversion(defaultUnit.label, unitsConversions, defaultUnit);
|
|
288876
|
+
}
|
|
288783
288877
|
if (conversion) {
|
|
288784
288878
|
const value = tokens[0].value * conversion.factor + conversion.offset;
|
|
288785
288879
|
return { ok: true, value };
|
|
@@ -288787,17 +288881,6 @@ class Parser {
|
|
|
288787
288881
|
// if no conversion, just return parsed number and ignore value in second token
|
|
288788
288882
|
return { ok: true, value: tokens[0].value };
|
|
288789
288883
|
}
|
|
288790
|
-
else { // unit specification comes before value (like currency)
|
|
288791
|
-
if (tokens[1].isNumber && tokens[0].isString) {
|
|
288792
|
-
const conversion = Parser.tryFindUnitConversion(tokens[0].value, unitsConversions, defaultUnit);
|
|
288793
|
-
if (conversion) {
|
|
288794
|
-
const value = tokens[1].value * conversion.factor + conversion.offset;
|
|
288795
|
-
return { ok: true, value };
|
|
288796
|
-
}
|
|
288797
|
-
// if no conversion, just return parsed number and ignore value in second token
|
|
288798
|
-
return { ok: true, value: tokens[1].value };
|
|
288799
|
-
}
|
|
288800
|
-
}
|
|
288801
288884
|
}
|
|
288802
288885
|
// common case where there are multiple value/label pairs
|
|
288803
288886
|
if (tokens.length % 2 === 0) {
|
|
@@ -290225,7 +290308,7 @@ class TestContext {
|
|
|
290225
290308
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
290226
290309
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
290227
290310
|
await core_frontend_1.NoRenderApp.startup({
|
|
290228
|
-
applicationVersion: "4.7.0
|
|
290311
|
+
applicationVersion: "4.7.0",
|
|
290229
290312
|
applicationId: this.settings.gprid,
|
|
290230
290313
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
|
|
290231
290314
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -314220,7 +314303,7 @@ function __disposeResources(env) {
|
|
|
314220
314303
|
/***/ ((module) => {
|
|
314221
314304
|
|
|
314222
314305
|
"use strict";
|
|
314223
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.7.0
|
|
314306
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.7.0","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./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 -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","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:^4.7.0","@itwin/core-bentley":"workspace:^4.7.0","@itwin/core-common":"workspace:^4.7.0","@itwin/core-geometry":"workspace:^4.7.0","@itwin/core-orbitgt":"workspace:^4.7.0","@itwin/core-quantity":"workspace:^4.7.0"},"//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/certa":"workspace:*","@itwin/eslint-plugin":"^4.0.2","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.56.0","glob":"^10.3.12","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.3.3","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.2.2","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","meshoptimizer":"~0.20.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
|
|
314224
314307
|
|
|
314225
314308
|
/***/ }),
|
|
314226
314309
|
|