@itwin/ecschema-rpcinterface-tests 5.1.0-dev.1 → 5.1.0-dev.4
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 +361 -255
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -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.
|
|
@@ -84141,6 +84155,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
84141
84155
|
/* harmony import */ var _ViewState__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ViewState */ "../../core/frontend/lib/esm/ViewState.js");
|
|
84142
84156
|
/* harmony import */ var _common_internal_Symbols__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./common/internal/Symbols */ "../../core/frontend/lib/esm/common/internal/Symbols.js");
|
|
84143
84157
|
/* harmony import */ var _IpcApp__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./IpcApp */ "../../core/frontend/lib/esm/IpcApp.js");
|
|
84158
|
+
/* harmony import */ var _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @itwin/ecschema-metadata */ "../../core/ecschema-metadata/lib/esm/ecschema-metadata.js");
|
|
84159
|
+
/* 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
84160
|
/*---------------------------------------------------------------------------------------------
|
|
84145
84161
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
84146
84162
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -84163,6 +84179,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
84163
84179
|
|
|
84164
84180
|
|
|
84165
84181
|
|
|
84182
|
+
|
|
84183
|
+
|
|
84166
84184
|
const loggerCategory = _common_FrontendLoggerCategory__WEBPACK_IMPORTED_MODULE_3__.FrontendLoggerCategory.IModelConnection;
|
|
84167
84185
|
/** A connection to a [IModelDb]($backend) hosted on the backend.
|
|
84168
84186
|
* @public
|
|
@@ -84245,6 +84263,7 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
|
|
|
84245
84263
|
* @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
84264
|
*/
|
|
84247
84265
|
fontMap; // eslint-disable-line @typescript-eslint/no-deprecated
|
|
84266
|
+
_schemaContext;
|
|
84248
84267
|
/** Load the FontMap for this IModelConnection.
|
|
84249
84268
|
* @returns Returns a Promise<FontMap> that is fulfilled when the FontMap member of this IModelConnection is valid.
|
|
84250
84269
|
* @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 +84652,24 @@ class IModelConnection extends _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.I
|
|
|
84633
84652
|
}
|
|
84634
84653
|
return ("number" === typeof this._projectCenterAltitude) ? this._projectCenterAltitude : undefined;
|
|
84635
84654
|
}
|
|
84655
|
+
/**
|
|
84656
|
+
* Gets the context that allows accessing the metadata (see `@itwin/ecschema-metadata` package) of this iModel.
|
|
84657
|
+
* 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.
|
|
84658
|
+
* This means to correctly access schema context, client-side applications must register `ECSchemaRpcInterface` following instructions for [RPC configuration]($docs/learning/rpcinterface/#client-side-configuration).
|
|
84659
|
+
* Server-side applications would also [configure RPC]($docs/learning/rpcinterface/#server-side-configuration) as needed.
|
|
84660
|
+
*
|
|
84661
|
+
* @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.
|
|
84662
|
+
* @beta
|
|
84663
|
+
*/
|
|
84664
|
+
get schemaContext() {
|
|
84665
|
+
if (this._schemaContext === undefined) {
|
|
84666
|
+
const context = new _itwin_ecschema_metadata__WEBPACK_IMPORTED_MODULE_15__.SchemaContext();
|
|
84667
|
+
const locater = new _itwin_ecschema_rpcinterface_common__WEBPACK_IMPORTED_MODULE_16__.ECSchemaRpcLocater(this._getRpcProps());
|
|
84668
|
+
context.addFallbackLocater(locater);
|
|
84669
|
+
this._schemaContext = context;
|
|
84670
|
+
}
|
|
84671
|
+
return this._schemaContext;
|
|
84672
|
+
}
|
|
84636
84673
|
}
|
|
84637
84674
|
/** A connection that exists without an iModel. Useful for connecting to Reality Data services.
|
|
84638
84675
|
* @note This class exists because our display system requires an IModelConnection type even if only reality data is drawn.
|
|
@@ -108160,12 +108197,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
108160
108197
|
* @internal
|
|
108161
108198
|
*/
|
|
108162
108199
|
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);
|
|
108200
|
+
const module = await __webpack_require__("../../core/frontend/lib/esm/extension/providers lazy recursive")(jsUrl);
|
|
108169
108201
|
return execute(module);
|
|
108170
108202
|
}
|
|
108171
108203
|
/** attempts to execute an extension module */
|
|
@@ -117958,7 +117990,7 @@ class MeshGraphic extends _Graphic__WEBPACK_IMPORTED_MODULE_2__.Graphic {
|
|
|
117958
117990
|
}
|
|
117959
117991
|
unionRange(range) {
|
|
117960
117992
|
if (this._instances)
|
|
117961
|
-
range.extendRange(range);
|
|
117993
|
+
range.extendRange(this._instances.range);
|
|
117962
117994
|
else
|
|
117963
117995
|
range.extendRange(this._meshRange);
|
|
117964
117996
|
}
|
|
@@ -141101,6 +141133,7 @@ class GraphicsCollectorDrawArgs extends _tile_internal__WEBPACK_IMPORTED_MODULE_
|
|
|
141101
141133
|
return undefined;
|
|
141102
141134
|
return new GraphicsCollectorDrawArgs(planes, worldToViewMap, collector, args);
|
|
141103
141135
|
}
|
|
141136
|
+
get shouldCollectClassifierGraphics() { return false; }
|
|
141104
141137
|
}
|
|
141105
141138
|
|
|
141106
141139
|
|
|
@@ -141371,6 +141404,7 @@ class IModelTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_4__.Tile {
|
|
|
141371
141404
|
if (format !== _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.TileFormat.IModel)
|
|
141372
141405
|
return content;
|
|
141373
141406
|
const sizeMultiplier = this.hasSizeMultiplier ? this.sizeMultiplier : undefined;
|
|
141407
|
+
const ecefTransform = this.tree.iModel.isGeoLocated ? this.tree.iModel.getEcefTransform() : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
|
|
141374
141408
|
try {
|
|
141375
141409
|
content = await this.iModelTree.decoder.decode({
|
|
141376
141410
|
stream: streamBuffer,
|
|
@@ -141379,7 +141413,7 @@ class IModelTile extends _tile_internal__WEBPACK_IMPORTED_MODULE_4__.Tile {
|
|
|
141379
141413
|
isCanceled,
|
|
141380
141414
|
sizeMultiplier,
|
|
141381
141415
|
tileData: {
|
|
141382
|
-
ecefTransform
|
|
141416
|
+
ecefTransform,
|
|
141383
141417
|
range: this.range,
|
|
141384
141418
|
layerClassifiers: this.tree.layerHandler?.layerClassifiers,
|
|
141385
141419
|
},
|
|
@@ -142088,7 +142122,8 @@ class IModelTileTree extends _tile_internal__WEBPACK_IMPORTED_MODULE_6__.TileTre
|
|
|
142088
142122
|
draw(args) {
|
|
142089
142123
|
const tiles = this.selectTiles(args);
|
|
142090
142124
|
this._rootTile.draw(args, tiles, this._numStaticTilesSelected);
|
|
142091
|
-
|
|
142125
|
+
if (args.shouldCollectClassifierGraphics)
|
|
142126
|
+
this._layerHandler.collectClassifierGraphics(args, tiles);
|
|
142092
142127
|
}
|
|
142093
142128
|
prune() {
|
|
142094
142129
|
const olderThan = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.now().minus(this.expirationTime);
|
|
@@ -143220,14 +143255,12 @@ class LayerTileTreeReferenceHandler {
|
|
|
143220
143255
|
removals.push(context.viewport.displayStyle.settings.onMapImageryChanged.addListener((imagery) => {
|
|
143221
143256
|
this.setBaseLayerSettings(imagery.backgroundBase);
|
|
143222
143257
|
this.setLayerSettings(imagery.backgroundLayers);
|
|
143223
|
-
this.clearLayers();
|
|
143224
143258
|
}));
|
|
143225
143259
|
}
|
|
143226
143260
|
removals.push(context.viewport.onChangeView.addListener((vp, previousViewState) => {
|
|
143227
143261
|
if ((0,_tile_internal__WEBPACK_IMPORTED_MODULE_1__.compareMapLayer)(previousViewState, vp.view)) {
|
|
143228
143262
|
this.setBaseLayerSettings(mapImagery.backgroundBase);
|
|
143229
143263
|
this.setLayerSettings(mapImagery.backgroundLayers);
|
|
143230
|
-
this.clearLayers();
|
|
143231
143264
|
}
|
|
143232
143265
|
}));
|
|
143233
143266
|
}
|
|
@@ -145895,8 +145928,9 @@ class RealityTileLoader {
|
|
|
145895
145928
|
isCanceled = () => !tile.isLoading;
|
|
145896
145929
|
const { is3d, yAxisUp, iModel, modelId } = tile.realityRoot;
|
|
145897
145930
|
let reader;
|
|
145931
|
+
const ecefTransform = tile.tree.iModel.isGeoLocated ? tile.tree.iModel.getEcefTransform() : _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_1__.Transform.createIdentity();
|
|
145898
145932
|
const tileData = {
|
|
145899
|
-
ecefTransform
|
|
145933
|
+
ecefTransform,
|
|
145900
145934
|
range: tile.range,
|
|
145901
145935
|
layerClassifiers: tile.tree.layerHandler?.layerClassifiers,
|
|
145902
145936
|
};
|
|
@@ -157211,7 +157245,7 @@ class RealityTileTree extends _internal__WEBPACK_IMPORTED_MODULE_6__.TileTree {
|
|
|
157211
157245
|
sortIndices = selectedTiles.map((_x, i) => i);
|
|
157212
157246
|
sortIndices.sort((a, b) => selectedTiles[a].depth - selectedTiles[b].depth);
|
|
157213
157247
|
}
|
|
157214
|
-
if (
|
|
157248
|
+
if (args.shouldCollectClassifierGraphics)
|
|
157215
157249
|
this.collectClassifierGraphics(args, selectedTiles);
|
|
157216
157250
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(selectedTiles.length === displayedTileDescendants.length);
|
|
157217
157251
|
for (let i = 0; i < selectedTiles.length; i++) {
|
|
@@ -159365,6 +159399,8 @@ class TileDrawArgs {
|
|
|
159365
159399
|
processSelectedTiles(_tiles) { }
|
|
159366
159400
|
/* @internal */
|
|
159367
159401
|
get maxRealityTreeSelectionCount() { return undefined; }
|
|
159402
|
+
/* @internal */
|
|
159403
|
+
get shouldCollectClassifierGraphics() { return true; }
|
|
159368
159404
|
}
|
|
159369
159405
|
|
|
159370
159406
|
|
|
@@ -203985,15 +204021,15 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
203985
204021
|
_activeMomentData;
|
|
203986
204022
|
_point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
203987
204023
|
_point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
203988
|
-
/**
|
|
203989
|
-
*
|
|
203990
|
-
* *
|
|
204024
|
+
/**
|
|
204025
|
+
* Accumulate (independent) integrations over:
|
|
204026
|
+
* * The area between the arc and the chord connecting its endpoints.
|
|
204027
|
+
* * The triangle with vertices: origin, arc start, arc end.
|
|
203991
204028
|
*/
|
|
203992
204029
|
handleArc3d(arc) {
|
|
203993
204030
|
const momentData = this._activeMomentData;
|
|
203994
204031
|
const sweepRadians = arc.sweep.sweepRadians;
|
|
203995
204032
|
const alphaRadians = sweepRadians * 0.5;
|
|
203996
|
-
// from https://apps.dtic.mil/dtic/tr/fulltext/u2/274936.pdf page 71 for radius = 1
|
|
203997
204033
|
let s = Math.sin(alphaRadians);
|
|
203998
204034
|
let c = Math.cos(alphaRadians);
|
|
203999
204035
|
let s1 = Math.sin(sweepRadians);
|
|
@@ -204020,12 +204056,12 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204020
204056
|
const pointC = arc.fractionToPoint(1.0);
|
|
204021
204057
|
momentData.accumulateTriangleMomentsXY(undefined, pointB, pointC);
|
|
204022
204058
|
}
|
|
204023
|
-
/** Accumulate integrals over the (triangular) areas from the origin to each line segment */
|
|
204059
|
+
/** Accumulate integrals over the (triangular) areas from the origin to each line segment. */
|
|
204024
204060
|
handleLineString3d(ls) {
|
|
204025
204061
|
const momentData = this._activeMomentData;
|
|
204026
204062
|
momentData.accumulateTriangleToLineStringMomentsXY(undefined, ls.packedPoints);
|
|
204027
204063
|
}
|
|
204028
|
-
/** Accumulate integrals over the (triangular) area from the origin to this line segment */
|
|
204064
|
+
/** Accumulate integrals over the (triangular) area from the origin to this line segment. */
|
|
204029
204065
|
handleLineSegment3d(segment) {
|
|
204030
204066
|
const momentData = this._activeMomentData;
|
|
204031
204067
|
segment.startPoint(this._point0);
|
|
@@ -204041,15 +204077,7 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204041
204077
|
this._activeMomentData = undefined;
|
|
204042
204078
|
return momentData;
|
|
204043
204079
|
}
|
|
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
|
-
*/
|
|
204080
|
+
/** Accumulate integrals from origin to the components of the parity region. */
|
|
204053
204081
|
handleParityRegion(region) {
|
|
204054
204082
|
const allChildMoments = [];
|
|
204055
204083
|
let maxAbsArea = 0.0;
|
|
@@ -204081,7 +204109,7 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204081
204109
|
}
|
|
204082
204110
|
return undefined;
|
|
204083
204111
|
}
|
|
204084
|
-
/** Accumulate
|
|
204112
|
+
/** Accumulate integrals from origin to the components of the union region. */
|
|
204085
204113
|
handleUnionRegion(region) {
|
|
204086
204114
|
const summedMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__.MomentData.create();
|
|
204087
204115
|
for (const child of region.children) {
|
|
@@ -204103,9 +204131,9 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204103
204131
|
this._strokeOptions = options;
|
|
204104
204132
|
return options;
|
|
204105
204133
|
}
|
|
204106
|
-
/**
|
|
204107
|
-
*
|
|
204108
|
-
* * accumulate stroke array.
|
|
204134
|
+
/**
|
|
204135
|
+
* Handle a single curve primitive (not loop).
|
|
204136
|
+
* * Stroke the curve and accumulate stroke array.
|
|
204109
204137
|
*/
|
|
204110
204138
|
handleCurvePrimitive(cp) {
|
|
204111
204139
|
const strokes = _LineString3d__WEBPACK_IMPORTED_MODULE_6__.LineString3d.create();
|
|
@@ -204113,12 +204141,18 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204113
204141
|
cp.emitStrokes(strokes, options);
|
|
204114
204142
|
this.handleLineString3d(strokes);
|
|
204115
204143
|
}
|
|
204116
|
-
/**
|
|
204117
|
-
handleBSplineCurve3d(g) {
|
|
204118
|
-
|
|
204119
|
-
|
|
204120
|
-
/**
|
|
204121
|
-
|
|
204144
|
+
/** Handle strongly typed BSplineCurve3d as generic curve primitive. */
|
|
204145
|
+
handleBSplineCurve3d(g) {
|
|
204146
|
+
return this.handleCurvePrimitive(g);
|
|
204147
|
+
}
|
|
204148
|
+
/** Handle strongly typed BSplineCurve3dH as generic curve primitive. */
|
|
204149
|
+
handleBSplineCurve3dH(g) {
|
|
204150
|
+
return this.handleCurvePrimitive(g);
|
|
204151
|
+
}
|
|
204152
|
+
/** Handle strongly typed TransitionSpiral as generic curve primitive. */
|
|
204153
|
+
handleTransitionSpiral(g) {
|
|
204154
|
+
return this.handleCurvePrimitive(g);
|
|
204155
|
+
}
|
|
204122
204156
|
}
|
|
204123
204157
|
|
|
204124
204158
|
|
|
@@ -204138,41 +204172,43 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
204138
204172
|
/* harmony export */ RegionOps: () => (/* binding */ RegionOps)
|
|
204139
204173
|
/* harmony export */ });
|
|
204140
204174
|
/* 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
|
|
204175
|
+
/* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
|
|
204176
|
+
/* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
|
|
204177
|
+
/* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
|
|
204178
|
+
/* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
|
|
204179
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
204180
|
+
/* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
|
|
204181
|
+
/* harmony import */ var _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/PolylineCompressionByEdgeOffset */ "../../core/geometry/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js");
|
|
204182
|
+
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
204183
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
204184
|
+
/* harmony import */ var _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../geometry3d/SortablePolygon */ "../../core/geometry/lib/esm/geometry3d/SortablePolygon.js");
|
|
204185
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
204150
204186
|
/* 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
|
|
204187
|
+
/* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
|
|
204188
|
+
/* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
|
|
204189
|
+
/* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
|
|
204190
|
+
/* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
|
|
204191
|
+
/* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
|
|
204192
|
+
/* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
204193
|
+
/* harmony import */ var _CurveCurve__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./CurveCurve */ "../../core/geometry/lib/esm/curve/CurveCurve.js");
|
|
204194
|
+
/* harmony import */ var _CurveOps__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
|
|
204195
|
+
/* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
|
|
204160
204196
|
/* 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
|
|
204197
|
+
/* harmony import */ var _GeometryQuery__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
204198
|
+
/* harmony import */ var _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./internalContexts/ChainCollectorContext */ "../../core/geometry/lib/esm/curve/internalContexts/ChainCollectorContext.js");
|
|
204199
|
+
/* harmony import */ var _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./internalContexts/PolygonOffsetContext */ "../../core/geometry/lib/esm/curve/internalContexts/PolygonOffsetContext.js");
|
|
204200
|
+
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
204201
|
+
/* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
204202
|
+
/* harmony import */ var _OffsetOptions__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./OffsetOptions */ "../../core/geometry/lib/esm/curve/OffsetOptions.js");
|
|
204203
|
+
/* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
|
|
204204
|
+
/* harmony import */ var _Path__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./Path */ "../../core/geometry/lib/esm/curve/Path.js");
|
|
204205
|
+
/* harmony import */ var _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./Query/ConsolidateAdjacentPrimitivesContext */ "../../core/geometry/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js");
|
|
204206
|
+
/* harmony import */ var _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./Query/CurveSplitContext */ "../../core/geometry/lib/esm/curve/Query/CurveSplitContext.js");
|
|
204207
|
+
/* harmony import */ var _Query_InOutTests__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./Query/InOutTests */ "../../core/geometry/lib/esm/curve/Query/InOutTests.js");
|
|
204208
|
+
/* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
|
|
204173
204209
|
/* 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
|
|
204210
|
+
/* harmony import */ var _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./RegionOpsClassificationSweeps */ "../../core/geometry/lib/esm/curve/RegionOpsClassificationSweeps.js");
|
|
204211
|
+
/* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
|
|
204176
204212
|
/*---------------------------------------------------------------------------------------------
|
|
204177
204213
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
204178
204214
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -204213,6 +204249,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
204213
204249
|
|
|
204214
204250
|
|
|
204215
204251
|
|
|
204252
|
+
|
|
204253
|
+
|
|
204216
204254
|
|
|
204217
204255
|
|
|
204218
204256
|
|
|
@@ -204242,13 +204280,16 @@ var RegionBinaryOpType;
|
|
|
204242
204280
|
class RegionOps {
|
|
204243
204281
|
/**
|
|
204244
204282
|
* Return moment sums for a loop, parity region, or union region.
|
|
204283
|
+
* * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
204245
204284
|
* * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
|
|
204246
|
-
*
|
|
204247
|
-
*
|
|
204285
|
+
* call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes(rawMomentData.origin, rawMomentData.sums);`
|
|
204286
|
+
* * `rawMomentData.origin` is the centroid of `region`.
|
|
204287
|
+
* * `rawMomentData.sums.weight()` is the signed area of `region`.
|
|
204288
|
+
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
204248
204289
|
*/
|
|
204249
|
-
static computeXYAreaMoments(
|
|
204290
|
+
static computeXYAreaMoments(region) {
|
|
204250
204291
|
const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__.RegionMomentsXY();
|
|
204251
|
-
const result =
|
|
204292
|
+
const result = region.dispatchToGeometryHandler(handler);
|
|
204252
204293
|
if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__.MomentData) {
|
|
204253
204294
|
result.shiftOriginAndSumsToCentroidOfSums();
|
|
204254
204295
|
return result;
|
|
@@ -204257,8 +204298,8 @@ class RegionOps {
|
|
|
204257
204298
|
}
|
|
204258
204299
|
/**
|
|
204259
204300
|
* 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
|
|
204301
|
+
* @param range range of planar region to tolerance.
|
|
204302
|
+
* @param distanceTolerance optional absolute distance tolerance.
|
|
204262
204303
|
*/
|
|
204263
204304
|
static computeXYAreaTolerance(range, distanceTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
|
|
204264
204305
|
// 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 +204308,13 @@ class RegionOps {
|
|
|
204267
204308
|
}
|
|
204268
204309
|
/**
|
|
204269
204310
|
* Return a (signed) xy area for a region.
|
|
204311
|
+
* * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
204270
204312
|
* * The area is negative if and only if the region is oriented clockwise with respect to the positive z-axis.
|
|
204271
|
-
* @param
|
|
204313
|
+
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
204272
204314
|
*/
|
|
204273
|
-
static computeXYArea(
|
|
204315
|
+
static computeXYArea(region) {
|
|
204274
204316
|
const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_0__.RegionMomentsXY();
|
|
204275
|
-
const result =
|
|
204317
|
+
const result = region.dispatchToGeometryHandler(handler);
|
|
204276
204318
|
if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_1__.MomentData) {
|
|
204277
204319
|
return result.quantitySum;
|
|
204278
204320
|
}
|
|
@@ -204280,49 +204322,88 @@ class RegionOps {
|
|
|
204280
204322
|
}
|
|
204281
204323
|
/**
|
|
204282
204324
|
* Return MomentData with the sums of wire moments.
|
|
204325
|
+
* * The input curve should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
204283
204326
|
* * If `rawMomentData` is the MomentData returned by computeXYAreaMoments, convert to principal axes and moments with
|
|
204284
|
-
*
|
|
204285
|
-
*
|
|
204327
|
+
* call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
|
|
204328
|
+
* * `rawMomentData.origin` is the wire centroid of `curve`.
|
|
204329
|
+
* * `rawMomentData.sums.weight()` is the signed length of `curve`.
|
|
204330
|
+
* @param curve any [[CurveCollection]] or [[CurvePrimitive]].
|
|
204286
204331
|
*/
|
|
204287
|
-
static computeXYZWireMomentSums(
|
|
204332
|
+
static computeXYZWireMomentSums(curve) {
|
|
204288
204333
|
const handler = new _CurveWireMomentsXYZ__WEBPACK_IMPORTED_MODULE_3__.CurveWireMomentsXYZ();
|
|
204289
|
-
handler.visitLeaves(
|
|
204334
|
+
handler.visitLeaves(curve);
|
|
204290
204335
|
const result = handler.momentData;
|
|
204291
204336
|
result.shiftOriginAndSumsToCentroidOfSums();
|
|
204292
204337
|
return result;
|
|
204293
204338
|
}
|
|
204339
|
+
/**
|
|
204340
|
+
* Return a [[Ray3d]] with:
|
|
204341
|
+
* * `origin` is the centroid of the region,
|
|
204342
|
+
* * `direction` is a unit vector perpendicular to the region plane,
|
|
204343
|
+
* * `a` is the region area.
|
|
204344
|
+
* @param region the region to process. Can lie in any plane.
|
|
204345
|
+
* @param result optional pre-allocated result to populate and return.
|
|
204346
|
+
*/
|
|
204347
|
+
static centroidAreaNormal(region, result) {
|
|
204348
|
+
const localToWorld = _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_4__.FrameBuilder.createRightHandedFrame(undefined, region);
|
|
204349
|
+
if (!localToWorld)
|
|
204350
|
+
return undefined;
|
|
204351
|
+
const normal = localToWorld.matrix.columnZ(result?.direction);
|
|
204352
|
+
const regionIsXY = normal.isParallelTo(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Vector3d.unitZ(), true);
|
|
204353
|
+
let regionXY = region;
|
|
204354
|
+
if (!regionIsXY) { // rotate the region to be parallel to the xy-plane
|
|
204355
|
+
regionXY = region.cloneTransformed(localToWorld.inverse());
|
|
204356
|
+
if (!regionXY)
|
|
204357
|
+
return undefined;
|
|
204358
|
+
}
|
|
204359
|
+
const momentData = RegionOps.computeXYAreaMoments(regionXY);
|
|
204360
|
+
if (!momentData)
|
|
204361
|
+
return undefined;
|
|
204362
|
+
const centroid = momentData.origin.clone(result?.origin);
|
|
204363
|
+
if (!regionIsXY) // rotate centroid back (area is unchanged)
|
|
204364
|
+
localToWorld.multiplyPoint3d(centroid, centroid);
|
|
204365
|
+
let area = momentData.sums.weight();
|
|
204366
|
+
if (area < 0.0) {
|
|
204367
|
+
area = -area;
|
|
204368
|
+
normal.scale(-1.0, normal);
|
|
204369
|
+
}
|
|
204370
|
+
if (!result)
|
|
204371
|
+
result = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__.Ray3d.createCapture(centroid, normal);
|
|
204372
|
+
result.a = area;
|
|
204373
|
+
return result;
|
|
204374
|
+
}
|
|
204294
204375
|
/**
|
|
204295
204376
|
* Create loops in the graph.
|
|
204296
204377
|
* @internal
|
|
204297
204378
|
*/
|
|
204298
204379
|
static addLoopsToGraph(graph, data, announceIsolatedLoop) {
|
|
204299
|
-
if (data instanceof
|
|
204380
|
+
if (data instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop) {
|
|
204300
204381
|
const points = data.getPackedStrokes();
|
|
204301
204382
|
if (points)
|
|
204302
204383
|
this.addLoopsToGraph(graph, points, announceIsolatedLoop);
|
|
204303
204384
|
}
|
|
204304
|
-
else if (data instanceof
|
|
204385
|
+
else if (data instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
|
|
204305
204386
|
for (const child of data.children) {
|
|
204306
204387
|
const points = child.getPackedStrokes();
|
|
204307
204388
|
if (points)
|
|
204308
204389
|
this.addLoopsToGraph(graph, points, announceIsolatedLoop);
|
|
204309
204390
|
}
|
|
204310
204391
|
}
|
|
204311
|
-
else if (data instanceof
|
|
204312
|
-
const loopSeed =
|
|
204392
|
+
else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
|
|
204393
|
+
const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
|
|
204313
204394
|
if (loopSeed !== undefined)
|
|
204314
204395
|
announceIsolatedLoop(graph, loopSeed);
|
|
204315
204396
|
}
|
|
204316
204397
|
else if (Array.isArray(data)) {
|
|
204317
204398
|
if (data.length > 0) {
|
|
204318
|
-
if (
|
|
204319
|
-
const loopSeed =
|
|
204399
|
+
if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.isAnyImmediatePointType(data[0])) {
|
|
204400
|
+
const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, data);
|
|
204320
204401
|
if (loopSeed !== undefined)
|
|
204321
204402
|
announceIsolatedLoop(graph, loopSeed);
|
|
204322
204403
|
}
|
|
204323
|
-
else if (data[0] instanceof
|
|
204404
|
+
else if (data[0] instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
|
|
204324
204405
|
for (const loop of data) {
|
|
204325
|
-
const loopSeed =
|
|
204406
|
+
const loopSeed = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.directCreateFaceLoopFromCoordinates(graph, loop);
|
|
204326
204407
|
if (loopSeed !== undefined)
|
|
204327
204408
|
announceIsolatedLoop(graph, loopSeed);
|
|
204328
204409
|
}
|
|
@@ -204362,10 +204443,10 @@ class RegionOps {
|
|
|
204362
204443
|
static finishGraphToPolyface(graph, triangulate) {
|
|
204363
204444
|
if (graph) {
|
|
204364
204445
|
if (triangulate) {
|
|
204365
|
-
|
|
204366
|
-
|
|
204446
|
+
_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.triangulateAllPositiveAreaFaces(graph);
|
|
204447
|
+
_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
|
|
204367
204448
|
}
|
|
204368
|
-
return
|
|
204449
|
+
return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__.PolyfaceBuilder.graphToPolyface(graph);
|
|
204369
204450
|
}
|
|
204370
204451
|
return undefined;
|
|
204371
204452
|
}
|
|
@@ -204379,7 +204460,7 @@ class RegionOps {
|
|
|
204379
204460
|
* @param triangulate whether to triangulate the result
|
|
204380
204461
|
*/
|
|
204381
204462
|
static polygonXYAreaIntersectLoopsToPolyface(loopsA, loopsB, triangulate = false) {
|
|
204382
|
-
const graph =
|
|
204463
|
+
const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && inB), this._graphCheckPointFunction);
|
|
204383
204464
|
return this.finishGraphToPolyface(graph, triangulate);
|
|
204384
204465
|
}
|
|
204385
204466
|
/**
|
|
@@ -204392,7 +204473,7 @@ class RegionOps {
|
|
|
204392
204473
|
* @param triangulate whether to triangulate the result
|
|
204393
204474
|
*/
|
|
204394
204475
|
static polygonXYAreaUnionLoopsToPolyface(loopsA, loopsB, triangulate = false) {
|
|
204395
|
-
const graph =
|
|
204476
|
+
const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA || inB), this._graphCheckPointFunction);
|
|
204396
204477
|
return this.finishGraphToPolyface(graph, triangulate);
|
|
204397
204478
|
}
|
|
204398
204479
|
/**
|
|
@@ -204405,7 +204486,7 @@ class RegionOps {
|
|
|
204405
204486
|
* @param triangulate whether to triangulate the result
|
|
204406
204487
|
*/
|
|
204407
204488
|
static polygonXYAreaDifferenceLoopsToPolyface(loopsA, loopsB, triangulate = false) {
|
|
204408
|
-
const graph =
|
|
204489
|
+
const graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(loopsA, loopsB, (inA, inB) => (inA && !inB), this._graphCheckPointFunction);
|
|
204409
204490
|
return this.finishGraphToPolyface(graph, triangulate);
|
|
204410
204491
|
}
|
|
204411
204492
|
/**
|
|
@@ -204422,8 +204503,8 @@ class RegionOps {
|
|
|
204422
204503
|
static regionBooleanXY(loopsA, loopsB, operation, mergeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
|
|
204423
204504
|
// Always return UnionRegion for now. But keep return type as AnyRegion:
|
|
204424
204505
|
// in the future, we might return the *simplest* region type.
|
|
204425
|
-
const result =
|
|
204426
|
-
const context =
|
|
204506
|
+
const result = _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion.create();
|
|
204507
|
+
const context = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionBooleanContext.create(_RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionGroupOpType.Union);
|
|
204427
204508
|
context.addMembers(loopsA, loopsB);
|
|
204428
204509
|
context.annotateAndMergeCurvesInGraph(mergeTolerance);
|
|
204429
204510
|
const range = context.groupA.range().union(context.groupB.range());
|
|
@@ -204435,7 +204516,7 @@ class RegionOps {
|
|
|
204435
204516
|
if (Math.abs(area) < areaTol)
|
|
204436
204517
|
return;
|
|
204437
204518
|
if (faceType === 1) {
|
|
204438
|
-
const loop =
|
|
204519
|
+
const loop = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.createLoopInFace(face);
|
|
204439
204520
|
if (loop)
|
|
204440
204521
|
result.tryAddChild(loop);
|
|
204441
204522
|
}
|
|
@@ -204455,7 +204536,7 @@ class RegionOps {
|
|
|
204455
204536
|
* @param triangulate whether to triangulate the result
|
|
204456
204537
|
*/
|
|
204457
204538
|
static polygonBooleanXYToPolyface(inputA, operation, inputB, triangulate = false) {
|
|
204458
|
-
const graph =
|
|
204539
|
+
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
204540
|
return this.finishGraphToPolyface(graph, triangulate);
|
|
204460
204541
|
}
|
|
204461
204542
|
/**
|
|
@@ -204470,18 +204551,18 @@ class RegionOps {
|
|
|
204470
204551
|
* @param inputB second set of loops
|
|
204471
204552
|
*/
|
|
204472
204553
|
static polygonBooleanXYToLoops(inputA, operation, inputB) {
|
|
204473
|
-
const graph =
|
|
204554
|
+
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
204555
|
if (!graph)
|
|
204475
204556
|
return undefined;
|
|
204476
|
-
const loopEdges =
|
|
204557
|
+
const loopEdges = _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_15__.HalfEdgeGraphSearch.collectExtendedBoundaryLoopsInGraph(graph, _topology_Graph__WEBPACK_IMPORTED_MODULE_16__.HalfEdgeMask.EXTERIOR);
|
|
204477
204558
|
const allLoops = [];
|
|
204478
204559
|
for (const graphLoop of loopEdges) {
|
|
204479
|
-
const points = new
|
|
204560
|
+
const points = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray();
|
|
204480
204561
|
for (const edge of graphLoop)
|
|
204481
204562
|
points.pushXYZ(edge.x, edge.y, edge.z);
|
|
204482
204563
|
points.pushWrap(1);
|
|
204483
|
-
const loop =
|
|
204484
|
-
loop.tryAddChild(
|
|
204564
|
+
const loop = _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.create();
|
|
204565
|
+
loop.tryAddChild(_LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d.createCapture(points));
|
|
204485
204566
|
allLoops.push(loop);
|
|
204486
204567
|
}
|
|
204487
204568
|
return RegionOps.sortOuterAndHoleLoopsXY(allLoops);
|
|
@@ -204499,7 +204580,7 @@ class RegionOps {
|
|
|
204499
204580
|
* object.
|
|
204500
204581
|
*/
|
|
204501
204582
|
static constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions) {
|
|
204502
|
-
const context = new
|
|
204583
|
+
const context = new _internalContexts_PolygonOffsetContext__WEBPACK_IMPORTED_MODULE_19__.PolygonWireOffsetContext();
|
|
204503
204584
|
return context.constructPolygonWireXYOffset(points, wrap, offsetDistanceOrOptions);
|
|
204504
204585
|
}
|
|
204505
204586
|
/**
|
|
@@ -204511,8 +204592,8 @@ class RegionOps {
|
|
|
204511
204592
|
* @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.
|
|
204512
204593
|
*/
|
|
204513
204594
|
static constructCurveXYOffset(curves, offsetDistanceOrOptions) {
|
|
204514
|
-
const offsetOptions =
|
|
204515
|
-
return
|
|
204595
|
+
const offsetOptions = _OffsetOptions__WEBPACK_IMPORTED_MODULE_20__.OffsetOptions.create(offsetDistanceOrOptions);
|
|
204596
|
+
return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.constructCurveXYOffset(curves, offsetOptions);
|
|
204516
204597
|
}
|
|
204517
204598
|
/**
|
|
204518
204599
|
* Test if point (x,y) is IN, OUT or ON a region.
|
|
@@ -204522,7 +204603,7 @@ class RegionOps {
|
|
|
204522
204603
|
* @param y y coordinate of point to test
|
|
204523
204604
|
*/
|
|
204524
204605
|
static testPointInOnOutRegionXY(curves, x, y) {
|
|
204525
|
-
return
|
|
204606
|
+
return _Query_InOutTests__WEBPACK_IMPORTED_MODULE_22__.PointInOnOutContext.testPointInOnOutRegionXY(curves, x, y);
|
|
204526
204607
|
}
|
|
204527
204608
|
/**
|
|
204528
204609
|
* Create curve collection of subtype determined by gaps between the input curves.
|
|
@@ -204546,11 +204627,11 @@ class RegionOps {
|
|
|
204546
204627
|
maxGap = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.maxXY(maxGap, curves[i].endPoint().distance(curves[i + 1].startPoint()));
|
|
204547
204628
|
let collection;
|
|
204548
204629
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(maxGap)) {
|
|
204549
|
-
collection = wrap ?
|
|
204630
|
+
collection = wrap ? _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.create() : _Path__WEBPACK_IMPORTED_MODULE_23__.Path.create();
|
|
204550
204631
|
isPath = true;
|
|
204551
204632
|
}
|
|
204552
204633
|
else {
|
|
204553
|
-
collection =
|
|
204634
|
+
collection = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.BagOfCurves.create();
|
|
204554
204635
|
}
|
|
204555
204636
|
for (const c of curves)
|
|
204556
204637
|
collection.tryAddChild(c);
|
|
@@ -204576,7 +204657,7 @@ class RegionOps {
|
|
|
204576
204657
|
* @param cutterCurves input curves to intersect with `curvesToCut`
|
|
204577
204658
|
*/
|
|
204578
204659
|
static cloneCurvesWithXYSplits(curvesToCut, cutterCurves) {
|
|
204579
|
-
return
|
|
204660
|
+
return _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_25__.CurveSplitContext.cloneCurvesWithXYSplits(curvesToCut, cutterCurves);
|
|
204580
204661
|
}
|
|
204581
204662
|
/**
|
|
204582
204663
|
* Create paths assembled from many curves.
|
|
@@ -204587,11 +204668,11 @@ class RegionOps {
|
|
|
204587
204668
|
static splitToPathsBetweenBreaks(source, makeClones) {
|
|
204588
204669
|
if (source === undefined)
|
|
204589
204670
|
return undefined;
|
|
204590
|
-
if (source instanceof
|
|
204671
|
+
if (source instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive)
|
|
204591
204672
|
return source;
|
|
204592
204673
|
// source is a collection . ..
|
|
204593
204674
|
const primitives = source.collectCurvePrimitives();
|
|
204594
|
-
const chainCollector = new
|
|
204675
|
+
const chainCollector = new _internalContexts_ChainCollectorContext__WEBPACK_IMPORTED_MODULE_27__.ChainCollectorContext(makeClones);
|
|
204595
204676
|
for (const primitive of primitives) {
|
|
204596
204677
|
chainCollector.announceCurvePrimitive(primitive);
|
|
204597
204678
|
}
|
|
@@ -204607,7 +204688,7 @@ class RegionOps {
|
|
|
204607
204688
|
* @returns object with named chains, insideOffsets, outsideOffsets
|
|
204608
204689
|
*/
|
|
204609
204690
|
static collectInsideAndOutsideOffsets(fragments, offsetDistance, gapTolerance) {
|
|
204610
|
-
return
|
|
204691
|
+
return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.collectInsideAndOutsideXYOffsets(fragments, offsetDistance, gapTolerance);
|
|
204611
204692
|
}
|
|
204612
204693
|
/**
|
|
204613
204694
|
* Restructure curve fragments as Paths and Loops.
|
|
@@ -204616,7 +204697,7 @@ class RegionOps {
|
|
|
204616
204697
|
* @returns chains, possibly wrapped in a [[BagOfCurves]].
|
|
204617
204698
|
*/
|
|
204618
204699
|
static collectChains(fragments, gapTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
|
|
204619
|
-
return
|
|
204700
|
+
return _CurveOps__WEBPACK_IMPORTED_MODULE_21__.CurveOps.collectChains(fragments, gapTolerance);
|
|
204620
204701
|
}
|
|
204621
204702
|
/**
|
|
204622
204703
|
* Find all intersections among curves in `curvesToCut` against the boundaries of `region` and return fragments
|
|
@@ -204628,17 +204709,17 @@ class RegionOps {
|
|
|
204628
204709
|
const result = { insideParts: [], outsideParts: [], coincidentParts: [] };
|
|
204629
204710
|
const pathWithIntersectionMarkup = RegionOps.cloneCurvesWithXYSplits(curvesToCut, region);
|
|
204630
204711
|
const splitPaths = RegionOps.splitToPathsBetweenBreaks(pathWithIntersectionMarkup, true);
|
|
204631
|
-
if (splitPaths instanceof
|
|
204712
|
+
if (splitPaths instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection) {
|
|
204632
204713
|
for (const child of splitPaths.children) {
|
|
204633
|
-
const pointOnChild =
|
|
204714
|
+
const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(child);
|
|
204634
204715
|
if (pointOnChild) {
|
|
204635
204716
|
const inOnOut = RegionOps.testPointInOnOutRegionXY(region, pointOnChild.point.x, pointOnChild.point.y);
|
|
204636
204717
|
pushToInOnOutArrays(child, inOnOut, result.outsideParts, result.coincidentParts, result.insideParts);
|
|
204637
204718
|
}
|
|
204638
204719
|
}
|
|
204639
204720
|
}
|
|
204640
|
-
else if (splitPaths instanceof
|
|
204641
|
-
const pointOnChild =
|
|
204721
|
+
else if (splitPaths instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive) {
|
|
204722
|
+
const pointOnChild = _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection.createCurveLocationDetailOnAnyCurvePrimitive(splitPaths);
|
|
204642
204723
|
if (pointOnChild) {
|
|
204643
204724
|
const inOnOut = RegionOps.testPointInOnOutRegionXY(region, pointOnChild.point.x, pointOnChild.point.y);
|
|
204644
204725
|
pushToInOnOutArrays(splitPaths, inOnOut, result.outsideParts, result.coincidentParts, result.insideParts);
|
|
@@ -204662,10 +204743,10 @@ class RegionOps {
|
|
|
204662
204743
|
* normal in z column. If not a rectangle, return undefined.
|
|
204663
204744
|
*/
|
|
204664
204745
|
static rectangleEdgeTransform(data, requireClosurePoint = true) {
|
|
204665
|
-
if (data instanceof
|
|
204746
|
+
if (data instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
|
|
204666
204747
|
return this.rectangleEdgeTransform(data.packedPoints);
|
|
204667
204748
|
}
|
|
204668
|
-
else if (data instanceof
|
|
204749
|
+
else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
|
|
204669
204750
|
let dataToUse;
|
|
204670
204751
|
if (requireClosurePoint && data.length === 5) {
|
|
204671
204752
|
if (!_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.isSmallMetricDistance(data.distanceIndexIndex(0, 4)))
|
|
@@ -204679,8 +204760,8 @@ class RegionOps {
|
|
|
204679
204760
|
return undefined;
|
|
204680
204761
|
}
|
|
204681
204762
|
else {
|
|
204682
|
-
dataToUse =
|
|
204683
|
-
|
|
204763
|
+
dataToUse = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(data);
|
|
204764
|
+
_geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_28__.PolylineCompressionContext.compressInPlaceByShortEdgeLength(dataToUse, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
|
|
204684
204765
|
if (dataToUse.length < (requireClosurePoint ? 5 : 4))
|
|
204685
204766
|
return undefined;
|
|
204686
204767
|
}
|
|
@@ -204691,19 +204772,19 @@ class RegionOps {
|
|
|
204691
204772
|
if (normalVector.normalizeInPlace()
|
|
204692
204773
|
&& vector12.isAlmostEqual(vector03)
|
|
204693
204774
|
&& vector01.isPerpendicularTo(vector03)) {
|
|
204694
|
-
return
|
|
204775
|
+
return _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_29__.Transform.createOriginAndMatrixColumns(dataToUse.getPoint3dAtUncheckedPointIndex(0), vector01, vector03, normalVector);
|
|
204695
204776
|
}
|
|
204696
204777
|
}
|
|
204697
204778
|
else if (Array.isArray(data)) {
|
|
204698
|
-
return this.rectangleEdgeTransform(new
|
|
204779
|
+
return this.rectangleEdgeTransform(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__.Point3dArrayCarrier(data), requireClosurePoint);
|
|
204699
204780
|
}
|
|
204700
|
-
else if (data instanceof
|
|
204781
|
+
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
204782
|
return this.rectangleEdgeTransform(data.children[0].packedPoints, true);
|
|
204702
204783
|
}
|
|
204703
|
-
else if (data instanceof
|
|
204784
|
+
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
204785
|
return this.rectangleEdgeTransform(data.children[0].packedPoints, requireClosurePoint);
|
|
204705
204786
|
}
|
|
204706
|
-
else if (data instanceof
|
|
204787
|
+
else if (data instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveChain) {
|
|
204707
204788
|
if (!data.checkForNonLinearPrimitives()) {
|
|
204708
204789
|
// const linestring = LineString3d.create();
|
|
204709
204790
|
const strokes = data.getPackedStrokes();
|
|
@@ -204727,7 +204808,7 @@ class RegionOps {
|
|
|
204727
204808
|
* @param options options for tolerance and selective simplification.
|
|
204728
204809
|
*/
|
|
204729
204810
|
static consolidateAdjacentPrimitives(curves, options) {
|
|
204730
|
-
const context = new
|
|
204811
|
+
const context = new _Query_ConsolidateAdjacentPrimitivesContext__WEBPACK_IMPORTED_MODULE_31__.ConsolidateAdjacentCurvePrimitivesContext(options);
|
|
204731
204812
|
curves.dispatchToGeometryHandler(context);
|
|
204732
204813
|
}
|
|
204733
204814
|
/**
|
|
@@ -204745,14 +204826,14 @@ class RegionOps {
|
|
|
204745
204826
|
static sortOuterAndHoleLoopsXY(loops) {
|
|
204746
204827
|
const loopAndArea = [];
|
|
204747
204828
|
for (const candidate of loops) {
|
|
204748
|
-
if (candidate instanceof
|
|
204749
|
-
|
|
204750
|
-
else if (candidate instanceof
|
|
204751
|
-
const loop =
|
|
204752
|
-
|
|
204829
|
+
if (candidate instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop)
|
|
204830
|
+
_geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.pushLoop(loopAndArea, candidate);
|
|
204831
|
+
else if (candidate instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedXYZCollection) {
|
|
204832
|
+
const loop = _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop.createPolygon(candidate);
|
|
204833
|
+
_geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.pushLoop(loopAndArea, loop);
|
|
204753
204834
|
}
|
|
204754
204835
|
}
|
|
204755
|
-
return
|
|
204836
|
+
return _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_32__.SortablePolygon.sortAsAnyRegion(loopAndArea);
|
|
204756
204837
|
}
|
|
204757
204838
|
/**
|
|
204758
204839
|
* Find all xy-areas bounded by the unstructured, possibly intersecting curves.
|
|
@@ -204778,9 +204859,9 @@ class RegionOps {
|
|
|
204778
204859
|
const primitives = RegionOps.collectCurvePrimitives(curvesAndRegions, undefined, true, true);
|
|
204779
204860
|
const range = this.curveArrayRange(primitives);
|
|
204780
204861
|
const areaTol = this.computeXYAreaTolerance(range, tolerance);
|
|
204781
|
-
const intersections =
|
|
204782
|
-
const graph =
|
|
204783
|
-
return
|
|
204862
|
+
const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_33__.CurveCurve.allIntersectionsAmongPrimitivesXY(primitives, tolerance);
|
|
204863
|
+
const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.assembleHalfEdgeGraph(primitives, intersections, tolerance);
|
|
204864
|
+
return _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_14__.PlanarSubdivision.collectSignedLoopSetsInHalfEdgeGraph(graph, areaTol);
|
|
204784
204865
|
}
|
|
204785
204866
|
/**
|
|
204786
204867
|
* Collect all `CurvePrimitives` in loosely typed input.
|
|
@@ -204795,10 +204876,10 @@ class RegionOps {
|
|
|
204795
204876
|
*/
|
|
204796
204877
|
static collectCurvePrimitives(candidates, collectorArray, smallestPossiblePrimitives = false, explodeLinestrings = false) {
|
|
204797
204878
|
const results = collectorArray === undefined ? [] : collectorArray;
|
|
204798
|
-
if (candidates instanceof
|
|
204879
|
+
if (candidates instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_26__.CurvePrimitive) {
|
|
204799
204880
|
candidates.collectCurvePrimitives(results, smallestPossiblePrimitives, explodeLinestrings);
|
|
204800
204881
|
}
|
|
204801
|
-
else if (candidates instanceof
|
|
204882
|
+
else if (candidates instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_24__.CurveCollection) {
|
|
204802
204883
|
candidates.collectCurvePrimitives(results, smallestPossiblePrimitives, explodeLinestrings);
|
|
204803
204884
|
}
|
|
204804
204885
|
else if (Array.isArray(candidates)) {
|
|
@@ -204817,7 +204898,7 @@ class RegionOps {
|
|
|
204817
204898
|
static expandLineStrings(candidates) {
|
|
204818
204899
|
const result = [];
|
|
204819
204900
|
for (const c of candidates) {
|
|
204820
|
-
if (c instanceof
|
|
204901
|
+
if (c instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d) {
|
|
204821
204902
|
for (let i = 0; i + 1 < c.packedPoints.length; i++) {
|
|
204822
204903
|
const q = c.getIndexedSegment(i);
|
|
204823
204904
|
if (q !== undefined)
|
|
@@ -204836,16 +204917,16 @@ class RegionOps {
|
|
|
204836
204917
|
* @param worldToLocal transform to apply to data before computing its range
|
|
204837
204918
|
*/
|
|
204838
204919
|
static curveArrayRange(data, worldToLocal) {
|
|
204839
|
-
const range =
|
|
204840
|
-
if (data instanceof
|
|
204920
|
+
const range = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_34__.Range3d.create();
|
|
204921
|
+
if (data instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_35__.GeometryQuery)
|
|
204841
204922
|
data.extendRange(range, worldToLocal);
|
|
204842
204923
|
else if (Array.isArray(data)) {
|
|
204843
204924
|
for (const c of data) {
|
|
204844
|
-
if (c instanceof
|
|
204925
|
+
if (c instanceof _GeometryQuery__WEBPACK_IMPORTED_MODULE_35__.GeometryQuery)
|
|
204845
204926
|
c.extendRange(range, worldToLocal);
|
|
204846
|
-
else if (c instanceof
|
|
204927
|
+
else if (c instanceof _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d)
|
|
204847
204928
|
range.extendPoint(c, worldToLocal);
|
|
204848
|
-
else if (c instanceof
|
|
204929
|
+
else if (c instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray)
|
|
204849
204930
|
range.extendRange(c.getRange(worldToLocal));
|
|
204850
204931
|
else if (Array.isArray(c))
|
|
204851
204932
|
range.extendRange(this.curveArrayRange(c, worldToLocal));
|
|
@@ -204864,37 +204945,37 @@ class RegionOps {
|
|
|
204864
204945
|
if (polygons.length === 0)
|
|
204865
204946
|
return undefined;
|
|
204866
204947
|
const firstEntry = polygons[0];
|
|
204867
|
-
if (
|
|
204868
|
-
graph =
|
|
204948
|
+
if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_5__.Point3d.isAnyImmediatePointType(firstEntry)) {
|
|
204949
|
+
graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
|
|
204869
204950
|
}
|
|
204870
204951
|
else if (polygons.length > 1) {
|
|
204871
204952
|
let writablePolygons;
|
|
204872
|
-
if (firstEntry instanceof
|
|
204953
|
+
if (firstEntry instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_9__.IndexedReadWriteXYZCollection) {
|
|
204873
204954
|
writablePolygons = polygons;
|
|
204874
204955
|
}
|
|
204875
204956
|
else {
|
|
204876
204957
|
writablePolygons = [];
|
|
204877
204958
|
for (const polygon of polygons)
|
|
204878
|
-
writablePolygons.push(
|
|
204959
|
+
writablePolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(polygon));
|
|
204879
204960
|
}
|
|
204880
|
-
const sortedPolygons =
|
|
204961
|
+
const sortedPolygons = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_36__.PolygonOps.sortOuterAndHoleLoopsXY(writablePolygons);
|
|
204881
204962
|
if (sortedPolygons.length === 1) { // below requires exactly one outer loop!
|
|
204882
|
-
if (graph =
|
|
204883
|
-
|
|
204963
|
+
if (graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromLoops(sortedPolygons[0]))
|
|
204964
|
+
_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
|
|
204884
204965
|
}
|
|
204885
204966
|
}
|
|
204886
204967
|
else {
|
|
204887
|
-
graph =
|
|
204968
|
+
graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(firstEntry);
|
|
204888
204969
|
}
|
|
204889
204970
|
}
|
|
204890
204971
|
else {
|
|
204891
|
-
graph =
|
|
204972
|
+
graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.createTriangulatedGraphFromSingleLoop(polygons);
|
|
204892
204973
|
}
|
|
204893
204974
|
if (!graph) {
|
|
204894
204975
|
// Last resort: try full merge. Conveniently, multiple polygons are processed with parity logic.
|
|
204895
|
-
if (graph =
|
|
204896
|
-
if (
|
|
204897
|
-
|
|
204976
|
+
if (graph = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_12__.RegionOpsFaceToFaceSearch.doPolygonBoolean(polygons, [], (inA, _inB) => inA)) {
|
|
204977
|
+
if (_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.triangulateAllPositiveAreaFaces(graph))
|
|
204978
|
+
_topology_Triangulation__WEBPACK_IMPORTED_MODULE_10__.Triangulator.flipTriangles(graph);
|
|
204898
204979
|
}
|
|
204899
204980
|
}
|
|
204900
204981
|
return graph;
|
|
@@ -204904,13 +204985,13 @@ class RegionOps {
|
|
|
204904
204985
|
const strokedComponent = component.cloneStroked(options);
|
|
204905
204986
|
// package the stroked region as polygons
|
|
204906
204987
|
const polygons = [];
|
|
204907
|
-
if (strokedComponent instanceof
|
|
204908
|
-
if (strokedComponent.children.length > 0 && strokedComponent.children[0] instanceof
|
|
204988
|
+
if (strokedComponent instanceof _Loop__WEBPACK_IMPORTED_MODULE_7__.Loop) {
|
|
204989
|
+
if (strokedComponent.children.length > 0 && strokedComponent.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d)
|
|
204909
204990
|
polygons.push(strokedComponent.children[0].packedPoints); // expect only 1
|
|
204910
204991
|
}
|
|
204911
|
-
else if (strokedComponent instanceof
|
|
204992
|
+
else if (strokedComponent instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_8__.ParityRegion) {
|
|
204912
204993
|
for (const strokedLoop of strokedComponent.children) {
|
|
204913
|
-
if (strokedLoop.children.length > 0 && strokedLoop.children[0] instanceof
|
|
204994
|
+
if (strokedLoop.children.length > 0 && strokedLoop.children[0] instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_18__.LineString3d)
|
|
204914
204995
|
polygons.push(strokedLoop.children[0].packedPoints); // expect only 1
|
|
204915
204996
|
}
|
|
204916
204997
|
}
|
|
@@ -204940,7 +205021,7 @@ class RegionOps {
|
|
|
204940
205021
|
*/
|
|
204941
205022
|
static facetRegionXY(region, options) {
|
|
204942
205023
|
let graph;
|
|
204943
|
-
if (region instanceof
|
|
205024
|
+
if (region instanceof _UnionRegion__WEBPACK_IMPORTED_MODULE_13__.UnionRegion) {
|
|
204944
205025
|
for (const child of region.children) {
|
|
204945
205026
|
const childGraph = RegionOps.triangulateRegionComponent(child, options);
|
|
204946
205027
|
if (childGraph) {
|
|
@@ -204962,8 +205043,8 @@ class RegionOps {
|
|
|
204962
205043
|
if (!graph)
|
|
204963
205044
|
return undefined;
|
|
204964
205045
|
if (options?.maximizeConvexFacets)
|
|
204965
|
-
|
|
204966
|
-
return
|
|
205046
|
+
_topology_Merging__WEBPACK_IMPORTED_MODULE_37__.HalfEdgeGraphOps.expandConvexFaces(graph);
|
|
205047
|
+
return _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_11__.PolyfaceBuilder.graphToPolyface(graph, options);
|
|
204967
205048
|
}
|
|
204968
205049
|
/**
|
|
204969
205050
|
* Decompose a polygon with optional holes into an array of convex polygons.
|
|
@@ -204976,11 +205057,11 @@ class RegionOps {
|
|
|
204976
205057
|
if (!graph)
|
|
204977
205058
|
return undefined;
|
|
204978
205059
|
if (maximize)
|
|
204979
|
-
|
|
205060
|
+
_topology_Merging__WEBPACK_IMPORTED_MODULE_37__.HalfEdgeGraphOps.expandConvexFaces(graph);
|
|
204980
205061
|
const convexPolygons = [];
|
|
204981
205062
|
graph.announceFaceLoops((_graph, seed) => {
|
|
204982
|
-
if (!seed.isMaskSet(
|
|
204983
|
-
convexPolygons.push(
|
|
205063
|
+
if (!seed.isMaskSet(_topology_Graph__WEBPACK_IMPORTED_MODULE_16__.HalfEdgeMask.EXTERIOR))
|
|
205064
|
+
convexPolygons.push(_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_17__.GrowableXYZArray.create(seed.collectAroundFace((node) => { return node.getPoint3d(); })));
|
|
204984
205065
|
return true;
|
|
204985
205066
|
});
|
|
204986
205067
|
return convexPolygons;
|
|
@@ -228747,9 +228828,9 @@ class Vector3d extends XYZ {
|
|
|
228747
228828
|
if (dot < 0.0 && !oppositeIsParallel)
|
|
228748
228829
|
return false;
|
|
228749
228830
|
const cross2 = this.crossProductMagnitudeSquared(other);
|
|
228750
|
-
|
|
228751
|
-
|
|
228752
|
-
|
|
228831
|
+
// a2,b2,cross2 are squared lengths of respective vectors
|
|
228832
|
+
// cross2 = sin^2(theta) * a2 * b2
|
|
228833
|
+
// For small theta, sin^2(theta) ~ theta^2
|
|
228753
228834
|
return cross2 <= radianSquaredTol * a2 * b2;
|
|
228754
228835
|
}
|
|
228755
228836
|
/**
|
|
@@ -230704,26 +230785,28 @@ class PolygonOps {
|
|
|
230704
230785
|
return s;
|
|
230705
230786
|
}
|
|
230706
230787
|
/**
|
|
230707
|
-
* Return a Ray3d with
|
|
230708
|
-
* * `origin`
|
|
230709
|
-
* * `direction` is
|
|
230710
|
-
* * `a` is the area.
|
|
230711
|
-
* @param points
|
|
230788
|
+
* Return a [[Ray3d]] with:
|
|
230789
|
+
* * `origin` is the centroid of the polygon,
|
|
230790
|
+
* * `direction` is a unit vector perpendicular to the polygon plane,
|
|
230791
|
+
* * `a` is the polygon area.
|
|
230792
|
+
* @param points the polygon vertices in order. Points can lie in any plane. First and last point do not have to be equal.
|
|
230793
|
+
* @param result optional pre-allocated result to populate and return.
|
|
230712
230794
|
*/
|
|
230713
|
-
static centroidAreaNormal(points) {
|
|
230795
|
+
static centroidAreaNormal(points, result) {
|
|
230714
230796
|
if (Array.isArray(points)) {
|
|
230715
230797
|
const carrier = new _Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_5__.Point3dArrayCarrier(points);
|
|
230716
|
-
return this.centroidAreaNormal(carrier);
|
|
230798
|
+
return this.centroidAreaNormal(carrier, result);
|
|
230717
230799
|
}
|
|
230718
230800
|
const n = points.length;
|
|
230719
230801
|
if (n === 3) {
|
|
230720
|
-
const normal = points.crossProductIndexIndexIndex(0, 1, 2);
|
|
230802
|
+
const normal = points.crossProductIndexIndexIndex(0, 1, 2, result?.direction);
|
|
230721
230803
|
const a = 0.5 * normal.magnitude();
|
|
230722
|
-
const centroid = points.getPoint3dAtCheckedPointIndex(0);
|
|
230804
|
+
const centroid = points.getPoint3dAtCheckedPointIndex(0, result?.origin);
|
|
230723
230805
|
points.accumulateScaledXYZ(1, 1.0, centroid);
|
|
230724
230806
|
points.accumulateScaledXYZ(2, 1.0, centroid);
|
|
230725
230807
|
centroid.scaleInPlace(1.0 / 3.0);
|
|
230726
|
-
|
|
230808
|
+
if (!result)
|
|
230809
|
+
result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
|
|
230727
230810
|
if (result.tryNormalizeInPlaceWithAreaWeight(a))
|
|
230728
230811
|
return result;
|
|
230729
230812
|
return undefined;
|
|
@@ -230741,22 +230824,24 @@ class PolygonOps {
|
|
|
230741
230824
|
points.vectorXYAndZIndex(origin, 1, vector0);
|
|
230742
230825
|
let cross = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
230743
230826
|
const centroidSum = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
|
|
230744
|
-
const
|
|
230827
|
+
const normal = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero(result?.direction);
|
|
230745
230828
|
let signedTriangleArea;
|
|
230746
|
-
// This will work with or without closure edge.
|
|
230829
|
+
// This will work with or without closure edge. If closure is given, the last vector is 000.
|
|
230747
230830
|
for (let i = 2; i < n; i++) {
|
|
230748
230831
|
points.vectorXYAndZIndex(origin, i, vector1);
|
|
230749
230832
|
cross = vector0.crossProduct(vector1, cross);
|
|
230750
230833
|
signedTriangleArea = areaNormal.dotProduct(cross); // well, actually twice the area.
|
|
230751
|
-
|
|
230834
|
+
normal.addInPlace(cross); // this grows to twice the area
|
|
230752
230835
|
const b = signedTriangleArea / 6.0;
|
|
230753
230836
|
centroidSum.plus2Scaled(vector0, b, vector1, b, centroidSum);
|
|
230754
230837
|
vector0.setFrom(vector1);
|
|
230755
230838
|
}
|
|
230756
|
-
const area = 0.5 *
|
|
230839
|
+
const area = 0.5 * normal.magnitude();
|
|
230757
230840
|
const inverseArea = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.conditionalDivideFraction(1, area);
|
|
230758
230841
|
if (inverseArea !== undefined) {
|
|
230759
|
-
const
|
|
230842
|
+
const centroid = origin.plusScaled(centroidSum, inverseArea, result?.origin);
|
|
230843
|
+
if (!result)
|
|
230844
|
+
result = _Ray3d__WEBPACK_IMPORTED_MODULE_3__.Ray3d.createCapture(centroid, normal);
|
|
230760
230845
|
result.tryNormalizeInPlaceWithAreaWeight(area);
|
|
230761
230846
|
return result;
|
|
230762
230847
|
}
|
|
@@ -237730,19 +237815,19 @@ class Matrix4d {
|
|
|
237730
237815
|
this._coffs[15] += scale * beta;
|
|
237731
237816
|
}
|
|
237732
237817
|
/**
|
|
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
|
|
237818
|
+
* Multiply and replace contents of ` this` matrix by `A*this*AT` where
|
|
237819
|
+
* * `A` is a pure translation with final column [x,y,z,1].
|
|
237820
|
+
* * `this` is this matrix.
|
|
237821
|
+
* * `AT` is the transpose of A.
|
|
237822
|
+
* @param ax x part of translation.
|
|
237823
|
+
* @param ay y part of translation.
|
|
237824
|
+
* @param az z part of translation.
|
|
237740
237825
|
*/
|
|
237741
237826
|
multiplyTranslationSandwichInPlace(ax, ay, az) {
|
|
237742
237827
|
const bx = this._coffs[3];
|
|
237743
237828
|
const by = this._coffs[7];
|
|
237744
237829
|
const bz = this._coffs[11];
|
|
237745
|
-
// matrixB can be non-symmetric
|
|
237830
|
+
// matrixB can be non-symmetric
|
|
237746
237831
|
const cx = this._coffs[12];
|
|
237747
237832
|
const cy = this._coffs[13];
|
|
237748
237833
|
const cz = this._coffs[14];
|
|
@@ -237765,7 +237850,7 @@ class Matrix4d {
|
|
|
237765
237850
|
this._coffs[12] += axBeta;
|
|
237766
237851
|
this._coffs[13] += ayBeta;
|
|
237767
237852
|
this._coffs[14] += azBeta;
|
|
237768
|
-
// coffs[15] is unchanged
|
|
237853
|
+
// coffs[15] is unchanged
|
|
237769
237854
|
}
|
|
237770
237855
|
}
|
|
237771
237856
|
|
|
@@ -237816,8 +237901,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
237816
237901
|
* * e.g. entry 03 is summed x.
|
|
237817
237902
|
* * In this level:
|
|
237818
237903
|
* * the `absoluteQuantity` member is undefined.
|
|
237819
|
-
* * the `localToWorldMap` and `radiiOfGyration` are created
|
|
237820
|
-
* * Second level: after a call to inertiaProductsToPrincipalAxes
|
|
237904
|
+
* * the `localToWorldMap` and `radiiOfGyration` are created but have undefined contents.
|
|
237905
|
+
* * Second level: after a call to `inertiaProductsToPrincipalAxes`, the `localToWorldMap`, `absoluteQuantity` and
|
|
237821
237906
|
* `radiiOfGyration` are filled in.
|
|
237822
237907
|
* @public
|
|
237823
237908
|
*/
|
|
@@ -237837,18 +237922,35 @@ class MomentData {
|
|
|
237837
237922
|
* * This set up with its inverse already constructed.
|
|
237838
237923
|
*/
|
|
237839
237924
|
localToWorldMap;
|
|
237925
|
+
/** Radii of gyration (square roots of principal second moments). */
|
|
237926
|
+
radiusOfGyration;
|
|
237927
|
+
/**
|
|
237928
|
+
* Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
|
|
237929
|
+
* inertiaProductsToPrincipalAxes.
|
|
237930
|
+
*/
|
|
237931
|
+
absoluteQuantity;
|
|
237840
237932
|
// private variables
|
|
237841
237933
|
static _vectorA;
|
|
237842
237934
|
static _vectorB;
|
|
237843
237935
|
static _vectorC;
|
|
237844
237936
|
_point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
237845
237937
|
_point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
237938
|
+
/** Constructor. */
|
|
237939
|
+
constructor() {
|
|
237940
|
+
this.origin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
|
|
237941
|
+
this.needOrigin = false;
|
|
237942
|
+
this.sums = _Matrix4d__WEBPACK_IMPORTED_MODULE_1__.Matrix4d.createZero();
|
|
237943
|
+
this.localToWorldMap = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity();
|
|
237944
|
+
this.radiusOfGyration = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
237945
|
+
this.absoluteQuantity = 0.1; // so optimizer sees its type
|
|
237946
|
+
this.absoluteQuantity = undefined;
|
|
237947
|
+
}
|
|
237846
237948
|
/**
|
|
237847
237949
|
* Return the lower-right (3,3) entry in the sums.
|
|
237848
237950
|
* * This is the quantity (i.e. length, area, or volume) summed.
|
|
237849
237951
|
*/
|
|
237850
237952
|
get quantitySum() {
|
|
237851
|
-
return this.sums.
|
|
237953
|
+
return this.sums.weight();
|
|
237852
237954
|
}
|
|
237853
237955
|
/**
|
|
237854
237956
|
* Return a scale factor to make these sums match the target orientation sign.
|
|
@@ -237879,23 +237981,6 @@ class MomentData {
|
|
|
237879
237981
|
this.needOrigin = false;
|
|
237880
237982
|
}
|
|
237881
237983
|
}
|
|
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
237984
|
/**
|
|
237900
237985
|
* Create moments with optional origin.
|
|
237901
237986
|
* * Origin and needOrigin are quirky.
|
|
@@ -237939,7 +238024,7 @@ class MomentData {
|
|
|
237939
238024
|
axes.setColumnsPoint4dXYZ(points[0], points[1], points[2]);
|
|
237940
238025
|
if (axes.determinant() < 0)
|
|
237941
238026
|
axes.scaleColumnsInPlace(-1.0, -1.0, -1.0);
|
|
237942
|
-
// prefer x and z positive
|
|
238027
|
+
// prefer x and z positive; y falls wherever
|
|
237943
238028
|
if (axes.at(0, 0) < 0.0)
|
|
237944
238029
|
axes.scaleColumnsInPlace(-1.0, -1.0, 1.0);
|
|
237945
238030
|
if (axes.at(2, 2) < 0.0)
|
|
@@ -237964,7 +238049,8 @@ class MomentData {
|
|
|
237964
238049
|
* * Hence x axis is long direction.
|
|
237965
238050
|
* * Hence planar data generates large moment as Z.
|
|
237966
238051
|
* @param origin The origin used for the inertia products.
|
|
237967
|
-
* @param inertiaProducts The inertia products: sums or integrals of
|
|
238052
|
+
* @param inertiaProducts The inertia products: sums or integrals of
|
|
238053
|
+
* [xx,xy,xz,xw; yx,yy,yz,yw; zx,zy,zz,zw; wx,wy,wz,w].
|
|
237968
238054
|
*/
|
|
237969
238055
|
static inertiaProductsToPrincipalAxes(origin, inertiaProducts) {
|
|
237970
238056
|
const moments = new MomentData();
|
|
@@ -238008,23 +238094,21 @@ class MomentData {
|
|
|
238008
238094
|
*/
|
|
238009
238095
|
static areEquivalentPrincipalAxes(dataA, dataB) {
|
|
238010
238096
|
if (dataA && dataB
|
|
238011
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { //
|
|
238097
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { // TODO: need different tolerance for area, volume?
|
|
238012
238098
|
if (dataA.localToWorldMap.getOrigin().isAlmostEqual(dataB.localToWorldMap.getOrigin())
|
|
238013
238099
|
&& dataA.radiusOfGyration.isAlmostEqual(dataB.radiusOfGyration)) {
|
|
238014
238100
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.y)) {
|
|
238015
|
-
//
|
|
238101
|
+
// we have at least xy symmetry
|
|
238016
238102
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.z))
|
|
238017
238103
|
return true;
|
|
238018
|
-
// just xy
|
|
238019
|
-
// allow opposite z directions.
|
|
238020
|
-
// If the z's are aligned, x an dy can spin freely.
|
|
238104
|
+
// just xy; allow opposite z directions; if the z's are aligned, x and y can spin freely
|
|
238021
238105
|
const zA = dataA.localToWorldMap.matrix.columnZ();
|
|
238022
238106
|
const zB = dataB.localToWorldMap.matrix.columnZ();
|
|
238023
238107
|
if (zA.isParallelTo(zB, true))
|
|
238024
238108
|
return true;
|
|
238025
238109
|
return false;
|
|
238026
238110
|
}
|
|
238027
|
-
// no symmetry
|
|
238111
|
+
// no symmetry; test all three axes
|
|
238028
238112
|
const vectorA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
238029
238113
|
const vectorB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
238030
238114
|
for (let i = 0; i < 3; i++) {
|
|
@@ -238054,7 +238138,7 @@ class MomentData {
|
|
|
238054
238138
|
}
|
|
238055
238139
|
/** Revise the accumulated sums to be "around the centroid". */
|
|
238056
238140
|
shiftOriginAndSumsToCentroidOfSums() {
|
|
238057
|
-
const xyz = this.sums.columnW().realPoint();
|
|
238141
|
+
const xyz = this.sums.columnW().realPoint(); // centroid of the geometry
|
|
238058
238142
|
if (xyz) {
|
|
238059
238143
|
this.shiftOriginAndSumsByXYZ(xyz.x, xyz.y, xyz.z);
|
|
238060
238144
|
return true;
|
|
@@ -238063,9 +238147,9 @@ class MomentData {
|
|
|
238063
238147
|
}
|
|
238064
238148
|
/**
|
|
238065
238149
|
* Revise the accumulated sums.
|
|
238066
|
-
* *
|
|
238067
|
-
* *
|
|
238068
|
-
|
|
238150
|
+
* * Add (ax,ay,az) to the origin coordinates.
|
|
238151
|
+
* * Apply the negative translation to the sums.
|
|
238152
|
+
*/
|
|
238069
238153
|
shiftOriginAndSumsByXYZ(ax, ay, az) {
|
|
238070
238154
|
this.origin.addXYZInPlace(ax, ay, az);
|
|
238071
238155
|
this.sums.multiplyTranslationSandwichInPlace(-ax, -ay, -az);
|
|
@@ -238075,23 +238159,24 @@ class MomentData {
|
|
|
238075
238159
|
this.shiftOriginAndSumsByXYZ(newOrigin.x - this.origin.x, newOrigin.y - this.origin.y, newOrigin.z - this.origin.z);
|
|
238076
238160
|
}
|
|
238077
238161
|
/**
|
|
238078
|
-
* Compute moments of a triangle from the origin
|
|
238079
|
-
*
|
|
238080
|
-
* * If `pointA` is undefined, use `this.origin` as pointA
|
|
238081
|
-
|
|
238082
|
-
*/
|
|
238162
|
+
* Compute moments of a triangle from the origin. Accumulate them to `this.sums`.
|
|
238163
|
+
* * If `this.needOrigin` is set, `this.origin` is set to `pointB`.
|
|
238164
|
+
* * If `pointA` is undefined, use `this.origin` as `pointA`.
|
|
238165
|
+
*/
|
|
238083
238166
|
accumulateTriangleMomentsXY(pointA, pointB, pointC) {
|
|
238084
238167
|
this.setOriginXYZIfNeeded(pointB.x, pointB.y, 0.0);
|
|
238085
238168
|
const x0 = this.origin.x;
|
|
238086
238169
|
const y0 = this.origin.y;
|
|
238087
|
-
const vectorA = MomentData._vectorA =
|
|
238088
|
-
|
|
238089
|
-
|
|
238170
|
+
const vectorA = MomentData._vectorA = (pointA !== undefined) ?
|
|
238171
|
+
_Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointA.x - x0, pointA.y - y0, 0.0, 1.0, MomentData._vectorA) :
|
|
238172
|
+
_Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(0.0, 0.0, 0.0, 1.0, MomentData._vectorA);
|
|
238090
238173
|
const vectorB = MomentData._vectorB = _Point4d__WEBPACK_IMPORTED_MODULE_5__.Point4d.create(pointB.x - x0, pointB.y - y0, 0.0, 1.0, MomentData._vectorB);
|
|
238091
238174
|
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
|
-
//
|
|
238175
|
+
// Below we calculate 16 double integrals: \iint_T [x y 0 1]^ [x y 0 1] dT over triangle T=(A,B,C).
|
|
238176
|
+
// Each accumulates contributions from 9 scaled outer products. Integration computations use the barycentric
|
|
238177
|
+
// change of variables [B-A C-A][u,v]^ = [x,y]^ with Jacobian detJ = B-A x C-A = twice the area of T.
|
|
238178
|
+
// This converts the integration domain from T to the triangle bounded by u=0, v=0 and v=1-u, yielding e.g.,
|
|
238179
|
+
// \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
238180
|
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
238181
|
if (detJ !== 0.0) {
|
|
238097
238182
|
const r1_12 = detJ / 12.0;
|
|
@@ -238107,7 +238192,7 @@ class MomentData {
|
|
|
238107
238192
|
this.sums.addScaledOuterProductInPlace(vectorC, vectorC, r1_12);
|
|
238108
238193
|
}
|
|
238109
238194
|
}
|
|
238110
|
-
/** Add scaled outer product of (4d, unit weight) point to this.sums
|
|
238195
|
+
/** Add scaled outer product of (4d, unit weight) point to `this.sums`. */
|
|
238111
238196
|
accumulateScaledOuterProduct(point, scaleFactor) {
|
|
238112
238197
|
this.setOriginXYZIfNeeded(point.x, point.y, 0.0);
|
|
238113
238198
|
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 +238215,15 @@ class MomentData {
|
|
|
238130
238215
|
this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_3);
|
|
238131
238216
|
}
|
|
238132
238217
|
/**
|
|
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
|
-
*
|
|
238218
|
+
* Compute moments of triangles from a base point to the given linestring. Accumulate them to `this.sums`.
|
|
238219
|
+
* * If `this.needOrigin` is set, `this.origin` is set to the first point of the array.
|
|
238220
|
+
* * If `sweepBase` is undefined, use `this.origin` as `sweepBase`.
|
|
238138
238221
|
*/
|
|
238139
238222
|
accumulateTriangleToLineStringMomentsXY(sweepBase, points) {
|
|
238140
238223
|
const n = points.length;
|
|
238141
238224
|
if (n > 1) {
|
|
238142
238225
|
points.getPoint3dAtUncheckedPointIndex(0, this._point0);
|
|
238226
|
+
// The linestring forms a polygon with sweepBase. Integrate over this polygon using Shoelace algorithm.
|
|
238143
238227
|
for (let i = 1; i < n; i++) {
|
|
238144
238228
|
points.getPoint3dAtUncheckedPointIndex(i, this._point1);
|
|
238145
238229
|
this.accumulateTriangleMomentsXY(sweepBase, this._point0, this._point1);
|
|
@@ -238148,17 +238232,17 @@ class MomentData {
|
|
|
238148
238232
|
}
|
|
238149
238233
|
}
|
|
238150
238234
|
/**
|
|
238151
|
-
*
|
|
238152
|
-
* * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin].
|
|
238153
|
-
* parts of vectors).
|
|
238154
|
-
* *
|
|
238235
|
+
* 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].
|
|
238236
|
+
* * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin].
|
|
238237
|
+
* (column weights 0001; only xy parts of vectors).
|
|
238238
|
+
* * Scale by detJ for the xy-only determinant of the vectors.
|
|
238155
238239
|
* @param productXX
|
|
238156
238240
|
* @param productXY
|
|
238157
238241
|
* @param productYY
|
|
238158
|
-
* @param area
|
|
238159
|
-
* @param origin
|
|
238160
|
-
* @param vectorU
|
|
238161
|
-
* @param vectorV
|
|
238242
|
+
* @param area area in caller's system.
|
|
238243
|
+
* @param origin caller's origin.
|
|
238244
|
+
* @param vectorU caller's U axis (not necessarily unit).
|
|
238245
|
+
* @param vectorV caller's V axis (not necessarily unit).
|
|
238162
238246
|
*/
|
|
238163
238247
|
accumulateXYProductsInCentroidalFrame(productXX, productXY, productYY, area, origin, vectorU, vectorV) {
|
|
238164
238248
|
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 +302321,28 @@ const getClassName = (obj) => {
|
|
|
302237
302321
|
};
|
|
302238
302322
|
|
|
302239
302323
|
|
|
302324
|
+
/***/ }),
|
|
302325
|
+
|
|
302326
|
+
/***/ "../../core/frontend/lib/esm/extension/providers lazy recursive":
|
|
302327
|
+
/*!******************************************************************************!*\
|
|
302328
|
+
!*** ../../core/frontend/lib/esm/extension/providers/ lazy namespace object ***!
|
|
302329
|
+
\******************************************************************************/
|
|
302330
|
+
/***/ ((module) => {
|
|
302331
|
+
|
|
302332
|
+
function webpackEmptyAsyncContext(req) {
|
|
302333
|
+
// Here Promise.resolve().then() is used instead of new Promise() to prevent
|
|
302334
|
+
// uncaught exception popping up in devtools
|
|
302335
|
+
return Promise.resolve().then(() => {
|
|
302336
|
+
var e = new Error("Cannot find module '" + req + "'");
|
|
302337
|
+
e.code = 'MODULE_NOT_FOUND';
|
|
302338
|
+
throw e;
|
|
302339
|
+
});
|
|
302340
|
+
}
|
|
302341
|
+
webpackEmptyAsyncContext.keys = () => ([]);
|
|
302342
|
+
webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
|
|
302343
|
+
webpackEmptyAsyncContext.id = "../../core/frontend/lib/esm/extension/providers lazy recursive";
|
|
302344
|
+
module.exports = webpackEmptyAsyncContext;
|
|
302345
|
+
|
|
302240
302346
|
/***/ }),
|
|
302241
302347
|
|
|
302242
302348
|
/***/ "?088e":
|
|
@@ -312309,7 +312415,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
312309
312415
|
/***/ ((module) => {
|
|
312310
312416
|
|
|
312311
312417
|
"use strict";
|
|
312312
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.
|
|
312418
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.4","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
312419
|
|
|
312314
312420
|
/***/ })
|
|
312315
312421
|
|