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