@itwin/rpcinterface-full-stack-tests 4.3.0-dev.2 → 4.3.0-dev.5
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 +632 -337
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +14 -14
|
@@ -103233,6 +103233,7 @@ const UNIT_DATA = [
|
|
|
103233
103233
|
{ name: "Units.SQ_FT", phenomenon: "Units.AREA", system: "Units.USCUSTOM", conversion: { numerator: 1.0, denominator: .09290304, offset: 0.0 }, displayLabel: "ft²" },
|
|
103234
103234
|
{ name: "Units.SQ_US_SURVEY_FT", phenomenon: "Units.AREA", system: "Units.USCUSTOM", conversion: { numerator: 15499969.0, denominator: 1440000, offset: 0.0 }, displayLabel: "ft² (US Survey)" },
|
|
103235
103235
|
{ name: "Units.SQ_M", phenomenon: "Units.AREA", system: "Units.SI", conversion: { numerator: 1.0, denominator: 1.0, offset: 0.0 }, displayLabel: "m²" },
|
|
103236
|
+
{ name: "Units.SQ_KM", phenomenon: "Units.AREA", system: "Units.SI", conversion: { numerator: 1.0, denominator: 1000000.0, offset: 0.0 }, displayLabel: "km²" },
|
|
103236
103237
|
// conversion => specified unit to base unit m³
|
|
103237
103238
|
{ name: "Units.CUB_FT", phenomenon: "Units.VOLUME", system: "Units.USCUSTOM", conversion: { numerator: 1.0, denominator: 0.028316847, offset: 0.0 }, displayLabel: "ft³" },
|
|
103238
103239
|
{ name: "Units.CUB_US_SURVEY_FT", phenomenon: "Units.VOLUME", system: "Units.USSURVEY", conversion: { numerator: 1, denominator: 0.0283170164937591, offset: 0.0 }, displayLabel: "ft³" },
|
|
@@ -139461,8 +139462,8 @@ class ContextShareProvider {
|
|
|
139461
139462
|
// Not a valid URL for Context share
|
|
139462
139463
|
return false;
|
|
139463
139464
|
}
|
|
139464
|
-
// If api.bentley.com/realitydata is used, it is context share
|
|
139465
|
-
if (tilesetUrl.toLowerCase().includes("api.bentley.com/realitydata"))
|
|
139465
|
+
// If api.bentley.com/realitydata or api.bentley.com/reality-management is used, it is context share
|
|
139466
|
+
if (tilesetUrl.toLowerCase().includes("api.bentley.com/realitydata") || tilesetUrl.toLowerCase().includes("api.bentley.com/reality-management/reality-data"))
|
|
139466
139467
|
return true;
|
|
139467
139468
|
// detect if it is a RDS url
|
|
139468
139469
|
const formattedUrl1 = attUrl.pathname.replace(/~2F/g, "/").replace(/\\/g, "/");
|
|
@@ -139492,16 +139493,24 @@ class ContextShareProvider {
|
|
|
139492
139493
|
// Not a valid URL and not equal, probably $cesiumAsset
|
|
139493
139494
|
return invalidUrlInfo;
|
|
139494
139495
|
}
|
|
139495
|
-
// If api.bentley.com/realitydata is used, it is context share
|
|
139496
|
-
if (tilesetUrl.toLowerCase().includes("api.bentley.com/realitydata")) {
|
|
139496
|
+
// If api.bentley.com/realitydata or api.bentley.com/reality-management is used, it is context share
|
|
139497
|
+
if (tilesetUrl.toLowerCase().includes("api.bentley.com/realitydata") || tilesetUrl.toLowerCase().includes("api.bentley.com/reality-management/reality-data")) {
|
|
139497
139498
|
const lcTilesetUrl = tilesetUrl.toLowerCase();
|
|
139498
139499
|
// NOTICE: We assume it is a ThreeDTile BUT this could technically be a point cloud (OPC).
|
|
139499
139500
|
// This method was used in typical workflow where format was always ThreeDTile and is here for legacy support.
|
|
139500
139501
|
// We don't want to make a call to RDS to resolve format since this method must not be async (it is used in workflow that are not async)
|
|
139501
139502
|
const format = _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.RealityDataFormat.ThreeDTile;
|
|
139502
|
-
|
|
139503
|
+
let indexId = -1;
|
|
139504
|
+
let indexProjectId = -1;
|
|
139505
|
+
if (tilesetUrl.toLowerCase().includes("reality-management/reality-data")) {
|
|
139506
|
+
indexId = lcTilesetUrl.indexOf("reality-management/reality-data/") + 32; // length of "reality-management/reality-data/" = 32;
|
|
139507
|
+
indexProjectId = lcTilesetUrl.indexOf("itwinid=") + 8; // length of "itwinid=" = 8;
|
|
139508
|
+
}
|
|
139509
|
+
else if (tilesetUrl.toLowerCase().includes("realitydata")) {
|
|
139510
|
+
indexId = lcTilesetUrl.indexOf("realitydata/") + 12; // length of "realitydata/" = 12;
|
|
139511
|
+
indexProjectId = lcTilesetUrl.indexOf("projectid=") + 10; // length of "projectid=" = 10;
|
|
139512
|
+
}
|
|
139503
139513
|
const id = lcTilesetUrl.substring(indexId, _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Guid.empty.length + indexId);
|
|
139504
|
-
const indexProjectId = lcTilesetUrl.indexOf("projectid=") + 10; // lenght of "projectid=" = 10;
|
|
139505
139514
|
let projectId;
|
|
139506
139515
|
if (indexProjectId && indexProjectId > 0)
|
|
139507
139516
|
projectId = lcTilesetUrl.substring(indexProjectId, _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Guid.empty.length + indexProjectId);
|
|
@@ -149710,7 +149719,8 @@ var TileGraphicType;
|
|
|
149710
149719
|
*/
|
|
149711
149720
|
class TileTreeReference /* implements RenderMemory.Consumer */ {
|
|
149712
149721
|
/** Force a new tree owner / tile tree to be created for the current tile tree reference
|
|
149713
|
-
|
|
149722
|
+
* @internal
|
|
149723
|
+
*/
|
|
149714
149724
|
resetTreeOwner() { }
|
|
149715
149725
|
/** Disclose *all* TileTrees use by this reference. This may include things like map tiles used for draping on terrain.
|
|
149716
149726
|
* Override this and call super if you have such auxiliary trees.
|
|
@@ -150836,7 +150846,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
150836
150846
|
/** @packageDocumentation
|
|
150837
150847
|
* @module Tiles
|
|
150838
150848
|
*/
|
|
150839
|
-
/**
|
|
150849
|
+
/**
|
|
150850
|
+
* Class representing an ArcGIS error code.
|
|
150851
|
+
* @internal
|
|
150852
|
+
*/
|
|
150840
150853
|
var ArcGisErrorCode;
|
|
150841
150854
|
(function (ArcGisErrorCode) {
|
|
150842
150855
|
ArcGisErrorCode[ArcGisErrorCode["InvalidCredentials"] = 401] = "InvalidCredentials";
|
|
@@ -150845,7 +150858,10 @@ var ArcGisErrorCode;
|
|
|
150845
150858
|
ArcGisErrorCode[ArcGisErrorCode["UnknownError"] = 1000] = "UnknownError";
|
|
150846
150859
|
ArcGisErrorCode[ArcGisErrorCode["NoTokenService"] = 1001] = "NoTokenService";
|
|
150847
150860
|
})(ArcGisErrorCode || (ArcGisErrorCode = {}));
|
|
150848
|
-
/**
|
|
150861
|
+
/**
|
|
150862
|
+
* Class containing utilities relating to ArcGIS services and coordinate systems.
|
|
150863
|
+
* @internal
|
|
150864
|
+
*/
|
|
150849
150865
|
class ArcGisUtilities {
|
|
150850
150866
|
static getBBoxString(range) {
|
|
150851
150867
|
if (!range)
|
|
@@ -150903,6 +150919,12 @@ class ArcGisUtilities {
|
|
|
150903
150919
|
}
|
|
150904
150920
|
return sources;
|
|
150905
150921
|
}
|
|
150922
|
+
/**
|
|
150923
|
+
* Get map layer sources from an ArcGIS query.
|
|
150924
|
+
* @param range Range for the query.
|
|
150925
|
+
* @param url URL for the query.
|
|
150926
|
+
* @returns List of map layer sources.
|
|
150927
|
+
*/
|
|
150906
150928
|
static async getSourcesFromQuery(range, url = "https://usgs.maps.arcgis.com/sharing/rest/search") {
|
|
150907
150929
|
const sources = new Array();
|
|
150908
150930
|
for (let start = 1; start > 0;) {
|
|
@@ -150922,11 +150944,11 @@ class ArcGisUtilities {
|
|
|
150922
150944
|
return sources;
|
|
150923
150945
|
}
|
|
150924
150946
|
/**
|
|
150925
|
-
* Parse the URL to check if it
|
|
150947
|
+
* Parse the URL to check if it represents a valid ArcGIS service
|
|
150926
150948
|
* @param url URL to validate.
|
|
150927
150949
|
* @param serviceType Service type to validate (i.e FeatureServer, MapServer)
|
|
150928
150950
|
* @return Validation Status.
|
|
150929
|
-
|
|
150951
|
+
*/
|
|
150930
150952
|
static validateUrl(url, serviceType) {
|
|
150931
150953
|
const urlObj = new URL(url.toLowerCase());
|
|
150932
150954
|
if (urlObj.pathname.includes("/rest/services/")) {
|
|
@@ -150949,10 +150971,10 @@ class ArcGisUtilities {
|
|
|
150949
150971
|
* @param capabilitiesFilter List of capabilities 'keyword' that needs to be advertised in the service's metadata
|
|
150950
150972
|
* in order to be valid. For example: 'Map', 'Query', etc
|
|
150951
150973
|
* @param userName Username to use for legacy token based security.
|
|
150952
|
-
* @param password
|
|
150974
|
+
* @param password Password to use for legacy token based security.
|
|
150953
150975
|
* @param ignoreCache Flag to skip cache lookup (i.e. force a new server request)
|
|
150954
150976
|
* @return Validation Status. If successful, a list of available sub-layers will also be returned.
|
|
150955
|
-
|
|
150977
|
+
*/
|
|
150956
150978
|
static async validateSource(url, formatId, capabilitiesFilter, userName, password, ignoreCache) {
|
|
150957
150979
|
const metadata = await this.getServiceJson(url, formatId, userName, password, ignoreCache);
|
|
150958
150980
|
const json = metadata?.content;
|
|
@@ -150996,9 +151018,7 @@ class ArcGisUtilities {
|
|
|
150996
151018
|
}
|
|
150997
151019
|
return { status: _internal__WEBPACK_IMPORTED_MODULE_1__.MapLayerSourceStatus.Valid, subLayers };
|
|
150998
151020
|
}
|
|
150999
|
-
/**
|
|
151000
|
-
* Validate MapService tiling metadata and checks if the tile tree is 'Google Maps' compatible.
|
|
151001
|
-
*/
|
|
151021
|
+
/** Validate MapService tiling metadata and checks if the tile tree is 'Google Maps' compatible. */
|
|
151002
151022
|
static isEpsg3857Compatible(tileInfo) {
|
|
151003
151023
|
if (tileInfo.spatialReference?.latestWkid !== 3857 || !Array.isArray(tileInfo.lods))
|
|
151004
151024
|
return false;
|
|
@@ -151006,11 +151026,17 @@ class ArcGisUtilities {
|
|
|
151006
151026
|
return zeroLod.level === 0 && Math.abs(zeroLod.resolution - 156543.03392800014) < .001;
|
|
151007
151027
|
}
|
|
151008
151028
|
/**
|
|
151009
|
-
*
|
|
151029
|
+
* Fetches an ArcGIS service metadata, and returns its JSON representation.
|
|
151010
151030
|
* If an access client has been configured for the specified formatId,
|
|
151011
151031
|
* it will be used to apply required security token.
|
|
151012
151032
|
* By default, response for each URL are cached.
|
|
151013
|
-
|
|
151033
|
+
* @param url URL of the ArcGIS service
|
|
151034
|
+
* @param formatId Format ID of the service
|
|
151035
|
+
* @param userName Username to use for legacy token based security
|
|
151036
|
+
* @param password Password to use for legacy token based security
|
|
151037
|
+
* @param ignoreCache Flag to skip cache lookup (i.e. force a new server request)
|
|
151038
|
+
* @param requireToken Flag to indicate if a token is required
|
|
151039
|
+
*/
|
|
151014
151040
|
static async getServiceJson(url, formatId, userName, password, ignoreCache, requireToken) {
|
|
151015
151041
|
if (!ignoreCache) {
|
|
151016
151042
|
const cached = ArcGisUtilities._serviceCache.get(url);
|
|
@@ -151057,8 +151083,7 @@ class ArcGisUtilities {
|
|
|
151057
151083
|
return undefined;
|
|
151058
151084
|
}
|
|
151059
151085
|
}
|
|
151060
|
-
/** Read a response from ArcGIS server and check for error code in the response.
|
|
151061
|
-
*/
|
|
151086
|
+
/** Read a response from ArcGIS server and check for error code in the response. */
|
|
151062
151087
|
static async checkForResponseErrorCode(response) {
|
|
151063
151088
|
const tmpResponse = response;
|
|
151064
151089
|
if (response.headers && tmpResponse.headers.get("content-type")?.toLowerCase().includes("json")) {
|
|
@@ -151099,8 +151124,7 @@ class ArcGisUtilities {
|
|
|
151099
151124
|
* @param latitude Latitude in degrees to use to compute scales (i.e 0 for Equator)
|
|
151100
151125
|
* @param tileSize Size of a tile in pixels (i.e 256)
|
|
151101
151126
|
* @param screenDpi Monitor resolution in dots per inch (i.e. typically 96dpi is used by Google Maps)
|
|
151102
|
-
*
|
|
151103
|
-
* @returns An array containing resolution and scale values for each requested zoom level
|
|
151127
|
+
* @returns An array containing resolution and scale values for each requested zoom level
|
|
151104
151128
|
*/
|
|
151105
151129
|
static computeZoomLevelsScales(startZoom = 0, endZoom = 20, latitude = 0, tileSize = 256, screenDpi = 96) {
|
|
151106
151130
|
// Note: There is probably a more direct way to compute this, but I prefer to go for a simple and well documented approach.
|
|
@@ -151119,12 +151143,12 @@ class ArcGisUtilities {
|
|
|
151119
151143
|
return results;
|
|
151120
151144
|
}
|
|
151121
151145
|
/**
|
|
151122
|
-
* Match the provided minScale,maxScale values to corresponding wgs84 zoom levels
|
|
151146
|
+
* Match the provided minScale, maxScale values to corresponding wgs84 zoom levels
|
|
151123
151147
|
* @param defaultMaxLod Value of the last LOD (i.e 22)
|
|
151124
151148
|
* @param tileSize Size of a tile in pixels (i.e 256)
|
|
151125
151149
|
* @param minScale Minimum scale value that needs to be matched to a LOD level
|
|
151126
151150
|
* @param maxScale Maximum scale value that needs to be matched to a LOD level
|
|
151127
|
-
|
|
151151
|
+
* @returns minLod: LOD value matching minScale, maxLod: LOD value matching maxScale
|
|
151128
151152
|
*/
|
|
151129
151153
|
static getZoomLevelsScales(defaultMaxLod, tileSize, minScale, maxScale, tolerance = 0) {
|
|
151130
151154
|
let minLod, maxLod;
|
|
@@ -152141,9 +152165,9 @@ class ArcGISMapLayerImageryProvider extends _internal__WEBPACK_IMPORTED_MODULE_2
|
|
|
152141
152165
|
return undefined;
|
|
152142
152166
|
}
|
|
152143
152167
|
}
|
|
152144
|
-
_generateChildIds(
|
|
152145
|
-
const childIds = this.getPotentialChildIds(
|
|
152146
|
-
if (
|
|
152168
|
+
_generateChildIds(quadId, resolveChildren) {
|
|
152169
|
+
const childIds = this.getPotentialChildIds(quadId);
|
|
152170
|
+
if (quadId.level < Math.max(1, this.minimumZoomLevel - 1)) {
|
|
152147
152171
|
resolveChildren(childIds);
|
|
152148
152172
|
return;
|
|
152149
152173
|
}
|
|
@@ -153442,14 +153466,14 @@ class WmtsMapLayerImageryProvider extends _internal__WEBPACK_IMPORTED_MODULE_2__
|
|
|
153442
153466
|
getDisplayedTileMatrixSetAndLimits() {
|
|
153443
153467
|
return this._preferredLayerTileMatrixSet.get(this.displayedLayerName);
|
|
153444
153468
|
}
|
|
153445
|
-
_generateChildIds(
|
|
153446
|
-
const childIds = this.getPotentialChildIds(
|
|
153469
|
+
_generateChildIds(quadId, resolveChildren) {
|
|
153470
|
+
const childIds = this.getPotentialChildIds(quadId);
|
|
153447
153471
|
const matrixSetAndLimits = this.getDisplayedTileMatrixSetAndLimits();
|
|
153448
153472
|
if (!matrixSetAndLimits) {
|
|
153449
153473
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false); // Must always hava a matrix set.
|
|
153450
153474
|
return;
|
|
153451
153475
|
}
|
|
153452
|
-
const limits = matrixSetAndLimits.limits?.[
|
|
153476
|
+
const limits = matrixSetAndLimits.limits?.[quadId.level + 1]?.limits;
|
|
153453
153477
|
if (!limits) {
|
|
153454
153478
|
resolveChildren(childIds);
|
|
153455
153479
|
return;
|
|
@@ -153829,17 +153853,24 @@ class ImageryMapLayerTreeSupplier {
|
|
|
153829
153853
|
}
|
|
153830
153854
|
const imageryTreeSupplier = new ImageryMapLayerTreeSupplier();
|
|
153831
153855
|
/** A reference to one of our tile trees. The specific TileTree drawn may change when the desired imagery type or target iModel changes.
|
|
153832
|
-
* @
|
|
153856
|
+
* @beta
|
|
153833
153857
|
*/
|
|
153834
153858
|
class ImageryMapLayerTreeReference extends _internal__WEBPACK_IMPORTED_MODULE_4__.MapLayerTileTreeReference {
|
|
153835
|
-
|
|
153836
|
-
|
|
153859
|
+
/**
|
|
153860
|
+
* Constructor for an ImageryMapLayerTreeReference.
|
|
153861
|
+
* @param layerSettings Map layer settings that are applied to the ImageryMapLayerTreeReference.
|
|
153862
|
+
* @param layerIndex The index of the associated map layer. Usually passed in through [[createMapLayerTreeReference]] in [[MapTileTree]]'s constructor.
|
|
153863
|
+
* @param iModel The iModel containing the ImageryMapLayerTreeReference.
|
|
153864
|
+
*/
|
|
153865
|
+
constructor(args) {
|
|
153866
|
+
super(args.layerSettings, args.layerIndex, args.iModel);
|
|
153837
153867
|
}
|
|
153838
153868
|
get castsShadows() { return false; }
|
|
153839
153869
|
/** Return the owner of the TileTree to draw. */
|
|
153840
153870
|
get treeOwner() {
|
|
153841
153871
|
return this.iModel.tiles.getTileTreeOwner({ settings: this._layerSettings }, imageryTreeSupplier);
|
|
153842
153872
|
}
|
|
153873
|
+
/* @internal */
|
|
153843
153874
|
resetTreeOwner() {
|
|
153844
153875
|
return this.iModel.tiles.resetTileTreeOwner({ settings: this._layerSettings }, imageryTreeSupplier);
|
|
153845
153876
|
}
|
|
@@ -154106,32 +154137,52 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
154106
154137
|
|
|
154107
154138
|
|
|
154108
154139
|
const loggerCategory = "ArcGISFeatureProvider";
|
|
154109
|
-
/**
|
|
154140
|
+
/**
|
|
154141
|
+
* Class representing a map-layer format.
|
|
154110
154142
|
* Each format has it's unique 'formatId' string, used to uniquely identify a format in the [[MapLayerFormatRegistry]].
|
|
154111
154143
|
* When creating an [[ImageMapLayerSettings]] object, a format needs to be specified this 'formatId'.
|
|
154112
154144
|
* The MapLayerFormat object can later be used to validate a source, or create a provider.
|
|
154113
154145
|
*
|
|
154114
|
-
* Subclasses should override formatId and [[MapLayerFormat.
|
|
154146
|
+
* Subclasses should override formatId, [[MapLayerFormat.createImageryProvider]], and [[MapLayerFormat.createMapLayerTree]].
|
|
154115
154147
|
* @public
|
|
154116
154148
|
*/
|
|
154117
154149
|
class MapLayerFormat {
|
|
154118
|
-
/** Register the current format in the [[MapLayerFormatRegistry]].
|
|
154119
|
-
*/
|
|
154150
|
+
/** Register the current format in the [[MapLayerFormatRegistry]]. */
|
|
154120
154151
|
static register() { _IModelApp__WEBPACK_IMPORTED_MODULE_1__.IModelApp.mapLayerFormatRegistry.register(this); }
|
|
154121
|
-
/**
|
|
154122
|
-
|
|
154152
|
+
/**
|
|
154153
|
+
* Allow a source of a specific format to be validated before being attached as a map-layer.
|
|
154154
|
+
* @param _url The URL of the source.
|
|
154155
|
+
* @param _userName The username to access the source if needed.
|
|
154156
|
+
* @param _password The password to access the source if needed.
|
|
154157
|
+
* @param _ignoreCache Flag to skip cache lookup (i.e. force a new server request).
|
|
154158
|
+
* @returns Validation Status. If successful, a list of available sub-layers may also be returned.
|
|
154159
|
+
*/
|
|
154123
154160
|
static async validateSource(_url, _userName, _password, _ignoreCache) { return { status: _internal__WEBPACK_IMPORTED_MODULE_2__.MapLayerSourceStatus.Valid }; }
|
|
154124
|
-
/**
|
|
154125
|
-
*
|
|
154126
|
-
|
|
154127
|
-
|
|
154128
|
-
|
|
154161
|
+
/**
|
|
154162
|
+
* Create a [[MapLayerImageryProvider]] that will be used to feed data in a map-layer tile tree.
|
|
154163
|
+
* @param _settings The map layer settings to be applied to the imagery provider.
|
|
154164
|
+
* @returns Returns the new imagery provider.
|
|
154165
|
+
* @beta
|
|
154166
|
+
*/
|
|
154167
|
+
static createImageryProvider(_settings) {
|
|
154168
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "Subclasses must override this method.");
|
|
154169
|
+
return undefined;
|
|
154170
|
+
}
|
|
154171
|
+
/**
|
|
154172
|
+
* Creates a MapLayerTileTreeReference for this map layer format.
|
|
154173
|
+
* @param _layerSettings Map layer settings that are applied to the MapLayerTileTreeReference.
|
|
154174
|
+
* @param _layerIndex The index of the associated map layer.
|
|
154175
|
+
* @param _iModel The iModel containing the MapLayerTileTreeReference.
|
|
154176
|
+
* @returns Returns the new tile tree reference.
|
|
154177
|
+
* @beta
|
|
154178
|
+
*/
|
|
154129
154179
|
static createMapLayerTree(_layerSettings, _layerIndex, _iModel) {
|
|
154130
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false);
|
|
154180
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "Subclasses must override this method.");
|
|
154131
154181
|
return undefined;
|
|
154132
154182
|
}
|
|
154133
154183
|
}
|
|
154134
|
-
/**
|
|
154184
|
+
/**
|
|
154185
|
+
* A registry of MapLayerFormats identified by their unique format IDs. The registry can be accessed via [[IModelApp.mapLayerFormatRegistry]].
|
|
154135
154186
|
* @public
|
|
154136
154187
|
*/
|
|
154137
154188
|
class MapLayerFormatRegistry {
|
|
@@ -154174,7 +154225,8 @@ class MapLayerFormatRegistry {
|
|
|
154174
154225
|
}
|
|
154175
154226
|
return format.createMapLayerTree(layerSettings, layerIndex, iModel);
|
|
154176
154227
|
}
|
|
154177
|
-
/**
|
|
154228
|
+
/**
|
|
154229
|
+
* Returns a [[MapLayerImageryProvider]] based on the provided [[ImageMapLayerSettings]] object.
|
|
154178
154230
|
* @internal
|
|
154179
154231
|
*/
|
|
154180
154232
|
createImageryProvider(layerSettings) {
|
|
@@ -154219,7 +154271,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
154219
154271
|
class ImageryMapLayerFormat extends _internal__WEBPACK_IMPORTED_MODULE_0__.MapLayerFormat {
|
|
154220
154272
|
/** @internal */
|
|
154221
154273
|
static createMapLayerTree(layerSettings, layerIndex, iModel) {
|
|
154222
|
-
return new _internal__WEBPACK_IMPORTED_MODULE_0__.ImageryMapLayerTreeReference(layerSettings, layerIndex, iModel);
|
|
154274
|
+
return new _internal__WEBPACK_IMPORTED_MODULE_0__.ImageryMapLayerTreeReference({ layerSettings, layerIndex, iModel });
|
|
154223
154275
|
}
|
|
154224
154276
|
}
|
|
154225
154277
|
class WmsMapLayerFormat extends ImageryMapLayerFormat {
|
|
@@ -154451,15 +154503,23 @@ class MapLayerImageryProvider {
|
|
|
154451
154503
|
this._geographicTilingScheme = new _internal__WEBPACK_IMPORTED_MODULE_5__.GeographicTilingScheme();
|
|
154452
154504
|
/** @internal */
|
|
154453
154505
|
this._status = MapLayerImageryProviderStatus.Valid;
|
|
154454
|
-
|
|
154455
|
-
|
|
154506
|
+
/**
|
|
154507
|
+
* This value is used internally for various computations, this should not get overriden.
|
|
154508
|
+
* @internal
|
|
154509
|
+
*/
|
|
154456
154510
|
this.defaultMinimumZoomLevel = 0;
|
|
154457
|
-
/**
|
|
154511
|
+
/**
|
|
154512
|
+
* This value is used internally for various computations, this should not get overriden.
|
|
154513
|
+
* @internal
|
|
154514
|
+
*/
|
|
154458
154515
|
this.defaultMaximumZoomLevel = 22;
|
|
154459
154516
|
this._mercatorTilingScheme = new _internal__WEBPACK_IMPORTED_MODULE_5__.WebMercatorTilingScheme();
|
|
154460
154517
|
this._geographicTilingScheme = new _internal__WEBPACK_IMPORTED_MODULE_5__.GeographicTilingScheme(2, 1, true);
|
|
154461
154518
|
}
|
|
154462
|
-
/**
|
|
154519
|
+
/**
|
|
154520
|
+
* Initialize the provider by loading the first tile at its default maximum zoom level.
|
|
154521
|
+
* @beta
|
|
154522
|
+
*/
|
|
154463
154523
|
async initialize() {
|
|
154464
154524
|
this.loadTile(0, 0, this.defaultMaximumZoomLevel).then((tileData) => {
|
|
154465
154525
|
if (tileData !== undefined)
|
|
@@ -154467,20 +154527,31 @@ class MapLayerImageryProvider {
|
|
|
154467
154527
|
});
|
|
154468
154528
|
}
|
|
154469
154529
|
get tilingScheme() { return this.useGeographicTilingScheme ? this._geographicTilingScheme : this._mercatorTilingScheme; }
|
|
154470
|
-
/**
|
|
154530
|
+
/**
|
|
154531
|
+
* Add attribution logo cards for the data supplied by this provider to the [[Viewport]]'s logo div.
|
|
154532
|
+
* @param _cards Logo cards HTML element that may contain custom data attributes.
|
|
154533
|
+
* @param _viewport Viewport to add logo cards to.
|
|
154534
|
+
* @beta
|
|
154535
|
+
*/
|
|
154471
154536
|
addLogoCards(_cards, _viewport) { }
|
|
154472
154537
|
/** @internal */
|
|
154473
154538
|
get transparentBackgroundString() { return this._settings.transparentBackground ? "true" : "false"; }
|
|
154474
154539
|
/** @internal */
|
|
154475
154540
|
async _areChildrenAvailable(_tile) { return true; }
|
|
154476
154541
|
/** @internal */
|
|
154477
|
-
getPotentialChildIds(
|
|
154478
|
-
const childLevel =
|
|
154479
|
-
return
|
|
154542
|
+
getPotentialChildIds(quadId) {
|
|
154543
|
+
const childLevel = quadId.level + 1;
|
|
154544
|
+
return quadId.getChildIds(this.tilingScheme.getNumberOfXChildrenAtLevel(childLevel), this.tilingScheme.getNumberOfYChildrenAtLevel(childLevel));
|
|
154480
154545
|
}
|
|
154481
|
-
/**
|
|
154482
|
-
|
|
154483
|
-
|
|
154546
|
+
/**
|
|
154547
|
+
* Get child IDs of a quad and generate tiles based on these child IDs.
|
|
154548
|
+
* See [[ImageryTileTree._loadChildren]] for the definition of `resolveChildren` where this function is commonly called.
|
|
154549
|
+
* @param quadId quad to generate child IDs for.
|
|
154550
|
+
* @param resolveChildren Function that creates tiles from child IDs.
|
|
154551
|
+
* @beta
|
|
154552
|
+
*/
|
|
154553
|
+
_generateChildIds(quadId, resolveChildren) {
|
|
154554
|
+
resolveChildren(this.getPotentialChildIds(quadId));
|
|
154484
154555
|
}
|
|
154485
154556
|
/** @internal */
|
|
154486
154557
|
generateChildIds(tile, resolveChildren) {
|
|
@@ -154488,9 +154559,16 @@ class MapLayerImageryProvider {
|
|
|
154488
154559
|
tile.setLeaf();
|
|
154489
154560
|
return;
|
|
154490
154561
|
}
|
|
154491
|
-
this._generateChildIds(tile, resolveChildren);
|
|
154562
|
+
this._generateChildIds(tile.quadId, resolveChildren);
|
|
154492
154563
|
}
|
|
154493
|
-
/**
|
|
154564
|
+
/**
|
|
154565
|
+
* Get tooltip text for a specific quad and cartographic position.
|
|
154566
|
+
* @param strings List of strings to contain tooltip text.
|
|
154567
|
+
* @param quadId Quad ID to get tooltip for.
|
|
154568
|
+
* @param _carto Cartographic that may be used to retrieve and/or format tooltip text.
|
|
154569
|
+
* @param tree Tree associated with the quad to get the tooltip for.
|
|
154570
|
+
* @internal
|
|
154571
|
+
*/
|
|
154494
154572
|
async getToolTip(strings, quadId, _carto, tree) {
|
|
154495
154573
|
if (doDebugToolTips) {
|
|
154496
154574
|
const range = quadId.getLatLongRangeDegrees(tree.tilingScheme);
|
|
@@ -154525,7 +154603,8 @@ class MapLayerImageryProvider {
|
|
|
154525
154603
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(false, "Invalid tile content type");
|
|
154526
154604
|
return undefined;
|
|
154527
154605
|
}
|
|
154528
|
-
/**
|
|
154606
|
+
/**
|
|
154607
|
+
* Change the status of this provider.
|
|
154529
154608
|
* Sub-classes should override 'onStatusUpdated' instead of this method.
|
|
154530
154609
|
* @internal
|
|
154531
154610
|
*/
|
|
@@ -154608,31 +154687,49 @@ class MapLayerImageryProvider {
|
|
|
154608
154687
|
}
|
|
154609
154688
|
return true;
|
|
154610
154689
|
}
|
|
154611
|
-
/**
|
|
154612
|
-
|
|
154690
|
+
/**
|
|
154691
|
+
* Calculates the projected x cartesian coordinate in EPSG:3857 from the longitude in EPSG:4326 (WGS84)
|
|
154692
|
+
* @param longitude Longitude in EPSG:4326 (WGS84)
|
|
154693
|
+
* @internal
|
|
154694
|
+
*/
|
|
154613
154695
|
getEPSG3857X(longitude) {
|
|
154614
154696
|
return longitude * 20037508.34 / 180.0;
|
|
154615
154697
|
}
|
|
154616
|
-
/**
|
|
154617
|
-
|
|
154698
|
+
/**
|
|
154699
|
+
* Calculates the projected y cartesian coordinate in EPSG:3857 from the latitude in EPSG:4326 (WGS84)
|
|
154700
|
+
* @param latitude Latitude in EPSG:4326 (WGS84)
|
|
154701
|
+
* @internal
|
|
154702
|
+
*/
|
|
154618
154703
|
getEPSG3857Y(latitude) {
|
|
154619
154704
|
const y = Math.log(Math.tan((90.0 + latitude) * Math.PI / 360.0)) / (Math.PI / 180.0);
|
|
154620
154705
|
return y * 20037508.34 / 180.0;
|
|
154621
154706
|
}
|
|
154622
|
-
/**
|
|
154623
|
-
|
|
154707
|
+
/**
|
|
154708
|
+
* Calculates the longitude in EPSG:4326 (WGS84) from the projected x cartesian coordinate in EPSG:3857
|
|
154709
|
+
* @param x3857 Projected x cartesian coordinate in EPSG:3857
|
|
154710
|
+
* @internal
|
|
154711
|
+
*/
|
|
154624
154712
|
getEPSG4326Lon(x3857) {
|
|
154625
154713
|
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Angle.radiansToDegrees(x3857 / earthRadius);
|
|
154626
154714
|
}
|
|
154627
|
-
/**
|
|
154628
|
-
|
|
154715
|
+
/**
|
|
154716
|
+
* Calculates the latitude in EPSG:4326 (WGS84) from the projected y cartesian coordinate in EPSG:3857
|
|
154717
|
+
* @param y3857 Projected y cartesian coordinate in EPSG:3857
|
|
154718
|
+
* @internal
|
|
154719
|
+
*/
|
|
154629
154720
|
getEPSG4326Lat(y3857) {
|
|
154630
154721
|
const y = 2 * Math.atan(Math.exp(y3857 / earthRadius)) - (Math.PI / 2);
|
|
154631
154722
|
return _itwin_core_geometry__WEBPACK_IMPORTED_MODULE_2__.Angle.radiansToDegrees(y);
|
|
154632
154723
|
}
|
|
154633
|
-
/**
|
|
154634
|
-
|
|
154635
|
-
|
|
154724
|
+
/**
|
|
154725
|
+
* Get the bounding box/extents of a tile in EPSG:4326 (WGS84) format.
|
|
154726
|
+
* Map tile providers like Bing and Mapbox allow the URL to be constructed directly from the zoom level and tile coordinates.
|
|
154727
|
+
* However, WMS-based servers take a bounding box instead. This method can help get that bounding box from a tile.
|
|
154728
|
+
* @param row Row of the tile
|
|
154729
|
+
* @param column Column of the tile
|
|
154730
|
+
* @param zoomLevel Desired zoom level of the tile
|
|
154731
|
+
* @internal
|
|
154732
|
+
*/
|
|
154636
154733
|
getEPSG4326Extent(row, column, zoomLevel) {
|
|
154637
154734
|
// Shift left (this.tileSize << zoomLevel) overflow when using 512 pixels tile at higher resolution,
|
|
154638
154735
|
// so use Math.pow instead (I assume the performance lost to be minimal)
|
|
@@ -154647,7 +154744,13 @@ class MapLayerImageryProvider {
|
|
|
154647
154744
|
const latitudeTop = 90.0 - 360.0 * Math.atan(Math.exp(-y1 * 2 * Math.PI)) / Math.PI;
|
|
154648
154745
|
return { longitudeLeft, longitudeRight, latitudeTop, latitudeBottom };
|
|
154649
154746
|
}
|
|
154650
|
-
/**
|
|
154747
|
+
/**
|
|
154748
|
+
* Get the bounding box/extents of a tile in EPSG:3857 format.
|
|
154749
|
+
* @param row Row of the tile
|
|
154750
|
+
* @param column Column of the tile
|
|
154751
|
+
* @param zoomLevel Desired zoom level of the tile
|
|
154752
|
+
* @internal
|
|
154753
|
+
*/
|
|
154651
154754
|
getEPSG3857Extent(row, column, zoomLevel) {
|
|
154652
154755
|
const epsg4326Extent = this.getEPSG4326Extent(row, column, zoomLevel);
|
|
154653
154756
|
const left = this.getEPSG3857X(epsg4326Extent.longitudeLeft);
|
|
@@ -154924,24 +155027,45 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
154924
155027
|
|
|
154925
155028
|
|
|
154926
155029
|
|
|
154927
|
-
/**
|
|
155030
|
+
/**
|
|
155031
|
+
* A [[TileTreeReference]] to be used specifically for [[MapTileTree]]s.
|
|
155032
|
+
* The reference refers to its MapTileTree by way of the tree's [[TileTreeOwner]].
|
|
155033
|
+
* Multiple MapLayerTileTreeReferences can refer to the same TileTree if the map layer settings are equivalent, meaning
|
|
155034
|
+
* they have identical format IDs, URLs, credentials, etc.
|
|
155035
|
+
* @beta
|
|
155036
|
+
*/
|
|
154928
155037
|
class MapLayerTileTreeReference extends _internal__WEBPACK_IMPORTED_MODULE_3__.TileTreeReference {
|
|
155038
|
+
/**
|
|
155039
|
+
* Constructor for a MapLayerTileTreeReference.
|
|
155040
|
+
* @param _layerSettings Map layer settings that are applied to the MapLayerTileTreeReference.
|
|
155041
|
+
* @param _layerIndex The index of the associated map layer.
|
|
155042
|
+
* @param iModel The iModel containing the MapLayerTileTreeReference.
|
|
155043
|
+
* @internal
|
|
155044
|
+
*/
|
|
154929
155045
|
constructor(_layerSettings, _layerIndex, iModel) {
|
|
154930
155046
|
super();
|
|
154931
155047
|
this._layerSettings = _layerSettings;
|
|
154932
155048
|
this._layerIndex = _layerIndex;
|
|
154933
155049
|
this.iModel = iModel;
|
|
154934
155050
|
}
|
|
155051
|
+
/* @internal */
|
|
154935
155052
|
get _transparency() { return this._layerSettings.transparency ? this._layerSettings.transparency : undefined; }
|
|
155053
|
+
/** Returns true if the associated map layer, including its sublayers, is opaque. */
|
|
154936
155054
|
get isOpaque() {
|
|
154937
155055
|
return this._layerSettings.visible && (!this._layerSettings.allSubLayersInvisible) && !this._layerSettings.transparentBackground && 0 === this._layerSettings.transparency;
|
|
154938
155056
|
}
|
|
155057
|
+
/* Returns the map layer name. */
|
|
154939
155058
|
get layerName() { return this._layerSettings.name; }
|
|
155059
|
+
/** Returns the imagery provider for the tile tree. */
|
|
154940
155060
|
get imageryProvider() { return undefined; }
|
|
154941
155061
|
set layerSettings(layerSettings) { this._layerSettings = layerSettings; }
|
|
155062
|
+
/** Returns the layer settings for the map layer. */
|
|
154942
155063
|
get layerSettings() { return this._layerSettings; }
|
|
155064
|
+
/** Returns the index of the map layer associated with the tile tree. */
|
|
154943
155065
|
get layerIndex() { return this._layerIndex; }
|
|
155066
|
+
/** Returns the transparency value of the map layer. */
|
|
154944
155067
|
get transparency() { return this._transparency; }
|
|
155068
|
+
/* Returns a tooltip describing the hit with the map layer name. */
|
|
154945
155069
|
async getToolTip(hit) {
|
|
154946
155070
|
const tree = this.treeOwner.tileTree;
|
|
154947
155071
|
if (undefined === tree || hit.iModel !== tree.iModel || tree.modelId !== hit.sourceId)
|
|
@@ -154953,7 +155077,14 @@ class MapLayerTileTreeReference extends _internal__WEBPACK_IMPORTED_MODULE_3__.T
|
|
|
154953
155077
|
return div;
|
|
154954
155078
|
}
|
|
154955
155079
|
}
|
|
154956
|
-
/**
|
|
155080
|
+
/**
|
|
155081
|
+
* Creates a MapLayerTileTreeReference.
|
|
155082
|
+
* @param layerSettings Model or image map layer settings that are applied to the MapLayerTileTreeReference.
|
|
155083
|
+
* @param layerIndex The index of the associated map layer.
|
|
155084
|
+
* @param iModel The iModel containing the new MapLayerTileTreeReference.
|
|
155085
|
+
* @returns Returns the new tile tree reference, either a ModelMapLayerTileTreeReference or an ImageryMapLayerTreeReference.
|
|
155086
|
+
* @internal
|
|
155087
|
+
*/
|
|
154957
155088
|
function createMapLayerTreeReference(layerSettings, layerIndex, iModel) {
|
|
154958
155089
|
if (layerSettings instanceof _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.ModelMapLayerSettings) {
|
|
154959
155090
|
return (0,_internal__WEBPACK_IMPORTED_MODULE_3__.createModelMapLayerTileTreeReference)(layerSettings, layerIndex, iModel);
|
|
@@ -185956,11 +186087,28 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
|
|
|
185956
186087
|
curveLengthBetweenFractions(fraction0, fraction1) {
|
|
185957
186088
|
return Math.abs(fraction1 - fraction0) * this._totalLength;
|
|
185958
186089
|
}
|
|
186090
|
+
/** Flatten CurveChainWithDistanceIndex children in the input chain.
|
|
186091
|
+
* @return cloned flattened CurveChain, or reference to the input chain if no nesting
|
|
186092
|
+
*/
|
|
186093
|
+
static flattenNestedChains(chain) {
|
|
186094
|
+
if (-1 === chain.children.findIndex((child) => { return child instanceof CurveChainWithDistanceIndex; }))
|
|
186095
|
+
return chain;
|
|
186096
|
+
const flatChain = chain.clone();
|
|
186097
|
+
const flatChildren = flatChain.children.flatMap((child) => {
|
|
186098
|
+
if (child instanceof CurveChainWithDistanceIndex)
|
|
186099
|
+
return child.path.children;
|
|
186100
|
+
else
|
|
186101
|
+
return [child];
|
|
186102
|
+
});
|
|
186103
|
+
flatChain.children.splice(0, Infinity, ...flatChildren);
|
|
186104
|
+
return flatChain;
|
|
186105
|
+
}
|
|
185959
186106
|
/**
|
|
185960
186107
|
* Capture (not clone) a path into a new `CurveChainWithDistanceIndex`
|
|
185961
186108
|
* @param path primitive array to be CAPTURED (not cloned)
|
|
185962
186109
|
*/
|
|
185963
186110
|
static createCapture(path, options) {
|
|
186111
|
+
path = this.flattenNestedChains(path); // nested chains not allowed
|
|
185964
186112
|
const fragments = DistanceIndexConstructionContext.createPathFragmentIndex(path, options);
|
|
185965
186113
|
const result = new CurveChainWithDistanceIndex(path, fragments);
|
|
185966
186114
|
return result;
|
|
@@ -186296,6 +186444,36 @@ class CurveChainWithDistanceIndex extends _curve_CurvePrimitive__WEBPACK_IMPORTE
|
|
|
186296
186444
|
}
|
|
186297
186445
|
return undefined;
|
|
186298
186446
|
}
|
|
186447
|
+
/**
|
|
186448
|
+
* Given a parent chain, convert the corresponding child details in the specified pairs.
|
|
186449
|
+
* * Converted details refer to the chain's global parameterization instead of the child's.
|
|
186450
|
+
* * It is assumed that for all i >= index0, `pairs[i].detailA.curve` is a child of chainA (similarly for chainB).
|
|
186451
|
+
* @param pairs array to mutate
|
|
186452
|
+
* @param index0 convert details of pairs in the tail of the array, starting at index0
|
|
186453
|
+
* @param chainA convert each specified detailA to the global parameterization of chainA
|
|
186454
|
+
* @param chainB convert each specified detailB to the global parameterization of chainB
|
|
186455
|
+
* @param compressAdjacent whether to remove adjacent duplicate pairs after conversion
|
|
186456
|
+
* @return the converted array
|
|
186457
|
+
* @internal
|
|
186458
|
+
*/
|
|
186459
|
+
static convertChildDetailToChainDetail(pairs, index0, chainA, chainB, compressAdjacent) {
|
|
186460
|
+
for (let i = index0; i < pairs.length; ++i) {
|
|
186461
|
+
const childDetailPair = pairs[i];
|
|
186462
|
+
if (chainA) {
|
|
186463
|
+
const chainDetail = chainA.computeChainDetail(childDetailPair.detailA);
|
|
186464
|
+
if (chainDetail)
|
|
186465
|
+
childDetailPair.detailA = chainDetail;
|
|
186466
|
+
}
|
|
186467
|
+
if (chainB) {
|
|
186468
|
+
const chainDetail = chainB.computeChainDetail(childDetailPair.detailB);
|
|
186469
|
+
if (chainDetail)
|
|
186470
|
+
childDetailPair.detailB = chainDetail;
|
|
186471
|
+
}
|
|
186472
|
+
}
|
|
186473
|
+
if (compressAdjacent)
|
|
186474
|
+
pairs = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_8__.CurveLocationDetailPair.removeAdjacentDuplicates(pairs, index0);
|
|
186475
|
+
return pairs;
|
|
186476
|
+
}
|
|
186299
186477
|
}
|
|
186300
186478
|
CurveChainWithDistanceIndex._numCalls = 0;
|
|
186301
186479
|
CurveChainWithDistanceIndex._numTested = 0;
|
|
@@ -186354,15 +186532,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
186354
186532
|
|
|
186355
186533
|
/**
|
|
186356
186534
|
* A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:
|
|
186357
|
-
* -
|
|
186358
|
-
* The two instantiable forms of `CurveChain` are
|
|
186359
|
-
* -
|
|
186360
|
-
*
|
|
186361
|
-
*
|
|
186362
|
-
*
|
|
186363
|
-
* -
|
|
186364
|
-
* - `UnionRegion` -- a collection of coplanar `Loop` and/or `ParityRegion`, with "in/out" classification by union rules.
|
|
186365
|
-
* - `BagOfCurves` -- a collection of `AnyCurve` with no implied structure.
|
|
186535
|
+
* - [[CurveChain]] - a non-instantiable intermediate class for a sequence of [[CurvePrimitive]] joining head-to-tail.
|
|
186536
|
+
* The two instantiable forms of `CurveChain` are:
|
|
186537
|
+
* - [[Path]] - a chain of curves. Does not have to be closed or planar. A closed `Path` is not treated as bounding a surface.
|
|
186538
|
+
* - [[Loop]] - a closed and planar chain of curves. A `Loop` is treated as bounding a planar area.
|
|
186539
|
+
* - [[ParityRegion]] - a collection of coplanar `Loop`, with "in/out" classification by parity rules.
|
|
186540
|
+
* - [[UnionRegion]] - a collection of coplanar `Loop` and/or `ParityRegion`, with "in/out" classification by union rules.
|
|
186541
|
+
* - [[BagOfCurves]] - a collection of [[AnyCurve]] with no implied structure.
|
|
186366
186542
|
*
|
|
186367
186543
|
* @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.
|
|
186368
186544
|
* @public
|
|
@@ -186372,7 +186548,6 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
186372
186548
|
super(...arguments);
|
|
186373
186549
|
/** String name for schema properties */
|
|
186374
186550
|
this.geometryCategory = "curveCollection";
|
|
186375
|
-
/* eslint-disable @typescript-eslint/naming-convention, no-empty */
|
|
186376
186551
|
/** Flag for inner loop status. Only used by `Loop`. */
|
|
186377
186552
|
this.isInner = false;
|
|
186378
186553
|
}
|
|
@@ -186749,11 +186924,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
186749
186924
|
/* harmony export */ CurveCurve: () => (/* binding */ CurveCurve)
|
|
186750
186925
|
/* harmony export */ });
|
|
186751
186926
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
186752
|
-
/* harmony import */ var
|
|
186753
|
-
/* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
|
|
186754
|
-
/* harmony import */ var _internalContexts_CurveCurveCloseApproachXY__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./internalContexts/CurveCurveCloseApproachXY */ "../../core/geometry/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js");
|
|
186927
|
+
/* harmony import */ var _internalContexts_CurveCurveCloseApproachXY__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./internalContexts/CurveCurveCloseApproachXY */ "../../core/geometry/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js");
|
|
186755
186928
|
/* harmony import */ var _internalContexts_CurveCurveIntersectXY__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./internalContexts/CurveCurveIntersectXY */ "../../core/geometry/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js");
|
|
186756
|
-
/* harmony import */ var
|
|
186929
|
+
/* harmony import */ var _internalContexts_CurveCurveIntersectXYZ__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./internalContexts/CurveCurveIntersectXYZ */ "../../core/geometry/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js");
|
|
186757
186930
|
/*---------------------------------------------------------------------------------------------
|
|
186758
186931
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
186759
186932
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -186765,8 +186938,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
186765
186938
|
|
|
186766
186939
|
|
|
186767
186940
|
|
|
186768
|
-
|
|
186769
|
-
|
|
186770
186941
|
/**
|
|
186771
186942
|
* `CurveCurve` has static method for various computations that work on a pair of curves or curve collections.
|
|
186772
186943
|
* @public
|
|
@@ -186781,22 +186952,11 @@ class CurveCurve {
|
|
|
186781
186952
|
* @param tolerance optional distance tolerance for coincidence
|
|
186782
186953
|
*/
|
|
186783
186954
|
static intersectionXYPairs(curveA, extendA, curveB, extendB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
186784
|
-
|
|
186785
|
-
if (curveB instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__.CurvePrimitive) {
|
|
186786
|
-
curveA.dispatchToGeometryHandler(handler);
|
|
186787
|
-
}
|
|
186788
|
-
else if (curveB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_3__.CurveCollection) {
|
|
186789
|
-
const allCurves = curveB.collectCurvePrimitives();
|
|
186790
|
-
for (const child of allCurves) {
|
|
186791
|
-
handler.resetGeometry(false, child, false);
|
|
186792
|
-
curveA.dispatchToGeometryHandler(handler);
|
|
186793
|
-
}
|
|
186794
|
-
}
|
|
186795
|
-
return handler.grabPairedResults();
|
|
186955
|
+
return CurveCurve.intersectionProjectedXYPairs(undefined, curveA, extendA, curveB, extendB, tolerance);
|
|
186796
186956
|
}
|
|
186797
186957
|
/**
|
|
186798
186958
|
* Return xy intersections of 2 projected curves.
|
|
186799
|
-
* @param worldToLocal transform (possibly perspective) defining the local coordinates in which to compute xy intersections
|
|
186959
|
+
* @param worldToLocal transform (possibly perspective) defining the local coordinates in which to compute xy intersections
|
|
186800
186960
|
* @param curveA first curve
|
|
186801
186961
|
* @param extendA true to allow curveA to extend
|
|
186802
186962
|
* @param curveB second curve
|
|
@@ -186820,7 +186980,7 @@ class CurveCurve {
|
|
|
186820
186980
|
* @returns array of intersections structured as CurveLocationDetailPair[]
|
|
186821
186981
|
*/
|
|
186822
186982
|
static intersectionXYZPairs(curveA, extendA, curveB, extendB) {
|
|
186823
|
-
const handler = new
|
|
186983
|
+
const handler = new _internalContexts_CurveCurveIntersectXYZ__WEBPACK_IMPORTED_MODULE_2__.CurveCurveIntersectXYZ(extendA, curveB, extendB);
|
|
186824
186984
|
curveA.dispatchToGeometryHandler(handler);
|
|
186825
186985
|
return handler.grabPairedResults();
|
|
186826
186986
|
}
|
|
@@ -186834,7 +186994,7 @@ class CurveCurve {
|
|
|
186834
186994
|
for (let i = 0; i < primitives.length; i++) {
|
|
186835
186995
|
const curveA = primitives[i];
|
|
186836
186996
|
for (let j = i + 1; j < primitives.length; j++) {
|
|
186837
|
-
handler.resetGeometry(
|
|
186997
|
+
handler.resetGeometry(primitives[j]);
|
|
186838
186998
|
curveA.dispatchToGeometryHandler(handler);
|
|
186839
186999
|
}
|
|
186840
187000
|
}
|
|
@@ -186854,7 +187014,7 @@ class CurveCurve {
|
|
|
186854
187014
|
* Close approaches further than this xy-distance are not returned.
|
|
186855
187015
|
*/
|
|
186856
187016
|
static closeApproachProjectedXYPairs(curveA, curveB, maxDistance) {
|
|
186857
|
-
const handler = new
|
|
187017
|
+
const handler = new _internalContexts_CurveCurveCloseApproachXY__WEBPACK_IMPORTED_MODULE_3__.CurveCurveCloseApproachXY(curveB);
|
|
186858
187018
|
handler.maxDistanceToAccept = maxDistance;
|
|
186859
187019
|
curveA.dispatchToGeometryHandler(handler);
|
|
186860
187020
|
return handler.grabPairedResults();
|
|
@@ -187988,6 +188148,10 @@ class CurveLocationDetail {
|
|
|
187988
188148
|
}
|
|
187989
188149
|
return detailB;
|
|
187990
188150
|
}
|
|
188151
|
+
/** Compare only the curve and fraction of this detail with `other`. */
|
|
188152
|
+
isSameCurveAndFraction(other) {
|
|
188153
|
+
return this.curve === other.curve && _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isAlmostEqualNumber(this.fraction, other.fraction);
|
|
188154
|
+
}
|
|
187991
188155
|
}
|
|
187992
188156
|
/**
|
|
187993
188157
|
* Enumeration of configurations for intersections and min/max distance-between-curve
|
|
@@ -188050,6 +188214,30 @@ class CurveLocationDetailPair {
|
|
|
188050
188214
|
this.detailA = this.detailB;
|
|
188051
188215
|
this.detailB = q;
|
|
188052
188216
|
}
|
|
188217
|
+
/**
|
|
188218
|
+
* Mutate the input array by removing the second of two adjacent duplicate pairs.
|
|
188219
|
+
* * Ignores details representing coincident intervals (e.g., for which `fraction1` is defined).
|
|
188220
|
+
* * Comparison is performed by [[CurveLocationDetail.isSameCurveAndFraction]].
|
|
188221
|
+
* * No sorting is performed.
|
|
188222
|
+
* @param pairs array to de-duplicate in place
|
|
188223
|
+
* @param index0 look for duplicates in the tail of the array starting at index0
|
|
188224
|
+
* @return reference to input array
|
|
188225
|
+
* @internal
|
|
188226
|
+
*/
|
|
188227
|
+
static removeAdjacentDuplicates(pairs, index0 = 0) {
|
|
188228
|
+
return pairs.flatMap((pair, i, arr) => {
|
|
188229
|
+
if (i >= index0 && i > 0) {
|
|
188230
|
+
if (!pair.detailA.hasFraction1 && !pair.detailB.hasFraction1) {
|
|
188231
|
+
if (pair.detailA.isSameCurveAndFraction(arr[i - 1].detailA)) {
|
|
188232
|
+
if (pair.detailB.isSameCurveAndFraction(arr[i - 1].detailB)) {
|
|
188233
|
+
return []; // remove the i_th pair
|
|
188234
|
+
}
|
|
188235
|
+
}
|
|
188236
|
+
}
|
|
188237
|
+
}
|
|
188238
|
+
return [pair]; // preserve the i_th pair
|
|
188239
|
+
});
|
|
188240
|
+
}
|
|
188053
188241
|
}
|
|
188054
188242
|
/**
|
|
188055
188243
|
* Data bundle for a pair of arrays of CurveLocationDetail structures.
|
|
@@ -189100,10 +189288,8 @@ class CurveWireMomentsXYZ {
|
|
|
189100
189288
|
if (root instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_3__.CurvePrimitive)
|
|
189101
189289
|
root.emitStrokableParts(this);
|
|
189102
189290
|
else if (root instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_4__.CurveCollection) {
|
|
189103
|
-
|
|
189104
|
-
|
|
189105
|
-
this.visitLeaves(child);
|
|
189106
|
-
}
|
|
189291
|
+
for (const child of root.children)
|
|
189292
|
+
this.visitLeaves(child);
|
|
189107
189293
|
}
|
|
189108
189294
|
}
|
|
189109
189295
|
}
|
|
@@ -190492,10 +190678,7 @@ class LineString3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_0__.CurvePri
|
|
|
190492
190678
|
isInPlane(plane) {
|
|
190493
190679
|
return this._points.isCloseToPlane(plane, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
|
|
190494
190680
|
}
|
|
190495
|
-
/**
|
|
190496
|
-
* Push a hit, fixing up the prior entry if needed.
|
|
190497
|
-
* Return the incremented counter.
|
|
190498
|
-
*/
|
|
190681
|
+
/** Push a hit, fixing up the prior entry if needed. */
|
|
190499
190682
|
static pushVertexHit(result, counter, cp, fraction, point) {
|
|
190500
190683
|
const detail = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_12__.CurveLocationDetail.createCurveFractionPoint(cp, fraction, point);
|
|
190501
190684
|
result.push(detail);
|
|
@@ -196315,10 +196498,6 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
196315
196498
|
this._results = [];
|
|
196316
196499
|
return result;
|
|
196317
196500
|
}
|
|
196318
|
-
/** Returns `true` if `detail` has same curve and fraction. */
|
|
196319
|
-
sameCurveAndFraction(cp, fraction, detail) {
|
|
196320
|
-
return cp === detail.curve && _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isAlmostEqualNumber(fraction, detail.fraction);
|
|
196321
|
-
}
|
|
196322
196501
|
/**
|
|
196323
196502
|
* If distance between pointA and pointB is less than maxDistance, record CurveLocationDetailPair which is
|
|
196324
196503
|
* the approach from pointA to pointB.
|
|
@@ -196369,13 +196548,13 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
196369
196548
|
const oldDetailA = this._results[numPrevious - 1].detailA;
|
|
196370
196549
|
const oldDetailB = this._results[numPrevious - 1].detailB;
|
|
196371
196550
|
if (reversed) {
|
|
196372
|
-
if (
|
|
196373
|
-
|
|
196551
|
+
if (oldDetailB.isSameCurveAndFraction({ curve: cpA, fraction: globalFractionA }) &&
|
|
196552
|
+
oldDetailA.isSameCurveAndFraction({ curve: cpB, fraction: globalFractionB }))
|
|
196374
196553
|
return;
|
|
196375
196554
|
}
|
|
196376
196555
|
else {
|
|
196377
|
-
if (
|
|
196378
|
-
|
|
196556
|
+
if (oldDetailA.isSameCurveAndFraction({ curve: cpA, fraction: globalFractionA }) &&
|
|
196557
|
+
oldDetailB.isSameCurveAndFraction({ curve: cpB, fraction: globalFractionB }))
|
|
196379
196558
|
return;
|
|
196380
196559
|
}
|
|
196381
196560
|
}
|
|
@@ -196421,13 +196600,13 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
196421
196600
|
const oldDetailA = this._results[numPrevious - 1].detailA;
|
|
196422
196601
|
const oldDetailB = this._results[numPrevious - 1].detailB;
|
|
196423
196602
|
if (reversed) {
|
|
196424
|
-
if (
|
|
196425
|
-
|
|
196603
|
+
if (oldDetailB.isSameCurveAndFraction({ curve: cpA, fraction: globalFractionA }) &&
|
|
196604
|
+
oldDetailA.isSameCurveAndFraction({ curve: cpB, fraction: globalFractionB }))
|
|
196426
196605
|
return;
|
|
196427
196606
|
}
|
|
196428
196607
|
else {
|
|
196429
|
-
if (
|
|
196430
|
-
|
|
196608
|
+
if (oldDetailA.isSameCurveAndFraction({ curve: cpA, fraction: globalFractionA }) &&
|
|
196609
|
+
oldDetailB.isSameCurveAndFraction({ curve: cpB, fraction: globalFractionB }))
|
|
196431
196610
|
return;
|
|
196432
196611
|
}
|
|
196433
196612
|
}
|
|
@@ -196813,38 +196992,22 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
196813
196992
|
}
|
|
196814
196993
|
this._geometryB = geomB; // restore
|
|
196815
196994
|
}
|
|
196816
|
-
/**
|
|
196817
|
-
* Given a parent chain, convert the corresponding child details so that they refer to the chain's global parameterization.
|
|
196818
|
-
* * It is assumed that `this._results[i].detailA.curve` is a child of chainA, and similarly for detailB/chainB.
|
|
196819
|
-
* @param chainA convert each detailA to the global parameterization of chainA
|
|
196820
|
-
* @param chainB convert each detailB to the global parameterization of chainB
|
|
196821
|
-
*/
|
|
196822
|
-
convertChildDetailToChainDetail(chainA, chainB) {
|
|
196823
|
-
for (const childDetailPair of this._results) {
|
|
196824
|
-
if (chainA) {
|
|
196825
|
-
const chainDetail = chainA.computeChainDetail(childDetailPair.detailA);
|
|
196826
|
-
if (chainDetail)
|
|
196827
|
-
childDetailPair.detailA = chainDetail;
|
|
196828
|
-
}
|
|
196829
|
-
if (chainB) {
|
|
196830
|
-
const chainDetail = chainB.computeChainDetail(childDetailPair.detailB);
|
|
196831
|
-
if (chainDetail)
|
|
196832
|
-
childDetailPair.detailB = chainDetail;
|
|
196833
|
-
}
|
|
196834
|
-
}
|
|
196835
|
-
}
|
|
196836
196995
|
/** Low level dispatch to geomA given a CurveChainWithDistanceIndex in geometryB. */
|
|
196837
196996
|
dispatchCurveChainWithDistanceIndex(geomA, geomAHandler) {
|
|
196838
196997
|
if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex))
|
|
196839
196998
|
return;
|
|
196999
|
+
if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex) {
|
|
197000
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!!"call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
197001
|
+
return;
|
|
197002
|
+
}
|
|
197003
|
+
const index0 = this._results.length;
|
|
196840
197004
|
const geomB = this._geometryB; // save
|
|
196841
197005
|
for (const child of geomB.path.children) {
|
|
196842
197006
|
this.resetGeometry(child);
|
|
196843
197007
|
geomAHandler(geomA);
|
|
196844
197008
|
}
|
|
196845
197009
|
this.resetGeometry(geomB); // restore
|
|
196846
|
-
|
|
196847
|
-
this.convertChildDetailToChainDetail(undefined, geomB);
|
|
197010
|
+
this._results = _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex.convertChildDetailToChainDetail(this._results, index0, undefined, geomB, true);
|
|
196848
197011
|
}
|
|
196849
197012
|
/** Double dispatch handler for strongly typed segment. */
|
|
196850
197013
|
handleLineSegment3d(segmentA) {
|
|
@@ -197015,7 +197178,8 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
197015
197178
|
/** Double dispatch handler for strongly typed CurveChainWithDistanceIndex. */
|
|
197016
197179
|
handleCurveChainWithDistanceIndex(chain) {
|
|
197017
197180
|
super.handleCurveChainWithDistanceIndex(chain);
|
|
197018
|
-
|
|
197181
|
+
// if _geometryB is also a CurveChainWithDistanceIndex, it will already have been converted by dispatchCurveChainWithDistanceIndex
|
|
197182
|
+
this._results = _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_10__.CurveChainWithDistanceIndex.convertChildDetailToChainDetail(this._results, 0, chain, undefined, true);
|
|
197019
197183
|
}
|
|
197020
197184
|
/** Double dispatch handler for strongly typed homogeneous bspline curve .. */
|
|
197021
197185
|
handleBSplineCurve3dH(_curve) {
|
|
@@ -197057,27 +197221,36 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
197057
197221
|
/* harmony export */ BezierBezierIntersectionXYRRToRRD: () => (/* binding */ BezierBezierIntersectionXYRRToRRD),
|
|
197058
197222
|
/* harmony export */ CurveCurveIntersectXY: () => (/* binding */ CurveCurveIntersectXY)
|
|
197059
197223
|
/* harmony export */ });
|
|
197060
|
-
/* harmony import */ var
|
|
197061
|
-
/* harmony import */ var
|
|
197062
|
-
/* harmony import */ var
|
|
197063
|
-
/* harmony import */ var
|
|
197064
|
-
/* harmony import */ var
|
|
197065
|
-
/* harmony import */ var
|
|
197066
|
-
/* harmony import */ var
|
|
197067
|
-
/* harmony import */ var
|
|
197068
|
-
/* harmony import */ var
|
|
197069
|
-
/* harmony import */ var
|
|
197070
|
-
/* harmony import */ var
|
|
197071
|
-
/* harmony import */ var
|
|
197072
|
-
/* harmony import */ var
|
|
197073
|
-
/* harmony import */ var
|
|
197074
|
-
/* harmony import */ var
|
|
197075
|
-
/* harmony import */ var
|
|
197076
|
-
/* harmony import */ var
|
|
197224
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
197225
|
+
/* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
|
|
197226
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
197227
|
+
/* harmony import */ var _geometry3d_CoincidentGeometryOps__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../geometry3d/CoincidentGeometryOps */ "../../core/geometry/lib/esm/geometry3d/CoincidentGeometryOps.js");
|
|
197228
|
+
/* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
|
|
197229
|
+
/* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
|
|
197230
|
+
/* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
|
|
197231
|
+
/* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
|
|
197232
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
197233
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
197234
|
+
/* harmony import */ var _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../geometry4d/Point4d */ "../../core/geometry/lib/esm/geometry4d/Point4d.js");
|
|
197235
|
+
/* harmony import */ var _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../numerics/BezierPolynomials */ "../../core/geometry/lib/esm/numerics/BezierPolynomials.js");
|
|
197236
|
+
/* harmony import */ var _numerics_Newton__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../numerics/Newton */ "../../core/geometry/lib/esm/numerics/Newton.js");
|
|
197237
|
+
/* harmony import */ var _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../numerics/Polynomials */ "../../core/geometry/lib/esm/numerics/Polynomials.js");
|
|
197238
|
+
/* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
197239
|
+
/* harmony import */ var _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../CurveChainWithDistanceIndex */ "../../core/geometry/lib/esm/curve/CurveChainWithDistanceIndex.js");
|
|
197240
|
+
/* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
197241
|
+
/* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
|
|
197242
|
+
/* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
197243
|
+
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
197077
197244
|
/*---------------------------------------------------------------------------------------------
|
|
197078
197245
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
197079
197246
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
197080
197247
|
*--------------------------------------------------------------------------------------------*/
|
|
197248
|
+
/** @packageDocumentation
|
|
197249
|
+
* @module Curve
|
|
197250
|
+
*/
|
|
197251
|
+
|
|
197252
|
+
|
|
197253
|
+
|
|
197081
197254
|
|
|
197082
197255
|
|
|
197083
197256
|
|
|
@@ -197101,13 +197274,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
197101
197274
|
* * The inputs are assumed pre-transformed so that the target condition is to match x and y coordinates.
|
|
197102
197275
|
* @internal
|
|
197103
197276
|
*/
|
|
197104
|
-
class BezierBezierIntersectionXYRRToRRD extends
|
|
197277
|
+
class BezierBezierIntersectionXYRRToRRD extends _numerics_Newton__WEBPACK_IMPORTED_MODULE_1__.NewtonEvaluatorRRtoRRD {
|
|
197105
197278
|
constructor(curveA, curveB) {
|
|
197106
197279
|
super();
|
|
197107
197280
|
this._curveA = curveA;
|
|
197108
197281
|
this._curveB = curveB;
|
|
197109
|
-
this._rayA =
|
|
197110
|
-
this._rayB =
|
|
197282
|
+
this._rayA = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_2__.Ray3d.createZero();
|
|
197283
|
+
this._rayB = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_2__.Ray3d.createZero();
|
|
197111
197284
|
}
|
|
197112
197285
|
evaluate(fractionA, fractionB) {
|
|
197113
197286
|
this._curveA.fractionToPointAndDerivative(fractionA, this._rayA);
|
|
@@ -197122,7 +197295,7 @@ class BezierBezierIntersectionXYRRToRRD extends _numerics_Newton__WEBPACK_IMPORT
|
|
|
197122
197295
|
* * geometryB is saved for later reference.
|
|
197123
197296
|
* @internal
|
|
197124
197297
|
*/
|
|
197125
|
-
class CurveCurveIntersectXY extends
|
|
197298
|
+
class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_3__.RecurseToCurvesGeometryHandler {
|
|
197126
197299
|
/**
|
|
197127
197300
|
* The constructor.
|
|
197128
197301
|
* @param worldToLocal optional transform (possibly perspective) to project to xy plane for intersection.
|
|
@@ -197131,7 +197304,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197131
197304
|
* @param extendB flag for extension of geometryB.
|
|
197132
197305
|
* @param tolerance optional distance tolerance for coincidence.
|
|
197133
197306
|
*/
|
|
197134
|
-
constructor(worldToLocal, extendA, geometryB, extendB, tolerance =
|
|
197307
|
+
constructor(worldToLocal, extendA, geometryB, extendB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.smallMetricDistance) {
|
|
197135
197308
|
super();
|
|
197136
197309
|
this._extendA = extendA;
|
|
197137
197310
|
this._geometryB = geometryB;
|
|
@@ -197143,14 +197316,12 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197143
197316
|
if (!this._worldToLocalAffine)
|
|
197144
197317
|
this._worldToLocalPerspective = worldToLocal.clone();
|
|
197145
197318
|
}
|
|
197146
|
-
this._coincidentGeometryContext =
|
|
197319
|
+
this._coincidentGeometryContext = _geometry3d_CoincidentGeometryOps__WEBPACK_IMPORTED_MODULE_5__.CoincidentGeometryQuery.create(tolerance);
|
|
197147
197320
|
this._results = [];
|
|
197148
197321
|
}
|
|
197149
|
-
/** Reset the geometry
|
|
197150
|
-
resetGeometry(
|
|
197151
|
-
this._extendA = extendA;
|
|
197322
|
+
/** Reset the geometry, leaving all other parts unchanged (and preserving accumulated intersections). */
|
|
197323
|
+
resetGeometry(geometryB) {
|
|
197152
197324
|
this._geometryB = geometryB;
|
|
197153
|
-
this._extendB = extendB;
|
|
197154
197325
|
}
|
|
197155
197326
|
acceptFraction(extend0, fraction, extend1, fractionTol = 1.0e-12) {
|
|
197156
197327
|
if (!extend0 && fraction < -fractionTol)
|
|
@@ -197160,12 +197331,12 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197160
197331
|
return true;
|
|
197161
197332
|
}
|
|
197162
197333
|
/** Test the fraction by strict parameter, but allow toleranced distance test at ends. */
|
|
197163
|
-
acceptFractionOnLine(extend0, fraction, extend1, pointA, pointB, tolerance =
|
|
197334
|
+
acceptFractionOnLine(extend0, fraction, extend1, pointA, pointB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.smallMetricDistance) {
|
|
197164
197335
|
if (!extend0 && fraction < 0) {
|
|
197165
|
-
return
|
|
197336
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol(fraction * pointA.distanceXY(pointB), tolerance);
|
|
197166
197337
|
}
|
|
197167
197338
|
else if (!extend1 && fraction > 1.0)
|
|
197168
|
-
return
|
|
197339
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol((fraction - 1.0) * pointA.distanceXY(pointB), tolerance);
|
|
197169
197340
|
return true;
|
|
197170
197341
|
}
|
|
197171
197342
|
/**
|
|
@@ -197178,9 +197349,6 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197178
197349
|
this._results = [];
|
|
197179
197350
|
return result;
|
|
197180
197351
|
}
|
|
197181
|
-
sameCurveAndFraction(cp, fraction, detail) {
|
|
197182
|
-
return cp === detail.curve && _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isAlmostEqualNumber(fraction, detail.fraction);
|
|
197183
|
-
}
|
|
197184
197352
|
/**
|
|
197185
197353
|
* Record the pre-computed intersection between two curves. Filter by extension rules. Record with fraction mapping.
|
|
197186
197354
|
* @param localFractionA intersection fraction local to the subcurve of cpA between fractionA0 and fractionA1
|
|
@@ -197201,14 +197369,14 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197201
197369
|
intervalDetails.detailA.hasFraction1 &&
|
|
197202
197370
|
intervalDetails.detailB.hasFraction1;
|
|
197203
197371
|
if (isInterval) {
|
|
197204
|
-
globalFractionA =
|
|
197205
|
-
globalFractionB =
|
|
197206
|
-
globalFractionA1 =
|
|
197207
|
-
globalFractionB1 =
|
|
197372
|
+
globalFractionA = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction, fractionA1);
|
|
197373
|
+
globalFractionB = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction, fractionB1);
|
|
197374
|
+
globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction1, fractionA1);
|
|
197375
|
+
globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction1, fractionB1);
|
|
197208
197376
|
}
|
|
197209
197377
|
else {
|
|
197210
|
-
globalFractionA = globalFractionA1 =
|
|
197211
|
-
globalFractionB = globalFractionB1 =
|
|
197378
|
+
globalFractionA = globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.interpolate(fractionA0, localFractionA, fractionA1);
|
|
197379
|
+
globalFractionB = globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.interpolate(fractionB0, localFractionB, fractionB1);
|
|
197212
197380
|
}
|
|
197213
197381
|
// ignore duplicate of most recent pair
|
|
197214
197382
|
const numPrevious = this._results.length;
|
|
@@ -197216,31 +197384,31 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197216
197384
|
const oldDetailA = this._results[numPrevious - 1].detailA;
|
|
197217
197385
|
const oldDetailB = this._results[numPrevious - 1].detailB;
|
|
197218
197386
|
if (reversed) {
|
|
197219
|
-
if (
|
|
197220
|
-
|
|
197387
|
+
if (oldDetailB.isSameCurveAndFraction({ curve: cpA, fraction: globalFractionA }) &&
|
|
197388
|
+
oldDetailA.isSameCurveAndFraction({ curve: cpB, fraction: globalFractionB }))
|
|
197221
197389
|
return;
|
|
197222
197390
|
}
|
|
197223
197391
|
else {
|
|
197224
|
-
if (
|
|
197225
|
-
|
|
197392
|
+
if (oldDetailA.isSameCurveAndFraction({ curve: cpA, fraction: globalFractionA }) &&
|
|
197393
|
+
oldDetailB.isSameCurveAndFraction({ curve: cpB, fraction: globalFractionB }))
|
|
197226
197394
|
return;
|
|
197227
197395
|
}
|
|
197228
197396
|
}
|
|
197229
|
-
const detailA =
|
|
197230
|
-
const detailB =
|
|
197397
|
+
const detailA = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveFractionPoint(cpA, globalFractionA, cpA.fractionToPoint(globalFractionA));
|
|
197398
|
+
const detailB = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetail.createCurveFractionPoint(cpB, globalFractionB, cpB.fractionToPoint(globalFractionB));
|
|
197231
197399
|
if (isInterval) {
|
|
197232
197400
|
detailA.captureFraction1Point1(globalFractionA1, cpA.fractionToPoint(globalFractionA1));
|
|
197233
197401
|
detailB.captureFraction1Point1(globalFractionB1, cpB.fractionToPoint(globalFractionB1));
|
|
197234
197402
|
}
|
|
197235
197403
|
else {
|
|
197236
|
-
detailA.setIntervalRole(
|
|
197237
|
-
detailB.setIntervalRole(
|
|
197404
|
+
detailA.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveIntervalRole.isolated);
|
|
197405
|
+
detailB.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveIntervalRole.isolated);
|
|
197238
197406
|
}
|
|
197239
197407
|
if (reversed) {
|
|
197240
|
-
this._results.push(new
|
|
197408
|
+
this._results.push(new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetailPair(detailB, detailA));
|
|
197241
197409
|
}
|
|
197242
197410
|
else {
|
|
197243
|
-
this._results.push(new
|
|
197411
|
+
this._results.push(new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_6__.CurveLocationDetailPair(detailA, detailB));
|
|
197244
197412
|
}
|
|
197245
197413
|
}
|
|
197246
197414
|
/**
|
|
@@ -197268,7 +197436,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197268
197436
|
if (overlap) {
|
|
197269
197437
|
this.recordPointWithLocalFractions(overlap.detailA.fraction, cpA, fractionA0, fractionA1, overlap.detailB.fraction, cpB, fractionB0, fractionB1, reversed, overlap);
|
|
197270
197438
|
}
|
|
197271
|
-
else if (
|
|
197439
|
+
else if (_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_7__.SmallSystem.lineSegment3dXYTransverseIntersectionUnbounded(pointA0, pointA1, pointB0, pointB1, uv)) {
|
|
197272
197440
|
if (this.acceptFractionOnLine(extendA0, uv.x, extendA1, pointA0, pointA1, this._coincidentGeometryContext.tolerance) &&
|
|
197273
197441
|
this.acceptFractionOnLine(extendB0, uv.y, extendB1, pointB0, pointB1, this._coincidentGeometryContext.tolerance)) {
|
|
197274
197442
|
this.recordPointWithLocalFractions(uv.x, cpA, fractionA0, fractionA1, uv.y, cpB, fractionB0, fractionB1, reversed);
|
|
@@ -197288,7 +197456,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197288
197456
|
this._worldToLocalPerspective.multiplyPoint3d(pointA1, 1, hA1);
|
|
197289
197457
|
this._worldToLocalPerspective.multiplyPoint3d(pointB0, 1, hB0);
|
|
197290
197458
|
this._worldToLocalPerspective.multiplyPoint3d(pointB1, 1, hB1);
|
|
197291
|
-
const fractionAB =
|
|
197459
|
+
const fractionAB = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_7__.SmallSystem.lineSegment3dHXYTransverseIntersectionUnbounded(hA0, hA1, hB0, hB1);
|
|
197292
197460
|
if (fractionAB !== undefined) {
|
|
197293
197461
|
const fractionA = fractionAB.x;
|
|
197294
197462
|
const fractionB = fractionAB.y;
|
|
@@ -197331,17 +197499,17 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197331
197499
|
const data = arc.toTransformedPoint4d(this._worldToLocalPerspective);
|
|
197332
197500
|
const pointA0H = this._worldToLocalPerspective.multiplyPoint3d(pointA0, 1);
|
|
197333
197501
|
const pointA1H = this._worldToLocalPerspective.multiplyPoint3d(pointA1, 1);
|
|
197334
|
-
const alpha =
|
|
197335
|
-
const beta =
|
|
197336
|
-
const gamma =
|
|
197337
|
-
const cosines = new
|
|
197338
|
-
const sines = new
|
|
197339
|
-
const radians = new
|
|
197340
|
-
const numRoots =
|
|
197502
|
+
const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.center);
|
|
197503
|
+
const beta = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.vector0);
|
|
197504
|
+
const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.vector90);
|
|
197505
|
+
const cosines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__.GrowableFloat64Array(2);
|
|
197506
|
+
const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__.GrowableFloat64Array(2);
|
|
197507
|
+
const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__.GrowableFloat64Array(2);
|
|
197508
|
+
const numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_7__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
|
|
197341
197509
|
for (let i = 0; i < numRoots; i++) {
|
|
197342
197510
|
const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
|
|
197343
197511
|
const arcFraction = data.sweep.radiansToSignedPeriodicFraction(radians.atUncheckedIndex(i));
|
|
197344
|
-
const lineFraction =
|
|
197512
|
+
const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_7__.SmallSystem.lineSegment3dHXYClosestPointUnbounded(pointA0H, pointA1H, arcPoint);
|
|
197345
197513
|
if (lineFraction !== undefined &&
|
|
197346
197514
|
this.acceptFraction(extendA0, lineFraction, extendA1) &&
|
|
197347
197515
|
this.acceptFraction(extendB0, arcFraction, extendB1)) {
|
|
@@ -197357,19 +197525,19 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197357
197525
|
pointA0Local = this._worldToLocalAffine.multiplyPoint3d(pointA0);
|
|
197358
197526
|
pointA1Local = this._worldToLocalAffine.multiplyPoint3d(pointA1);
|
|
197359
197527
|
}
|
|
197360
|
-
const alpha =
|
|
197361
|
-
const beta =
|
|
197362
|
-
const gamma =
|
|
197363
|
-
const cosines = new
|
|
197364
|
-
const sines = new
|
|
197365
|
-
const radians = new
|
|
197366
|
-
const numRoots =
|
|
197528
|
+
const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.center, 1);
|
|
197529
|
+
const beta = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector0, 0);
|
|
197530
|
+
const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector90, 0);
|
|
197531
|
+
const cosines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__.GrowableFloat64Array(2);
|
|
197532
|
+
const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__.GrowableFloat64Array(2);
|
|
197533
|
+
const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__.GrowableFloat64Array(2);
|
|
197534
|
+
const numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_7__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
|
|
197367
197535
|
const lineFractionTol = 1.0e-10;
|
|
197368
197536
|
const arcFractionTol = 1.0e-7;
|
|
197369
197537
|
for (let i = 0; i < numRoots; i++) {
|
|
197370
197538
|
const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
|
|
197371
197539
|
const arcFraction = data.sweep.radiansToSignedPeriodicFraction(radians.atUncheckedIndex(i));
|
|
197372
|
-
const lineFraction =
|
|
197540
|
+
const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_7__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
|
|
197373
197541
|
if (lineFraction !== undefined &&
|
|
197374
197542
|
this.acceptFraction(extendA0, lineFraction, extendA1, lineFractionTol) &&
|
|
197375
197543
|
this.acceptFraction(extendB0, arcFraction, extendB1, arcFractionTol)) {
|
|
@@ -197390,7 +197558,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197390
197558
|
const localB = inverseA.multiplyMatrixMatrix(matrixB); // localB->localA transform
|
|
197391
197559
|
const ellipseRadians = [];
|
|
197392
197560
|
const circleRadians = [];
|
|
197393
|
-
|
|
197561
|
+
_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_7__.TrigPolynomial.solveUnitCircleHomogeneousEllipseIntersection(localB.coffs[2], localB.coffs[5], localB.coffs[8], // center xyw
|
|
197394
197562
|
localB.coffs[0], localB.coffs[3], localB.coffs[6], // vector0 xyw
|
|
197395
197563
|
localB.coffs[1], localB.coffs[4], localB.coffs[7], // vector90 xyw
|
|
197396
197564
|
ellipseRadians, circleRadians);
|
|
@@ -197421,14 +197589,14 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197421
197589
|
if (this._worldToLocalPerspective) {
|
|
197422
197590
|
const dataA = cpA.toTransformedPoint4d(this._worldToLocalPerspective);
|
|
197423
197591
|
const dataB = cpB.toTransformedPoint4d(this._worldToLocalPerspective);
|
|
197424
|
-
matrixA =
|
|
197425
|
-
matrixB =
|
|
197592
|
+
matrixA = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createColumnsXYW(dataA.vector0, dataA.vector0.w, dataA.vector90, dataA.vector90.w, dataA.center, dataA.center.w);
|
|
197593
|
+
matrixB = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createColumnsXYW(dataB.vector0, dataB.vector0.w, dataB.vector90, dataA.vector90.w, dataB.center, dataB.center.w);
|
|
197426
197594
|
}
|
|
197427
197595
|
else {
|
|
197428
197596
|
const dataA = cpA.toTransformedVectors(this._worldToLocalAffine);
|
|
197429
197597
|
const dataB = cpB.toTransformedVectors(this._worldToLocalAffine);
|
|
197430
|
-
matrixA =
|
|
197431
|
-
matrixB =
|
|
197598
|
+
matrixA = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createColumnsXYW(dataA.vector0, 0, dataA.vector90, 0, dataA.center, 1);
|
|
197599
|
+
matrixB = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createColumnsXYW(dataB.vector0, 0, dataB.vector90, 0, dataB.center, 1);
|
|
197432
197600
|
}
|
|
197433
197601
|
const conditionA = matrixA.conditionNumber();
|
|
197434
197602
|
const conditionB = matrixB.conditionNumber();
|
|
@@ -197458,11 +197626,11 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197458
197626
|
let matrixA;
|
|
197459
197627
|
if (this._worldToLocalPerspective) {
|
|
197460
197628
|
const dataA = cpA.toTransformedPoint4d(this._worldToLocalPerspective);
|
|
197461
|
-
matrixA =
|
|
197629
|
+
matrixA = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createColumnsXYW(dataA.vector0, dataA.vector0.w, dataA.vector90, dataA.vector90.w, dataA.center, dataA.center.w);
|
|
197462
197630
|
}
|
|
197463
197631
|
else {
|
|
197464
197632
|
const dataA = cpA.toTransformedVectors(this._worldToLocalAffine);
|
|
197465
|
-
matrixA =
|
|
197633
|
+
matrixA = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createColumnsXYW(dataA.vector0, 0, dataA.vector90, 0, dataA.center, 1);
|
|
197466
197634
|
}
|
|
197467
197635
|
// The worldToLocal has moved the arc vectors into local space.
|
|
197468
197636
|
// matrixA captures the xyw parts (ignoring z)
|
|
@@ -197473,7 +197641,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197473
197641
|
const orderF = cpB.order; // order of the beziers for simple coordinates
|
|
197474
197642
|
const orderG = 2 * orderF - 1; // order of the (single) bezier for squared coordinates.
|
|
197475
197643
|
const coffF = new Float64Array(orderF);
|
|
197476
|
-
const univariateBezierG = new
|
|
197644
|
+
const univariateBezierG = new _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_10__.UnivariateBezier(orderG);
|
|
197477
197645
|
const axx = matrixAInverse.at(0, 0);
|
|
197478
197646
|
const axy = matrixAInverse.at(0, 1);
|
|
197479
197647
|
const axz = 0.0;
|
|
@@ -197544,13 +197712,13 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197544
197712
|
dispatchBezierBezierStrokeFirst(bezierA, bcurveA, strokeCountA, bezierB, bcurveB, _strokeCountB, univariateBezierB, // caller-allocated for univariate coefficients.
|
|
197545
197713
|
reversed) {
|
|
197546
197714
|
if (!this._xyzwA0)
|
|
197547
|
-
this._xyzwA0 =
|
|
197715
|
+
this._xyzwA0 = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_11__.Point4d.create();
|
|
197548
197716
|
if (!this._xyzwA1)
|
|
197549
|
-
this._xyzwA1 =
|
|
197717
|
+
this._xyzwA1 = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_11__.Point4d.create();
|
|
197550
197718
|
if (!this._xyzwPlane)
|
|
197551
|
-
this._xyzwPlane =
|
|
197719
|
+
this._xyzwPlane = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_11__.Point4d.create();
|
|
197552
197720
|
if (!this._xyzwB)
|
|
197553
|
-
this._xyzwB =
|
|
197721
|
+
this._xyzwB = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_11__.Point4d.create();
|
|
197554
197722
|
/*
|
|
197555
197723
|
const roots = univariateBezierG.roots(0.0, true);
|
|
197556
197724
|
if (roots) {
|
|
@@ -197576,7 +197744,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197576
197744
|
for (let i = 1; i <= strokeCountA; i++, f0 = f1, this._xyzwA0.setFrom(this._xyzwA1)) {
|
|
197577
197745
|
f1 = i * df;
|
|
197578
197746
|
bezierA.fractionToPoint4d(f1, this._xyzwA1);
|
|
197579
|
-
|
|
197747
|
+
_geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_11__.Point4d.createPlanePointPointZ(this._xyzwA0, this._xyzwA1, this._xyzwPlane);
|
|
197580
197748
|
bezierB.poleProductsXYZW(univariateBezierB.coffs, this._xyzwPlane.x, this._xyzwPlane.y, this._xyzwPlane.z, this._xyzwPlane.w);
|
|
197581
197749
|
let errors = 0;
|
|
197582
197750
|
const roots = univariateBezierB.roots(0.0, true);
|
|
@@ -197584,11 +197752,11 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197584
197752
|
for (const r of roots) {
|
|
197585
197753
|
let bezierBFraction = r;
|
|
197586
197754
|
bezierB.fractionToPoint4d(bezierBFraction, this._xyzwB);
|
|
197587
|
-
const segmentAFraction =
|
|
197588
|
-
if (segmentAFraction &&
|
|
197589
|
-
let bezierAFraction =
|
|
197755
|
+
const segmentAFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_7__.SmallSystem.lineSegment3dHXYClosestPointUnbounded(this._xyzwA0, this._xyzwA1, this._xyzwB);
|
|
197756
|
+
if (segmentAFraction && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isIn01WithTolerance(segmentAFraction, intervalTolerance)) {
|
|
197757
|
+
let bezierAFraction = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.interpolate(f0, segmentAFraction, f1);
|
|
197590
197758
|
const xyMatchingFunction = new BezierBezierIntersectionXYRRToRRD(bezierA, bezierB);
|
|
197591
|
-
const newtonSearcher = new
|
|
197759
|
+
const newtonSearcher = new _numerics_Newton__WEBPACK_IMPORTED_MODULE_1__.Newton2dUnboundedWithDerivative(xyMatchingFunction);
|
|
197592
197760
|
newtonSearcher.setUV(bezierAFraction, bezierBFraction);
|
|
197593
197761
|
if (newtonSearcher.runIterations()) {
|
|
197594
197762
|
bezierAFraction = newtonSearcher.getU();
|
|
@@ -197631,8 +197799,8 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197631
197799
|
const rangeB = this.getRanges(bezierSpanB);
|
|
197632
197800
|
const orderA = bcurveA.order;
|
|
197633
197801
|
const orderB = bcurveB.order;
|
|
197634
|
-
const univariateCoffsA = new
|
|
197635
|
-
const univariateCoffsB = new
|
|
197802
|
+
const univariateCoffsA = new _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_10__.UnivariateBezier(orderA);
|
|
197803
|
+
const univariateCoffsB = new _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_10__.UnivariateBezier(orderB);
|
|
197636
197804
|
for (let a = 0; a < numA; a++) {
|
|
197637
197805
|
for (let b = 0; b < numB; b++) {
|
|
197638
197806
|
if (rangeA[a].intersectsRangeXY(rangeB[b])) {
|
|
@@ -197656,7 +197824,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197656
197824
|
return this._worldToLocalPerspective.multiplyPoint3d(xyz, w);
|
|
197657
197825
|
if (this._worldToLocalAffine)
|
|
197658
197826
|
return this._worldToLocalAffine.multiplyXYZW(xyz.x, xyz.y, xyz.z, w);
|
|
197659
|
-
return
|
|
197827
|
+
return _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_11__.Point4d.createFromPointAndWeight(xyz, w);
|
|
197660
197828
|
}
|
|
197661
197829
|
mapNPCPlaneToWorld(npcPlane, worldPlane) {
|
|
197662
197830
|
// for NPC pointY, Y^ * H = 0 is "on" plane H. (Hat is transpose)
|
|
@@ -197680,7 +197848,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197680
197848
|
dispatchSegmentBsplineCurve(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, bcurve, extendB, reversed) {
|
|
197681
197849
|
const pointA0H = this.projectPoint(pointA0);
|
|
197682
197850
|
const pointA1H = this.projectPoint(pointA1);
|
|
197683
|
-
const planeCoffs =
|
|
197851
|
+
const planeCoffs = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_11__.Point4d.createPlanePointPointZ(pointA0H, pointA1H);
|
|
197684
197852
|
this.mapNPCPlaneToWorld(planeCoffs, planeCoffs);
|
|
197685
197853
|
// NOW .. we have a plane in world space. Intersect it with the bspline:
|
|
197686
197854
|
const intersections = [];
|
|
@@ -197692,7 +197860,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197692
197860
|
const fractionB = detail.fraction;
|
|
197693
197861
|
const curvePoint = detail.point;
|
|
197694
197862
|
const curvePointH = this.projectPoint(curvePoint);
|
|
197695
|
-
const lineFraction =
|
|
197863
|
+
const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_7__.SmallSystem.lineSegment3dHXYClosestPointUnbounded(pointA0H, pointA1H, curvePointH);
|
|
197696
197864
|
if (lineFraction !== undefined && this.acceptFraction(extendA0, lineFraction, extendA1) &&
|
|
197697
197865
|
this.acceptFraction(extendB, fractionB, extendB)) {
|
|
197698
197866
|
this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, fractionB, bcurve, 0, 1, reversed);
|
|
@@ -197796,72 +197964,130 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197796
197964
|
transform.multiplyPoint3d(pointB0, this._workPointB0);
|
|
197797
197965
|
transform.multiplyPoint3d(pointB1, this._workPointB1);
|
|
197798
197966
|
}
|
|
197967
|
+
/** Low level dispatch of curve collection. */
|
|
197968
|
+
dispatchCurveCollection(geomA, geomAHandler) {
|
|
197969
|
+
const geomB = this._geometryB; // save
|
|
197970
|
+
if (!geomB || !geomB.children || !(geomB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_12__.CurveCollection))
|
|
197971
|
+
return;
|
|
197972
|
+
for (const child of geomB.children) {
|
|
197973
|
+
this.resetGeometry(child);
|
|
197974
|
+
geomAHandler(geomA);
|
|
197975
|
+
}
|
|
197976
|
+
this._geometryB = geomB; // restore
|
|
197977
|
+
}
|
|
197978
|
+
/** Low level dispatch to geomA given a CurveChainWithDistanceIndex in geometryB. */
|
|
197979
|
+
dispatchCurveChainWithDistanceIndex(geomA, geomAHandler) {
|
|
197980
|
+
if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_13__.CurveChainWithDistanceIndex))
|
|
197981
|
+
return;
|
|
197982
|
+
if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_13__.CurveChainWithDistanceIndex) {
|
|
197983
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!!"call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
197984
|
+
return;
|
|
197985
|
+
}
|
|
197986
|
+
const index0 = this._results.length;
|
|
197987
|
+
const geomB = this._geometryB; // save
|
|
197988
|
+
for (const child of geomB.path.children) {
|
|
197989
|
+
this.resetGeometry(child);
|
|
197990
|
+
geomAHandler(geomA);
|
|
197991
|
+
}
|
|
197992
|
+
this.resetGeometry(geomB); // restore
|
|
197993
|
+
this._results = _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_13__.CurveChainWithDistanceIndex.convertChildDetailToChainDetail(this._results, index0, undefined, geomB, true);
|
|
197994
|
+
}
|
|
197799
197995
|
/** Double dispatch handler for strongly typed segment. */
|
|
197800
197996
|
handleLineSegment3d(segmentA) {
|
|
197801
|
-
if (this._geometryB instanceof
|
|
197997
|
+
if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_14__.LineSegment3d) {
|
|
197802
197998
|
const segmentB = this._geometryB;
|
|
197803
197999
|
this.dispatchSegmentSegment(segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA, segmentB, this._extendB, segmentB.point0Ref, 0.0, segmentB.point1Ref, 1.0, this._extendB, false);
|
|
197804
198000
|
}
|
|
197805
|
-
else if (this._geometryB instanceof
|
|
198001
|
+
else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_15__.LineString3d) {
|
|
197806
198002
|
this.computeSegmentLineString(segmentA, this._extendA, this._geometryB, this._extendB, false);
|
|
197807
198003
|
}
|
|
197808
|
-
else if (this._geometryB instanceof
|
|
198004
|
+
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_16__.Arc3d) {
|
|
197809
198005
|
this.dispatchSegmentArc(segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA, this._geometryB, this._extendB, this._extendB, false);
|
|
197810
198006
|
}
|
|
197811
|
-
else if (this._geometryB instanceof
|
|
198007
|
+
else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_17__.BSplineCurve3d) {
|
|
197812
198008
|
this.dispatchSegmentBsplineCurve(segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA, this._geometryB, this._extendB, false);
|
|
197813
198009
|
}
|
|
198010
|
+
else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_12__.CurveCollection) {
|
|
198011
|
+
this.dispatchCurveCollection(segmentA, this.handleLineSegment3d.bind(this));
|
|
198012
|
+
}
|
|
198013
|
+
else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_13__.CurveChainWithDistanceIndex) {
|
|
198014
|
+
this.dispatchCurveChainWithDistanceIndex(segmentA, this.handleLineSegment3d.bind(this));
|
|
198015
|
+
}
|
|
197814
198016
|
return undefined;
|
|
197815
198017
|
}
|
|
197816
198018
|
/** Double dispatch handler for strongly typed linestring. */
|
|
197817
198019
|
handleLineString3d(lsA) {
|
|
197818
|
-
if (this._geometryB instanceof
|
|
198020
|
+
if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_15__.LineString3d) {
|
|
197819
198021
|
const lsB = this._geometryB;
|
|
197820
198022
|
this.computeLineStringLineString(lsA, lsB, false);
|
|
197821
198023
|
}
|
|
197822
|
-
else if (this._geometryB instanceof
|
|
198024
|
+
else if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_14__.LineSegment3d) {
|
|
197823
198025
|
this.computeSegmentLineString(this._geometryB, this._extendB, lsA, this._extendA, true);
|
|
197824
198026
|
}
|
|
197825
|
-
else if (this._geometryB instanceof
|
|
198027
|
+
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_16__.Arc3d) {
|
|
197826
198028
|
this.computeArcLineString(this._geometryB, this._extendB, lsA, this._extendA, true);
|
|
197827
198029
|
}
|
|
197828
|
-
else if (this._geometryB instanceof
|
|
198030
|
+
else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_17__.BSplineCurve3d) {
|
|
197829
198031
|
this.dispatchLineStringBSplineCurve(lsA, this._extendA, this._geometryB, this._extendB, false);
|
|
197830
198032
|
}
|
|
198033
|
+
else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_12__.CurveCollection) {
|
|
198034
|
+
this.dispatchCurveCollection(lsA, this.handleLineString3d.bind(this));
|
|
198035
|
+
}
|
|
198036
|
+
else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_13__.CurveChainWithDistanceIndex) {
|
|
198037
|
+
this.dispatchCurveChainWithDistanceIndex(lsA, this.handleLineString3d.bind(this));
|
|
198038
|
+
}
|
|
197831
198039
|
return undefined;
|
|
197832
198040
|
}
|
|
197833
198041
|
/** Double dispatch handler for strongly typed arc. */
|
|
197834
198042
|
handleArc3d(arc0) {
|
|
197835
|
-
if (this._geometryB instanceof
|
|
198043
|
+
if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_14__.LineSegment3d) {
|
|
197836
198044
|
this.dispatchSegmentArc(this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB, arc0, this._extendA, this._extendA, true);
|
|
197837
198045
|
}
|
|
197838
|
-
else if (this._geometryB instanceof
|
|
198046
|
+
else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_15__.LineString3d) {
|
|
197839
198047
|
this.computeArcLineString(arc0, this._extendA, this._geometryB, this._extendB, false);
|
|
197840
198048
|
}
|
|
197841
|
-
else if (this._geometryB instanceof
|
|
198049
|
+
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_16__.Arc3d) {
|
|
197842
198050
|
this.dispatchArcArc(arc0, this._extendA, this._geometryB, this._extendB, false);
|
|
197843
198051
|
}
|
|
197844
|
-
else if (this._geometryB instanceof
|
|
198052
|
+
else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_17__.BSplineCurve3d) {
|
|
197845
198053
|
this.dispatchArcBsplineCurve3d(arc0, this._extendA, this._geometryB, this._extendB, false);
|
|
197846
198054
|
}
|
|
198055
|
+
else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_12__.CurveCollection) {
|
|
198056
|
+
this.dispatchCurveCollection(arc0, this.handleArc3d.bind(this));
|
|
198057
|
+
}
|
|
198058
|
+
else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_13__.CurveChainWithDistanceIndex) {
|
|
198059
|
+
this.dispatchCurveChainWithDistanceIndex(arc0, this.handleArc3d.bind(this));
|
|
198060
|
+
}
|
|
197847
198061
|
return undefined;
|
|
197848
198062
|
}
|
|
197849
198063
|
/** Double dispatch handler for strongly typed bspline curve. */
|
|
197850
198064
|
handleBSplineCurve3d(curve) {
|
|
197851
|
-
if (this._geometryB instanceof
|
|
198065
|
+
if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_14__.LineSegment3d) {
|
|
197852
198066
|
this.dispatchSegmentBsplineCurve(this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB, curve, this._extendA, true);
|
|
197853
198067
|
}
|
|
197854
|
-
else if (this._geometryB instanceof
|
|
198068
|
+
else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_15__.LineString3d) {
|
|
197855
198069
|
this.dispatchLineStringBSplineCurve(this._geometryB, this._extendB, curve, this._extendA, true);
|
|
197856
198070
|
}
|
|
197857
|
-
else if (this._geometryB instanceof
|
|
198071
|
+
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_16__.Arc3d) {
|
|
197858
198072
|
this.dispatchArcBsplineCurve3d(this._geometryB, this._extendB, curve, this._extendA, true);
|
|
197859
198073
|
}
|
|
197860
|
-
else if (this._geometryB instanceof
|
|
198074
|
+
else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_17__.BSplineCurve3dBase) {
|
|
197861
198075
|
this.dispatchBSplineCurve3dBSplineCurve3d(curve, this._geometryB, false);
|
|
197862
198076
|
}
|
|
198077
|
+
else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_12__.CurveCollection) {
|
|
198078
|
+
this.dispatchCurveCollection(curve, this.handleBSplineCurve3d.bind(this));
|
|
198079
|
+
}
|
|
198080
|
+
else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_13__.CurveChainWithDistanceIndex) {
|
|
198081
|
+
this.dispatchCurveChainWithDistanceIndex(curve, this.handleBSplineCurve3d.bind(this));
|
|
198082
|
+
}
|
|
197863
198083
|
return undefined;
|
|
197864
198084
|
}
|
|
198085
|
+
/** Double dispatch handler for strongly typed CurveChainWithDistanceIndex. */
|
|
198086
|
+
handleCurveChainWithDistanceIndex(chain) {
|
|
198087
|
+
super.handleCurveChainWithDistanceIndex(chain);
|
|
198088
|
+
// if _geometryB is also a CurveChainWithDistanceIndex, it will already have been converted by dispatchCurveChainWithDistanceIndex
|
|
198089
|
+
this._results = _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_13__.CurveChainWithDistanceIndex.convertChildDetailToChainDetail(this._results, 0, chain, undefined, true);
|
|
198090
|
+
}
|
|
197865
198091
|
/** Double dispatch handler for strongly typed homogeneous bspline curve .. */
|
|
197866
198092
|
handleBSplineCurve3dH(_curve) {
|
|
197867
198093
|
/*
|
|
@@ -197880,19 +198106,19 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
197880
198106
|
return undefined;
|
|
197881
198107
|
}
|
|
197882
198108
|
}
|
|
197883
|
-
CurveCurveIntersectXY._workVector2dA =
|
|
197884
|
-
CurveCurveIntersectXY._workPointA0H =
|
|
197885
|
-
CurveCurveIntersectXY._workPointA1H =
|
|
197886
|
-
CurveCurveIntersectXY._workPointB0H =
|
|
197887
|
-
CurveCurveIntersectXY._workPointB1H =
|
|
197888
|
-
CurveCurveIntersectXY._workPointAA0 =
|
|
197889
|
-
CurveCurveIntersectXY._workPointAA1 =
|
|
197890
|
-
CurveCurveIntersectXY._workPointBB0 =
|
|
197891
|
-
CurveCurveIntersectXY._workPointBB1 =
|
|
197892
|
-
CurveCurveIntersectXY._workPointA0 =
|
|
197893
|
-
CurveCurveIntersectXY._workPointA1 =
|
|
197894
|
-
CurveCurveIntersectXY._workPointB0 =
|
|
197895
|
-
CurveCurveIntersectXY._workPointB1 =
|
|
198109
|
+
CurveCurveIntersectXY._workVector2dA = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_18__.Vector2d.create();
|
|
198110
|
+
CurveCurveIntersectXY._workPointA0H = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_11__.Point4d.create();
|
|
198111
|
+
CurveCurveIntersectXY._workPointA1H = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_11__.Point4d.create();
|
|
198112
|
+
CurveCurveIntersectXY._workPointB0H = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_11__.Point4d.create();
|
|
198113
|
+
CurveCurveIntersectXY._workPointB1H = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_11__.Point4d.create();
|
|
198114
|
+
CurveCurveIntersectXY._workPointAA0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_19__.Point3d.create();
|
|
198115
|
+
CurveCurveIntersectXY._workPointAA1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_19__.Point3d.create();
|
|
198116
|
+
CurveCurveIntersectXY._workPointBB0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_19__.Point3d.create();
|
|
198117
|
+
CurveCurveIntersectXY._workPointBB1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_19__.Point3d.create();
|
|
198118
|
+
CurveCurveIntersectXY._workPointA0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_19__.Point3d.create();
|
|
198119
|
+
CurveCurveIntersectXY._workPointA1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_19__.Point3d.create();
|
|
198120
|
+
CurveCurveIntersectXY._workPointB0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_19__.Point3d.create();
|
|
198121
|
+
CurveCurveIntersectXY._workPointB1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_19__.Point3d.create();
|
|
197896
198122
|
|
|
197897
198123
|
|
|
197898
198124
|
|
|
@@ -197909,17 +198135,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
197909
198135
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
197910
198136
|
/* harmony export */ CurveCurveIntersectXYZ: () => (/* binding */ CurveCurveIntersectXYZ)
|
|
197911
198137
|
/* harmony export */ });
|
|
197912
|
-
/* harmony import */ var
|
|
197913
|
-
/* harmony import */ var
|
|
197914
|
-
/* harmony import */ var
|
|
197915
|
-
/* harmony import */ var
|
|
197916
|
-
/* harmony import */ var
|
|
197917
|
-
/* harmony import */ var
|
|
197918
|
-
/* harmony import */ var
|
|
197919
|
-
/* harmony import */ var
|
|
197920
|
-
/* harmony import */ var
|
|
197921
|
-
/* harmony import */ var
|
|
197922
|
-
/* harmony import */ var
|
|
198138
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
198139
|
+
/* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
|
|
198140
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
198141
|
+
/* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
|
|
198142
|
+
/* harmony import */ var _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../geometry3d/Plane3dByOriginAndUnitNormal */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js");
|
|
198143
|
+
/* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
|
|
198144
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
198145
|
+
/* harmony import */ var _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../numerics/Polynomials */ "../../core/geometry/lib/esm/numerics/Polynomials.js");
|
|
198146
|
+
/* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
198147
|
+
/* harmony import */ var _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../CurveChainWithDistanceIndex */ "../../core/geometry/lib/esm/curve/CurveChainWithDistanceIndex.js");
|
|
198148
|
+
/* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
198149
|
+
/* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
|
|
198150
|
+
/* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
198151
|
+
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
197923
198152
|
/*---------------------------------------------------------------------------------------------
|
|
197924
198153
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
197925
198154
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -197938,6 +198167,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
197938
198167
|
|
|
197939
198168
|
|
|
197940
198169
|
|
|
198170
|
+
|
|
198171
|
+
|
|
198172
|
+
|
|
197941
198173
|
// cspell:word XYRR
|
|
197942
198174
|
/**
|
|
197943
198175
|
* Handler class for XYZ intersections between _geometryB and another geometry.
|
|
@@ -197945,7 +198177,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
197945
198177
|
* * geometryB is saved for later reference.
|
|
197946
198178
|
* @internal
|
|
197947
198179
|
*/
|
|
197948
|
-
class CurveCurveIntersectXYZ extends
|
|
198180
|
+
class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_1__.RecurseToCurvesGeometryHandler {
|
|
197949
198181
|
/**
|
|
197950
198182
|
* @param extendA flag to enable using extension of the other geometry.
|
|
197951
198183
|
* @param geometryB second curve for intersection. Saved for reference by specific handler methods.
|
|
@@ -197958,6 +198190,10 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
197958
198190
|
this._extendB = extendB;
|
|
197959
198191
|
this._results = [];
|
|
197960
198192
|
}
|
|
198193
|
+
/** Reset the geometry, leaving all other parts unchanged (and preserving accumulated intersections). */
|
|
198194
|
+
resetGeometry(geometryB) {
|
|
198195
|
+
this._geometryB = geometryB;
|
|
198196
|
+
}
|
|
197961
198197
|
/**
|
|
197962
198198
|
* Return the results structure for the intersection calculation, structured as an array of CurveLocationDetailPair.
|
|
197963
198199
|
* @param reinitialize if true, a new results structure is created for use by later calls.
|
|
@@ -197982,21 +198218,21 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
197982
198218
|
* Record with fraction mapping.
|
|
197983
198219
|
*/
|
|
197984
198220
|
recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, cpB, fractionB0, fractionB1, reversed) {
|
|
197985
|
-
const globalFractionA =
|
|
197986
|
-
const globalFractionB =
|
|
197987
|
-
// ignore duplicate of most recent point
|
|
198221
|
+
const globalFractionA = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionA0, localFractionA, fractionA1);
|
|
198222
|
+
const globalFractionB = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.interpolate(fractionB0, localFractionB, fractionB1);
|
|
198223
|
+
// ignore duplicate of most recent point
|
|
197988
198224
|
const numPrevious = this._results.length;
|
|
197989
198225
|
if (numPrevious > 0) {
|
|
197990
|
-
const
|
|
197991
|
-
const
|
|
198226
|
+
const oldDetailA = this._results[numPrevious - 1].detailA;
|
|
198227
|
+
const oldDetailB = this._results[numPrevious - 1].detailB;
|
|
197992
198228
|
if (reversed) {
|
|
197993
|
-
if (
|
|
197994
|
-
|
|
198229
|
+
if (oldDetailB.isSameCurveAndFraction({ curve: cpA, fraction: globalFractionA }) &&
|
|
198230
|
+
oldDetailA.isSameCurveAndFraction({ curve: cpB, fraction: globalFractionB }))
|
|
197995
198231
|
return;
|
|
197996
198232
|
}
|
|
197997
198233
|
else {
|
|
197998
|
-
if (
|
|
197999
|
-
|
|
198234
|
+
if (oldDetailA.isSameCurveAndFraction({ curve: cpA, fraction: globalFractionA }) &&
|
|
198235
|
+
oldDetailB.isSameCurveAndFraction({ curve: cpB, fraction: globalFractionB }))
|
|
198000
198236
|
return;
|
|
198001
198237
|
}
|
|
198002
198238
|
}
|
|
@@ -198004,16 +198240,16 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198004
198240
|
const pointB = cpB.fractionToPoint(globalFractionB);
|
|
198005
198241
|
if (!pointA.isAlmostEqualMetric(pointB))
|
|
198006
198242
|
return;
|
|
198007
|
-
const detailA =
|
|
198008
|
-
detailA.setIntervalRole(
|
|
198009
|
-
const detailB =
|
|
198010
|
-
detailB.setIntervalRole(
|
|
198243
|
+
const detailA = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveFractionPoint(cpA, globalFractionA, pointA);
|
|
198244
|
+
detailA.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveIntervalRole.isolated);
|
|
198245
|
+
const detailB = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetail.createCurveFractionPoint(cpB, globalFractionB, pointB);
|
|
198246
|
+
detailB.setIntervalRole(_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveIntervalRole.isolated);
|
|
198011
198247
|
if (reversed) {
|
|
198012
|
-
const pair = new
|
|
198248
|
+
const pair = new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetailPair(detailB, detailA);
|
|
198013
198249
|
this._results.push(pair);
|
|
198014
198250
|
}
|
|
198015
198251
|
else {
|
|
198016
|
-
const pair = new
|
|
198252
|
+
const pair = new _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_3__.CurveLocationDetailPair(detailA, detailB);
|
|
198017
198253
|
this._results.push(pair);
|
|
198018
198254
|
}
|
|
198019
198255
|
}
|
|
@@ -198024,7 +198260,7 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198024
198260
|
*/
|
|
198025
198261
|
computeSegmentSegment3D(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {
|
|
198026
198262
|
const uv = CurveCurveIntersectXYZ._workVector2dA;
|
|
198027
|
-
if (
|
|
198263
|
+
if (_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_4__.SmallSystem.lineSegment3dClosestApproachUnbounded(pointA0, pointA1, pointB0, pointB1, uv) &&
|
|
198028
198264
|
this.acceptFraction(extendA0, uv.x, extendA1) && this.acceptFraction(extendB0, uv.y, extendB1)) {
|
|
198029
198265
|
this.recordPointWithLocalFractions(uv.x, cpA, fractionA0, fractionA1, uv.y, cpB, fractionB0, fractionB1, reversed);
|
|
198030
198266
|
}
|
|
@@ -198051,20 +198287,20 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198051
198287
|
* @param vectorC second candidate for additional in-plane vector
|
|
198052
198288
|
*/
|
|
198053
198289
|
createPlaneWithPreferredPerpendicular(origin, vectorA, cosineValue, vectorB, vectorC) {
|
|
198054
|
-
cosineValue =
|
|
198290
|
+
cosineValue = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.restrictToInterval(Math.abs(cosineValue), 0.0, 1.0 - _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallFraction);
|
|
198055
198291
|
const dotAA = vectorA.magnitudeSquared();
|
|
198056
198292
|
const dotBB = vectorB.magnitudeSquared();
|
|
198057
198293
|
const dotAB = Math.abs(vectorA.dotProduct(vectorB));
|
|
198058
198294
|
const cross = vectorA.unitCrossProduct(dotAB * dotAB <= cosineValue * cosineValue * dotAA * dotBB ? vectorB : vectorC);
|
|
198059
198295
|
if (cross)
|
|
198060
|
-
return
|
|
198296
|
+
return _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_5__.Plane3dByOriginAndUnitNormal.create(origin, cross);
|
|
198061
198297
|
return undefined;
|
|
198062
198298
|
}
|
|
198063
198299
|
// Caller accesses data from a linestring or segment and passes it here.
|
|
198064
198300
|
// The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
|
|
198065
198301
|
// The fraction and extend parameters allow all combinations to be passed in.
|
|
198066
198302
|
dispatchSegmentArc(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, arc, extendB0, extendB1, reversed) {
|
|
198067
|
-
const lineVector =
|
|
198303
|
+
const lineVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.createStartEnd(pointA0, pointA1);
|
|
198068
198304
|
const plane = this.createPlaneWithPreferredPerpendicular(pointA0, lineVector, 0.94, arc.perpendicularVector, arc.vector0);
|
|
198069
198305
|
if (plane !== undefined) {
|
|
198070
198306
|
const candidates = [];
|
|
@@ -198073,7 +198309,7 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198073
198309
|
let linePoint;
|
|
198074
198310
|
for (const c of candidates) {
|
|
198075
198311
|
if (this.acceptFraction(extendB0, c.fraction, extendB1)) {
|
|
198076
|
-
lineFraction =
|
|
198312
|
+
lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_4__.SmallSystem.lineSegment3dClosestPointUnbounded(pointA0, pointA1, c.point);
|
|
198077
198313
|
if (lineFraction !== undefined) {
|
|
198078
198314
|
linePoint = pointA0.interpolate(lineFraction, pointA1, linePoint);
|
|
198079
198315
|
if (linePoint.isAlmostEqualMetric(c.point)
|
|
@@ -198094,7 +198330,7 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198094
198330
|
if (otherVectors !== undefined) {
|
|
198095
198331
|
const ellipseRadians = [];
|
|
198096
198332
|
const circleRadians = [];
|
|
198097
|
-
|
|
198333
|
+
_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_4__.TrigPolynomial.solveUnitCircleHomogeneousEllipseIntersection(otherVectors.center.x, otherVectors.center.y, 1.0, otherVectors.vector0.x, otherVectors.vector0.y, 0.0, otherVectors.vector90.x, otherVectors.vector90.y, 0.0, ellipseRadians, circleRadians);
|
|
198098
198334
|
for (let i = 0; i < ellipseRadians.length; i++) {
|
|
198099
198335
|
const fractionA = cpA.sweep.radiansToSignedPeriodicFraction(circleRadians[i]);
|
|
198100
198336
|
const fractionB = cpB.sweep.radiansToSignedPeriodicFraction(ellipseRadians[i]);
|
|
@@ -198114,8 +198350,8 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198114
198350
|
// 2) accept points that appear in both intersection sets.
|
|
198115
198351
|
// If arcs are in parallel planes -- no intersections.
|
|
198116
198352
|
// If arcs are in the same plane -- xy intersection in that plane.
|
|
198117
|
-
const planeA =
|
|
198118
|
-
const planeB =
|
|
198353
|
+
const planeA = _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_5__.Plane3dByOriginAndUnitNormal.create(cpA.center, cpA.perpendicularVector);
|
|
198354
|
+
const planeB = _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_5__.Plane3dByOriginAndUnitNormal.create(cpB.center, cpB.perpendicularVector);
|
|
198119
198355
|
if (planeA === undefined || planeB === undefined)
|
|
198120
198356
|
return;
|
|
198121
198357
|
if (planeA.getNormalRef().isParallelTo(planeB.getNormalRef())) {
|
|
@@ -198516,72 +198752,130 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198516
198752
|
}
|
|
198517
198753
|
}
|
|
198518
198754
|
}
|
|
198755
|
+
/** Low level dispatch of curve collection. */
|
|
198756
|
+
dispatchCurveCollection(geomA, geomAHandler) {
|
|
198757
|
+
const geomB = this._geometryB; // save
|
|
198758
|
+
if (!geomB || !geomB.children || !(geomB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_7__.CurveCollection))
|
|
198759
|
+
return;
|
|
198760
|
+
for (const child of geomB.children) {
|
|
198761
|
+
this.resetGeometry(child);
|
|
198762
|
+
geomAHandler(geomA);
|
|
198763
|
+
}
|
|
198764
|
+
this._geometryB = geomB; // restore
|
|
198765
|
+
}
|
|
198766
|
+
/** Low level dispatch to geomA given a CurveChainWithDistanceIndex in geometryB. */
|
|
198767
|
+
dispatchCurveChainWithDistanceIndex(geomA, geomAHandler) {
|
|
198768
|
+
if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_8__.CurveChainWithDistanceIndex))
|
|
198769
|
+
return;
|
|
198770
|
+
if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_8__.CurveChainWithDistanceIndex) {
|
|
198771
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!!"call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
198772
|
+
return;
|
|
198773
|
+
}
|
|
198774
|
+
const index0 = this._results.length;
|
|
198775
|
+
const geomB = this._geometryB; // save
|
|
198776
|
+
for (const child of geomB.path.children) {
|
|
198777
|
+
this.resetGeometry(child);
|
|
198778
|
+
geomAHandler(geomA);
|
|
198779
|
+
}
|
|
198780
|
+
this.resetGeometry(geomB); // restore
|
|
198781
|
+
this._results = _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_8__.CurveChainWithDistanceIndex.convertChildDetailToChainDetail(this._results, index0, undefined, geomB, true);
|
|
198782
|
+
}
|
|
198519
198783
|
/** Double dispatch handler for strongly typed segment. */
|
|
198520
198784
|
handleLineSegment3d(segmentA) {
|
|
198521
|
-
if (this._geometryB instanceof
|
|
198785
|
+
if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_9__.LineSegment3d) {
|
|
198522
198786
|
const segmentB = this._geometryB;
|
|
198523
198787
|
this.dispatchSegmentSegment(segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA, segmentB, this._extendB, segmentB.point0Ref, 0.0, segmentB.point1Ref, 1.0, this._extendB, false);
|
|
198524
198788
|
}
|
|
198525
|
-
else if (this._geometryB instanceof
|
|
198789
|
+
else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_10__.LineString3d) {
|
|
198526
198790
|
this.computeSegmentLineString(segmentA, this._extendA, this._geometryB, this._extendB, false);
|
|
198527
198791
|
}
|
|
198528
|
-
else if (this._geometryB instanceof
|
|
198792
|
+
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_11__.Arc3d) {
|
|
198529
198793
|
this.dispatchSegmentArc(segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA, this._geometryB, this._extendB, this._extendB, false);
|
|
198530
198794
|
}
|
|
198531
|
-
else if (this._geometryB instanceof
|
|
198795
|
+
else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__.BSplineCurve3d) {
|
|
198532
198796
|
this.dispatchSegmentBsplineCurve(segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA, this._geometryB, this._extendB, false);
|
|
198533
198797
|
}
|
|
198798
|
+
else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_7__.CurveCollection) {
|
|
198799
|
+
this.dispatchCurveCollection(segmentA, this.handleLineSegment3d.bind(this));
|
|
198800
|
+
}
|
|
198801
|
+
else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_8__.CurveChainWithDistanceIndex) {
|
|
198802
|
+
this.dispatchCurveChainWithDistanceIndex(segmentA, this.handleLineSegment3d.bind(this));
|
|
198803
|
+
}
|
|
198534
198804
|
return undefined;
|
|
198535
198805
|
}
|
|
198536
198806
|
/** double dispatch handler for strongly typed linestring. */
|
|
198537
198807
|
handleLineString3d(lsA) {
|
|
198538
|
-
if (this._geometryB instanceof
|
|
198808
|
+
if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_10__.LineString3d) {
|
|
198539
198809
|
const lsB = this._geometryB;
|
|
198540
198810
|
this.computeLineStringLineString(lsA, lsB, false);
|
|
198541
198811
|
}
|
|
198542
|
-
else if (this._geometryB instanceof
|
|
198812
|
+
else if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_9__.LineSegment3d) {
|
|
198543
198813
|
this.computeSegmentLineString(this._geometryB, this._extendB, lsA, this._extendA, true);
|
|
198544
198814
|
}
|
|
198545
|
-
else if (this._geometryB instanceof
|
|
198815
|
+
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_11__.Arc3d) {
|
|
198546
198816
|
this.computeArcLineString(this._geometryB, this._extendB, lsA, this._extendA, true);
|
|
198547
198817
|
}
|
|
198548
|
-
else if (this._geometryB instanceof
|
|
198818
|
+
else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__.BSplineCurve3d) {
|
|
198549
198819
|
this.dispatchLineStringBSplineCurve(lsA, this._extendA, this._geometryB, this._extendB, false);
|
|
198550
198820
|
}
|
|
198821
|
+
else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_7__.CurveCollection) {
|
|
198822
|
+
this.dispatchCurveCollection(lsA, this.handleLineString3d.bind(this));
|
|
198823
|
+
}
|
|
198824
|
+
else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_8__.CurveChainWithDistanceIndex) {
|
|
198825
|
+
this.dispatchCurveChainWithDistanceIndex(lsA, this.handleLineString3d.bind(this));
|
|
198826
|
+
}
|
|
198551
198827
|
return undefined;
|
|
198552
198828
|
}
|
|
198553
198829
|
/** Double dispatch handler for strongly typed arc. */
|
|
198554
198830
|
handleArc3d(arc0) {
|
|
198555
|
-
if (this._geometryB instanceof
|
|
198831
|
+
if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_9__.LineSegment3d) {
|
|
198556
198832
|
this.dispatchSegmentArc(this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB, arc0, this._extendA, this._extendA, true);
|
|
198557
198833
|
}
|
|
198558
|
-
else if (this._geometryB instanceof
|
|
198834
|
+
else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_10__.LineString3d) {
|
|
198559
198835
|
this.computeArcLineString(arc0, this._extendA, this._geometryB, this._extendB, false);
|
|
198560
198836
|
}
|
|
198561
|
-
else if (this._geometryB instanceof
|
|
198837
|
+
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_11__.Arc3d) {
|
|
198562
198838
|
this.dispatchArcArc(arc0, this._extendA, this._geometryB, this._extendB, false);
|
|
198563
198839
|
}
|
|
198564
|
-
else if (this._geometryB instanceof
|
|
198840
|
+
else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__.BSplineCurve3d) {
|
|
198565
198841
|
this.dispatchArcBsplineCurve3d(arc0, this._extendA, this._geometryB, this._extendB, false);
|
|
198566
198842
|
}
|
|
198843
|
+
else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_7__.CurveCollection) {
|
|
198844
|
+
this.dispatchCurveCollection(arc0, this.handleArc3d.bind(this));
|
|
198845
|
+
}
|
|
198846
|
+
else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_8__.CurveChainWithDistanceIndex) {
|
|
198847
|
+
this.dispatchCurveChainWithDistanceIndex(arc0, this.handleArc3d.bind(this));
|
|
198848
|
+
}
|
|
198567
198849
|
return undefined;
|
|
198568
198850
|
}
|
|
198569
198851
|
/** Double dispatch handler for strongly typed bspline curve. */
|
|
198570
198852
|
handleBSplineCurve3d(curve) {
|
|
198571
|
-
if (this._geometryB instanceof
|
|
198853
|
+
if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_9__.LineSegment3d) {
|
|
198572
198854
|
this.dispatchSegmentBsplineCurve(this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB, curve, this._extendA, true);
|
|
198573
198855
|
}
|
|
198574
|
-
else if (this._geometryB instanceof
|
|
198856
|
+
else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_10__.LineString3d) {
|
|
198575
198857
|
this.dispatchLineStringBSplineCurve(this._geometryB, this._extendB, curve, this._extendA, true);
|
|
198576
198858
|
}
|
|
198577
|
-
else if (this._geometryB instanceof
|
|
198859
|
+
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_11__.Arc3d) {
|
|
198578
198860
|
this.dispatchArcBsplineCurve3d(this._geometryB, this._extendB, curve, this._extendA, true);
|
|
198579
198861
|
}
|
|
198580
|
-
else if (this._geometryB instanceof
|
|
198862
|
+
else if (this._geometryB instanceof _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__.BSplineCurve3dBase) {
|
|
198581
198863
|
this.dispatchBSplineCurve3dBSplineCurve3d(curve, this._geometryB, false);
|
|
198582
198864
|
}
|
|
198865
|
+
else if (this._geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_7__.CurveCollection) {
|
|
198866
|
+
this.dispatchCurveCollection(curve, this.handleBSplineCurve3d.bind(this));
|
|
198867
|
+
}
|
|
198868
|
+
else if (this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_8__.CurveChainWithDistanceIndex) {
|
|
198869
|
+
this.dispatchCurveChainWithDistanceIndex(curve, this.handleBSplineCurve3d.bind(this));
|
|
198870
|
+
}
|
|
198583
198871
|
return undefined;
|
|
198584
198872
|
}
|
|
198873
|
+
/** Double dispatch handler for strongly typed CurveChainWithDistanceIndex. */
|
|
198874
|
+
handleCurveChainWithDistanceIndex(chain) {
|
|
198875
|
+
super.handleCurveChainWithDistanceIndex(chain);
|
|
198876
|
+
// if _geometryB is also a CurveChainWithDistanceIndex, it will already have been converted by dispatchCurveChainWithDistanceIndex
|
|
198877
|
+
this._results = _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_8__.CurveChainWithDistanceIndex.convertChildDetailToChainDetail(this._results, 0, chain, undefined, true);
|
|
198878
|
+
}
|
|
198585
198879
|
/** Double dispatch handler for strongly typed homogeneous bspline curve. */
|
|
198586
198880
|
handleBSplineCurve3dH(_curve) {
|
|
198587
198881
|
/*
|
|
@@ -198600,11 +198894,11 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198600
198894
|
return undefined;
|
|
198601
198895
|
}
|
|
198602
198896
|
}
|
|
198603
|
-
CurveCurveIntersectXYZ._workVector2dA =
|
|
198604
|
-
CurveCurveIntersectXYZ._workPointAA0 =
|
|
198605
|
-
CurveCurveIntersectXYZ._workPointAA1 =
|
|
198606
|
-
CurveCurveIntersectXYZ._workPointBB0 =
|
|
198607
|
-
CurveCurveIntersectXYZ._workPointBB1 =
|
|
198897
|
+
CurveCurveIntersectXYZ._workVector2dA = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_13__.Vector2d.create();
|
|
198898
|
+
CurveCurveIntersectXYZ._workPointAA0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
|
|
198899
|
+
CurveCurveIntersectXYZ._workPointAA1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
|
|
198900
|
+
CurveCurveIntersectXYZ._workPointBB0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
|
|
198901
|
+
CurveCurveIntersectXYZ._workPointBB1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
|
|
198608
198902
|
|
|
198609
198903
|
|
|
198610
198904
|
|
|
@@ -198969,10 +199263,9 @@ class MultiChainCollector {
|
|
|
198969
199263
|
captureCurve(candidate) {
|
|
198970
199264
|
if (candidate instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive)
|
|
198971
199265
|
this.captureCurvePrimitive(candidate);
|
|
198972
|
-
else if (candidate instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_2__.CurveCollection
|
|
198973
|
-
for (const c of candidate.children)
|
|
199266
|
+
else if (candidate instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_2__.CurveCollection) {
|
|
199267
|
+
for (const c of candidate.children)
|
|
198974
199268
|
this.captureCurve(c);
|
|
198975
|
-
}
|
|
198976
199269
|
}
|
|
198977
199270
|
}
|
|
198978
199271
|
/** If allowed by the geometry type, move an endpoint. */
|
|
@@ -225175,7 +225468,7 @@ class Point4d extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
|
|
|
225175
225468
|
return undefined;
|
|
225176
225469
|
}
|
|
225177
225470
|
/**
|
|
225178
|
-
* * Return xyz projection of spacePoint to the plane
|
|
225471
|
+
* * Return xyz projection of spacePoint to the plane (this Point4d is understood as plane coefficients, not point coordinates)
|
|
225179
225472
|
* * If the xyz part of `this` are all zero, (a clone of) `spacePoint` is returned.
|
|
225180
225473
|
*/
|
|
225181
225474
|
projectPointToPlane(spacePoint, result) {
|
|
@@ -225695,14 +225988,15 @@ class BezierCoffs {
|
|
|
225695
225988
|
for (let i = 0; i < this.coffs.length; i++)
|
|
225696
225989
|
this.coffs[i] += a;
|
|
225697
225990
|
}
|
|
225698
|
-
/** Compute parameter values where the bezier value matches
|
|
225991
|
+
/** Compute parameter values where the bezier value matches targetValue.
|
|
225699
225992
|
* * The base class finds roots only in 01. (i.e. ignores _restrictTo01)
|
|
225700
|
-
* * Order-specific implementations apply special case
|
|
225993
|
+
* * Order-specific implementations apply special case analytic logic, e.g. for degree 1,2,3,4.
|
|
225701
225994
|
*/
|
|
225702
225995
|
roots(targetValue, _restrictTo01) {
|
|
225703
225996
|
const bezier = UnivariateBezier.create(this);
|
|
225704
225997
|
bezier.addInPlace(-targetValue);
|
|
225705
|
-
|
|
225998
|
+
const roots = UnivariateBezier.deflateRoots(bezier);
|
|
225999
|
+
return this.filter01(roots, true);
|
|
225706
226000
|
}
|
|
225707
226001
|
/** Given an array of numbers, optionally remove those not in the 0..1 interval.
|
|
225708
226002
|
* @param roots candidate values
|
|
@@ -225730,7 +226024,9 @@ class BezierCoffs {
|
|
|
225730
226024
|
return undefined;
|
|
225731
226025
|
}
|
|
225732
226026
|
/** zero out all coefficients. */
|
|
225733
|
-
zero() {
|
|
226027
|
+
zero() {
|
|
226028
|
+
this.coffs.fill(0);
|
|
226029
|
+
}
|
|
225734
226030
|
/** Subdivide -- write results into caller-supplied bezier coffs (which must be of the same order) */
|
|
225735
226031
|
subdivide(u, left, right) {
|
|
225736
226032
|
const order = this.order;
|
|
@@ -226253,11 +226549,10 @@ class UnivariateBezier extends BezierCoffs {
|
|
|
226253
226549
|
// first c0*b0 = a0
|
|
226254
226550
|
// last c[orderC-1]*b1 = a[orderA-1]
|
|
226255
226551
|
/** Find roots of a bezier polynomial
|
|
226256
|
-
* * Only look for roots in 0..1
|
|
226257
226552
|
* * As roots are found, deflate the polynomial.
|
|
226258
226553
|
* * bezier coffs are changed (and order reduced) at each step.
|
|
226259
226554
|
*/
|
|
226260
|
-
static
|
|
226555
|
+
static deflateRoots(bezier) {
|
|
226261
226556
|
const roots = [];
|
|
226262
226557
|
const coffs = bezier.coffs;
|
|
226263
226558
|
let a0, a1, segmentFraction, globalStartFraction, newtonFraction;
|
|
@@ -280372,7 +280667,7 @@ class TestContext {
|
|
|
280372
280667
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
280373
280668
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
280374
280669
|
await core_frontend_1.NoRenderApp.startup({
|
|
280375
|
-
applicationVersion: "4.3.0-dev.
|
|
280670
|
+
applicationVersion: "4.3.0-dev.5",
|
|
280376
280671
|
applicationId: this.settings.gprid,
|
|
280377
280672
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
|
|
280378
280673
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -299780,7 +300075,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
|
299780
300075
|
/***/ ((module) => {
|
|
299781
300076
|
|
|
299782
300077
|
"use strict";
|
|
299783
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.3.0-dev.
|
|
300078
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.3.0-dev.5","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.3.0-dev.5","@itwin/core-bentley":"workspace:^4.3.0-dev.5","@itwin/core-common":"workspace:^4.3.0-dev.5","@itwin/core-geometry":"workspace:^4.3.0-dev.5","@itwin/core-orbitgt":"workspace:^4.3.0-dev.5","@itwin/core-quantity":"workspace:^4.3.0-dev.5"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"18.16.1","@types/sinon":"^10.0.15","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^15.0.4","source-map-loader":"^4.0.0","typescript":"~5.0.2","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.1.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
|
|
299784
300079
|
|
|
299785
300080
|
/***/ }),
|
|
299786
300081
|
|