@itwin/ecschema-rpcinterface-tests 5.2.0 → 5.2.1
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 +347 -280
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_cross-fetch_4_0_0_node_modules_cross-fetch_dist_browser-24291b.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_4_3_4__loaders_gl_core_4_3_4_node_modu-4c1fc9.bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -151998,6 +151998,7 @@ class ArcGISImageryProvider extends _tile_internal__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
151998
151998
|
if (this._accessTokenRequired && this._accessClient) {
|
|
151999
151999
|
this._lastAccessToken = await _tile_internal__WEBPACK_IMPORTED_MODULE_0__.ArcGisUtilities.appendSecurityToken(urlObj, this._accessClient, {
|
|
152000
152000
|
mapLayerUrl: new URL(this._settings.url),
|
|
152001
|
+
portal: typeof this._settings.properties?.portal === "string" ? this._settings.properties.portal : undefined,
|
|
152001
152002
|
userName: this._settings.userName,
|
|
152002
152003
|
password: this._settings.password
|
|
152003
152004
|
});
|
|
@@ -201045,16 +201046,14 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
201045
201046
|
}
|
|
201046
201047
|
/** Return the (signed) area between (a fractional portion of) the arc and the chord between those points. */
|
|
201047
201048
|
areaToChordXY(fraction0, fraction1) {
|
|
201048
|
-
|
|
201049
|
-
// areas in arc of unit circle with radians limits
|
|
201049
|
+
const detJ = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.crossProductXYXY(this._matrix.coffs[0], this._matrix.coffs[3], this._matrix.coffs[1], this._matrix.coffs[4]); // area scale factor from local to world
|
|
201050
201050
|
const radians0 = this._sweep.fractionToRadians(fraction0);
|
|
201051
201051
|
const radians1 = this._sweep.fractionToRadians(fraction1);
|
|
201052
|
-
|
|
201053
|
-
|
|
201054
|
-
|
|
201055
|
-
detJ = -detJ;
|
|
201052
|
+
const alpha = 0.5 * (radians1 - radians0); // signed area of local sector
|
|
201053
|
+
// Compute signed area of local triangle ("wedge") formed by origin and arc endpoints p0, p1:
|
|
201054
|
+
// (p0 x p1)/2 = (cos(r0)sin(r1)-cos(r1)sin(r0))/2 = sin(r1-r0)/2 = cos(a)sin(a)
|
|
201056
201055
|
const wedgeArea = Math.cos(alpha) * Math.sin(alpha);
|
|
201057
|
-
return (alpha - wedgeArea) * detJ;
|
|
201056
|
+
return (alpha - wedgeArea) * detJ; // to world
|
|
201058
201057
|
}
|
|
201059
201058
|
/**
|
|
201060
201059
|
* Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).
|
|
@@ -204481,8 +204480,7 @@ class CurveOps {
|
|
|
204481
204480
|
/**
|
|
204482
204481
|
* Check whether or not the curves are planar, and if so, return a localToWorld frame.
|
|
204483
204482
|
* @param curves input geometry: curves or points.
|
|
204484
|
-
* @param
|
|
204485
|
-
* @param result optional pre-allocated object to populate and return.
|
|
204483
|
+
* @param options bundle of options.
|
|
204486
204484
|
* @returns localToWorld frame `T` for coplanar curves, or undefined if they are not coplanar.
|
|
204487
204485
|
* `T` satisfies:
|
|
204488
204486
|
* * `T.origin` is in the plane.
|
|
@@ -204502,9 +204500,7 @@ class CurveOps {
|
|
|
204502
204500
|
* Check whether or not the curves lie in a straight line, and if so, return a colinear ray.
|
|
204503
204501
|
* * This test does not take curve traversal or point order into account.
|
|
204504
204502
|
* @param curves input geometry: curves or points.
|
|
204505
|
-
* @param
|
|
204506
|
-
* @param tolerance optional maximum allowable linear deviation, default [[Geometry.smallMetricDistance]].
|
|
204507
|
-
* @param result optional pre-allocated object to populate and return.
|
|
204503
|
+
* @param options bundle of options.
|
|
204508
204504
|
* @returns ray colinear with input, or undefined if input is not colinear.
|
|
204509
204505
|
*/
|
|
204510
204506
|
static isColinear(curves, options) {
|
|
@@ -209193,17 +209189,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
209193
209189
|
/* harmony export */ });
|
|
209194
209190
|
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
209195
209191
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
209192
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
209196
209193
|
/* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
|
|
209197
|
-
/* harmony import */ var
|
|
209194
|
+
/* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
|
|
209198
209195
|
/* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
|
|
209199
209196
|
/* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
209200
209197
|
/* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
|
|
209201
209198
|
/* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
209202
209199
|
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
209203
|
-
/* harmony import */ var
|
|
209204
|
-
/* harmony import */ var
|
|
209205
|
-
/* harmony import */ var
|
|
209206
|
-
/* harmony import */ var
|
|
209200
|
+
/* harmony import */ var _Loop__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
209201
|
+
/* harmony import */ var _ParityRegion__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
|
|
209202
|
+
/* harmony import */ var _RegionOps__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
|
|
209203
|
+
/* harmony import */ var _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../RegionOpsClassificationSweeps */ "../../core/geometry/lib/esm/curve/RegionOpsClassificationSweeps.js");
|
|
209207
209204
|
/*---------------------------------------------------------------------------------------------
|
|
209208
209205
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
209209
209206
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -209221,9 +209218,29 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
209221
209218
|
|
|
209222
209219
|
|
|
209223
209220
|
|
|
209221
|
+
|
|
209224
209222
|
/** @packageDocumentation
|
|
209225
209223
|
* @module Curve
|
|
209226
209224
|
*/
|
|
209225
|
+
function computeSortAngle(curve, fraction, reverse) {
|
|
209226
|
+
const ray = curve.fractionToPointAndDerivative(fraction);
|
|
209227
|
+
const s = reverse ? -1.0 : 1.0;
|
|
209228
|
+
return Math.atan2(s * ray.direction.y, s * ray.direction.x);
|
|
209229
|
+
}
|
|
209230
|
+
function getFractionOnCurve(pair, curve) {
|
|
209231
|
+
if (pair.detailA.curve === curve)
|
|
209232
|
+
return pair.detailA.fraction;
|
|
209233
|
+
if (pair.detailB.curve === curve)
|
|
209234
|
+
return pair.detailB.fraction;
|
|
209235
|
+
return undefined;
|
|
209236
|
+
}
|
|
209237
|
+
function getDetailOnCurve(pair, curve) {
|
|
209238
|
+
if (pair.detailA.curve === curve)
|
|
209239
|
+
return pair.detailA;
|
|
209240
|
+
if (pair.detailB.curve === curve)
|
|
209241
|
+
return pair.detailB;
|
|
209242
|
+
return undefined;
|
|
209243
|
+
}
|
|
209227
209244
|
class MapCurvePrimitiveToCurveLocationDetailPairArray {
|
|
209228
209245
|
primitiveToPair = new Map();
|
|
209229
209246
|
// index assigned to this primitive (for debugging)
|
|
@@ -209286,8 +209303,11 @@ class MapCurvePrimitiveToCurveLocationDetailPairArray {
|
|
|
209286
209303
|
*/
|
|
209287
209304
|
class PlanarSubdivision {
|
|
209288
209305
|
/**
|
|
209289
|
-
* Create a graph from
|
|
209290
|
-
* Z-coordinates are ignored.
|
|
209306
|
+
* Create a graph from curves and precomputed intersections.
|
|
209307
|
+
* * Z-coordinates are ignored.
|
|
209308
|
+
* @param primitives input curves
|
|
209309
|
+
* @param allPairs array of curve-curve xy-intersections
|
|
209310
|
+
* @param mergeTolerance optional distance tolerance for clustering vertices. Default value is [[Geometry.smallMetricDistance]].
|
|
209291
209311
|
*/
|
|
209292
209312
|
static assembleHalfEdgeGraph(primitives, allPairs, mergeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
209293
209313
|
// map from key CurvePrimitive to CurveLocationDetailPair
|
|
@@ -209333,31 +209353,45 @@ class PlanarSubdivision {
|
|
|
209333
209353
|
return graph;
|
|
209334
209354
|
}
|
|
209335
209355
|
/**
|
|
209336
|
-
*
|
|
209337
|
-
* *
|
|
209356
|
+
* Filter for trivial curve fragment: fast computation if line segment; otherwise clip, flatten, and measure.
|
|
209357
|
+
* * Different metrics are employed for expedience.
|
|
209358
|
+
*/
|
|
209359
|
+
static isCurveTrivialXY(p, point0, fraction0, point1, fraction1, mergeTolerance) {
|
|
209360
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSmallRelative(fraction0 - fraction1))
|
|
209361
|
+
return true;
|
|
209362
|
+
if (!(p instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_3__.LineSegment3d)) {
|
|
209363
|
+
const p0 = p.clonePartialCurve(fraction0, fraction1);
|
|
209364
|
+
if (p0?.tryTransformInPlace(_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_8__.Transform.createRowValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0))) // flatten
|
|
209365
|
+
return p0.curveLength() <= mergeTolerance; // Euclidean
|
|
209366
|
+
}
|
|
209367
|
+
return point0.isAlmostEqualXY(point1, mergeTolerance); // Manhattan
|
|
209368
|
+
}
|
|
209369
|
+
/**
|
|
209370
|
+
* Create a pair of mated half edges referencing a non-trivial interval of a primitive.
|
|
209338
209371
|
* @param graph containing graph
|
|
209339
209372
|
* @param p the curve
|
|
209340
209373
|
* @param point0 start point
|
|
209341
209374
|
* @param fraction0 starting fraction
|
|
209342
209375
|
* @param point1 end point
|
|
209343
209376
|
* @param fraction1 end fraction
|
|
209344
|
-
* @
|
|
209377
|
+
* @param mergeTolerance optional maximum xy-length of a trivial edge
|
|
209378
|
+
* @returns end point and fraction
|
|
209345
209379
|
*/
|
|
209346
209380
|
static addHalfEdge(graph, p, point0, fraction0, point1, fraction1, mergeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
209347
|
-
if (
|
|
209348
|
-
|
|
209349
|
-
|
|
209350
|
-
|
|
209351
|
-
|
|
209352
|
-
|
|
209353
|
-
|
|
209354
|
-
|
|
209355
|
-
|
|
209356
|
-
|
|
209357
|
-
|
|
209358
|
-
|
|
209359
|
-
|
|
209360
|
-
return { point: point1, fraction: fraction1 };
|
|
209381
|
+
if (!this.isCurveTrivialXY(p, point0, fraction0, point1, fraction1, mergeTolerance)) {
|
|
209382
|
+
const halfEdge = graph.createEdgeXYAndZ(point0, 0, point1, 0);
|
|
209383
|
+
if (p.parent && p.parent instanceof _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_9__.RegionGroupMember && p.parent.parentGroup.groupOpType === _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_9__.RegionGroupOpType.NonBounding)
|
|
209384
|
+
halfEdge.setMaskAroundEdge(_topology_Graph__WEBPACK_IMPORTED_MODULE_6__.HalfEdgeMask.BRIDGE_EDGE);
|
|
209385
|
+
const detail01 = _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_5__.CurveLocationDetail.createCurveEvaluatedFractionFraction(p, fraction0, fraction1);
|
|
209386
|
+
const mate = halfEdge.edgeMate;
|
|
209387
|
+
halfEdge.edgeTag = detail01;
|
|
209388
|
+
halfEdge.sortData = 1.0;
|
|
209389
|
+
mate.edgeTag = detail01;
|
|
209390
|
+
mate.sortData = -1.0;
|
|
209391
|
+
halfEdge.sortAngle = computeSortAngle(p, fraction0, false);
|
|
209392
|
+
mate.sortAngle = computeSortAngle(p, fraction1, true);
|
|
209393
|
+
}
|
|
209394
|
+
return { point: point1, fraction: fraction1 }; // where the next curve fragment starts
|
|
209361
209395
|
}
|
|
209362
209396
|
/**
|
|
209363
209397
|
* Based on computed (and toleranced) area, push the loop (pointer) onto the appropriate array of positive, negative,
|
|
@@ -209367,7 +209401,7 @@ class PlanarSubdivision {
|
|
|
209367
209401
|
* @returns the area (forced to zero if within tolerance)
|
|
209368
209402
|
*/
|
|
209369
209403
|
static collectSignedLoop(loop, outLoops, zeroAreaTolerance = 1.0e-10, isSliverFace) {
|
|
209370
|
-
let area = isSliverFace ? 0.0 :
|
|
209404
|
+
let area = isSliverFace ? 0.0 : _RegionOps__WEBPACK_IMPORTED_MODULE_10__.RegionOps.computeXYArea(loop);
|
|
209371
209405
|
if (area === undefined)
|
|
209372
209406
|
area = 0;
|
|
209373
209407
|
if (Math.abs(area) < zeroAreaTolerance)
|
|
@@ -209393,32 +209427,31 @@ class PlanarSubdivision {
|
|
|
209393
209427
|
return undefined;
|
|
209394
209428
|
}
|
|
209395
209429
|
/** Create the geometry for a topological edge. */
|
|
209396
|
-
static createCurveInEdge(edge) {
|
|
209430
|
+
static createCurveInEdge(edge, z) {
|
|
209431
|
+
let result;
|
|
209397
209432
|
const info = this.extractGeometryFromEdge(edge);
|
|
209398
|
-
if (info) {
|
|
209399
|
-
|
|
209400
|
-
|
|
209401
|
-
|
|
209433
|
+
if (info && info.detail.curve && info.detail.fraction1) {
|
|
209434
|
+
const f0 = info.reversed ? info.detail.fraction1 : info.detail.fraction;
|
|
209435
|
+
const f1 = info.reversed ? info.detail.fraction : info.detail.fraction1;
|
|
209436
|
+
result = info.detail.curve.clonePartialCurve(f0, f1);
|
|
209437
|
+
if (result && z !== undefined)
|
|
209438
|
+
result.tryTransformInPlace(_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_8__.Transform.createRowValues(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, z));
|
|
209402
209439
|
}
|
|
209403
|
-
return
|
|
209440
|
+
return result;
|
|
209404
209441
|
}
|
|
209405
209442
|
/**
|
|
209406
209443
|
* Create a [[Loop]] for the given face or super face.
|
|
209407
209444
|
* @param face a node in the face loop, or an array of HalfEdges that comprise a loop (e.g., a super face).
|
|
209408
|
-
* @param
|
|
209409
|
-
* @param compress whether to consolidate adjacent curves in the output Loop (default `false`).
|
|
209410
|
-
* If `announce` is provided, no compression is performed, as edges and curves would no longer be in 1-1 correspondence.
|
|
209411
|
-
* @param closureTol absolute xy-distance for confirming the returned Loop is closed (default [[Geometry.smallMetricDistance]]).
|
|
209445
|
+
* @param options bundle of options.
|
|
209412
209446
|
* @returns the Loop, or `undefined` if it is not closed within xy-tolerance.
|
|
209413
209447
|
*/
|
|
209414
|
-
static createLoopInFace(face,
|
|
209415
|
-
if
|
|
209416
|
-
|
|
209417
|
-
const
|
|
209418
|
-
|
|
209419
|
-
const curve = this.createCurveInEdge(he);
|
|
209448
|
+
static createLoopInFace(face, options) {
|
|
209449
|
+
const consolidate = options?.announceEdge ? false : options?.compress ?? false; // can't compress if announcing
|
|
209450
|
+
const loop = _Loop__WEBPACK_IMPORTED_MODULE_11__.Loop.create();
|
|
209451
|
+
const addEdgeCurve = (edge) => {
|
|
209452
|
+
const curve = this.createCurveInEdge(edge, options?.z);
|
|
209420
209453
|
if (curve) {
|
|
209421
|
-
|
|
209454
|
+
options?.announceEdge?.(edge, curve, loop);
|
|
209422
209455
|
loop.tryAddChild(curve);
|
|
209423
209456
|
}
|
|
209424
209457
|
};
|
|
@@ -209426,12 +209459,12 @@ class PlanarSubdivision {
|
|
|
209426
209459
|
face.forEach(addEdgeCurve);
|
|
209427
209460
|
else
|
|
209428
209461
|
face.announceEdgesInFace(addEdgeCurve);
|
|
209429
|
-
if (
|
|
209430
|
-
const
|
|
209431
|
-
|
|
209432
|
-
|
|
209462
|
+
if (consolidate) {
|
|
209463
|
+
const consolidateOptions = new _RegionOps__WEBPACK_IMPORTED_MODULE_10__.ConsolidateAdjacentCurvePrimitivesOptions();
|
|
209464
|
+
consolidateOptions.consolidateLoopSeam = true;
|
|
209465
|
+
_RegionOps__WEBPACK_IMPORTED_MODULE_10__.RegionOps.consolidateAdjacentPrimitives(loop, consolidateOptions);
|
|
209433
209466
|
}
|
|
209434
|
-
if (loop.isPhysicallyClosedCurve(closureTol, true))
|
|
209467
|
+
if (loop.isPhysicallyClosedCurve(options?.closureTol, true))
|
|
209435
209468
|
return loop;
|
|
209436
209469
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(() => false, "face is not physically closed");
|
|
209437
209470
|
return undefined;
|
|
@@ -209440,17 +209473,19 @@ class PlanarSubdivision {
|
|
|
209440
209473
|
* Create a [[Loop]] or [[ParityRegion]] for the given face.
|
|
209441
209474
|
* * A ParityRegion is created for a split-washer type face by removing bridge edges.
|
|
209442
209475
|
* @param face a node in the face loop.
|
|
209443
|
-
* @param
|
|
209444
|
-
* @
|
|
209445
|
-
* @param closureTol absolute xy-distance for confirming the returned Loop is closed (default [[Geometry.smallMetricDistance]]).
|
|
209446
|
-
* @returns the Loop or ParityRegion, or `undefined` if one could not be computed
|
|
209476
|
+
* @param options bundle of options.
|
|
209477
|
+
* @returns the Loop or ParityRegion, or `undefined` if one could not be computed.
|
|
209447
209478
|
*/
|
|
209448
|
-
static createLoopOrParityRegionInFace(face,
|
|
209479
|
+
static createLoopOrParityRegionInFace(face, options) {
|
|
209449
209480
|
let region;
|
|
209450
|
-
|
|
209481
|
+
const visitMask = options?.visitMask ?? _topology_Graph__WEBPACK_IMPORTED_MODULE_6__.HalfEdgeMask.VISITED;
|
|
209482
|
+
const bridgeMask = options?.bridgeMask ?? _topology_Graph__WEBPACK_IMPORTED_MODULE_6__.HalfEdgeMask.BRIDGE_EDGE;
|
|
209483
|
+
let startBridgeEdge;
|
|
209484
|
+
// is it a split-washer face?
|
|
209485
|
+
if (face.isSplitWasherFace(bridgeMask) && (startBridgeEdge = face.findMaskAroundFace(bridgeMask, true))) {
|
|
209451
209486
|
const loops = [];
|
|
209452
209487
|
const loopEdges = [];
|
|
209453
|
-
const bridgeStack = [
|
|
209488
|
+
const bridgeStack = [startBridgeEdge];
|
|
209454
209489
|
const announceEdge = (he) => { he.setMask(visitMask); loopEdges.push(he); };
|
|
209455
209490
|
const announceBridge = (he) => { if (!he.isMaskSet(visitMask))
|
|
209456
209491
|
bridgeStack.push(he); };
|
|
@@ -209464,7 +209499,7 @@ class PlanarSubdivision {
|
|
|
209464
209499
|
continue;
|
|
209465
209500
|
loopEdges.length = 0;
|
|
209466
209501
|
if (loopSeed.announceEdgesInSuperFace(bridgeMask, announceEdge, announceBridge)) {
|
|
209467
|
-
const loop = this.createLoopInFace(loopEdges,
|
|
209502
|
+
const loop = this.createLoopInFace(loopEdges, options);
|
|
209468
209503
|
if (loop) {
|
|
209469
209504
|
loops.push(loop);
|
|
209470
209505
|
continue;
|
|
@@ -209472,13 +209507,13 @@ class PlanarSubdivision {
|
|
|
209472
209507
|
}
|
|
209473
209508
|
}
|
|
209474
209509
|
}
|
|
209475
|
-
region =
|
|
209476
|
-
region =
|
|
209510
|
+
region = _RegionOps__WEBPACK_IMPORTED_MODULE_10__.RegionOps.sortOuterAndHoleLoopsXY(loops);
|
|
209511
|
+
region = _RegionOps__WEBPACK_IMPORTED_MODULE_10__.RegionOps.simplifyRegion(region);
|
|
209477
209512
|
}
|
|
209478
209513
|
else {
|
|
209479
|
-
region = this.createLoopInFace(face,
|
|
209514
|
+
region = this.createLoopInFace(face, options);
|
|
209480
209515
|
}
|
|
209481
|
-
return (region && (region instanceof
|
|
209516
|
+
return (region && (region instanceof _Loop__WEBPACK_IMPORTED_MODULE_11__.Loop || region instanceof _ParityRegion__WEBPACK_IMPORTED_MODULE_12__.ParityRegion)) ? region : undefined;
|
|
209482
209517
|
}
|
|
209483
209518
|
/** Return true if there are only two edges in the face loop, and their start curvatures are the same. */
|
|
209484
209519
|
static isNullFace(he) {
|
|
@@ -209505,7 +209540,7 @@ class PlanarSubdivision {
|
|
|
209505
209540
|
return e1;
|
|
209506
209541
|
}
|
|
209507
209542
|
static collectSignedLoopSetsInHalfEdgeGraph(graph, zeroAreaTolerance = 1.0e-10) {
|
|
209508
|
-
const q =
|
|
209543
|
+
const q = _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_13__.HalfEdgeGraphSearch.collectConnectedComponentsWithExteriorParityMasks(graph, undefined);
|
|
209509
209544
|
const result = [];
|
|
209510
209545
|
const edgeMap = new Map();
|
|
209511
209546
|
for (const faceSeeds of q) {
|
|
@@ -209513,24 +209548,23 @@ class PlanarSubdivision {
|
|
|
209513
209548
|
const edges = [];
|
|
209514
209549
|
for (const faceSeed of faceSeeds) {
|
|
209515
209550
|
const isNullFace = this.isNullFace(faceSeed);
|
|
209516
|
-
const
|
|
209517
|
-
|
|
209518
|
-
|
|
209519
|
-
|
|
209520
|
-
|
|
209521
|
-
|
|
209522
|
-
|
|
209523
|
-
|
|
209524
|
-
|
|
209525
|
-
|
|
209526
|
-
|
|
209527
|
-
|
|
209528
|
-
|
|
209529
|
-
edgeMap.delete(mate);
|
|
209530
|
-
}
|
|
209551
|
+
const announceEdge = isNullFace ? undefined : (he, curveC, loopC) => {
|
|
209552
|
+
const mate = this.getNonNullEdgeMate(graph, he);
|
|
209553
|
+
if (mate !== undefined) {
|
|
209554
|
+
const e = edgeMap.get(mate);
|
|
209555
|
+
if (e === undefined) {
|
|
209556
|
+
// Record this as loopA,edgeA of a shared edge to be completed later from the other side of the edge
|
|
209557
|
+
const e1 = new _Loop__WEBPACK_IMPORTED_MODULE_11__.LoopCurveLoopCurve(loopC, curveC, undefined, undefined);
|
|
209558
|
+
edgeMap.set(he, e1);
|
|
209559
|
+
}
|
|
209560
|
+
else if (e instanceof _Loop__WEBPACK_IMPORTED_MODULE_11__.LoopCurveLoopCurve) {
|
|
209561
|
+
e.setB(loopC, curveC);
|
|
209562
|
+
edges.push(e);
|
|
209563
|
+
edgeMap.delete(mate);
|
|
209531
209564
|
}
|
|
209532
209565
|
}
|
|
209533
|
-
}
|
|
209566
|
+
};
|
|
209567
|
+
const loop = this.createLoopInFace(faceSeed, { announceEdge });
|
|
209534
209568
|
if (loop)
|
|
209535
209569
|
this.collectSignedLoop(loop, componentAreas, zeroAreaTolerance, isNullFace);
|
|
209536
209570
|
}
|
|
@@ -209541,25 +209575,6 @@ class PlanarSubdivision {
|
|
|
209541
209575
|
return result;
|
|
209542
209576
|
}
|
|
209543
209577
|
}
|
|
209544
|
-
function sortAngle(curve, fraction, reverse) {
|
|
209545
|
-
const ray = curve.fractionToPointAndDerivative(fraction);
|
|
209546
|
-
const s = reverse ? -1.0 : 1.0;
|
|
209547
|
-
return Math.atan2(s * ray.direction.y, s * ray.direction.x);
|
|
209548
|
-
}
|
|
209549
|
-
function getFractionOnCurve(pair, curve) {
|
|
209550
|
-
if (pair.detailA.curve === curve)
|
|
209551
|
-
return pair.detailA.fraction;
|
|
209552
|
-
if (pair.detailB.curve === curve)
|
|
209553
|
-
return pair.detailB.fraction;
|
|
209554
|
-
return undefined;
|
|
209555
|
-
}
|
|
209556
|
-
function getDetailOnCurve(pair, curve) {
|
|
209557
|
-
if (pair.detailA.curve === curve)
|
|
209558
|
-
return pair.detailA;
|
|
209559
|
-
if (pair.detailB.curve === curve)
|
|
209560
|
-
return pair.detailB;
|
|
209561
|
-
return undefined;
|
|
209562
|
-
}
|
|
209563
209578
|
|
|
209564
209579
|
|
|
209565
209580
|
/***/ }),
|
|
@@ -210385,7 +210400,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
210385
210400
|
/* harmony export */ RegionOps: () => (/* binding */ RegionOps)
|
|
210386
210401
|
/* harmony export */ });
|
|
210387
210402
|
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
210388
|
-
/* harmony import */ var
|
|
210403
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
210389
210404
|
/* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
|
|
210390
210405
|
/* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
|
|
210391
210406
|
/* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
|
|
@@ -210397,7 +210412,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
210397
210412
|
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
210398
210413
|
/* harmony import */ var _geometry3d_SortablePolygon__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../geometry3d/SortablePolygon */ "../../core/geometry/lib/esm/geometry3d/SortablePolygon.js");
|
|
210399
210414
|
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
210400
|
-
/* harmony import */ var
|
|
210415
|
+
/* harmony import */ var _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry4d/MomentData */ "../../core/geometry/lib/esm/geometry4d/MomentData.js");
|
|
210401
210416
|
/* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
|
|
210402
210417
|
/* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
|
|
210403
210418
|
/* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
|
|
@@ -210422,7 +210437,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
210422
210437
|
/* harmony import */ var _Query_CurveSplitContext__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./Query/CurveSplitContext */ "../../core/geometry/lib/esm/curve/Query/CurveSplitContext.js");
|
|
210423
210438
|
/* harmony import */ var _Query_InOutTests__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./Query/InOutTests */ "../../core/geometry/lib/esm/curve/Query/InOutTests.js");
|
|
210424
210439
|
/* harmony import */ var _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./Query/PlanarSubdivision */ "../../core/geometry/lib/esm/curve/Query/PlanarSubdivision.js");
|
|
210425
|
-
/* harmony import */ var
|
|
210440
|
+
/* harmony import */ var _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./RegionMomentsXY */ "../../core/geometry/lib/esm/curve/RegionMomentsXY.js");
|
|
210426
210441
|
/* harmony import */ var _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./RegionOpsClassificationSweeps */ "../../core/geometry/lib/esm/curve/RegionOpsClassificationSweeps.js");
|
|
210427
210442
|
/* harmony import */ var _UnionRegion__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
|
|
210428
210443
|
/*---------------------------------------------------------------------------------------------
|
|
@@ -210474,7 +210489,29 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
210474
210489
|
|
|
210475
210490
|
|
|
210476
210491
|
/**
|
|
210477
|
-
*
|
|
210492
|
+
* * Options to control method [[RegionOps.consolidateAdjacentPrimitives]].
|
|
210493
|
+
* @public
|
|
210494
|
+
*/
|
|
210495
|
+
class ConsolidateAdjacentCurvePrimitivesOptions {
|
|
210496
|
+
/** True to consolidate adjacent linear geometry into a single LineString3d. */
|
|
210497
|
+
consolidateLinearGeometry = true;
|
|
210498
|
+
/** True to consolidate contiguous compatible arcs into a single Arc3d. */
|
|
210499
|
+
consolidateCompatibleArcs = true;
|
|
210500
|
+
/**
|
|
210501
|
+
* True to attempt consolidation of the first and last primitives of a [[Loop]] or physically closed linestring data,
|
|
210502
|
+
* allowing location of the seam to change.
|
|
210503
|
+
*/
|
|
210504
|
+
consolidateLoopSeam = false;
|
|
210505
|
+
/** Disable LineSegment3d and LineString3d point compression. */
|
|
210506
|
+
disableLinearCompression = false;
|
|
210507
|
+
/** Tolerance for detecting identical points. */
|
|
210508
|
+
duplicatePointTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance;
|
|
210509
|
+
/** Tolerance for removing interior colinear points (if `!disableLinearCompression`). */
|
|
210510
|
+
colinearPointTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance;
|
|
210511
|
+
}
|
|
210512
|
+
/**
|
|
210513
|
+
* Enumeration of the binary operation types for Boolean operations.
|
|
210514
|
+
* @see [[RegionOps.regionBooleanXY]], [[RegionOps.polygonBooleanXYToLoops]], [[RegionOps.polygonBooleanXYToPolyface]].
|
|
210478
210515
|
* @public
|
|
210479
210516
|
*/
|
|
210480
210517
|
var RegionBinaryOpType;
|
|
@@ -210508,9 +210545,9 @@ class RegionOps {
|
|
|
210508
210545
|
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
210509
210546
|
*/
|
|
210510
210547
|
static computeXYAreaMoments(region) {
|
|
210511
|
-
const handler = new
|
|
210548
|
+
const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_2__.RegionMomentsXY();
|
|
210512
210549
|
const result = region.dispatchToGeometryHandler(handler);
|
|
210513
|
-
if (result instanceof
|
|
210550
|
+
if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__.MomentData) {
|
|
210514
210551
|
result.shiftOriginAndSumsToCentroidOfSums();
|
|
210515
210552
|
return result;
|
|
210516
210553
|
}
|
|
@@ -210521,9 +210558,13 @@ class RegionOps {
|
|
|
210521
210558
|
* @param range range of planar region to tolerance.
|
|
210522
210559
|
* @param distanceTolerance optional absolute distance tolerance.
|
|
210523
210560
|
*/
|
|
210524
|
-
static computeXYAreaTolerance(range, distanceTolerance =
|
|
210525
|
-
//
|
|
210526
|
-
|
|
210561
|
+
static computeXYAreaTolerance(range, distanceTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
210562
|
+
// ensure the result is nonzero: we never want to report a zero-area loop as a signed-area loop
|
|
210563
|
+
if (distanceTolerance === 0)
|
|
210564
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallFloatingPoint * 10; // observed area 2e-15 computed for a zero-area loop
|
|
210565
|
+
// If A = bh and e is distance tolerance, let A' be the region with b and h extended by half the tolerance.
|
|
210566
|
+
// Then A' := (b+e/2)(h+e/2) = A + e/2(b+h+e/2), which motivates our area tol = A'-A = e/2(b+h+e/2).
|
|
210567
|
+
const halfDistTol = 0.5 * Math.abs(distanceTolerance);
|
|
210527
210568
|
return halfDistTol * (range.xLength() + range.yLength() + halfDistTol);
|
|
210528
210569
|
}
|
|
210529
210570
|
/**
|
|
@@ -210534,9 +210575,9 @@ class RegionOps {
|
|
|
210534
210575
|
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
210535
210576
|
*/
|
|
210536
210577
|
static computeXYArea(region) {
|
|
210537
|
-
const handler = new
|
|
210578
|
+
const handler = new _RegionMomentsXY__WEBPACK_IMPORTED_MODULE_2__.RegionMomentsXY();
|
|
210538
210579
|
const result = region.dispatchToGeometryHandler(handler);
|
|
210539
|
-
if (result instanceof
|
|
210580
|
+
if (result instanceof _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_3__.MomentData) {
|
|
210540
210581
|
return result.quantitySum;
|
|
210541
210582
|
}
|
|
210542
210583
|
return undefined;
|
|
@@ -210738,7 +210779,7 @@ class RegionOps {
|
|
|
210738
210779
|
* * Regions without children are removed.
|
|
210739
210780
|
* * No Boolean operations are performed.
|
|
210740
210781
|
* @param region region to simplify in place
|
|
210741
|
-
* @returns reference to the updated input region
|
|
210782
|
+
* @returns reference to the updated input region, or `undefined` if no children.
|
|
210742
210783
|
* @see [[simplifyRegionType]]
|
|
210743
210784
|
*/
|
|
210744
210785
|
static simplifyRegion(region) {
|
|
@@ -210763,6 +210804,14 @@ class RegionOps {
|
|
|
210763
210804
|
return region.children.splice(0, 1)[0];
|
|
210764
210805
|
return region;
|
|
210765
210806
|
}
|
|
210807
|
+
/**
|
|
210808
|
+
* Helper method to sample a z-coordinate from the input region(s).
|
|
210809
|
+
* * The assumption is that the input is horizontal.
|
|
210810
|
+
*/
|
|
210811
|
+
static getZCoordinate(xyRegion) {
|
|
210812
|
+
const localToWorld = _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_5__.FrameBuilder.createRightHandedFrame(undefined, xyRegion);
|
|
210813
|
+
return localToWorld ? localToWorld.origin.z : 0;
|
|
210814
|
+
}
|
|
210766
210815
|
/**
|
|
210767
210816
|
* Return areas defined by a boolean operation.
|
|
210768
210817
|
* @note For best results, input regions should have correctly oriented loops. See [[sortOuterAndHoleLoopsXY]].
|
|
@@ -210773,18 +210822,30 @@ class RegionOps {
|
|
|
210773
210822
|
* @param loopsA first set of loops (treated as a union)
|
|
210774
210823
|
* @param loopsB second set of loops (treated as a union)
|
|
210775
210824
|
* @param operation indicates Union, Intersection, Parity, AMinusB, or BMinusA
|
|
210776
|
-
* @param
|
|
210825
|
+
* @param mergeToleranceOrOptions absolute distance tolerance for merging loops, or multiple options settings. Default value is [[Geometry.smallMetricDistance]].
|
|
210777
210826
|
* @returns a region resulting from merging input loops and the boolean operation.
|
|
210778
210827
|
*/
|
|
210779
|
-
static regionBooleanXY(loopsA, loopsB, operation,
|
|
210780
|
-
|
|
210828
|
+
static regionBooleanXY(loopsA, loopsB, operation, mergeToleranceOrOptions = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
210829
|
+
let mergeTolerance;
|
|
210830
|
+
let simplifyUnion;
|
|
210831
|
+
if (typeof mergeToleranceOrOptions === "number") {
|
|
210832
|
+
mergeTolerance = mergeToleranceOrOptions;
|
|
210833
|
+
simplifyUnion = false;
|
|
210834
|
+
}
|
|
210835
|
+
else {
|
|
210836
|
+
mergeTolerance = mergeToleranceOrOptions.mergeTolerance ?? _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance;
|
|
210837
|
+
simplifyUnion = mergeToleranceOrOptions.simplifyUnion ?? false;
|
|
210838
|
+
}
|
|
210839
|
+
let result = _UnionRegion__WEBPACK_IMPORTED_MODULE_14__.UnionRegion.create();
|
|
210781
210840
|
const context = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_13__.RegionBooleanContext.create(_RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_13__.RegionGroupOpType.Union, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_13__.RegionGroupOpType.Union);
|
|
210782
210841
|
context.addMembers(loopsA, loopsB);
|
|
210783
210842
|
context.annotateAndMergeCurvesInGraph(mergeTolerance);
|
|
210843
|
+
const bridgeMask = _topology_Graph__WEBPACK_IMPORTED_MODULE_15__.HalfEdgeMask.BRIDGE_EDGE;
|
|
210784
210844
|
const visitMask = context.graph.grabMask(false);
|
|
210785
210845
|
const range = context.groupA.range().union(context.groupB.range());
|
|
210786
210846
|
const areaTol = this.computeXYAreaTolerance(range, mergeTolerance);
|
|
210787
|
-
const
|
|
210847
|
+
const z = RegionOps.getZCoordinate(operation === RegionBinaryOpType.BMinusA ? loopsB : loopsA);
|
|
210848
|
+
const options = { compress: true, closureTol: mergeTolerance, bridgeMask, visitMask, z };
|
|
210788
210849
|
context.runClassificationSweep(operation, (_graph, face, faceType, area) => {
|
|
210789
210850
|
// ignore danglers and null faces, but not 2-edge "banana" faces with nonzero area
|
|
210790
210851
|
if (face.countEdgesAroundFace() < 2)
|
|
@@ -210792,12 +210853,20 @@ class RegionOps {
|
|
|
210792
210853
|
if (Math.abs(area) < areaTol)
|
|
210793
210854
|
return;
|
|
210794
210855
|
if (faceType === 1) {
|
|
210795
|
-
const loopOrParityRegion = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_16__.PlanarSubdivision.createLoopOrParityRegionInFace(face,
|
|
210856
|
+
const loopOrParityRegion = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_16__.PlanarSubdivision.createLoopOrParityRegionInFace(face, options);
|
|
210796
210857
|
if (loopOrParityRegion)
|
|
210797
210858
|
result.tryAddChild(loopOrParityRegion);
|
|
210798
210859
|
}
|
|
210799
210860
|
});
|
|
210800
210861
|
context.graph.dropMask(visitMask);
|
|
210862
|
+
if (simplifyUnion && operation === RegionBinaryOpType.Union) {
|
|
210863
|
+
const signedLoops = RegionOps.constructAllXYRegionLoops(result);
|
|
210864
|
+
if (signedLoops) {
|
|
210865
|
+
const outerLoops = signedLoops.map((component) => component.negativeAreaLoops).flat();
|
|
210866
|
+
if (outerLoops.length > 0)
|
|
210867
|
+
result = _UnionRegion__WEBPACK_IMPORTED_MODULE_14__.UnionRegion.create(...outerLoops);
|
|
210868
|
+
}
|
|
210869
|
+
}
|
|
210801
210870
|
return this.simplifyRegion(result);
|
|
210802
210871
|
}
|
|
210803
210872
|
/**
|
|
@@ -210899,11 +210968,11 @@ class RegionOps {
|
|
|
210899
210968
|
let maxGap = 0.0;
|
|
210900
210969
|
let isPath = false;
|
|
210901
210970
|
if (wrap)
|
|
210902
|
-
maxGap =
|
|
210971
|
+
maxGap = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.maxXY(maxGap, curves[0].startPoint().distance(curves[n - 1].endPoint()));
|
|
210903
210972
|
for (let i = 0; i + 1 < n; i++)
|
|
210904
|
-
maxGap =
|
|
210973
|
+
maxGap = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.maxXY(maxGap, curves[i].endPoint().distance(curves[i + 1].startPoint()));
|
|
210905
210974
|
let collection;
|
|
210906
|
-
if (
|
|
210975
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSmallMetricDistance(maxGap)) {
|
|
210907
210976
|
collection = wrap ? _Loop__WEBPACK_IMPORTED_MODULE_8__.Loop.create() : _Path__WEBPACK_IMPORTED_MODULE_24__.Path.create();
|
|
210908
210977
|
isPath = true;
|
|
210909
210978
|
}
|
|
@@ -210973,7 +211042,7 @@ class RegionOps {
|
|
|
210973
211042
|
* @param gapTolerance distance to be treated as "effectively zero" when assembling fragments head-to-tail
|
|
210974
211043
|
* @returns chains, possibly wrapped in a [[BagOfCurves]].
|
|
210975
211044
|
*/
|
|
210976
|
-
static collectChains(fragments, gapTolerance =
|
|
211045
|
+
static collectChains(fragments, gapTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
210977
211046
|
return _CurveOps__WEBPACK_IMPORTED_MODULE_22__.CurveOps.collectChains(fragments, gapTolerance);
|
|
210978
211047
|
}
|
|
210979
211048
|
/**
|
|
@@ -211026,7 +211095,7 @@ class RegionOps {
|
|
|
211026
211095
|
else if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_10__.IndexedXYZCollection) {
|
|
211027
211096
|
let dataToUse;
|
|
211028
211097
|
if (requireClosurePoint && data.length === 5) {
|
|
211029
|
-
if (!
|
|
211098
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSmallMetricDistance(data.distanceIndexIndex(0, 4)))
|
|
211030
211099
|
return undefined;
|
|
211031
211100
|
dataToUse = data;
|
|
211032
211101
|
}
|
|
@@ -211038,7 +211107,7 @@ class RegionOps {
|
|
|
211038
211107
|
}
|
|
211039
211108
|
else {
|
|
211040
211109
|
dataToUse = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_18__.GrowableXYZArray.create(data);
|
|
211041
|
-
_geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_29__.PolylineCompressionContext.compressInPlaceByShortEdgeLength(dataToUse,
|
|
211110
|
+
_geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_29__.PolylineCompressionContext.compressInPlaceByShortEdgeLength(dataToUse, _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance);
|
|
211042
211111
|
if (dataToUse.length < (requireClosurePoint ? 5 : 4))
|
|
211043
211112
|
return undefined;
|
|
211044
211113
|
}
|
|
@@ -211118,7 +211187,7 @@ class RegionOps {
|
|
|
211118
211187
|
* * Physically closed input curves are each returned wrapped in a Loop to facilitate xy-algorithms,
|
|
211119
211188
|
* but outside this limited context, these Loops only makes sense if they are planar.
|
|
211120
211189
|
*/
|
|
211121
|
-
static collectRegionsAndClosedPrimitives(curves, tolerance =
|
|
211190
|
+
static collectRegionsAndClosedPrimitives(curves, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
211122
211191
|
const regions = [];
|
|
211123
211192
|
if (!Array.isArray(curves))
|
|
211124
211193
|
curves = [curves];
|
|
@@ -211159,7 +211228,7 @@ class RegionOps {
|
|
|
211159
211228
|
* * `edges` contains a [[LoopCurveLoopCurve]] object for each component edge, collecting both loops adjacent
|
|
211160
211229
|
* to the edge and a constituent curve in each.
|
|
211161
211230
|
*/
|
|
211162
|
-
static constructAllXYRegionLoops(curvesAndRegions, tolerance =
|
|
211231
|
+
static constructAllXYRegionLoops(curvesAndRegions, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance, addBridges = true) {
|
|
211163
211232
|
let primitives = RegionOps.collectCurvePrimitives(curvesAndRegions, undefined, true, true);
|
|
211164
211233
|
primitives = _internalContexts_TransferWithSplitArcs__WEBPACK_IMPORTED_MODULE_34__.TransferWithSplitArcs.clone(_CurveCollection__WEBPACK_IMPORTED_MODULE_25__.BagOfCurves.create(...primitives)).children;
|
|
211165
211234
|
const range = this.curveArrayRange(primitives);
|
|
@@ -211167,13 +211236,15 @@ class RegionOps {
|
|
|
211167
211236
|
if (addBridges) { // generate a temp graph to extract its bridge edges
|
|
211168
211237
|
const context = _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_13__.RegionBooleanContext.create(_RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_13__.RegionGroupOpType.Union, _RegionOpsClassificationSweeps__WEBPACK_IMPORTED_MODULE_13__.RegionGroupOpType.Union);
|
|
211169
211238
|
const regions = this.collectRegionsAndClosedPrimitives(curvesAndRegions, tolerance);
|
|
211170
|
-
|
|
211171
|
-
|
|
211172
|
-
|
|
211173
|
-
|
|
211174
|
-
|
|
211175
|
-
|
|
211176
|
-
|
|
211239
|
+
if (regions.length > 0) {
|
|
211240
|
+
context.addMembers(regions, undefined);
|
|
211241
|
+
context.annotateAndMergeCurvesInGraph(tolerance);
|
|
211242
|
+
context.graph.announceEdges((_graph, edge) => {
|
|
211243
|
+
if (edge.isMaskSet(_topology_Graph__WEBPACK_IMPORTED_MODULE_15__.HalfEdgeMask.BRIDGE_EDGE))
|
|
211244
|
+
primitives.push(_LineSegment3d__WEBPACK_IMPORTED_MODULE_35__.LineSegment3d.create(edge.getPoint3d(), edge.faceSuccessor.getPoint3d()));
|
|
211245
|
+
return true;
|
|
211246
|
+
});
|
|
211247
|
+
}
|
|
211177
211248
|
}
|
|
211178
211249
|
const intersections = _CurveCurve__WEBPACK_IMPORTED_MODULE_36__.CurveCurve.allIntersectionsAmongPrimitivesXY(primitives, tolerance);
|
|
211179
211250
|
const graph = _Query_PlanarSubdivision__WEBPACK_IMPORTED_MODULE_16__.PlanarSubdivision.assembleHalfEdgeGraph(primitives, intersections, tolerance);
|
|
@@ -211390,27 +211461,6 @@ function pushToInOnOutArrays(curve, select, arrayNegative, array0, arrayPositive
|
|
|
211390
211461
|
else
|
|
211391
211462
|
array0.push(curve);
|
|
211392
211463
|
}
|
|
211393
|
-
/**
|
|
211394
|
-
* * Options to control method `RegionOps.consolidateAdjacentPrimitives`.
|
|
211395
|
-
* @public
|
|
211396
|
-
*/
|
|
211397
|
-
class ConsolidateAdjacentCurvePrimitivesOptions {
|
|
211398
|
-
/** True to consolidate adjacent linear geometry into a single LineString3d. */
|
|
211399
|
-
consolidateLinearGeometry = true;
|
|
211400
|
-
/** True to consolidate contiguous compatible arcs into a single Arc3d. */
|
|
211401
|
-
consolidateCompatibleArcs = true;
|
|
211402
|
-
/**
|
|
211403
|
-
* True to attempt consolidation of the first and last primitives of a [[Loop]] or physically closed linestring data,
|
|
211404
|
-
* allowing location of the seam to change.
|
|
211405
|
-
*/
|
|
211406
|
-
consolidateLoopSeam = false;
|
|
211407
|
-
/** Disable LineSegment3d and LineString3d point compression. */
|
|
211408
|
-
disableLinearCompression = false;
|
|
211409
|
-
/** Tolerance for detecting identical points. */
|
|
211410
|
-
duplicatePointTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance;
|
|
211411
|
-
/** Tolerance for removing interior colinear points (if `!disableLinearCompression`). */
|
|
211412
|
-
colinearPointTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance;
|
|
211413
|
-
}
|
|
211414
211464
|
|
|
211415
211465
|
|
|
211416
211466
|
/***/ }),
|
|
@@ -212087,13 +212137,11 @@ class RegionBooleanContext {
|
|
|
212087
212137
|
const nodeHasBeenVisitedMask = this.graph.grabMask();
|
|
212088
212138
|
const componentArray = GraphComponentArray.create(this.graph);
|
|
212089
212139
|
for (const component of componentArray.components) {
|
|
212090
|
-
const exteriorHalfEdge =
|
|
212091
|
-
|
|
212092
|
-
|
|
212093
|
-
|
|
212094
|
-
|
|
212095
|
-
RegionOpsFaceToFaceSearch.faceToFaceSearchFromOuterLoop(this.graph, exteriorHalfEdge, faceHasBeenVisitedMask, nodeHasBeenVisitedMask, this);
|
|
212096
|
-
}
|
|
212140
|
+
const exteriorHalfEdge = component.faces[component.faceAreas.indexOf(Math.min(...component.faceAreas))];
|
|
212141
|
+
const exteriorMask = _topology_Graph__WEBPACK_IMPORTED_MODULE_0__.HalfEdgeMask.EXTERIOR;
|
|
212142
|
+
const allMasksToClear = exteriorMask | faceHasBeenVisitedMask | nodeHasBeenVisitedMask;
|
|
212143
|
+
this.graph.clearMask(allMasksToClear);
|
|
212144
|
+
RegionOpsFaceToFaceSearch.faceToFaceSearchFromOuterLoop(this.graph, exteriorHalfEdge, faceHasBeenVisitedMask, nodeHasBeenVisitedMask, this);
|
|
212097
212145
|
}
|
|
212098
212146
|
this.graph.dropMask(faceHasBeenVisitedMask);
|
|
212099
212147
|
this.graph.dropMask(nodeHasBeenVisitedMask);
|
|
@@ -212266,8 +212314,10 @@ class GraphComponent {
|
|
|
212266
212314
|
f.sumAroundFace(vertexFunction);
|
|
212267
212315
|
}
|
|
212268
212316
|
this.faceAreas.length = 0;
|
|
212317
|
+
if (faceAreaFunction === faceAreaFromCurvedEdgeData && !this.faces.every((he) => he.edgeTag instanceof _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_16__.CurveLocationDetail))
|
|
212318
|
+
faceAreaFunction = undefined; // prerequisite CurveLocationDetails are absent, fall through to default
|
|
212269
212319
|
if (!faceAreaFunction)
|
|
212270
|
-
faceAreaFunction = (node) => _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_4__.HalfEdgeGraphSearch.signedFaceArea(node);
|
|
212320
|
+
faceAreaFunction = (node) => _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_4__.HalfEdgeGraphSearch.signedFaceArea(node); // polygon area
|
|
212271
212321
|
for (const f of this.faces) {
|
|
212272
212322
|
this.faceAreas.push(faceAreaFunction(f));
|
|
212273
212323
|
}
|
|
@@ -214766,7 +214816,9 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
214766
214816
|
// The fraction and extend parameters allow all combinations to be passed in.
|
|
214767
214817
|
dispatchSegmentArc(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, arc, extendB0, extendB1, reversed) {
|
|
214768
214818
|
const tol2 = this._coincidentGeometryContext.tolerance * this._coincidentGeometryContext.tolerance;
|
|
214769
|
-
|
|
214819
|
+
const cosines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_9__.GrowableFloat64Array(2);
|
|
214820
|
+
const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_9__.GrowableFloat64Array(2);
|
|
214821
|
+
const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_9__.GrowableFloat64Array(2);
|
|
214770
214822
|
// Arc: X = C + cU + sV
|
|
214771
214823
|
// Line: contains points A0,A1
|
|
214772
214824
|
// Arc point colinear with line if det (A0, A1, X) = 0
|
|
@@ -214786,27 +214838,30 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
214786
214838
|
const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.center);
|
|
214787
214839
|
const beta = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.vector0);
|
|
214788
214840
|
const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.vector90);
|
|
214789
|
-
|
|
214790
|
-
const
|
|
214791
|
-
|
|
214792
|
-
|
|
214793
|
-
|
|
214794
|
-
|
|
214841
|
+
let numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_10__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
|
|
214842
|
+
const closeApproach = (0 === numRoots);
|
|
214843
|
+
if (closeApproach)
|
|
214844
|
+
numRoots = 1; // we returned the arc's closest approach as the first "root"; if within tolerance and at endpoints, we record it
|
|
214845
|
+
const acceptSolution = (iRoot, checkOnlyEndPointDistance = false) => {
|
|
214846
|
+
const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(iRoot), data.vector90, sines.atUncheckedIndex(iRoot));
|
|
214847
|
+
let fArc = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(iRoot), extendB0);
|
|
214848
|
+
let fLine = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegment3dHXYClosestPointUnbounded(pointA0H, pointA1H, arcPoint);
|
|
214849
|
+
if (fLine === undefined)
|
|
214850
|
+
return undefined;
|
|
214851
|
+
if (!checkOnlyEndPointDistance && this.acceptFraction(extendA0, fLine, extendA1) && this.acceptFraction(extendB0, fArc, extendB1))
|
|
214852
|
+
return { fLine, fArc };
|
|
214853
|
+
// check for an endpoint intersection that is beyond parametric tolerance but within point tolerance
|
|
214854
|
+
fLine = fLine < 0.5 ? 0 : 1;
|
|
214855
|
+
fArc = data.sweep.fractionToSignedPeriodicFraction(fArc) < 0.5 ? 0 : 1;
|
|
214856
|
+
const pointAH = fLine ? pointA1H : pointA0H;
|
|
214857
|
+
const pointBH = fArc ? pointB1H : pointB0H;
|
|
214858
|
+
const dist2 = pointAH.realDistanceSquaredXY(pointBH);
|
|
214859
|
+
return (dist2 !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol(dist2, tol2)) ? { fLine, fArc } : undefined;
|
|
214860
|
+
};
|
|
214795
214861
|
for (let i = 0; i < numRoots; i++) {
|
|
214796
|
-
const
|
|
214797
|
-
|
|
214798
|
-
|
|
214799
|
-
if (lineFraction !== undefined) {
|
|
214800
|
-
if (this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB0, arcFraction, extendB1)) {
|
|
214801
|
-
this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
|
|
214802
|
-
}
|
|
214803
|
-
else { // check for endpoint intersections beyond parametric tolerance but within point tolerance
|
|
214804
|
-
const pointAH = lineFraction < 0.5 ? pointA0H : pointA1H;
|
|
214805
|
-
const pointBH = (arcFraction = data.sweep.fractionToSignedPeriodicFraction(arcFraction)) < 0.5 ? pointB0H : pointB1H;
|
|
214806
|
-
if ((dist2 = pointAH.realDistanceSquaredXY(pointBH)) !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol(dist2, tol2))
|
|
214807
|
-
this.recordPointWithLocalFractions(lineFraction < 0.5 ? 0 : 1, cpA, fractionA0, fractionA1, arcFraction < 0.5 ? 0 : 1, arc, 0, 1, reversed);
|
|
214808
|
-
}
|
|
214809
|
-
}
|
|
214862
|
+
const result = acceptSolution(i, closeApproach);
|
|
214863
|
+
if (result)
|
|
214864
|
+
this.recordPointWithLocalFractions(result.fLine, cpA, fractionA0, fractionA1, result.fArc, arc, 0, 1, reversed);
|
|
214810
214865
|
}
|
|
214811
214866
|
}
|
|
214812
214867
|
else {
|
|
@@ -214824,27 +214879,30 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
214824
214879
|
const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.center, 1);
|
|
214825
214880
|
const beta = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector0, 0);
|
|
214826
214881
|
const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector90, 0);
|
|
214827
|
-
|
|
214828
|
-
const
|
|
214829
|
-
|
|
214830
|
-
|
|
214831
|
-
|
|
214832
|
-
|
|
214882
|
+
let numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_10__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
|
|
214883
|
+
const closeApproach = (0 === numRoots);
|
|
214884
|
+
if (closeApproach)
|
|
214885
|
+
numRoots = 1; // we returned the arc's closest approach as the first "root"; if within tolerance and at endpoints, we record it
|
|
214886
|
+
const acceptSolution = (iRoot, checkOnlyEndPointDistance = false) => {
|
|
214887
|
+
const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(iRoot), data.vector90, sines.atUncheckedIndex(iRoot));
|
|
214888
|
+
let fArc = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(iRoot), extendB0);
|
|
214889
|
+
let fLine = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
|
|
214890
|
+
if (fLine === undefined)
|
|
214891
|
+
return undefined;
|
|
214892
|
+
if (!checkOnlyEndPointDistance && this.acceptFraction(extendA0, fLine, extendA1) && this.acceptFraction(extendB0, fArc, extendB1))
|
|
214893
|
+
return { fLine, fArc };
|
|
214894
|
+
// check for an endpoint intersection that is beyond parametric tolerance but within point tolerance
|
|
214895
|
+
fLine = fLine < 0.5 ? 0 : 1;
|
|
214896
|
+
fArc = data.sweep.fractionToSignedPeriodicFraction(fArc) < 0.5 ? 0 : 1;
|
|
214897
|
+
const pointALocal = fLine ? pointA1Local : pointA0Local;
|
|
214898
|
+
const pointBLocal = fArc ? pointB1Local : pointB0Local;
|
|
214899
|
+
const dist2 = pointALocal.distanceSquaredXY(pointBLocal);
|
|
214900
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol(dist2, tol2) ? { fLine, fArc } : undefined;
|
|
214901
|
+
};
|
|
214833
214902
|
for (let i = 0; i < numRoots; i++) {
|
|
214834
|
-
const
|
|
214835
|
-
|
|
214836
|
-
|
|
214837
|
-
if (lineFraction !== undefined) {
|
|
214838
|
-
if (this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB0, arcFraction, extendB1)) {
|
|
214839
|
-
this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
|
|
214840
|
-
}
|
|
214841
|
-
else { // check for endpoint intersections beyond parametric tolerance but within point tolerance
|
|
214842
|
-
const pointALocal = lineFraction < 0.5 ? pointA0Local : pointA1Local;
|
|
214843
|
-
const pointBLocal = (arcFraction = data.sweep.fractionToSignedPeriodicFraction(arcFraction)) < 0.5 ? pointB0Local : pointB1Local;
|
|
214844
|
-
if ((dist2 = pointALocal.distanceSquaredXY(pointBLocal)) !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol(dist2, tol2))
|
|
214845
|
-
this.recordPointWithLocalFractions(lineFraction < 0.5 ? 0 : 1, cpA, fractionA0, fractionA1, arcFraction < 0.5 ? 0 : 1, arc, 0, 1, reversed);
|
|
214846
|
-
}
|
|
214847
|
-
}
|
|
214903
|
+
const result = acceptSolution(i, closeApproach);
|
|
214904
|
+
if (result)
|
|
214905
|
+
this.recordPointWithLocalFractions(result.fLine, cpA, fractionA0, fractionA1, result.fArc, arc, 0, 1, reversed);
|
|
214848
214906
|
}
|
|
214849
214907
|
}
|
|
214850
214908
|
}
|
|
@@ -214867,12 +214925,23 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
214867
214925
|
localB.coffs[0], localB.coffs[3], localB.coffs[6], // vector0 xyw
|
|
214868
214926
|
localB.coffs[1], localB.coffs[4], localB.coffs[7], // vector90 xyw
|
|
214869
214927
|
ellipseRadians, circleRadians);
|
|
214928
|
+
const tol2 = this._coincidentGeometryContext.tolerance * this._coincidentGeometryContext.tolerance;
|
|
214870
214929
|
// the intersections are transform-invariant, so the solution angles apply directly to the input arcs
|
|
214871
214930
|
for (let i = 0; i < ellipseRadians.length; i++) {
|
|
214872
|
-
|
|
214873
|
-
|
|
214874
|
-
if (this.acceptFraction(extendA0, fractionA, extendA1) && this.acceptFraction(extendB0, fractionB, extendB1))
|
|
214931
|
+
let fractionA = cpA.sweep.radiansToSignedFraction(circleRadians[i], extendA0);
|
|
214932
|
+
let fractionB = cpB.sweep.radiansToSignedFraction(ellipseRadians[i], extendB0);
|
|
214933
|
+
if (this.acceptFraction(extendA0, fractionA, extendA1) && this.acceptFraction(extendB0, fractionB, extendB1)) {
|
|
214875
214934
|
this.recordPointWithLocalFractions(fractionA, cpA, 0, 1, fractionB, cpB, 0, 1, reversed);
|
|
214935
|
+
}
|
|
214936
|
+
else { // check for endpoint intersection beyond angular tolerance but within point tolerance
|
|
214937
|
+
fractionA = cpA.sweep.fractionToSignedPeriodicFraction(fractionA) < 0.5 ? 0 : 1;
|
|
214938
|
+
fractionB = cpB.sweep.fractionToSignedPeriodicFraction(fractionB) < 0.5 ? 0 : 1;
|
|
214939
|
+
const endPointA = cpA.fractionToPoint(fractionA, CurveCurveIntersectXY._workPointAA0);
|
|
214940
|
+
const endPointB = cpB.fractionToPoint(fractionB, CurveCurveIntersectXY._workPointBB0);
|
|
214941
|
+
const dist2 = endPointA.distanceSquaredXY(endPointB);
|
|
214942
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol(dist2, tol2))
|
|
214943
|
+
this.recordPointWithLocalFractions(fractionA, cpA, 0, 1, fractionB, cpB, 0, 1, reversed);
|
|
214944
|
+
}
|
|
214876
214945
|
}
|
|
214877
214946
|
}
|
|
214878
214947
|
}
|
|
@@ -214885,6 +214954,15 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
214885
214954
|
* 5- Convert intersection angles to fractions and record intersections.
|
|
214886
214955
|
*/
|
|
214887
214956
|
dispatchArcArc(cpA, extendA0, extendA1, cpB, extendB0, extendB1, reversed) {
|
|
214957
|
+
// overlap handling. perspective is not handled.
|
|
214958
|
+
if (this._coincidentGeometryContext && !this._worldToLocalPerspective && !this._worldToLocalAffine) {
|
|
214959
|
+
const pairs = this._coincidentGeometryContext.coincidentArcIntersectionXY(cpA, cpB, true);
|
|
214960
|
+
if (pairs) {
|
|
214961
|
+
this.recordPairs(cpA, cpB, pairs, reversed);
|
|
214962
|
+
return;
|
|
214963
|
+
}
|
|
214964
|
+
}
|
|
214965
|
+
// look for isolated intersections
|
|
214888
214966
|
let matrixA;
|
|
214889
214967
|
let matrixB;
|
|
214890
214968
|
if (this._worldToLocalPerspective) {
|
|
@@ -214901,27 +214979,13 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
214901
214979
|
}
|
|
214902
214980
|
const conditionA = matrixA.conditionNumber();
|
|
214903
214981
|
const conditionB = matrixB.conditionNumber();
|
|
214904
|
-
//
|
|
214982
|
+
// order the arcs so that the first one we pass in is closer to circular
|
|
214905
214983
|
if (conditionA > conditionB)
|
|
214906
214984
|
this.dispatchArcArcThisOrder(cpA, matrixA, extendA0, extendA1, cpB, matrixB, extendB0, extendB1, reversed);
|
|
214907
214985
|
else
|
|
214908
214986
|
this.dispatchArcArcThisOrder(cpB, matrixB, extendB0, extendB1, cpA, matrixA, extendA0, extendA1, !reversed);
|
|
214909
|
-
// overlap handling. perspective is not handled.
|
|
214910
|
-
if (!this._coincidentGeometryContext) {
|
|
214911
|
-
// do nothing
|
|
214912
|
-
}
|
|
214913
|
-
else if (this._worldToLocalPerspective) {
|
|
214914
|
-
// do nothing
|
|
214915
|
-
}
|
|
214916
|
-
else if (this._worldToLocalAffine) {
|
|
214917
|
-
// do nothing
|
|
214918
|
-
}
|
|
214919
|
-
else {
|
|
214920
|
-
const pairs = this._coincidentGeometryContext.coincidentArcIntersectionXY(cpA, cpB, true);
|
|
214921
|
-
if (pairs !== undefined)
|
|
214922
|
-
this.recordPairs(cpA, cpB, pairs, reversed);
|
|
214923
|
-
}
|
|
214924
214987
|
}
|
|
214988
|
+
/** Compute the intersection of an arc and a B-spline curve. */
|
|
214925
214989
|
dispatchArcBsplineCurve3d(cpA, extendA0, extendA1, cpB, extendB0, extendB1, reversed) {
|
|
214926
214990
|
// Arc: X = C + cU + sV
|
|
214927
214991
|
// implicitize the arc as viewed. This "3d" matrix is homogeneous "XYW" not "xyz"
|
|
@@ -214936,8 +215000,6 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
214936
215000
|
}
|
|
214937
215001
|
// The worldToLocal has moved the arc vectors into local space.
|
|
214938
215002
|
// matrixA captures the xyw parts (ignoring z)
|
|
214939
|
-
// for any point in world space,
|
|
214940
|
-
// THIS CODE ONLY WORKS FOR
|
|
214941
215003
|
const matrixAInverse = matrixA.inverse();
|
|
214942
215004
|
if (matrixAInverse) {
|
|
214943
215005
|
const orderF = cpB.order; // order of the beziers for simple coordinates
|
|
@@ -214956,36 +215018,34 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
214956
215018
|
const awy = matrixAInverse.at(2, 1);
|
|
214957
215019
|
const awz = 0.0;
|
|
214958
215020
|
const aww = matrixAInverse.at(2, 2);
|
|
214959
|
-
|
|
214960
|
-
|
|
214961
|
-
|
|
214962
|
-
|
|
214963
|
-
|
|
214964
|
-
|
|
214965
|
-
|
|
214966
|
-
|
|
214967
|
-
|
|
214968
|
-
|
|
214969
|
-
|
|
214970
|
-
|
|
214971
|
-
|
|
214972
|
-
|
|
214973
|
-
|
|
214974
|
-
|
|
214975
|
-
|
|
214976
|
-
|
|
214977
|
-
|
|
214978
|
-
|
|
214979
|
-
|
|
214980
|
-
|
|
214981
|
-
|
|
214982
|
-
|
|
214983
|
-
|
|
214984
|
-
|
|
214985
|
-
|
|
214986
|
-
|
|
214987
|
-
this.recordPointWithLocalFractions(arcFraction, cpA, 0, 1, fractionB, cpB, 0, 1, reversed);
|
|
214988
|
-
}
|
|
215021
|
+
let bezier;
|
|
215022
|
+
for (let spanIndex = 0;; spanIndex++) {
|
|
215023
|
+
bezier = cpB.getSaturatedBezierSpan3dH(spanIndex, bezier);
|
|
215024
|
+
if (!bezier)
|
|
215025
|
+
break;
|
|
215026
|
+
if (this._worldToLocalPerspective)
|
|
215027
|
+
bezier.tryMultiplyMatrix4dInPlace(this._worldToLocalPerspective);
|
|
215028
|
+
else if (this._worldToLocalAffine)
|
|
215029
|
+
bezier.tryTransformInPlace(this._worldToLocalAffine);
|
|
215030
|
+
univariateBezierG.zero();
|
|
215031
|
+
bezier.poleProductsXYZW(coffF, axx, axy, axz, axw);
|
|
215032
|
+
univariateBezierG.addSquaredSquaredBezier(coffF, 1.0);
|
|
215033
|
+
bezier.poleProductsXYZW(coffF, ayx, ayy, ayz, ayw);
|
|
215034
|
+
univariateBezierG.addSquaredSquaredBezier(coffF, 1.0);
|
|
215035
|
+
bezier.poleProductsXYZW(coffF, awx, awy, awz, aww);
|
|
215036
|
+
univariateBezierG.addSquaredSquaredBezier(coffF, -1.0);
|
|
215037
|
+
const roots = univariateBezierG.roots(0.0, true);
|
|
215038
|
+
if (roots) {
|
|
215039
|
+
for (const root of roots) {
|
|
215040
|
+
const fractionB = bezier.fractionToParentFraction(root);
|
|
215041
|
+
// The univariate bezier (which has been transformed by the view transform) evaluates into xyw space
|
|
215042
|
+
const bcurvePoint4d = bezier.fractionToPoint4d(root);
|
|
215043
|
+
const c = bcurvePoint4d.dotProductXYZW(axx, axy, axz, axw);
|
|
215044
|
+
const s = bcurvePoint4d.dotProductXYZW(ayx, ayy, ayz, ayw);
|
|
215045
|
+
const arcFraction = cpA.sweep.radiansToSignedFraction(Math.atan2(s, c), extendA0);
|
|
215046
|
+
if (this.acceptFraction(extendA0, arcFraction, extendA1) &&
|
|
215047
|
+
this.acceptFraction(extendB0, fractionB, extendB1)) {
|
|
215048
|
+
this.recordPointWithLocalFractions(arcFraction, cpA, 0, 1, fractionB, cpB, 0, 1, reversed);
|
|
214989
215049
|
}
|
|
214990
215050
|
}
|
|
214991
215051
|
}
|
|
@@ -226589,7 +226649,8 @@ class GrowableXYArray extends _IndexedXYCollection__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
226589
226649
|
newPoints._xyInUse = this.length;
|
|
226590
226650
|
return newPoints;
|
|
226591
226651
|
}
|
|
226592
|
-
/**
|
|
226652
|
+
/**
|
|
226653
|
+
* Create an array by copying data from various point formats.
|
|
226593
226654
|
* Valid inputs are:
|
|
226594
226655
|
* * Point2d
|
|
226595
226656
|
* * Point3d
|
|
@@ -227367,7 +227428,8 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
227367
227428
|
compressInPlace(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
227368
227429
|
return GrowableXYZArray.createCompressed(this, tolerance, this);
|
|
227369
227430
|
}
|
|
227370
|
-
/**
|
|
227431
|
+
/**
|
|
227432
|
+
* Create an array by copying data from various point formats.
|
|
227371
227433
|
* Valid inputs are:
|
|
227372
227434
|
* * Point2d
|
|
227373
227435
|
* * Point3d
|
|
@@ -228465,8 +228527,8 @@ class PointsIterator {
|
|
|
228465
228527
|
[Symbol.iterator]() { return this; }
|
|
228466
228528
|
}
|
|
228467
228529
|
/**
|
|
228468
|
-
*
|
|
228469
|
-
* * This allows algorithms to work with Point3d[] or
|
|
228530
|
+
* Abstract base class for read-only access to XYZ data with indexed reference.
|
|
228531
|
+
* * This allows algorithms to work with Point3d[] or [[GrowableXYZArray]].
|
|
228470
228532
|
* * GrowableXYZArray implements these for its data.
|
|
228471
228533
|
* * Point3dArrayCarrier carries a (reference to) a Point3d[] and implements the methods with calls on that array reference.
|
|
228472
228534
|
* * In addition to "point by point" accessors, other abstract members compute commonly useful vector data "between points".
|
|
@@ -228684,7 +228746,7 @@ class IndexedXYZCollection {
|
|
|
228684
228746
|
}
|
|
228685
228747
|
}
|
|
228686
228748
|
/**
|
|
228687
|
-
*
|
|
228749
|
+
* Abstract base class extends [[IndexedXYZCollection]] with methods that modify the collection.
|
|
228688
228750
|
* @public
|
|
228689
228751
|
*/
|
|
228690
228752
|
class IndexedReadWriteXYZCollection extends IndexedXYZCollection {
|
|
@@ -239378,8 +239440,8 @@ class PolylineOps {
|
|
|
239378
239440
|
* Checks if all points are colinear.
|
|
239379
239441
|
* * This test does not take point order into account.
|
|
239380
239442
|
* @param points array of points to check.
|
|
239381
|
-
* @param distanceTol
|
|
239382
|
-
* @param xyOnly
|
|
239443
|
+
* @param distanceTol maximum allowable distance that geometry can deviate from colinearity.Default is [[Geometry.smallMetricDistance]].
|
|
239444
|
+
* @param xyOnly whether to ignore z-coordinates in the colinearity test.
|
|
239383
239445
|
*/
|
|
239384
239446
|
static isColinear(points, distanceTol = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance, xyOnly = false) {
|
|
239385
239447
|
if (points.length < 3)
|
|
@@ -247465,9 +247527,9 @@ class ClusterableArray extends _geometry3d_GrowableBlockedArray__WEBPACK_IMPORTE
|
|
|
247465
247527
|
candidateBlockIndex = firstSort[j];
|
|
247466
247528
|
if (candidateBlockIndex === ClusterableArray.clusterTerminator)
|
|
247467
247529
|
continue; // nearby in sort direction but already in a cluster.
|
|
247468
|
-
if (this.component(candidateBlockIndex, 0)
|
|
247530
|
+
if (this.component(candidateBlockIndex, 0) > barrierU)
|
|
247469
247531
|
break;
|
|
247470
|
-
if (this.distanceBetweenSubBlocks(clusterStartBlockIndex, candidateBlockIndex, k0, k1)
|
|
247532
|
+
if (this.distanceBetweenSubBlocks(clusterStartBlockIndex, candidateBlockIndex, k0, k1) <= clusterTolerance) {
|
|
247471
247533
|
clusterIndices[m++] = candidateBlockIndex; // The candidate is in the block
|
|
247472
247534
|
firstSort[j] = ClusterableArray.clusterTerminator; // and it will not be reused as future block base
|
|
247473
247535
|
}
|
|
@@ -283252,13 +283314,21 @@ class HalfEdgeGraphMerge {
|
|
|
283252
283314
|
static isNullFace(node) {
|
|
283253
283315
|
return node.isMaskSet(_Graph__WEBPACK_IMPORTED_MODULE_3__.HalfEdgeMask.NULL_FACE) && node.faceSuccessor.isMaskSet(_Graph__WEBPACK_IMPORTED_MODULE_3__.HalfEdgeMask.NULL_FACE) && node === node.faceSuccessor.faceSuccessor;
|
|
283254
283316
|
}
|
|
283255
|
-
/**
|
|
283256
|
-
*
|
|
283257
|
-
* *
|
|
283258
|
-
* *
|
|
283259
|
-
* * This
|
|
283260
|
-
*
|
|
283261
|
-
*
|
|
283317
|
+
/**
|
|
283318
|
+
* Cluster the HalfEdges so that xy-coordinates within `mergeTolerance` are equated.
|
|
283319
|
+
* * Note that any additional data (e.g., edgeTag, faceTag) on the HalfEdges are ignored. In particular,
|
|
283320
|
+
* [[CurveLocationDetail]]s attached to clustered HalfEdges do *not* get their points adjusted.
|
|
283321
|
+
* * This is a simple merge algorithm:
|
|
283322
|
+
* * untwist all edges from the vertex loops
|
|
283323
|
+
* * collect array of (x,y,theta) at all nodes
|
|
283324
|
+
* * lexical sort of the array
|
|
283325
|
+
* * twist all edges together in sort order around each vertex
|
|
283326
|
+
* * This effectively creates valid face loops for a planar subdivision if there are no edge crossings.
|
|
283327
|
+
* * If there are edge crossings, the graph can be a (highly complicated) Klein bottle topology.
|
|
283328
|
+
* * [[HalfEdgeMask.NULL_FACE]] is cleared throughout and applied within null faces.
|
|
283329
|
+
* @param graph input graph
|
|
283330
|
+
* @param outboundRadiansFunction optional function to compute the sort angle of an edge at its start vertex
|
|
283331
|
+
* @param clusterTol optional distance tolerance for clustering vertices. Default value is [[Geometry.smallMetricDistance]].
|
|
283262
283332
|
*/
|
|
283263
283333
|
static clusterAndMergeXYTheta(graph, outboundRadiansFunction, clusterTol = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
283264
283334
|
const allNodes = graph.allHalfEdges;
|
|
@@ -283316,14 +283386,11 @@ class HalfEdgeGraphMerge {
|
|
|
283316
283386
|
const unmatchedNullFaceNodes = [];
|
|
283317
283387
|
k0 = 0;
|
|
283318
283388
|
let thetaA, thetaB;
|
|
283319
|
-
// GeometryCoreTestIO.consoleLog("START VERTEX LINKS");
|
|
283320
283389
|
// now pinch each neighboring pair together
|
|
283321
283390
|
for (let k1 = 0; k1 < numK; k1++) {
|
|
283322
283391
|
if (order[k1] === _numerics_ClusterableArray__WEBPACK_IMPORTED_MODULE_5__.ClusterableArray.clusterTerminator) {
|
|
283323
283392
|
// nodes identified in order[k0]..order[k1-1] are properly sorted around a vertex.
|
|
283324
283393
|
if (k1 > k0) {
|
|
283325
|
-
// const xy = clusters.getPoint2d(order[k0]);
|
|
283326
|
-
// GeometryCoreTestIO.consoleLog({ k0, k1, x: xy.x, y: xy.y });
|
|
283327
283394
|
if (k1 > k0 + 1)
|
|
283328
283395
|
this.secondarySortAroundVertex(clusters, order, allNodes, k0, k1);
|
|
283329
283396
|
this.doAnnounceVertexNeighborhood(clusters, order, allNodes, k0, k1);
|
|
@@ -320752,7 +320819,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
320752
320819
|
/***/ ((module) => {
|
|
320753
320820
|
|
|
320754
320821
|
"use strict";
|
|
320755
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.2.
|
|
320822
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.2.1","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 && npm run -s copy:draco","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/eslint-plugin":"5.2.2-dev.2","@types/chai-as-promised":"^7","@types/draco3d":"^1.4.10","@types/sinon":"^17.0.2","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.31.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","sinon":"^17.0.2","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.3.0","@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^4.3.4","@loaders.gl/draco":"^4.3.4","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
320756
320823
|
|
|
320757
320824
|
/***/ })
|
|
320758
320825
|
|