@itwin/rpcinterface-full-stack-tests 4.9.0-dev.19 → 4.9.0-dev.20

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.
@@ -74627,6 +74627,16 @@ class Schema {
74627
74627
  setDescription(description) {
74628
74628
  this._description = description;
74629
74629
  }
74630
+ /**
74631
+ * @alpha
74632
+ * Used for schema editing.
74633
+ */
74634
+ setAlias(alias) {
74635
+ if (!_ECName__WEBPACK_IMPORTED_MODULE_5__.ECName.validate(alias)) {
74636
+ throw new _Exception__WEBPACK_IMPORTED_MODULE_3__.ECObjectsError(_Exception__WEBPACK_IMPORTED_MODULE_3__.ECObjectsStatus.InvalidECName, "The specified schema alias is invalid.");
74637
+ }
74638
+ this._alias = alias;
74639
+ }
74630
74640
  }
74631
74641
  /**
74632
74642
  * Hackish approach that works like a "friend class" so we can access protected members without making them public.
@@ -196479,7 +196489,7 @@ class CurveOps {
196479
196489
  * @returns object with named chains, insideOffsets, outsideOffsets
196480
196490
  */
196481
196491
  static collectInsideAndOutsideXYOffsets(fragments, offsetDistance, gapTolerance) {
196482
- const collector = new _internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_5__.MultiChainCollector(gapTolerance);
196492
+ const collector = new _internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_5__.MultiChainCollector(gapTolerance, gapTolerance);
196483
196493
  for (const s of fragments) {
196484
196494
  collector.captureCurve(s);
196485
196495
  }
@@ -196520,7 +196530,7 @@ class CurveOps {
196520
196530
  * @param planeTolerance tolerance for considering a closed chain to be planar. If undefined, only create Path. If defined, create Loops for closed chains within tolerance of a plane.
196521
196531
  * @returns chains, possibly wrapped in a [[BagOfCurves]].
196522
196532
  */
196523
- static collectChains(fragments, gapTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.smallMetricDistance, planeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.smallMetricDistance) {
196533
+ static collectChains(fragments, gapTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.smallMetricDistance, planeTolerance) {
196524
196534
  const collector = new _internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_5__.MultiChainCollector(gapTolerance, planeTolerance);
196525
196535
  for (const s of fragments) {
196526
196536
  collector.captureCurve(s);
@@ -196528,16 +196538,16 @@ class CurveOps {
196528
196538
  return collector.grabResult(true);
196529
196539
  }
196530
196540
  /**
196531
- * Restructure curve fragments as Paths and Loops, to be stroked and passed into the callback.
196541
+ * Restructure curve fragments, to be stroked and passed into the callback.
196532
196542
  * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.
196533
196543
  * @param fragments fragments to be chained and stroked
196534
196544
  * @param announceChain callback to process each stroked Path and Loop
196535
196545
  * @param strokeOptions options for stroking the chains
196536
196546
  * @param gapTolerance distance to be treated as "effectively zero" when assembling fragments head-to-tail. Also used for removing duplicate points in the stroked chains.
196537
- * @param planeTolerance tolerance for considering a closed chain to be planar. If undefined, only create Path. If defined, create Loops for closed chains within tolerance of a plane.
196547
+ * @param _planeTolerance unused, pass undefined
196538
196548
  */
196539
- static collectChainsAsLineString3d(fragments, announceChain, strokeOptions, gapTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.smallMetricDistance, planeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.smallMetricDistance) {
196540
- const collector = new _internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_5__.MultiChainCollector(gapTolerance, planeTolerance);
196549
+ static collectChainsAsLineString3d(fragments, announceChain, strokeOptions, gapTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.smallMetricDistance, _planeTolerance) {
196550
+ const collector = new _internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_5__.MultiChainCollector(gapTolerance); // no planarity tolerance needed
196541
196551
  for (const s of fragments) {
196542
196552
  collector.captureCurve(s);
196543
196553
  }
@@ -208589,7 +208599,7 @@ __webpack_require__.r(__webpack_exports__);
208589
208599
  * Manage a growing array of arrays of curve primitives that are to be joined "head to tail" in paths.
208590
208600
  * * The caller makes a sequence of calls to announce individual primitives.
208591
208601
  * * This collector (unlike the simpler [[ChainCollectorContext]]) expects to have inputs arriving in random order, leaving multiple open chains in play at any time.
208592
- * * When all curves have been announced, the call to `grabResults` restructures the various active chains into Paths (and optionally, Loops).
208602
+ * * When all curves have been announced, the call to `grabResult` restructures the various active chains into Paths (and optionally, Loops).
208593
208603
  * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.
208594
208604
  * * Usage pattern is
208595
208605
  * * initialization: `context = new MultiChainCollector(gapTol, planeTol)`
@@ -208604,7 +208614,7 @@ class MultiChainCollector {
208604
208614
  * @param gapTolerance tolerance for calling endpoints identical
208605
208615
  * @param planeTolerance tolerance for considering a closed chain to be planar. If undefined, only create Path. If defined, create Loops for closed chains within tolerance of a plane.
208606
208616
  */
208607
- constructor(gapTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance, planeTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
208617
+ constructor(gapTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance, planeTolerance) {
208608
208618
  this._chains = [];
208609
208619
  this._gapTolerance = gapTolerance;
208610
208620
  this._snapTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance;
@@ -208824,7 +208834,7 @@ class MultiChainCollector {
208824
208834
  /**
208825
208835
  * Convert an array of curve primitives into the simplest possible strongly typed curve structure.
208826
208836
  * @param curves input array, assembled correctly into a single contiguous path, captured by returned object
208827
- * @param makeLoopIfClosed whether to return a Loop from physically closed curves array, otherwise Path
208837
+ * @param makeLoopIfClosed whether to return a Loop from physically closed coplanar curves, otherwise Path
208828
208838
  * @return Loop or Path if multiple curves; the primitive if only one curve; undefined if no curves
208829
208839
  */
208830
208840
  promoteArrayToCurves(curves, makeLoopIfClosed) {
@@ -208882,7 +208892,10 @@ class MultiChainCollector {
208882
208892
  }
208883
208893
  return bag;
208884
208894
  }
208885
- /** Return chains as individual calls to announceChain. */
208895
+ /**
208896
+ * Return chains as individual calls to announceChain.
208897
+ * * Does not use planeTolerance.
208898
+ */
208886
208899
  announceChainsAsLineString3d(announceChain, options) {
208887
208900
  const chains = this._chains;
208888
208901
  if (chains.length === 1) {
@@ -215907,7 +215920,8 @@ class FrameBuilder {
215907
215920
  * * x axis in direction of first nonzero vector present or implied by the input.
215908
215921
  * * y axis is perpendicular to x and contains (in positive side) the next vector present or implied by the input.
215909
215922
  * * The calculation favors the first points found. It does not try to get a "best" plane.
215910
- * @param defaultUpVector optional vector to cross with vector0 to create vector1 when it is unknown
215923
+ * @param defaultUpVector optional vector to cross with vector0 to create vector1 when it is unknown.
215924
+ * The z-column of the returned frame points into the same halfspace as this vector.
215911
215925
  * @param params any number of geometric objects to examine in [[announce]] for point/vector data sufficient to construct a frame.
215912
215926
  * If the last argument is a `Transform`, it is populated with the computed frame and returned.
215913
215927
  * @returns computed localToWorld frame, or undefined if insufficient data.
@@ -215915,17 +215929,17 @@ class FrameBuilder {
215915
215929
  static createRightHandedFrame(defaultUpVector, ...params) {
215916
215930
  // if last arg is a Transform, remove it from the array and use for the return value
215917
215931
  let frame = (params.length > 0 && params[params.length - 1] instanceof _Transform__WEBPACK_IMPORTED_MODULE_2__.Transform) ? params.pop() : undefined;
215932
+ const flipFrame = (f) => {
215933
+ if (defaultUpVector && f.matrix.dotColumnZ(defaultUpVector) < 0.0)
215934
+ f.matrix.scaleColumnsInPlace(1, -1, -1);
215935
+ return f;
215936
+ };
215918
215937
  const builder = new FrameBuilder();
215919
215938
  for (const data of params) {
215920
215939
  builder.announce(data);
215921
215940
  builder.applyDefaultUpVector(defaultUpVector);
215922
- if (frame = builder.getValidatedFrame(false, frame)) {
215923
- if (defaultUpVector) {
215924
- if (frame.matrix.dotColumnZ(defaultUpVector) < 0.0)
215925
- frame.matrix.scaleColumnsInPlace(1, -1, -1);
215926
- }
215927
- return frame;
215928
- }
215941
+ if (frame = builder.getValidatedFrame(false, frame))
215942
+ return flipFrame(frame);
215929
215943
  }
215930
215944
  const evaluatePrimitiveFrame = (curve, result) => {
215931
215945
  return curve.fractionToFrenetFrame(0.0, result);
@@ -215933,13 +215947,14 @@ class FrameBuilder {
215933
215947
  // try direct evaluation of curve primitives using the above lambda
215934
215948
  for (const data of params) {
215935
215949
  if (data instanceof _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_4__.CurvePrimitive) {
215936
- return evaluatePrimitiveFrame(data, frame);
215950
+ if (frame = evaluatePrimitiveFrame(data, frame))
215951
+ return flipFrame(frame);
215937
215952
  }
215938
215953
  else if (data instanceof _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_10__.CurveCollection) {
215939
215954
  const children = data.collectCurvePrimitives();
215940
215955
  for (const curve of children) {
215941
215956
  if (frame = evaluatePrimitiveFrame(curve, frame))
215942
- return frame;
215957
+ return flipFrame(frame);
215943
215958
  }
215944
215959
  }
215945
215960
  }
@@ -227552,10 +227567,10 @@ class PolygonOps {
227552
227567
  return s;
227553
227568
  }
227554
227569
  /**
227555
- * Return a Ray3d with (assuming the polygon is planar and not self-intersecting)
227556
- * * origin at the centroid of the (3D) polygon
227557
- * * normal is a unit vector perpendicular to the plane
227558
- * * 'a' member is the area.
227570
+ * Return a Ray3d with (assuming the polygon is planar and not self-intersecting):
227571
+ * * `origin` at the centroid of the (3D) polygon
227572
+ * * `direction` is the unit vector perpendicular to the plane
227573
+ * * `a` is the area.
227559
227574
  * @param points
227560
227575
  */
227561
227576
  static centroidAreaNormal(points) {
@@ -227871,20 +227886,16 @@ class PolygonOps {
227871
227886
  static orientLoopsCCWForOutwardNormalInPlace(loops, outwardNormal) {
227872
227887
  if (loops instanceof _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_5__.IndexedXYZCollection)
227873
227888
  return this.orientLoopsCCWForOutwardNormalInPlace([loops], outwardNormal);
227874
- const orientations = [];
227875
227889
  const unitNormal = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
227876
227890
  // orient individually ... (no hole analysis)
227877
227891
  let numReverse = 0;
227878
227892
  for (const loop of loops) {
227879
227893
  if (this.unitNormal(loop, unitNormal)) {
227880
227894
  const q = unitNormal.dotProduct(outwardNormal);
227881
- orientations.push(q);
227882
- if (q <= 0.0)
227895
+ if (q < 0.0) {
227883
227896
  loop.reverseInPlace();
227884
- numReverse++;
227885
- }
227886
- else {
227887
- orientations.push(0.0);
227897
+ numReverse++;
227898
+ }
227888
227899
  }
227889
227900
  }
227890
227901
  return numReverse;
@@ -245246,8 +245257,9 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
245246
245257
  if (surface.capped && contour.isAnyRegionType) {
245247
245258
  const contourA = surface.getSweepContourRef();
245248
245259
  contourA.purgeFacets();
245249
- contourA.emitFacets(this, true, undefined);
245250
- contourA.emitFacets(this, false, sweepTransform);
245260
+ const reverseNearCap = contourA.localToWorld.matrix.dotColumnZ(sweepVector) > 0;
245261
+ contourA.emitFacets(this, reverseNearCap, undefined);
245262
+ contourA.emitFacets(this, !reverseNearCap, sweepTransform);
245251
245263
  }
245252
245264
  }
245253
245265
  /** Add facets from a ruled sweep. */
@@ -246085,15 +246097,7 @@ class ClipCandidate {
246085
246097
  }
246086
246098
  }
246087
246099
  /**
246088
- * A pair of PolyfaceBuilder objects, for use by clippers that emit inside and outside parts.
246089
- * * There are nominally 4 builders:
246090
- * * builderA collects simple "inside" clip.
246091
- * * builderB collects simple "outside" clip.
246092
- * * builderA1 collects "side" clip for inside.
246093
- * * builderB1 collets "side" clip for outside.
246094
- * * `static ClippedPolyfaceBuilders.create(keepInside, keepOutside)` initializes `builderA` and `builderB` (each optionally to undefined), with undefined `builderA1` and `builderB1`
246095
- * * `builders.enableSideBuilders()` makes `builderA1` and `builderB1` match `builderA` and `builderB`.
246096
- * * construction methods aim their facets at appropriate builders if defined.
246100
+ * A pair of [[PolyfaceBuilder]] objects, for use by clippers that emit inside and outside parts.
246097
246101
  * * @public
246098
246102
  */
246099
246103
  class ClippedPolyfaceBuilders {
@@ -246102,10 +246106,21 @@ class ClippedPolyfaceBuilders {
246102
246106
  this.builderB = builderB;
246103
246107
  this.buildClosureFaces = buildClosureFaces;
246104
246108
  }
246105
- /** Simple create with default options on builder. */
246109
+ /**
246110
+ * Static constructor with default options for the builders.
246111
+ * @param keepInside whether to collect clipped facets inside the clipper to `this.builderA` (default true)
246112
+ * @param keepOutside whether to collect clipped facets outside the clipper to `this.builderB` (default false)
246113
+ * @param buildSideFaces whether to add side facets to active builders (default false)
246114
+ */
246106
246115
  static create(keepInside = true, keepOutside = false, buildSideFaces = false) {
246107
246116
  return new ClippedPolyfaceBuilders(keepInside ? _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_1__.PolyfaceBuilder.create() : undefined, keepOutside ? _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_1__.PolyfaceBuilder.create() : undefined, buildSideFaces);
246108
246117
  }
246118
+ /**
246119
+ * Return the computed facets from the selected builder.
246120
+ * @param selector the polyface to return: 0 - builderA (typically inside facets), 1 - builderB (typically outside facets)
246121
+ * @param fixup whether to clean up the polyface
246122
+ * @param tolerance compression tolerance (default [[Geometry.smallMetricDistance]]).
246123
+ */
246109
246124
  claimPolyface(selector, fixup, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance) {
246110
246125
  const builder = selector === 0 ? this.builderA : this.builderB;
246111
246126
  if (builder) {
@@ -246429,9 +246444,9 @@ class PolyfaceClip {
246429
246444
  }
246430
246445
  else {
246431
246446
  if (destination.builderA)
246432
- contour.emitFacets(destination.builderA, true, clipper);
246447
+ contour.emitFacets(destination.builderA, false);
246433
246448
  if (destination.builderB)
246434
- contour.emitFacets(destination.builderB, false, clipper);
246449
+ contour.emitFacets(destination.builderB, true);
246435
246450
  }
246436
246451
  }
246437
246452
  }
@@ -246445,9 +246460,9 @@ class PolyfaceClip {
246445
246460
  }
246446
246461
  else {
246447
246462
  if (destination.builderA)
246448
- contour.emitFacets(destination.builderA, true, clipper);
246463
+ contour.emitFacets(destination.builderA, false);
246449
246464
  if (destination.builderB)
246450
- contour.emitFacets(destination.builderB, false, clipper);
246465
+ contour.emitFacets(destination.builderB, true);
246451
246466
  }
246452
246467
  }
246453
246468
  }
@@ -247347,42 +247362,44 @@ __webpack_require__.r(__webpack_exports__);
247347
247362
  /* harmony export */ "PolyfaceQuery": () => (/* binding */ PolyfaceQuery),
247348
247363
  /* harmony export */ "SweepLineStringToFacetsOptions": () => (/* binding */ SweepLineStringToFacetsOptions)
247349
247364
  /* harmony export */ });
247350
- /* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
247351
- /* harmony import */ var _curve_CurveOps__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../curve/CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
247352
- /* harmony import */ var _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../curve/internalContexts/MultiChainCollector */ "../../core/geometry/lib/esm/curve/internalContexts/MultiChainCollector.js");
247353
- /* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
247354
- /* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
247355
- /* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
247356
- /* harmony import */ var _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../curve/StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
247357
- /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
247358
- /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
247359
- /* harmony import */ var _geometry3d_BarycentricTriangle__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../geometry3d/BarycentricTriangle */ "../../core/geometry/lib/esm/geometry3d/BarycentricTriangle.js");
247360
- /* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
247361
- /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
247362
- /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
247363
- /* harmony import */ var _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../geometry3d/PointHelpers */ "../../core/geometry/lib/esm/geometry3d/PointHelpers.js");
247364
- /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
247365
- /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
247366
- /* harmony import */ var _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry4d/Matrix4d */ "../../core/geometry/lib/esm/geometry4d/Matrix4d.js");
247367
- /* harmony import */ var _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry4d/MomentData */ "../../core/geometry/lib/esm/geometry4d/MomentData.js");
247368
- /* harmony import */ var _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../numerics/UnionFind */ "../../core/geometry/lib/esm/numerics/UnionFind.js");
247369
- /* harmony import */ var _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../topology/ChainMerge */ "../../core/geometry/lib/esm/topology/ChainMerge.js");
247370
- /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
247371
- /* harmony import */ var _topology_HalfEdgeGraphFromIndexedLoopsContext__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../topology/HalfEdgeGraphFromIndexedLoopsContext */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js");
247372
- /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
247373
- /* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
247374
- /* harmony import */ var _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../topology/SpaceTriangulation */ "../../core/geometry/lib/esm/topology/SpaceTriangulation.js");
247375
- /* harmony import */ var _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./FacetLocationDetail */ "../../core/geometry/lib/esm/polyface/FacetLocationDetail.js");
247376
- /* harmony import */ var _FacetOrientation__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./FacetOrientation */ "../../core/geometry/lib/esm/polyface/FacetOrientation.js");
247377
- /* harmony import */ var _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./IndexedEdgeMatcher */ "../../core/geometry/lib/esm/polyface/IndexedEdgeMatcher.js");
247378
- /* harmony import */ var _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./IndexedPolyfaceVisitor */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceVisitor.js");
247379
- /* harmony import */ var _multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./multiclip/BuildAverageNormalsContext */ "../../core/geometry/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js");
247380
- /* harmony import */ var _multiclip_OffsetMeshContext__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./multiclip/OffsetMeshContext */ "../../core/geometry/lib/esm/polyface/multiclip/OffsetMeshContext.js");
247381
- /* harmony import */ var _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./multiclip/SweepLineStringToFacetContext */ "../../core/geometry/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js");
247382
- /* harmony import */ var _multiclip_XYPointBuckets__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./multiclip/XYPointBuckets */ "../../core/geometry/lib/esm/polyface/multiclip/XYPointBuckets.js");
247383
- /* harmony import */ var _Polyface__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
247384
- /* harmony import */ var _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
247385
- /* harmony import */ var _RangeLengthData__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./RangeLengthData */ "../../core/geometry/lib/esm/polyface/RangeLengthData.js");
247365
+ /* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
247366
+ /* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
247367
+ /* harmony import */ var _curve_CurveOps__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../curve/CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
247368
+ /* harmony import */ var _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../curve/internalContexts/MultiChainCollector */ "../../core/geometry/lib/esm/curve/internalContexts/MultiChainCollector.js");
247369
+ /* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
247370
+ /* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
247371
+ /* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
247372
+ /* harmony import */ var _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../curve/StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
247373
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
247374
+ /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
247375
+ /* harmony import */ var _geometry3d_BarycentricTriangle__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../geometry3d/BarycentricTriangle */ "../../core/geometry/lib/esm/geometry3d/BarycentricTriangle.js");
247376
+ /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
247377
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
247378
+ /* harmony import */ var _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../geometry3d/PointHelpers */ "../../core/geometry/lib/esm/geometry3d/PointHelpers.js");
247379
+ /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
247380
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
247381
+ /* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
247382
+ /* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
247383
+ /* harmony import */ var _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geometry4d/Matrix4d */ "../../core/geometry/lib/esm/geometry4d/Matrix4d.js");
247384
+ /* harmony import */ var _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry4d/MomentData */ "../../core/geometry/lib/esm/geometry4d/MomentData.js");
247385
+ /* harmony import */ var _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../numerics/UnionFind */ "../../core/geometry/lib/esm/numerics/UnionFind.js");
247386
+ /* harmony import */ var _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../topology/ChainMerge */ "../../core/geometry/lib/esm/topology/ChainMerge.js");
247387
+ /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
247388
+ /* harmony import */ var _topology_HalfEdgeGraphFromIndexedLoopsContext__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../topology/HalfEdgeGraphFromIndexedLoopsContext */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js");
247389
+ /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
247390
+ /* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
247391
+ /* harmony import */ var _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../topology/SpaceTriangulation */ "../../core/geometry/lib/esm/topology/SpaceTriangulation.js");
247392
+ /* harmony import */ var _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./FacetLocationDetail */ "../../core/geometry/lib/esm/polyface/FacetLocationDetail.js");
247393
+ /* harmony import */ var _FacetOrientation__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./FacetOrientation */ "../../core/geometry/lib/esm/polyface/FacetOrientation.js");
247394
+ /* harmony import */ var _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./IndexedEdgeMatcher */ "../../core/geometry/lib/esm/polyface/IndexedEdgeMatcher.js");
247395
+ /* harmony import */ var _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./IndexedPolyfaceVisitor */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceVisitor.js");
247396
+ /* harmony import */ var _multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./multiclip/BuildAverageNormalsContext */ "../../core/geometry/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js");
247397
+ /* harmony import */ var _multiclip_OffsetMeshContext__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./multiclip/OffsetMeshContext */ "../../core/geometry/lib/esm/polyface/multiclip/OffsetMeshContext.js");
247398
+ /* harmony import */ var _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./multiclip/SweepLineStringToFacetContext */ "../../core/geometry/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js");
247399
+ /* harmony import */ var _multiclip_XYPointBuckets__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./multiclip/XYPointBuckets */ "../../core/geometry/lib/esm/polyface/multiclip/XYPointBuckets.js");
247400
+ /* harmony import */ var _Polyface__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
247401
+ /* harmony import */ var _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
247402
+ /* harmony import */ var _RangeLengthData__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./RangeLengthData */ "../../core/geometry/lib/esm/polyface/RangeLengthData.js");
247386
247403
  /*---------------------------------------------------------------------------------------------
247387
247404
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
247388
247405
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -247425,6 +247442,8 @@ __webpack_require__.r(__webpack_exports__);
247425
247442
 
247426
247443
 
247427
247444
 
247445
+
247446
+
247428
247447
 
247429
247448
 
247430
247449
 
@@ -247451,7 +247470,7 @@ class SweepLineStringToFacetsOptions {
247451
247470
  * * Default `collectOnForwardFacets`, `collectOnSideFacets`, `collectOnRearFacets` are all `true`.
247452
247471
  */
247453
247472
  static create(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets) {
247454
- return new SweepLineStringToFacetsOptions(vectorToEye === undefined ? _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.unitZ() : vectorToEye.clone(), sideAngle === undefined ? _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallAngleRadians) : sideAngle.clone(), _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.resolveValue(assembleChains, true), _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.resolveValue(collectOnForwardFacets, true), _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.resolveValue(collectOnSideFacets, true), _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.resolveValue(collectOnRearFacets, true));
247473
+ return new SweepLineStringToFacetsOptions(vectorToEye === undefined ? _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ() : vectorToEye.clone(), sideAngle === undefined ? _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallAngleRadians) : sideAngle.clone(), _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.resolveValue(assembleChains, true), _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.resolveValue(collectOnForwardFacets, true), _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.resolveValue(collectOnSideFacets, true), _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.resolveValue(collectOnRearFacets, true));
247455
247474
  }
247456
247475
  /** Return `true` if all outputs are requested. */
247457
247476
  get collectAll() {
@@ -247482,7 +247501,7 @@ class SweepLineStringToFacetsOptions {
247482
247501
  */
247483
247502
  class OffsetMeshOptions {
247484
247503
  /** Constructor -- CAPTURE parameters. */
247485
- constructor(smoothSingleAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(25), smoothAccumulatedAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(60), chamferAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(90)) {
247504
+ constructor(smoothSingleAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(25), smoothAccumulatedAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(60), chamferAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(90)) {
247486
247505
  this.smoothSingleAngleBetweenNormals = smoothSingleAngleBetweenNormals.clone();
247487
247506
  this.smoothAccumulatedAngleBetweenNormals = smoothAccumulatedAngleBetweenNormals.clone();
247488
247507
  this.chamferAngleBetweenNormals = chamferAngleBetweenNormals.clone();
@@ -247499,7 +247518,7 @@ class OffsetMeshOptions {
247499
247518
  * is larger than `chamferTurnAngleBetweenNormals`, a chamfer edge may be added to prevent offset mesh from having
247500
247519
  * facets that extend out too far away from the source mesh. Default value is `120` degrees.
247501
247520
  */
247502
- static create(smoothSingleAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(25), smoothAccumulatedAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(60), chamferTurnAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(120)) {
247521
+ static create(smoothSingleAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(25), smoothAccumulatedAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(60), chamferTurnAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(120)) {
247503
247522
  const mySmoothSingleRadiansBetweenNormals = smoothSingleAngleBetweenNormals.clone();
247504
247523
  const mySmoothAccumulatedRadiansBetweenNormals = smoothAccumulatedAngleBetweenNormals.clone();
247505
247524
  const myChamferTurnAngleBetweenNormals = chamferTurnAngleBetweenNormals.clone();
@@ -247535,12 +247554,12 @@ var DuplicateFacetClusterSelector;
247535
247554
  class PolyfaceQuery {
247536
247555
  /** Copy the points from a visitor into a linestring loop. */
247537
247556
  static visitorToLoop(visitor) {
247538
- const ls = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d.createPoints(visitor.point.getPoint3dArray());
247539
- return _curve_Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.create(ls);
247557
+ const ls = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_4__.LineString3d.createPoints(visitor.point.getPoint3dArray());
247558
+ return _curve_Loop__WEBPACK_IMPORTED_MODULE_5__.Loop.create(ls);
247540
247559
  }
247541
247560
  /** Create a linestring loop for each facet of the polyface. */
247542
247561
  static indexedPolyfaceToLoops(polyface) {
247543
- const result = _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_5__.BagOfCurves.create();
247562
+ const result = _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_6__.BagOfCurves.create();
247544
247563
  const visitor = polyface.createVisitor(1);
247545
247564
  while (visitor.moveToNextFacet()) {
247546
247565
  const loop = PolyfaceQuery.visitorToLoop(visitor);
@@ -247558,14 +247577,14 @@ class PolyfaceQuery {
247558
247577
  static sumFacetAreas(source, vectorToEye) {
247559
247578
  let sum = 0;
247560
247579
  if (source !== undefined) {
247561
- if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
247580
+ if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
247562
247581
  return PolyfaceQuery.sumFacetAreas(source.createVisitor(1), vectorToEye);
247563
247582
  let unitVectorToEye;
247564
247583
  if (vectorToEye !== undefined)
247565
247584
  unitVectorToEye = vectorToEye.normalize();
247566
247585
  source.reset();
247567
247586
  while (source.moveToNextFacet()) {
247568
- const areaNormal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.areaNormal(source.point.getPoint3dArray());
247587
+ const areaNormal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.areaNormal(source.point.getPoint3dArray());
247569
247588
  sum += unitVectorToEye ? areaNormal.dotProduct(unitVectorToEye) : areaNormal.magnitude();
247570
247589
  }
247571
247590
  }
@@ -247580,12 +247599,12 @@ class PolyfaceQuery {
247580
247599
  */
247581
247600
  static sumTetrahedralVolumes(source, origin) {
247582
247601
  let sum = 0;
247583
- if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
247602
+ if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
247584
247603
  return PolyfaceQuery.sumTetrahedralVolumes(source.createVisitor(0), origin);
247585
247604
  let myOrigin = origin;
247586
- const facetOrigin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
247587
- const targetA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
247588
- const targetB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
247605
+ const facetOrigin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
247606
+ const targetA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
247607
+ const targetB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
247589
247608
  source.reset();
247590
247609
  while (source.moveToNextFacet()) {
247591
247610
  if (myOrigin === undefined)
@@ -247607,20 +247626,20 @@ class PolyfaceQuery {
247607
247626
  * moments with respect to the centroid.
247608
247627
  */
247609
247628
  static sumVolumeBetweenFacetsAndPlane(source, plane) {
247610
- if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
247629
+ if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
247611
247630
  return PolyfaceQuery.sumVolumeBetweenFacetsAndPlane(source.createVisitor(0), plane);
247612
- const facetOrigin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
247613
- const targetA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
247614
- const targetB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
247615
- const triangleNormal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
247631
+ const facetOrigin = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
247632
+ const targetA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
247633
+ const targetB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
247634
+ const triangleNormal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
247616
247635
  const planeNormal = plane.getNormalRef();
247617
247636
  let h0, hA, hB;
247618
247637
  let signedVolumeSum = 0.0;
247619
247638
  let signedTriangleArea;
247620
247639
  let singleFacetArea;
247621
- const positiveAreaMomentSums = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__.MomentData.create(undefined, true);
247622
- const negativeAreaMomentSums = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__.MomentData.create(undefined, true);
247623
- const singleFacetProducts = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__.Matrix4d.createZero();
247640
+ const positiveAreaMomentSums = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_9__.MomentData.create(undefined, true);
247641
+ const negativeAreaMomentSums = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_9__.MomentData.create(undefined, true);
247642
+ const singleFacetProducts = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_10__.Matrix4d.createZero();
247624
247643
  const projectToPlane = plane.getProjectionToPlane();
247625
247644
  source.reset();
247626
247645
  // For each facet:
@@ -247647,7 +247666,7 @@ class PolyfaceQuery {
247647
247666
  }
247648
247667
  singleFacetProducts.setZero();
247649
247668
  source.point.multiplyTransformInPlace(projectToPlane);
247650
- _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.addSecondMomentAreaProducts(source.point, facetOrigin, singleFacetProducts);
247669
+ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.addSecondMomentAreaProducts(source.point, facetOrigin, singleFacetProducts);
247651
247670
  if (singleFacetArea > 0) {
247652
247671
  positiveAreaMomentSums.accumulateProductsFromOrigin(facetOrigin, singleFacetProducts, 1.0);
247653
247672
  }
@@ -247657,8 +247676,8 @@ class PolyfaceQuery {
247657
247676
  }
247658
247677
  positiveAreaMomentSums.shiftOriginAndSumsToCentroidOfSums();
247659
247678
  negativeAreaMomentSums.shiftOriginAndSumsToCentroidOfSums();
247660
- const positiveAreaMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__.MomentData.inertiaProductsToPrincipalAxes(positiveAreaMomentSums.origin, positiveAreaMomentSums.sums);
247661
- const negativeAreaMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__.MomentData.inertiaProductsToPrincipalAxes(negativeAreaMomentSums.origin, negativeAreaMomentSums.sums);
247679
+ const positiveAreaMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_9__.MomentData.inertiaProductsToPrincipalAxes(positiveAreaMomentSums.origin, positiveAreaMomentSums.sums);
247680
+ const negativeAreaMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_9__.MomentData.inertiaProductsToPrincipalAxes(negativeAreaMomentSums.origin, negativeAreaMomentSums.sums);
247662
247681
  return {
247663
247682
  volume: signedVolumeSum / 6.0,
247664
247683
  positiveProjectedFacetAreaMoments: positiveAreaMoments,
@@ -247667,23 +247686,23 @@ class PolyfaceQuery {
247667
247686
  }
247668
247687
  /** Return the inertia products [xx,xy,xz,xw,yw, etc] integrated over all all facets as viewed from origin. */
247669
247688
  static sumFacetSecondAreaMomentProducts(source, origin) {
247670
- if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
247689
+ if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
247671
247690
  return PolyfaceQuery.sumFacetSecondAreaMomentProducts(source.createVisitor(0), origin);
247672
- const products = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__.Matrix4d.createZero();
247691
+ const products = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_10__.Matrix4d.createZero();
247673
247692
  source.reset();
247674
247693
  while (source.moveToNextFacet()) {
247675
- _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.addSecondMomentAreaProducts(source.point, origin, products);
247694
+ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.addSecondMomentAreaProducts(source.point, origin, products);
247676
247695
  }
247677
247696
  return products;
247678
247697
  }
247679
247698
  /** Return the inertia products [xx,xy,xz,xw,yw, etc] integrated over all tetrahedral volumes from origin. */
247680
247699
  static sumFacetSecondVolumeMomentProducts(source, origin) {
247681
- if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
247700
+ if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
247682
247701
  return PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source.createVisitor(0), origin);
247683
- const products = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__.Matrix4d.createZero();
247702
+ const products = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_10__.Matrix4d.createZero();
247684
247703
  source.reset();
247685
247704
  while (source.moveToNextFacet()) {
247686
- _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.addSecondMomentVolumeProducts(source.point, origin, products);
247705
+ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.addSecondMomentVolumeProducts(source.point, origin, products);
247687
247706
  }
247688
247707
  return products;
247689
247708
  }
@@ -247698,7 +247717,7 @@ class PolyfaceQuery {
247698
247717
  if (!origin)
247699
247718
  return undefined;
247700
247719
  const inertiaProducts = PolyfaceQuery.sumFacetSecondAreaMomentProducts(source, origin);
247701
- return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
247720
+ return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_9__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
247702
247721
  }
247703
247722
  /**
247704
247723
  * Compute area moments for the mesh. In the returned MomentData:
@@ -247713,7 +247732,7 @@ class PolyfaceQuery {
247713
247732
  if (!origin)
247714
247733
  return undefined;
247715
247734
  const inertiaProducts = PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source, origin);
247716
- return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
247735
+ return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_9__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
247717
247736
  }
247718
247737
  /**
247719
247738
  * Determine whether all facets are convex.
@@ -247721,13 +247740,13 @@ class PolyfaceQuery {
247721
247740
  * @returns `true` if all facets are convex; `false` otherwise.
247722
247741
  */
247723
247742
  static areFacetsConvex(source) {
247724
- if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
247743
+ if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
247725
247744
  return this.areFacetsConvex(source.createVisitor(0));
247726
247745
  source.setNumWrap(0);
247727
247746
  source.reset();
247728
247747
  while (source.moveToNextFacet()) {
247729
247748
  if (source.pointCount > 3) {
247730
- if (!_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.isConvex(source.point))
247749
+ if (!_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.isConvex(source.point))
247731
247750
  return false;
247732
247751
  }
247733
247752
  }
@@ -247752,7 +247771,7 @@ class PolyfaceQuery {
247752
247771
  */
247753
247772
  static dihedralAngleSummary(source, ignoreBoundaries = false) {
247754
247773
  // more info can be found at geometry/internaldocs/Polyface.md
247755
- const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
247774
+ const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.IndexedEdgeMatcher();
247756
247775
  const visitor = source.createVisitor(1);
247757
247776
  visitor.reset();
247758
247777
  // find centroid normals of all facets
@@ -247760,7 +247779,7 @@ class PolyfaceQuery {
247760
247779
  let normalCounter = 0;
247761
247780
  while (visitor.moveToNextFacet()) {
247762
247781
  const numEdges = visitor.pointCount - 1;
247763
- const normal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.centroidAreaNormal(visitor.point);
247782
+ const normal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.centroidAreaNormal(visitor.point);
247764
247783
  if (normal === undefined)
247765
247784
  return -2;
247766
247785
  centroidNormal.push(normal);
@@ -247781,11 +247800,11 @@ class PolyfaceQuery {
247781
247800
  let numPositive = 0;
247782
247801
  let numPlanar = 0;
247783
247802
  let numNegative = 0;
247784
- const edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
247803
+ const edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
247785
247804
  for (const cluster of manifoldClusters) {
247786
247805
  const sideA = cluster[0];
247787
247806
  const sideB = cluster[1];
247788
- if (sideA instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge && sideB instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge
247807
+ if (sideA instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.SortableEdge && sideB instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.SortableEdge
247789
247808
  && source.data.point.vectorIndexIndex(sideA.vertexIndexA, sideA.vertexIndexB, edgeVector)) {
247790
247809
  const dihedralAngle = centroidNormal[sideA.facetIndex].direction.signedAngleTo(centroidNormal[sideB.facetIndex].direction, edgeVector);
247791
247810
  if (dihedralAngle.isAlmostZero)
@@ -247832,7 +247851,7 @@ class PolyfaceQuery {
247832
247851
  * * Any edge with 2 adjacent facets in the same direction triggers a `false` return.
247833
247852
  */
247834
247853
  static isPolyfaceManifold(source, allowSimpleBoundaries = false) {
247835
- const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
247854
+ const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.IndexedEdgeMatcher();
247836
247855
  const visitor = source.createVisitor(1);
247837
247856
  visitor.reset();
247838
247857
  while (visitor.moveToNextFacet()) {
@@ -247860,10 +247879,10 @@ class PolyfaceQuery {
247860
247879
  * @param includeNull true to announce edges with identical start and end vertex indices.
247861
247880
  */
247862
247881
  static announceBoundaryEdges(source, announceEdge, includeTypical = true, includeMismatch = true, includeNull = true) {
247863
- if (source === undefined)
247864
- return undefined;
247865
- const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
247866
- const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface ? source.createVisitor(1) : source;
247882
+ if (source === undefined || (!includeTypical && !includeMismatch && !includeNull))
247883
+ return;
247884
+ const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.IndexedEdgeMatcher();
247885
+ const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.createVisitor(1) : source;
247867
247886
  visitor.setNumWrap(1);
247868
247887
  visitor.reset();
247869
247888
  while (visitor.moveToNextFacet()) {
@@ -247873,29 +247892,18 @@ class PolyfaceQuery {
247873
247892
  }
247874
247893
  }
247875
247894
  const boundaryEdges = [];
247876
- const nullEdges = [];
247877
- const allOtherEdges = [];
247878
- edges.sortAndCollectClusters(undefined, boundaryEdges, nullEdges, allOtherEdges);
247879
- const badList = [];
247880
- if (includeTypical && boundaryEdges.length > 0)
247881
- badList.push(boundaryEdges);
247882
- if (includeNull && nullEdges.length > 0)
247883
- badList.push(nullEdges);
247884
- if (includeMismatch && allOtherEdges.length > 0)
247885
- badList.push(allOtherEdges);
247886
- if (badList.length === 0)
247887
- return undefined;
247895
+ edges.sortAndCollectClusters(undefined, includeTypical ? boundaryEdges : undefined, includeNull ? boundaryEdges : undefined, includeMismatch ? boundaryEdges : undefined);
247896
+ if (boundaryEdges.length === 0)
247897
+ return;
247888
247898
  const sourcePolyface = visitor.clientPolyface();
247889
- const pointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
247890
- const pointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
247891
- for (const list of badList) {
247892
- for (const e of list) {
247893
- const e1 = e instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge ? e : e[0];
247894
- const indexA = e1.vertexIndexA;
247895
- const indexB = e1.vertexIndexB;
247896
- if (sourcePolyface.data.getPoint(indexA, pointA) && sourcePolyface.data.getPoint(indexB, pointB))
247897
- announceEdge(pointA, pointB, indexA, indexB, e1.facetIndex);
247898
- }
247899
+ const pointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
247900
+ const pointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
247901
+ for (const e of boundaryEdges) {
247902
+ const e1 = e instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.SortableEdge ? e : e[0];
247903
+ const indexA = e1.vertexIndexA;
247904
+ const indexB = e1.vertexIndexB;
247905
+ if (sourcePolyface.data.getPoint(indexA, pointA) && sourcePolyface.data.getPoint(indexB, pointB))
247906
+ announceEdge(pointA, pointB, indexA, indexB, e1.facetIndex);
247899
247907
  }
247900
247908
  }
247901
247909
  /**
@@ -247907,9 +247915,9 @@ class PolyfaceQuery {
247907
247915
  * @param includeNull true to include edges with identical start and end vertex indices.
247908
247916
  */
247909
247917
  static boundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
247910
- const result = new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_5__.BagOfCurves();
247918
+ const result = new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_6__.BagOfCurves();
247911
247919
  const announceEdge = (pointA, pointB, _indexA, _indexB, _readIndex) => {
247912
- result.tryAddChild(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(pointA, pointB));
247920
+ result.tryAddChild(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(pointA, pointB));
247913
247921
  };
247914
247922
  PolyfaceQuery.announceBoundaryEdges(source, announceEdge, includeTypical, includeMismatch, includeNull);
247915
247923
  if (result.children.length === 0)
@@ -247920,13 +247928,13 @@ class PolyfaceQuery {
247920
247928
  * Collect boundary edges.
247921
247929
  * * Return the edges as the simplest collection of chains of line segments.
247922
247930
  * @param source polyface or visitor.
247923
- * @param includeTypical true to in include typical boundary edges with a single adjacent facet.
247931
+ * @param includeTypical true to include typical boundary edges with a single adjacent facet.
247924
247932
  * @param includeMismatch true to include edges with more than 2 adjacent facets.
247925
247933
  * @param includeNull true to include edges with identical start and end vertex indices.
247926
247934
  */
247927
247935
  static collectBoundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
247928
- const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_12__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
247929
- PolyfaceQuery.announceBoundaryEdges(source, (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(ptA, ptB)), includeTypical, includeMismatch, includeNull);
247936
+ const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_13__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance, _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance);
247937
+ PolyfaceQuery.announceBoundaryEdges(source, (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(ptA, ptB)), includeTypical, includeMismatch, includeNull);
247930
247938
  return collector.grabResult(true);
247931
247939
  }
247932
247940
  /**
@@ -247934,9 +247942,9 @@ class PolyfaceQuery {
247934
247942
  * @param polyface a mesh or a visitor assumed to have numWrap === 1.
247935
247943
  */
247936
247944
  static createIndexedEdges(polyface) {
247937
- if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
247945
+ if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
247938
247946
  return this.createIndexedEdges(polyface.createVisitor(1));
247939
- const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
247947
+ const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.IndexedEdgeMatcher();
247940
247948
  polyface.reset();
247941
247949
  while (polyface.moveToNextFacet()) {
247942
247950
  const numEdges = polyface.pointCount - 1;
@@ -247955,8 +247963,8 @@ class PolyfaceQuery {
247955
247963
  * @param vectorToEye normal of plane in which to compute silhouette edges.
247956
247964
  * @param sideAngle angular tolerance for perpendicularity test.
247957
247965
  */
247958
- static announceSilhouetteEdges(source, announce, vectorToEye, sideAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle()) {
247959
- if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
247966
+ static announceSilhouetteEdges(source, announce, vectorToEye, sideAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createSmallAngle()) {
247967
+ if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
247960
247968
  return this.announceSilhouetteEdges(source.createVisitor(1), announce, vectorToEye, sideAngle);
247961
247969
  const mesh = source.clientPolyface();
247962
247970
  if (undefined === mesh)
@@ -247966,9 +247974,9 @@ class PolyfaceQuery {
247966
247974
  const manifoldEdges = [];
247967
247975
  allEdges.sortAndCollectClusters(manifoldEdges);
247968
247976
  const sideAngleTol = sideAngle.radians < 0.0 ? -sideAngle.radians : sideAngle.radians;
247969
- const pointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
247970
- const pointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
247971
- const normal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
247977
+ const pointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
247978
+ const pointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
247979
+ const normal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
247972
247980
  const analyzeFace = (iFacet) => {
247973
247981
  if (!PolyfaceQuery.computeFacetUnitNormal(source, iFacet, normal))
247974
247982
  return { isSideFace: false, perpAngle: 0.0 };
@@ -248007,9 +248015,9 @@ class PolyfaceQuery {
248007
248015
  * @param vectorToEye normal of plane in which to compute silhouette edges.
248008
248016
  * @param sideAngle angular tolerance for perpendicularity test.
248009
248017
  */
248010
- static collectSilhouetteEdges(source, vectorToEye, sideAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle()) {
248011
- const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_12__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
248012
- PolyfaceQuery.announceSilhouetteEdges(source, (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(ptA, ptB)), vectorToEye, sideAngle);
248018
+ static collectSilhouetteEdges(source, vectorToEye, sideAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createSmallAngle()) {
248019
+ const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_13__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance, _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance);
248020
+ PolyfaceQuery.announceSilhouetteEdges(source, (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(ptA, ptB)), vectorToEye, sideAngle);
248013
248021
  return collector.grabResult(true);
248014
248022
  }
248015
248023
  /**
@@ -248018,7 +248026,7 @@ class PolyfaceQuery {
248018
248026
  * * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
248019
248027
  */
248020
248028
  static announceSweepLinestringToConvexPolyfaceXY(linestringPoints, polyface, announce) {
248021
- const context = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_13__.SweepLineStringToFacetContext.create(linestringPoints);
248029
+ const context = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_14__.SweepLineStringToFacetContext.create(linestringPoints);
248022
248030
  if (context) {
248023
248031
  const visitor = polyface.createVisitor(0);
248024
248032
  for (visitor.reset(); visitor.moveToNextFacet();) {
@@ -248060,7 +248068,7 @@ class PolyfaceQuery {
248060
248068
  * @internal
248061
248069
  */
248062
248070
  static async asyncAnnounceSweepLinestringToConvexPolyfaceXY(linestringPoints, polyface, announce) {
248063
- const context = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_13__.SweepLineStringToFacetContext.create(linestringPoints);
248071
+ const context = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_14__.SweepLineStringToFacetContext.create(linestringPoints);
248064
248072
  this.awaitBlockCount = 0;
248065
248073
  let workTotal = 0;
248066
248074
  if (context) {
@@ -248080,11 +248088,11 @@ class PolyfaceQuery {
248080
248088
  * * Return array of arrays of facet indices.
248081
248089
  */
248082
248090
  static partitionFacetIndicesByVertexConnectedComponent(polyface) {
248083
- if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
248091
+ if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface) {
248084
248092
  return this.partitionFacetIndicesByVertexConnectedComponent(polyface.createVisitor(0));
248085
248093
  }
248086
248094
  // The polyface is really a visitor
248087
- const context = new _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_14__.UnionFindContext(this.visitorClientPointCount(polyface));
248095
+ const context = new _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_15__.UnionFindContext(this.visitorClientPointCount(polyface));
248088
248096
  for (polyface.reset(); polyface.moveToNextFacet();) {
248089
248097
  const firstVertexIndexOnThisFacet = polyface.pointIndex[0];
248090
248098
  for (const vertexIndex of polyface.pointIndex)
@@ -248117,7 +248125,7 @@ class PolyfaceQuery {
248117
248125
  * * Return array of arrays of facet indices.
248118
248126
  */
248119
248127
  static partitionFacetIndicesByVisibilityVector(polyface, vectorToEye, sideAngleTolerance) {
248120
- if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
248128
+ if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface) {
248121
248129
  return this.partitionFacetIndicesByVisibilityVector(polyface.createVisitor(0), vectorToEye, sideAngleTolerance);
248122
248130
  }
248123
248131
  const facetsInComponent = [];
@@ -248129,7 +248137,7 @@ class PolyfaceQuery {
248129
248137
  const sideComponent = facetsInComponent[2];
248130
248138
  const radiansTol = Math.max(sideAngleTolerance.radians, 1.0e-8);
248131
248139
  for (polyface.reset(); polyface.moveToNextFacet();) {
248132
- const areaNormal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.areaNormalGo(polyface.point);
248140
+ const areaNormal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.areaNormalGo(polyface.point);
248133
248141
  const index = polyface.currentReadIndex();
248134
248142
  if (areaNormal) {
248135
248143
  const angle = areaNormal.angleFromPerpendicular(vectorToEye);
@@ -248156,76 +248164,92 @@ class PolyfaceQuery {
248156
248164
  * @param vectorToEye the vector to eye
248157
248165
  * @param sideAngleTolerance the tolerance of side angle
248158
248166
  */
248159
- static boundaryOfVisibleSubset(polyface, visibilitySelect, vectorToEye, sideAngleTolerance = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(1.0e-3)) {
248167
+ static boundaryOfVisibleSubset(polyface, visibilitySelect, vectorToEye, sideAngleTolerance = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(1.0e-3)) {
248160
248168
  const partitionedIndices = this.partitionFacetIndicesByVisibilityVector(polyface, vectorToEye, sideAngleTolerance);
248161
248169
  if (partitionedIndices[visibilitySelect].length === 0)
248162
248170
  return undefined;
248163
- const visitor = _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_15__.IndexedPolyfaceSubsetVisitor.createSubsetVisitor(polyface, partitionedIndices[visibilitySelect], 1);
248171
+ const visitor = _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_16__.IndexedPolyfaceSubsetVisitor.createSubsetVisitor(polyface, partitionedIndices[visibilitySelect], 1);
248164
248172
  return this.boundaryEdges(visitor, true, false, false);
248165
248173
  }
248166
248174
  /**
248167
248175
  * Search for edges with only 1 adjacent facet.
248168
- * * Chain them into loops.
248169
- * * Emit the loops to the announceLoop function.
248176
+ * * Accumulate them into chains.
248177
+ * * Emit the chains to the `announceChain` callback.
248170
248178
  */
248171
- static announceBoundaryChainsAsLineString3d(mesh, announceLoop) {
248172
- const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_12__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, 1000);
248173
- PolyfaceQuery.announceBoundaryEdges(mesh, (pointA, pointB, _indexA, _indexB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(pointA, pointB)), true, false, false);
248174
- collector.announceChainsAsLineString3d(announceLoop);
248179
+ static announceBoundaryChainsAsLineString3d(mesh, announceChain) {
248180
+ const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_13__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance); // no planarity tolerance needed
248181
+ PolyfaceQuery.announceBoundaryEdges(mesh, (pointA, pointB, _indexA, _indexB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(pointA, pointB)), true, false, false);
248182
+ collector.announceChainsAsLineString3d(announceChain);
248175
248183
  }
248176
248184
  /**
248177
248185
  * Return a mesh with
248178
- * * clusters of adjacent, coplanar facets merged into larger facets.
248179
- * * other facets included unchanged.
248186
+ * * clusters of adjacent, coplanar facets merged into larger (possibly non-convex) facets.
248187
+ * * other facets are unchanged.
248180
248188
  * @param mesh existing mesh or visitor.
248181
248189
  * @param maxSmoothEdgeAngle maximum dihedral angle across an edge between facets deemed coplanar. If undefined,
248182
248190
  * uses `Geometry.smallAngleRadians`.
248183
248191
  */
248184
248192
  static cloneWithMaximalPlanarFacets(mesh, maxSmoothEdgeAngle) {
248185
- if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
248193
+ if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
248186
248194
  return this.cloneWithMaximalPlanarFacets(mesh.createVisitor(0), maxSmoothEdgeAngle);
248187
248195
  const numFacets = PolyfaceQuery.visitorClientFacetCount(mesh);
248188
248196
  const smoothEdges = PolyfaceQuery.collectEdgesByDihedralAngle(mesh, maxSmoothEdgeAngle);
248189
248197
  const partitions = PolyfaceQuery.partitionFacetIndicesBySortableEdgeClusters(smoothEdges, numFacets);
248190
- const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
248198
+ const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_17__.PolyfaceBuilder.create();
248191
248199
  const visitor = mesh;
248192
248200
  const planarPartitions = [];
248201
+ const partitionNormals = []; // average normal in each nontrivial partition
248202
+ const normal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
248193
248203
  for (const partition of partitions) {
248194
248204
  if (partition.length === 1) {
248195
248205
  if (visitor.moveToReadIndex(partition[0]))
248196
248206
  builder.addFacetFromVisitor(visitor);
248197
248207
  }
248198
- else {
248199
- // This is a non-trivial set of contiguous coplanar facets
248208
+ else if (partition.length > 1) { // nontrivial set of contiguous coplanar facets
248209
+ const averageNormal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
248210
+ const point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero();
248211
+ if (visitor.moveToReadIndex(partition[0]))
248212
+ visitor.point.getPoint3dAtCheckedPointIndex(0, point0);
248213
+ for (const facetIndex of partition) {
248214
+ if (visitor.moveToReadIndex(facetIndex))
248215
+ if (_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.areaNormalGo(visitor.point, normal))
248216
+ averageNormal.addInPlace(normal);
248217
+ }
248218
+ partitionNormals.push(_geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_18__.Ray3d.createCapture(point0, averageNormal));
248200
248219
  planarPartitions.push(partition);
248201
248220
  }
248202
248221
  }
248203
248222
  const fragmentPolyfaces = PolyfaceQuery.clonePartitions(mesh, planarPartitions);
248223
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(planarPartitions.length === partitionNormals.length);
248224
+ (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(planarPartitions.length === fragmentPolyfaces.length);
248204
248225
  const gapTolerance = 1.0e-4;
248205
248226
  const planarityTolerance = 1.0e-4;
248206
- for (const fragment of fragmentPolyfaces) {
248227
+ const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_19__.Transform.createIdentity();
248228
+ const worldToLocal = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_19__.Transform.createIdentity();
248229
+ for (let i = 0; i < fragmentPolyfaces.length; ++i) {
248230
+ const fragment = fragmentPolyfaces[i];
248207
248231
  const edges = [];
248208
248232
  const edgeStrings = [];
248209
248233
  PolyfaceQuery.announceBoundaryEdges(fragment, (pointA, pointB, _indexA, _indexB) => {
248210
- edges.push(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(pointA, pointB));
248234
+ edges.push(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(pointA, pointB));
248211
248235
  edgeStrings.push([pointA.clone(), pointB.clone()]);
248212
- });
248213
- const chains = _curve_CurveOps__WEBPACK_IMPORTED_MODULE_17__.CurveOps.collectChains(edges, gapTolerance, planarityTolerance);
248236
+ }, true, false, false);
248237
+ const chains = _curve_CurveOps__WEBPACK_IMPORTED_MODULE_20__.CurveOps.collectChains(edges, gapTolerance, planarityTolerance);
248214
248238
  if (chains) {
248215
- const frameBuilder = new _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_18__.FrameBuilder();
248216
- frameBuilder.announce(chains);
248217
- const frame = frameBuilder.getValidatedFrame(false);
248218
- if (frame !== undefined) {
248219
- const inverseFrame = frame.inverse();
248220
- if (inverseFrame !== undefined) {
248221
- inverseFrame.multiplyPoint3dArrayArrayInPlace(edgeStrings);
248222
- const graph = _topology_Merging__WEBPACK_IMPORTED_MODULE_19__.HalfEdgeGraphMerge.formGraphFromChains(edgeStrings, true, _topology_Graph__WEBPACK_IMPORTED_MODULE_20__.HalfEdgeMask.BOUNDARY_EDGE);
248223
- if (graph) {
248224
- _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_21__.HalfEdgeGraphSearch.collectConnectedComponentsWithExteriorParityMasks(graph, new _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_21__.HalfEdgeMaskTester(_topology_Graph__WEBPACK_IMPORTED_MODULE_20__.HalfEdgeMask.BOUNDARY_EDGE), _topology_Graph__WEBPACK_IMPORTED_MODULE_20__.HalfEdgeMask.EXTERIOR);
248225
- // this.purgeNullFaces(HalfEdgeMask.EXTERIOR);
248226
- const polyface1 = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.graphToPolyface(graph);
248227
- builder.addIndexedPolyface(polyface1, false, frame);
248228
- }
248239
+ // avoid FrameBuilder: it can flip the normal of a nonconvex facet!
248240
+ partitionNormals[i].toRigidZFrame(localToWorld);
248241
+ if (localToWorld.inverse(worldToLocal)) {
248242
+ worldToLocal.multiplyPoint3dArrayArrayInPlace(edgeStrings);
248243
+ // Regularize adds bridge edges to holes, and adds other edges to aid triangulation.
248244
+ // But we aren't triangulating here. So if we don't have holes, we can skip regularization
248245
+ // to avoid splitting the loop.
248246
+ const regularize = !(chains instanceof _curve_Loop__WEBPACK_IMPORTED_MODULE_5__.Loop);
248247
+ const graph = _topology_Merging__WEBPACK_IMPORTED_MODULE_21__.HalfEdgeGraphMerge.formGraphFromChains(edgeStrings, regularize, _topology_Graph__WEBPACK_IMPORTED_MODULE_22__.HalfEdgeMask.BOUNDARY_EDGE);
248248
+ if (graph) {
248249
+ _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_23__.HalfEdgeGraphSearch.collectConnectedComponentsWithExteriorParityMasks(graph, new _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_23__.HalfEdgeMaskTester(_topology_Graph__WEBPACK_IMPORTED_MODULE_22__.HalfEdgeMask.BOUNDARY_EDGE), _topology_Graph__WEBPACK_IMPORTED_MODULE_22__.HalfEdgeMask.EXTERIOR);
248250
+ // this.purgeNullFaces(HalfEdgeMask.EXTERIOR);
248251
+ const polyface1 = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_17__.PolyfaceBuilder.graphToPolyface(graph);
248252
+ builder.addIndexedPolyface(polyface1, false, localToWorld);
248229
248253
  }
248230
248254
  }
248231
248255
  }
@@ -248248,9 +248272,9 @@ class PolyfaceQuery {
248248
248272
  * @param unfilledChains optional array to receive the points around holes that were not filled.
248249
248273
  */
248250
248274
  static fillSimpleHoles(mesh, options, unfilledChains) {
248251
- if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
248275
+ if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
248252
248276
  return this.fillSimpleHoles(mesh.createVisitor(0), options, unfilledChains);
248253
- const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
248277
+ const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_17__.PolyfaceBuilder.create();
248254
248278
  const chains = [];
248255
248279
  PolyfaceQuery.announceBoundaryChainsAsLineString3d(mesh, (ls) => { ls.reverseInPlace(); chains.push(ls); });
248256
248280
  for (const c of chains) {
@@ -248260,11 +248284,11 @@ class PolyfaceQuery {
248260
248284
  rejected = true;
248261
248285
  else if (options.maxEdgesAroundHole !== undefined && points.length > options.maxEdgesAroundHole)
248262
248286
  rejected = true;
248263
- else if (options.maxPerimeter !== undefined && _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_22__.Point3dArray.sumEdgeLengths(points, false) > options.maxPerimeter)
248287
+ else if (options.maxPerimeter !== undefined && _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_24__.Point3dArray.sumEdgeLengths(points, false) > options.maxPerimeter)
248264
248288
  rejected = true;
248265
- else if (options.upVector !== undefined && _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.sumTriangleAreasPerpendicularToUpVector(points, options.upVector) <= 0.0)
248289
+ else if (options.upVector !== undefined && _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.sumTriangleAreasPerpendicularToUpVector(points, options.upVector) <= 0.0)
248266
248290
  rejected = true;
248267
- if (!rejected && _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_23__.SpacePolygonTriangulation.triangulateSimplestSpaceLoop(points, (_loop, triangles) => {
248291
+ if (!rejected && _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_25__.SpacePolygonTriangulation.triangulateSimplestSpaceLoop(points, (_loop, triangles) => {
248268
248292
  for (const t of triangles)
248269
248293
  builder.addPolygon(t);
248270
248294
  })) {
@@ -248283,18 +248307,18 @@ class PolyfaceQuery {
248283
248307
  }
248284
248308
  /** Clone the facets in each partition to a separate polyface. */
248285
248309
  static clonePartitions(polyface, partitions) {
248286
- if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
248310
+ if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface) {
248287
248311
  return this.clonePartitions(polyface.createVisitor(0), partitions);
248288
248312
  }
248289
248313
  polyface.setNumWrap(0);
248290
248314
  const polyfaces = [];
248291
- const options = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_24__.StrokeOptions.createForFacets();
248315
+ const options = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_26__.StrokeOptions.createForFacets();
248292
248316
  options.needNormals = polyface.normal !== undefined;
248293
248317
  options.needParams = polyface.param !== undefined;
248294
248318
  options.needColors = polyface.color !== undefined;
248295
248319
  options.needTwoSided = polyface.twoSided;
248296
248320
  for (const partition of partitions) {
248297
- const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create(options);
248321
+ const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_17__.PolyfaceBuilder.create(options);
248298
248322
  polyface.reset();
248299
248323
  for (const facetIndex of partition) {
248300
248324
  polyface.moveToReadIndex(facetIndex);
@@ -248306,16 +248330,16 @@ class PolyfaceQuery {
248306
248330
  }
248307
248331
  /** Clone facets that pass a filter function. */
248308
248332
  static cloneFiltered(source, filter) {
248309
- if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
248333
+ if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface) {
248310
248334
  return this.cloneFiltered(source.createVisitor(0), filter);
248311
248335
  }
248312
248336
  source.setNumWrap(0);
248313
- const options = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_24__.StrokeOptions.createForFacets();
248337
+ const options = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_26__.StrokeOptions.createForFacets();
248314
248338
  options.needNormals = source.normal !== undefined;
248315
248339
  options.needParams = source.param !== undefined;
248316
248340
  options.needColors = source.color !== undefined;
248317
248341
  options.needTwoSided = source.twoSided;
248318
- const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create(options);
248342
+ const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_17__.PolyfaceBuilder.create(options);
248319
248343
  source.reset();
248320
248344
  for (; source.moveToNextFacet();) {
248321
248345
  if (filter(source))
@@ -248325,14 +248349,14 @@ class PolyfaceQuery {
248325
248349
  }
248326
248350
  /** Clone the facets with in-facet dangling edges removed. */
248327
248351
  static cloneWithDanglingEdgesRemoved(source) {
248328
- if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
248352
+ if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
248329
248353
  return this.cloneWithDanglingEdgesRemoved(source.createVisitor(0));
248330
- const options = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_24__.StrokeOptions.createForFacets();
248354
+ const options = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_26__.StrokeOptions.createForFacets();
248331
248355
  options.needNormals = source.normal !== undefined;
248332
248356
  options.needParams = source.param !== undefined;
248333
248357
  options.needColors = source.color !== undefined;
248334
248358
  options.needTwoSided = source.twoSided;
248335
- const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create(options);
248359
+ const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_17__.PolyfaceBuilder.create(options);
248336
248360
  // Finds an odd palindrome in data as indexed by indices.
248337
248361
  // An odd palindrome in a face loop corresponds to dangling edges in the face.
248338
248362
  // If one is found, indices is mutated to excise the palindrome (data is untouched).
@@ -248379,7 +248403,7 @@ class PolyfaceQuery {
248379
248403
  * * If `source` is a visitor, this is an upper bound on the number of addressed mesh vertices.
248380
248404
  */
248381
248405
  static visitorClientPointCount(source) {
248382
- if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
248406
+ if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
248383
248407
  return source.data.point.length;
248384
248408
  const polyface = source.clientPolyface();
248385
248409
  if (polyface !== undefined)
@@ -248400,7 +248424,7 @@ class PolyfaceQuery {
248400
248424
  * * If `source` is a visitor, this is the number of facets it can visit.
248401
248425
  */
248402
248426
  static visitorClientFacetCount(source) {
248403
- if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
248427
+ if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface) {
248404
248428
  if (source.facetCount !== undefined)
248405
248429
  return source.facetCount;
248406
248430
  source = source.createVisitor(0);
@@ -248426,9 +248450,9 @@ class PolyfaceQuery {
248426
248450
  * @return collection of facet index arrays, one array per connected component.
248427
248451
  */
248428
248452
  static partitionFacetIndicesBySortableEdgeClusters(edgeClusters, numFacets) {
248429
- const context = new _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_14__.UnionFindContext(numFacets);
248453
+ const context = new _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_15__.UnionFindContext(numFacets);
248430
248454
  for (const cluster of edgeClusters) {
248431
- if (cluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge) {
248455
+ if (cluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.SortableEdge) {
248432
248456
  // this edge does not connect anywhere. Ignore it!!
248433
248457
  }
248434
248458
  else {
@@ -248462,11 +248486,11 @@ class PolyfaceQuery {
248462
248486
  * @return collection of facet index arrays, one per connected component.
248463
248487
  */
248464
248488
  static partitionFacetIndicesByEdgeConnectedComponent(polyface, stopAtVisibleEdges = false) {
248465
- if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
248489
+ if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface) {
248466
248490
  return this.partitionFacetIndicesByEdgeConnectedComponent(polyface.createVisitor(0), stopAtVisibleEdges);
248467
248491
  }
248468
248492
  polyface.setNumWrap(1);
248469
- const matcher = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
248493
+ const matcher = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.IndexedEdgeMatcher();
248470
248494
  polyface.reset();
248471
248495
  let numFacets = 0;
248472
248496
  while (polyface.moveToNextFacet()) {
@@ -248490,7 +248514,7 @@ class PolyfaceQuery {
248490
248514
  * * Input facets are ASSUMED to be convex and planar, and not overlap in the z direction.
248491
248515
  */
248492
248516
  static sweepLineStringToFacetsXYReturnSweptFacets(lineStringPoints, polyface) {
248493
- const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
248517
+ const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_17__.PolyfaceBuilder.create();
248494
248518
  this.announceSweepLinestringToConvexPolyfaceXY(lineStringPoints, polyface, (_linestring, _segmentIndex, _polyface, _facetIndex, points) => {
248495
248519
  if (points.length === 4)
248496
248520
  builder.addQuadFacet(points);
@@ -248514,26 +248538,26 @@ class PolyfaceQuery {
248514
248538
  let result = [];
248515
248539
  // setup default options
248516
248540
  if (options === undefined)
248517
- options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallAngleRadians), // tight geometry tolerance for vertical side facets
248541
+ options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallAngleRadians), // tight geometry tolerance for vertical side facets
248518
248542
  true, true, true, true);
248519
248543
  let chainContext;
248520
248544
  if (options.assembleChains)
248521
- chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_25__.ChainMergeContext.create();
248522
- const context = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_13__.ClipSweptLineStringContext.create(linestringPoints, options.vectorToEye);
248545
+ chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_27__.ChainMergeContext.create();
248546
+ const context = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_14__.ClipSweptLineStringContext.create(linestringPoints, options.vectorToEye);
248523
248547
  if (context) {
248524
248548
  let visitor;
248525
- if (polyfaceOrVisitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
248549
+ if (polyfaceOrVisitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
248526
248550
  visitor = polyfaceOrVisitor.createVisitor(0);
248527
248551
  else
248528
248552
  visitor = polyfaceOrVisitor;
248529
- const workNormal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.createZero();
248553
+ const workNormal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
248530
248554
  for (visitor.reset(); visitor.moveToNextFacet();) {
248531
- if (options.collectFromThisFacetNormal(_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.areaNormalGo(visitor.point, workNormal))) {
248555
+ if (options.collectFromThisFacetNormal(_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.areaNormalGo(visitor.point, workNormal))) {
248532
248556
  context.processPolygon(visitor.point.getArray(), (pointA, pointB) => {
248533
248557
  if (chainContext !== undefined)
248534
248558
  chainContext.addSegment(pointA, pointB);
248535
248559
  else
248536
- result.push(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(pointA, pointB));
248560
+ result.push(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(pointA, pointB));
248537
248561
  });
248538
248562
  }
248539
248563
  }
@@ -248561,25 +248585,25 @@ class PolyfaceQuery {
248561
248585
  * @returns the collected line strings.
248562
248586
  */
248563
248587
  static sweepLineStringToFacetsXY(lineStringPoints, polyfaceOrVisitor, searchByReadIndex) {
248564
- const chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_25__.ChainMergeContext.create();
248565
- const sweepVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create(0, 0, 1);
248566
- const searchRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_26__.Range3d.create();
248588
+ const chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_27__.ChainMergeContext.create();
248589
+ const sweepVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(0, 0, 1);
248590
+ const searchRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_28__.Range3d.create();
248567
248591
  let visitor;
248568
- if (polyfaceOrVisitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
248592
+ if (polyfaceOrVisitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
248569
248593
  visitor = polyfaceOrVisitor.createVisitor(0);
248570
248594
  else
248571
248595
  visitor = polyfaceOrVisitor;
248572
248596
  let lineStringSource;
248573
248597
  if (Array.isArray(lineStringPoints))
248574
- lineStringSource = new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_27__.Point3dArrayCarrier(lineStringPoints);
248598
+ lineStringSource = new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_29__.Point3dArrayCarrier(lineStringPoints);
248575
248599
  else
248576
248600
  lineStringSource = lineStringPoints;
248577
248601
  for (let i = 1; i < lineStringSource.length; i++) {
248578
248602
  const point0 = lineStringSource.getPoint3dAtUncheckedPointIndex(i - 1);
248579
248603
  const point1 = lineStringSource.getPoint3dAtUncheckedPointIndex(i);
248580
- const edgeClipper = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_13__.EdgeClipData.createPointPointSweep(point0, point1, sweepVector);
248604
+ const edgeClipper = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_14__.EdgeClipData.createPointPointSweep(point0, point1, sweepVector);
248581
248605
  if (edgeClipper !== undefined) {
248582
- _geometry3d_Range__WEBPACK_IMPORTED_MODULE_26__.Range3d.createNull(searchRange);
248606
+ _geometry3d_Range__WEBPACK_IMPORTED_MODULE_28__.Range3d.createNull(searchRange);
248583
248607
  searchRange.extendPoint(point0);
248584
248608
  searchRange.extendPoint(point1);
248585
248609
  searchByReadIndex.searchRange2d(searchRange, (_facetRange, readIndex) => {
@@ -248600,7 +248624,7 @@ class PolyfaceQuery {
248600
248624
  * @deprecated in 4.x. Use [[PolyfaceQuery.sweepLineStringToFacets]] to get further options.
248601
248625
  */
248602
248626
  static sweepLinestringToFacetsXYReturnLines(linestringPoints, polyface) {
248603
- const options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle(), false, true, true, true);
248627
+ const options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createSmallAngle(), false, true, true, true);
248604
248628
  const result = PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface, options);
248605
248629
  return result;
248606
248630
  }
@@ -248612,7 +248636,7 @@ class PolyfaceQuery {
248612
248636
  * @deprecated in 4.x. Use [[PolyfaceQuery.sweepLineStringToFacets]] to get further options.
248613
248637
  */
248614
248638
  static sweepLinestringToFacetsXYReturnChains(linestringPoints, polyface) {
248615
- const options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle(), true, true, true, true);
248639
+ const options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createSmallAngle(), true, true, true, true);
248616
248640
  const result = PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface, options);
248617
248641
  return result;
248618
248642
  }
@@ -248626,7 +248650,7 @@ class PolyfaceQuery {
248626
248650
  * * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
248627
248651
  */
248628
248652
  static async asyncSweepLinestringToFacetsXYReturnChains(linestringPoints, polyface) {
248629
- const chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_25__.ChainMergeContext.create();
248653
+ const chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_27__.ChainMergeContext.create();
248630
248654
  await Promise.resolve(this.asyncAnnounceSweepLinestringToConvexPolyfaceXY(linestringPoints, polyface, (_linestring, _segmentIndex, _polyface, _facetIndex, points, indexA, indexB) => {
248631
248655
  chainContext.addSegment(points[indexA], points[indexB]);
248632
248656
  }));
@@ -248639,10 +248663,10 @@ class PolyfaceQuery {
248639
248663
  * * Return statistical summary of x,y,z ranges.
248640
248664
  */
248641
248665
  static collectRangeLengthData(polyface) {
248642
- if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
248666
+ if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface) {
248643
248667
  return this.collectRangeLengthData(polyface.createVisitor(0));
248644
248668
  }
248645
- const rangeData = new _RangeLengthData__WEBPACK_IMPORTED_MODULE_28__.RangeLengthData();
248669
+ const rangeData = new _RangeLengthData__WEBPACK_IMPORTED_MODULE_30__.RangeLengthData();
248646
248670
  // polyface is a visitor
248647
248671
  for (polyface.reset(); polyface.moveToNextFacet();)
248648
248672
  rangeData.accumulateGrowableXYZArrayRange(polyface.point);
@@ -248655,13 +248679,13 @@ class PolyfaceQuery {
248655
248679
  static cloneWithTVertexFixup(polyface) {
248656
248680
  const oldFacetVisitor = polyface.createVisitor(1); // this is to visit the existing facets
248657
248681
  const newFacetVisitor = polyface.createVisitor(0); // this is to build the new facets
248658
- const rangeSearcher = _multiclip_XYPointBuckets__WEBPACK_IMPORTED_MODULE_29__.XYPointBuckets.create(polyface.data.point, 30);
248659
- const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
248660
- const edgeRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_26__.Range3d.createNull();
248661
- const point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
248662
- const point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
248663
- const spacePoint = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
248664
- const segment = _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(point0, point1);
248682
+ const rangeSearcher = _multiclip_XYPointBuckets__WEBPACK_IMPORTED_MODULE_31__.XYPointBuckets.create(polyface.data.point, 30);
248683
+ const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_17__.PolyfaceBuilder.create();
248684
+ const edgeRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_28__.Range3d.createNull();
248685
+ const point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
248686
+ const point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
248687
+ const spacePoint = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
248688
+ const segment = _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(point0, point1);
248665
248689
  for (oldFacetVisitor.reset(); oldFacetVisitor.moveToNextFacet();) {
248666
248690
  newFacetVisitor.clearArrays();
248667
248691
  for (let i = 0; i + 1 < oldFacetVisitor.point.length; i++) {
@@ -248670,11 +248694,11 @@ class PolyfaceQuery {
248670
248694
  oldFacetVisitor.point.getPoint3dAtUncheckedPointIndex(i + 1, point1);
248671
248695
  newFacetVisitor.pushDataFrom(oldFacetVisitor, i);
248672
248696
  edgeRange.setNull();
248673
- _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(point0, point1, segment);
248697
+ _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(point0, point1, segment);
248674
248698
  let detailArray;
248675
248699
  edgeRange.extend(point0);
248676
248700
  edgeRange.extend(point1);
248677
- edgeRange.ensureMinLengths(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance); // add some slop in case segment is axis-aligned
248701
+ edgeRange.ensureMinLengths(_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance); // add some slop in case segment is axis-aligned
248678
248702
  rangeSearcher.announcePointsInRange(edgeRange, (index, _x, _y, _z) => {
248679
248703
  // x,y,z has x,y within the range of the search; test for exact on (in full 3d)
248680
248704
  polyface.data.point.getPoint3dAtUncheckedPointIndex(index, spacePoint);
@@ -248789,7 +248813,7 @@ class PolyfaceQuery {
248789
248813
  * @param clusterSelector indicates whether to copy 0, 1, or all facets in each cluster of duplicate facets.
248790
248814
  */
248791
248815
  static cloneByFacetDuplication(source, includeSingletons, clusterSelector) {
248792
- const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
248816
+ const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_17__.PolyfaceBuilder.create();
248793
248817
  const visitor = source.createVisitor(0);
248794
248818
  this.announceDuplicateFacetIndices(source, (clusterFacetIndices) => {
248795
248819
  let numToSelect = 0;
@@ -248816,9 +248840,9 @@ class PolyfaceQuery {
248816
248840
  static cloneWithColinearEdgeFixup(polyface) {
248817
248841
  const oldFacetVisitor = polyface.createVisitor(2); // this is to visit the existing facets
248818
248842
  const newFacetVisitor = polyface.createVisitor(0); // this is to build the new facets
248819
- const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
248820
- const vector01 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
248821
- const vector12 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
248843
+ const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_17__.PolyfaceBuilder.create();
248844
+ const vector01 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
248845
+ const vector12 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
248822
248846
  const numPoint = polyface.data.point.length;
248823
248847
  const pointState = new Int32Array(numPoint);
248824
248848
  // FIRST PASS: in each sector of each facet, determine if the sector has colinear incoming and outgoing vectors.
@@ -248865,7 +248889,7 @@ class PolyfaceQuery {
248865
248889
  */
248866
248890
  static setEdgeVisibility(polyface, clusters, value) {
248867
248891
  for (const cluster of clusters) {
248868
- if (cluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge) {
248892
+ if (cluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.SortableEdge) {
248869
248893
  this.setSingleEdgeVisibility(polyface, cluster.facetIndex, cluster.vertexIndexA, value);
248870
248894
  }
248871
248895
  else if (Array.isArray(cluster)) {
@@ -248913,17 +248937,17 @@ class PolyfaceQuery {
248913
248937
  * @param sharpEdges true to reverse the angle threshold test and return sharp edges; otherwise return smooth edges (default).
248914
248938
  */
248915
248939
  static collectEdgesByDihedralAngle(mesh, maxSmoothEdgeAngle, sharpEdges = false) {
248916
- if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
248940
+ if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
248917
248941
  return this.collectEdgesByDihedralAngle(mesh.createVisitor(1), maxSmoothEdgeAngle, sharpEdges);
248918
248942
  mesh.setNumWrap(1);
248919
248943
  const allEdges = this.createIndexedEdges(mesh);
248920
248944
  const manifoldEdges = [];
248921
248945
  allEdges.sortAndCollectClusters(manifoldEdges);
248922
248946
  if (undefined === maxSmoothEdgeAngle || maxSmoothEdgeAngle.radians < 0)
248923
- maxSmoothEdgeAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallAngleRadians);
248947
+ maxSmoothEdgeAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallAngleRadians);
248924
248948
  const outEdges = [];
248925
- const normal0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
248926
- const normal1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
248949
+ const normal0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
248950
+ const normal1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
248927
248951
  for (const pair of manifoldEdges) {
248928
248952
  if (Array.isArray(pair) && pair.length === 2) {
248929
248953
  const e0 = pair[0];
@@ -248962,8 +248986,8 @@ class PolyfaceQuery {
248962
248986
  this.markAllEdgeVisibility(mesh, false);
248963
248987
  this.setEdgeVisibility(mesh, boundaryEdges, true);
248964
248988
  if (sharpEdgeAngle !== undefined) {
248965
- const normal0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
248966
- const normal1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
248989
+ const normal0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
248990
+ const normal1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
248967
248991
  for (const pair of pairedEdges) {
248968
248992
  if (Array.isArray(pair) && pair.length === 2) {
248969
248993
  const e0 = pair[0];
@@ -248986,9 +249010,9 @@ class PolyfaceQuery {
248986
249010
  */
248987
249011
  static computeFacetUnitNormal(visitor, facetIndex, result) {
248988
249012
  if (!result)
248989
- result = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
249013
+ result = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
248990
249014
  if (visitor.moveToReadIndex(facetIndex)) {
248991
- if (_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.unitNormal(visitor.point, result))
249015
+ if (_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.unitNormal(visitor.point, result))
248992
249016
  return result;
248993
249017
  }
248994
249018
  return undefined;
@@ -249009,13 +249033,13 @@ class PolyfaceQuery {
249009
249033
  * @internal
249010
249034
  */
249011
249035
  static convertToHalfEdgeGraph(mesh) {
249012
- const builder = new _topology_HalfEdgeGraphFromIndexedLoopsContext__WEBPACK_IMPORTED_MODULE_30__.HalfEdgeGraphFromIndexedLoopsContext();
249036
+ const builder = new _topology_HalfEdgeGraphFromIndexedLoopsContext__WEBPACK_IMPORTED_MODULE_32__.HalfEdgeGraphFromIndexedLoopsContext();
249013
249037
  const visitor = mesh.createVisitor(0);
249014
249038
  for (visitor.reset(); visitor.moveToNextFacet();) {
249015
249039
  builder.insertLoop(visitor.pointIndex);
249016
249040
  }
249017
249041
  const graph = builder.graph;
249018
- const xyz = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
249042
+ const xyz = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
249019
249043
  graph.announceNodes((_graph, halfEdge) => {
249020
249044
  const vertexIndex = halfEdge.i;
249021
249045
  mesh.data.getPoint(vertexIndex, xyz);
@@ -249026,11 +249050,11 @@ class PolyfaceQuery {
249026
249050
  }
249027
249051
  /** Examine adjacent facet orientations throughout the mesh. If possible, reverse a subset to achieve proper pairing. */
249028
249052
  static reorientVertexOrderAroundFacetsForConsistentOrientation(mesh) {
249029
- return _FacetOrientation__WEBPACK_IMPORTED_MODULE_31__.FacetOrientationFixup.doFixup(mesh);
249053
+ return _FacetOrientation__WEBPACK_IMPORTED_MODULE_33__.FacetOrientationFixup.doFixup(mesh);
249030
249054
  }
249031
249055
  /** Set up indexed normals with one normal in the plane of each facet of the mesh. */
249032
249056
  static buildPerFaceNormals(polyface) {
249033
- _multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_32__.BuildAverageNormalsContext.buildPerFaceNormals(polyface);
249057
+ _multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_34__.BuildAverageNormalsContext.buildPerFaceNormals(polyface);
249034
249058
  }
249035
249059
  /**
249036
249060
  * * At each vertex of the mesh:
@@ -249043,8 +249067,8 @@ class PolyfaceQuery {
249043
249067
  * @param polyface polyface to update.
249044
249068
  * @param toleranceAngle averaging is done between normals up to this angle.
249045
249069
  */
249046
- static buildAverageNormals(polyface, toleranceAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(31.0)) {
249047
- _multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_32__.BuildAverageNormalsContext.buildFastAverageNormals(polyface, toleranceAngle);
249070
+ static buildAverageNormals(polyface, toleranceAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(31.0)) {
249071
+ _multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_34__.BuildAverageNormalsContext.buildFastAverageNormals(polyface, toleranceAngle);
249048
249072
  }
249049
249073
  /**
249050
249074
  * Offset the faces of the mesh.
@@ -249054,9 +249078,9 @@ class PolyfaceQuery {
249054
249078
  * @returns shifted mesh.
249055
249079
  */
249056
249080
  static cloneOffset(source, signedOffsetDistance, offsetOptions = OffsetMeshOptions.create()) {
249057
- const strokeOptions = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_24__.StrokeOptions.createForFacets();
249058
- const offsetBuilder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create(strokeOptions);
249059
- _multiclip_OffsetMeshContext__WEBPACK_IMPORTED_MODULE_33__.OffsetMeshContext.buildOffsetMeshWithEdgeChamfers(source, offsetBuilder, signedOffsetDistance, offsetOptions);
249081
+ const strokeOptions = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_26__.StrokeOptions.createForFacets();
249082
+ const offsetBuilder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_17__.PolyfaceBuilder.create(strokeOptions);
249083
+ _multiclip_OffsetMeshContext__WEBPACK_IMPORTED_MODULE_35__.OffsetMeshContext.buildOffsetMeshWithEdgeChamfers(source, offsetBuilder, signedOffsetDistance, offsetOptions);
249060
249084
  return offsetBuilder.claimPolyface();
249061
249085
  }
249062
249086
  /**
@@ -249078,7 +249102,7 @@ class PolyfaceQuery {
249078
249102
  * @see PolygonOps.intersectRay3d
249079
249103
  */
249080
249104
  static intersectRay3d(visitor, ray, options) {
249081
- if (visitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
249105
+ if (visitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
249082
249106
  return PolyfaceQuery.intersectRay3d(visitor.createVisitor(0), ray, options);
249083
249107
  let detail;
249084
249108
  visitor.setNumWrap(0);
@@ -249086,17 +249110,17 @@ class PolyfaceQuery {
249086
249110
  const numEdges = visitor.pointCount; // #vertices = #edges since numWrap is zero
249087
249111
  const vertices = visitor.point;
249088
249112
  if (3 === numEdges) {
249089
- const tri = this._workTriangle = _geometry3d_BarycentricTriangle__WEBPACK_IMPORTED_MODULE_34__.BarycentricTriangle.create(vertices.getPoint3dAtUncheckedPointIndex(0), vertices.getPoint3dAtUncheckedPointIndex(1), vertices.getPoint3dAtUncheckedPointIndex(2), this._workTriangle);
249113
+ const tri = this._workTriangle = _geometry3d_BarycentricTriangle__WEBPACK_IMPORTED_MODULE_36__.BarycentricTriangle.create(vertices.getPoint3dAtUncheckedPointIndex(0), vertices.getPoint3dAtUncheckedPointIndex(1), vertices.getPoint3dAtUncheckedPointIndex(2), this._workTriangle);
249090
249114
  const detail3 = this._workTriDetail = tri.intersectRay3d(ray, this._workTriDetail);
249091
249115
  tri.snapLocationToEdge(detail3, options?.distanceTolerance, options?.parameterTolerance);
249092
- detail = this._workFacetDetail3 = _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_35__.TriangularFacetLocationDetail.create(visitor.currentReadIndex(), detail3, this._workFacetDetail3);
249116
+ detail = this._workFacetDetail3 = _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_37__.TriangularFacetLocationDetail.create(visitor.currentReadIndex(), detail3, this._workFacetDetail3);
249093
249117
  }
249094
249118
  else {
249095
- const detailN = this._workPolyDetail = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.intersectRay3d(vertices, ray, options?.distanceTolerance, this._workPolyDetail);
249096
- if (_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.isConvex(vertices))
249097
- detail = this._workFacetDetailC = _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_35__.ConvexFacetLocationDetail.create(visitor.currentReadIndex(), numEdges, detailN, this._workFacetDetailC);
249119
+ const detailN = this._workPolyDetail = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.intersectRay3d(vertices, ray, options?.distanceTolerance, this._workPolyDetail);
249120
+ if (_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.isConvex(vertices))
249121
+ detail = this._workFacetDetailC = _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_37__.ConvexFacetLocationDetail.create(visitor.currentReadIndex(), numEdges, detailN, this._workFacetDetailC);
249098
249122
  else
249099
- detail = this._workFacetDetailNC = _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_35__.NonConvexFacetLocationDetail.create(visitor.currentReadIndex(), numEdges, detailN, this._workFacetDetailNC);
249123
+ detail = this._workFacetDetailNC = _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_37__.NonConvexFacetLocationDetail.create(visitor.currentReadIndex(), numEdges, detailN, this._workFacetDetailNC);
249100
249124
  }
249101
249125
  if (detail.isInsideOrOn) { // set optional caches, process the intersection
249102
249126
  if (options?.needNormal && visitor.normal)
@@ -266222,10 +266246,6 @@ class SweepContour {
266222
266246
  static createForPolygon(points, defaultNormal) {
266223
266247
  const localToWorld = _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_3__.FrameBuilder.createRightHandedFrame(defaultNormal, points);
266224
266248
  if (localToWorld) {
266225
- if (defaultNormal !== undefined) {
266226
- if (localToWorld.matrix.dotColumnZ(defaultNormal))
266227
- localToWorld.matrix.scaleColumnsInPlace(1.0, -1.0, -1.0);
266228
- }
266229
266249
  const linestrings = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_4__.LineString3d.createArrayOfLineString3d(points);
266230
266250
  const loops = [];
266231
266251
  for (const ls of linestrings) {
@@ -271340,8 +271360,8 @@ class HalfEdgeGraphMerge {
271340
271360
  }
271341
271361
  /**
271342
271362
  * * Input is random linestrings, not necessarily loops
271343
- * * Graph gets full splitEdges, regularize, and triangulate.
271344
- * @returns triangulated graph, or undefined if bad data.
271363
+ * * Graph gets full splitEdges, regularize (optional), and triangulate.
271364
+ * @returns graph, or undefined if bad data.
271345
271365
  */
271346
271366
  static formGraphFromChains(chains, regularize = true, mask = _Graph__WEBPACK_IMPORTED_MODULE_3__.HalfEdgeMask.PRIMARY_EDGE) {
271347
271367
  if (chains.length < 1)
@@ -294130,7 +294150,7 @@ class TestContext {
294130
294150
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
294131
294151
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
294132
294152
  await core_frontend_1.NoRenderApp.startup({
294133
- applicationVersion: "4.9.0-dev.19",
294153
+ applicationVersion: "4.9.0-dev.20",
294134
294154
  applicationId: this.settings.gprid,
294135
294155
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
294136
294156
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -318793,7 +318813,7 @@ function __disposeResources(env) {
318793
318813
  /***/ ((module) => {
318794
318814
 
318795
318815
  "use strict";
318796
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.9.0-dev.19","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.9.0-dev.19","@itwin/core-bentley":"workspace:^4.9.0-dev.19","@itwin/core-common":"workspace:^4.9.0-dev.19","@itwin/core-geometry":"workspace:^4.9.0-dev.19","@itwin/core-orbitgt":"workspace:^4.9.0-dev.19","@itwin/core-quantity":"workspace:^4.9.0-dev.19"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"^4.0.2","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.56.0","glob":"^10.3.12","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.3.3","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.2.5","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","meshoptimizer":"~0.20.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
318816
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.9.0-dev.20","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.9.0-dev.20","@itwin/core-bentley":"workspace:^4.9.0-dev.20","@itwin/core-common":"workspace:^4.9.0-dev.20","@itwin/core-geometry":"workspace:^4.9.0-dev.20","@itwin/core-orbitgt":"workspace:^4.9.0-dev.20","@itwin/core-quantity":"workspace:^4.9.0-dev.20"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"^4.0.2","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.56.0","glob":"^10.3.12","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.3.3","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.2.5","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","meshoptimizer":"~0.20.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
318797
318817
 
318798
318818
  /***/ }),
318799
318819