@itwin/ecschema-rpcinterface-tests 5.1.0-dev.1 → 5.1.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dist/bundled-tests.js +463 -296
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -38986,6 +38986,20 @@ var RenderSchedule;
|
|
|
38986
38986
|
get maxBatchId() {
|
|
38987
38987
|
return this._maxBatchId ?? (this._maxBatchId = this.modelTimelines.reduce((accum, timeline) => Math.max(accum, timeline.maxBatchId), 0));
|
|
38988
38988
|
}
|
|
38989
|
+
/**
|
|
38990
|
+
* Replaces all elementIds in a ScriptProps object with an empty string. Returns modified ScriptProps.
|
|
38991
|
+
* @param scheduleScript The script props to modify.
|
|
38992
|
+
* @internal */
|
|
38993
|
+
static removeScheduleScriptElementIds(scheduleScript) {
|
|
38994
|
+
scheduleScript.forEach((modelTimeline) => {
|
|
38995
|
+
modelTimeline.elementTimelines.forEach((elementTimeline) => {
|
|
38996
|
+
if (elementTimeline.elementIds) {
|
|
38997
|
+
elementTimeline.elementIds = "";
|
|
38998
|
+
}
|
|
38999
|
+
});
|
|
39000
|
+
});
|
|
39001
|
+
return scheduleScript;
|
|
39002
|
+
}
|
|
38989
39003
|
}
|
|
38990
39004
|
RenderSchedule.Script = Script;
|
|
38991
39005
|
/** A reference to a [[RenderSchedule.Script]], optionally identifying the source of the script.
|
|
@@ -72013,20 +72027,16 @@ class ECSchemaRpcLocater {
|
|
|
72013
72027
|
return undefined;
|
|
72014
72028
|
}
|
|
72015
72029
|
/**
|
|
72016
|
-
*
|
|
72017
|
-
*
|
|
72018
|
-
* @param
|
|
72019
|
-
* @param
|
|
72030
|
+
* This method is not supported for locating schemas over RPC/HTTP.
|
|
72031
|
+
* Use the asynchronous `getSchema` method instead.
|
|
72032
|
+
* @param _schemaKey Key to look up
|
|
72033
|
+
* @param _matchType How to match key against candidate schemas
|
|
72034
|
+
* @param _context The SchemaContext that will control the lifetime of the schema and holds the schema's references, if they exist.
|
|
72035
|
+
* @throws Error Always throws an error indicating this method is not supported.
|
|
72036
|
+
* @deprecated in 5.0 Use the asynchronous `getSchema` method for schema retrieval.
|
|
72020
72037
|
*/
|
|
72021
|
-
getSchemaSync(
|
|
72022
|
-
|
|
72023
|
-
return props;
|
|
72024
|
-
});
|
|
72025
|
-
const schema = _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__.Schema.fromJsonSync(schemaJson, context || new _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_0__.SchemaContext());
|
|
72026
|
-
if (schema !== undefined && schema.schemaKey.matches(schemaKey, matchType)) {
|
|
72027
|
-
return schema;
|
|
72028
|
-
}
|
|
72029
|
-
return undefined;
|
|
72038
|
+
getSchemaSync(_schemaKey, _matchType, _context) {
|
|
72039
|
+
throw new Error("getSchemaSync is not supported. Use the asynchronous getSchema method instead.");
|
|
72030
72040
|
}
|
|
72031
72041
|
}
|
|
72032
72042
|
|
|
@@ -74241,6 +74251,8 @@ class AccuDraw {
|
|
|
74241
74251
|
onFieldKeyinStatusChange(_index) { }
|
|
74242
74252
|
/** Called to request focus change to the specified input field */
|
|
74243
74253
|
setFocusItem(_index) { }
|
|
74254
|
+
/** Called to get the item field that currently has input focus */
|
|
74255
|
+
getFocusItem() { return undefined; }
|
|
74244
74256
|
static getMinPolarMag(origin) {
|
|
74245
74257
|
return (1.0e-12 * (1.0 + origin.magnitude()));
|
|
74246
74258
|
}
|
|
@@ -84141,6 +84153,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
84141
84153
|
/* harmony import */ var _ViewState__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ViewState */ "../../core/frontend/lib/esm/ViewState.js");
|
|
84142
84154
|
/* harmony import */ var _common_internal_Symbols__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./common/internal/Symbols */ "../../core/frontend/lib/esm/common/internal/Symbols.js");
|
|
84143
84155
|
/* harmony import */ var _IpcApp__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./IpcApp */ "../../core/frontend/lib/esm/IpcApp.js");
|
|
84156
|
+
/* harmony import */ var _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @itwin/ecschema-metadata */ "../../core/ecschema-metadata/lib/esm/ecschema-metadata.js");
|
|
84157
|
+
/* harmony import */ var _itwin_ecschema_rpcinterface_common__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @itwin/ecschema-rpcinterface-common */ "../../core/ecschema-rpc/common/lib/esm/ecschema-rpc-interface.js");
|
|
84144
84158
|
/*---------------------------------------------------------------------------------------------
|
|
84145
84159
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
84146
84160
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -84163,6 +84177,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
84163
84177
|
|
|
84164
84178
|
|
|
84165
84179
|
|
|
84180
|
+
|
|
84181
|
+
|
|
84166
84182
|
const loggerCategory = _common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_3__.FrontendLoggerCategory.IModelConnection;
|
|
84167
84183
|
/** A connection to a [IModelDb]($backend) hosted on the backend.
|
|
84168
84184
|
* @public
|
|
@@ -84245,6 +84261,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
|
|
|
84245
84261
|
* @deprecated in 5.0.0. If you need font Ids on the front-end for some reason, write an Ipc method that queries [IModelDb.fonts]($backend).
|
|
84246
84262
|
*/
|
|
84247
84263
|
fontMap; // eslint-disable-line @typescript-eslint/no-deprecated
|
|
84264
|
+
_schemaContext;
|
|
84248
84265
|
/** Load the FontMap for this IModelConnection.
|
|
84249
84266
|
* @returns Returns a Promise<FontMap> that is fulfilled when the FontMap member of this IModelConnection is valid.
|
|
84250
84267
|
* @deprecated in 5.0.0. If you need font Ids on the front-end for some reason, write an Ipc method that queries [IModelDb.fonts]($backend).
|
|
@@ -84633,6 +84650,24 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
|
|
|
84633
84650
|
}
|
|
84634
84651
|
return ("number" === typeof this._projectCenterAltitude) ? this._projectCenterAltitude : undefined;
|
|
84635
84652
|
}
|
|
84653
|
+
/**
|
|
84654
|
+
* Gets the context that allows accessing the metadata (see `@itwin/ecschema-metadata` package) of this iModel.
|
|
84655
|
+
* The context is created lazily when this property is accessed for the first time, with an `ECSchemaRpcLocater` registered as a fallback locater, enabling users to register their own locater that'd take more priority.
|
|
84656
|
+
* This means to correctly access schema context, client-side applications must register `ECSchemaRpcInterface` following instructions for [RPC configuration]($docs/learning/rpcinterface/#client-side-configuration).
|
|
84657
|
+
* Server-side applications would also [configure RPC]($docs/learning/rpcinterface/#server-side-configuration) as needed.
|
|
84658
|
+
*
|
|
84659
|
+
* @note While a `BlankConnection` returns a valid `schemaContext`, it has an invalid locater registered by default, and will throw an error when trying to call it's methods.
|
|
84660
|
+
* @beta
|
|
84661
|
+
*/
|
|
84662
|
+
get schemaContext() {
|
|
84663
|
+
if (this._schemaContext === undefined) {
|
|
84664
|
+
const context = new _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_15__.SchemaContext();
|
|
84665
|
+
const locater = new _itwin_ecschema_rpcinterface_common__WEBPACK_IMPORTED_MODULE_16__.ECSchemaRpcLocater(this._getRpcProps());
|
|
84666
|
+
context.addFallbackLocater(locater);
|
|
84667
|
+
this._schemaContext = context;
|
|
84668
|
+
}
|
|
84669
|
+
return this._schemaContext;
|
|
84670
|
+
}
|
|
84636
84671
|
}
|
|
84637
84672
|
/** A connection that exists without an iModel. Useful for connecting to Reality Data services.
|
|
84638
84673
|
* @note This class exists because our display system requires an IModelConnection type even if only reality data is drawn.
|
|
@@ -91605,16 +91640,21 @@ class RenderContext {
|
|
|
91605
91640
|
* @public
|
|
91606
91641
|
*/
|
|
91607
91642
|
class DynamicsContext extends RenderContext {
|
|
91608
|
-
|
|
91643
|
+
_foreground;
|
|
91644
|
+
_overlay;
|
|
91609
91645
|
/** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]]. */
|
|
91610
91646
|
addGraphic(graphic) {
|
|
91611
|
-
|
|
91612
|
-
|
|
91613
|
-
|
|
91647
|
+
this.add(graphic, false);
|
|
91648
|
+
}
|
|
91649
|
+
/** @internal */
|
|
91650
|
+
add(graphic, isOverlay) {
|
|
91651
|
+
const key = isOverlay ? "_overlay" : "_foreground";
|
|
91652
|
+
const list = this[key] ?? (this[key] = []);
|
|
91653
|
+
list.push(graphic);
|
|
91614
91654
|
}
|
|
91615
91655
|
/** @internal */
|
|
91616
91656
|
changeDynamics() {
|
|
91617
|
-
this.viewport.changeDynamics(this.
|
|
91657
|
+
this.viewport.changeDynamics(this._foreground, this._overlay);
|
|
91618
91658
|
}
|
|
91619
91659
|
/** Create a builder for producing a [[RenderGraphic]] appropriate for rendering within this context's [[Viewport]].
|
|
91620
91660
|
* @param options Options describing how to create the builder.
|
|
@@ -92718,10 +92758,10 @@ class ViewManager {
|
|
|
92718
92758
|
this.inDynamicsMode = false;
|
|
92719
92759
|
const cursorVp = _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.toolAdmin.cursorView;
|
|
92720
92760
|
if (cursorVp)
|
|
92721
|
-
cursorVp.changeDynamics(undefined);
|
|
92761
|
+
cursorVp.changeDynamics(undefined, undefined);
|
|
92722
92762
|
for (const vp of this._viewports) {
|
|
92723
92763
|
if (vp !== cursorVp)
|
|
92724
|
-
vp.changeDynamics(undefined);
|
|
92764
|
+
vp.changeDynamics(undefined, undefined);
|
|
92725
92765
|
}
|
|
92726
92766
|
}
|
|
92727
92767
|
/** @internal */
|
|
@@ -97019,8 +97059,8 @@ class Viewport {
|
|
|
97019
97059
|
return this.view.is3d() && this.view.isCameraOn;
|
|
97020
97060
|
}
|
|
97021
97061
|
/** @internal */
|
|
97022
|
-
changeDynamics(dynamics) {
|
|
97023
|
-
this.target.changeDynamics(dynamics);
|
|
97062
|
+
changeDynamics(dynamics, overlay) {
|
|
97063
|
+
this.target.changeDynamics(dynamics, overlay);
|
|
97024
97064
|
this.invalidateDecorations();
|
|
97025
97065
|
}
|
|
97026
97066
|
_assigningFlashedId = false;
|
|
@@ -108160,12 +108200,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
108160
108200
|
* @internal
|
|
108161
108201
|
*/
|
|
108162
108202
|
async function loadScript(jsUrl) {
|
|
108163
|
-
|
|
108164
|
-
// Webpack gives a warning:
|
|
108165
|
-
// "Critical dependency: the request of a dependency is an expression"
|
|
108166
|
-
// Because tsc transpiles "await import" to "require" (when compiled to is CommonJS).
|
|
108167
|
-
// So use FunctionConstructor to avoid tsc.
|
|
108168
|
-
const module = await Function("x", "return import(x)")(jsUrl);
|
|
108203
|
+
const module = await __webpack_require__("../../core/frontend/lib/esm/extension/providers lazy recursive")(jsUrl);
|
|
108169
108204
|
return execute(module);
|
|
108170
108205
|
}
|
|
108171
108206
|
/** attempts to execute an extension module */
|
|
@@ -108615,7 +108650,7 @@ var MockRender;
|
|
|
108615
108650
|
get analysisFraction() { return 0; }
|
|
108616
108651
|
set analysisFraction(_fraction) { }
|
|
108617
108652
|
changeScene(_scene) { }
|
|
108618
|
-
changeDynamics(
|
|
108653
|
+
changeDynamics(_foreground, _overlay) { }
|
|
108619
108654
|
changeDecorations(_decs) { }
|
|
108620
108655
|
changeRenderPlan(_plan) { }
|
|
108621
108656
|
drawFrame(_sceneTime) { }
|
|
@@ -117958,7 +117993,7 @@ class MeshGraphic extends _Graphic__WEBPACK_IMPORTED_MODULE_2__.Graphic {
|
|
|
117958
117993
|
}
|
|
117959
117994
|
unionRange(range) {
|
|
117960
117995
|
if (this._instances)
|
|
117961
|
-
range.extendRange(range);
|
|
117996
|
+
range.extendRange(this._instances.range);
|
|
117962
117997
|
else
|
|
117963
117998
|
range.extendRange(this._meshRange);
|
|
117964
117999
|
}
|
|
@@ -120705,9 +120740,8 @@ class RenderCommands {
|
|
|
120705
120740
|
this.addGraphics(gfx.foreground);
|
|
120706
120741
|
this.addBackgroundMapGraphics(gfx.background);
|
|
120707
120742
|
this.addOverlayGraphics(gfx.overlays);
|
|
120708
|
-
|
|
120709
|
-
|
|
120710
|
-
this.addDecorations(dynamics);
|
|
120743
|
+
this.addGraphics(gfx.foregroundDynamics);
|
|
120744
|
+
this.addOverlayGraphics(gfx.overlayDynamics);
|
|
120711
120745
|
const dec = gfx.decorations;
|
|
120712
120746
|
if (undefined !== dec) {
|
|
120713
120747
|
this.addBackground(dec.viewBackground);
|
|
@@ -127665,8 +127699,8 @@ class Target extends _render_RenderTarget__WEBPACK_IMPORTED_MODULE_7__.RenderTar
|
|
|
127665
127699
|
this.changeDrapesOrClassifiers(this._planarClassifiers, planarClassifiers);
|
|
127666
127700
|
this._planarClassifiers = planarClassifiers;
|
|
127667
127701
|
}
|
|
127668
|
-
changeDynamics(
|
|
127669
|
-
this.graphics.
|
|
127702
|
+
changeDynamics(foreground, overlay) {
|
|
127703
|
+
this.graphics.changeDynamics(foreground, overlay);
|
|
127670
127704
|
}
|
|
127671
127705
|
overrideFeatureSymbology(ovr) {
|
|
127672
127706
|
this.uniforms.branch.overrideFeatureSymbology(ovr);
|
|
@@ -128547,26 +128581,29 @@ class TargetGraphics {
|
|
|
128547
128581
|
foreground = [];
|
|
128548
128582
|
background = [];
|
|
128549
128583
|
overlays = [];
|
|
128550
|
-
|
|
128584
|
+
foregroundDynamics = [];
|
|
128585
|
+
overlayDynamics = [];
|
|
128551
128586
|
_decorations;
|
|
128552
128587
|
[Symbol.dispose]() {
|
|
128553
128588
|
this.foreground.length = this.background.length = this.overlays.length = 0;
|
|
128554
|
-
|
|
128589
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.disposeArray)(this.foregroundDynamics);
|
|
128590
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.disposeArray)(this.overlayDynamics);
|
|
128555
128591
|
this._decorations = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.dispose)(this._decorations);
|
|
128556
128592
|
}
|
|
128557
128593
|
get isDisposed() {
|
|
128558
128594
|
return 0 === this.foreground.length && 0 === this.background.length && 0 === this.overlays.length
|
|
128559
|
-
&&
|
|
128595
|
+
&& 0 === this.foregroundDynamics.length && 0 === this.overlayDynamics.length && !this._decorations;
|
|
128560
128596
|
}
|
|
128561
128597
|
changeScene(scene) {
|
|
128562
128598
|
this.foreground = scene.foreground;
|
|
128563
128599
|
this.background = scene.background;
|
|
128564
128600
|
this.overlays = scene.overlay;
|
|
128565
128601
|
}
|
|
128566
|
-
|
|
128567
|
-
|
|
128568
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.disposeArray)(this.
|
|
128569
|
-
this.
|
|
128602
|
+
changeDynamics(foreground, overlay) {
|
|
128603
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.disposeArray)(this.foregroundDynamics);
|
|
128604
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.disposeArray)(this.overlayDynamics);
|
|
128605
|
+
this.foregroundDynamics = foreground ?? [];
|
|
128606
|
+
this.overlayDynamics = overlay ?? [];
|
|
128570
128607
|
}
|
|
128571
128608
|
get decorations() { return this._decorations; }
|
|
128572
128609
|
set decorations(decorations) {
|
|
@@ -141101,6 +141138,7 @@ class GraphicsCollectorDrawArgs extends _tile_internal__WEBPACK_IMPORTED_MODULE_
|
|
|
141101
141138
|
return undefined;
|
|
141102
141139
|
return new GraphicsCollectorDrawArgs(planes, worldToViewMap, collector, args);
|
|
141103
141140
|
}
|
|
141141
|
+
get shouldCollectClassifierGraphics() { return false; }
|
|
141104
141142
|
}
|
|
141105
141143
|
|
|
141106
141144
|
|
|
@@ -141371,6 +141409,7 @@ class IModelTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_4__.Tile {
|
|
|
141371
141409
|
if (format !== _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileFormat.IModel)
|
|
141372
141410
|
return content;
|
|
141373
141411
|
const sizeMultiplier = this.hasSizeMultiplier ? this.sizeMultiplier : undefined;
|
|
141412
|
+
const ecefTransform = this.tree.iModel.isGeoLocated ? this.tree.iModel.getEcefTransform() : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
|
|
141374
141413
|
try {
|
|
141375
141414
|
content = await this.iModelTree.decoder.decode({
|
|
141376
141415
|
stream: streamBuffer,
|
|
@@ -141379,7 +141418,7 @@ class IModelTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_4__.Tile {
|
|
|
141379
141418
|
isCanceled,
|
|
141380
141419
|
sizeMultiplier,
|
|
141381
141420
|
tileData: {
|
|
141382
|
-
ecefTransform
|
|
141421
|
+
ecefTransform,
|
|
141383
141422
|
range: this.range,
|
|
141384
141423
|
layerClassifiers: this.tree.layerHandler?.layerClassifiers,
|
|
141385
141424
|
},
|
|
@@ -142088,7 +142127,8 @@ class IModelTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_6__.TileTre
|
|
|
142088
142127
|
draw(args) {
|
|
142089
142128
|
const tiles = this.selectTiles(args);
|
|
142090
142129
|
this._rootTile.draw(args, tiles, this._numStaticTilesSelected);
|
|
142091
|
-
|
|
142130
|
+
if (args.shouldCollectClassifierGraphics)
|
|
142131
|
+
this._layerHandler.collectClassifierGraphics(args, tiles);
|
|
142092
142132
|
}
|
|
142093
142133
|
prune() {
|
|
142094
142134
|
const olderThan = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.now().minus(this.expirationTime);
|
|
@@ -143220,14 +143260,20 @@ class LayerTileTreeReferenceHandler {
|
|
|
143220
143260
|
removals.push(context.viewport.displayStyle.settings.onMapImageryChanged.addListener((imagery) => {
|
|
143221
143261
|
this.setBaseLayerSettings(imagery.backgroundBase);
|
|
143222
143262
|
this.setLayerSettings(imagery.backgroundLayers);
|
|
143223
|
-
this.clearLayers();
|
|
143224
143263
|
}));
|
|
143225
143264
|
}
|
|
143226
143265
|
removals.push(context.viewport.onChangeView.addListener((vp, previousViewState) => {
|
|
143227
143266
|
if ((0,_tile_internal__WEBPACK_IMPORTED_MODULE_1__.compareMapLayer)(previousViewState, vp.view)) {
|
|
143228
143267
|
this.setBaseLayerSettings(mapImagery.backgroundBase);
|
|
143229
143268
|
this.setLayerSettings(mapImagery.backgroundLayers);
|
|
143230
|
-
|
|
143269
|
+
}
|
|
143270
|
+
}));
|
|
143271
|
+
removals.push(context.viewport.onViewedModelsChanged.addListener((viewport) => {
|
|
143272
|
+
const layers = viewport.displayStyle.settings.mapImagery.backgroundLayers;
|
|
143273
|
+
if (layers.length > 0) {
|
|
143274
|
+
this.setBaseLayerSettings(mapImagery.backgroundBase);
|
|
143275
|
+
this.setLayerSettings(mapImagery.backgroundLayers);
|
|
143276
|
+
viewport.invalidateScene();
|
|
143231
143277
|
}
|
|
143232
143278
|
}));
|
|
143233
143279
|
}
|
|
@@ -145895,8 +145941,9 @@ class RealityTileLoader {
|
|
|
145895
145941
|
isCanceled = () => !tile.isLoading;
|
|
145896
145942
|
const { is3d, yAxisUp, iModel, modelId } = tile.realityRoot;
|
|
145897
145943
|
let reader;
|
|
145944
|
+
const ecefTransform = tile.tree.iModel.isGeoLocated ? tile.tree.iModel.getEcefTransform() : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
|
|
145898
145945
|
const tileData = {
|
|
145899
|
-
ecefTransform
|
|
145946
|
+
ecefTransform,
|
|
145900
145947
|
range: tile.range,
|
|
145901
145948
|
layerClassifiers: tile.tree.layerHandler?.layerClassifiers,
|
|
145902
145949
|
};
|
|
@@ -157211,7 +157258,7 @@ class RealityTileTree extends _internal__WEBPACK_IMPORTED_MODULE_6__.TileTree {
|
|
|
157211
157258
|
sortIndices = selectedTiles.map((_x, i) => i);
|
|
157212
157259
|
sortIndices.sort((a, b) => selectedTiles[a].depth - selectedTiles[b].depth);
|
|
157213
157260
|
}
|
|
157214
|
-
if (
|
|
157261
|
+
if (args.shouldCollectClassifierGraphics)
|
|
157215
157262
|
this.collectClassifierGraphics(args, selectedTiles);
|
|
157216
157263
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(selectedTiles.length === displayedTileDescendants.length);
|
|
157217
157264
|
for (let i = 0; i < selectedTiles.length; i++) {
|
|
@@ -159365,6 +159412,8 @@ class TileDrawArgs {
|
|
|
159365
159412
|
processSelectedTiles(_tiles) { }
|
|
159366
159413
|
/* @internal */
|
|
159367
159414
|
get maxRealityTreeSelectionCount() { return undefined; }
|
|
159415
|
+
/* @internal */
|
|
159416
|
+
get shouldCollectClassifierGraphics() { return true; }
|
|
159368
159417
|
}
|
|
159369
159418
|
|
|
159370
159419
|
|
|
@@ -162665,6 +162714,18 @@ class MapCartoRectangle extends _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0_
|
|
|
162665
162714
|
scratchMercatorFractionRange.high.y = tilingScheme.latitudeToYFraction(this.high.y);
|
|
162666
162715
|
return scratchMercatorFractionRange;
|
|
162667
162716
|
}
|
|
162717
|
+
/**
|
|
162718
|
+
* Compute rectangle with angles specified in degrees.
|
|
162719
|
+
* @beta
|
|
162720
|
+
*/
|
|
162721
|
+
toDegrees() {
|
|
162722
|
+
return {
|
|
162723
|
+
north: _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Angle.radiansToDegrees(this.north),
|
|
162724
|
+
south: _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Angle.radiansToDegrees(this.south),
|
|
162725
|
+
east: _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Angle.radiansToDegrees(this.east),
|
|
162726
|
+
west: _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_0__.Angle.radiansToDegrees(this.west),
|
|
162727
|
+
};
|
|
162728
|
+
}
|
|
162668
162729
|
}
|
|
162669
162730
|
|
|
162670
162731
|
|
|
@@ -163331,7 +163392,7 @@ class MapLayerImageryProvider {
|
|
|
163331
163392
|
}
|
|
163332
163393
|
}
|
|
163333
163394
|
/** @internal */
|
|
163334
|
-
async makeTileRequest(url, timeoutMs) {
|
|
163395
|
+
async makeTileRequest(url, timeoutMs, authorization) {
|
|
163335
163396
|
// We want to complete the first request before letting other requests go;
|
|
163336
163397
|
// this done to avoid flooding server with requests missing credentials
|
|
163337
163398
|
if (!this._firstRequestPromise)
|
|
@@ -163340,7 +163401,7 @@ class MapLayerImageryProvider {
|
|
|
163340
163401
|
await this._firstRequestPromise;
|
|
163341
163402
|
let response;
|
|
163342
163403
|
try {
|
|
163343
|
-
response = await this.makeRequest(url, timeoutMs);
|
|
163404
|
+
response = await this.makeRequest(url, timeoutMs, authorization);
|
|
163344
163405
|
}
|
|
163345
163406
|
finally {
|
|
163346
163407
|
this.onFirstRequestCompleted.raiseEvent();
|
|
@@ -163350,11 +163411,15 @@ class MapLayerImageryProvider {
|
|
|
163350
163411
|
return response;
|
|
163351
163412
|
}
|
|
163352
163413
|
/** @internal */
|
|
163353
|
-
async makeRequest(url, timeoutMs) {
|
|
163414
|
+
async makeRequest(url, timeoutMs, authorization) {
|
|
163354
163415
|
let response;
|
|
163355
163416
|
let headers;
|
|
163356
163417
|
let hasCreds = false;
|
|
163357
|
-
if (
|
|
163418
|
+
if (authorization) {
|
|
163419
|
+
headers = new Headers();
|
|
163420
|
+
headers.set("Authorization", authorization);
|
|
163421
|
+
}
|
|
163422
|
+
else if (this._settings.userName && this._settings.password) {
|
|
163358
163423
|
hasCreds = true;
|
|
163359
163424
|
headers = new Headers();
|
|
163360
163425
|
this.setRequestAuthorization(headers);
|
|
@@ -166160,6 +166225,18 @@ class QuadId {
|
|
|
166160
166225
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(this.row, other.row) ||
|
|
166161
166226
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(this.column, other.column);
|
|
166162
166227
|
}
|
|
166228
|
+
/** Creates a QuadId from a JSON representation */
|
|
166229
|
+
static fromJSON(props) {
|
|
166230
|
+
return new QuadId(props.level, props.column, props.row);
|
|
166231
|
+
}
|
|
166232
|
+
/** Convert this QuadId to a JSON representation */
|
|
166233
|
+
static toJSON(props) {
|
|
166234
|
+
return {
|
|
166235
|
+
level: props.level,
|
|
166236
|
+
column: props.column,
|
|
166237
|
+
row: props.row,
|
|
166238
|
+
};
|
|
166239
|
+
}
|
|
166163
166240
|
}
|
|
166164
166241
|
|
|
166165
166242
|
|
|
@@ -168000,6 +168077,7 @@ class AccuDrawViewportUI extends _AccuDraw__WEBPACK_IMPORTED_MODULE_1__.AccuDraw
|
|
|
168000
168077
|
this._controls.overlay.remove();
|
|
168001
168078
|
this._controls = undefined;
|
|
168002
168079
|
this.unsuspendToolTips();
|
|
168080
|
+
this.removedControlRect();
|
|
168003
168081
|
}
|
|
168004
168082
|
createControlDiv() {
|
|
168005
168083
|
const div = document.createElement("div");
|
|
@@ -168087,6 +168165,10 @@ class AccuDrawViewportUI extends _AccuDraw__WEBPACK_IMPORTED_MODULE_1__.AccuDraw
|
|
|
168087
168165
|
style.outlineWidth = button.outlineWidth;
|
|
168088
168166
|
return itemLock;
|
|
168089
168167
|
}
|
|
168168
|
+
/** Called after the controls have been removed from the view. */
|
|
168169
|
+
removedControlRect() { }
|
|
168170
|
+
/** Called after the position of the controls in the supplied view is updated. */
|
|
168171
|
+
changedControlRect(_rect, _vp) { }
|
|
168090
168172
|
/** Use to override the position of the controls in the supplied view. */
|
|
168091
168173
|
modifyControlRect(_rect, _vp) { }
|
|
168092
168174
|
/** Return the ViewRect currently occupied by the controls in the supplied view. */
|
|
@@ -168183,6 +168265,8 @@ class AccuDrawViewportUI extends _AccuDraw__WEBPACK_IMPORTED_MODULE_1__.AccuDraw
|
|
|
168183
168265
|
return; // Keep showing at last valid location...
|
|
168184
168266
|
this._controls.div.style.left = `${controlRect.left}px`;
|
|
168185
168267
|
this._controls.div.style.top = `${controlRect.top}px`;
|
|
168268
|
+
this.changedControlRect(controlRect, vp);
|
|
168269
|
+
return;
|
|
168186
168270
|
}
|
|
168187
168271
|
get _isFocusHome() {
|
|
168188
168272
|
return (document.body === document.activeElement);
|
|
@@ -168205,6 +168289,13 @@ class AccuDrawViewportUI extends _AccuDraw__WEBPACK_IMPORTED_MODULE_1__.AccuDraw
|
|
|
168205
168289
|
// Indicate when keyboard shortcuts can't be used (i.e. focus not at AccuDraw or Home) by changing compass to monochrome...
|
|
168206
168290
|
return (this._isFocusHome || this._isFocusAccuDraw);
|
|
168207
168291
|
}
|
|
168292
|
+
/** Get the item field that currently has input focus.
|
|
168293
|
+
*/
|
|
168294
|
+
getFocusItem() {
|
|
168295
|
+
if (!this._isFocusAccuDraw)
|
|
168296
|
+
return undefined;
|
|
168297
|
+
return this._focusItem;
|
|
168298
|
+
}
|
|
168208
168299
|
/** Request to set focus to the specified AccuDraw input field to start entering values.
|
|
168209
168300
|
* The focused input field will be indicated by the background color.
|
|
168210
168301
|
*/
|
|
@@ -175037,6 +175128,7 @@ class CurrentInputState {
|
|
|
175037
175128
|
lastButton = _Tool__WEBPACK_IMPORTED_MODULE_13__.BeButton.Data;
|
|
175038
175129
|
inputSource = _Tool__WEBPACK_IMPORTED_MODULE_13__.InputSource.Unknown;
|
|
175039
175130
|
lastMotion = new _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Point2d();
|
|
175131
|
+
lastMotionEvent;
|
|
175040
175132
|
lastWheelEvent;
|
|
175041
175133
|
lastTouchStart;
|
|
175042
175134
|
touchTapTimer;
|
|
@@ -175054,7 +175146,7 @@ class CurrentInputState {
|
|
|
175054
175146
|
onStartDrag(button) { this.button[button].isDragging = true; }
|
|
175055
175147
|
onInstallTool() {
|
|
175056
175148
|
this.clearKeyQualifiers();
|
|
175057
|
-
this.lastWheelEvent = undefined;
|
|
175149
|
+
this.lastWheelEvent = this.lastMotionEvent = undefined;
|
|
175058
175150
|
this.lastTouchStart = this.touchTapTimer = this.touchTapCount = undefined;
|
|
175059
175151
|
}
|
|
175060
175152
|
clearKeyQualifiers() { this.qualifiers = _Tool__WEBPACK_IMPORTED_MODULE_13__.BeModifierKeys.None; }
|
|
@@ -175329,6 +175421,9 @@ class ToolAdmin {
|
|
|
175329
175421
|
this.clearMotionPromises();
|
|
175330
175422
|
// make sure tools don't think the cursor is still in this viewport.
|
|
175331
175423
|
this.onMouseLeave(vp);
|
|
175424
|
+
// Invalidate last motion if for this viewport...
|
|
175425
|
+
if (this.currentInputState.lastMotionEvent?.viewport === vp)
|
|
175426
|
+
this.currentInputState.lastMotionEvent = undefined;
|
|
175332
175427
|
// Remove any events associated with this viewport.
|
|
175333
175428
|
ToolAdmin._toolEvents = ToolAdmin._toolEvents.filter((ev) => ev.vp !== vp);
|
|
175334
175429
|
}
|
|
@@ -175692,6 +175787,7 @@ class ToolAdmin {
|
|
|
175692
175787
|
toolPromise.then(() => {
|
|
175693
175788
|
if (undefined === this._toolMotionPromise)
|
|
175694
175789
|
return; // Only early return if canceled, result from a previous motion is preferable to showing nothing...
|
|
175790
|
+
this.currentInputState.lastMotionEvent = motion; // Save to use for simulation motion...
|
|
175695
175791
|
// Update decorations when dynamics are inactive...
|
|
175696
175792
|
if (!_IModelApp__WEBPACK_IMPORTED_MODULE_5__.IModelApp.viewManager.inDynamicsMode) {
|
|
175697
175793
|
vp.invalidateDecorations();
|
|
@@ -176433,7 +176529,8 @@ class ToolAdmin {
|
|
|
176433
176529
|
}
|
|
176434
176530
|
/** Can be called by tools to invoke their [[InteractiveTool.onDynamicFrame]] method without requiring a motion event. */
|
|
176435
176531
|
simulateMotionEvent() {
|
|
176436
|
-
|
|
176532
|
+
// NOTE: Prefer last resolved motion over current cursor location which could be out of the view, or moved from last AccuSnap etc.
|
|
176533
|
+
this.updateDynamics(this.currentInputState.lastMotionEvent, undefined, true);
|
|
176437
176534
|
}
|
|
176438
176535
|
/** @internal */
|
|
176439
176536
|
setIncompatibleViewportCursor(restore) {
|
|
@@ -203985,15 +204082,15 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
203985
204082
|
_activeMomentData;
|
|
203986
204083
|
_point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
203987
204084
|
_point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
203988
|
-
/**
|
|
203989
|
-
*
|
|
203990
|
-
* *
|
|
204085
|
+
/**
|
|
204086
|
+
* Accumulate (independent) integrations over:
|
|
204087
|
+
* * The area between the arc and the chord connecting its endpoints.
|
|
204088
|
+
* * The triangle with vertices: origin, arc start, arc end.
|
|
203991
204089
|
*/
|
|
203992
204090
|
handleArc3d(arc) {
|
|
203993
204091
|
const momentData = this._activeMomentData;
|
|
203994
204092
|
const sweepRadians = arc.sweep.sweepRadians;
|
|
203995
204093
|
const alphaRadians = sweepRadians * 0.5;
|
|
203996
|
-
// from https://apps.dtic.mil/dtic/tr/fulltext/u2/274936.pdf page 71 for radius = 1
|
|
203997
204094
|
let s = Math.sin(alphaRadians);
|
|
203998
204095
|
let c = Math.cos(alphaRadians);
|
|
203999
204096
|
let s1 = Math.sin(sweepRadians);
|
|
@@ -204020,12 +204117,12 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204020
204117
|
const pointC = arc.fractionToPoint(1.0);
|
|
204021
204118
|
momentData.accumulateTriangleMomentsXY(undefined, pointB, pointC);
|
|
204022
204119
|
}
|
|
204023
|
-
/** Accumulate integrals over the (triangular) areas from the origin to each line segment */
|
|
204120
|
+
/** Accumulate integrals over the (triangular) areas from the origin to each line segment. */
|
|
204024
204121
|
handleLineString3d(ls) {
|
|
204025
204122
|
const momentData = this._activeMomentData;
|
|
204026
204123
|
momentData.accumulateTriangleToLineStringMomentsXY(undefined, ls.packedPoints);
|
|
204027
204124
|
}
|
|
204028
|
-
/** Accumulate integrals over the (triangular) area from the origin to this line segment */
|
|
204125
|
+
/** Accumulate integrals over the (triangular) area from the origin to this line segment. */
|
|
204029
204126
|
handleLineSegment3d(segment) {
|
|
204030
204127
|
const momentData = this._activeMomentData;
|
|
204031
204128
|
segment.startPoint(this._point0);
|
|
@@ -204041,15 +204138,7 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204041
204138
|
this._activeMomentData = undefined;
|
|
204042
204139
|
return momentData;
|
|
204043
204140
|
}
|
|
204044
|
-
/**
|
|
204045
|
-
* ASSUMPTIONS FOR ORIENTATION AND CONTAINMENT ISSUES
|
|
204046
|
-
* * Largest area is outer
|
|
204047
|
-
* * All others are interior (and not overlapping)
|
|
204048
|
-
* Hence
|
|
204049
|
-
* * Outer area sign must be positive -- negate all integrations as needed
|
|
204050
|
-
* * Outer area signs must be positive -- negate all integrations as needed
|
|
204051
|
-
* @param region
|
|
204052
|
-
*/
|
|
204141
|
+
/** Accumulate integrals from origin to the components of the parity region. */
|
|
204053
204142
|
handleParityRegion(region) {
|
|
204054
204143
|
const allChildMoments = [];
|
|
204055
204144
|
let maxAbsArea = 0.0;
|
|
@@ -204081,7 +204170,7 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204081
204170
|
}
|
|
204082
204171
|
return undefined;
|
|
204083
204172
|
}
|
|
204084
|
-
/** Accumulate
|
|
204173
|
+
/** Accumulate integrals from origin to the components of the union region. */
|
|
204085
204174
|
handleUnionRegion(region) {
|
|
204086
204175
|
const summedMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__.MomentData.create();
|
|
204087
204176
|
for (const child of region.children) {
|
|
@@ -204103,9 +204192,9 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204103
204192
|
this._strokeOptions = options;
|
|
204104
204193
|
return options;
|
|
204105
204194
|
}
|
|
204106
|
-
/**
|
|
204107
|
-
*
|
|
204108
|
-
* * accumulate stroke array.
|
|
204195
|
+
/**
|
|
204196
|
+
* Handle a single curve primitive (not loop).
|
|
204197
|
+
* * Stroke the curve and accumulate stroke array.
|
|
204109
204198
|
*/
|
|
204110
204199
|
handleCurvePrimitive(cp) {
|
|
204111
204200
|
const strokes = _LineString3d__WEBPACK_IMPORTED_MODULE_6__.LineString3d.create();
|
|
@@ -204113,12 +204202,18 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204113
204202
|
cp.emitStrokes(strokes, options);
|
|
204114
204203
|
this.handleLineString3d(strokes);
|
|
204115
204204
|
}
|
|
204116
|
-
/**
|
|
204117
|
-
handleBSplineCurve3d(g) {
|
|
204118
|
-
|
|
204119
|
-
|
|
204120
|
-
/**
|
|
204121
|
-
|
|
204205
|
+
/** Handle strongly typed BSplineCurve3d as generic curve primitive. */
|
|
204206
|
+
handleBSplineCurve3d(g) {
|
|
204207
|
+
return this.handleCurvePrimitive(g);
|
|
204208
|
+
}
|
|
204209
|
+
/** Handle strongly typed BSplineCurve3dH as generic curve primitive. */
|
|
204210
|
+
handleBSplineCurve3dH(g) {
|
|
204211
|
+
return this.handleCurvePrimitive(g);
|
|
204212
|
+
}
|
|
204213
|
+
/** Handle strongly typed TransitionSpiral as generic curve primitive. */
|
|
204214
|
+
handleTransitionSpiral(g) {
|
|
204215
|
+
return this.handleCurvePrimitive(g);
|
|
204216
|
+
}
|
|
204122
204217
|
}
|
|
204123
204218
|
|
|
204124
204219
|
|
|
@@ -204138,41 +204233,43 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
204138
204233
|
/* harmony export */ RegionOps: () => (/* binding */ RegionOps)
|
|
204139
204234
|
/* harmony export */ });
|
|
204140
204235
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
204141
|
-
/* harmony import */ var
|
|
204142
|
-
/* harmony import */ var
|
|
204143
|
-
/* harmony import */ var
|
|
204144
|
-
/* harmony import */ var
|
|
204145
|
-
/* harmony import */ var
|
|
204146
|
-
/* harmony import */ var
|
|
204147
|
-
/* harmony import */ var
|
|
204148
|
-
/* harmony import */ var
|
|
204149
|
-
/* harmony import */ var
|
|
204236
|
+
/* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
|
|
204237
|
+
/* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
|
|
204238
|
+
/* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
|
|
204239
|
+
/* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
|
|
204240
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
204241
|
+
/* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
|
|
204242
|
+
/* harmony import */ var _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/PolylineCompressionByEdgeOffset */ "../../core/geometry/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js");
|
|
204243
|
+
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
204244
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
204245
|
+
/* harmony import */ var _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../geometry3d/SortablePolygon */ "../../core/geometry/lib/esm/geometry3d/SortablePolygon.js");
|
|
204246
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
204150
204247
|
/* harmony import */ var _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry4d/MomentData */ "../../core/geometry/lib/esm/geometry4d/MomentData.js");
|
|
204151
|
-
/* harmony import */ var
|
|
204152
|
-
/* harmony import */ var
|
|
204153
|
-
/* harmony import */ var
|
|
204154
|
-
/* harmony import */ var
|
|
204155
|
-
/* harmony import */ var
|
|
204156
|
-
/* harmony import */ var
|
|
204157
|
-
/* harmony import */ var
|
|
204158
|
-
/* harmony import */ var
|
|
204159
|
-
/* harmony import */ var
|
|
204248
|
+
/* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
|
|
204249
|
+
/* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
|
|
204250
|
+
/* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
|
|
204251
|
+
/* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
|
|
204252
|
+
/* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
|
|
204253
|
+
/* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
204254
|
+
/* harmony import */ var _CurveCurve__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./CurveCurve */ "../../core/geometry/lib/esm/curve/CurveCurve.js");
|
|
204255
|
+
/* harmony import */ var _CurveOps__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
|
|
204256
|
+
/* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
|
|
204160
204257
|
/* harmony import */ var _CurveWireMomentsXYZ__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CurveWireMomentsXYZ */ "../../core/geometry/lib/esm/curve/CurveWireMomentsXYZ.js");
|
|
204161
|
-
/* harmony import */ var
|
|
204162
|
-
/* harmony import */ var
|
|
204163
|
-
/* harmony import */ var
|
|
204164
|
-
/* harmony import */ var
|
|
204165
|
-
/* harmony import */ var
|
|
204166
|
-
/* harmony import */ var
|
|
204167
|
-
/* harmony import */ var
|
|
204168
|
-
/* harmony import */ var
|
|
204169
|
-
/* harmony import */ var
|
|
204170
|
-
/* harmony import */ var
|
|
204171
|
-
/* harmony import */ var
|
|
204172
|
-
/* harmony import */ var
|
|
204258
|
+
/* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
204259
|
+
/* harmony import */ var _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./internalContexts/ChainCollectorContext */ "../../core/geometry/lib/esm/curve/internalContexts/ChainCollectorContext.js");
|
|
204260
|
+
/* harmony import */ var _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./internalContexts/PolygonOffsetContext */ "../../core/geometry/lib/esm/curve/internalContexts/PolygonOffsetContext.js");
|
|
204261
|
+
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
204262
|
+
/* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
204263
|
+
/* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
|
|
204264
|
+
/* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
|
|
204265
|
+
/* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
|
|
204266
|
+
/* harmony import */ var _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./Query/ConsolidateAdjacentPrimitivesContext */ "../../core/geometry/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js");
|
|
204267
|
+
/* harmony import */ var _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./Query/CurveSplitContext */ "../../core/geometry/lib/esm/curve/Query/CurveSplitContext.js");
|
|
204268
|
+
/* harmony import */ var _Query_InOutTests__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Query/InOutTests */ "../../core/geometry/lib/esm/curve/Query/InOutTests.js");
|
|
204269
|
+
/* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
|
|
204173
204270
|
/* harmony import */ var _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RegionMomentsXY */ "../../core/geometry/lib/esm/curve/RegionMomentsXY.js");
|
|
204174
|
-
/* harmony import */ var
|
|
204175
|
-
/* harmony import */ var
|
|
204271
|
+
/* harmony import */ var _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./RegionOpsClassificationSweeps */ "../../core/geometry/lib/esm/curve/RegionOpsClassificationSweeps.js");
|
|
204272
|
+
/* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
|
|
204176
204273
|
/*---------------------------------------------------------------------------------------------
|
|
204177
204274
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
204178
204275
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -204213,6 +204310,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
204213
204310
|
|
|
204214
204311
|
|
|
204215
204312
|
|
|
204313
|
+
|
|
204314
|
+
|
|
204216
204315
|
|
|
204217
204316
|
|
|
204218
204317
|
|
|
@@ -204242,13 +204341,16 @@ var RegionBinaryOpType;
|
|
|
204242
204341
|
class RegionOps {
|
|
204243
204342
|
/**
|
|
204244
204343
|
* Return moment sums for a loop, parity region, or union region.
|
|
204344
|
+
* * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
204245
204345
|
* * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
|
|
204246
|
-
*
|
|
204247
|
-
*
|
|
204346
|
+
* call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes(rawMomentData.origin, rawMomentData.sums);`
|
|
204347
|
+
* * `rawMomentData.origin` is the centroid of `region`.
|
|
204348
|
+
* * `rawMomentData.sums.weight()` is the signed area of `region`.
|
|
204349
|
+
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
204248
204350
|
*/
|
|
204249
|
-
static computeXYAreaMoments(
|
|
204351
|
+
static computeXYAreaMoments(region) {
|
|
204250
204352
|
const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__.RegionMomentsXY();
|
|
204251
|
-
const result =
|
|
204353
|
+
const result = region.dispatchToGeometryHandler(handler);
|
|
204252
204354
|
if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__.MomentData) {
|
|
204253
204355
|
result.shiftOriginAndSumsToCentroidOfSums();
|
|
204254
204356
|
return result;
|
|
@@ -204257,8 +204359,8 @@ class RegionOps {
|
|
|
204257
204359
|
}
|
|
204258
204360
|
/**
|
|
204259
204361
|
* Return an area tolerance for a given xy-range and optional distance tolerance.
|
|
204260
|
-
* @param range range of planar region to tolerance
|
|
204261
|
-
* @param distanceTolerance optional absolute distance tolerance
|
|
204362
|
+
* @param range range of planar region to tolerance.
|
|
204363
|
+
* @param distanceTolerance optional absolute distance tolerance.
|
|
204262
204364
|
*/
|
|
204263
204365
|
static computeXYAreaTolerance(range, distanceTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
|
|
204264
204366
|
// 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).
|
|
@@ -204267,12 +204369,13 @@ class RegionOps {
|
|
|
204267
204369
|
}
|
|
204268
204370
|
/**
|
|
204269
204371
|
* Return a (signed) xy area for a region.
|
|
204372
|
+
* * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
204270
204373
|
* * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
|
|
204271
|
-
* @param
|
|
204374
|
+
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
204272
204375
|
*/
|
|
204273
|
-
static computeXYArea(
|
|
204376
|
+
static computeXYArea(region) {
|
|
204274
204377
|
const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__.RegionMomentsXY();
|
|
204275
|
-
const result =
|
|
204378
|
+
const result = region.dispatchToGeometryHandler(handler);
|
|
204276
204379
|
if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__.MomentData) {
|
|
204277
204380
|
return result.quantitySum;
|
|
204278
204381
|
}
|
|
@@ -204280,49 +204383,88 @@ class RegionOps {
|
|
|
204280
204383
|
}
|
|
204281
204384
|
/**
|
|
204282
204385
|
* Return MomentData with the sums of wire moments.
|
|
204386
|
+
* * The input curve should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
204283
204387
|
* * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
|
|
204284
|
-
*
|
|
204285
|
-
*
|
|
204388
|
+
* call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
|
|
204389
|
+
* * `rawMomentData.origin` is the wire centroid of `curve`.
|
|
204390
|
+
* * `rawMomentData.sums.weight()` is the signed length of `curve`.
|
|
204391
|
+
* @param curve any [[CurveCollection]] or [[CurvePrimitive]].
|
|
204286
204392
|
*/
|
|
204287
|
-
static computeXYZWireMomentSums(
|
|
204393
|
+
static computeXYZWireMomentSums(curve) {
|
|
204288
204394
|
const handler = new _CurveWireMomentsXYZ__WEBPACK_IMPORTED_MODULE_3__.CurveWireMomentsXYZ();
|
|
204289
|
-
handler.visitLeaves(
|
|
204395
|
+
handler.visitLeaves(curve);
|
|
204290
204396
|
const result = handler.momentData;
|
|
204291
204397
|
result.shiftOriginAndSumsToCentroidOfSums();
|
|
204292
204398
|
return result;
|
|
204293
204399
|
}
|
|
204400
|
+
/**
|
|
204401
|
+
* Return a [[Ray3d]] with:
|
|
204402
|
+
* * `origin` is the centroid of the region,
|
|
204403
|
+
* * `direction` is a unit vector perpendicular to the region plane,
|
|
204404
|
+
* * `a` is the region area.
|
|
204405
|
+
* @param region the region to process. Can lie in any plane.
|
|
204406
|
+
* @param result optional pre-allocated result to populate and return.
|
|
204407
|
+
*/
|
|
204408
|
+
static centroidAreaNormal(region, result) {
|
|
204409
|
+
const localToWorld = _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_4__.FrameBuilder.createRightHandedFrame(undefined, region);
|
|
204410
|
+
if (!localToWorld)
|
|
204411
|
+
return undefined;
|
|
204412
|
+
const normal = localToWorld.matrix.columnZ(result?.direction);
|
|
204413
|
+
const regionIsXY = normal.isParallelTo(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Vector3d.unitZ(), true);
|
|
204414
|
+
let regionXY = region;
|
|
204415
|
+
if (!regionIsXY) { // rotate the region to be parallel to the xy-plane
|
|
204416
|
+
regionXY = region.cloneTransformed(localToWorld.inverse());
|
|
204417
|
+
if (!regionXY)
|
|
204418
|
+
return undefined;
|
|
204419
|
+
}
|
|
204420
|
+
const momentData = RegionOps.computeXYAreaMoments(regionXY);
|
|
204421
|
+
if (!momentData)
|
|
204422
|
+
return undefined;
|
|
204423
|
+
const centroid = momentData.origin.clone(result?.origin);
|
|
204424
|
+
if (!regionIsXY) // rotate centroid back (area is unchanged)
|
|
204425
|
+
localToWorld.multiplyPoint3d(centroid, centroid);
|
|
204426
|
+
let area = momentData.sums.weight();
|
|
204427
|
+
if (area < 0.0) {
|
|
204428
|
+
area = -area;
|
|
204429
|
+
normal.scale(-1.0, normal);
|
|
204430
|
+
}
|
|
204431
|
+
if (!result)
|
|
204432
|
+
result = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__.Ray3d.createCapture(centroid, normal);
|
|
204433
|
+
result.a = area;
|
|
204434
|
+
return result;
|
|
204435
|
+
}
|
|
204294
204436
|
/**
|
|
204295
204437
|
* Create loops in the graph.
|
|
204296
204438
|
* @internal
|
|
204297
204439
|
*/
|
|
204298
204440
|
static addLoopsToGraph(graph, data, announceIsolatedLoop) {
|
|
204299
|
-
if (data instanceof
|
|
204441
|
+
if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop) {
|
|
204300
204442
|
const points = data.getPackedStrokes();
|
|
204301
204443
|
if (points)
|
|
204302
204444
|
this.addLoopsToGraph(graph, points, announceIsolatedLoop);
|
|
204303
204445
|
}
|
|
204304
|
-
else if (data instanceof
|
|
204446
|
+
else if (data instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
|
|
204305
204447
|
for (const child of data.children) {
|
|
204306
204448
|
const points = child.getPackedStrokes();
|
|
204307
204449
|
if (points)
|
|
204308
204450
|
this.addLoopsToGraph(graph, points, announceIsolatedLoop);
|
|
204309
204451
|
}
|
|
204310
204452
|
}
|
|
204311
|
-
else if (data instanceof
|
|
204312
|
-
const loopSeed =
|
|
204453
|
+
else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
|
|
204454
|
+
const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
|
|
204313
204455
|
if (loopSeed !== undefined)
|
|
204314
204456
|
announceIsolatedLoop(graph, loopSeed);
|
|
204315
204457
|
}
|
|
204316
204458
|
else if (Array.isArray(data)) {
|
|
204317
204459
|
if (data.length > 0) {
|
|
204318
|
-
if (
|
|
204319
|
-
const loopSeed =
|
|
204460
|
+
if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.isAnyImmediatePointType(data[0])) {
|
|
204461
|
+
const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
|
|
204320
204462
|
if (loopSeed !== undefined)
|
|
204321
204463
|
announceIsolatedLoop(graph, loopSeed);
|
|
204322
204464
|
}
|
|
204323
|
-
else if (data[0] instanceof
|
|
204465
|
+
else if (data[0] instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
|
|
204324
204466
|
for (const loop of data) {
|
|
204325
|
-
const loopSeed =
|
|
204467
|
+
const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, loop);
|
|
204326
204468
|
if (loopSeed !== undefined)
|
|
204327
204469
|
announceIsolatedLoop(graph, loopSeed);
|
|
204328
204470
|
}
|
|
@@ -204362,10 +204504,10 @@ class RegionOps {
|
|
|
204362
204504
|
static finishGraphToPolyface(graph, triangulate) {
|
|
204363
204505
|
if (graph) {
|
|
204364
204506
|
if (triangulate) {
|
|
204365
|
-
|
|
204366
|
-
|
|
204507
|
+
_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.triangulateAllPositiveAreaFaces(graph);
|
|
204508
|
+
_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
|
|
204367
204509
|
}
|
|
204368
|
-
return
|
|
204510
|
+
return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__.PolyfaceBuilder.graphToPolyface(graph);
|
|
204369
204511
|
}
|
|
204370
204512
|
return undefined;
|
|
204371
204513
|
}
|
|
@@ -204379,7 +204521,7 @@ class RegionOps {
|
|
|
204379
204521
|
* @param triangulate whether to triangulate the result
|
|
204380
204522
|
*/
|
|
204381
204523
|
static polygonXYAreaIntersectLoopsToPolyface(loopsA, loopsB, triangulate = false) {
|
|
204382
|
-
const graph =
|
|
204524
|
+
const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && inB), this._graphCheckPointFunction);
|
|
204383
204525
|
return this.finishGraphToPolyface(graph, triangulate);
|
|
204384
204526
|
}
|
|
204385
204527
|
/**
|
|
@@ -204392,7 +204534,7 @@ class RegionOps {
|
|
|
204392
204534
|
* @param triangulate whether to triangulate the result
|
|
204393
204535
|
*/
|
|
204394
204536
|
static polygonXYAreaUnionLoopsToPolyface(loopsA, loopsB, triangulate = false) {
|
|
204395
|
-
const graph =
|
|
204537
|
+
const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA || inB), this._graphCheckPointFunction);
|
|
204396
204538
|
return this.finishGraphToPolyface(graph, triangulate);
|
|
204397
204539
|
}
|
|
204398
204540
|
/**
|
|
@@ -204405,7 +204547,7 @@ class RegionOps {
|
|
|
204405
204547
|
* @param triangulate whether to triangulate the result
|
|
204406
204548
|
*/
|
|
204407
204549
|
static polygonXYAreaDifferenceLoopsToPolyface(loopsA, loopsB, triangulate = false) {
|
|
204408
|
-
const graph =
|
|
204550
|
+
const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && !inB), this._graphCheckPointFunction);
|
|
204409
204551
|
return this.finishGraphToPolyface(graph, triangulate);
|
|
204410
204552
|
}
|
|
204411
204553
|
/**
|
|
@@ -204422,8 +204564,8 @@ class RegionOps {
|
|
|
204422
204564
|
static regionBooleanXY(loopsA, loopsB, operation, mergeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
|
|
204423
204565
|
// Always return UnionRegion for now. But keep return type as AnyRegion:
|
|
204424
204566
|
// in the future, we might return the *simplest* region type.
|
|
204425
|
-
const result =
|
|
204426
|
-
const context =
|
|
204567
|
+
const result = _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion.create();
|
|
204568
|
+
const context = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionBooleanContext.create(_RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union);
|
|
204427
204569
|
context.addMembers(loopsA, loopsB);
|
|
204428
204570
|
context.annotateAndMergeCurvesInGraph(mergeTolerance);
|
|
204429
204571
|
const range = context.groupA.range().union(context.groupB.range());
|
|
@@ -204435,7 +204577,7 @@ class RegionOps {
|
|
|
204435
204577
|
if (Math.abs(area) < areaTol)
|
|
204436
204578
|
return;
|
|
204437
204579
|
if (faceType === 1) {
|
|
204438
|
-
const loop =
|
|
204580
|
+
const loop = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.createLoopInFace(face);
|
|
204439
204581
|
if (loop)
|
|
204440
204582
|
result.tryAddChild(loop);
|
|
204441
204583
|
}
|
|
@@ -204455,7 +204597,7 @@ class RegionOps {
|
|
|
204455
204597
|
* @param triangulate whether to triangulate the result
|
|
204456
204598
|
*/
|
|
204457
204599
|
static polygonBooleanXYToPolyface(inputA, operation, inputB, triangulate = false) {
|
|
204458
|
-
const graph =
|
|
204600
|
+
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);
|
|
204459
204601
|
return this.finishGraphToPolyface(graph, triangulate);
|
|
204460
204602
|
}
|
|
204461
204603
|
/**
|
|
@@ -204470,18 +204612,18 @@ class RegionOps {
|
|
|
204470
204612
|
* @param inputB second set of loops
|
|
204471
204613
|
*/
|
|
204472
204614
|
static polygonBooleanXYToLoops(inputA, operation, inputB) {
|
|
204473
|
-
const graph =
|
|
204615
|
+
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);
|
|
204474
204616
|
if (!graph)
|
|
204475
204617
|
return undefined;
|
|
204476
|
-
const loopEdges =
|
|
204618
|
+
const loopEdges = _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_15__.HalfEdgeGraphSearch.collectExtendedBoundaryLoopsInGraph(graph, _topology_Graph__WEBPACK_IMPORTED_MODULE_16__.HalfEdgeMask.EXTERIOR);
|
|
204477
204619
|
const allLoops = [];
|
|
204478
204620
|
for (const graphLoop of loopEdges) {
|
|
204479
|
-
const points = new
|
|
204621
|
+
const points = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray();
|
|
204480
204622
|
for (const edge of graphLoop)
|
|
204481
204623
|
points.pushXYZ(edge.x, edge.y, edge.z);
|
|
204482
204624
|
points.pushWrap(1);
|
|
204483
|
-
const loop =
|
|
204484
|
-
loop.tryAddChild(
|
|
204625
|
+
const loop = _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.create();
|
|
204626
|
+
loop.tryAddChild(_LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d.createCapture(points));
|
|
204485
204627
|
allLoops.push(loop);
|
|
204486
204628
|
}
|
|
204487
204629
|
return RegionOps.sortOuterAndHoleLoopsXY(allLoops);
|
|
@@ -204499,7 +204641,7 @@ class RegionOps {
|
|
|
204499
204641
|
* object.
|
|
204500
204642
|
*/
|
|
204501
204643
|
static constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions) {
|
|
204502
|
-
const context = new
|
|
204644
|
+
const context = new _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_19__.PolygonWireOffsetContext();
|
|
204503
204645
|
return context.constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions);
|
|
204504
204646
|
}
|
|
204505
204647
|
/**
|
|
@@ -204511,8 +204653,8 @@ class RegionOps {
|
|
|
204511
204653
|
* @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
|
|
204512
204654
|
*/
|
|
204513
204655
|
static constructCurveXYOffset(curves, offsetDistanceOrOptions) {
|
|
204514
|
-
const offsetOptions =
|
|
204515
|
-
return
|
|
204656
|
+
const offsetOptions = _OffsetOptions__WEBPACK_IMPORTED_MODULE_20__.OffsetOptions.create(offsetDistanceOrOptions);
|
|
204657
|
+
return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.constructCurveXYOffset(curves, offsetOptions);
|
|
204516
204658
|
}
|
|
204517
204659
|
/**
|
|
204518
204660
|
* Test if point (x,y) is IN, OUT or ON a region.
|
|
@@ -204522,7 +204664,7 @@ class RegionOps {
|
|
|
204522
204664
|
* @param y y coordinate of point to test
|
|
204523
204665
|
*/
|
|
204524
204666
|
static testPointInOnOutRegionXY(curves, x, y) {
|
|
204525
|
-
return
|
|
204667
|
+
return _Query_InOutTests__WEBPACK_IMPORTED_MODULE_22__.PointInOnOutContext.testPointInOnOutRegionXY(curves, x, y);
|
|
204526
204668
|
}
|
|
204527
204669
|
/**
|
|
204528
204670
|
* Create curve collection of subtype determined by gaps between the input curves.
|
|
@@ -204546,11 +204688,11 @@ class RegionOps {
|
|
|
204546
204688
|
maxGap = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.maxXY(maxGap, curves[i].endPoint().distance(curves[i + 1].startPoint()));
|
|
204547
204689
|
let collection;
|
|
204548
204690
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(maxGap)) {
|
|
204549
|
-
collection = wrap ?
|
|
204691
|
+
collection = wrap ? _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.create() : _Path__WEBPACK_IMPORTED_MODULE_23__.Path.create();
|
|
204550
204692
|
isPath = true;
|
|
204551
204693
|
}
|
|
204552
204694
|
else {
|
|
204553
|
-
collection =
|
|
204695
|
+
collection = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.BagOfCurves.create();
|
|
204554
204696
|
}
|
|
204555
204697
|
for (const c of curves)
|
|
204556
204698
|
collection.tryAddChild(c);
|
|
@@ -204576,7 +204718,7 @@ class RegionOps {
|
|
|
204576
204718
|
* @param cutterCurves input curves to intersect with `curvesToCut`
|
|
204577
204719
|
*/
|
|
204578
204720
|
static cloneCurvesWithXYSplits(curvesToCut, cutterCurves) {
|
|
204579
|
-
return
|
|
204721
|
+
return _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_25__.CurveSplitContext.cloneCurvesWithXYSplits(curvesToCut, cutterCurves);
|
|
204580
204722
|
}
|
|
204581
204723
|
/**
|
|
204582
204724
|
* Create paths assembled from many curves.
|
|
@@ -204587,11 +204729,11 @@ class RegionOps {
|
|
|
204587
204729
|
static splitToPathsBetweenBreaks(source, makeClones) {
|
|
204588
204730
|
if (source === undefined)
|
|
204589
204731
|
return undefined;
|
|
204590
|
-
if (source instanceof
|
|
204732
|
+
if (source instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive)
|
|
204591
204733
|
return source;
|
|
204592
204734
|
// source is a collection . ..
|
|
204593
204735
|
const primitives = source.collectCurvePrimitives();
|
|
204594
|
-
const chainCollector = new
|
|
204736
|
+
const chainCollector = new _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_27__.ChainCollectorContext(makeClones);
|
|
204595
204737
|
for (const primitive of primitives) {
|
|
204596
204738
|
chainCollector.announceCurvePrimitive(primitive);
|
|
204597
204739
|
}
|
|
@@ -204607,7 +204749,7 @@ class RegionOps {
|
|
|
204607
204749
|
* @returns object with named chains, insideOffsets, outsideOffsets
|
|
204608
204750
|
*/
|
|
204609
204751
|
static collectInsideAndOutsideOffsets(fragments, offsetDistance, gapTolerance) {
|
|
204610
|
-
return
|
|
204752
|
+
return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.collectInsideAndOutsideXYOffsets(fragments, offsetDistance, gapTolerance);
|
|
204611
204753
|
}
|
|
204612
204754
|
/**
|
|
204613
204755
|
* Restructure curve fragments as Paths and Loops.
|
|
@@ -204616,7 +204758,7 @@ class RegionOps {
|
|
|
204616
204758
|
* @returns chains, possibly wrapped in a [[BagOfCurves]].
|
|
204617
204759
|
*/
|
|
204618
204760
|
static collectChains(fragments, gapTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
|
|
204619
|
-
return
|
|
204761
|
+
return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.collectChains(fragments, gapTolerance);
|
|
204620
204762
|
}
|
|
204621
204763
|
/**
|
|
204622
204764
|
* Find all intersections among curves in `curvesToCut` against the boundaries of `region` and return fragments
|
|
@@ -204628,17 +204770,17 @@ class RegionOps {
|
|
|
204628
204770
|
const result = { insideParts: [], outsideParts: [], coincidentParts: [] };
|
|
204629
204771
|
const pathWithIntersectionMarkup = RegionOps.cloneCurvesWithXYSplits(curvesToCut, region);
|
|
204630
204772
|
const splitPaths = RegionOps.splitToPathsBetweenBreaks(pathWithIntersectionMarkup, true);
|
|
204631
|
-
if (splitPaths instanceof
|
|
204773
|
+
if (splitPaths instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection) {
|
|
204632
204774
|
for (const child of splitPaths.children) {
|
|
204633
|
-
const pointOnChild =
|
|
204775
|
+
const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(child);
|
|
204634
204776
|
if (pointOnChild) {
|
|
204635
204777
|
const inOnOut = RegionOps.testPointInOnOutRegionXY(region, pointOnChild.point.x, pointOnChild.point.y);
|
|
204636
204778
|
pushToInOnOutArrays(child, inOnOut, result.outsideParts, result.coincidentParts, result.insideParts);
|
|
204637
204779
|
}
|
|
204638
204780
|
}
|
|
204639
204781
|
}
|
|
204640
|
-
else if (splitPaths instanceof
|
|
204641
|
-
const pointOnChild =
|
|
204782
|
+
else if (splitPaths instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive) {
|
|
204783
|
+
const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(splitPaths);
|
|
204642
204784
|
if (pointOnChild) {
|
|
204643
204785
|
const inOnOut = RegionOps.testPointInOnOutRegionXY(region, pointOnChild.point.x, pointOnChild.point.y);
|
|
204644
204786
|
pushToInOnOutArrays(splitPaths, inOnOut, result.outsideParts, result.coincidentParts, result.insideParts);
|
|
@@ -204662,10 +204804,10 @@ class RegionOps {
|
|
|
204662
204804
|
* normal in z column. If not a rectangle, return undefined.
|
|
204663
204805
|
*/
|
|
204664
204806
|
static rectangleEdgeTransform(data, requireClosurePoint = true) {
|
|
204665
|
-
if (data instanceof
|
|
204807
|
+
if (data instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
|
|
204666
204808
|
return this.rectangleEdgeTransform(data.packedPoints);
|
|
204667
204809
|
}
|
|
204668
|
-
else if (data instanceof
|
|
204810
|
+
else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
|
|
204669
204811
|
let dataToUse;
|
|
204670
204812
|
if (requireClosurePoint && data.length === 5) {
|
|
204671
204813
|
if (!_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(data.distanceIndexIndex(0, 4)))
|
|
@@ -204679,8 +204821,8 @@ class RegionOps {
|
|
|
204679
204821
|
return undefined;
|
|
204680
204822
|
}
|
|
204681
204823
|
else {
|
|
204682
|
-
dataToUse =
|
|
204683
|
-
|
|
204824
|
+
dataToUse = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(data);
|
|
204825
|
+
_geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_28__.PolylineCompressionContext.compressInPlaceByShortEdgeLength(dataToUse, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
|
|
204684
204826
|
if (dataToUse.length < (requireClosurePoint ? 5 : 4))
|
|
204685
204827
|
return undefined;
|
|
204686
204828
|
}
|
|
@@ -204691,19 +204833,19 @@ class RegionOps {
|
|
|
204691
204833
|
if (normalVector.normalizeInPlace()
|
|
204692
204834
|
&& vector12.isAlmostEqual(vector03)
|
|
204693
204835
|
&& vector01.isPerpendicularTo(vector03)) {
|
|
204694
|
-
return
|
|
204836
|
+
return _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_29__.Transform.createOriginAndMatrixColumns(dataToUse.getPoint3dAtUncheckedPointIndex(0), vector01, vector03, normalVector);
|
|
204695
204837
|
}
|
|
204696
204838
|
}
|
|
204697
204839
|
else if (Array.isArray(data)) {
|
|
204698
|
-
return this.rectangleEdgeTransform(new
|
|
204840
|
+
return this.rectangleEdgeTransform(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__.Point3dArrayCarrier(data), requireClosurePoint);
|
|
204699
204841
|
}
|
|
204700
|
-
else if (data instanceof
|
|
204842
|
+
else if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
|
|
204701
204843
|
return this.rectangleEdgeTransform(data.children[0].packedPoints, true);
|
|
204702
204844
|
}
|
|
204703
|
-
else if (data instanceof
|
|
204845
|
+
else if (data instanceof _Path__WEBPACK_IMPORTED_MODULE_23__.Path && data.children.length === 1 && data.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
|
|
204704
204846
|
return this.rectangleEdgeTransform(data.children[0].packedPoints, requireClosurePoint);
|
|
204705
204847
|
}
|
|
204706
|
-
else if (data instanceof
|
|
204848
|
+
else if (data instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveChain) {
|
|
204707
204849
|
if (!data.checkForNonLinearPrimitives()) {
|
|
204708
204850
|
// const linestring = LineString3d.create();
|
|
204709
204851
|
const strokes = data.getPackedStrokes();
|
|
@@ -204727,7 +204869,7 @@ class RegionOps {
|
|
|
204727
204869
|
* @param options options for tolerance and selective simplification.
|
|
204728
204870
|
*/
|
|
204729
204871
|
static consolidateAdjacentPrimitives(curves, options) {
|
|
204730
|
-
const context = new
|
|
204872
|
+
const context = new _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_31__.ConsolidateAdjacentCurvePrimitivesContext(options);
|
|
204731
204873
|
curves.dispatchToGeometryHandler(context);
|
|
204732
204874
|
}
|
|
204733
204875
|
/**
|
|
@@ -204745,14 +204887,14 @@ class RegionOps {
|
|
|
204745
204887
|
static sortOuterAndHoleLoopsXY(loops) {
|
|
204746
204888
|
const loopAndArea = [];
|
|
204747
204889
|
for (const candidate of loops) {
|
|
204748
|
-
if (candidate instanceof
|
|
204749
|
-
|
|
204750
|
-
else if (candidate instanceof
|
|
204751
|
-
const loop =
|
|
204752
|
-
|
|
204890
|
+
if (candidate instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop)
|
|
204891
|
+
_geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.pushLoop(loopAndArea, candidate);
|
|
204892
|
+
else if (candidate instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
|
|
204893
|
+
const loop = _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.createPolygon(candidate);
|
|
204894
|
+
_geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.pushLoop(loopAndArea, loop);
|
|
204753
204895
|
}
|
|
204754
204896
|
}
|
|
204755
|
-
return
|
|
204897
|
+
return _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.sortAsAnyRegion(loopAndArea);
|
|
204756
204898
|
}
|
|
204757
204899
|
/**
|
|
204758
204900
|
* Find all xy-areas bounded by the unstructured, possibly intersecting curves.
|
|
@@ -204778,9 +204920,9 @@ class RegionOps {
|
|
|
204778
204920
|
const primitives = RegionOps.collectCurvePrimitives(curvesAndRegions, undefined, true, true);
|
|
204779
204921
|
const range = this.curveArrayRange(primitives);
|
|
204780
204922
|
const areaTol = this.computeXYAreaTolerance(range, tolerance);
|
|
204781
|
-
const intersections =
|
|
204782
|
-
const graph =
|
|
204783
|
-
return
|
|
204923
|
+
const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_33__.CurveCurve.allIntersectionsAmongPrimitivesXY(primitives, tolerance);
|
|
204924
|
+
const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.assembleHalfEdgeGraph(primitives, intersections, tolerance);
|
|
204925
|
+
return _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.collectSignedLoopSetsInHalfEdgeGraph(graph, areaTol);
|
|
204784
204926
|
}
|
|
204785
204927
|
/**
|
|
204786
204928
|
* Collect all `CurvePrimitives` in loosely typed input.
|
|
@@ -204795,10 +204937,10 @@ class RegionOps {
|
|
|
204795
204937
|
*/
|
|
204796
204938
|
static collectCurvePrimitives(candidates, collectorArray, smallestPossiblePrimitives = false, explodeLinestrings = false) {
|
|
204797
204939
|
const results = collectorArray === undefined ? [] : collectorArray;
|
|
204798
|
-
if (candidates instanceof
|
|
204940
|
+
if (candidates instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive) {
|
|
204799
204941
|
candidates.collectCurvePrimitives(results, smallestPossiblePrimitives, explodeLinestrings);
|
|
204800
204942
|
}
|
|
204801
|
-
else if (candidates instanceof
|
|
204943
|
+
else if (candidates instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection) {
|
|
204802
204944
|
candidates.collectCurvePrimitives(results, smallestPossiblePrimitives, explodeLinestrings);
|
|
204803
204945
|
}
|
|
204804
204946
|
else if (Array.isArray(candidates)) {
|
|
@@ -204817,7 +204959,7 @@ class RegionOps {
|
|
|
204817
204959
|
static expandLineStrings(candidates) {
|
|
204818
204960
|
const result = [];
|
|
204819
204961
|
for (const c of candidates) {
|
|
204820
|
-
if (c instanceof
|
|
204962
|
+
if (c instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
|
|
204821
204963
|
for (let i = 0; i + 1 < c.packedPoints.length; i++) {
|
|
204822
204964
|
const q = c.getIndexedSegment(i);
|
|
204823
204965
|
if (q !== undefined)
|
|
@@ -204836,16 +204978,16 @@ class RegionOps {
|
|
|
204836
204978
|
* @param worldToLocal transform to apply to data before computing its range
|
|
204837
204979
|
*/
|
|
204838
204980
|
static curveArrayRange(data, worldToLocal) {
|
|
204839
|
-
const range =
|
|
204840
|
-
if (data instanceof
|
|
204981
|
+
const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_34__.Range3d.create();
|
|
204982
|
+
if (data instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_35__.GeometryQuery)
|
|
204841
204983
|
data.extendRange(range, worldToLocal);
|
|
204842
204984
|
else if (Array.isArray(data)) {
|
|
204843
204985
|
for (const c of data) {
|
|
204844
|
-
if (c instanceof
|
|
204986
|
+
if (c instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_35__.GeometryQuery)
|
|
204845
204987
|
c.extendRange(range, worldToLocal);
|
|
204846
|
-
else if (c instanceof
|
|
204988
|
+
else if (c instanceof _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d)
|
|
204847
204989
|
range.extendPoint(c, worldToLocal);
|
|
204848
|
-
else if (c instanceof
|
|
204990
|
+
else if (c instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray)
|
|
204849
204991
|
range.extendRange(c.getRange(worldToLocal));
|
|
204850
204992
|
else if (Array.isArray(c))
|
|
204851
204993
|
range.extendRange(this.curveArrayRange(c, worldToLocal));
|
|
@@ -204864,37 +205006,37 @@ class RegionOps {
|
|
|
204864
205006
|
if (polygons.length === 0)
|
|
204865
205007
|
return undefined;
|
|
204866
205008
|
const firstEntry = polygons[0];
|
|
204867
|
-
if (
|
|
204868
|
-
graph =
|
|
205009
|
+
if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.isAnyImmediatePointType(firstEntry)) {
|
|
205010
|
+
graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
|
|
204869
205011
|
}
|
|
204870
205012
|
else if (polygons.length > 1) {
|
|
204871
205013
|
let writablePolygons;
|
|
204872
|
-
if (firstEntry instanceof
|
|
205014
|
+
if (firstEntry instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedReadWriteXYZCollection) {
|
|
204873
205015
|
writablePolygons = polygons;
|
|
204874
205016
|
}
|
|
204875
205017
|
else {
|
|
204876
205018
|
writablePolygons = [];
|
|
204877
205019
|
for (const polygon of polygons)
|
|
204878
|
-
writablePolygons.push(
|
|
205020
|
+
writablePolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(polygon));
|
|
204879
205021
|
}
|
|
204880
|
-
const sortedPolygons =
|
|
205022
|
+
const sortedPolygons = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_36__.PolygonOps.sortOuterAndHoleLoopsXY(writablePolygons);
|
|
204881
205023
|
if (sortedPolygons.length === 1) { // below requires exactly one outer loop!
|
|
204882
|
-
if (graph =
|
|
204883
|
-
|
|
205024
|
+
if (graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromLoops(sortedPolygons[0]))
|
|
205025
|
+
_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
|
|
204884
205026
|
}
|
|
204885
205027
|
}
|
|
204886
205028
|
else {
|
|
204887
|
-
graph =
|
|
205029
|
+
graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(firstEntry);
|
|
204888
205030
|
}
|
|
204889
205031
|
}
|
|
204890
205032
|
else {
|
|
204891
|
-
graph =
|
|
205033
|
+
graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
|
|
204892
205034
|
}
|
|
204893
205035
|
if (!graph) {
|
|
204894
205036
|
// Last resort: try full merge. Conveniently, multiple polygons are processed with parity logic.
|
|
204895
|
-
if (graph =
|
|
204896
|
-
if (
|
|
204897
|
-
|
|
205037
|
+
if (graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(polygons, [], (inA, _inB) => inA)) {
|
|
205038
|
+
if (_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.triangulateAllPositiveAreaFaces(graph))
|
|
205039
|
+
_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
|
|
204898
205040
|
}
|
|
204899
205041
|
}
|
|
204900
205042
|
return graph;
|
|
@@ -204904,13 +205046,13 @@ class RegionOps {
|
|
|
204904
205046
|
const strokedComponent = component.cloneStroked(options);
|
|
204905
205047
|
// package the stroked region as polygons
|
|
204906
205048
|
const polygons = [];
|
|
204907
|
-
if (strokedComponent instanceof
|
|
204908
|
-
if (strokedComponent.children.length > 0 && strokedComponent.children[0] instanceof
|
|
205049
|
+
if (strokedComponent instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop) {
|
|
205050
|
+
if (strokedComponent.children.length > 0 && strokedComponent.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d)
|
|
204909
205051
|
polygons.push(strokedComponent.children[0].packedPoints); // expect only 1
|
|
204910
205052
|
}
|
|
204911
|
-
else if (strokedComponent instanceof
|
|
205053
|
+
else if (strokedComponent instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
|
|
204912
205054
|
for (const strokedLoop of strokedComponent.children) {
|
|
204913
|
-
if (strokedLoop.children.length > 0 && strokedLoop.children[0] instanceof
|
|
205055
|
+
if (strokedLoop.children.length > 0 && strokedLoop.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d)
|
|
204914
205056
|
polygons.push(strokedLoop.children[0].packedPoints); // expect only 1
|
|
204915
205057
|
}
|
|
204916
205058
|
}
|
|
@@ -204940,7 +205082,7 @@ class RegionOps {
|
|
|
204940
205082
|
*/
|
|
204941
205083
|
static facetRegionXY(region, options) {
|
|
204942
205084
|
let graph;
|
|
204943
|
-
if (region instanceof
|
|
205085
|
+
if (region instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion) {
|
|
204944
205086
|
for (const child of region.children) {
|
|
204945
205087
|
const childGraph = RegionOps.triangulateRegionComponent(child, options);
|
|
204946
205088
|
if (childGraph) {
|
|
@@ -204962,8 +205104,8 @@ class RegionOps {
|
|
|
204962
205104
|
if (!graph)
|
|
204963
205105
|
return undefined;
|
|
204964
205106
|
if (options?.maximizeConvexFacets)
|
|
204965
|
-
|
|
204966
|
-
return
|
|
205107
|
+
_topology_Merging__WEBPACK_IMPORTED_MODULE_37__.HalfEdgeGraphOps.expandConvexFaces(graph);
|
|
205108
|
+
return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__.PolyfaceBuilder.graphToPolyface(graph, options);
|
|
204967
205109
|
}
|
|
204968
205110
|
/**
|
|
204969
205111
|
* Decompose a polygon with optional holes into an array of convex polygons.
|
|
@@ -204976,11 +205118,11 @@ class RegionOps {
|
|
|
204976
205118
|
if (!graph)
|
|
204977
205119
|
return undefined;
|
|
204978
205120
|
if (maximize)
|
|
204979
|
-
|
|
205121
|
+
_topology_Merging__WEBPACK_IMPORTED_MODULE_37__.HalfEdgeGraphOps.expandConvexFaces(graph);
|
|
204980
205122
|
const convexPolygons = [];
|
|
204981
205123
|
graph.announceFaceLoops((_graph, seed) => {
|
|
204982
|
-
if (!seed.isMaskSet(
|
|
204983
|
-
convexPolygons.push(
|
|
205124
|
+
if (!seed.isMaskSet(_topology_Graph__WEBPACK_IMPORTED_MODULE_16__.HalfEdgeMask.EXTERIOR))
|
|
205125
|
+
convexPolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(seed.collectAroundFace((node) => { return node.getPoint3d(); })));
|
|
204984
205126
|
return true;
|
|
204985
205127
|
});
|
|
204986
205128
|
return convexPolygons;
|
|
@@ -228747,9 +228889,9 @@ class Vector3d extends XYZ {
|
|
|
228747
228889
|
if (dot < 0.0 && !oppositeIsParallel)
|
|
228748
228890
|
return false;
|
|
228749
228891
|
const cross2 = this.crossProductMagnitudeSquared(other);
|
|
228750
|
-
|
|
228751
|
-
|
|
228752
|
-
|
|
228892
|
+
// a2,b2,cross2 are squared lengths of respective vectors
|
|
228893
|
+
// cross2 = sin^2(theta) * a2 * b2
|
|
228894
|
+
// For small theta, sin^2(theta) ~ theta^2
|
|
228753
228895
|
return cross2 <= radianSquaredTol * a2 * b2;
|
|
228754
228896
|
}
|
|
228755
228897
|
/**
|
|
@@ -230704,26 +230846,28 @@ class PolygonOps {
|
|
|
230704
230846
|
return s;
|
|
230705
230847
|
}
|
|
230706
230848
|
/**
|
|
230707
|
-
* Return a Ray3d with
|
|
230708
|
-
* * `origin`
|
|
230709
|
-
* * `direction` is
|
|
230710
|
-
* * `a` is the area.
|
|
230711
|
-
* @param points
|
|
230849
|
+
* Return a [[Ray3d]] with:
|
|
230850
|
+
* * `origin` is the centroid of the polygon,
|
|
230851
|
+
* * `direction` is a unit vector perpendicular to the polygon plane,
|
|
230852
|
+
* * `a` is the polygon area.
|
|
230853
|
+
* @param points the polygon vertices in order. Points can lie in any plane. First and last point do not have to be equal.
|
|
230854
|
+
* @param result optional pre-allocated result to populate and return.
|
|
230712
230855
|
*/
|
|
230713
|
-
static centroidAreaNormal(points) {
|
|
230856
|
+
static centroidAreaNormal(points, result) {
|
|
230714
230857
|
if (Array.isArray(points)) {
|
|
230715
230858
|
const carrier = new _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_5__.Point3dArrayCarrier(points);
|
|
230716
|
-
return this.centroidAreaNormal(carrier);
|
|
230859
|
+
return this.centroidAreaNormal(carrier, result);
|
|
230717
230860
|
}
|
|
230718
230861
|
const n = points.length;
|
|
230719
230862
|
if (n === 3) {
|
|
230720
|
-
const normal = points.crossProductIndexIndexIndex(0, 1, 2);
|
|
230863
|
+
const normal = points.crossProductIndexIndexIndex(0, 1, 2, result?.direction);
|
|
230721
230864
|
const a = 0.5 * normal.magnitude();
|
|
230722
|
-
const centroid = points.getPoint3dAtCheckedPointIndex(0);
|
|
230865
|
+
const centroid = points.getPoint3dAtCheckedPointIndex(0, result?.origin);
|
|
230723
230866
|
points.accumulateScaledXYZ(1, 1.0, centroid);
|
|
230724
230867
|
points.accumulateScaledXYZ(2, 1.0, centroid);
|
|
230725
230868
|
centroid.scaleInPlace(1.0 / 3.0);
|
|
230726
|
-
|
|
230869
|
+
if (!result)
|
|
230870
|
+
result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
|
|
230727
230871
|
if (result.tryNormalizeInPlaceWithAreaWeight(a))
|
|
230728
230872
|
return result;
|
|
230729
230873
|
return undefined;
|
|
@@ -230741,22 +230885,24 @@ class PolygonOps {
|
|
|
230741
230885
|
points.vectorXYAndZIndex(origin, 1, vector0);
|
|
230742
230886
|
let cross = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
230743
230887
|
const centroidSum = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
|
|
230744
|
-
const
|
|
230888
|
+
const normal = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero(result?.direction);
|
|
230745
230889
|
let signedTriangleArea;
|
|
230746
|
-
// This will work with or without closure edge.
|
|
230890
|
+
// This will work with or without closure edge. If closure is given, the last vector is 000.
|
|
230747
230891
|
for (let i = 2; i < n; i++) {
|
|
230748
230892
|
points.vectorXYAndZIndex(origin, i, vector1);
|
|
230749
230893
|
cross = vector0.crossProduct(vector1, cross);
|
|
230750
230894
|
signedTriangleArea = areaNormal.dotProduct(cross); // well, actually twice the area.
|
|
230751
|
-
|
|
230895
|
+
normal.addInPlace(cross); // this grows to twice the area
|
|
230752
230896
|
const b = signedTriangleArea / 6.0;
|
|
230753
230897
|
centroidSum.plus2Scaled(vector0, b, vector1, b, centroidSum);
|
|
230754
230898
|
vector0.setFrom(vector1);
|
|
230755
230899
|
}
|
|
230756
|
-
const area = 0.5 *
|
|
230900
|
+
const area = 0.5 * normal.magnitude();
|
|
230757
230901
|
const inverseArea = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.conditionalDivideFraction(1, area);
|
|
230758
230902
|
if (inverseArea !== undefined) {
|
|
230759
|
-
const
|
|
230903
|
+
const centroid = origin.plusScaled(centroidSum, inverseArea, result?.origin);
|
|
230904
|
+
if (!result)
|
|
230905
|
+
result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
|
|
230760
230906
|
result.tryNormalizeInPlaceWithAreaWeight(area);
|
|
230761
230907
|
return result;
|
|
230762
230908
|
}
|
|
@@ -237730,19 +237876,19 @@ class Matrix4d {
|
|
|
237730
237876
|
this._coffs[15] += scale * beta;
|
|
237731
237877
|
}
|
|
237732
237878
|
/**
|
|
237733
|
-
* Multiply and replace contents of this matrix by A*this*AT where
|
|
237734
|
-
* * A is a pure translation with final column [x,y,z,1]
|
|
237735
|
-
* * this is this matrix.
|
|
237736
|
-
* * AT is the transpose of A.
|
|
237737
|
-
* @param ax x part of translation
|
|
237738
|
-
* @param ay y part of translation
|
|
237739
|
-
* @param az z part of translation
|
|
237879
|
+
* Multiply and replace contents of ` this` matrix by `A*this*AT` where
|
|
237880
|
+
* * `A` is a pure translation with final column [x,y,z,1].
|
|
237881
|
+
* * `this` is this matrix.
|
|
237882
|
+
* * `AT` is the transpose of A.
|
|
237883
|
+
* @param ax x part of translation.
|
|
237884
|
+
* @param ay y part of translation.
|
|
237885
|
+
* @param az z part of translation.
|
|
237740
237886
|
*/
|
|
237741
237887
|
multiplyTranslationSandwichInPlace(ax, ay, az) {
|
|
237742
237888
|
const bx = this._coffs[3];
|
|
237743
237889
|
const by = this._coffs[7];
|
|
237744
237890
|
const bz = this._coffs[11];
|
|
237745
|
-
// matrixB can be non-symmetric
|
|
237891
|
+
// matrixB can be non-symmetric
|
|
237746
237892
|
const cx = this._coffs[12];
|
|
237747
237893
|
const cy = this._coffs[13];
|
|
237748
237894
|
const cz = this._coffs[14];
|
|
@@ -237765,7 +237911,7 @@ class Matrix4d {
|
|
|
237765
237911
|
this._coffs[12] += axBeta;
|
|
237766
237912
|
this._coffs[13] += ayBeta;
|
|
237767
237913
|
this._coffs[14] += azBeta;
|
|
237768
|
-
// coffs[15] is unchanged
|
|
237914
|
+
// coffs[15] is unchanged
|
|
237769
237915
|
}
|
|
237770
237916
|
}
|
|
237771
237917
|
|
|
@@ -237816,8 +237962,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
237816
237962
|
* * e.g. entry 03 is summed x.
|
|
237817
237963
|
* * In this level:
|
|
237818
237964
|
* * the `absoluteQuantity` member is undefined.
|
|
237819
|
-
* * the `localToWorldMap` and `radiiOfGyration` are created
|
|
237820
|
-
* * Second level: after a call to inertiaProductsToPrincipalAxes
|
|
237965
|
+
* * the `localToWorldMap` and `radiiOfGyration` are created but have undefined contents.
|
|
237966
|
+
* * Second level: after a call to `inertiaProductsToPrincipalAxes`, the `localToWorldMap`, `absoluteQuantity` and
|
|
237821
237967
|
* `radiiOfGyration` are filled in.
|
|
237822
237968
|
* @public
|
|
237823
237969
|
*/
|
|
@@ -237837,18 +237983,35 @@ class MomentData {
|
|
|
237837
237983
|
* * This set up with its inverse already constructed.
|
|
237838
237984
|
*/
|
|
237839
237985
|
localToWorldMap;
|
|
237986
|
+
/** Radii of gyration (square roots of principal second moments). */
|
|
237987
|
+
radiusOfGyration;
|
|
237988
|
+
/**
|
|
237989
|
+
* Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
|
|
237990
|
+
* inertiaProductsToPrincipalAxes.
|
|
237991
|
+
*/
|
|
237992
|
+
absoluteQuantity;
|
|
237840
237993
|
// private variables
|
|
237841
237994
|
static _vectorA;
|
|
237842
237995
|
static _vectorB;
|
|
237843
237996
|
static _vectorC;
|
|
237844
237997
|
_point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
237845
237998
|
_point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
237999
|
+
/** Constructor. */
|
|
238000
|
+
constructor() {
|
|
238001
|
+
this.origin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
|
|
238002
|
+
this.needOrigin = false;
|
|
238003
|
+
this.sums = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createZero();
|
|
238004
|
+
this.localToWorldMap = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity();
|
|
238005
|
+
this.radiusOfGyration = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
238006
|
+
this.absoluteQuantity = 0.1; // so optimizer sees its type
|
|
238007
|
+
this.absoluteQuantity = undefined;
|
|
238008
|
+
}
|
|
237846
238009
|
/**
|
|
237847
238010
|
* Return the lower-right (3,3) entry in the sums.
|
|
237848
238011
|
* * This is the quantity (i.e. length, area, or volume) summed.
|
|
237849
238012
|
*/
|
|
237850
238013
|
get quantitySum() {
|
|
237851
|
-
return this.sums.
|
|
238014
|
+
return this.sums.weight();
|
|
237852
238015
|
}
|
|
237853
238016
|
/**
|
|
237854
238017
|
* Return a scale factor to make these sums match the target orientation sign.
|
|
@@ -237879,23 +238042,6 @@ class MomentData {
|
|
|
237879
238042
|
this.needOrigin = false;
|
|
237880
238043
|
}
|
|
237881
238044
|
}
|
|
237882
|
-
/** Radii of gyration (square roots of principal second moments). */
|
|
237883
|
-
radiusOfGyration;
|
|
237884
|
-
/**
|
|
237885
|
-
* Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
|
|
237886
|
-
* inertiaProductsToPrincipalAxes.
|
|
237887
|
-
*/
|
|
237888
|
-
absoluteQuantity;
|
|
237889
|
-
/** Constructor. */
|
|
237890
|
-
constructor() {
|
|
237891
|
-
this.origin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
|
|
237892
|
-
this.sums = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createZero();
|
|
237893
|
-
this.localToWorldMap = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity();
|
|
237894
|
-
this.radiusOfGyration = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
237895
|
-
this.needOrigin = false;
|
|
237896
|
-
this.absoluteQuantity = 0.1; // so optimizer sees its type
|
|
237897
|
-
this.absoluteQuantity = undefined;
|
|
237898
|
-
}
|
|
237899
238045
|
/**
|
|
237900
238046
|
* Create moments with optional origin.
|
|
237901
238047
|
* * Origin and needOrigin are quirky.
|
|
@@ -237939,7 +238085,7 @@ class MomentData {
|
|
|
237939
238085
|
axes.setColumnsPoint4dXYZ(points[0], points[1], points[2]);
|
|
237940
238086
|
if (axes.determinant() < 0)
|
|
237941
238087
|
axes.scaleColumnsInPlace(-1.0, -1.0, -1.0);
|
|
237942
|
-
// prefer x and z positive
|
|
238088
|
+
// prefer x and z positive; y falls wherever
|
|
237943
238089
|
if (axes.at(0, 0) < 0.0)
|
|
237944
238090
|
axes.scaleColumnsInPlace(-1.0, -1.0, 1.0);
|
|
237945
238091
|
if (axes.at(2, 2) < 0.0)
|
|
@@ -237964,7 +238110,8 @@ class MomentData {
|
|
|
237964
238110
|
* * Hence x axis is long direction.
|
|
237965
238111
|
* * Hence planar data generates large moment as Z.
|
|
237966
238112
|
* @param origin The origin used for the inertia products.
|
|
237967
|
-
* @param inertiaProducts The inertia products: sums or integrals of
|
|
238113
|
+
* @param inertiaProducts The inertia products: sums or integrals of
|
|
238114
|
+
* [xx,xy,xz,xw; yx,yy,yz,yw; zx,zy,zz,zw; wx,wy,wz,w].
|
|
237968
238115
|
*/
|
|
237969
238116
|
static inertiaProductsToPrincipalAxes(origin, inertiaProducts) {
|
|
237970
238117
|
const moments = new MomentData();
|
|
@@ -238008,23 +238155,21 @@ class MomentData {
|
|
|
238008
238155
|
*/
|
|
238009
238156
|
static areEquivalentPrincipalAxes(dataA, dataB) {
|
|
238010
238157
|
if (dataA && dataB
|
|
238011
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { //
|
|
238158
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { // TODO: need different tolerance for area, volume?
|
|
238012
238159
|
if (dataA.localToWorldMap.getOrigin().isAlmostEqual(dataB.localToWorldMap.getOrigin())
|
|
238013
238160
|
&& dataA.radiusOfGyration.isAlmostEqual(dataB.radiusOfGyration)) {
|
|
238014
238161
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.y)) {
|
|
238015
|
-
//
|
|
238162
|
+
// we have at least xy symmetry
|
|
238016
238163
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.z))
|
|
238017
238164
|
return true;
|
|
238018
|
-
// just xy
|
|
238019
|
-
// allow opposite z directions.
|
|
238020
|
-
// If the z's are aligned, x an dy can spin freely.
|
|
238165
|
+
// just xy; allow opposite z directions; if the z's are aligned, x and y can spin freely
|
|
238021
238166
|
const zA = dataA.localToWorldMap.matrix.columnZ();
|
|
238022
238167
|
const zB = dataB.localToWorldMap.matrix.columnZ();
|
|
238023
238168
|
if (zA.isParallelTo(zB, true))
|
|
238024
238169
|
return true;
|
|
238025
238170
|
return false;
|
|
238026
238171
|
}
|
|
238027
|
-
// no symmetry
|
|
238172
|
+
// no symmetry; test all three axes
|
|
238028
238173
|
const vectorA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
238029
238174
|
const vectorB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
238030
238175
|
for (let i = 0; i < 3; i++) {
|
|
@@ -238054,7 +238199,7 @@ class MomentData {
|
|
|
238054
238199
|
}
|
|
238055
238200
|
/** Revise the accumulated sums to be "around the centroid". */
|
|
238056
238201
|
shiftOriginAndSumsToCentroidOfSums() {
|
|
238057
|
-
const xyz = this.sums.columnW().realPoint();
|
|
238202
|
+
const xyz = this.sums.columnW().realPoint(); // centroid of the geometry
|
|
238058
238203
|
if (xyz) {
|
|
238059
238204
|
this.shiftOriginAndSumsByXYZ(xyz.x, xyz.y, xyz.z);
|
|
238060
238205
|
return true;
|
|
@@ -238063,9 +238208,9 @@ class MomentData {
|
|
|
238063
238208
|
}
|
|
238064
238209
|
/**
|
|
238065
238210
|
* Revise the accumulated sums.
|
|
238066
|
-
* *
|
|
238067
|
-
* *
|
|
238068
|
-
|
|
238211
|
+
* * Add (ax,ay,az) to the origin coordinates.
|
|
238212
|
+
* * Apply the negative translation to the sums.
|
|
238213
|
+
*/
|
|
238069
238214
|
shiftOriginAndSumsByXYZ(ax, ay, az) {
|
|
238070
238215
|
this.origin.addXYZInPlace(ax, ay, az);
|
|
238071
238216
|
this.sums.multiplyTranslationSandwichInPlace(-ax, -ay, -az);
|
|
@@ -238075,23 +238220,24 @@ class MomentData {
|
|
|
238075
238220
|
this.shiftOriginAndSumsByXYZ(newOrigin.x - this.origin.x, newOrigin.y - this.origin.y, newOrigin.z - this.origin.z);
|
|
238076
238221
|
}
|
|
238077
238222
|
/**
|
|
238078
|
-
* Compute moments of a triangle from the origin
|
|
238079
|
-
*
|
|
238080
|
-
* * If `pointA` is undefined, use `this.origin` as pointA
|
|
238081
|
-
|
|
238082
|
-
*/
|
|
238223
|
+
* Compute moments of a triangle from the origin. Accumulate them to `this.sums`.
|
|
238224
|
+
* * If `this.needOrigin` is set, `this.origin` is set to `pointB`.
|
|
238225
|
+
* * If `pointA` is undefined, use `this.origin` as `pointA`.
|
|
238226
|
+
*/
|
|
238083
238227
|
accumulateTriangleMomentsXY(pointA, pointB, pointC) {
|
|
238084
238228
|
this.setOriginXYZIfNeeded(pointB.x, pointB.y, 0.0);
|
|
238085
238229
|
const x0 = this.origin.x;
|
|
238086
238230
|
const y0 = this.origin.y;
|
|
238087
|
-
const vectorA = MomentData._vectorA =
|
|
238088
|
-
|
|
238089
|
-
|
|
238231
|
+
const vectorA = MomentData._vectorA = (pointA !== undefined) ?
|
|
238232
|
+
_Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointA.x - x0, pointA.y - y0, 0.0, 1.0, MomentData._vectorA) :
|
|
238233
|
+
_Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(0.0, 0.0, 0.0, 1.0, MomentData._vectorA);
|
|
238090
238234
|
const vectorB = MomentData._vectorB = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointB.x - x0, pointB.y - y0, 0.0, 1.0, MomentData._vectorB);
|
|
238091
238235
|
const vectorC = MomentData._vectorC = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointC.x - x0, pointC.y - y0, 0.0, 1.0, MomentData._vectorC);
|
|
238092
|
-
//
|
|
238093
|
-
//
|
|
238094
|
-
//
|
|
238236
|
+
// Below we calculate 16 double integrals: \iint_T [x y 0 1]^ [x y 0 1] dT over triangle T=(A,B,C).
|
|
238237
|
+
// Each accumulates contributions from 9 scaled outer products. Integration computations use the barycentric
|
|
238238
|
+
// change of variables [B-A C-A][u,v]^ = [x,y]^ with Jacobian detJ = B-A x C-A = twice the area of T.
|
|
238239
|
+
// This converts the integration domain from T to the triangle bounded by u=0, v=0 and v=1-u, yielding e.g.,
|
|
238240
|
+
// \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.
|
|
238095
238241
|
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);
|
|
238096
238242
|
if (detJ !== 0.0) {
|
|
238097
238243
|
const r1_12 = detJ / 12.0;
|
|
@@ -238107,7 +238253,7 @@ class MomentData {
|
|
|
238107
238253
|
this.sums.addScaledOuterProductInPlace(vectorC, vectorC, r1_12);
|
|
238108
238254
|
}
|
|
238109
238255
|
}
|
|
238110
|
-
/** Add scaled outer product of (4d, unit weight) point to this.sums
|
|
238256
|
+
/** Add scaled outer product of (4d, unit weight) point to `this.sums`. */
|
|
238111
238257
|
accumulateScaledOuterProduct(point, scaleFactor) {
|
|
238112
238258
|
this.setOriginXYZIfNeeded(point.x, point.y, 0.0);
|
|
238113
238259
|
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);
|
|
@@ -238130,16 +238276,15 @@ class MomentData {
|
|
|
238130
238276
|
this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_3);
|
|
238131
238277
|
}
|
|
238132
238278
|
/**
|
|
238133
|
-
* Compute moments of triangles from a base point to the given linestring.
|
|
238134
|
-
*
|
|
238135
|
-
* * If `
|
|
238136
|
-
* * If `this.needOrigin` is set, the first point of the array is captured as local origin for subsequent sums.
|
|
238137
|
-
*
|
|
238279
|
+
* Compute moments of triangles from a base point to the given linestring. Accumulate them to `this.sums`.
|
|
238280
|
+
* * If `this.needOrigin` is set, `this.origin` is set to the first point of the array.
|
|
238281
|
+
* * If `sweepBase` is undefined, use `this.origin` as `sweepBase`.
|
|
238138
238282
|
*/
|
|
238139
238283
|
accumulateTriangleToLineStringMomentsXY(sweepBase, points) {
|
|
238140
238284
|
const n = points.length;
|
|
238141
238285
|
if (n > 1) {
|
|
238142
238286
|
points.getPoint3dAtUncheckedPointIndex(0, this._point0);
|
|
238287
|
+
// The linestring forms a polygon with sweepBase. Integrate over this polygon using Shoelace algorithm.
|
|
238143
238288
|
for (let i = 1; i < n; i++) {
|
|
238144
238289
|
points.getPoint3dAtUncheckedPointIndex(i, this._point1);
|
|
238145
238290
|
this.accumulateTriangleMomentsXY(sweepBase, this._point0, this._point1);
|
|
@@ -238148,17 +238293,17 @@ class MomentData {
|
|
|
238148
238293
|
}
|
|
238149
238294
|
}
|
|
238150
238295
|
/**
|
|
238151
|
-
*
|
|
238152
|
-
* * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin].
|
|
238153
|
-
* parts of vectors).
|
|
238154
|
-
* *
|
|
238296
|
+
* 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].
|
|
238297
|
+
* * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin].
|
|
238298
|
+
* (column weights 0001; only xy parts of vectors).
|
|
238299
|
+
* * Scale by detJ for the xy-only determinant of the vectors.
|
|
238155
238300
|
* @param productXX
|
|
238156
238301
|
* @param productXY
|
|
238157
238302
|
* @param productYY
|
|
238158
|
-
* @param area
|
|
238159
|
-
* @param origin
|
|
238160
|
-
* @param vectorU
|
|
238161
|
-
* @param vectorV
|
|
238303
|
+
* @param area area in caller's system.
|
|
238304
|
+
* @param origin caller's origin.
|
|
238305
|
+
* @param vectorU caller's U axis (not necessarily unit).
|
|
238306
|
+
* @param vectorV caller's V axis (not necessarily unit).
|
|
238162
238307
|
*/
|
|
238163
238308
|
accumulateXYProductsInCentroidalFrame(productXX, productXY, productYY, area, origin, vectorU, vectorV) {
|
|
238164
238309
|
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);
|
|
@@ -302237,6 +302382,28 @@ const getClassName = (obj) => {
|
|
|
302237
302382
|
};
|
|
302238
302383
|
|
|
302239
302384
|
|
|
302385
|
+
/***/ }),
|
|
302386
|
+
|
|
302387
|
+
/***/ "../../core/frontend/lib/esm/extension/providers lazy recursive":
|
|
302388
|
+
/*!******************************************************************************!*\
|
|
302389
|
+
!*** ../../core/frontend/lib/esm/extension/providers/ lazy namespace object ***!
|
|
302390
|
+
\******************************************************************************/
|
|
302391
|
+
/***/ ((module) => {
|
|
302392
|
+
|
|
302393
|
+
function webpackEmptyAsyncContext(req) {
|
|
302394
|
+
// Here Promise.resolve().then() is used instead of new Promise() to prevent
|
|
302395
|
+
// uncaught exception popping up in devtools
|
|
302396
|
+
return Promise.resolve().then(() => {
|
|
302397
|
+
var e = new Error("Cannot find module '" + req + "'");
|
|
302398
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
302399
|
+
throw e;
|
|
302400
|
+
});
|
|
302401
|
+
}
|
|
302402
|
+
webpackEmptyAsyncContext.keys = () => ([]);
|
|
302403
|
+
webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
|
|
302404
|
+
webpackEmptyAsyncContext.id = "../../core/frontend/lib/esm/extension/providers lazy recursive";
|
|
302405
|
+
module.exports = webpackEmptyAsyncContext;
|
|
302406
|
+
|
|
302240
302407
|
/***/ }),
|
|
302241
302408
|
|
|
302242
302409
|
/***/ "?088e":
|
|
@@ -312309,7 +312476,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
312309
312476
|
/***/ ((module) => {
|
|
312310
312477
|
|
|
312311
312478
|
"use strict";
|
|
312312
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.
|
|
312479
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.10","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"}}');
|
|
312313
312480
|
|
|
312314
312481
|
/***/ })
|
|
312315
312482
|
|