@itwin/ecschema-rpcinterface-tests 5.0.0-dev.114 → 5.0.0-dev.116
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 +762 -569
- 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_cross-fetch_4_0_0_node_modules_cross-fetch_dist_browser-24291b.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/package.json +16 -16
|
@@ -170772,6 +170772,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
170772
170772
|
/* harmony import */ var _SelectTool__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./SelectTool */ "../../core/frontend/lib/esm/tools/SelectTool.js");
|
|
170773
170773
|
/* harmony import */ var _Tool__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Tool */ "../../core/frontend/lib/esm/tools/Tool.js");
|
|
170774
170774
|
/* harmony import */ var _ToolAssistance__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ToolAssistance */ "../../core/frontend/lib/esm/tools/ToolAssistance.js");
|
|
170775
|
+
/* harmony import */ var _ToolSettings__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./ToolSettings */ "../../core/frontend/lib/esm/tools/ToolSettings.js");
|
|
170775
170776
|
/*---------------------------------------------------------------------------------------------
|
|
170776
170777
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
170777
170778
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -170792,6 +170793,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
170792
170793
|
|
|
170793
170794
|
|
|
170794
170795
|
|
|
170796
|
+
|
|
170795
170797
|
/** Identifies the source of the elements in the agenda.
|
|
170796
170798
|
* @public
|
|
170797
170799
|
*/
|
|
@@ -171189,12 +171191,105 @@ class ElementSetTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.Primiti
|
|
|
171189
171191
|
await this.onAgendaModified();
|
|
171190
171192
|
return true;
|
|
171191
171193
|
}
|
|
171192
|
-
/** Get
|
|
171193
|
-
|
|
171194
|
-
|
|
171195
|
-
|
|
171194
|
+
/** Get ids of spatial elements to process from a clip volume created by drag box selection. */
|
|
171195
|
+
static async getVolumeSelectionCandidates(vp, origin, corner, allowOverlaps, filter) {
|
|
171196
|
+
const contents = new Set();
|
|
171197
|
+
if (!vp.view.isSpatialView())
|
|
171198
|
+
return contents;
|
|
171199
|
+
const boxRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Range2d.createXYXY(origin.x, origin.y, corner.x, corner.y);
|
|
171200
|
+
if (boxRange.isNull || boxRange.isAlmostZeroX || boxRange.isAlmostZeroY)
|
|
171201
|
+
return contents;
|
|
171202
|
+
const getClipPlane = (viewPt, viewDir, negate) => {
|
|
171203
|
+
const point = vp.viewToWorld(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point3d.createFrom(viewPt));
|
|
171204
|
+
const boresite = _AccuDraw__WEBPACK_IMPORTED_MODULE_3__.AccuDrawHintBuilder.getBoresite(point, vp);
|
|
171205
|
+
const normal = viewDir.crossProduct(boresite.direction);
|
|
171206
|
+
if (negate)
|
|
171207
|
+
normal.negate(normal);
|
|
171208
|
+
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ClipPlane.createNormalAndPoint(normal, point);
|
|
171209
|
+
};
|
|
171210
|
+
const planeSet = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ConvexClipPlaneSet.createEmpty();
|
|
171211
|
+
planeSet.addPlaneToConvexSet(getClipPlane(boxRange.low, vp.rotation.rowX(), true));
|
|
171212
|
+
planeSet.addPlaneToConvexSet(getClipPlane(boxRange.low, vp.rotation.rowY(), true));
|
|
171213
|
+
planeSet.addPlaneToConvexSet(getClipPlane(boxRange.high, vp.rotation.rowX(), false));
|
|
171214
|
+
planeSet.addPlaneToConvexSet(getClipPlane(boxRange.high, vp.rotation.rowY(), false));
|
|
171215
|
+
if (0 === planeSet.planes.length)
|
|
171216
|
+
return contents;
|
|
171217
|
+
const clip = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ClipVector.createCapture([_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ClipPrimitive.createCapture(planeSet)]);
|
|
171218
|
+
const viewRange = vp.computeViewRange();
|
|
171219
|
+
const range = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ClipUtilities.rangeOfClipperIntersectionWithRange(clip, viewRange);
|
|
171220
|
+
if (range.isNull)
|
|
171221
|
+
return contents;
|
|
171222
|
+
// TODO: Possible to make UnionOfComplexClipPlaneSets from view clip and planes work and remove 2nd containment check?
|
|
171223
|
+
const viewClip = (vp.viewFlags.clipVolume ? vp.view.getViewClip()?.clone() : undefined);
|
|
171224
|
+
if (viewClip) {
|
|
171225
|
+
const viewClipRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ClipUtilities.rangeOfClipperIntersectionWithRange(viewClip, viewRange);
|
|
171226
|
+
if (viewClipRange.isNull || !viewClipRange.intersectsRange(range))
|
|
171227
|
+
return contents;
|
|
171228
|
+
}
|
|
171229
|
+
const candidates = [];
|
|
171230
|
+
const categories = new Set();
|
|
171231
|
+
try {
|
|
171232
|
+
const viewedModels = [...vp.view.modelSelector.models].join(",");
|
|
171233
|
+
const viewedCategories = [...vp.view.categorySelector.categories].join(",");
|
|
171234
|
+
const ecsql = `SELECT e.ECInstanceId, Category.Id as category FROM bis.SpatialElement e JOIN bis.SpatialIndex i ON e.ECInstanceId=i.ECInstanceId WHERE Model.Id IN (${viewedModels}) AND Category.Id IN (${viewedCategories}) AND i.MinX <= ${range.xHigh} AND i.MinY <= ${range.yHigh} AND i.MinZ <= ${range.zHigh} AND i.MaxX >= ${range.xLow} AND i.MaxY >= ${range.yLow} AND i.MaxZ >= ${range.zLow}`;
|
|
171235
|
+
const reader = vp.iModel.createQueryReader(ecsql, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseECSqlPropertyNames });
|
|
171236
|
+
for await (const row of reader) {
|
|
171237
|
+
candidates.push(row.ECInstanceId);
|
|
171238
|
+
categories.add(row.category);
|
|
171239
|
+
}
|
|
171240
|
+
}
|
|
171241
|
+
catch { }
|
|
171242
|
+
if (0 === candidates.length)
|
|
171243
|
+
return contents;
|
|
171244
|
+
let offSubCategories;
|
|
171245
|
+
if (0 !== categories.size) {
|
|
171246
|
+
for (const categoryId of categories) {
|
|
171247
|
+
const subcategories = vp.iModel.subcategories.getSubCategories(categoryId);
|
|
171248
|
+
if (undefined === subcategories)
|
|
171249
|
+
continue;
|
|
171250
|
+
for (const subCategoryId of subcategories) {
|
|
171251
|
+
const appearance = vp.iModel.subcategories.getSubCategoryAppearance(subCategoryId);
|
|
171252
|
+
if (undefined === appearance || (!appearance.invisible && !appearance.dontLocate))
|
|
171253
|
+
continue;
|
|
171254
|
+
if (undefined === offSubCategories)
|
|
171255
|
+
offSubCategories = new Array;
|
|
171256
|
+
offSubCategories.push(subCategoryId);
|
|
171257
|
+
}
|
|
171258
|
+
}
|
|
171259
|
+
}
|
|
171260
|
+
const requestProps = {
|
|
171261
|
+
candidates,
|
|
171262
|
+
clip: clip.toJSON(),
|
|
171263
|
+
allowOverlaps,
|
|
171264
|
+
viewFlags: vp.viewFlags.toJSON(),
|
|
171265
|
+
offSubCategories,
|
|
171266
|
+
};
|
|
171267
|
+
const result = await vp.iModel.getGeometryContainment(requestProps);
|
|
171268
|
+
if (_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyStatus.SUCCESS !== result.status || undefined === result.candidatesContainment)
|
|
171269
|
+
return contents;
|
|
171270
|
+
result.candidatesContainment.forEach((status, index) => {
|
|
171271
|
+
if (_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ClipPlaneContainment.StronglyOutside !== status && (undefined === filter || filter(candidates[index])))
|
|
171272
|
+
contents.add(candidates[index]);
|
|
171273
|
+
});
|
|
171274
|
+
if (0 !== contents.size && viewClip) {
|
|
171275
|
+
requestProps.clip = viewClip.toJSON();
|
|
171276
|
+
requestProps.candidates.length = 0;
|
|
171277
|
+
for (const id of contents)
|
|
171278
|
+
requestProps.candidates.push(id);
|
|
171279
|
+
contents.clear();
|
|
171280
|
+
const resultViewClip = await vp.iModel.getGeometryContainment(requestProps);
|
|
171281
|
+
if (_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyStatus.SUCCESS !== resultViewClip.status || undefined === resultViewClip.candidatesContainment)
|
|
171282
|
+
return contents;
|
|
171283
|
+
resultViewClip.candidatesContainment.forEach((status, index) => {
|
|
171284
|
+
if (_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.ClipPlaneContainment.StronglyOutside !== status)
|
|
171285
|
+
contents.add(candidates[index]);
|
|
171286
|
+
});
|
|
171287
|
+
}
|
|
171288
|
+
return contents;
|
|
171289
|
+
}
|
|
171290
|
+
/** Get ids of visible elements to process from drag box or crossing line selection. */
|
|
171291
|
+
static getAreaSelectionCandidates(vp, origin, corner, method, allowOverlaps, filter) {
|
|
171196
171292
|
let contents = new Set();
|
|
171197
|
-
// TODO: Include option to use IModelConnection.getGeometryContainment instead of readPixels. No/Yes/2dOnly...
|
|
171198
171293
|
const pts = [];
|
|
171199
171294
|
pts[0] = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point2d(Math.floor(origin.x + 0.5), Math.floor(origin.y + 0.5));
|
|
171200
171295
|
pts[1] = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Point2d(Math.floor(corner.x + 0.5), Math.floor(corner.y + 0.5));
|
|
@@ -171217,12 +171312,12 @@ class ElementSetTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.Primiti
|
|
|
171217
171312
|
return undefined; // no geometry at this location...
|
|
171218
171313
|
if (!vp.isPixelSelectable(pixel))
|
|
171219
171314
|
return undefined; // reality model, terrain, etc - not selectable
|
|
171220
|
-
if (!
|
|
171315
|
+
if (undefined !== filter && !filter(pixel.elementId))
|
|
171221
171316
|
return undefined;
|
|
171222
171317
|
return pixel.elementId;
|
|
171223
171318
|
};
|
|
171224
171319
|
if (_SelectTool__WEBPACK_IMPORTED_MODULE_10__.SelectionMethod.Box === method) {
|
|
171225
|
-
const outline =
|
|
171320
|
+
const outline = allowOverlaps ? undefined : new Set();
|
|
171226
171321
|
const offset = sRange.clone();
|
|
171227
171322
|
offset.expandInPlace(-2);
|
|
171228
171323
|
for (testPoint.x = sRange.low.x; testPoint.x <= sRange.high.x; ++testPoint.x) {
|
|
@@ -171264,6 +171359,33 @@ class ElementSetTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.Primiti
|
|
|
171264
171359
|
}, true);
|
|
171265
171360
|
return contents;
|
|
171266
171361
|
}
|
|
171362
|
+
/** Get ids of elements to process from drag box or crossing line selection using either the depth buffer or clip vector...
|
|
171363
|
+
* @internal
|
|
171364
|
+
*/
|
|
171365
|
+
static async getAreaOrVolumeSelectionCandidates(vp, origin, corner, method, allowOverlaps, filter, includeDecorationsForVolume) {
|
|
171366
|
+
let contents;
|
|
171367
|
+
if (_ToolSettings__WEBPACK_IMPORTED_MODULE_13__.ToolSettings.enableVolumeSelection && _SelectTool__WEBPACK_IMPORTED_MODULE_10__.SelectionMethod.Box === method && vp.view.isSpatialView()) {
|
|
171368
|
+
contents = await ElementSetTool.getVolumeSelectionCandidates(vp, origin, corner, allowOverlaps, filter);
|
|
171369
|
+
// Use area select to identify pickable transients...
|
|
171370
|
+
if (includeDecorationsForVolume) {
|
|
171371
|
+
const acceptTransientsFilter = (id) => { return _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.isTransient(id) && (undefined === filter || filter(id)); };
|
|
171372
|
+
const transients = ElementSetTool.getAreaSelectionCandidates(vp, origin, corner, method, allowOverlaps, acceptTransientsFilter);
|
|
171373
|
+
for (const id of transients)
|
|
171374
|
+
contents.add(id);
|
|
171375
|
+
}
|
|
171376
|
+
}
|
|
171377
|
+
else {
|
|
171378
|
+
contents = ElementSetTool.getAreaSelectionCandidates(vp, origin, corner, method, allowOverlaps, filter);
|
|
171379
|
+
}
|
|
171380
|
+
return contents;
|
|
171381
|
+
}
|
|
171382
|
+
/** Get element ids to process from drag box or crossing line selection.
|
|
171383
|
+
* Sub-classes may override to support selection scopes or apply tool specific filtering.
|
|
171384
|
+
*/
|
|
171385
|
+
async getDragSelectCandidates(vp, origin, corner, method, overlap) {
|
|
171386
|
+
const filter = (id) => { return this.isElementIdValid(id, ModifyElementSource.DragSelect); };
|
|
171387
|
+
return ElementSetTool.getAreaOrVolumeSelectionCandidates(vp, origin, corner, method, overlap, filter, _IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.locateManager.options.allowDecorations);
|
|
171388
|
+
}
|
|
171267
171389
|
/** Populate [[ElementSetTool.agenda]] by drag box or crossing line information.
|
|
171268
171390
|
* @see [[ElementSetTool.getDragSelectCandidates]] to filter or augment the set of elements.
|
|
171269
171391
|
*/
|
|
@@ -173587,17 +173709,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
173587
173709
|
/* harmony export */ SelectionTool: () => (/* binding */ SelectionTool)
|
|
173588
173710
|
/* harmony export */ });
|
|
173589
173711
|
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
173590
|
-
/* harmony import */ var
|
|
173591
|
-
/* harmony import */ var
|
|
173592
|
-
/* harmony import */ var
|
|
173593
|
-
/* harmony import */ var
|
|
173594
|
-
/* harmony import */ var
|
|
173595
|
-
/* harmony import */ var
|
|
173596
|
-
/* harmony import */ var
|
|
173597
|
-
/* harmony import */ var
|
|
173598
|
-
/* harmony import */ var
|
|
173599
|
-
/* harmony import */ var _ToolAdmin__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ToolAdmin */ "../../core/frontend/lib/esm/tools/ToolAdmin.js");
|
|
173600
|
-
/* harmony import */ var _ToolAssistance__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ToolAssistance */ "../../core/frontend/lib/esm/tools/ToolAssistance.js");
|
|
173712
|
+
/* harmony import */ var _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-common */ "../../core/common/lib/esm/core-common.js");
|
|
173713
|
+
/* harmony import */ var _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @itwin/appui-abstract */ "../../ui/appui-abstract/lib/esm/appui-abstract.js");
|
|
173714
|
+
/* harmony import */ var _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../ElementLocateManager */ "../../core/frontend/lib/esm/ElementLocateManager.js");
|
|
173715
|
+
/* harmony import */ var _IModelApp__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../IModelApp */ "../../core/frontend/lib/esm/IModelApp.js");
|
|
173716
|
+
/* harmony import */ var _PrimitiveTool__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PrimitiveTool */ "../../core/frontend/lib/esm/tools/PrimitiveTool.js");
|
|
173717
|
+
/* harmony import */ var _Tool__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Tool */ "../../core/frontend/lib/esm/tools/Tool.js");
|
|
173718
|
+
/* harmony import */ var _ToolAdmin__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ToolAdmin */ "../../core/frontend/lib/esm/tools/ToolAdmin.js");
|
|
173719
|
+
/* harmony import */ var _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ToolAssistance */ "../../core/frontend/lib/esm/tools/ToolAssistance.js");
|
|
173720
|
+
/* harmony import */ var _ElementSetTool__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ElementSetTool */ "../../core/frontend/lib/esm/tools/ElementSetTool.js");
|
|
173601
173721
|
/*---------------------------------------------------------------------------------------------
|
|
173602
173722
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
173603
173723
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -173615,8 +173735,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
173615
173735
|
|
|
173616
173736
|
|
|
173617
173737
|
|
|
173618
|
-
|
|
173619
|
-
|
|
173620
173738
|
// cSpell:ignore buttongroup
|
|
173621
173739
|
/** The method for choosing elements with the [[SelectionTool]]
|
|
173622
173740
|
* @public
|
|
@@ -173662,7 +173780,7 @@ var SelectionProcessing;
|
|
|
173662
173780
|
/** Tool for picking a set of elements of interest, selected by the user.
|
|
173663
173781
|
* @public
|
|
173664
173782
|
*/
|
|
173665
|
-
class SelectionTool extends
|
|
173783
|
+
class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_5__.PrimitiveTool {
|
|
173666
173784
|
static hidden = false;
|
|
173667
173785
|
static toolId = "Select";
|
|
173668
173786
|
static iconSpec = "icon-cursor";
|
|
@@ -173681,7 +173799,7 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173681
173799
|
set selectionMethod(method) { this._selectionMethodValue.value = method; }
|
|
173682
173800
|
get selectionMode() { return this._selectionModeValue.value; }
|
|
173683
173801
|
set selectionMode(mode) { this._selectionModeValue.value = mode; }
|
|
173684
|
-
static methodsMessage(str) { return
|
|
173802
|
+
static methodsMessage(str) { return _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate(`ElementSet.SelectionMethods.${str}`); }
|
|
173685
173803
|
static _methodsName = "selectionMethods";
|
|
173686
173804
|
/* The property descriptions used to generate ToolSettings UI. */
|
|
173687
173805
|
static _getMethodsDescription() {
|
|
@@ -173692,14 +173810,14 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173692
173810
|
editor: {
|
|
173693
173811
|
name: "enum-buttongroup",
|
|
173694
173812
|
params: [{
|
|
173695
|
-
type:
|
|
173813
|
+
type: _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_2__.PropertyEditorParamTypes.ButtonGroupData,
|
|
173696
173814
|
buttons: [
|
|
173697
173815
|
{ iconSpec: "icon-select-single" },
|
|
173698
173816
|
{ iconSpec: "icon-select-line" },
|
|
173699
173817
|
{ iconSpec: "icon-select-box" },
|
|
173700
173818
|
],
|
|
173701
173819
|
}, {
|
|
173702
|
-
type:
|
|
173820
|
+
type: _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_2__.PropertyEditorParamTypes.SuppressEditorLabel,
|
|
173703
173821
|
suppressLabelPlaceholder: true,
|
|
173704
173822
|
},
|
|
173705
173823
|
],
|
|
@@ -173713,7 +173831,7 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173713
173831
|
},
|
|
173714
173832
|
};
|
|
173715
173833
|
}
|
|
173716
|
-
static modesMessage(str) { return
|
|
173834
|
+
static modesMessage(str) { return _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate(`ElementSet.SelectionModes.${str}`); }
|
|
173717
173835
|
static _modesName = "selectionModes";
|
|
173718
173836
|
/* The property descriptions used to generate ToolSettings UI. */
|
|
173719
173837
|
static _getModesDescription() {
|
|
@@ -173724,20 +173842,20 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173724
173842
|
editor: {
|
|
173725
173843
|
name: "enum-buttongroup",
|
|
173726
173844
|
params: [{
|
|
173727
|
-
type:
|
|
173845
|
+
type: _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_2__.PropertyEditorParamTypes.ButtonGroupData,
|
|
173728
173846
|
buttons: [
|
|
173729
173847
|
{ iconSpec: "icon-replace" },
|
|
173730
173848
|
{ iconSpec: "icon-select-plus" },
|
|
173731
173849
|
{
|
|
173732
173850
|
iconSpec: "icon-select-minus",
|
|
173733
173851
|
isEnabledFunction: () => {
|
|
173734
|
-
const tool =
|
|
173735
|
-
return tool instanceof
|
|
173852
|
+
const tool = _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.activeTool;
|
|
173853
|
+
return tool instanceof _PrimitiveTool__WEBPACK_IMPORTED_MODULE_5__.PrimitiveTool ? tool.iModel.selectionSet.isActive : false;
|
|
173736
173854
|
},
|
|
173737
173855
|
},
|
|
173738
173856
|
],
|
|
173739
173857
|
}, {
|
|
173740
|
-
type:
|
|
173858
|
+
type: _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_2__.PropertyEditorParamTypes.SuppressEditorLabel,
|
|
173741
173859
|
suppressLabelPlaceholder: true,
|
|
173742
173860
|
},
|
|
173743
173861
|
],
|
|
@@ -173764,49 +173882,49 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173764
173882
|
mainMsg += (0 === this._points.length ? "StartCorner" : "OppositeCorner");
|
|
173765
173883
|
break;
|
|
173766
173884
|
}
|
|
173767
|
-
const mainInstruction =
|
|
173885
|
+
const mainInstruction = _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(this.iconSpec, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate(mainMsg));
|
|
173768
173886
|
const sections = [];
|
|
173769
173887
|
switch (method) {
|
|
173770
173888
|
case SelectionMethod.Pick:
|
|
173771
173889
|
const mousePickInstructions = [];
|
|
173772
|
-
mousePickInstructions.push(
|
|
173773
|
-
mousePickInstructions.push(
|
|
173774
|
-
mousePickInstructions.push(
|
|
173775
|
-
mousePickInstructions.push(
|
|
173890
|
+
mousePickInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.AcceptElement"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173891
|
+
mousePickInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClickDrag, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.BoxCorners"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173892
|
+
mousePickInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.RightClickDrag, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.CrossingLine"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173893
|
+
mousePickInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createModifierKeyInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.shiftKey, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClickDrag, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.OverlapSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173776
173894
|
if (SelectionMode.Replace === mode) {
|
|
173777
|
-
mousePickInstructions.push(
|
|
173778
|
-
mousePickInstructions.push(
|
|
173895
|
+
mousePickInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createKeyboardInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.ctrlKeyboardInfo, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.InvertSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173896
|
+
mousePickInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.CursorClick, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.ClearSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173779
173897
|
}
|
|
173780
|
-
sections.push(
|
|
173898
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createSection(mousePickInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.inputsLabel));
|
|
173781
173899
|
const touchPickInstructions = [];
|
|
173782
|
-
if (!
|
|
173783
|
-
touchPickInstructions.push(
|
|
173784
|
-
sections.push(
|
|
173900
|
+
if (!_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createTouchCursorInstructions(touchPickInstructions))
|
|
173901
|
+
touchPickInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.OneTouchTap, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.AcceptElement"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Touch));
|
|
173902
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createSection(touchPickInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.inputsLabel));
|
|
173785
173903
|
break;
|
|
173786
173904
|
case SelectionMethod.Line:
|
|
173787
173905
|
const mouseLineInstructions = [];
|
|
173788
|
-
mouseLineInstructions.push(
|
|
173906
|
+
mouseLineInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.AcceptPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173789
173907
|
if (SelectionMode.Replace === mode)
|
|
173790
|
-
mouseLineInstructions.push(
|
|
173791
|
-
sections.push(
|
|
173908
|
+
mouseLineInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createModifierKeyInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.ctrlKey, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.InvertSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173909
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createSection(mouseLineInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.inputsLabel));
|
|
173792
173910
|
const touchLineInstructions = [];
|
|
173793
|
-
touchLineInstructions.push(
|
|
173794
|
-
sections.push(
|
|
173911
|
+
touchLineInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.OneTouchDrag, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.AcceptPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Touch));
|
|
173912
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createSection(touchLineInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.inputsLabel));
|
|
173795
173913
|
break;
|
|
173796
173914
|
case SelectionMethod.Box:
|
|
173797
173915
|
const mouseBoxInstructions = [];
|
|
173798
|
-
mouseBoxInstructions.push(
|
|
173799
|
-
mouseBoxInstructions.push(
|
|
173916
|
+
mouseBoxInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.AcceptPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173917
|
+
mouseBoxInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createModifierKeyInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.shiftKey, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.OverlapSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173800
173918
|
if (SelectionMode.Replace === mode)
|
|
173801
|
-
mouseBoxInstructions.push(
|
|
173802
|
-
sections.push(
|
|
173919
|
+
mouseBoxInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createModifierKeyInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.ctrlKey, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.LeftClick, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.InvertSelection"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Mouse));
|
|
173920
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createSection(mouseBoxInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.inputsLabel));
|
|
173803
173921
|
const touchBoxInstructions = [];
|
|
173804
|
-
touchBoxInstructions.push(
|
|
173805
|
-
sections.push(
|
|
173922
|
+
touchBoxInstructions.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstruction(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceImage.OneTouchDrag, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate("ElementSet.Inputs.AcceptPoint"), false, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistanceInputMethod.Touch));
|
|
173923
|
+
sections.push(_ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createSection(touchBoxInstructions, _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.inputsLabel));
|
|
173806
173924
|
break;
|
|
173807
173925
|
}
|
|
173808
|
-
const instructions =
|
|
173809
|
-
|
|
173926
|
+
const instructions = _ToolAssistance__WEBPACK_IMPORTED_MODULE_8__.ToolAssistance.createInstructions(mainInstruction, sections);
|
|
173927
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.notifications.setToolAssistance(instructions);
|
|
173810
173928
|
}
|
|
173811
173929
|
initSelectTool() {
|
|
173812
173930
|
const method = this.selectionMethod;
|
|
@@ -173814,8 +173932,8 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173814
173932
|
const enableLocate = SelectionMethod.Pick === method;
|
|
173815
173933
|
this._isSelectByPoints = false;
|
|
173816
173934
|
this._points.length = 0;
|
|
173817
|
-
this.initLocateElements(enableLocate, false, enableLocate ? "default" :
|
|
173818
|
-
|
|
173935
|
+
this.initLocateElements(enableLocate, false, enableLocate ? "default" : _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.viewManager.crossHairCursor, _Tool__WEBPACK_IMPORTED_MODULE_6__.CoordinateLockOverrides.All);
|
|
173936
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.locateManager.options.allowDecorations = true; // Always locate to display tool tip even if we reject for adding to selection set...
|
|
173819
173937
|
this.showPrompt(mode, method);
|
|
173820
173938
|
}
|
|
173821
173939
|
processMiss(_ev) {
|
|
@@ -173860,13 +173978,13 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173860
173978
|
selectByPointsDecorate(context) {
|
|
173861
173979
|
if (!this._isSelectByPoints)
|
|
173862
173980
|
return;
|
|
173863
|
-
const ev = new
|
|
173864
|
-
|
|
173981
|
+
const ev = new _Tool__WEBPACK_IMPORTED_MODULE_6__.BeButtonEvent();
|
|
173982
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.fillEventFromCursorLocation(ev);
|
|
173865
173983
|
if (undefined === ev.viewport)
|
|
173866
173984
|
return;
|
|
173867
173985
|
const vp = context.viewport;
|
|
173868
|
-
const bestContrastIsBlack = (
|
|
173869
|
-
const crossingLine = (SelectionMethod.Line === this.selectionMethod || (SelectionMethod.Pick === this.selectionMethod &&
|
|
173986
|
+
const bestContrastIsBlack = (_itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.ColorDef.black === vp.getContrastToBackgroundColor());
|
|
173987
|
+
const crossingLine = (SelectionMethod.Line === this.selectionMethod || (SelectionMethod.Pick === this.selectionMethod && _Tool__WEBPACK_IMPORTED_MODULE_6__.BeButton.Reset === ev.button));
|
|
173870
173988
|
const overlapSelection = (crossingLine || this.useOverlapSelection(ev));
|
|
173871
173989
|
const position = vp.worldToView(this._points[0]);
|
|
173872
173990
|
position.x = Math.floor(position.x) + 0.5;
|
|
@@ -173894,111 +174012,42 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
173894
174012
|
};
|
|
173895
174013
|
context.addCanvasDecoration({ position, drawDecoration });
|
|
173896
174014
|
}
|
|
173897
|
-
selectByPointsProcess(origin, corner, ev, method, overlap) {
|
|
174015
|
+
async selectByPointsProcess(origin, corner, ev, method, overlap) {
|
|
173898
174016
|
const vp = ev.viewport;
|
|
173899
174017
|
if (!vp)
|
|
173900
|
-
return;
|
|
173901
|
-
const
|
|
173902
|
-
|
|
173903
|
-
|
|
173904
|
-
|
|
173905
|
-
|
|
173906
|
-
|
|
173907
|
-
const allowTransients = this.wantPickableDecorations();
|
|
173908
|
-
vp.readPixels(rect, _render_Pixel__WEBPACK_IMPORTED_MODULE_6__.Pixel.Selector.Feature, (pixels) => {
|
|
173909
|
-
if (undefined === pixels)
|
|
173910
|
-
return;
|
|
173911
|
-
const sRange = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Range2d.createNull();
|
|
173912
|
-
sRange.extendPoint(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.create(vp.cssPixelsToDevicePixels(range.low.x), vp.cssPixelsToDevicePixels(range.low.y)));
|
|
173913
|
-
sRange.extendPoint(_itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.create(vp.cssPixelsToDevicePixels(range.high.x), vp.cssPixelsToDevicePixels(range.high.y)));
|
|
173914
|
-
pts[0].x = vp.cssPixelsToDevicePixels(pts[0].x);
|
|
173915
|
-
pts[0].y = vp.cssPixelsToDevicePixels(pts[0].y);
|
|
173916
|
-
pts[1].x = vp.cssPixelsToDevicePixels(pts[1].x);
|
|
173917
|
-
pts[1].y = vp.cssPixelsToDevicePixels(pts[1].y);
|
|
173918
|
-
let contents = new Set();
|
|
173919
|
-
const testPoint = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.createZero();
|
|
173920
|
-
const getPixelElementId = (pixel) => {
|
|
173921
|
-
if (undefined === pixel.elementId || _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.isInvalid(pixel.elementId))
|
|
173922
|
-
return undefined; // no geometry at this location...
|
|
173923
|
-
if (!allowTransients && _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.isTransient(pixel.elementId))
|
|
173924
|
-
return undefined; // tool didn't request pickable decorations...
|
|
173925
|
-
if (!vp.isPixelSelectable(pixel))
|
|
173926
|
-
return undefined; // reality model, terrain, etc - not selectable
|
|
173927
|
-
return pixel.elementId;
|
|
173928
|
-
};
|
|
173929
|
-
if (SelectionMethod.Box === method) {
|
|
173930
|
-
const outline = overlap ? undefined : new Set();
|
|
173931
|
-
const offset = sRange.clone();
|
|
173932
|
-
offset.expandInPlace(-2);
|
|
173933
|
-
for (testPoint.x = sRange.low.x; testPoint.x <= sRange.high.x; ++testPoint.x) {
|
|
173934
|
-
for (testPoint.y = sRange.low.y; testPoint.y <= sRange.high.y; ++testPoint.y) {
|
|
173935
|
-
const pixel = pixels.getPixel(testPoint.x, testPoint.y);
|
|
173936
|
-
const elementId = getPixelElementId(pixel);
|
|
173937
|
-
if (undefined === elementId)
|
|
173938
|
-
continue;
|
|
173939
|
-
if (undefined !== outline && !offset.containsPoint(testPoint))
|
|
173940
|
-
outline.add(elementId.toString());
|
|
173941
|
-
else
|
|
173942
|
-
contents.add(elementId.toString());
|
|
173943
|
-
}
|
|
173944
|
-
}
|
|
173945
|
-
if (undefined !== outline && 0 !== outline.size) {
|
|
173946
|
-
const inside = new Set();
|
|
173947
|
-
contents.forEach((id) => {
|
|
173948
|
-
if (!outline.has(id))
|
|
173949
|
-
inside.add(id);
|
|
173950
|
-
});
|
|
173951
|
-
contents = inside;
|
|
173952
|
-
}
|
|
173953
|
-
}
|
|
173954
|
-
else {
|
|
173955
|
-
const closePoint = _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d.createZero();
|
|
173956
|
-
for (testPoint.x = sRange.low.x; testPoint.x <= sRange.high.x; ++testPoint.x) {
|
|
173957
|
-
for (testPoint.y = sRange.low.y; testPoint.y <= sRange.high.y; ++testPoint.y) {
|
|
173958
|
-
const pixel = pixels.getPixel(testPoint.x, testPoint.y);
|
|
173959
|
-
const elementId = getPixelElementId(pixel);
|
|
173960
|
-
if (undefined === elementId)
|
|
173961
|
-
continue;
|
|
173962
|
-
const fraction = testPoint.fractionOfProjectionToLine(pts[0], pts[1], 0.0);
|
|
173963
|
-
pts[0].interpolate(fraction, pts[1], closePoint);
|
|
173964
|
-
if (closePoint.distance(testPoint) < 1.5)
|
|
173965
|
-
contents.add(elementId.toString());
|
|
173966
|
-
}
|
|
173967
|
-
}
|
|
173968
|
-
}
|
|
173969
|
-
if (0 === contents.size) {
|
|
173970
|
-
if (!ev.isControlKey && this.wantSelectionClearOnMiss(ev) && this.processMiss(ev))
|
|
173971
|
-
this.syncSelectionMode();
|
|
173972
|
-
return;
|
|
173973
|
-
}
|
|
173974
|
-
switch (this.selectionMode) {
|
|
173975
|
-
case SelectionMode.Replace:
|
|
173976
|
-
if (!ev.isControlKey)
|
|
173977
|
-
this.processSelection(contents, SelectionProcessing.ReplaceSelectionWithElement); // eslint-disable-line @typescript-eslint/no-floating-promises
|
|
173978
|
-
else
|
|
173979
|
-
this.processSelection(contents, SelectionProcessing.InvertElementInSelection); // eslint-disable-line @typescript-eslint/no-floating-promises
|
|
173980
|
-
break;
|
|
173981
|
-
case SelectionMode.Add:
|
|
173982
|
-
this.processSelection(contents, SelectionProcessing.AddElementToSelection); // eslint-disable-line @typescript-eslint/no-floating-promises
|
|
173983
|
-
break;
|
|
173984
|
-
case SelectionMode.Remove:
|
|
173985
|
-
this.processSelection(contents, SelectionProcessing.RemoveElementFromSelection); // eslint-disable-line @typescript-eslint/no-floating-promises
|
|
173986
|
-
break;
|
|
174018
|
+
return false;
|
|
174019
|
+
const filter = (id) => { return !_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.isTransient(id); };
|
|
174020
|
+
const contents = await _ElementSetTool__WEBPACK_IMPORTED_MODULE_9__.ElementSetTool.getAreaOrVolumeSelectionCandidates(vp, origin, corner, method, overlap, this.wantPickableDecorations() ? undefined : filter, this.wantPickableDecorations());
|
|
174021
|
+
if (0 === contents.size) {
|
|
174022
|
+
if (!ev.isControlKey && this.wantSelectionClearOnMiss(ev) && this.processMiss(ev)) {
|
|
174023
|
+
this.syncSelectionMode();
|
|
174024
|
+
return true;
|
|
173987
174025
|
}
|
|
173988
|
-
|
|
174026
|
+
return false;
|
|
174027
|
+
}
|
|
174028
|
+
switch (this.selectionMode) {
|
|
174029
|
+
case SelectionMode.Replace:
|
|
174030
|
+
if (!ev.isControlKey)
|
|
174031
|
+
return this.processSelection(contents, SelectionProcessing.ReplaceSelectionWithElement);
|
|
174032
|
+
return this.processSelection(contents, SelectionProcessing.InvertElementInSelection);
|
|
174033
|
+
case SelectionMode.Add:
|
|
174034
|
+
return this.processSelection(contents, SelectionProcessing.AddElementToSelection);
|
|
174035
|
+
case SelectionMode.Remove:
|
|
174036
|
+
return this.processSelection(contents, SelectionProcessing.RemoveElementFromSelection);
|
|
174037
|
+
}
|
|
173989
174038
|
}
|
|
173990
174039
|
selectByPointsStart(ev) {
|
|
173991
|
-
if (
|
|
174040
|
+
if (_Tool__WEBPACK_IMPORTED_MODULE_6__.BeButton.Data !== ev.button && _Tool__WEBPACK_IMPORTED_MODULE_6__.BeButton.Reset !== ev.button)
|
|
173992
174041
|
return false;
|
|
173993
174042
|
this._points.length = 0;
|
|
173994
174043
|
this._points.push(ev.point.clone());
|
|
173995
174044
|
this._isSelectByPoints = true;
|
|
173996
|
-
|
|
173997
|
-
|
|
174045
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.accuSnap.enableLocate(false);
|
|
174046
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.setLocateCircleOn(false);
|
|
173998
174047
|
this.showPrompt(this.selectionMode, this.selectionMethod);
|
|
173999
174048
|
return true;
|
|
174000
174049
|
}
|
|
174001
|
-
selectByPointsEnd(ev) {
|
|
174050
|
+
async selectByPointsEnd(ev) {
|
|
174002
174051
|
if (!this._isSelectByPoints)
|
|
174003
174052
|
return false;
|
|
174004
174053
|
const vp = ev.viewport;
|
|
@@ -174008,10 +174057,10 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174008
174057
|
}
|
|
174009
174058
|
const origin = vp.worldToView(this._points[0]);
|
|
174010
174059
|
const corner = vp.worldToView(ev.point);
|
|
174011
|
-
if (SelectionMethod.Line === this.selectionMethod || (SelectionMethod.Pick === this.selectionMethod &&
|
|
174012
|
-
this.selectByPointsProcess(origin, corner, ev, SelectionMethod.Line, true);
|
|
174060
|
+
if (SelectionMethod.Line === this.selectionMethod || (SelectionMethod.Pick === this.selectionMethod && _Tool__WEBPACK_IMPORTED_MODULE_6__.BeButton.Reset === ev.button))
|
|
174061
|
+
await this.selectByPointsProcess(origin, corner, ev, SelectionMethod.Line, true);
|
|
174013
174062
|
else
|
|
174014
|
-
this.selectByPointsProcess(origin, corner, ev, SelectionMethod.Box, this.useOverlapSelection(ev));
|
|
174063
|
+
await this.selectByPointsProcess(origin, corner, ev, SelectionMethod.Box, this.useOverlapSelection(ev));
|
|
174015
174064
|
this.initSelectTool();
|
|
174016
174065
|
vp.invalidateDecorations();
|
|
174017
174066
|
return true;
|
|
@@ -174022,14 +174071,14 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174022
174071
|
}
|
|
174023
174072
|
async selectDecoration(ev, currHit) {
|
|
174024
174073
|
if (undefined === currHit)
|
|
174025
|
-
currHit = await
|
|
174074
|
+
currHit = await _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.locateManager.doLocate(new _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateResponse(), true, ev.point, ev.viewport, ev.inputSource);
|
|
174026
174075
|
if (undefined !== currHit)
|
|
174027
|
-
return (currHit.isElementHit ?
|
|
174028
|
-
return
|
|
174076
|
+
return (currHit.isElementHit ? _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.viewManager.overrideElementButtonEvent(currHit, ev) : _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.viewManager.onDecorationButtonEvent(currHit, ev));
|
|
174077
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No;
|
|
174029
174078
|
}
|
|
174030
174079
|
async processHit(ev, hit) {
|
|
174031
174080
|
if (hit.isModelHit || hit.isMapHit)
|
|
174032
|
-
return
|
|
174081
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No; // model hit = terrain, reality models, background maps, etc - not selectable
|
|
174033
174082
|
switch (this.selectionMode) {
|
|
174034
174083
|
case SelectionMode.Replace:
|
|
174035
174084
|
await this.processSelection(hit.sourceId, ev.isControlKey ? SelectionProcessing.InvertElementInSelection : SelectionProcessing.ReplaceSelectionWithElement);
|
|
@@ -174041,59 +174090,59 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174041
174090
|
await this.processSelection(hit.sourceId, SelectionProcessing.RemoveElementFromSelection);
|
|
174042
174091
|
break;
|
|
174043
174092
|
}
|
|
174044
|
-
return
|
|
174093
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174045
174094
|
}
|
|
174046
174095
|
async onMouseStartDrag(ev) {
|
|
174047
|
-
|
|
174048
|
-
if (
|
|
174049
|
-
return
|
|
174050
|
-
if (
|
|
174051
|
-
return
|
|
174052
|
-
return this.selectByPointsStart(ev) ?
|
|
174096
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.accuSnap.clear(); // Need to test hit at start drag location, not current AccuSnap...
|
|
174097
|
+
if (_Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes === await this.selectDecoration(ev))
|
|
174098
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174099
|
+
if (_Tool__WEBPACK_IMPORTED_MODULE_6__.InputSource.Touch === ev.inputSource && SelectionMethod.Pick === this.selectionMethod)
|
|
174100
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No; // Require method change for line/box selection...allow IdleTool to handle touch move...
|
|
174101
|
+
return this.selectByPointsStart(ev) ? _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes : _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No;
|
|
174053
174102
|
}
|
|
174054
174103
|
async onMouseEndDrag(ev) {
|
|
174055
|
-
return this.selectByPointsEnd(ev) ?
|
|
174104
|
+
return await this.selectByPointsEnd(ev) ? _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes : _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No;
|
|
174056
174105
|
}
|
|
174057
174106
|
async onDataButtonUp(ev) {
|
|
174058
174107
|
if (undefined === ev.viewport)
|
|
174059
|
-
return
|
|
174060
|
-
if (this.selectByPointsEnd(ev))
|
|
174061
|
-
return
|
|
174108
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No;
|
|
174109
|
+
if (await this.selectByPointsEnd(ev))
|
|
174110
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174062
174111
|
if (SelectionMethod.Pick !== this.selectionMethod) {
|
|
174063
174112
|
if (!ev.isControlKey && this.wantSelectionClearOnMiss(ev) && this.processMiss(ev))
|
|
174064
174113
|
this.syncSelectionMode();
|
|
174065
|
-
if (
|
|
174114
|
+
if (_Tool__WEBPACK_IMPORTED_MODULE_6__.InputSource.Touch !== ev.inputSource)
|
|
174066
174115
|
this.selectByPointsStart(ev); // Require touch move and not tap to start crossing line/box selection...
|
|
174067
|
-
return
|
|
174116
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174068
174117
|
}
|
|
174069
|
-
const hit = await
|
|
174118
|
+
const hit = await _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.locateManager.doLocate(new _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateResponse(), true, ev.point, ev.viewport, ev.inputSource);
|
|
174070
174119
|
if (hit !== undefined) {
|
|
174071
|
-
if (
|
|
174072
|
-
return
|
|
174073
|
-
if (
|
|
174074
|
-
return
|
|
174120
|
+
if (_Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes === await this.selectDecoration(ev, hit))
|
|
174121
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174122
|
+
if (_Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes === await this.processHit(ev, hit))
|
|
174123
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174075
174124
|
}
|
|
174076
174125
|
if (!ev.isControlKey && this.wantSelectionClearOnMiss(ev) && this.processMiss(ev))
|
|
174077
174126
|
this.syncSelectionMode();
|
|
174078
|
-
return
|
|
174127
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174079
174128
|
}
|
|
174080
174129
|
async onResetButtonUp(ev) {
|
|
174081
174130
|
if (this._isSelectByPoints) {
|
|
174082
174131
|
if (undefined !== ev.viewport)
|
|
174083
174132
|
ev.viewport.invalidateDecorations();
|
|
174084
174133
|
this.initSelectTool();
|
|
174085
|
-
return
|
|
174134
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174086
174135
|
}
|
|
174087
174136
|
// Check for overlapping hits...
|
|
174088
|
-
const lastHit = SelectionMode.Remove === this.selectionMode ? undefined :
|
|
174137
|
+
const lastHit = SelectionMode.Remove === this.selectionMode ? undefined : _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.locateManager.currHit;
|
|
174089
174138
|
if (lastHit && this.iModel.selectionSet.elements.has(lastHit.sourceId)) {
|
|
174090
|
-
const autoHit =
|
|
174139
|
+
const autoHit = _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.accuSnap.currHit;
|
|
174091
174140
|
// Play nice w/auto-locate, only remove previous hit if not currently auto-locating or over previous hit
|
|
174092
174141
|
if (undefined === autoHit || autoHit.isSameHit(lastHit)) {
|
|
174093
|
-
const response = new
|
|
174142
|
+
const response = new _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateResponse();
|
|
174094
174143
|
let nextHit;
|
|
174095
174144
|
do {
|
|
174096
|
-
nextHit = await
|
|
174145
|
+
nextHit = await _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.locateManager.doLocate(response, false, ev.point, ev.viewport, ev.inputSource);
|
|
174097
174146
|
} while (undefined !== nextHit && (nextHit.isModelHit || nextHit.isMapHit)); // Ignore reality models, terrain, maps, etc.
|
|
174098
174147
|
// remove element(s) previously selected if in replace mode, or if we have a next element in add mode
|
|
174099
174148
|
if (SelectionMode.Replace === this.selectionMode || undefined !== nextHit)
|
|
@@ -174101,69 +174150,69 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174101
174150
|
// add element(s) located via reset button
|
|
174102
174151
|
if (undefined !== nextHit)
|
|
174103
174152
|
await this.processSelection(nextHit.sourceId, SelectionProcessing.AddElementToSelection);
|
|
174104
|
-
return
|
|
174153
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174105
174154
|
}
|
|
174106
174155
|
}
|
|
174107
|
-
if (
|
|
174108
|
-
return
|
|
174109
|
-
await
|
|
174110
|
-
return
|
|
174156
|
+
if (_Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes === await this.selectDecoration(ev, _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.accuSnap.currHit))
|
|
174157
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174158
|
+
await _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.accuSnap.resetButton();
|
|
174159
|
+
return _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes;
|
|
174111
174160
|
}
|
|
174112
174161
|
async onSuspend() {
|
|
174113
174162
|
this._isSuspended = true;
|
|
174114
174163
|
if (this.wantEditManipulators())
|
|
174115
|
-
|
|
174164
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.manipulatorToolEvent.raiseEvent(this, _ToolAdmin__WEBPACK_IMPORTED_MODULE_7__.ManipulatorToolEvent.Suspend);
|
|
174116
174165
|
}
|
|
174117
174166
|
async onUnsuspend() {
|
|
174118
174167
|
this._isSuspended = false;
|
|
174119
174168
|
if (this.wantEditManipulators())
|
|
174120
|
-
|
|
174169
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.manipulatorToolEvent.raiseEvent(this, _ToolAdmin__WEBPACK_IMPORTED_MODULE_7__.ManipulatorToolEvent.Unsuspend);
|
|
174121
174170
|
this.showPrompt(this.selectionMode, this.selectionMethod);
|
|
174122
174171
|
}
|
|
174123
174172
|
async onTouchMoveStart(ev, startEv) {
|
|
174124
174173
|
if (startEv.isSingleTouch && !this._isSelectByPoints)
|
|
174125
|
-
await
|
|
174126
|
-
return (this._isSuspended || this._isSelectByPoints) ?
|
|
174174
|
+
await _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.convertTouchMoveStartToButtonDownAndMotion(startEv, ev);
|
|
174175
|
+
return (this._isSuspended || this._isSelectByPoints) ? _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes : _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No;
|
|
174127
174176
|
}
|
|
174128
174177
|
async onTouchMove(ev) {
|
|
174129
174178
|
if (this._isSelectByPoints)
|
|
174130
|
-
return
|
|
174179
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.convertTouchMoveToMotion(ev);
|
|
174131
174180
|
}
|
|
174132
174181
|
async onTouchComplete(ev) {
|
|
174133
174182
|
if (this._isSelectByPoints)
|
|
174134
|
-
return
|
|
174183
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.convertTouchEndToButtonUp(ev);
|
|
174135
174184
|
}
|
|
174136
174185
|
async onTouchCancel(ev) {
|
|
174137
174186
|
if (this._isSelectByPoints)
|
|
174138
|
-
return
|
|
174187
|
+
return _IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.convertTouchEndToButtonUp(ev, _Tool__WEBPACK_IMPORTED_MODULE_6__.BeButton.Reset);
|
|
174139
174188
|
}
|
|
174140
174189
|
decorate(context) { this.selectByPointsDecorate(context); }
|
|
174141
174190
|
async onModifierKeyTransition(_wentDown, modifier, _event) {
|
|
174142
|
-
return (modifier ===
|
|
174191
|
+
return (modifier === _Tool__WEBPACK_IMPORTED_MODULE_6__.BeModifierKeys.Shift && this._isSelectByPoints) ? _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.Yes : _Tool__WEBPACK_IMPORTED_MODULE_6__.EventHandled.No;
|
|
174143
174192
|
}
|
|
174144
174193
|
async filterHit(hit, out) {
|
|
174145
174194
|
if (!this.wantPickableDecorations() && !hit.isElementHit)
|
|
174146
|
-
return
|
|
174195
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateFilterStatus.Reject;
|
|
174147
174196
|
const mode = this.selectionMode;
|
|
174148
174197
|
if (SelectionMode.Replace === mode)
|
|
174149
|
-
return
|
|
174198
|
+
return _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateFilterStatus.Accept;
|
|
174150
174199
|
const isSelected = this.iModel.selectionSet.elements.has(hit.sourceId);
|
|
174151
|
-
const status = ((SelectionMode.Add === mode ? !isSelected : isSelected) ?
|
|
174152
|
-
if (out &&
|
|
174153
|
-
out.explanation =
|
|
174200
|
+
const status = ((SelectionMode.Add === mode ? !isSelected : isSelected) ? _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateFilterStatus.Accept : _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateFilterStatus.Reject);
|
|
174201
|
+
if (out && _ElementLocateManager__WEBPACK_IMPORTED_MODULE_3__.LocateFilterStatus.Reject === status)
|
|
174202
|
+
out.explanation = _Tool__WEBPACK_IMPORTED_MODULE_6__.CoreTools.translate(`ElementSet.Error.${isSelected ? "AlreadySelected" : "NotSelected"}`);
|
|
174154
174203
|
return status;
|
|
174155
174204
|
}
|
|
174156
174205
|
async onRestartTool() { return this.exitTool(); }
|
|
174157
174206
|
async onCleanup() {
|
|
174158
174207
|
if (this.wantEditManipulators())
|
|
174159
|
-
|
|
174208
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.manipulatorToolEvent.raiseEvent(this, _ToolAdmin__WEBPACK_IMPORTED_MODULE_7__.ManipulatorToolEvent.Stop);
|
|
174160
174209
|
}
|
|
174161
174210
|
async onPostInstall() {
|
|
174162
174211
|
await super.onPostInstall();
|
|
174163
174212
|
if (!this.targetView)
|
|
174164
174213
|
return;
|
|
174165
174214
|
if (this.wantEditManipulators())
|
|
174166
|
-
|
|
174215
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.manipulatorToolEvent.raiseEvent(this, _ToolAdmin__WEBPACK_IMPORTED_MODULE_7__.ManipulatorToolEvent.Start);
|
|
174167
174216
|
this.initSelectTool();
|
|
174168
174217
|
}
|
|
174169
174218
|
static async startTool() { return new SelectionTool().run(); }
|
|
@@ -174175,7 +174224,7 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174175
174224
|
}
|
|
174176
174225
|
if (this.wantToolSettings()) {
|
|
174177
174226
|
const syncMode = { value: this._selectionModeValue, propertyName: SelectionTool._modesName };
|
|
174178
|
-
|
|
174227
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.toolSettingsState.saveToolSettingProperty(this.toolId, syncMode);
|
|
174179
174228
|
this.syncToolSettingsProperties([syncMode]);
|
|
174180
174229
|
}
|
|
174181
174230
|
}
|
|
@@ -174186,14 +174235,14 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174186
174235
|
if (!this.wantToolSettings())
|
|
174187
174236
|
return undefined;
|
|
174188
174237
|
// load latest values from session
|
|
174189
|
-
|
|
174238
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.toolSettingsState.getInitialToolSettingValues(this.toolId, [SelectionTool._modesName])?.forEach((value) => {
|
|
174190
174239
|
if (value.propertyName === SelectionTool._modesName)
|
|
174191
174240
|
this._selectionModeValue = value.value;
|
|
174192
174241
|
});
|
|
174193
174242
|
// Make sure a mode of SelectionMode.Remove is valid
|
|
174194
174243
|
if (SelectionMode.Remove === this.selectionMode && !this.iModel.selectionSet.isActive) {
|
|
174195
174244
|
this.selectionMode = SelectionMode.Replace;
|
|
174196
|
-
|
|
174245
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.toolSettingsState.saveToolSettingProperty(this.toolId, { propertyName: SelectionTool._modesName, value: this._selectionModeValue });
|
|
174197
174246
|
}
|
|
174198
174247
|
const toolSettings = new Array();
|
|
174199
174248
|
// generate 3 columns - label will be placed in column 0 and button group editors in columns 1 and 2.
|
|
@@ -174212,7 +174261,7 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174212
174261
|
if (this._selectionMethodValue) {
|
|
174213
174262
|
const currWantManipulators = this.wantEditManipulators();
|
|
174214
174263
|
if (saveWantManipulators !== currWantManipulators)
|
|
174215
|
-
|
|
174264
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.manipulatorToolEvent.raiseEvent(this, currWantManipulators ? _ToolAdmin__WEBPACK_IMPORTED_MODULE_7__.ManipulatorToolEvent.Start : _ToolAdmin__WEBPACK_IMPORTED_MODULE_7__.ManipulatorToolEvent.Stop);
|
|
174216
174265
|
changed = true;
|
|
174217
174266
|
}
|
|
174218
174267
|
}
|
|
@@ -174220,7 +174269,7 @@ class SelectionTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_8__.Primitiv
|
|
|
174220
174269
|
this._selectionModeValue = updatedValue.value;
|
|
174221
174270
|
if (this._selectionModeValue) {
|
|
174222
174271
|
if (this.wantToolSettings())
|
|
174223
|
-
|
|
174272
|
+
_IModelApp__WEBPACK_IMPORTED_MODULE_4__.IModelApp.toolAdmin.toolSettingsState.saveToolSettingProperty(this.toolId, { propertyName: SelectionTool._modesName, value: this._selectionModeValue });
|
|
174224
174273
|
changed = true;
|
|
174225
174274
|
}
|
|
174226
174275
|
}
|
|
@@ -177363,6 +177412,11 @@ class ToolSettings {
|
|
|
177363
177412
|
};
|
|
177364
177413
|
/** Maximum number of times in a second the accuSnap tool's onMotion function is called. */
|
|
177365
177414
|
static maxOnMotionSnapCallPerSecond = 15;
|
|
177415
|
+
/** If true, drag box selection will accept spatial elements that are inside or overlap a clip volume instead of only what is visible in the view.
|
|
177416
|
+
* @note Enabling is not recommended for web applications.
|
|
177417
|
+
* @beta
|
|
177418
|
+
*/
|
|
177419
|
+
static enableVolumeSelection = false;
|
|
177366
177420
|
}
|
|
177367
177421
|
|
|
177368
177422
|
|
|
@@ -185224,7 +185278,8 @@ class BSpline2dNd extends _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geom
|
|
|
185224
185278
|
knots;
|
|
185225
185279
|
/** flat array of coordinate data, blocked by poleDimension and row */
|
|
185226
185280
|
coffs;
|
|
185227
|
-
/**
|
|
185281
|
+
/**
|
|
185282
|
+
* Number of components per pole.
|
|
185228
185283
|
* * 3 for conventional xyz surface
|
|
185229
185284
|
* * 4 for weighted (wx, wy, wz, w) surface.
|
|
185230
185285
|
*/
|
|
@@ -191004,11 +191059,13 @@ class ClipUtilities {
|
|
|
191004
191059
|
clippedLocalRegion.tryTransformInPlace(localToWorld);
|
|
191005
191060
|
if (!result)
|
|
191006
191061
|
result = (clippedLocalRegion instanceof _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_8__.UnionRegion) ? clippedLocalRegion : _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_8__.UnionRegion.create(clippedLocalRegion);
|
|
191007
|
-
|
|
191008
|
-
result.children.push(...clippedLocalRegion.children);
|
|
191062
|
+
if (clippedLocalRegion instanceof _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_8__.UnionRegion)
|
|
191063
|
+
result.children.push(...clippedLocalRegion.children); // avoid nested UnionRegions
|
|
191064
|
+
else
|
|
191065
|
+
result.tryAddChild(clippedLocalRegion);
|
|
191009
191066
|
}
|
|
191010
191067
|
}
|
|
191011
|
-
return result;
|
|
191068
|
+
return result ? _curve_RegionOps__WEBPACK_IMPORTED_MODULE_7__.RegionOps.simplifyRegionType(result) : undefined;
|
|
191012
191069
|
}
|
|
191013
191070
|
/**
|
|
191014
191071
|
* Compute and return portions of the input curve or region that are within the clipper.
|
|
@@ -204396,9 +204453,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
204396
204453
|
/* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
|
|
204397
204454
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
204398
204455
|
/* harmony import */ var _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry4d/MomentData */ "../../core/geometry/lib/esm/geometry4d/MomentData.js");
|
|
204399
|
-
/* harmony import */ var
|
|
204400
|
-
/* harmony import */ var
|
|
204401
|
-
/* harmony import */ var
|
|
204456
|
+
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
204457
|
+
/* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
204458
|
+
/* harmony import */ var _RegionOps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
|
|
204459
|
+
/* harmony import */ var _StrokeOptions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
|
|
204402
204460
|
/*---------------------------------------------------------------------------------------------
|
|
204403
204461
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
204404
204462
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -204410,6 +204468,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
204410
204468
|
|
|
204411
204469
|
|
|
204412
204470
|
|
|
204471
|
+
|
|
204413
204472
|
/**
|
|
204414
204473
|
* Implementation class for computing XY area moments.
|
|
204415
204474
|
* @internal
|
|
@@ -204418,15 +204477,15 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204418
204477
|
_activeMomentData;
|
|
204419
204478
|
_point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
204420
204479
|
_point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
204421
|
-
/**
|
|
204422
|
-
*
|
|
204423
|
-
* *
|
|
204480
|
+
/**
|
|
204481
|
+
* Accumulate (independent) integrations over:
|
|
204482
|
+
* * The area between the arc and the chord connecting its endpoints.
|
|
204483
|
+
* * The triangle with vertices: origin, arc start, arc end.
|
|
204424
204484
|
*/
|
|
204425
204485
|
handleArc3d(arc) {
|
|
204426
204486
|
const momentData = this._activeMomentData;
|
|
204427
204487
|
const sweepRadians = arc.sweep.sweepRadians;
|
|
204428
204488
|
const alphaRadians = sweepRadians * 0.5;
|
|
204429
|
-
// from https://apps.dtic.mil/dtic/tr/fulltext/u2/274936.pdf page 71 for radius = 1
|
|
204430
204489
|
let s = Math.sin(alphaRadians);
|
|
204431
204490
|
let c = Math.cos(alphaRadians);
|
|
204432
204491
|
let s1 = Math.sin(sweepRadians);
|
|
@@ -204453,12 +204512,12 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204453
204512
|
const pointC = arc.fractionToPoint(1.0);
|
|
204454
204513
|
momentData.accumulateTriangleMomentsXY(undefined, pointB, pointC);
|
|
204455
204514
|
}
|
|
204456
|
-
/** Accumulate integrals over the (triangular) areas from the origin to each line segment */
|
|
204515
|
+
/** Accumulate integrals over the (triangular) areas from the origin to each line segment. */
|
|
204457
204516
|
handleLineString3d(ls) {
|
|
204458
204517
|
const momentData = this._activeMomentData;
|
|
204459
204518
|
momentData.accumulateTriangleToLineStringMomentsXY(undefined, ls.packedPoints);
|
|
204460
204519
|
}
|
|
204461
|
-
/** Accumulate integrals over the (triangular) area from the origin to this line segment */
|
|
204520
|
+
/** Accumulate integrals over the (triangular) area from the origin to this line segment. */
|
|
204462
204521
|
handleLineSegment3d(segment) {
|
|
204463
204522
|
const momentData = this._activeMomentData;
|
|
204464
204523
|
segment.startPoint(this._point0);
|
|
@@ -204474,50 +204533,15 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204474
204533
|
this._activeMomentData = undefined;
|
|
204475
204534
|
return momentData;
|
|
204476
204535
|
}
|
|
204477
|
-
|
|
204478
|
-
|
|
204479
|
-
|
|
204480
|
-
|
|
204481
|
-
|
|
204482
|
-
|
|
204483
|
-
|
|
204484
|
-
* @param region
|
|
204485
|
-
*/
|
|
204486
|
-
handleParityRegion(region) {
|
|
204487
|
-
const allChildMoments = [];
|
|
204488
|
-
let maxAbsArea = 0.0;
|
|
204489
|
-
let largestChildMoments;
|
|
204490
|
-
for (const child of region.children) {
|
|
204491
|
-
if (child instanceof _Loop__WEBPACK_IMPORTED_MODULE_4__.Loop) {
|
|
204492
|
-
const childMoments = this.handleLoop(child);
|
|
204493
|
-
if (childMoments) {
|
|
204494
|
-
allChildMoments.push(childMoments);
|
|
204495
|
-
const q = Math.abs(childMoments.quantitySum);
|
|
204496
|
-
if (q > maxAbsArea) {
|
|
204497
|
-
maxAbsArea = q;
|
|
204498
|
-
largestChildMoments = childMoments;
|
|
204499
|
-
}
|
|
204500
|
-
}
|
|
204501
|
-
}
|
|
204502
|
-
}
|
|
204503
|
-
if (largestChildMoments) {
|
|
204504
|
-
const summedMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__.MomentData.create();
|
|
204505
|
-
const sign0 = largestChildMoments.signFactor(1.0);
|
|
204506
|
-
summedMoments.accumulateProducts(largestChildMoments, sign0);
|
|
204507
|
-
for (const childMoments of allChildMoments) {
|
|
204508
|
-
if (childMoments !== largestChildMoments) {
|
|
204509
|
-
const sign1 = childMoments.signFactor(-1.0);
|
|
204510
|
-
summedMoments.accumulateProducts(childMoments, sign1);
|
|
204511
|
-
}
|
|
204512
|
-
}
|
|
204513
|
-
return summedMoments;
|
|
204514
|
-
}
|
|
204515
|
-
return undefined;
|
|
204516
|
-
}
|
|
204517
|
-
/** Accumulate (as simple addition) products over each component of the union region. */
|
|
204518
|
-
handleUnionRegion(region) {
|
|
204536
|
+
handleAnyRegion(region) {
|
|
204537
|
+
// guarantee there is no overlapping children
|
|
204538
|
+
const merged = _RegionOps__WEBPACK_IMPORTED_MODULE_4__.RegionOps.regionBooleanXY(region, undefined, _RegionOps__WEBPACK_IMPORTED_MODULE_4__.RegionBinaryOpType.Union);
|
|
204539
|
+
if (!merged)
|
|
204540
|
+
return undefined;
|
|
204541
|
+
if (merged instanceof _Loop__WEBPACK_IMPORTED_MODULE_5__.Loop)
|
|
204542
|
+
return this.handleLoop(merged);
|
|
204519
204543
|
const summedMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__.MomentData.create();
|
|
204520
|
-
for (const child of
|
|
204544
|
+
for (const child of merged.children) {
|
|
204521
204545
|
const childMoments = child.dispatchToGeometryHandler(this);
|
|
204522
204546
|
if (childMoments) {
|
|
204523
204547
|
const sign0 = childMoments.signFactor(1.0);
|
|
@@ -204526,32 +204550,46 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204526
204550
|
}
|
|
204527
204551
|
return summedMoments;
|
|
204528
204552
|
}
|
|
204553
|
+
/** Accumulate integrals from origin to the components of the parity region. */
|
|
204554
|
+
handleParityRegion(region) {
|
|
204555
|
+
return this.handleAnyRegion(region);
|
|
204556
|
+
}
|
|
204557
|
+
/** Accumulate integrals from origin to the components of the union region. */
|
|
204558
|
+
handleUnionRegion(region) {
|
|
204559
|
+
return this.handleAnyRegion(region);
|
|
204560
|
+
}
|
|
204529
204561
|
_strokeOptions;
|
|
204530
204562
|
getStrokeOptions() {
|
|
204531
204563
|
if (this._strokeOptions)
|
|
204532
204564
|
return this._strokeOptions;
|
|
204533
|
-
const options =
|
|
204565
|
+
const options = _StrokeOptions__WEBPACK_IMPORTED_MODULE_6__.StrokeOptions.createForCurves();
|
|
204534
204566
|
// this is unusually fine for stroking, but appropriate for sum.
|
|
204535
204567
|
options.angleTol = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(5.0);
|
|
204536
204568
|
this._strokeOptions = options;
|
|
204537
204569
|
return options;
|
|
204538
204570
|
}
|
|
204539
|
-
/**
|
|
204540
|
-
*
|
|
204541
|
-
* * accumulate stroke array.
|
|
204571
|
+
/**
|
|
204572
|
+
* Handle a single curve primitive (not loop).
|
|
204573
|
+
* * Stroke the curve and accumulate stroke array.
|
|
204542
204574
|
*/
|
|
204543
204575
|
handleCurvePrimitive(cp) {
|
|
204544
|
-
const strokes =
|
|
204576
|
+
const strokes = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
204545
204577
|
const options = this.getStrokeOptions();
|
|
204546
204578
|
cp.emitStrokes(strokes, options);
|
|
204547
204579
|
this.handleLineString3d(strokes);
|
|
204548
204580
|
}
|
|
204549
|
-
/**
|
|
204550
|
-
handleBSplineCurve3d(g) {
|
|
204551
|
-
|
|
204552
|
-
|
|
204553
|
-
/**
|
|
204554
|
-
|
|
204581
|
+
/** Handle strongly typed BSplineCurve3d as generic curve primitive. */
|
|
204582
|
+
handleBSplineCurve3d(g) {
|
|
204583
|
+
this.handleCurvePrimitive(g);
|
|
204584
|
+
}
|
|
204585
|
+
/** Handle strongly typed BSplineCurve3dH as generic curve primitive. */
|
|
204586
|
+
handleBSplineCurve3dH(g) {
|
|
204587
|
+
this.handleCurvePrimitive(g);
|
|
204588
|
+
}
|
|
204589
|
+
/** Handle strongly typed TransitionSpiral as generic curve primitive. */
|
|
204590
|
+
handleTransitionSpiral(g) {
|
|
204591
|
+
this.handleCurvePrimitive(g);
|
|
204592
|
+
}
|
|
204555
204593
|
}
|
|
204556
204594
|
|
|
204557
204595
|
|
|
@@ -204571,41 +204609,44 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
204571
204609
|
/* harmony export */ RegionOps: () => (/* binding */ RegionOps)
|
|
204572
204610
|
/* harmony export */ });
|
|
204573
204611
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
204574
|
-
/* harmony import */ var
|
|
204575
|
-
/* harmony import */ var
|
|
204576
|
-
/* harmony import */ var
|
|
204577
|
-
/* harmony import */ var
|
|
204578
|
-
/* harmony import */ var
|
|
204579
|
-
/* harmony import */ var
|
|
204580
|
-
/* harmony import */ var
|
|
204581
|
-
/* harmony import */ var
|
|
204582
|
-
/* harmony import */ var
|
|
204612
|
+
/* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
|
|
204613
|
+
/* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
|
|
204614
|
+
/* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
|
|
204615
|
+
/* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
|
|
204616
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
204617
|
+
/* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
|
|
204618
|
+
/* harmony import */ var _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/PolylineCompressionByEdgeOffset */ "../../core/geometry/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js");
|
|
204619
|
+
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
204620
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
204621
|
+
/* harmony import */ var _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../geometry3d/SortablePolygon */ "../../core/geometry/lib/esm/geometry3d/SortablePolygon.js");
|
|
204622
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
204583
204623
|
/* harmony import */ var _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry4d/MomentData */ "../../core/geometry/lib/esm/geometry4d/MomentData.js");
|
|
204584
|
-
/* harmony import */ var
|
|
204585
|
-
/* harmony import */ var
|
|
204586
|
-
/* harmony import */ var
|
|
204587
|
-
/* harmony import */ var
|
|
204588
|
-
/* harmony import */ var
|
|
204589
|
-
/* harmony import */ var
|
|
204590
|
-
/* harmony import */ var
|
|
204591
|
-
/* harmony import */ var
|
|
204592
|
-
/* harmony import */ var
|
|
204624
|
+
/* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
|
|
204625
|
+
/* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
|
|
204626
|
+
/* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
|
|
204627
|
+
/* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
|
|
204628
|
+
/* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
|
|
204629
|
+
/* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
204630
|
+
/* harmony import */ var _CurveCurve__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./CurveCurve */ "../../core/geometry/lib/esm/curve/CurveCurve.js");
|
|
204631
|
+
/* harmony import */ var _CurveOps__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
|
|
204632
|
+
/* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
|
|
204593
204633
|
/* harmony import */ var _CurveWireMomentsXYZ__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CurveWireMomentsXYZ */ "../../core/geometry/lib/esm/curve/CurveWireMomentsXYZ.js");
|
|
204594
|
-
/* harmony import */ var
|
|
204595
|
-
/* harmony import */ var
|
|
204596
|
-
/* harmony import */ var
|
|
204597
|
-
/* harmony import */ var
|
|
204598
|
-
/* harmony import */ var
|
|
204599
|
-
/* harmony import */ var
|
|
204600
|
-
/* harmony import */ var
|
|
204601
|
-
/* harmony import */ var
|
|
204602
|
-
/* harmony import */ var
|
|
204603
|
-
/* harmony import */ var
|
|
204604
|
-
/* harmony import */ var
|
|
204605
|
-
/* harmony import */ var
|
|
204634
|
+
/* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
204635
|
+
/* harmony import */ var _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./internalContexts/ChainCollectorContext */ "../../core/geometry/lib/esm/curve/internalContexts/ChainCollectorContext.js");
|
|
204636
|
+
/* harmony import */ var _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./internalContexts/PolygonOffsetContext */ "../../core/geometry/lib/esm/curve/internalContexts/PolygonOffsetContext.js");
|
|
204637
|
+
/* harmony import */ var _internalContexts_TransferWithSplitArcs__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./internalContexts/TransferWithSplitArcs */ "../../core/geometry/lib/esm/curve/internalContexts/TransferWithSplitArcs.js");
|
|
204638
|
+
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
204639
|
+
/* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
204640
|
+
/* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
|
|
204641
|
+
/* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
|
|
204642
|
+
/* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
|
|
204643
|
+
/* harmony import */ var _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./Query/ConsolidateAdjacentPrimitivesContext */ "../../core/geometry/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js");
|
|
204644
|
+
/* harmony import */ var _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./Query/CurveSplitContext */ "../../core/geometry/lib/esm/curve/Query/CurveSplitContext.js");
|
|
204645
|
+
/* harmony import */ var _Query_InOutTests__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Query/InOutTests */ "../../core/geometry/lib/esm/curve/Query/InOutTests.js");
|
|
204646
|
+
/* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
|
|
204606
204647
|
/* harmony import */ var _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RegionMomentsXY */ "../../core/geometry/lib/esm/curve/RegionMomentsXY.js");
|
|
204607
|
-
/* harmony import */ var
|
|
204608
|
-
/* harmony import */ var
|
|
204648
|
+
/* harmony import */ var _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./RegionOpsClassificationSweeps */ "../../core/geometry/lib/esm/curve/RegionOpsClassificationSweeps.js");
|
|
204649
|
+
/* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
|
|
204609
204650
|
/*---------------------------------------------------------------------------------------------
|
|
204610
204651
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
204611
204652
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -204645,6 +204686,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
204645
204686
|
|
|
204646
204687
|
|
|
204647
204688
|
|
|
204689
|
+
|
|
204690
|
+
|
|
204691
|
+
|
|
204648
204692
|
|
|
204649
204693
|
|
|
204650
204694
|
|
|
@@ -204676,13 +204720,16 @@ var RegionBinaryOpType;
|
|
|
204676
204720
|
class RegionOps {
|
|
204677
204721
|
/**
|
|
204678
204722
|
* Return moment sums for a loop, parity region, or union region.
|
|
204723
|
+
* * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
204679
204724
|
* * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
|
|
204680
|
-
*
|
|
204681
|
-
*
|
|
204725
|
+
* call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes(rawMomentData.origin, rawMomentData.sums);`
|
|
204726
|
+
* * `rawMomentData.origin` is the centroid of `region`.
|
|
204727
|
+
* * `rawMomentData.sums.weight()` is the signed area of `region`.
|
|
204728
|
+
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
204682
204729
|
*/
|
|
204683
|
-
static computeXYAreaMoments(
|
|
204730
|
+
static computeXYAreaMoments(region) {
|
|
204684
204731
|
const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__.RegionMomentsXY();
|
|
204685
|
-
const result =
|
|
204732
|
+
const result = region.dispatchToGeometryHandler(handler);
|
|
204686
204733
|
if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__.MomentData) {
|
|
204687
204734
|
result.shiftOriginAndSumsToCentroidOfSums();
|
|
204688
204735
|
return result;
|
|
@@ -204691,8 +204738,8 @@ class RegionOps {
|
|
|
204691
204738
|
}
|
|
204692
204739
|
/**
|
|
204693
204740
|
* Return an area tolerance for a given xy-range and optional distance tolerance.
|
|
204694
|
-
* @param range range of planar region to tolerance
|
|
204695
|
-
* @param distanceTolerance optional absolute distance tolerance
|
|
204741
|
+
* @param range range of planar region to tolerance.
|
|
204742
|
+
* @param distanceTolerance optional absolute distance tolerance.
|
|
204696
204743
|
*/
|
|
204697
204744
|
static computeXYAreaTolerance(range, distanceTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
|
|
204698
204745
|
// if A = bh and e is distance tolerance, then A' := (b+e/2)(h+e/2) = A + e/2(b+h+e/2), so A'-A = e/2(b+h+e/2).
|
|
@@ -204701,19 +204748,13 @@ class RegionOps {
|
|
|
204701
204748
|
}
|
|
204702
204749
|
/**
|
|
204703
204750
|
* Return a (signed) xy area for a region.
|
|
204704
|
-
<<<<<<< HEAD
|
|
204705
|
-
* * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
|
|
204706
|
-
* @param root any Loop, ParityRegion, or UnionRegion.
|
|
204707
|
-
=======
|
|
204708
204751
|
* * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
204709
|
-
* *
|
|
204710
|
-
* with respect to the positive z-axis.
|
|
204752
|
+
* * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
|
|
204711
204753
|
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
204712
|
-
>>>>>>> 168574b454 (Utilize `PolyfaceData.edgeMateIndex` to speed up some `Polyface` methods (#8095))
|
|
204713
204754
|
*/
|
|
204714
|
-
static computeXYArea(
|
|
204755
|
+
static computeXYArea(region) {
|
|
204715
204756
|
const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__.RegionMomentsXY();
|
|
204716
|
-
const result =
|
|
204757
|
+
const result = region.dispatchToGeometryHandler(handler);
|
|
204717
204758
|
if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__.MomentData) {
|
|
204718
204759
|
return result.quantitySum;
|
|
204719
204760
|
}
|
|
@@ -204721,49 +204762,88 @@ class RegionOps {
|
|
|
204721
204762
|
}
|
|
204722
204763
|
/**
|
|
204723
204764
|
* Return MomentData with the sums of wire moments.
|
|
204765
|
+
* * The input curve should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
204724
204766
|
* * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
|
|
204725
|
-
*
|
|
204726
|
-
*
|
|
204767
|
+
* call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
|
|
204768
|
+
* * `rawMomentData.origin` is the wire centroid of `curve`.
|
|
204769
|
+
* * `rawMomentData.sums.weight()` is the signed length of `curve`.
|
|
204770
|
+
* @param curve any [[CurveCollection]] or [[CurvePrimitive]].
|
|
204727
204771
|
*/
|
|
204728
|
-
static computeXYZWireMomentSums(
|
|
204772
|
+
static computeXYZWireMomentSums(curve) {
|
|
204729
204773
|
const handler = new _CurveWireMomentsXYZ__WEBPACK_IMPORTED_MODULE_3__.CurveWireMomentsXYZ();
|
|
204730
|
-
handler.visitLeaves(
|
|
204774
|
+
handler.visitLeaves(curve);
|
|
204731
204775
|
const result = handler.momentData;
|
|
204732
204776
|
result.shiftOriginAndSumsToCentroidOfSums();
|
|
204733
204777
|
return result;
|
|
204734
204778
|
}
|
|
204779
|
+
/**
|
|
204780
|
+
* Return a [[Ray3d]] with:
|
|
204781
|
+
* * `origin` is the centroid of the region,
|
|
204782
|
+
* * `direction` is a unit vector perpendicular to the region plane,
|
|
204783
|
+
* * `a` is the region area.
|
|
204784
|
+
* @param region the region to process. Can lie in any plane.
|
|
204785
|
+
* @param result optional pre-allocated result to populate and return.
|
|
204786
|
+
*/
|
|
204787
|
+
static centroidAreaNormal(region, result) {
|
|
204788
|
+
const localToWorld = _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_4__.FrameBuilder.createRightHandedFrame(undefined, region);
|
|
204789
|
+
if (!localToWorld)
|
|
204790
|
+
return undefined;
|
|
204791
|
+
const normal = localToWorld.matrix.columnZ(result?.direction);
|
|
204792
|
+
const regionIsXY = normal.isParallelTo(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Vector3d.unitZ(), true);
|
|
204793
|
+
let regionXY = region;
|
|
204794
|
+
if (!regionIsXY) { // rotate the region to be parallel to the xy-plane
|
|
204795
|
+
regionXY = region.cloneTransformed(localToWorld.inverse());
|
|
204796
|
+
if (!regionXY)
|
|
204797
|
+
return undefined;
|
|
204798
|
+
}
|
|
204799
|
+
const momentData = RegionOps.computeXYAreaMoments(regionXY);
|
|
204800
|
+
if (!momentData)
|
|
204801
|
+
return undefined;
|
|
204802
|
+
const centroid = momentData.origin.clone(result?.origin);
|
|
204803
|
+
if (!regionIsXY) // rotate centroid back (area is unchanged)
|
|
204804
|
+
localToWorld.multiplyPoint3d(centroid, centroid);
|
|
204805
|
+
let area = momentData.sums.weight();
|
|
204806
|
+
if (area < 0.0) {
|
|
204807
|
+
area = -area;
|
|
204808
|
+
normal.scale(-1.0, normal);
|
|
204809
|
+
}
|
|
204810
|
+
if (!result)
|
|
204811
|
+
result = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__.Ray3d.createCapture(centroid, normal);
|
|
204812
|
+
result.a = area;
|
|
204813
|
+
return result;
|
|
204814
|
+
}
|
|
204735
204815
|
/**
|
|
204736
204816
|
* Create loops in the graph.
|
|
204737
204817
|
* @internal
|
|
204738
204818
|
*/
|
|
204739
204819
|
static addLoopsToGraph(graph, data, announceIsolatedLoop) {
|
|
204740
|
-
if (data instanceof
|
|
204820
|
+
if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop) {
|
|
204741
204821
|
const points = data.getPackedStrokes();
|
|
204742
204822
|
if (points)
|
|
204743
204823
|
this.addLoopsToGraph(graph, points, announceIsolatedLoop);
|
|
204744
204824
|
}
|
|
204745
|
-
else if (data instanceof
|
|
204825
|
+
else if (data instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
|
|
204746
204826
|
for (const child of data.children) {
|
|
204747
204827
|
const points = child.getPackedStrokes();
|
|
204748
204828
|
if (points)
|
|
204749
204829
|
this.addLoopsToGraph(graph, points, announceIsolatedLoop);
|
|
204750
204830
|
}
|
|
204751
204831
|
}
|
|
204752
|
-
else if (data instanceof
|
|
204753
|
-
const loopSeed =
|
|
204832
|
+
else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
|
|
204833
|
+
const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
|
|
204754
204834
|
if (loopSeed !== undefined)
|
|
204755
204835
|
announceIsolatedLoop(graph, loopSeed);
|
|
204756
204836
|
}
|
|
204757
204837
|
else if (Array.isArray(data)) {
|
|
204758
204838
|
if (data.length > 0) {
|
|
204759
|
-
if (
|
|
204760
|
-
const loopSeed =
|
|
204839
|
+
if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.isAnyImmediatePointType(data[0])) {
|
|
204840
|
+
const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
|
|
204761
204841
|
if (loopSeed !== undefined)
|
|
204762
204842
|
announceIsolatedLoop(graph, loopSeed);
|
|
204763
204843
|
}
|
|
204764
|
-
else if (data[0] instanceof
|
|
204844
|
+
else if (data[0] instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
|
|
204765
204845
|
for (const loop of data) {
|
|
204766
|
-
const loopSeed =
|
|
204846
|
+
const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, loop);
|
|
204767
204847
|
if (loopSeed !== undefined)
|
|
204768
204848
|
announceIsolatedLoop(graph, loopSeed);
|
|
204769
204849
|
}
|
|
@@ -204803,10 +204883,10 @@ class RegionOps {
|
|
|
204803
204883
|
static finishGraphToPolyface(graph, triangulate) {
|
|
204804
204884
|
if (graph) {
|
|
204805
204885
|
if (triangulate) {
|
|
204806
|
-
|
|
204807
|
-
|
|
204886
|
+
_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.triangulateAllPositiveAreaFaces(graph);
|
|
204887
|
+
_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
|
|
204808
204888
|
}
|
|
204809
|
-
return
|
|
204889
|
+
return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__.PolyfaceBuilder.graphToPolyface(graph);
|
|
204810
204890
|
}
|
|
204811
204891
|
return undefined;
|
|
204812
204892
|
}
|
|
@@ -204820,7 +204900,7 @@ class RegionOps {
|
|
|
204820
204900
|
* @param triangulate whether to triangulate the result
|
|
204821
204901
|
*/
|
|
204822
204902
|
static polygonXYAreaIntersectLoopsToPolyface(loopsA, loopsB, triangulate = false) {
|
|
204823
|
-
const graph =
|
|
204903
|
+
const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && inB), this._graphCheckPointFunction);
|
|
204824
204904
|
return this.finishGraphToPolyface(graph, triangulate);
|
|
204825
204905
|
}
|
|
204826
204906
|
/**
|
|
@@ -204833,7 +204913,7 @@ class RegionOps {
|
|
|
204833
204913
|
* @param triangulate whether to triangulate the result
|
|
204834
204914
|
*/
|
|
204835
204915
|
static polygonXYAreaUnionLoopsToPolyface(loopsA, loopsB, triangulate = false) {
|
|
204836
|
-
const graph =
|
|
204916
|
+
const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA || inB), this._graphCheckPointFunction);
|
|
204837
204917
|
return this.finishGraphToPolyface(graph, triangulate);
|
|
204838
204918
|
}
|
|
204839
204919
|
/**
|
|
@@ -204846,9 +204926,31 @@ class RegionOps {
|
|
|
204846
204926
|
* @param triangulate whether to triangulate the result
|
|
204847
204927
|
*/
|
|
204848
204928
|
static polygonXYAreaDifferenceLoopsToPolyface(loopsA, loopsB, triangulate = false) {
|
|
204849
|
-
const graph =
|
|
204929
|
+
const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && !inB), this._graphCheckPointFunction);
|
|
204850
204930
|
return this.finishGraphToPolyface(graph, triangulate);
|
|
204851
204931
|
}
|
|
204932
|
+
/**
|
|
204933
|
+
* Simplify the type of the region by stripping redundant parent(s).
|
|
204934
|
+
* * No Boolean operations are performed.
|
|
204935
|
+
* * Invalid inputs (such as childless regions) are not corrected.
|
|
204936
|
+
* @param region region to simplify
|
|
204937
|
+
* @returns
|
|
204938
|
+
* * For a [[UnionRegion]] with exactly one child, return it if it is a [[Loop]],
|
|
204939
|
+
* or if it is a [[ParityRegion]] with multiple children, otherwise return the `ParityRegion`'s `Loop`.
|
|
204940
|
+
* * For a `ParityRegion` with exactly one `Loop`, return it.
|
|
204941
|
+
* * All other inputs returned unchanged.
|
|
204942
|
+
*/
|
|
204943
|
+
static simplifyRegionType(region) {
|
|
204944
|
+
if (region instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion) {
|
|
204945
|
+
if (region.children.length === 1)
|
|
204946
|
+
return this.simplifyRegionType(region.children[0]);
|
|
204947
|
+
}
|
|
204948
|
+
else if (region instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
|
|
204949
|
+
if (region.children.length === 1)
|
|
204950
|
+
return region.children[0];
|
|
204951
|
+
}
|
|
204952
|
+
return region;
|
|
204953
|
+
}
|
|
204852
204954
|
/**
|
|
204853
204955
|
* Return areas defined by a boolean operation.
|
|
204854
204956
|
* @note For best results, input regions should have correctly oriented loops. See [[sortOuterAndHoleLoopsXY]].
|
|
@@ -204862,10 +204964,8 @@ class RegionOps {
|
|
|
204862
204964
|
* to connect interior loops to exterior loops.
|
|
204863
204965
|
*/
|
|
204864
204966
|
static regionBooleanXY(loopsA, loopsB, operation, mergeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
|
|
204865
|
-
|
|
204866
|
-
|
|
204867
|
-
const result = _UnionRegion__WEBPACK_IMPORTED_MODULE_11__.UnionRegion.create();
|
|
204868
|
-
const context = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionBooleanContext.create(_RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_10__.RegionGroupOpType.Union);
|
|
204967
|
+
const result = _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion.create();
|
|
204968
|
+
const context = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionBooleanContext.create(_RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union);
|
|
204869
204969
|
context.addMembers(loopsA, loopsB);
|
|
204870
204970
|
context.annotateAndMergeCurvesInGraph(mergeTolerance);
|
|
204871
204971
|
const range = context.groupA.range().union(context.groupB.range());
|
|
@@ -204877,12 +204977,12 @@ class RegionOps {
|
|
|
204877
204977
|
if (Math.abs(area) < areaTol)
|
|
204878
204978
|
return;
|
|
204879
204979
|
if (faceType === 1) {
|
|
204880
|
-
const loop =
|
|
204980
|
+
const loop = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.createLoopInFace(face);
|
|
204881
204981
|
if (loop)
|
|
204882
204982
|
result.tryAddChild(loop);
|
|
204883
204983
|
}
|
|
204884
204984
|
});
|
|
204885
|
-
return result;
|
|
204985
|
+
return result ? this.simplifyRegionType(result) : undefined;
|
|
204886
204986
|
}
|
|
204887
204987
|
/**
|
|
204888
204988
|
* Return a polyface whose facets are a boolean operation between the input regions.
|
|
@@ -204897,7 +204997,7 @@ class RegionOps {
|
|
|
204897
204997
|
* @param triangulate whether to triangulate the result
|
|
204898
204998
|
*/
|
|
204899
204999
|
static polygonBooleanXYToPolyface(inputA, operation, inputB, triangulate = false) {
|
|
204900
|
-
const graph =
|
|
205000
|
+
const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doBinaryBooleanBetweenMultiLoopInputs(inputA, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, operation, inputB, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, true);
|
|
204901
205001
|
return this.finishGraphToPolyface(graph, triangulate);
|
|
204902
205002
|
}
|
|
204903
205003
|
/**
|
|
@@ -204912,18 +205012,18 @@ class RegionOps {
|
|
|
204912
205012
|
* @param inputB second set of loops
|
|
204913
205013
|
*/
|
|
204914
205014
|
static polygonBooleanXYToLoops(inputA, operation, inputB) {
|
|
204915
|
-
const graph =
|
|
205015
|
+
const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doBinaryBooleanBetweenMultiLoopInputs(inputA, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, operation, inputB, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, true);
|
|
204916
205016
|
if (!graph)
|
|
204917
205017
|
return undefined;
|
|
204918
|
-
const loopEdges =
|
|
205018
|
+
const loopEdges = _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_15__.HalfEdgeGraphSearch.collectExtendedBoundaryLoopsInGraph(graph, _topology_Graph__WEBPACK_IMPORTED_MODULE_16__.HalfEdgeMask.EXTERIOR);
|
|
204919
205019
|
const allLoops = [];
|
|
204920
205020
|
for (const graphLoop of loopEdges) {
|
|
204921
|
-
const points = new
|
|
205021
|
+
const points = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray();
|
|
204922
205022
|
for (const edge of graphLoop)
|
|
204923
205023
|
points.pushXYZ(edge.x, edge.y, edge.z);
|
|
204924
205024
|
points.pushWrap(1);
|
|
204925
|
-
const loop =
|
|
204926
|
-
loop.tryAddChild(
|
|
205025
|
+
const loop = _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.create();
|
|
205026
|
+
loop.tryAddChild(_LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d.createCapture(points));
|
|
204927
205027
|
allLoops.push(loop);
|
|
204928
205028
|
}
|
|
204929
205029
|
return RegionOps.sortOuterAndHoleLoopsXY(allLoops);
|
|
@@ -204941,7 +205041,7 @@ class RegionOps {
|
|
|
204941
205041
|
* object.
|
|
204942
205042
|
*/
|
|
204943
205043
|
static constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions) {
|
|
204944
|
-
const context = new
|
|
205044
|
+
const context = new _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_19__.PolygonWireOffsetContext();
|
|
204945
205045
|
return context.constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions);
|
|
204946
205046
|
}
|
|
204947
205047
|
/**
|
|
@@ -204953,8 +205053,8 @@ class RegionOps {
|
|
|
204953
205053
|
* @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
|
|
204954
205054
|
*/
|
|
204955
205055
|
static constructCurveXYOffset(curves, offsetDistanceOrOptions) {
|
|
204956
|
-
const offsetOptions =
|
|
204957
|
-
return
|
|
205056
|
+
const offsetOptions = _OffsetOptions__WEBPACK_IMPORTED_MODULE_20__.OffsetOptions.create(offsetDistanceOrOptions);
|
|
205057
|
+
return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.constructCurveXYOffset(curves, offsetOptions);
|
|
204958
205058
|
}
|
|
204959
205059
|
/**
|
|
204960
205060
|
* Test if point (x,y) is IN, OUT or ON a region.
|
|
@@ -204964,7 +205064,7 @@ class RegionOps {
|
|
|
204964
205064
|
* @param y y coordinate of point to test
|
|
204965
205065
|
*/
|
|
204966
205066
|
static testPointInOnOutRegionXY(curves, x, y) {
|
|
204967
|
-
return
|
|
205067
|
+
return _Query_InOutTests__WEBPACK_IMPORTED_MODULE_22__.PointInOnOutContext.testPointInOnOutRegionXY(curves, x, y);
|
|
204968
205068
|
}
|
|
204969
205069
|
/**
|
|
204970
205070
|
* Create curve collection of subtype determined by gaps between the input curves.
|
|
@@ -204988,11 +205088,11 @@ class RegionOps {
|
|
|
204988
205088
|
maxGap = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.maxXY(maxGap, curves[i].endPoint().distance(curves[i + 1].startPoint()));
|
|
204989
205089
|
let collection;
|
|
204990
205090
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(maxGap)) {
|
|
204991
|
-
collection = wrap ?
|
|
205091
|
+
collection = wrap ? _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.create() : _Path__WEBPACK_IMPORTED_MODULE_23__.Path.create();
|
|
204992
205092
|
isPath = true;
|
|
204993
205093
|
}
|
|
204994
205094
|
else {
|
|
204995
|
-
collection =
|
|
205095
|
+
collection = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.BagOfCurves.create();
|
|
204996
205096
|
}
|
|
204997
205097
|
for (const c of curves)
|
|
204998
205098
|
collection.tryAddChild(c);
|
|
@@ -205018,7 +205118,7 @@ class RegionOps {
|
|
|
205018
205118
|
* @param cutterCurves input curves to intersect with `curvesToCut`
|
|
205019
205119
|
*/
|
|
205020
205120
|
static cloneCurvesWithXYSplits(curvesToCut, cutterCurves) {
|
|
205021
|
-
return
|
|
205121
|
+
return _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_25__.CurveSplitContext.cloneCurvesWithXYSplits(curvesToCut, cutterCurves);
|
|
205022
205122
|
}
|
|
205023
205123
|
/**
|
|
205024
205124
|
* Create paths assembled from many curves.
|
|
@@ -205029,11 +205129,11 @@ class RegionOps {
|
|
|
205029
205129
|
static splitToPathsBetweenBreaks(source, makeClones) {
|
|
205030
205130
|
if (source === undefined)
|
|
205031
205131
|
return undefined;
|
|
205032
|
-
if (source instanceof
|
|
205132
|
+
if (source instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive)
|
|
205033
205133
|
return source;
|
|
205034
205134
|
// source is a collection . ..
|
|
205035
205135
|
const primitives = source.collectCurvePrimitives();
|
|
205036
|
-
const chainCollector = new
|
|
205136
|
+
const chainCollector = new _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_27__.ChainCollectorContext(makeClones);
|
|
205037
205137
|
for (const primitive of primitives) {
|
|
205038
205138
|
chainCollector.announceCurvePrimitive(primitive);
|
|
205039
205139
|
}
|
|
@@ -205049,7 +205149,7 @@ class RegionOps {
|
|
|
205049
205149
|
* @returns object with named chains, insideOffsets, outsideOffsets
|
|
205050
205150
|
*/
|
|
205051
205151
|
static collectInsideAndOutsideOffsets(fragments, offsetDistance, gapTolerance) {
|
|
205052
|
-
return
|
|
205152
|
+
return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.collectInsideAndOutsideXYOffsets(fragments, offsetDistance, gapTolerance);
|
|
205053
205153
|
}
|
|
205054
205154
|
/**
|
|
205055
205155
|
* Restructure curve fragments as Paths and Loops.
|
|
@@ -205058,7 +205158,7 @@ class RegionOps {
|
|
|
205058
205158
|
* @returns chains, possibly wrapped in a [[BagOfCurves]].
|
|
205059
205159
|
*/
|
|
205060
205160
|
static collectChains(fragments, gapTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
|
|
205061
|
-
return
|
|
205161
|
+
return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.collectChains(fragments, gapTolerance);
|
|
205062
205162
|
}
|
|
205063
205163
|
/**
|
|
205064
205164
|
* Find all intersections among curves in `curvesToCut` against the boundaries of `region` and return fragments
|
|
@@ -205070,17 +205170,17 @@ class RegionOps {
|
|
|
205070
205170
|
const result = { insideParts: [], outsideParts: [], coincidentParts: [] };
|
|
205071
205171
|
const pathWithIntersectionMarkup = RegionOps.cloneCurvesWithXYSplits(curvesToCut, region);
|
|
205072
205172
|
const splitPaths = RegionOps.splitToPathsBetweenBreaks(pathWithIntersectionMarkup, true);
|
|
205073
|
-
if (splitPaths instanceof
|
|
205173
|
+
if (splitPaths instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection) {
|
|
205074
205174
|
for (const child of splitPaths.children) {
|
|
205075
|
-
const pointOnChild =
|
|
205175
|
+
const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(child);
|
|
205076
205176
|
if (pointOnChild) {
|
|
205077
205177
|
const inOnOut = RegionOps.testPointInOnOutRegionXY(region, pointOnChild.point.x, pointOnChild.point.y);
|
|
205078
205178
|
pushToInOnOutArrays(child, inOnOut, result.outsideParts, result.coincidentParts, result.insideParts);
|
|
205079
205179
|
}
|
|
205080
205180
|
}
|
|
205081
205181
|
}
|
|
205082
|
-
else if (splitPaths instanceof
|
|
205083
|
-
const pointOnChild =
|
|
205182
|
+
else if (splitPaths instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive) {
|
|
205183
|
+
const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(splitPaths);
|
|
205084
205184
|
if (pointOnChild) {
|
|
205085
205185
|
const inOnOut = RegionOps.testPointInOnOutRegionXY(region, pointOnChild.point.x, pointOnChild.point.y);
|
|
205086
205186
|
pushToInOnOutArrays(splitPaths, inOnOut, result.outsideParts, result.coincidentParts, result.insideParts);
|
|
@@ -205104,10 +205204,10 @@ class RegionOps {
|
|
|
205104
205204
|
* normal in z column. If not a rectangle, return undefined.
|
|
205105
205205
|
*/
|
|
205106
205206
|
static rectangleEdgeTransform(data, requireClosurePoint = true) {
|
|
205107
|
-
if (data instanceof
|
|
205207
|
+
if (data instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
|
|
205108
205208
|
return this.rectangleEdgeTransform(data.packedPoints);
|
|
205109
205209
|
}
|
|
205110
|
-
else if (data instanceof
|
|
205210
|
+
else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
|
|
205111
205211
|
let dataToUse;
|
|
205112
205212
|
if (requireClosurePoint && data.length === 5) {
|
|
205113
205213
|
if (!_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(data.distanceIndexIndex(0, 4)))
|
|
@@ -205121,8 +205221,8 @@ class RegionOps {
|
|
|
205121
205221
|
return undefined;
|
|
205122
205222
|
}
|
|
205123
205223
|
else {
|
|
205124
|
-
dataToUse =
|
|
205125
|
-
|
|
205224
|
+
dataToUse = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(data);
|
|
205225
|
+
_geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_28__.PolylineCompressionContext.compressInPlaceByShortEdgeLength(dataToUse, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
|
|
205126
205226
|
if (dataToUse.length < (requireClosurePoint ? 5 : 4))
|
|
205127
205227
|
return undefined;
|
|
205128
205228
|
}
|
|
@@ -205133,19 +205233,19 @@ class RegionOps {
|
|
|
205133
205233
|
if (normalVector.normalizeInPlace()
|
|
205134
205234
|
&& vector12.isAlmostEqual(vector03)
|
|
205135
205235
|
&& vector01.isPerpendicularTo(vector03)) {
|
|
205136
|
-
return
|
|
205236
|
+
return _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_29__.Transform.createOriginAndMatrixColumns(dataToUse.getPoint3dAtUncheckedPointIndex(0), vector01, vector03, normalVector);
|
|
205137
205237
|
}
|
|
205138
205238
|
}
|
|
205139
205239
|
else if (Array.isArray(data)) {
|
|
205140
|
-
return this.rectangleEdgeTransform(new
|
|
205240
|
+
return this.rectangleEdgeTransform(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__.Point3dArrayCarrier(data), requireClosurePoint);
|
|
205141
205241
|
}
|
|
205142
|
-
else if (data instanceof
|
|
205242
|
+
else if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
|
|
205143
205243
|
return this.rectangleEdgeTransform(data.children[0].packedPoints, true);
|
|
205144
205244
|
}
|
|
205145
|
-
else if (data instanceof
|
|
205245
|
+
else if (data instanceof _Path__WEBPACK_IMPORTED_MODULE_23__.Path && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
|
|
205146
205246
|
return this.rectangleEdgeTransform(data.children[0].packedPoints, requireClosurePoint);
|
|
205147
205247
|
}
|
|
205148
|
-
else if (data instanceof
|
|
205248
|
+
else if (data instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveChain) {
|
|
205149
205249
|
if (!data.checkForNonLinearPrimitives()) {
|
|
205150
205250
|
// const linestring = LineString3d.create();
|
|
205151
205251
|
const strokes = data.getPackedStrokes();
|
|
@@ -205169,7 +205269,7 @@ class RegionOps {
|
|
|
205169
205269
|
* @param options options for tolerance and selective simplification.
|
|
205170
205270
|
*/
|
|
205171
205271
|
static consolidateAdjacentPrimitives(curves, options) {
|
|
205172
|
-
const context = new
|
|
205272
|
+
const context = new _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_31__.ConsolidateAdjacentCurvePrimitivesContext(options);
|
|
205173
205273
|
curves.dispatchToGeometryHandler(context);
|
|
205174
205274
|
}
|
|
205175
205275
|
/**
|
|
@@ -205188,14 +205288,14 @@ class RegionOps {
|
|
|
205188
205288
|
static sortOuterAndHoleLoopsXY(loops) {
|
|
205189
205289
|
const loopAndArea = [];
|
|
205190
205290
|
for (const candidate of loops) {
|
|
205191
|
-
if (candidate instanceof
|
|
205192
|
-
|
|
205193
|
-
else if (candidate instanceof
|
|
205194
|
-
const loop =
|
|
205195
|
-
|
|
205291
|
+
if (candidate instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop)
|
|
205292
|
+
_geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.pushLoop(loopAndArea, candidate);
|
|
205293
|
+
else if (candidate instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
|
|
205294
|
+
const loop = _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.createPolygon(candidate);
|
|
205295
|
+
_geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.pushLoop(loopAndArea, loop);
|
|
205196
205296
|
}
|
|
205197
205297
|
}
|
|
205198
|
-
return
|
|
205298
|
+
return _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.sortAsAnyRegion(loopAndArea);
|
|
205199
205299
|
}
|
|
205200
205300
|
/**
|
|
205201
205301
|
* Find all xy-areas bounded by the unstructured, possibly intersecting curves.
|
|
@@ -205218,12 +205318,13 @@ class RegionOps {
|
|
|
205218
205318
|
* to the edge and a constituent curve in each.
|
|
205219
205319
|
*/
|
|
205220
205320
|
static constructAllXYRegionLoops(curvesAndRegions, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
|
|
205221
|
-
|
|
205321
|
+
let primitives = RegionOps.collectCurvePrimitives(curvesAndRegions, undefined, true, true);
|
|
205322
|
+
primitives = _internalContexts_TransferWithSplitArcs__WEBPACK_IMPORTED_MODULE_33__.TransferWithSplitArcs.clone(_CurveCollection__WEBPACK_IMPORTED_MODULE_24__.BagOfCurves.create(...primitives)).children;
|
|
205222
205323
|
const range = this.curveArrayRange(primitives);
|
|
205223
205324
|
const areaTol = this.computeXYAreaTolerance(range, tolerance);
|
|
205224
|
-
const intersections =
|
|
205225
|
-
const graph =
|
|
205226
|
-
return
|
|
205325
|
+
const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_34__.CurveCurve.allIntersectionsAmongPrimitivesXY(primitives, tolerance);
|
|
205326
|
+
const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.assembleHalfEdgeGraph(primitives, intersections, tolerance);
|
|
205327
|
+
return _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.collectSignedLoopSetsInHalfEdgeGraph(graph, areaTol);
|
|
205227
205328
|
}
|
|
205228
205329
|
/**
|
|
205229
205330
|
* Collect all `CurvePrimitives` in loosely typed input.
|
|
@@ -205238,10 +205339,10 @@ class RegionOps {
|
|
|
205238
205339
|
*/
|
|
205239
205340
|
static collectCurvePrimitives(candidates, collectorArray, smallestPossiblePrimitives = false, explodeLinestrings = false) {
|
|
205240
205341
|
const results = collectorArray === undefined ? [] : collectorArray;
|
|
205241
|
-
if (candidates instanceof
|
|
205342
|
+
if (candidates instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive) {
|
|
205242
205343
|
candidates.collectCurvePrimitives(results, smallestPossiblePrimitives, explodeLinestrings);
|
|
205243
205344
|
}
|
|
205244
|
-
else if (candidates instanceof
|
|
205345
|
+
else if (candidates instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection) {
|
|
205245
205346
|
candidates.collectCurvePrimitives(results, smallestPossiblePrimitives, explodeLinestrings);
|
|
205246
205347
|
}
|
|
205247
205348
|
else if (Array.isArray(candidates)) {
|
|
@@ -205260,7 +205361,7 @@ class RegionOps {
|
|
|
205260
205361
|
static expandLineStrings(candidates) {
|
|
205261
205362
|
const result = [];
|
|
205262
205363
|
for (const c of candidates) {
|
|
205263
|
-
if (c instanceof
|
|
205364
|
+
if (c instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
|
|
205264
205365
|
for (let i = 0; i + 1 < c.packedPoints.length; i++) {
|
|
205265
205366
|
const q = c.getIndexedSegment(i);
|
|
205266
205367
|
if (q !== undefined)
|
|
@@ -205279,16 +205380,16 @@ class RegionOps {
|
|
|
205279
205380
|
* @param worldToLocal transform to apply to data before computing its range
|
|
205280
205381
|
*/
|
|
205281
205382
|
static curveArrayRange(data, worldToLocal) {
|
|
205282
|
-
const range =
|
|
205283
|
-
if (data instanceof
|
|
205383
|
+
const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_35__.Range3d.create();
|
|
205384
|
+
if (data instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_36__.GeometryQuery)
|
|
205284
205385
|
data.extendRange(range, worldToLocal);
|
|
205285
205386
|
else if (Array.isArray(data)) {
|
|
205286
205387
|
for (const c of data) {
|
|
205287
|
-
if (c instanceof
|
|
205388
|
+
if (c instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_36__.GeometryQuery)
|
|
205288
205389
|
c.extendRange(range, worldToLocal);
|
|
205289
|
-
else if (c instanceof
|
|
205390
|
+
else if (c instanceof _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d)
|
|
205290
205391
|
range.extendPoint(c, worldToLocal);
|
|
205291
|
-
else if (c instanceof
|
|
205392
|
+
else if (c instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray)
|
|
205292
205393
|
range.extendRange(c.getRange(worldToLocal));
|
|
205293
205394
|
else if (Array.isArray(c))
|
|
205294
205395
|
range.extendRange(this.curveArrayRange(c, worldToLocal));
|
|
@@ -205307,37 +205408,37 @@ class RegionOps {
|
|
|
205307
205408
|
if (polygons.length === 0)
|
|
205308
205409
|
return undefined;
|
|
205309
205410
|
const firstEntry = polygons[0];
|
|
205310
|
-
if (
|
|
205311
|
-
graph =
|
|
205411
|
+
if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.isAnyImmediatePointType(firstEntry)) {
|
|
205412
|
+
graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
|
|
205312
205413
|
}
|
|
205313
205414
|
else if (polygons.length > 1) {
|
|
205314
205415
|
let writablePolygons;
|
|
205315
|
-
if (firstEntry instanceof
|
|
205416
|
+
if (firstEntry instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedReadWriteXYZCollection) {
|
|
205316
205417
|
writablePolygons = polygons;
|
|
205317
205418
|
}
|
|
205318
205419
|
else {
|
|
205319
205420
|
writablePolygons = [];
|
|
205320
205421
|
for (const polygon of polygons)
|
|
205321
|
-
writablePolygons.push(
|
|
205422
|
+
writablePolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(polygon));
|
|
205322
205423
|
}
|
|
205323
|
-
const sortedPolygons =
|
|
205424
|
+
const sortedPolygons = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_37__.PolygonOps.sortOuterAndHoleLoopsXY(writablePolygons);
|
|
205324
205425
|
if (sortedPolygons.length === 1) { // below requires exactly one outer loop!
|
|
205325
|
-
if (graph =
|
|
205326
|
-
|
|
205426
|
+
if (graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromLoops(sortedPolygons[0]))
|
|
205427
|
+
_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
|
|
205327
205428
|
}
|
|
205328
205429
|
}
|
|
205329
205430
|
else {
|
|
205330
|
-
graph =
|
|
205431
|
+
graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(firstEntry);
|
|
205331
205432
|
}
|
|
205332
205433
|
}
|
|
205333
205434
|
else {
|
|
205334
|
-
graph =
|
|
205435
|
+
graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
|
|
205335
205436
|
}
|
|
205336
205437
|
if (!graph) {
|
|
205337
205438
|
// Last resort: try full merge. Conveniently, multiple polygons are processed with parity logic.
|
|
205338
|
-
if (graph =
|
|
205339
|
-
if (
|
|
205340
|
-
|
|
205439
|
+
if (graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(polygons, [], (inA, _inB) => inA)) {
|
|
205440
|
+
if (_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.triangulateAllPositiveAreaFaces(graph))
|
|
205441
|
+
_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
|
|
205341
205442
|
}
|
|
205342
205443
|
}
|
|
205343
205444
|
return graph;
|
|
@@ -205347,13 +205448,13 @@ class RegionOps {
|
|
|
205347
205448
|
const strokedComponent = component.cloneStroked(options);
|
|
205348
205449
|
// package the stroked region as polygons
|
|
205349
205450
|
const polygons = [];
|
|
205350
|
-
if (strokedComponent instanceof
|
|
205351
|
-
if (strokedComponent.children.length > 0 && strokedComponent.children[0] instanceof
|
|
205451
|
+
if (strokedComponent instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop) {
|
|
205452
|
+
if (strokedComponent.children.length > 0 && strokedComponent.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d)
|
|
205352
205453
|
polygons.push(strokedComponent.children[0].packedPoints); // expect only 1
|
|
205353
205454
|
}
|
|
205354
|
-
else if (strokedComponent instanceof
|
|
205455
|
+
else if (strokedComponent instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
|
|
205355
205456
|
for (const strokedLoop of strokedComponent.children) {
|
|
205356
|
-
if (strokedLoop.children.length > 0 && strokedLoop.children[0] instanceof
|
|
205457
|
+
if (strokedLoop.children.length > 0 && strokedLoop.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d)
|
|
205357
205458
|
polygons.push(strokedLoop.children[0].packedPoints); // expect only 1
|
|
205358
205459
|
}
|
|
205359
205460
|
}
|
|
@@ -205381,7 +205482,7 @@ class RegionOps {
|
|
|
205381
205482
|
*/
|
|
205382
205483
|
static facetRegionXY(region, options) {
|
|
205383
205484
|
let graph;
|
|
205384
|
-
if (region instanceof
|
|
205485
|
+
if (region instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion) {
|
|
205385
205486
|
for (const child of region.children) {
|
|
205386
205487
|
const childGraph = RegionOps.triangulateRegionComponent(child, options);
|
|
205387
205488
|
if (childGraph) {
|
|
@@ -205403,8 +205504,8 @@ class RegionOps {
|
|
|
205403
205504
|
if (!graph)
|
|
205404
205505
|
return undefined;
|
|
205405
205506
|
if (options?.maximizeConvexFacets)
|
|
205406
|
-
|
|
205407
|
-
return
|
|
205507
|
+
_topology_Merging__WEBPACK_IMPORTED_MODULE_38__.HalfEdgeGraphOps.expandConvexFaces(graph);
|
|
205508
|
+
return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__.PolyfaceBuilder.graphToPolyface(graph, options);
|
|
205408
205509
|
}
|
|
205409
205510
|
/**
|
|
205410
205511
|
* Decompose a polygon with optional holes into an array of convex polygons.
|
|
@@ -205417,11 +205518,11 @@ class RegionOps {
|
|
|
205417
205518
|
if (!graph)
|
|
205418
205519
|
return undefined;
|
|
205419
205520
|
if (maximize)
|
|
205420
|
-
|
|
205521
|
+
_topology_Merging__WEBPACK_IMPORTED_MODULE_38__.HalfEdgeGraphOps.expandConvexFaces(graph);
|
|
205421
205522
|
const convexPolygons = [];
|
|
205422
205523
|
graph.announceFaceLoops((_graph, seed) => {
|
|
205423
|
-
if (!seed.isMaskSet(
|
|
205424
|
-
convexPolygons.push(
|
|
205524
|
+
if (!seed.isMaskSet(_topology_Graph__WEBPACK_IMPORTED_MODULE_16__.HalfEdgeMask.EXTERIOR))
|
|
205525
|
+
convexPolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(seed.collectAroundFace((node) => { return node.getPoint3d(); })));
|
|
205425
205526
|
return true;
|
|
205426
205527
|
});
|
|
205427
205528
|
return convexPolygons;
|
|
@@ -205473,24 +205574,25 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
205473
205574
|
/* harmony export */ RegionOpsFaceToFaceSearch: () => (/* binding */ RegionOpsFaceToFaceSearch)
|
|
205474
205575
|
/* harmony export */ });
|
|
205475
205576
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
205476
|
-
/* harmony import */ var
|
|
205577
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
205477
205578
|
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
205478
|
-
/* harmony import */ var
|
|
205579
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
205479
205580
|
/* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
|
|
205480
205581
|
/* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
|
|
205481
205582
|
/* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
|
|
205482
205583
|
/* harmony import */ var _topology_RegularizeFace__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../topology/RegularizeFace */ "../../core/geometry/lib/esm/topology/RegularizeFace.js");
|
|
205483
|
-
/* harmony import */ var
|
|
205484
|
-
/* harmony import */ var
|
|
205485
|
-
/* harmony import */ var
|
|
205584
|
+
/* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
205585
|
+
/* harmony import */ var _CurveCurve__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./CurveCurve */ "../../core/geometry/lib/esm/curve/CurveCurve.js");
|
|
205586
|
+
/* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
|
|
205486
205587
|
/* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
205487
|
-
/* harmony import */ var
|
|
205488
|
-
/* harmony import */ var
|
|
205588
|
+
/* harmony import */ var _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./internalContexts/PlaneAltitudeRangeContext */ "../../core/geometry/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js");
|
|
205589
|
+
/* harmony import */ var _internalContexts_TransferWithSplitArcs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./internalContexts/TransferWithSplitArcs */ "../../core/geometry/lib/esm/curve/internalContexts/TransferWithSplitArcs.js");
|
|
205590
|
+
/* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
205489
205591
|
/* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
205490
205592
|
/* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
|
|
205491
|
-
/* harmony import */ var
|
|
205593
|
+
/* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
|
|
205492
205594
|
/* harmony import */ var _RegionOps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
|
|
205493
|
-
/* harmony import */ var
|
|
205595
|
+
/* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
|
|
205494
205596
|
/*---------------------------------------------------------------------------------------------
|
|
205495
205597
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
205496
205598
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -205517,6 +205619,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
205517
205619
|
|
|
205518
205620
|
|
|
205519
205621
|
|
|
205622
|
+
|
|
205520
205623
|
/**
|
|
205521
205624
|
* base class for callbacks during region sweeps.
|
|
205522
205625
|
* * At start of a component, `startComponent(node)` is called announcing a representative node on the outermost face.
|
|
@@ -205833,8 +205936,7 @@ class RegionGroup {
|
|
|
205833
205936
|
}
|
|
205834
205937
|
return range;
|
|
205835
205938
|
}
|
|
205836
|
-
/** Ask if the current _numIn count qualifies as an "in" for this operation type.
|
|
205837
|
-
*/
|
|
205939
|
+
/** Ask if the current _numIn count qualifies as an "in" for this operation type. */
|
|
205838
205940
|
getInOut() {
|
|
205839
205941
|
// UNION is true if one or more members are IN
|
|
205840
205942
|
if (this.groupOpType === RegionGroupOpType.Union)
|
|
@@ -205850,11 +205952,12 @@ class RegionGroup {
|
|
|
205850
205952
|
// push new members into the group.
|
|
205851
205953
|
addMember(data, allowLineSegment = false) {
|
|
205852
205954
|
if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_8__.Loop || data instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_9__.ParityRegion) {
|
|
205853
|
-
|
|
205955
|
+
let cleanerData = data.clone();
|
|
205854
205956
|
_RegionOps__WEBPACK_IMPORTED_MODULE_1__.RegionOps.consolidateAdjacentPrimitives(cleanerData);
|
|
205957
|
+
cleanerData = _internalContexts_TransferWithSplitArcs__WEBPACK_IMPORTED_MODULE_10__.TransferWithSplitArcs.clone(cleanerData);
|
|
205855
205958
|
this.members.push(new RegionGroupMember(cleanerData, this));
|
|
205856
205959
|
}
|
|
205857
|
-
else if (data instanceof
|
|
205960
|
+
else if (data instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_11__.UnionRegion) {
|
|
205858
205961
|
for (const child of data.children) {
|
|
205859
205962
|
this.addMember(child);
|
|
205860
205963
|
}
|
|
@@ -205864,7 +205967,7 @@ class RegionGroup {
|
|
|
205864
205967
|
this.addMember(item);
|
|
205865
205968
|
}
|
|
205866
205969
|
}
|
|
205867
|
-
else if (allowLineSegment && data instanceof
|
|
205970
|
+
else if (allowLineSegment && data instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d) {
|
|
205868
205971
|
this.members.push(new RegionGroupMember(data, this));
|
|
205869
205972
|
}
|
|
205870
205973
|
}
|
|
@@ -205881,22 +205984,22 @@ class RegionGroup {
|
|
|
205881
205984
|
/**
|
|
205882
205985
|
* A `RegionBooleanContext` carries structure and operations for binary operations between two sets of regions.
|
|
205883
205986
|
* * In the binary operation OP (union, intersection, parity, difference), the left and right operands
|
|
205884
|
-
*
|
|
205987
|
+
* are each a composite union, difference, or parity among multiple inputs, i.e.,
|
|
205885
205988
|
* * (operationA among Ai) OP (operationB among Bi)
|
|
205886
205989
|
* * where the Ai are one set of regions, being combined by operationA
|
|
205887
|
-
* * and the Bi are the another set of regions, being combined by operationB
|
|
205888
|
-
* * Each group of Ai and Bi is a `RegionGroup
|
|
205990
|
+
* * and the Bi are the another set of regions, being combined by operationB.
|
|
205991
|
+
* * Each group of Ai and Bi is a `RegionGroup`.
|
|
205889
205992
|
* * This is an extremely delicate structure.
|
|
205890
205993
|
* * Members are public because of the unique variety of queries, but should only be used for queries.
|
|
205891
205994
|
* * The graph and curves in the booleans are connected by an extended pointer chain:
|
|
205892
|
-
* * (HalfEdge in Graph).edgeTag points to a CurveLocationDetail
|
|
205893
|
-
* * (CurveLocationDetail).curve points to a curve
|
|
205894
|
-
* * (Curve).parent points to RegionGroupMember
|
|
205895
|
-
* * (RegionGroupMember) points to RegionGroup
|
|
205896
|
-
* * (RegionGroup) points to RegionBooleanBinaryContext
|
|
205897
|
-
* * So
|
|
205898
|
-
* * the chain leads to a parity count in the RegionGroupMember
|
|
205899
|
-
* * that can change the number of members active in the RegionGroup
|
|
205995
|
+
* * (HalfEdge in Graph).edgeTag points to a CurveLocationDetail.
|
|
205996
|
+
* * (CurveLocationDetail).curve points to a curve.
|
|
205997
|
+
* * (Curve).parent points to RegionGroupMember.
|
|
205998
|
+
* * (RegionGroupMember) points to RegionGroup.
|
|
205999
|
+
* * (RegionGroup) points to RegionBooleanBinaryContext.
|
|
206000
|
+
* * So when a graph sweep crosses an edge
|
|
206001
|
+
* * the chain leads to a parity count in the RegionGroupMember.
|
|
206002
|
+
* * that can change the number of members active in the RegionGroup.
|
|
205900
206003
|
* * which can change the state of the context.
|
|
205901
206004
|
* @internal
|
|
205902
206005
|
*/
|
|
@@ -205911,7 +206014,7 @@ class RegionBooleanContext {
|
|
|
205911
206014
|
this.groupA = new RegionGroup(this, groupTypeA);
|
|
205912
206015
|
this.groupB = new RegionGroup(this, groupTypeB);
|
|
205913
206016
|
this.extraGeometry = new RegionGroup(this, RegionGroupOpType.NonBounding);
|
|
205914
|
-
this.binaryOp = _RegionOps__WEBPACK_IMPORTED_MODULE_1__.RegionBinaryOpType.Union; //
|
|
206017
|
+
this.binaryOp = _RegionOps__WEBPACK_IMPORTED_MODULE_1__.RegionBinaryOpType.Union; // revised in runClassificationSweep
|
|
205915
206018
|
}
|
|
205916
206019
|
/**
|
|
205917
206020
|
* Create a context with both A and B groups empty.
|
|
@@ -205930,7 +206033,7 @@ class RegionBooleanContext {
|
|
|
205930
206033
|
this.addConnectives();
|
|
205931
206034
|
}
|
|
205932
206035
|
_workSegment;
|
|
205933
|
-
static _bridgeDirection =
|
|
206036
|
+
static _bridgeDirection = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_13__.Vector3d.createNormalized(1.0, -0.12328974132467); // magic unit direction to minimize vertex hits
|
|
205934
206037
|
/**
|
|
205935
206038
|
* The sweep operations require access to all geometry by edge crossings and face walk.
|
|
205936
206039
|
* If input loops are non-overlapping, there may be disconnected islands not reachable.
|
|
@@ -205945,7 +206048,7 @@ class RegionBooleanContext {
|
|
|
205945
206048
|
const rangeAB = rangeA.union(rangeB);
|
|
205946
206049
|
const areaTol = _RegionOps__WEBPACK_IMPORTED_MODULE_1__.RegionOps.computeXYAreaTolerance(rangeAB);
|
|
205947
206050
|
let margin = 0.1;
|
|
205948
|
-
this._workSegment =
|
|
206051
|
+
this._workSegment = _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_14__.PlaneAltitudeRangeContext.findExtremePointsInDirection(rangeAB.corners(), RegionBooleanContext._bridgeDirection, this._workSegment);
|
|
205949
206052
|
if (this._workSegment)
|
|
205950
206053
|
margin *= this._workSegment.point0Ref.distanceXY(this._workSegment.point1Ref); // how much further to extend each bridge ray
|
|
205951
206054
|
const maxPoints = [];
|
|
@@ -205953,7 +206056,7 @@ class RegionBooleanContext {
|
|
|
205953
206056
|
const area = _RegionOps__WEBPACK_IMPORTED_MODULE_1__.RegionOps.computeXYArea(region);
|
|
205954
206057
|
if (area === undefined || Math.abs(area) < areaTol)
|
|
205955
206058
|
return; // avoid bridging trivial faces
|
|
205956
|
-
this._workSegment =
|
|
206059
|
+
this._workSegment = _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_14__.PlaneAltitudeRangeContext.findExtremePointsInDirection(region, RegionBooleanContext._bridgeDirection, this._workSegment);
|
|
205957
206060
|
if (this._workSegment)
|
|
205958
206061
|
maxPoints.push(this._workSegment.point1Ref);
|
|
205959
206062
|
};
|
|
@@ -205968,17 +206071,17 @@ class RegionBooleanContext {
|
|
|
205968
206071
|
}
|
|
205969
206072
|
}
|
|
205970
206073
|
}
|
|
205971
|
-
const ray =
|
|
206074
|
+
const ray = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_15__.Ray3d.createZero();
|
|
205972
206075
|
for (const p of maxPoints) {
|
|
205973
|
-
// Make a line from
|
|
205974
|
-
//
|
|
205975
|
-
//
|
|
205976
|
-
// If p came from some inner loop this will
|
|
205977
|
-
//
|
|
205978
|
-
//
|
|
205979
|
-
const bridgeLength = margin +
|
|
205980
|
-
const outside =
|
|
205981
|
-
const bridgeLine =
|
|
206076
|
+
// Make a line from
|
|
206077
|
+
// 1) exactly the max point of the loops to
|
|
206078
|
+
// 2) a point clearly outside the big range
|
|
206079
|
+
// If p came from some inner loop this will
|
|
206080
|
+
// 1) create a bridge from the inner loop through any containing loops (always)
|
|
206081
|
+
// 2) avoid crossing any containing loop at a vertex. (with high probability, but not absolutely always)
|
|
206082
|
+
const bridgeLength = margin + _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_15__.Ray3d.create(p, RegionBooleanContext._bridgeDirection, ray).intersectionWithRange3d(rangeAB).high;
|
|
206083
|
+
const outside = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_13__.Point3d.createAdd2Scaled(p, 1.0, RegionBooleanContext._bridgeDirection, bridgeLength);
|
|
206084
|
+
const bridgeLine = _LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.createXYXY(p.x, p.y, outside.x, outside.y);
|
|
205982
206085
|
this.extraGeometry.addMember(bridgeLine, true);
|
|
205983
206086
|
}
|
|
205984
206087
|
}
|
|
@@ -205992,7 +206095,7 @@ class RegionBooleanContext {
|
|
|
205992
206095
|
*/
|
|
205993
206096
|
annotateAndMergeCurvesInGraph(mergeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_7__.Geometry.smallMetricDistance) {
|
|
205994
206097
|
const allPrimitives = [];
|
|
205995
|
-
// ASSUME loops have fine-grained types
|
|
206098
|
+
// ASSUME loops have fine-grained types (no linestrings)
|
|
205996
206099
|
for (const group of [this.groupA, this.groupB, this.extraGeometry]) {
|
|
205997
206100
|
for (const member of group.members) {
|
|
205998
206101
|
let k = allPrimitives.length;
|
|
@@ -206003,9 +206106,8 @@ class RegionBooleanContext {
|
|
|
206003
206106
|
}
|
|
206004
206107
|
}
|
|
206005
206108
|
}
|
|
206006
|
-
|
|
206007
|
-
const
|
|
206008
|
-
const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_16__.PlanarSubdivision.assembleHalfEdgeGraph(allPrimitives, intersections, mergeTolerance);
|
|
206109
|
+
const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_16__.CurveCurve.allIntersectionsAmongPrimitivesXY(allPrimitives, mergeTolerance);
|
|
206110
|
+
const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_17__.PlanarSubdivision.assembleHalfEdgeGraph(allPrimitives, intersections, mergeTolerance);
|
|
206009
206111
|
this.graph = graph;
|
|
206010
206112
|
this.faceAreaFunction = faceAreaFromCurvedEdgeData;
|
|
206011
206113
|
}
|
|
@@ -206096,7 +206198,7 @@ class RegionBooleanContext {
|
|
|
206096
206198
|
const data = node.edgeTag;
|
|
206097
206199
|
if (data instanceof RegionGroupMember)
|
|
206098
206200
|
return updateRegionGroupMemberState(data);
|
|
206099
|
-
if (data instanceof
|
|
206201
|
+
if (data instanceof _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_18__.CurveLocationDetail) {
|
|
206100
206202
|
// We trust that the caller has linked from the graph node to a curve which has a RegionGroupMember as its parent.
|
|
206101
206203
|
const member = data.curve.parent;
|
|
206102
206204
|
if (member instanceof RegionGroupMember)
|
|
@@ -206151,10 +206253,10 @@ function areaUnderPartialCurveXY(detail, xyStart, xyEnd, referencePoint) {
|
|
|
206151
206253
|
}
|
|
206152
206254
|
let areaToChord = 0.0;
|
|
206153
206255
|
if (detail && detail.curve && detail.hasFraction1) {
|
|
206154
|
-
if (detail.curve instanceof
|
|
206256
|
+
if (detail.curve instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d) {
|
|
206155
206257
|
// ah .. nothing to do for a line segment
|
|
206156
206258
|
}
|
|
206157
|
-
else if (detail.curve instanceof
|
|
206259
|
+
else if (detail.curve instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_19__.Arc3d) {
|
|
206158
206260
|
areaToChord = detail.curve.areaToChordXY(detail.fraction, detail.fraction1);
|
|
206159
206261
|
}
|
|
206160
206262
|
}
|
|
@@ -208696,6 +208798,8 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
208696
208798
|
// The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
|
|
208697
208799
|
// The fraction and extend parameters allow all combinations to be passed in.
|
|
208698
208800
|
dispatchSegmentArc(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, arc, extendB0, extendB1, reversed) {
|
|
208801
|
+
const tol2 = this._coincidentGeometryContext.tolerance * this._coincidentGeometryContext.tolerance;
|
|
208802
|
+
let dist2;
|
|
208699
208803
|
// Arc: X = C + cU + sV
|
|
208700
208804
|
// Line: contains points A0,A1
|
|
208701
208805
|
// Arc point colinear with line if det (A0, A1, X) = 0
|
|
@@ -208706,6 +208810,10 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
208706
208810
|
// project back to line.
|
|
208707
208811
|
if (this._worldToLocalPerspective) {
|
|
208708
208812
|
const data = arc.toTransformedPoint4d(this._worldToLocalPerspective);
|
|
208813
|
+
const radians0 = data.sweep.fractionToRadians(0);
|
|
208814
|
+
const pointB0H = data.center.plus2Scaled(data.vector0, Math.cos(radians0), data.vector90, Math.sin(radians0));
|
|
208815
|
+
const radians1 = data.sweep.fractionToRadians(1);
|
|
208816
|
+
const pointB1H = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
|
|
208709
208817
|
const pointA0H = this._worldToLocalPerspective.multiplyPoint3d(pointA0, 1);
|
|
208710
208818
|
const pointA1H = this._worldToLocalPerspective.multiplyPoint3d(pointA1, 1);
|
|
208711
208819
|
const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.center);
|
|
@@ -208715,19 +208823,31 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
208715
208823
|
const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_9__.GrowableFloat64Array(2);
|
|
208716
208824
|
const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_9__.GrowableFloat64Array(2);
|
|
208717
208825
|
const numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_10__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
|
|
208826
|
+
if (numRoots <= 0)
|
|
208827
|
+
return;
|
|
208718
208828
|
for (let i = 0; i < numRoots; i++) {
|
|
208719
208829
|
const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
|
|
208720
|
-
|
|
208830
|
+
let arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
|
|
208721
208831
|
const lineFraction = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegment3dHXYClosestPointUnbounded(pointA0H, pointA1H, arcPoint);
|
|
208722
|
-
if (lineFraction !== undefined
|
|
208723
|
-
this.acceptFraction(extendA0, lineFraction, extendA1) &&
|
|
208724
|
-
|
|
208725
|
-
|
|
208832
|
+
if (lineFraction !== undefined) {
|
|
208833
|
+
if (this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB0, arcFraction, extendB1)) {
|
|
208834
|
+
this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
|
|
208835
|
+
}
|
|
208836
|
+
else { // check for endpoint intersections beyond parametric tolerance but within point tolerance
|
|
208837
|
+
const pointAH = lineFraction < 0.5 ? pointA0H : pointA1H;
|
|
208838
|
+
const pointBH = (arcFraction = data.sweep.fractionToSignedPeriodicFraction(arcFraction)) < 0.5 ? pointB0H : pointB1H;
|
|
208839
|
+
if ((dist2 = pointAH.realDistanceSquaredXY(pointBH)) !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isDistanceWithinTol(dist2, tol2))
|
|
208840
|
+
this.recordPointWithLocalFractions(lineFraction < 0.5 ? 0 : 1, cpA, fractionA0, fractionA1, arcFraction < 0.5 ? 0 : 1, arc, 0, 1, reversed);
|
|
208841
|
+
}
|
|
208726
208842
|
}
|
|
208727
208843
|
}
|
|
208728
208844
|
}
|
|
208729
208845
|
else {
|
|
208730
208846
|
const data = arc.toTransformedVectors(this._worldToLocalAffine);
|
|
208847
|
+
const radians0 = data.sweep.fractionToRadians(0);
|
|
208848
|
+
const pointB0Local = data.center.plus2Scaled(data.vector0, Math.cos(radians0), data.vector90, Math.sin(radians0));
|
|
208849
|
+
const radians1 = data.sweep.fractionToRadians(1);
|
|
208850
|
+
const pointB1Local = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
|
|
208731
208851
|
let pointA0Local = pointA0;
|
|
208732
208852
|
let pointA1Local = pointA1;
|
|
208733
208853
|
if (this._worldToLocalAffine) {
|
|
@@ -208741,16 +208861,22 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
208741
208861
|
const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_9__.GrowableFloat64Array(2);
|
|
208742
208862
|
const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_9__.GrowableFloat64Array(2);
|
|
208743
208863
|
const numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_10__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
|
|
208744
|
-
|
|
208745
|
-
|
|
208864
|
+
if (numRoots <= 0)
|
|
208865
|
+
return;
|
|
208746
208866
|
for (let i = 0; i < numRoots; i++) {
|
|
208747
208867
|
const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
|
|
208748
|
-
|
|
208868
|
+
let arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
|
|
208749
208869
|
const lineFraction = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
|
|
208750
|
-
if (lineFraction !== undefined
|
|
208751
|
-
this.acceptFraction(extendA0, lineFraction, extendA1,
|
|
208752
|
-
|
|
208753
|
-
|
|
208870
|
+
if (lineFraction !== undefined) {
|
|
208871
|
+
if (this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB0, arcFraction, extendB1)) {
|
|
208872
|
+
this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
|
|
208873
|
+
}
|
|
208874
|
+
else { // check for endpoint intersections beyond parametric tolerance but within point tolerance
|
|
208875
|
+
const pointALocal = lineFraction < 0.5 ? pointA0Local : pointA1Local;
|
|
208876
|
+
const pointBLocal = (arcFraction = data.sweep.fractionToSignedPeriodicFraction(arcFraction)) < 0.5 ? pointB0Local : pointB1Local;
|
|
208877
|
+
if ((dist2 = pointALocal.distanceSquaredXY(pointBLocal)) !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isDistanceWithinTol(dist2, tol2))
|
|
208878
|
+
this.recordPointWithLocalFractions(lineFraction < 0.5 ? 0 : 1, cpA, fractionA0, fractionA1, arcFraction < 0.5 ? 0 : 1, arc, 0, 1, reversed);
|
|
208879
|
+
}
|
|
208754
208880
|
}
|
|
208755
208881
|
}
|
|
208756
208882
|
}
|
|
@@ -212823,6 +212949,52 @@ class SumLengthsContext extends _CurveProcessor__WEBPACK_IMPORTED_MODULE_0__.Rec
|
|
|
212823
212949
|
}
|
|
212824
212950
|
|
|
212825
212951
|
|
|
212952
|
+
/***/ }),
|
|
212953
|
+
|
|
212954
|
+
/***/ "../../core/geometry/lib/esm/curve/internalContexts/TransferWithSplitArcs.js":
|
|
212955
|
+
/*!***********************************************************************************!*\
|
|
212956
|
+
!*** ../../core/geometry/lib/esm/curve/internalContexts/TransferWithSplitArcs.js ***!
|
|
212957
|
+
\***********************************************************************************/
|
|
212958
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
212959
|
+
|
|
212960
|
+
"use strict";
|
|
212961
|
+
__webpack_require__.r(__webpack_exports__);
|
|
212962
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
212963
|
+
/* harmony export */ TransferWithSplitArcs: () => (/* binding */ TransferWithSplitArcs)
|
|
212964
|
+
/* harmony export */ });
|
|
212965
|
+
/* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
212966
|
+
/* harmony import */ var _CloneCurvesContext__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CloneCurvesContext */ "../../core/geometry/lib/esm/curve/internalContexts/CloneCurvesContext.js");
|
|
212967
|
+
/*---------------------------------------------------------------------------------------------
|
|
212968
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
212969
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
212970
|
+
*--------------------------------------------------------------------------------------------*/
|
|
212971
|
+
/** @packageDocumentation
|
|
212972
|
+
* @module Curve
|
|
212973
|
+
*/
|
|
212974
|
+
|
|
212975
|
+
|
|
212976
|
+
/**
|
|
212977
|
+
* Algorithmic class for shallow-copying a CurveCollection with each full-sweep arc replaced by two half-sweep arcs.
|
|
212978
|
+
* * Often useful for building graphs from loops.
|
|
212979
|
+
* @internal
|
|
212980
|
+
*/
|
|
212981
|
+
class TransferWithSplitArcs extends _CloneCurvesContext__WEBPACK_IMPORTED_MODULE_0__.CloneCurvesContext {
|
|
212982
|
+
constructor() {
|
|
212983
|
+
super(undefined);
|
|
212984
|
+
}
|
|
212985
|
+
doClone(primitive) {
|
|
212986
|
+
if (primitive instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_1__.Arc3d && primitive.sweep.isFullCircle) // replace full arc with two half arcs
|
|
212987
|
+
return [primitive.clonePartialCurve(0.0, 0.5), primitive.clonePartialCurve(0.5, 1)];
|
|
212988
|
+
return primitive;
|
|
212989
|
+
}
|
|
212990
|
+
static clone(target) {
|
|
212991
|
+
const context = new TransferWithSplitArcs();
|
|
212992
|
+
target.announceToCurveProcessor(context);
|
|
212993
|
+
return context._result;
|
|
212994
|
+
}
|
|
212995
|
+
}
|
|
212996
|
+
|
|
212997
|
+
|
|
212826
212998
|
/***/ }),
|
|
212827
212999
|
|
|
212828
213000
|
/***/ "../../core/geometry/lib/esm/curve/internalContexts/TransformInPlaceContext.js":
|
|
@@ -216320,8 +216492,10 @@ class AngleSweep {
|
|
|
216320
216492
|
* @param fraction fraction of the sweep.
|
|
216321
216493
|
* @param radians0 start angle of sweep (in radians).
|
|
216322
216494
|
* @param radians1 end angle of sweep (in radians).
|
|
216323
|
-
* @param toNegativeFraction
|
|
216324
|
-
*
|
|
216495
|
+
* @param toNegativeFraction exterior fraction handling:
|
|
216496
|
+
* * if true, return `fraction` period-shifted to within one period of the start
|
|
216497
|
+
* * if false, return `fraction` period-shifted to within one period of the end
|
|
216498
|
+
* * if undefined, return the period-shift of `fraction` closest to [0,1].
|
|
216325
216499
|
* @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is
|
|
216326
216500
|
* returned unchanged.
|
|
216327
216501
|
*/
|
|
@@ -216335,16 +216509,25 @@ class AngleSweep {
|
|
|
216335
216509
|
fraction = fraction % period; // period-shifted equivalent fraction closest to 0 with same sign as fraction
|
|
216336
216510
|
if (fraction + period < 1)
|
|
216337
216511
|
fraction += period; // it's really an interior fraction
|
|
216338
|
-
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isIn01(fraction)
|
|
216512
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isIn01(fraction))
|
|
216339
216513
|
return fraction;
|
|
216340
|
-
|
|
216514
|
+
if (toNegativeFraction === true)
|
|
216515
|
+
return fraction < 0 ? fraction : fraction - period;
|
|
216516
|
+
if (toNegativeFraction === false)
|
|
216517
|
+
return fraction > 1 ? fraction : fraction + period;
|
|
216518
|
+
const fractionDistFrom01 = fraction < 0 ? -fraction : fraction - 1;
|
|
216519
|
+
const fraction2 = fraction < 0 ? fraction + period : fraction - period; // period-shift with opposite sign
|
|
216520
|
+
const fraction2DistFrom01 = fraction2 < 0 ? -fraction2 : fraction2 - 1;
|
|
216521
|
+
return fractionDistFrom01 < fraction2DistFrom01 ? fraction : fraction2; // choose the period-shift closer to [0,1]
|
|
216341
216522
|
}
|
|
216342
216523
|
/**
|
|
216343
216524
|
* Convert a sweep fraction to the equivalent period-shifted fraction inside this sweep, or within one period of
|
|
216344
216525
|
* zero on the desired side.
|
|
216345
216526
|
* @param fraction fraction of the sweep.
|
|
216346
|
-
* @param toNegativeFraction
|
|
216347
|
-
*
|
|
216527
|
+
* @param toNegativeFraction exterior fraction handling:
|
|
216528
|
+
* * if true, return `fraction` period-shifted to within one period of the start
|
|
216529
|
+
* * if false, return `fraction` period-shifted to within one period of the end
|
|
216530
|
+
* * if undefined, return the period-shift of `fraction` closest to [0,1].
|
|
216348
216531
|
* @returns period-shifted fraction. If `fraction` is already in [0,1], or the sweep is empty, then `fraction` is
|
|
216349
216532
|
* returned unchanged.
|
|
216350
216533
|
*/
|
|
@@ -229233,9 +229416,9 @@ class Vector3d extends XYZ {
|
|
|
229233
229416
|
if (dot < 0.0 && !oppositeIsParallel)
|
|
229234
229417
|
return false;
|
|
229235
229418
|
const cross2 = this.crossProductMagnitudeSquared(other);
|
|
229236
|
-
|
|
229237
|
-
|
|
229238
|
-
|
|
229419
|
+
// a2,b2,cross2 are squared lengths of respective vectors
|
|
229420
|
+
// cross2 = sin^2(theta) * a2 * b2
|
|
229421
|
+
// For small theta, sin^2(theta) ~ theta^2
|
|
229239
229422
|
return cross2 <= radianSquaredTol * a2 * b2;
|
|
229240
229423
|
}
|
|
229241
229424
|
/**
|
|
@@ -231230,26 +231413,28 @@ class PolygonOps {
|
|
|
231230
231413
|
return s;
|
|
231231
231414
|
}
|
|
231232
231415
|
/**
|
|
231233
|
-
* Return a Ray3d with
|
|
231234
|
-
* * `origin`
|
|
231235
|
-
* * `direction` is
|
|
231236
|
-
* * `a` is the area.
|
|
231237
|
-
* @param points
|
|
231416
|
+
* Return a [[Ray3d]] with:
|
|
231417
|
+
* * `origin` is the centroid of the polygon,
|
|
231418
|
+
* * `direction` is a unit vector perpendicular to the polygon plane,
|
|
231419
|
+
* * `a` is the polygon area.
|
|
231420
|
+
* @param points the polygon vertices in order. Points can lie in any plane. First and last point do not have to be equal.
|
|
231421
|
+
* @param result optional pre-allocated result to populate and return.
|
|
231238
231422
|
*/
|
|
231239
|
-
static centroidAreaNormal(points) {
|
|
231423
|
+
static centroidAreaNormal(points, result) {
|
|
231240
231424
|
if (Array.isArray(points)) {
|
|
231241
231425
|
const carrier = new _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_5__.Point3dArrayCarrier(points);
|
|
231242
|
-
return this.centroidAreaNormal(carrier);
|
|
231426
|
+
return this.centroidAreaNormal(carrier, result);
|
|
231243
231427
|
}
|
|
231244
231428
|
const n = points.length;
|
|
231245
231429
|
if (n === 3) {
|
|
231246
|
-
const normal = points.crossProductIndexIndexIndex(0, 1, 2);
|
|
231430
|
+
const normal = points.crossProductIndexIndexIndex(0, 1, 2, result?.direction);
|
|
231247
231431
|
const a = 0.5 * normal.magnitude();
|
|
231248
|
-
const centroid = points.getPoint3dAtCheckedPointIndex(0);
|
|
231432
|
+
const centroid = points.getPoint3dAtCheckedPointIndex(0, result?.origin);
|
|
231249
231433
|
points.accumulateScaledXYZ(1, 1.0, centroid);
|
|
231250
231434
|
points.accumulateScaledXYZ(2, 1.0, centroid);
|
|
231251
231435
|
centroid.scaleInPlace(1.0 / 3.0);
|
|
231252
|
-
|
|
231436
|
+
if (!result)
|
|
231437
|
+
result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
|
|
231253
231438
|
if (result.tryNormalizeInPlaceWithAreaWeight(a))
|
|
231254
231439
|
return result;
|
|
231255
231440
|
return undefined;
|
|
@@ -231267,22 +231452,24 @@ class PolygonOps {
|
|
|
231267
231452
|
points.vectorXYAndZIndex(origin, 1, vector0);
|
|
231268
231453
|
let cross = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
231269
231454
|
const centroidSum = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
|
|
231270
|
-
const
|
|
231455
|
+
const normal = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero(result?.direction);
|
|
231271
231456
|
let signedTriangleArea;
|
|
231272
|
-
// This will work with or without closure edge.
|
|
231457
|
+
// This will work with or without closure edge. If closure is given, the last vector is 000.
|
|
231273
231458
|
for (let i = 2; i < n; i++) {
|
|
231274
231459
|
points.vectorXYAndZIndex(origin, i, vector1);
|
|
231275
231460
|
cross = vector0.crossProduct(vector1, cross);
|
|
231276
231461
|
signedTriangleArea = areaNormal.dotProduct(cross); // well, actually twice the area.
|
|
231277
|
-
|
|
231462
|
+
normal.addInPlace(cross); // this grows to twice the area
|
|
231278
231463
|
const b = signedTriangleArea / 6.0;
|
|
231279
231464
|
centroidSum.plus2Scaled(vector0, b, vector1, b, centroidSum);
|
|
231280
231465
|
vector0.setFrom(vector1);
|
|
231281
231466
|
}
|
|
231282
|
-
const area = 0.5 *
|
|
231467
|
+
const area = 0.5 * normal.magnitude();
|
|
231283
231468
|
const inverseArea = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.conditionalDivideFraction(1, area);
|
|
231284
231469
|
if (inverseArea !== undefined) {
|
|
231285
|
-
const
|
|
231470
|
+
const centroid = origin.plusScaled(centroidSum, inverseArea, result?.origin);
|
|
231471
|
+
if (!result)
|
|
231472
|
+
result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
|
|
231286
231473
|
result.tryNormalizeInPlaceWithAreaWeight(area);
|
|
231287
231474
|
return result;
|
|
231288
231475
|
}
|
|
@@ -238307,19 +238494,19 @@ class Matrix4d {
|
|
|
238307
238494
|
this._coffs[15] += scale * beta;
|
|
238308
238495
|
}
|
|
238309
238496
|
/**
|
|
238310
|
-
* Multiply and replace contents of this matrix by A*this*AT where
|
|
238311
|
-
* * A is a pure translation with final column [x,y,z,1]
|
|
238312
|
-
* * this is this matrix.
|
|
238313
|
-
* * AT is the transpose of A.
|
|
238314
|
-
* @param ax x part of translation
|
|
238315
|
-
* @param ay y part of translation
|
|
238316
|
-
* @param az z part of translation
|
|
238497
|
+
* Multiply and replace contents of ` this` matrix by `A*this*AT` where
|
|
238498
|
+
* * `A` is a pure translation with final column [x,y,z,1].
|
|
238499
|
+
* * `this` is this matrix.
|
|
238500
|
+
* * `AT` is the transpose of A.
|
|
238501
|
+
* @param ax x part of translation.
|
|
238502
|
+
* @param ay y part of translation.
|
|
238503
|
+
* @param az z part of translation.
|
|
238317
238504
|
*/
|
|
238318
238505
|
multiplyTranslationSandwichInPlace(ax, ay, az) {
|
|
238319
238506
|
const bx = this._coffs[3];
|
|
238320
238507
|
const by = this._coffs[7];
|
|
238321
238508
|
const bz = this._coffs[11];
|
|
238322
|
-
// matrixB can be non-symmetric
|
|
238509
|
+
// matrixB can be non-symmetric
|
|
238323
238510
|
const cx = this._coffs[12];
|
|
238324
238511
|
const cy = this._coffs[13];
|
|
238325
238512
|
const cz = this._coffs[14];
|
|
@@ -238342,7 +238529,7 @@ class Matrix4d {
|
|
|
238342
238529
|
this._coffs[12] += axBeta;
|
|
238343
238530
|
this._coffs[13] += ayBeta;
|
|
238344
238531
|
this._coffs[14] += azBeta;
|
|
238345
|
-
// coffs[15] is unchanged
|
|
238532
|
+
// coffs[15] is unchanged
|
|
238346
238533
|
}
|
|
238347
238534
|
}
|
|
238348
238535
|
|
|
@@ -238393,8 +238580,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
238393
238580
|
* * e.g. entry 03 is summed x.
|
|
238394
238581
|
* * In this level:
|
|
238395
238582
|
* * the `absoluteQuantity` member is undefined.
|
|
238396
|
-
* * the `localToWorldMap` and `radiiOfGyration` are created
|
|
238397
|
-
* * Second level: after a call to inertiaProductsToPrincipalAxes
|
|
238583
|
+
* * the `localToWorldMap` and `radiiOfGyration` are created but have undefined contents.
|
|
238584
|
+
* * Second level: after a call to `inertiaProductsToPrincipalAxes`, the `localToWorldMap`, `absoluteQuantity` and
|
|
238398
238585
|
* `radiiOfGyration` are filled in.
|
|
238399
238586
|
* @public
|
|
238400
238587
|
*/
|
|
@@ -238414,18 +238601,35 @@ class MomentData {
|
|
|
238414
238601
|
* * This set up with its inverse already constructed.
|
|
238415
238602
|
*/
|
|
238416
238603
|
localToWorldMap;
|
|
238604
|
+
/** Radii of gyration (square roots of principal second moments). */
|
|
238605
|
+
radiusOfGyration;
|
|
238606
|
+
/**
|
|
238607
|
+
* Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
|
|
238608
|
+
* inertiaProductsToPrincipalAxes.
|
|
238609
|
+
*/
|
|
238610
|
+
absoluteQuantity;
|
|
238417
238611
|
// private variables
|
|
238418
238612
|
static _vectorA;
|
|
238419
238613
|
static _vectorB;
|
|
238420
238614
|
static _vectorC;
|
|
238421
238615
|
_point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
238422
238616
|
_point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
238617
|
+
/** Constructor. */
|
|
238618
|
+
constructor() {
|
|
238619
|
+
this.origin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
|
|
238620
|
+
this.needOrigin = false;
|
|
238621
|
+
this.sums = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createZero();
|
|
238622
|
+
this.localToWorldMap = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity();
|
|
238623
|
+
this.radiusOfGyration = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
238624
|
+
this.absoluteQuantity = 0.1; // so optimizer sees its type
|
|
238625
|
+
this.absoluteQuantity = undefined;
|
|
238626
|
+
}
|
|
238423
238627
|
/**
|
|
238424
238628
|
* Return the lower-right (3,3) entry in the sums.
|
|
238425
238629
|
* * This is the quantity (i.e. length, area, or volume) summed.
|
|
238426
238630
|
*/
|
|
238427
238631
|
get quantitySum() {
|
|
238428
|
-
return this.sums.
|
|
238632
|
+
return this.sums.weight();
|
|
238429
238633
|
}
|
|
238430
238634
|
/**
|
|
238431
238635
|
* Return a scale factor to make these sums match the target orientation sign.
|
|
@@ -238456,23 +238660,6 @@ class MomentData {
|
|
|
238456
238660
|
this.needOrigin = false;
|
|
238457
238661
|
}
|
|
238458
238662
|
}
|
|
238459
|
-
/** Radii of gyration (square roots of principal second moments). */
|
|
238460
|
-
radiusOfGyration;
|
|
238461
|
-
/**
|
|
238462
|
-
* Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
|
|
238463
|
-
* inertiaProductsToPrincipalAxes.
|
|
238464
|
-
*/
|
|
238465
|
-
absoluteQuantity;
|
|
238466
|
-
/** Constructor. */
|
|
238467
|
-
constructor() {
|
|
238468
|
-
this.origin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
|
|
238469
|
-
this.sums = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createZero();
|
|
238470
|
-
this.localToWorldMap = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity();
|
|
238471
|
-
this.radiusOfGyration = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
238472
|
-
this.needOrigin = false;
|
|
238473
|
-
this.absoluteQuantity = 0.1; // so optimizer sees its type
|
|
238474
|
-
this.absoluteQuantity = undefined;
|
|
238475
|
-
}
|
|
238476
238663
|
/**
|
|
238477
238664
|
* Create moments with optional origin.
|
|
238478
238665
|
* * Origin and needOrigin are quirky.
|
|
@@ -238516,7 +238703,7 @@ class MomentData {
|
|
|
238516
238703
|
axes.setColumnsPoint4dXYZ(points[0], points[1], points[2]);
|
|
238517
238704
|
if (axes.determinant() < 0)
|
|
238518
238705
|
axes.scaleColumnsInPlace(-1.0, -1.0, -1.0);
|
|
238519
|
-
// prefer x and z positive
|
|
238706
|
+
// prefer x and z positive; y falls wherever
|
|
238520
238707
|
if (axes.at(0, 0) < 0.0)
|
|
238521
238708
|
axes.scaleColumnsInPlace(-1.0, -1.0, 1.0);
|
|
238522
238709
|
if (axes.at(2, 2) < 0.0)
|
|
@@ -238541,7 +238728,8 @@ class MomentData {
|
|
|
238541
238728
|
* * Hence x axis is long direction.
|
|
238542
238729
|
* * Hence planar data generates large moment as Z.
|
|
238543
238730
|
* @param origin The origin used for the inertia products.
|
|
238544
|
-
* @param inertiaProducts The inertia products: sums or integrals of
|
|
238731
|
+
* @param inertiaProducts The inertia products: sums or integrals of
|
|
238732
|
+
* [xx,xy,xz,xw; yx,yy,yz,yw; zx,zy,zz,zw; wx,wy,wz,w].
|
|
238545
238733
|
*/
|
|
238546
238734
|
static inertiaProductsToPrincipalAxes(origin, inertiaProducts) {
|
|
238547
238735
|
const moments = new MomentData();
|
|
@@ -238585,23 +238773,21 @@ class MomentData {
|
|
|
238585
238773
|
*/
|
|
238586
238774
|
static areEquivalentPrincipalAxes(dataA, dataB) {
|
|
238587
238775
|
if (dataA && dataB
|
|
238588
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { //
|
|
238776
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { // TODO: need different tolerance for area, volume?
|
|
238589
238777
|
if (dataA.localToWorldMap.getOrigin().isAlmostEqual(dataB.localToWorldMap.getOrigin())
|
|
238590
238778
|
&& dataA.radiusOfGyration.isAlmostEqual(dataB.radiusOfGyration)) {
|
|
238591
238779
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.y)) {
|
|
238592
|
-
//
|
|
238780
|
+
// we have at least xy symmetry
|
|
238593
238781
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.z))
|
|
238594
238782
|
return true;
|
|
238595
|
-
// just xy
|
|
238596
|
-
// allow opposite z directions.
|
|
238597
|
-
// If the z's are aligned, x an dy can spin freely.
|
|
238783
|
+
// just xy; allow opposite z directions; if the z's are aligned, x and y can spin freely
|
|
238598
238784
|
const zA = dataA.localToWorldMap.matrix.columnZ();
|
|
238599
238785
|
const zB = dataB.localToWorldMap.matrix.columnZ();
|
|
238600
238786
|
if (zA.isParallelTo(zB, true))
|
|
238601
238787
|
return true;
|
|
238602
238788
|
return false;
|
|
238603
238789
|
}
|
|
238604
|
-
// no symmetry
|
|
238790
|
+
// no symmetry; test all three axes
|
|
238605
238791
|
const vectorA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
238606
238792
|
const vectorB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
238607
238793
|
for (let i = 0; i < 3; i++) {
|
|
@@ -238631,7 +238817,7 @@ class MomentData {
|
|
|
238631
238817
|
}
|
|
238632
238818
|
/** Revise the accumulated sums to be "around the centroid". */
|
|
238633
238819
|
shiftOriginAndSumsToCentroidOfSums() {
|
|
238634
|
-
const xyz = this.sums.columnW().realPoint();
|
|
238820
|
+
const xyz = this.sums.columnW().realPoint(); // centroid of the geometry
|
|
238635
238821
|
if (xyz) {
|
|
238636
238822
|
this.shiftOriginAndSumsByXYZ(xyz.x, xyz.y, xyz.z);
|
|
238637
238823
|
return true;
|
|
@@ -238640,9 +238826,9 @@ class MomentData {
|
|
|
238640
238826
|
}
|
|
238641
238827
|
/**
|
|
238642
238828
|
* Revise the accumulated sums.
|
|
238643
|
-
* *
|
|
238644
|
-
* *
|
|
238645
|
-
|
|
238829
|
+
* * Add (ax,ay,az) to the origin coordinates.
|
|
238830
|
+
* * Apply the negative translation to the sums.
|
|
238831
|
+
*/
|
|
238646
238832
|
shiftOriginAndSumsByXYZ(ax, ay, az) {
|
|
238647
238833
|
this.origin.addXYZInPlace(ax, ay, az);
|
|
238648
238834
|
this.sums.multiplyTranslationSandwichInPlace(-ax, -ay, -az);
|
|
@@ -238652,23 +238838,24 @@ class MomentData {
|
|
|
238652
238838
|
this.shiftOriginAndSumsByXYZ(newOrigin.x - this.origin.x, newOrigin.y - this.origin.y, newOrigin.z - this.origin.z);
|
|
238653
238839
|
}
|
|
238654
238840
|
/**
|
|
238655
|
-
* Compute moments of a triangle from the origin
|
|
238656
|
-
*
|
|
238657
|
-
* * If `pointA` is undefined, use `this.origin` as pointA
|
|
238658
|
-
|
|
238659
|
-
*/
|
|
238841
|
+
* Compute moments of a triangle from the origin. Accumulate them to `this.sums`.
|
|
238842
|
+
* * If `this.needOrigin` is set, `this.origin` is set to `pointB`.
|
|
238843
|
+
* * If `pointA` is undefined, use `this.origin` as `pointA`.
|
|
238844
|
+
*/
|
|
238660
238845
|
accumulateTriangleMomentsXY(pointA, pointB, pointC) {
|
|
238661
238846
|
this.setOriginXYZIfNeeded(pointB.x, pointB.y, 0.0);
|
|
238662
238847
|
const x0 = this.origin.x;
|
|
238663
238848
|
const y0 = this.origin.y;
|
|
238664
|
-
const vectorA = MomentData._vectorA =
|
|
238665
|
-
|
|
238666
|
-
|
|
238849
|
+
const vectorA = MomentData._vectorA = (pointA !== undefined) ?
|
|
238850
|
+
_Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointA.x - x0, pointA.y - y0, 0.0, 1.0, MomentData._vectorA) :
|
|
238851
|
+
_Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(0.0, 0.0, 0.0, 1.0, MomentData._vectorA);
|
|
238667
238852
|
const vectorB = MomentData._vectorB = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointB.x - x0, pointB.y - y0, 0.0, 1.0, MomentData._vectorB);
|
|
238668
238853
|
const vectorC = MomentData._vectorC = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointC.x - x0, pointC.y - y0, 0.0, 1.0, MomentData._vectorC);
|
|
238669
|
-
//
|
|
238670
|
-
//
|
|
238671
|
-
//
|
|
238854
|
+
// Below we calculate 16 double integrals: \iint_T [x y 0 1]^ [x y 0 1] dT over triangle T=(A,B,C).
|
|
238855
|
+
// Each accumulates contributions from 9 scaled outer products. Integration computations use the barycentric
|
|
238856
|
+
// change of variables [B-A C-A][u,v]^ = [x,y]^ with Jacobian detJ = B-A x C-A = twice the area of T.
|
|
238857
|
+
// This converts the integration domain from T to the triangle bounded by u=0, v=0 and v=1-u, yielding e.g.,
|
|
238858
|
+
// \iint_T x^2 dT = detJ \int_0^1 \int_0^{1-u} u^2 dv du = detJ / 12, and similarly \iint_T xy dT = detJ / 24.
|
|
238672
238859
|
const detJ = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.crossProductXYXY(vectorB.x - vectorA.x, vectorB.y - vectorA.y, vectorC.x - vectorA.x, vectorC.y - vectorA.y);
|
|
238673
238860
|
if (detJ !== 0.0) {
|
|
238674
238861
|
const r1_12 = detJ / 12.0;
|
|
@@ -238684,7 +238871,7 @@ class MomentData {
|
|
|
238684
238871
|
this.sums.addScaledOuterProductInPlace(vectorC, vectorC, r1_12);
|
|
238685
238872
|
}
|
|
238686
238873
|
}
|
|
238687
|
-
/** Add scaled outer product of (4d, unit weight) point to this.sums
|
|
238874
|
+
/** Add scaled outer product of (4d, unit weight) point to `this.sums`. */
|
|
238688
238875
|
accumulateScaledOuterProduct(point, scaleFactor) {
|
|
238689
238876
|
this.setOriginXYZIfNeeded(point.x, point.y, 0.0);
|
|
238690
238877
|
const vectorA = MomentData._vectorA = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(point.x - this.origin.x, point.y - this.origin.y, point.z - this.origin.z, 1.0, MomentData._vectorA);
|
|
@@ -238707,16 +238894,15 @@ class MomentData {
|
|
|
238707
238894
|
this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_3);
|
|
238708
238895
|
}
|
|
238709
238896
|
/**
|
|
238710
|
-
* Compute moments of triangles from a base point to the given linestring.
|
|
238711
|
-
*
|
|
238712
|
-
* * If `
|
|
238713
|
-
* * If `this.needOrigin` is set, the first point of the array is captured as local origin for subsequent sums.
|
|
238714
|
-
*
|
|
238897
|
+
* Compute moments of triangles from a base point to the given linestring. Accumulate them to `this.sums`.
|
|
238898
|
+
* * If `this.needOrigin` is set, `this.origin` is set to the first point of the array.
|
|
238899
|
+
* * If `sweepBase` is undefined, use `this.origin` as `sweepBase`.
|
|
238715
238900
|
*/
|
|
238716
238901
|
accumulateTriangleToLineStringMomentsXY(sweepBase, points) {
|
|
238717
238902
|
const n = points.length;
|
|
238718
238903
|
if (n > 1) {
|
|
238719
238904
|
points.getPoint3dAtUncheckedPointIndex(0, this._point0);
|
|
238905
|
+
// The linestring forms a polygon with sweepBase. Integrate over this polygon using Shoelace algorithm.
|
|
238720
238906
|
for (let i = 1; i < n; i++) {
|
|
238721
238907
|
points.getPoint3dAtUncheckedPointIndex(i, this._point1);
|
|
238722
238908
|
this.accumulateTriangleMomentsXY(sweepBase, this._point0, this._point1);
|
|
@@ -238725,17 +238911,17 @@ class MomentData {
|
|
|
238725
238911
|
}
|
|
238726
238912
|
}
|
|
238727
238913
|
/**
|
|
238728
|
-
*
|
|
238729
|
-
* * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin].
|
|
238730
|
-
* parts of vectors).
|
|
238731
|
-
* *
|
|
238914
|
+
* Assemble XX, YY, XY products into a full matrix form [xx,xy,0,0; xy,yy,0,0; 0,0,0,0; 0,0,0,1].
|
|
238915
|
+
* * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin].
|
|
238916
|
+
* (column weights 0001; only xy parts of vectors).
|
|
238917
|
+
* * Scale by detJ for the xy-only determinant of the vectors.
|
|
238732
238918
|
* @param productXX
|
|
238733
238919
|
* @param productXY
|
|
238734
238920
|
* @param productYY
|
|
238735
|
-
* @param area
|
|
238736
|
-
* @param origin
|
|
238737
|
-
* @param vectorU
|
|
238738
|
-
* @param vectorV
|
|
238921
|
+
* @param area area in caller's system.
|
|
238922
|
+
* @param origin caller's origin.
|
|
238923
|
+
* @param vectorU caller's U axis (not necessarily unit).
|
|
238924
|
+
* @param vectorV caller's V axis (not necessarily unit).
|
|
238739
238925
|
*/
|
|
238740
238926
|
accumulateXYProductsInCentroidalFrame(productXX, productXY, productYY, area, origin, vectorU, vectorV) {
|
|
238741
238927
|
const centroidalProducts = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createRowValues(productXX, productXY, 0, 0, productXY, productYY, 0, 0, 0, 0, 0, 0, 0, 0, 0, area);
|
|
@@ -239048,8 +239234,7 @@ class Point4d extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
|
|
|
239048
239234
|
distanceSquaredXYZW(other) {
|
|
239049
239235
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseSquaredXYZW(other.xyzw[0] - this.xyzw[0], other.xyzw[1] - this.xyzw[1], other.xyzw[2] - this.xyzw[2], other.xyzw[3] - this.xyzw[3]);
|
|
239050
239236
|
}
|
|
239051
|
-
/** Return the distance between the instance and other after normalizing by weights
|
|
239052
|
-
*/
|
|
239237
|
+
/** Return the xy distance between the instance and `other` after normalizing by weights */
|
|
239053
239238
|
realDistanceXY(other) {
|
|
239054
239239
|
const wA = this.w;
|
|
239055
239240
|
const wB = other.w;
|
|
@@ -239057,6 +239242,14 @@ class Point4d extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
|
|
|
239057
239242
|
return undefined;
|
|
239058
239243
|
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);
|
|
239059
239244
|
}
|
|
239245
|
+
/** Return the xy squared distance between the instance and `other` after normalizing by weights */
|
|
239246
|
+
realDistanceSquaredXY(other) {
|
|
239247
|
+
const wA = this.w;
|
|
239248
|
+
const wB = other.w;
|
|
239249
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSmallMetricDistance(wA) || _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSmallMetricDistance(wB))
|
|
239250
|
+
return undefined;
|
|
239251
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseSquaredXY(other.xyzw[0] / wB - this.xyzw[0] / wA, other.xyzw[1] / wB - this.xyzw[1] / wA);
|
|
239252
|
+
}
|
|
239060
239253
|
/** Return the largest absolute distance between corresponding components
|
|
239061
239254
|
* * x,y,z,w all participate without normalization.
|
|
239062
239255
|
*/
|
|
@@ -247422,7 +247615,7 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
247422
247615
|
*/
|
|
247423
247616
|
class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {
|
|
247424
247617
|
_facetIndices;
|
|
247425
|
-
_currentSubsetIndex; // index within _facetIndices
|
|
247618
|
+
_currentSubsetIndex; // index within _facetIndices
|
|
247426
247619
|
_nextSubsetIndex; // index within _facetIndices
|
|
247427
247620
|
constructor(polyface, facetIndices, numWrap) {
|
|
247428
247621
|
super(polyface, numWrap);
|
|
@@ -313019,7 +313212,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
313019
313212
|
/***/ ((module) => {
|
|
313020
313213
|
|
|
313021
313214
|
"use strict";
|
|
313022
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.
|
|
313215
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.0.0-dev.116","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:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"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/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"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"}}');
|
|
313023
313216
|
|
|
313024
313217
|
/***/ })
|
|
313025
313218
|
|