@itwin/rpcinterface-full-stack-tests 5.1.0-dev.17 → 5.1.0-dev.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/dist/_bea9.bundled-tests.js.map +1 -1
- package/lib/dist/bundled-tests.js +1148 -818
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_cross-fetch_4_0_0_node_modules_cross-fetch_dist_browser-24291b.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_1_6_node_modules_loaders_gl_draco_di-0642a6.bundled-tests.js.map +1 -1
- package/package.json +13 -13
|
@@ -204587,25 +204587,48 @@ class InteractiveTool extends Tool {
|
|
|
204587
204587
|
return foundProperty;
|
|
204588
204588
|
throw new Error(`property not found: ${propertyName}`);
|
|
204589
204589
|
}
|
|
204590
|
-
/** Override to return the property that is
|
|
204590
|
+
/** Override to return the property that is locked by the supplied property if it is a lock property.
|
|
204591
|
+
* Used to enable/disable the returned property according to the current lock state.
|
|
204592
|
+
* @note Only applicable when [[getToolSettingLockProperty]] is not being used automatically enable the lock on a change of value.
|
|
204591
204593
|
* @see [[changeToolSettingPropertyValue]]
|
|
204592
204594
|
* @public
|
|
204593
204595
|
*/
|
|
204594
204596
|
getToolSettingPropertyLocked(_property) {
|
|
204595
204597
|
return undefined;
|
|
204596
204598
|
}
|
|
204599
|
+
/** Override to return the lock property associated with the supplied non-lock property.
|
|
204600
|
+
* Used to enable the lock property after the value of the supplied property is changed.
|
|
204601
|
+
* @see [[changeToolSettingPropertyValue]]
|
|
204602
|
+
* @beta
|
|
204603
|
+
*/
|
|
204604
|
+
getToolSettingLockProperty(_property) {
|
|
204605
|
+
return undefined;
|
|
204606
|
+
}
|
|
204597
204607
|
/** Helper method for responding to a tool setting property value change by updating saved settings.
|
|
204598
204608
|
* @see [[applyToolSettingPropertyChange]]
|
|
204599
204609
|
* @see [[getToolSettingPropertyLocked]] to return the corresponding locked property, if any.
|
|
204610
|
+
* @see [[getToolSettingLockProperty]] to return the corresponding property's lock property, if any.
|
|
204600
204611
|
* @public
|
|
204601
204612
|
*/
|
|
204602
204613
|
changeToolSettingPropertyValue(syncItem) {
|
|
204603
204614
|
const property = this.getToolSettingPropertyByName(syncItem.propertyName);
|
|
204604
204615
|
if (!this.saveToolSettingPropertyValue(property, syncItem.value))
|
|
204605
204616
|
return false;
|
|
204606
|
-
|
|
204607
|
-
|
|
204608
|
-
|
|
204617
|
+
// Either enable lock when corresponding property value changes, or enable/disable property according to value of lock...
|
|
204618
|
+
const lockProperty = this.getToolSettingLockProperty(property);
|
|
204619
|
+
if (undefined !== lockProperty) {
|
|
204620
|
+
if (!lockProperty.value) {
|
|
204621
|
+
this.saveToolSettingPropertyValue(lockProperty, { value: true });
|
|
204622
|
+
this.syncToolSettingPropertyValue(lockProperty);
|
|
204623
|
+
}
|
|
204624
|
+
}
|
|
204625
|
+
else {
|
|
204626
|
+
const propertyToLock = this.getToolSettingPropertyLocked(property);
|
|
204627
|
+
if (undefined !== propertyToLock) {
|
|
204628
|
+
if (undefined === this.getToolSettingLockProperty(propertyToLock))
|
|
204629
|
+
this.syncToolSettingPropertyValue(propertyToLock, !property.value);
|
|
204630
|
+
}
|
|
204631
|
+
}
|
|
204609
204632
|
return true;
|
|
204610
204633
|
}
|
|
204611
204634
|
/** Helper method to establish initial values for tool setting properties from saved settings.
|
|
@@ -210679,7 +210702,7 @@ class SetupCameraTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_17__.Primi
|
|
|
210679
210702
|
_cameraHeightProperty;
|
|
210680
210703
|
get cameraHeightProperty() {
|
|
210681
210704
|
if (!this._cameraHeightProperty)
|
|
210682
|
-
this._cameraHeightProperty = new _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_3__.DialogProperty(new _properties_LengthDescription__WEBPACK_IMPORTED_MODULE_8__.LengthDescription("cameraHeight", ViewTool.translate("SetupCamera.Labels.CameraHeight")), 0.0
|
|
210705
|
+
this._cameraHeightProperty = new _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_3__.DialogProperty(new _properties_LengthDescription__WEBPACK_IMPORTED_MODULE_8__.LengthDescription("cameraHeight", ViewTool.translate("SetupCamera.Labels.CameraHeight")), 0.0);
|
|
210683
210706
|
return this._cameraHeightProperty;
|
|
210684
210707
|
}
|
|
210685
210708
|
get cameraHeight() { return this.cameraHeightProperty.value; }
|
|
@@ -210695,16 +210718,16 @@ class SetupCameraTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_17__.Primi
|
|
|
210695
210718
|
_targetHeightProperty;
|
|
210696
210719
|
get targetHeightProperty() {
|
|
210697
210720
|
if (!this._targetHeightProperty)
|
|
210698
|
-
this._targetHeightProperty = new _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_3__.DialogProperty(new _properties_LengthDescription__WEBPACK_IMPORTED_MODULE_8__.LengthDescription("targetHeight", ViewTool.translate("SetupCamera.Labels.TargetHeight")), 0.0
|
|
210721
|
+
this._targetHeightProperty = new _itwin_appui_abstract__WEBPACK_IMPORTED_MODULE_3__.DialogProperty(new _properties_LengthDescription__WEBPACK_IMPORTED_MODULE_8__.LengthDescription("targetHeight", ViewTool.translate("SetupCamera.Labels.TargetHeight")), 0.0);
|
|
210699
210722
|
return this._targetHeightProperty;
|
|
210700
210723
|
}
|
|
210701
210724
|
get targetHeight() { return this.targetHeightProperty.value; }
|
|
210702
210725
|
set targetHeight(value) { this.targetHeightProperty.value = value; }
|
|
210703
|
-
|
|
210704
|
-
if (property === this.
|
|
210705
|
-
return this.
|
|
210706
|
-
else if (property === this.
|
|
210707
|
-
return this.
|
|
210726
|
+
getToolSettingLockProperty(property) {
|
|
210727
|
+
if (property === this.cameraHeightProperty)
|
|
210728
|
+
return this.useCameraHeightProperty;
|
|
210729
|
+
else if (property === this.targetHeightProperty)
|
|
210730
|
+
return this.useTargetHeightProperty;
|
|
210708
210731
|
return undefined;
|
|
210709
210732
|
}
|
|
210710
210733
|
async applyToolSettingPropertyChange(updatedValue) {
|
|
@@ -210712,9 +210735,6 @@ class SetupCameraTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_17__.Primi
|
|
|
210712
210735
|
}
|
|
210713
210736
|
supplyToolSettingsProperties() {
|
|
210714
210737
|
this.initializeToolSettingPropertyValues([this.useCameraHeightProperty, this.useTargetHeightProperty, this.cameraHeightProperty, this.targetHeightProperty]);
|
|
210715
|
-
// ensure controls are enabled/disabled base on current lock property state
|
|
210716
|
-
this.targetHeightProperty.isDisabled = !this.useTargetHeight;
|
|
210717
|
-
this.cameraHeightProperty.isDisabled = !this.useCameraHeight;
|
|
210718
210738
|
const cameraHeightLock = this.useCameraHeightProperty.toDialogItem({ rowPriority: 1, columnIndex: 0 });
|
|
210719
210739
|
const targetHeightLock = this.useTargetHeightProperty.toDialogItem({ rowPriority: 2, columnIndex: 0 });
|
|
210720
210740
|
const toolSettings = new Array();
|
|
@@ -219306,11 +219326,11 @@ class ClipPlane extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d
|
|
|
219306
219326
|
get inwardNormalRef() {
|
|
219307
219327
|
return this._inwardNormal;
|
|
219308
219328
|
}
|
|
219309
|
-
/** Return the "interior" property
|
|
219329
|
+
/** Return the "interior" property flag. Interpretation of this flag is algorithm-specific. */
|
|
219310
219330
|
get interior() {
|
|
219311
219331
|
return this._interior;
|
|
219312
219332
|
}
|
|
219313
|
-
/** Return the "invisible" property
|
|
219333
|
+
/** Return the "invisible" property flag. Interpretation of this flag is algorithm-specific. */
|
|
219314
219334
|
get invisible() {
|
|
219315
219335
|
return this._invisible;
|
|
219316
219336
|
}
|
|
@@ -219529,7 +219549,7 @@ class ClipPlane extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d
|
|
|
219529
219549
|
this._distanceFromOrigin = this._inwardNormal.dotProduct(plane.getOriginRef());
|
|
219530
219550
|
return true;
|
|
219531
219551
|
}
|
|
219532
|
-
/** Set the invisible flag. Interpretation of this is
|
|
219552
|
+
/** Set the invisible flag. Interpretation of this flag is algorithm-specific. */
|
|
219533
219553
|
setInvisible(invisible) {
|
|
219534
219554
|
this._invisible = invisible;
|
|
219535
219555
|
}
|
|
@@ -219673,8 +219693,12 @@ class ClipPlane extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d
|
|
|
219673
219693
|
}
|
|
219674
219694
|
/** Project a point in space to the plane. */
|
|
219675
219695
|
projectPointToPlane(spacePoint, result) {
|
|
219676
|
-
|
|
219677
|
-
|
|
219696
|
+
return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);
|
|
219697
|
+
}
|
|
219698
|
+
/** Return the projection of (x,y,z) onto the plane. */
|
|
219699
|
+
projectXYZToPlane(x, y, z, result) {
|
|
219700
|
+
const scale = -this.altitudeXYZ(x, y, z);
|
|
219701
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x + scale * this._inwardNormal.x, y + scale * this._inwardNormal.y, z + scale * this._inwardNormal.z, result);
|
|
219678
219702
|
}
|
|
219679
219703
|
}
|
|
219680
219704
|
|
|
@@ -221973,8 +221997,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
221973
221997
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
221974
221998
|
/* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
|
|
221975
221999
|
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
221976
|
-
/* harmony import */ var
|
|
221977
|
-
/* harmony import */ var
|
|
222000
|
+
/* harmony import */ var _polyface_Polyface__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../polyface/Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
222001
|
+
/* harmony import */ var _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../polyface/PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
|
|
221978
222002
|
/* harmony import */ var _ClipPlane__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ClipPlane */ "../../core/geometry/lib/esm/clipping/ClipPlane.js");
|
|
221979
222003
|
/* harmony import */ var _ClipUtils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ClipUtils */ "../../core/geometry/lib/esm/clipping/ClipUtils.js");
|
|
221980
222004
|
/*---------------------------------------------------------------------------------------------
|
|
@@ -222714,29 +222738,18 @@ class ConvexClipPlaneSet {
|
|
|
222714
222738
|
static createConvexPolyface(convexMesh, result) {
|
|
222715
222739
|
result = this.createEmpty(result);
|
|
222716
222740
|
let vol = 0;
|
|
222717
|
-
|
|
222718
|
-
|
|
222719
|
-
|
|
222720
|
-
|
|
222721
|
-
|
|
222722
|
-
|
|
222723
|
-
|
|
222724
|
-
|
|
222725
|
-
|
|
222726
|
-
|
|
222727
|
-
|
|
222728
|
-
|
|
222729
|
-
vol = _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_11__.PolyfaceQuery.sumTetrahedralVolumes(myVisitor);
|
|
222730
|
-
const scale = vol > 0.0 ? -1.0 : 1.0; // point clipper normals inward if mesh normals point outward
|
|
222731
|
-
const normal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create();
|
|
222732
|
-
const plane = _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_1__.Plane3dByOriginAndUnitNormal.createXYPlane();
|
|
222733
|
-
myVisitor.reset();
|
|
222734
|
-
while (myVisitor.moveToNextFacet()) {
|
|
222735
|
-
if (undefined !== _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.areaNormalGo(myVisitor.point, normal)) {
|
|
222736
|
-
normal.scaleInPlace(scale);
|
|
222737
|
-
if (undefined !== _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_1__.Plane3dByOriginAndUnitNormal.create(myVisitor.point.front(), normal, plane))
|
|
222738
|
-
result.addPlaneToConvexSet(plane);
|
|
222739
|
-
}
|
|
222741
|
+
if (_polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_10__.PolyfaceQuery.isPolyfaceClosedByEdgePairing(convexMesh))
|
|
222742
|
+
vol = _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_10__.PolyfaceQuery.sumTetrahedralVolumes(convexMesh);
|
|
222743
|
+
const scale = vol > 0.0 ? -1.0 : 1.0; // point clipper normals inward if mesh normals point outward
|
|
222744
|
+
const normal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create();
|
|
222745
|
+
const plane = _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_1__.Plane3dByOriginAndUnitNormal.createXYPlane();
|
|
222746
|
+
const visitor = convexMesh instanceof _polyface_Polyface__WEBPACK_IMPORTED_MODULE_11__.Polyface ? convexMesh.createVisitor(0) : convexMesh;
|
|
222747
|
+
visitor.setNumWrap(0);
|
|
222748
|
+
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
222749
|
+
if (undefined !== _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.areaNormalGo(visitor.point, normal)) {
|
|
222750
|
+
normal.scaleInPlace(scale);
|
|
222751
|
+
if (undefined !== _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_1__.Plane3dByOriginAndUnitNormal.create(visitor.point.front(), normal, plane))
|
|
222752
|
+
result.addPlaneToConvexSet(plane);
|
|
222740
222753
|
}
|
|
222741
222754
|
}
|
|
222742
222755
|
return { clipper: result, volume: vol };
|
|
@@ -223331,7 +223344,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
223331
223344
|
/* harmony export */ BSplineWrapMode: () => (/* reexport safe */ _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_108__.BSplineWrapMode),
|
|
223332
223345
|
/* harmony export */ BagOfCurves: () => (/* reexport safe */ _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_64__.BagOfCurves),
|
|
223333
223346
|
/* harmony export */ BarycentricTriangle: () => (/* reexport safe */ _geometry3d_BarycentricTriangle__WEBPACK_IMPORTED_MODULE_3__.BarycentricTriangle),
|
|
223334
|
-
/* harmony export */ BentleyGeometryFlatBuffer: () => (/* reexport safe */
|
|
223347
|
+
/* harmony export */ BentleyGeometryFlatBuffer: () => (/* reexport safe */ _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_132__.BentleyGeometryFlatBuffer),
|
|
223335
223348
|
/* harmony export */ Bezier1dNd: () => (/* reexport safe */ _bspline_Bezier1dNd__WEBPACK_IMPORTED_MODULE_98__.Bezier1dNd),
|
|
223336
223349
|
/* harmony export */ BezierCoffs: () => (/* reexport safe */ _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_51__.BezierCoffs),
|
|
223337
223350
|
/* harmony export */ BezierCurve3d: () => (/* reexport safe */ _bspline_BezierCurve3d__WEBPACK_IMPORTED_MODULE_100__.BezierCurve3d),
|
|
@@ -223351,7 +223364,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
223351
223364
|
/* harmony export */ ClipStepAction: () => (/* reexport safe */ _clipping_ClipUtils__WEBPACK_IMPORTED_MODULE_44__.ClipStepAction),
|
|
223352
223365
|
/* harmony export */ ClipUtilities: () => (/* reexport safe */ _clipping_ClipUtils__WEBPACK_IMPORTED_MODULE_44__.ClipUtilities),
|
|
223353
223366
|
/* harmony export */ ClipVector: () => (/* reexport safe */ _clipping_ClipVector__WEBPACK_IMPORTED_MODULE_43__.ClipVector),
|
|
223354
|
-
/* harmony export */ ClippedPolyfaceBuilders: () => (/* reexport safe */
|
|
223367
|
+
/* harmony export */ ClippedPolyfaceBuilders: () => (/* reexport safe */ _polyface_PolyfaceClip__WEBPACK_IMPORTED_MODULE_122__.ClippedPolyfaceBuilders),
|
|
223355
223368
|
/* harmony export */ ClusterableArray: () => (/* reexport safe */ _numerics_ClusterableArray__WEBPACK_IMPORTED_MODULE_52__.ClusterableArray),
|
|
223356
223369
|
/* harmony export */ Complex: () => (/* reexport safe */ _numerics_Complex__WEBPACK_IMPORTED_MODULE_53__.Complex),
|
|
223357
223370
|
/* harmony export */ Cone: () => (/* reexport safe */ _solid_Cone__WEBPACK_IMPORTED_MODULE_89__.Cone),
|
|
@@ -223379,9 +223392,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
223379
223392
|
/* harmony export */ CurveSearchStatus: () => (/* reexport safe */ _curve_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_66__.CurveSearchStatus),
|
|
223380
223393
|
/* harmony export */ CutLoop: () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.CutLoop),
|
|
223381
223394
|
/* harmony export */ CutLoopMergeContext: () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.CutLoopMergeContext),
|
|
223382
|
-
/* harmony export */ DeepCompare: () => (/* reexport safe */
|
|
223395
|
+
/* harmony export */ DeepCompare: () => (/* reexport safe */ _serialization_DeepCompare__WEBPACK_IMPORTED_MODULE_129__.DeepCompare),
|
|
223383
223396
|
/* harmony export */ DirectSpiral3d: () => (/* reexport safe */ _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_85__.DirectSpiral3d),
|
|
223384
|
-
/* harmony export */ DuplicateFacetClusterSelector: () => (/* reexport safe */
|
|
223397
|
+
/* harmony export */ DuplicateFacetClusterSelector: () => (/* reexport safe */ _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_121__.DuplicateFacetClusterSelector),
|
|
223385
223398
|
/* harmony export */ Ellipsoid: () => (/* reexport safe */ _geometry3d_Ellipsoid__WEBPACK_IMPORTED_MODULE_5__.Ellipsoid),
|
|
223386
223399
|
/* harmony export */ EllipsoidPatch: () => (/* reexport safe */ _geometry3d_Ellipsoid__WEBPACK_IMPORTED_MODULE_5__.EllipsoidPatch),
|
|
223387
223400
|
/* harmony export */ EllipticalArcApproximationOptions: () => (/* reexport safe */ _curve_Arc3d__WEBPACK_IMPORTED_MODULE_59__.EllipticalArcApproximationOptions),
|
|
@@ -223396,18 +223409,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
223396
223409
|
/* harmony export */ Geometry: () => (/* reexport safe */ _Geometry__WEBPACK_IMPORTED_MODULE_36__.Geometry),
|
|
223397
223410
|
/* harmony export */ GeometryHandler: () => (/* reexport safe */ _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_8__.GeometryHandler),
|
|
223398
223411
|
/* harmony export */ GeometryQuery: () => (/* reexport safe */ _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_71__.GeometryQuery),
|
|
223399
|
-
/* harmony export */ GriddedRaggedRange2dSet: () => (/* reexport safe */
|
|
223400
|
-
/* harmony export */ GriddedRaggedRange2dSetWithOverflow: () => (/* reexport safe */
|
|
223412
|
+
/* harmony export */ GriddedRaggedRange2dSet: () => (/* reexport safe */ _polyface_multiclip_GriddedRaggedRange2dSet__WEBPACK_IMPORTED_MODULE_117__.GriddedRaggedRange2dSet),
|
|
223413
|
+
/* harmony export */ GriddedRaggedRange2dSetWithOverflow: () => (/* reexport safe */ _polyface_multiclip_GriddedRaggedRange2dSetWithOverflow__WEBPACK_IMPORTED_MODULE_118__.GriddedRaggedRange2dSetWithOverflow),
|
|
223401
223414
|
/* harmony export */ GrowableBlockedArray: () => (/* reexport safe */ _geometry3d_GrowableBlockedArray__WEBPACK_IMPORTED_MODULE_9__.GrowableBlockedArray),
|
|
223402
223415
|
/* harmony export */ GrowableFloat64Array: () => (/* reexport safe */ _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_10__.GrowableFloat64Array),
|
|
223403
223416
|
/* harmony export */ GrowableXYArray: () => (/* reexport safe */ _geometry3d_GrowableXYArray__WEBPACK_IMPORTED_MODULE_11__.GrowableXYArray),
|
|
223404
223417
|
/* harmony export */ GrowableXYZArray: () => (/* reexport safe */ _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_12__.GrowableXYZArray),
|
|
223405
|
-
/* harmony export */ IModelJson: () => (/* reexport safe */
|
|
223418
|
+
/* harmony export */ IModelJson: () => (/* reexport safe */ _serialization_IModelJsonSchema__WEBPACK_IMPORTED_MODULE_128__.IModelJson),
|
|
223406
223419
|
/* harmony export */ IndexedCollectionInterval: () => (/* reexport safe */ _geometry3d_IndexedCollectionInterval__WEBPACK_IMPORTED_MODULE_13__.IndexedCollectionInterval),
|
|
223420
|
+
/* harmony export */ IndexedEdgeMatcher: () => (/* reexport safe */ _polyface_IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_114__.IndexedEdgeMatcher),
|
|
223407
223421
|
/* harmony export */ IndexedPolyface: () => (/* reexport safe */ _polyface_Polyface__WEBPACK_IMPORTED_MODULE_112__.IndexedPolyface),
|
|
223408
|
-
/* harmony export */ IndexedPolyfaceSubsetVisitor: () => (/* reexport safe */
|
|
223409
|
-
/* harmony export */ IndexedPolyfaceVisitor: () => (/* reexport safe */
|
|
223410
|
-
/* harmony export */ IndexedPolyfaceWalker: () => (/* reexport safe */
|
|
223422
|
+
/* harmony export */ IndexedPolyfaceSubsetVisitor: () => (/* reexport safe */ _polyface_IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_115__.IndexedPolyfaceSubsetVisitor),
|
|
223423
|
+
/* harmony export */ IndexedPolyfaceVisitor: () => (/* reexport safe */ _polyface_IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_115__.IndexedPolyfaceVisitor),
|
|
223424
|
+
/* harmony export */ IndexedPolyfaceWalker: () => (/* reexport safe */ _polyface_IndexedPolyfaceWalker__WEBPACK_IMPORTED_MODULE_116__.IndexedPolyfaceWalker),
|
|
223411
223425
|
/* harmony export */ IndexedReadWriteXYZCollection: () => (/* reexport safe */ _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_15__.IndexedReadWriteXYZCollection),
|
|
223412
223426
|
/* harmony export */ IndexedXYCollection: () => (/* reexport safe */ _geometry3d_IndexedXYCollection__WEBPACK_IMPORTED_MODULE_14__.IndexedXYCollection),
|
|
223413
223427
|
/* harmony export */ IndexedXYZCollection: () => (/* reexport safe */ _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_15__.IndexedXYZCollection),
|
|
@@ -223421,7 +223435,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
223421
223435
|
/* harmony export */ KnotVector: () => (/* reexport safe */ _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_108__.KnotVector),
|
|
223422
223436
|
/* harmony export */ LineSegment3d: () => (/* reexport safe */ _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_72__.LineSegment3d),
|
|
223423
223437
|
/* harmony export */ LineString3d: () => (/* reexport safe */ _curve_LineString3d__WEBPACK_IMPORTED_MODULE_73__.LineString3d),
|
|
223424
|
-
/* harmony export */ LineString3dRangeTreeContext: () => (/* reexport safe */
|
|
223438
|
+
/* harmony export */ LineString3dRangeTreeContext: () => (/* reexport safe */ _polyface_RangeTree_LineString3dRangeTreeContext__WEBPACK_IMPORTED_MODULE_124__.LineString3dRangeTreeContext),
|
|
223425
223439
|
/* harmony export */ LinearSweep: () => (/* reexport safe */ _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_90__.LinearSweep),
|
|
223426
223440
|
/* harmony export */ LongitudeLatitudeNumber: () => (/* reexport safe */ _geometry3d_LongitudeLatitudeAltitude__WEBPACK_IMPORTED_MODULE_2__.LongitudeLatitudeNumber),
|
|
223427
223441
|
/* harmony export */ Loop: () => (/* reexport safe */ _curve_Loop__WEBPACK_IMPORTED_MODULE_74__.Loop),
|
|
@@ -223434,7 +223448,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
223434
223448
|
/* harmony export */ NonConvexFacetLocationDetail: () => (/* reexport safe */ _polyface_FacetLocationDetail__WEBPACK_IMPORTED_MODULE_113__.NonConvexFacetLocationDetail),
|
|
223435
223449
|
/* harmony export */ NullGeometryHandler: () => (/* reexport safe */ _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_8__.NullGeometryHandler),
|
|
223436
223450
|
/* harmony export */ NumberArray: () => (/* reexport safe */ _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_24__.NumberArray),
|
|
223437
|
-
/* harmony export */ OffsetMeshOptions: () => (/* reexport safe */
|
|
223451
|
+
/* harmony export */ OffsetMeshOptions: () => (/* reexport safe */ _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_121__.OffsetMeshOptions),
|
|
223438
223452
|
/* harmony export */ OffsetOptions: () => (/* reexport safe */ _curve_OffsetOptions__WEBPACK_IMPORTED_MODULE_75__.OffsetOptions),
|
|
223439
223453
|
/* harmony export */ Order2Bezier: () => (/* reexport safe */ _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_51__.Order2Bezier),
|
|
223440
223454
|
/* harmony export */ Order3Bezier: () => (/* reexport safe */ _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_51__.Order3Bezier),
|
|
@@ -223457,17 +223471,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
223457
223471
|
/* harmony export */ Point3dArray: () => (/* reexport safe */ _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_24__.Point3dArray),
|
|
223458
223472
|
/* harmony export */ Point3dArrayCarrier: () => (/* reexport safe */ _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_25__.Point3dArrayCarrier),
|
|
223459
223473
|
/* harmony export */ Point3dArrayPolygonOps: () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.Point3dArrayPolygonOps),
|
|
223460
|
-
/* harmony export */ Point3dArrayRangeTreeContext: () => (/* reexport safe */
|
|
223474
|
+
/* harmony export */ Point3dArrayRangeTreeContext: () => (/* reexport safe */ _polyface_RangeTree_Point3dArrayRangeTreeContext__WEBPACK_IMPORTED_MODULE_123__.Point3dArrayRangeTreeContext),
|
|
223461
223475
|
/* harmony export */ Point4d: () => (/* reexport safe */ _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_47__.Point4d),
|
|
223462
223476
|
/* harmony export */ Point4dArray: () => (/* reexport safe */ _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_24__.Point4dArray),
|
|
223463
223477
|
/* harmony export */ PointString3d: () => (/* reexport safe */ _curve_PointString3d__WEBPACK_IMPORTED_MODULE_80__.PointString3d),
|
|
223464
223478
|
/* harmony export */ Polyface: () => (/* reexport safe */ _polyface_Polyface__WEBPACK_IMPORTED_MODULE_112__.Polyface),
|
|
223465
223479
|
/* harmony export */ PolyfaceAuxData: () => (/* reexport safe */ _polyface_AuxData__WEBPACK_IMPORTED_MODULE_109__.PolyfaceAuxData),
|
|
223466
|
-
/* harmony export */ PolyfaceBuilder: () => (/* reexport safe */
|
|
223467
|
-
/* harmony export */ PolyfaceClip: () => (/* reexport safe */
|
|
223468
|
-
/* harmony export */ PolyfaceData: () => (/* reexport safe */
|
|
223469
|
-
/* harmony export */ PolyfaceQuery: () => (/* reexport safe */
|
|
223470
|
-
/* harmony export */ PolyfaceRangeTreeContext: () => (/* reexport safe */
|
|
223480
|
+
/* harmony export */ PolyfaceBuilder: () => (/* reexport safe */ _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_119__.PolyfaceBuilder),
|
|
223481
|
+
/* harmony export */ PolyfaceClip: () => (/* reexport safe */ _polyface_PolyfaceClip__WEBPACK_IMPORTED_MODULE_122__.PolyfaceClip),
|
|
223482
|
+
/* harmony export */ PolyfaceData: () => (/* reexport safe */ _polyface_PolyfaceData__WEBPACK_IMPORTED_MODULE_120__.PolyfaceData),
|
|
223483
|
+
/* harmony export */ PolyfaceQuery: () => (/* reexport safe */ _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_121__.PolyfaceQuery),
|
|
223484
|
+
/* harmony export */ PolyfaceRangeTreeContext: () => (/* reexport safe */ _polyface_RangeTree_PolyfaceRangeTreeContext__WEBPACK_IMPORTED_MODULE_125__.PolyfaceRangeTreeContext),
|
|
223471
223485
|
/* harmony export */ PolygonLocation: () => (/* reexport safe */ _Geometry__WEBPACK_IMPORTED_MODULE_36__.PolygonLocation),
|
|
223472
223486
|
/* harmony export */ PolygonLocationDetail: () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.PolygonLocationDetail),
|
|
223473
223487
|
/* harmony export */ PolygonLocationDetailPair: () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.PolygonLocationDetailPair),
|
|
@@ -223490,23 +223504,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
223490
223504
|
/* harmony export */ RegionOps: () => (/* reexport safe */ _curve_RegionOps__WEBPACK_IMPORTED_MODULE_79__.RegionOps),
|
|
223491
223505
|
/* harmony export */ RotationalSweep: () => (/* reexport safe */ _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_91__.RotationalSweep),
|
|
223492
223506
|
/* harmony export */ RuledSweep: () => (/* reexport safe */ _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_92__.RuledSweep),
|
|
223493
|
-
/* harmony export */ Sample: () => (/* reexport safe */
|
|
223507
|
+
/* harmony export */ Sample: () => (/* reexport safe */ _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_130__.Sample),
|
|
223494
223508
|
/* harmony export */ Segment1d: () => (/* reexport safe */ _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_31__.Segment1d),
|
|
223495
|
-
/* harmony export */ SerializationHelpers: () => (/* reexport safe */
|
|
223509
|
+
/* harmony export */ SerializationHelpers: () => (/* reexport safe */ _serialization_SerializationHelpers__WEBPACK_IMPORTED_MODULE_131__.SerializationHelpers),
|
|
223496
223510
|
/* harmony export */ SmallSystem: () => (/* reexport safe */ _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_57__.SmallSystem),
|
|
223497
223511
|
/* harmony export */ SmoothTransformBetweenFrusta: () => (/* reexport safe */ _geometry3d_FrustumAnimation__WEBPACK_IMPORTED_MODULE_7__.SmoothTransformBetweenFrusta),
|
|
223498
223512
|
/* harmony export */ SolidPrimitive: () => (/* reexport safe */ _solid_SolidPrimitive__WEBPACK_IMPORTED_MODULE_93__.SolidPrimitive),
|
|
223499
|
-
/* harmony export */
|
|
223513
|
+
/* harmony export */ SortableEdge: () => (/* reexport safe */ _polyface_IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_114__.SortableEdge),
|
|
223514
|
+
/* harmony export */ SpacePolygonTriangulation: () => (/* reexport safe */ _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_127__.SpacePolygonTriangulation),
|
|
223500
223515
|
/* harmony export */ Sphere: () => (/* reexport safe */ _solid_Sphere__WEBPACK_IMPORTED_MODULE_94__.Sphere),
|
|
223501
223516
|
/* harmony export */ StandardViewIndex: () => (/* reexport safe */ _Geometry__WEBPACK_IMPORTED_MODULE_36__.StandardViewIndex),
|
|
223502
|
-
/* harmony export */ SteppedIndexFunctionFactory: () => (/* reexport safe */
|
|
223517
|
+
/* harmony export */ SteppedIndexFunctionFactory: () => (/* reexport safe */ _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_130__.SteppedIndexFunctionFactory),
|
|
223503
223518
|
/* harmony export */ StringifiedClipVector: () => (/* reexport safe */ _clipping_ClipVector__WEBPACK_IMPORTED_MODULE_43__.StringifiedClipVector),
|
|
223504
223519
|
/* harmony export */ StrokeCountMap: () => (/* reexport safe */ _curve_Query_StrokeCountMap__WEBPACK_IMPORTED_MODULE_87__.StrokeCountMap),
|
|
223505
223520
|
/* harmony export */ StrokeOptions: () => (/* reexport safe */ _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_82__.StrokeOptions),
|
|
223506
223521
|
/* harmony export */ SweepContour: () => (/* reexport safe */ _solid_SweepContour__WEBPACK_IMPORTED_MODULE_95__.SweepContour),
|
|
223507
|
-
/* harmony export */ SweepLineStringToFacetsOptions: () => (/* reexport safe */
|
|
223508
|
-
/* harmony export */ TaggedNumericConstants: () => (/* reexport safe */
|
|
223509
|
-
/* harmony export */ TaggedNumericData: () => (/* reexport safe */
|
|
223522
|
+
/* harmony export */ SweepLineStringToFacetsOptions: () => (/* reexport safe */ _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_121__.SweepLineStringToFacetsOptions),
|
|
223523
|
+
/* harmony export */ TaggedNumericConstants: () => (/* reexport safe */ _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_126__.TaggedNumericConstants),
|
|
223524
|
+
/* harmony export */ TaggedNumericData: () => (/* reexport safe */ _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_126__.TaggedNumericData),
|
|
223510
223525
|
/* harmony export */ TorusPipe: () => (/* reexport safe */ _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_96__.TorusPipe),
|
|
223511
223526
|
/* harmony export */ Transform: () => (/* reexport safe */ _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_32__.Transform),
|
|
223512
223527
|
/* harmony export */ TransitionSpiral3d: () => (/* reexport safe */ _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_83__.TransitionSpiral3d),
|
|
@@ -223642,24 +223657,25 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
223642
223657
|
/* harmony import */ var _polyface_FacetFaceData__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(/*! ./polyface/FacetFaceData */ "../../core/geometry/lib/esm/polyface/FacetFaceData.js");
|
|
223643
223658
|
/* harmony import */ var _polyface_Polyface__WEBPACK_IMPORTED_MODULE_112__ = __webpack_require__(/*! ./polyface/Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
223644
223659
|
/* harmony import */ var _polyface_FacetLocationDetail__WEBPACK_IMPORTED_MODULE_113__ = __webpack_require__(/*! ./polyface/FacetLocationDetail */ "../../core/geometry/lib/esm/polyface/FacetLocationDetail.js");
|
|
223645
|
-
/* harmony import */ var
|
|
223646
|
-
/* harmony import */ var
|
|
223647
|
-
/* harmony import */ var
|
|
223648
|
-
/* harmony import */ var
|
|
223649
|
-
/* harmony import */ var
|
|
223650
|
-
/* harmony import */ var
|
|
223651
|
-
/* harmony import */ var
|
|
223652
|
-
/* harmony import */ var
|
|
223653
|
-
/* harmony import */ var
|
|
223654
|
-
/* harmony import */ var
|
|
223655
|
-
/* harmony import */ var
|
|
223656
|
-
/* harmony import */ var
|
|
223657
|
-
/* harmony import */ var
|
|
223658
|
-
/* harmony import */ var
|
|
223659
|
-
/* harmony import */ var
|
|
223660
|
-
/* harmony import */ var
|
|
223661
|
-
/* harmony import */ var
|
|
223662
|
-
/* harmony import */ var
|
|
223660
|
+
/* harmony import */ var _polyface_IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_114__ = __webpack_require__(/*! ./polyface/IndexedEdgeMatcher */ "../../core/geometry/lib/esm/polyface/IndexedEdgeMatcher.js");
|
|
223661
|
+
/* harmony import */ var _polyface_IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_115__ = __webpack_require__(/*! ./polyface/IndexedPolyfaceVisitor */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceVisitor.js");
|
|
223662
|
+
/* harmony import */ var _polyface_IndexedPolyfaceWalker__WEBPACK_IMPORTED_MODULE_116__ = __webpack_require__(/*! ./polyface/IndexedPolyfaceWalker */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceWalker.js");
|
|
223663
|
+
/* harmony import */ var _polyface_multiclip_GriddedRaggedRange2dSet__WEBPACK_IMPORTED_MODULE_117__ = __webpack_require__(/*! ./polyface/multiclip/GriddedRaggedRange2dSet */ "../../core/geometry/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js");
|
|
223664
|
+
/* harmony import */ var _polyface_multiclip_GriddedRaggedRange2dSetWithOverflow__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(/*! ./polyface/multiclip/GriddedRaggedRange2dSetWithOverflow */ "../../core/geometry/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js");
|
|
223665
|
+
/* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(/*! ./polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
|
|
223666
|
+
/* harmony import */ var _polyface_PolyfaceData__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(/*! ./polyface/PolyfaceData */ "../../core/geometry/lib/esm/polyface/PolyfaceData.js");
|
|
223667
|
+
/* harmony import */ var _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(/*! ./polyface/PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
|
|
223668
|
+
/* harmony import */ var _polyface_PolyfaceClip__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(/*! ./polyface/PolyfaceClip */ "../../core/geometry/lib/esm/polyface/PolyfaceClip.js");
|
|
223669
|
+
/* harmony import */ var _polyface_RangeTree_Point3dArrayRangeTreeContext__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(/*! ./polyface/RangeTree/Point3dArrayRangeTreeContext */ "../../core/geometry/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js");
|
|
223670
|
+
/* harmony import */ var _polyface_RangeTree_LineString3dRangeTreeContext__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(/*! ./polyface/RangeTree/LineString3dRangeTreeContext */ "../../core/geometry/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js");
|
|
223671
|
+
/* harmony import */ var _polyface_RangeTree_PolyfaceRangeTreeContext__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(/*! ./polyface/RangeTree/PolyfaceRangeTreeContext */ "../../core/geometry/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js");
|
|
223672
|
+
/* harmony import */ var _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(/*! ./polyface/TaggedNumericData */ "../../core/geometry/lib/esm/polyface/TaggedNumericData.js");
|
|
223673
|
+
/* harmony import */ var _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(/*! ./topology/SpaceTriangulation */ "../../core/geometry/lib/esm/topology/SpaceTriangulation.js");
|
|
223674
|
+
/* harmony import */ var _serialization_IModelJsonSchema__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(/*! ./serialization/IModelJsonSchema */ "../../core/geometry/lib/esm/serialization/IModelJsonSchema.js");
|
|
223675
|
+
/* harmony import */ var _serialization_DeepCompare__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(/*! ./serialization/DeepCompare */ "../../core/geometry/lib/esm/serialization/DeepCompare.js");
|
|
223676
|
+
/* harmony import */ var _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_130__ = __webpack_require__(/*! ./serialization/GeometrySamples */ "../../core/geometry/lib/esm/serialization/GeometrySamples.js");
|
|
223677
|
+
/* harmony import */ var _serialization_SerializationHelpers__WEBPACK_IMPORTED_MODULE_131__ = __webpack_require__(/*! ./serialization/SerializationHelpers */ "../../core/geometry/lib/esm/serialization/SerializationHelpers.js");
|
|
223678
|
+
/* harmony import */ var _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_132__ = __webpack_require__(/*! ./serialization/BentleyGeometryFlatBuffer */ "../../core/geometry/lib/esm/serialization/BentleyGeometryFlatBuffer.js");
|
|
223663
223679
|
/*---------------------------------------------------------------------------------------------
|
|
223664
223680
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
223665
223681
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -223913,6 +223929,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
223913
223929
|
|
|
223914
223930
|
|
|
223915
223931
|
|
|
223932
|
+
|
|
223916
223933
|
|
|
223917
223934
|
|
|
223918
223935
|
/***/ }),
|
|
@@ -224096,15 +224113,26 @@ class EllipticalArcApproximationOptions {
|
|
|
224096
224113
|
* Circular or elliptic arc.
|
|
224097
224114
|
* * The angle to point equation is:
|
|
224098
224115
|
* * `X = center + cos(theta) * vector0 + sin(theta) * vector90`
|
|
224099
|
-
* *
|
|
224100
|
-
* *
|
|
224101
|
-
* *
|
|
224102
|
-
* *
|
|
224103
|
-
* *
|
|
224104
|
-
*
|
|
224116
|
+
* * The arc's `sweep` determines the range of theta values (angles). In particular:
|
|
224117
|
+
* * The point at `theta = n*360` degrees is `center + vector0` for any integer n.
|
|
224118
|
+
* * The point at `theta = 90 + n*360` degrees is `center + vector90` for any integer n.
|
|
224119
|
+
* * The arc's `sweep` _together with_ `vector0` and `vector90` determine the arc's orientation:
|
|
224120
|
+
* * If `sweep.startDegrees < sweep.endDegrees`, the arc's orientation is counterclockwise with respect to its
|
|
224121
|
+
* `perpendicularVector` (i.e., looking at the arc from the head of this vector).
|
|
224122
|
+
* * Similarly, if `sweep.startDegrees > sweep.endDegrees`, the arc's orientation is clockwise with respect to
|
|
224123
|
+
* its `perpendicularVector`.
|
|
224124
|
+
* * The arc's orientation is _always_ counterclockwise with respect to its `binormalVector`.
|
|
224125
|
+
* * When `vector0` and `vector90` are perpendicular and have equal length, the arc is circular.
|
|
224126
|
+
* * When they are non-perpendicular, the arc is always elliptic.
|
|
224127
|
+
* * When they have unequal length, the arc is always elliptic.
|
|
224128
|
+
* * To create an ellipse in standard major-minor axis form:
|
|
224129
|
+
* * `vector0` is the vector from the center to the major axis extreme.
|
|
224130
|
+
* * `vector90` is the vector from the center to the minor axis extreme.
|
|
224105
224131
|
* * Note that constructing these vectors to the extreme points makes them perpendicular.
|
|
224106
|
-
* * The method toScaledMatrix3d
|
|
224107
|
-
*
|
|
224132
|
+
* * The method [[Arc3d.toScaledMatrix3d]] can be called to convert an arc with unrestricted `vector0` and `vector90`
|
|
224133
|
+
* to an arc in standard major-minor axis form.
|
|
224134
|
+
* * The unrestricted form is much easier to work with for common calculations: stroking, projection to 2d,
|
|
224135
|
+
* intersection with plane.
|
|
224108
224136
|
* @public
|
|
224109
224137
|
*/
|
|
224110
224138
|
class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive {
|
|
@@ -224115,7 +224143,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
224115
224143
|
return other instanceof Arc3d;
|
|
224116
224144
|
}
|
|
224117
224145
|
_center;
|
|
224118
|
-
_matrix; // columns are [vector0, vector90,
|
|
224146
|
+
_matrix; // columns are [vector0, vector90, unit normal]
|
|
224119
224147
|
_sweep; // sweep limits
|
|
224120
224148
|
static _workPointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create();
|
|
224121
224149
|
static _workPointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create();
|
|
@@ -224130,21 +224158,27 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
224130
224158
|
set center(center) {
|
|
224131
224159
|
this._center.setFrom(center);
|
|
224132
224160
|
}
|
|
224133
|
-
/** Read property for (reference to) center. */
|
|
224161
|
+
/** Read property for (reference to) the arc center. */
|
|
224134
224162
|
get centerRef() {
|
|
224135
224163
|
return this._center;
|
|
224136
224164
|
}
|
|
224137
|
-
/**
|
|
224165
|
+
/**
|
|
224166
|
+
* Read property for (clone of) the x-column of the arc matrix.
|
|
224167
|
+
* * This vector determines the point on the arc corresponding to angles n*360 degrees.
|
|
224168
|
+
*/
|
|
224138
224169
|
get vector0() {
|
|
224139
224170
|
return this._matrix.columnX();
|
|
224140
224171
|
}
|
|
224141
|
-
/**
|
|
224172
|
+
/**
|
|
224173
|
+
* Read property for (clone of) the y-column of the arc matrix.
|
|
224174
|
+
* * This vector determines the point on the arc corresponding to angles 90 + n*360 degrees.
|
|
224175
|
+
*/
|
|
224142
224176
|
get vector90() {
|
|
224143
224177
|
return this._matrix.columnY();
|
|
224144
224178
|
}
|
|
224145
224179
|
/**
|
|
224146
224180
|
* Compute an arc binormal vector with arbitrary length.
|
|
224147
|
-
* * The arc parameterization is
|
|
224181
|
+
* * The arc parameterization is counterclockwise with respect to this vector.
|
|
224148
224182
|
* * This vector is parallel to [[perpendicularVector]] and possibly opposite.
|
|
224149
224183
|
*/
|
|
224150
224184
|
binormalVector(result) {
|
|
@@ -224152,17 +224186,18 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
224152
224186
|
return plane.vectorU.crossProduct(plane.vectorV, result);
|
|
224153
224187
|
}
|
|
224154
224188
|
/**
|
|
224155
|
-
* Read property for (clone of)
|
|
224156
|
-
* *
|
|
224189
|
+
* Read property for (clone of) the z-column of the arc matrix.
|
|
224190
|
+
* * This vector is nominally the normalized cross product: `vector0 x vector90`.
|
|
224191
|
+
* * To compute a vector with respect to which the arc sweep is counterclockwise, use [[binormalVector]].
|
|
224157
224192
|
*/
|
|
224158
224193
|
get perpendicularVector() {
|
|
224159
224194
|
return this._matrix.columnZ();
|
|
224160
224195
|
}
|
|
224161
|
-
/**
|
|
224196
|
+
/** Return a clone of the arc matrix. */
|
|
224162
224197
|
matrixClone() {
|
|
224163
224198
|
return this._matrix.clone();
|
|
224164
224199
|
}
|
|
224165
|
-
/** Read property for (reference to)
|
|
224200
|
+
/** Read property for (reference to) the arc matrix. */
|
|
224166
224201
|
get matrixRef() {
|
|
224167
224202
|
return this._matrix;
|
|
224168
224203
|
}
|
|
@@ -224177,17 +224212,14 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
224177
224212
|
get isExtensibleFractionSpace() {
|
|
224178
224213
|
return true;
|
|
224179
224214
|
}
|
|
224180
|
-
|
|
224215
|
+
/** Constructor. Captures the inputs. */
|
|
224181
224216
|
constructor(center, matrix, sweep) {
|
|
224182
224217
|
super();
|
|
224183
224218
|
this._center = center;
|
|
224184
224219
|
this._matrix = matrix;
|
|
224185
224220
|
this._sweep = sweep.clampToFullCircle(sweep);
|
|
224186
224221
|
}
|
|
224187
|
-
/**
|
|
224188
|
-
* Return a clone of the arc, with transform applied.
|
|
224189
|
-
* @param transform
|
|
224190
|
-
*/
|
|
224222
|
+
/** Return a clone of the arc, with transform applied. */
|
|
224191
224223
|
cloneTransformed(transform) {
|
|
224192
224224
|
const c = this.clone();
|
|
224193
224225
|
c.tryTransformInPlace(transform);
|
|
@@ -224196,7 +224228,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
224196
224228
|
/**
|
|
224197
224229
|
* Redefine the arc with (captured references to) given data.
|
|
224198
224230
|
* @param center arc center.
|
|
224199
|
-
* @param matrix matrix with columns vector0,
|
|
224231
|
+
* @param matrix matrix with columns vector0, vector90, and their unit cross product.
|
|
224200
224232
|
* @param sweep angle sweep.
|
|
224201
224233
|
*/
|
|
224202
224234
|
setRefs(center, matrix, sweep) {
|
|
@@ -224207,7 +224239,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
224207
224239
|
/**
|
|
224208
224240
|
* Redefine the arc with (clones of) given data.
|
|
224209
224241
|
* @param center arc center.
|
|
224210
|
-
* @param matrix matrix with columns vector0,
|
|
224242
|
+
* @param matrix matrix with columns vector0, vector90, and their unit cross product.
|
|
224211
224243
|
* @param sweep angle sweep.
|
|
224212
224244
|
*/
|
|
224213
224245
|
set(center, matrix, sweep) {
|
|
@@ -224226,7 +224258,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
224226
224258
|
/**
|
|
224227
224259
|
* Create an arc, capturing references to center, matrix and sweep.
|
|
224228
224260
|
* @param center center point.
|
|
224229
|
-
* @param matrix matrix with columns vector0, vector90, and unit cross product.
|
|
224261
|
+
* @param matrix matrix with columns vector0, vector90, and their unit cross product.
|
|
224230
224262
|
* @param sweep sweep limits.
|
|
224231
224263
|
* @param result optional preallocated result.
|
|
224232
224264
|
*/
|
|
@@ -224240,9 +224272,10 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
224240
224272
|
/**
|
|
224241
224273
|
* Create an arc from center, x column to be scaled, and y column to be scaled.
|
|
224242
224274
|
* @param center center of ellipse.
|
|
224243
|
-
* @param matrix
|
|
224244
|
-
*
|
|
224245
|
-
* @param
|
|
224275
|
+
* @param matrix the x-column and y-column of this matrix are scaled by `radius0` and `radius90` to define the
|
|
224276
|
+
* arc's `vector0` and `vector90`.
|
|
224277
|
+
* @param radius0 radius along `vector0`.
|
|
224278
|
+
* @param radius90 radius along `vector90`.
|
|
224246
224279
|
* @param sweep sweep limits.
|
|
224247
224280
|
* @param result optional preallocated result.
|
|
224248
224281
|
*/
|
|
@@ -224252,10 +224285,10 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
224252
224285
|
return Arc3d.create(center, vector0.scale(radius0, vector0), vector90.scale(radius90, vector90), sweep, result);
|
|
224253
224286
|
}
|
|
224254
224287
|
/**
|
|
224255
|
-
* Create a
|
|
224256
|
-
* @param center center of
|
|
224288
|
+
* Create a full circle from center, normal and radius.
|
|
224289
|
+
* @param center center of circle. If undefined, use 000.
|
|
224257
224290
|
* @param normal normal vector.
|
|
224258
|
-
* @param radius radius
|
|
224291
|
+
* @param radius radius of the circle.
|
|
224259
224292
|
* @param result optional preallocated result.
|
|
224260
224293
|
*/
|
|
224261
224294
|
static createCenterNormalRadius(center, normal, radius, result) {
|
|
@@ -224263,7 +224296,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
224263
224296
|
return Arc3d.createScaledXYColumns(center, frame, radius, radius, undefined, result);
|
|
224264
224297
|
}
|
|
224265
224298
|
/**
|
|
224266
|
-
* Create an arc by center with vectors to points at 0 and 90 degrees in parameter space.
|
|
224299
|
+
* Create an elliptical arc by center with vectors to points at 0 and 90 degrees in parameter space.
|
|
224267
224300
|
* @param center arc center.
|
|
224268
224301
|
* @param vector0 vector to 0 degrees (commonly major axis).
|
|
224269
224302
|
* @param vector90 vector to 90 degree point (commonly minor axis).
|
|
@@ -224580,10 +224613,13 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
224580
224613
|
curveLength() {
|
|
224581
224614
|
return this.curveLengthBetweenFractions(0, 1);
|
|
224582
224615
|
}
|
|
224583
|
-
|
|
224584
|
-
|
|
224585
|
-
|
|
224616
|
+
/**
|
|
224617
|
+
* Gauss point quadrature count for evaluating curve length. (The number of intervals is adjusted to the arc sweep).
|
|
224618
|
+
* @deprecated in 5.0. Use correct spelling quadratureGaussCount.
|
|
224619
|
+
*/
|
|
224586
224620
|
static quadratureGuassCount = 5;
|
|
224621
|
+
/** Gauss point quadrature count for evaluating curve length. (The number of intervals is adjusted to the arc sweep). */
|
|
224622
|
+
static quadratureGaussCount = 5;
|
|
224587
224623
|
/** In quadrature for arc length, use this interval (divided by quickEccentricity). */
|
|
224588
224624
|
static quadratureIntervalAngleDegrees = 10.0;
|
|
224589
224625
|
/**
|
|
@@ -224610,7 +224646,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
224610
224646
|
numInterval = 400;
|
|
224611
224647
|
if (numInterval < 1)
|
|
224612
224648
|
numInterval = 1;
|
|
224613
|
-
return super.curveLengthWithFixedIntervalCountQuadrature(f0, f1, numInterval, Arc3d.
|
|
224649
|
+
return super.curveLengthWithFixedIntervalCountQuadrature(f0, f1, numInterval, Arc3d.quadratureGaussCount);
|
|
224614
224650
|
}
|
|
224615
224651
|
/**
|
|
224616
224652
|
* Return an approximate (but easy to compute) arc length.
|
|
@@ -226588,6 +226624,20 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
226588
226624
|
projectedParameterRange(ray, lowHigh) {
|
|
226589
226625
|
return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_9__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
|
|
226590
226626
|
}
|
|
226627
|
+
/** Return the immediate parent of the input curve in the instance, or undefined if it is not a descendant. */
|
|
226628
|
+
findParentOfDescendant(descendant) {
|
|
226629
|
+
for (const child of this.children) {
|
|
226630
|
+
if (child === descendant)
|
|
226631
|
+
return this;
|
|
226632
|
+
if (child instanceof CurveCollection) {
|
|
226633
|
+
const parent = child.findParentOfDescendant(descendant);
|
|
226634
|
+
if (parent)
|
|
226635
|
+
return parent;
|
|
226636
|
+
}
|
|
226637
|
+
}
|
|
226638
|
+
return undefined;
|
|
226639
|
+
}
|
|
226640
|
+
;
|
|
226591
226641
|
}
|
|
226592
226642
|
/**
|
|
226593
226643
|
* Shared base class for use by both open and closed paths.
|
|
@@ -229592,6 +229642,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
229592
229642
|
|
|
229593
229643
|
|
|
229594
229644
|
|
|
229645
|
+
// cspell:words CCWXY
|
|
229595
229646
|
/**
|
|
229596
229647
|
* A LineSegment3d is:
|
|
229597
229648
|
* * A 3d line segment represented by its start and end coordinates
|
|
@@ -232565,11 +232616,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
232565
232616
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
232566
232617
|
/* harmony export */ ConsolidateAdjacentCurvePrimitivesContext: () => (/* binding */ ConsolidateAdjacentCurvePrimitivesContext)
|
|
232567
232618
|
/* harmony export */ });
|
|
232619
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
232568
232620
|
/* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
|
|
232569
|
-
/* harmony import */ var
|
|
232621
|
+
/* harmony import */ var _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../geometry3d/PolylineCompressionByEdgeOffset */ "../../core/geometry/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js");
|
|
232570
232622
|
/* harmony import */ var _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../geometry3d/PolylineOps */ "../../core/geometry/lib/esm/geometry3d/PolylineOps.js");
|
|
232571
|
-
/* harmony import */ var
|
|
232572
|
-
/* harmony import */ var
|
|
232623
|
+
/* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
232624
|
+
/* harmony import */ var _CurveFactory__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../CurveFactory */ "../../core/geometry/lib/esm/curve/CurveFactory.js");
|
|
232573
232625
|
/* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
232574
232626
|
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
232575
232627
|
/* harmony import */ var _RegionOps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
|
|
@@ -232588,6 +232640,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
232588
232640
|
|
|
232589
232641
|
|
|
232590
232642
|
|
|
232643
|
+
|
|
232591
232644
|
/**
|
|
232592
232645
|
* * Implementation class for ConsolidateAdjacentCurvePrimitives.
|
|
232593
232646
|
*
|
|
@@ -232629,12 +232682,19 @@ class ConsolidateAdjacentCurvePrimitivesContext extends _geometry3d_GeometryHand
|
|
|
232629
232682
|
break;
|
|
232630
232683
|
}
|
|
232631
232684
|
}
|
|
232632
|
-
if (points.length
|
|
232685
|
+
if (points.length <= 1) {
|
|
232686
|
+
g.children[numAccept++] = basePrimitive;
|
|
232687
|
+
}
|
|
232688
|
+
else if (this._options.disableLinearCompression) {
|
|
232689
|
+
const pointsDeduped = _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_4__.PolylineOps.compressShortEdges(points, _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.smallFloatingPoint); // remove only exact duplicate interior points
|
|
232690
|
+
g.children[numAccept++] = _LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d.createPoints(pointsDeduped);
|
|
232691
|
+
}
|
|
232692
|
+
else { // compress points
|
|
232633
232693
|
const compressedPointsA = _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_4__.PolylineOps.compressShortEdges(points, this._options.duplicatePointTolerance);
|
|
232634
232694
|
const compressedPointsB = _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_4__.PolylineOps.compressByPerpendicularDistance(compressedPointsA, this._options.colinearPointTolerance);
|
|
232635
232695
|
if (i0 === 0 && i1 === numOriginal) {
|
|
232636
232696
|
// points is the entire curve, and the curve is closed. Maybe the first and last segments are colinear.
|
|
232637
|
-
|
|
232697
|
+
_geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_6__.PolylineCompressionContext.compressColinearWrapInPlace(compressedPointsB, this._options.duplicatePointTolerance, this._options.colinearPointTolerance);
|
|
232638
232698
|
}
|
|
232639
232699
|
if (compressedPointsB.length < 2) {
|
|
232640
232700
|
// Collapsed to a point? Make a single point linestring
|
|
@@ -232647,19 +232707,16 @@ class ConsolidateAdjacentCurvePrimitivesContext extends _geometry3d_GeometryHand
|
|
|
232647
232707
|
g.children[numAccept++] = _LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d.createPoints(compressedPointsB);
|
|
232648
232708
|
}
|
|
232649
232709
|
}
|
|
232650
|
-
else {
|
|
232651
|
-
g.children[numAccept++] = basePrimitive;
|
|
232652
|
-
}
|
|
232653
232710
|
i0 = i1;
|
|
232654
232711
|
}
|
|
232655
|
-
else if (this._options.consolidateCompatibleArcs && basePrimitive instanceof
|
|
232712
|
+
else if (this._options.consolidateCompatibleArcs && basePrimitive instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_7__.Arc3d) {
|
|
232656
232713
|
// subsume subsequent arcs into basePrimitive.
|
|
232657
232714
|
// always accept base primitive.
|
|
232658
232715
|
for (; ++i0 < g.children.length;) {
|
|
232659
232716
|
const nextPrimitive = g.children[i0];
|
|
232660
|
-
if (!(nextPrimitive instanceof
|
|
232717
|
+
if (!(nextPrimitive instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_7__.Arc3d))
|
|
232661
232718
|
break;
|
|
232662
|
-
if (!
|
|
232719
|
+
if (!_CurveFactory__WEBPACK_IMPORTED_MODULE_8__.CurveFactory.appendToArcInPlace(basePrimitive, nextPrimitive)) // TODO: use this._options.duplicatePointTolerance
|
|
232663
232720
|
break;
|
|
232664
232721
|
}
|
|
232665
232722
|
// i0 has already advanced
|
|
@@ -233162,13 +233219,18 @@ class MapCurvePrimitiveToCurveLocationDetailPairArray {
|
|
|
233162
233219
|
if (primitiveB)
|
|
233163
233220
|
this.insertPrimitiveToPair(primitiveB, pair);
|
|
233164
233221
|
}
|
|
233165
|
-
/**
|
|
233222
|
+
/**
|
|
233223
|
+
* Split closed missing primitives in half and add new intersection pairs.
|
|
233224
|
+
* * When bridge edges aren't included in the primitives array, a closed primitive with no intersections will not be
|
|
233225
|
+
* added to the graph because it isn't in the `primitiveToPair` map. By splitting such a missing primitive in two, we
|
|
233226
|
+
* introduce two intersections for each half, which allows the primitive to be represented in the map.
|
|
233227
|
+
*/
|
|
233166
233228
|
splitAndAppendMissingClosedPrimitives(primitives, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
233167
233229
|
for (const p of primitives) {
|
|
233168
233230
|
let closedCurveSplitCandidate = false;
|
|
233169
233231
|
if (p instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_1__.Arc3d)
|
|
233170
233232
|
closedCurveSplitCandidate = p.sweep.isFullCircle;
|
|
233171
|
-
else if (!(p instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d) && !(p instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d))
|
|
233233
|
+
else if (!(p instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d) && !(p instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d)) // TODO: probably should do this for all types. Lots of spline-type primitives can be closed.
|
|
233172
233234
|
closedCurveSplitCandidate = p.startPoint().isAlmostEqualXY(p.endPoint(), tolerance);
|
|
233173
233235
|
if (closedCurveSplitCandidate && !this.primitiveToPair.has(p)) {
|
|
233174
233236
|
const p0 = p.clonePartialCurve(0.0, 0.5);
|
|
@@ -234124,7 +234186,7 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
234124
234186
|
handleUnionRegion(region) {
|
|
234125
234187
|
return this.handleAnyRegion(region);
|
|
234126
234188
|
}
|
|
234127
|
-
_strokeOptions;
|
|
234189
|
+
_strokeOptions; // TODO: expose to callers in RegionOps
|
|
234128
234190
|
getStrokeOptions() {
|
|
234129
234191
|
if (this._strokeOptions)
|
|
234130
234192
|
return this._strokeOptions;
|
|
@@ -234273,13 +234335,14 @@ var RegionBinaryOpType;
|
|
|
234273
234335
|
})(RegionBinaryOpType || (RegionBinaryOpType = {}));
|
|
234274
234336
|
/**
|
|
234275
234337
|
* Class `RegionOps` has static members for calculations on regions (areas).
|
|
234276
|
-
* * Regions are represented by these
|
|
234277
|
-
* *
|
|
234278
|
-
* *
|
|
234279
|
-
* The common "One outer loop and many
|
|
234280
|
-
* *
|
|
234281
|
-
* *
|
|
234282
|
-
* been rotated parallel to the xy-plane.
|
|
234338
|
+
* * Regions are represented by these [[CurveCollection]] subclasses:
|
|
234339
|
+
* * [[Loop]] -- a single loop
|
|
234340
|
+
* * [[ParityRegion]] -- a collection of loops, interpreted by parity rules.
|
|
234341
|
+
* The common "One outer loop and many inner loops" is a parity region.
|
|
234342
|
+
* * [[UnionRegion]] -- a collection of `Loop` and `ParityRegion` objects understood as a (probably disjoint) union.
|
|
234343
|
+
* * Most of the methods in this class:
|
|
234344
|
+
* * Ignore z-coordinates, so callers should ensure that input geometry has been rotated parallel to the xy-plane.
|
|
234345
|
+
* * Assume consistent Loop orientation: "solid" Loops are counterclockwise; "hole" Loops are clockwise.
|
|
234283
234346
|
* @public
|
|
234284
234347
|
*/
|
|
234285
234348
|
class RegionOps {
|
|
@@ -234314,7 +234377,8 @@ class RegionOps {
|
|
|
234314
234377
|
/**
|
|
234315
234378
|
* Return a (signed) xy area for a region.
|
|
234316
234379
|
* * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
234317
|
-
* *
|
|
234380
|
+
* * For a non-self-intersecting Loop, the returned area is negative if and only if the Loop is oriented clockwise
|
|
234381
|
+
* with respect to the positive z-axis.
|
|
234318
234382
|
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
234319
234383
|
*/
|
|
234320
234384
|
static computeXYArea(region) {
|
|
@@ -234496,10 +234560,11 @@ class RegionOps {
|
|
|
234496
234560
|
}
|
|
234497
234561
|
/**
|
|
234498
234562
|
* Return areas defined by a boolean operation.
|
|
234499
|
-
*
|
|
234500
|
-
*
|
|
234501
|
-
*
|
|
234502
|
-
* @param
|
|
234563
|
+
* @note For best results, input regions should have correctly oriented loops. See [[sortOuterAndHoleLoopsXY]].
|
|
234564
|
+
* @note A common use case of this method is to convert a region with overlapping children into one with
|
|
234565
|
+
* non-overlapping children: `regionOut = RegionOps.regionBooleanXY(regionIn, undefined, RegionBinaryOpType.Union)`.
|
|
234566
|
+
* @param loopsA first set of loops (treated as a union)
|
|
234567
|
+
* @param loopsB second set of loops (treated as a union)
|
|
234503
234568
|
* @param operation indicates Union, Intersection, Parity, AMinusB, or BMinusA
|
|
234504
234569
|
* @param mergeTolerance absolute distance tolerance for merging loops
|
|
234505
234570
|
* @returns a region resulting from merging input loops and the boolean operation. May contain bridge edges added
|
|
@@ -234817,14 +234882,15 @@ class RegionOps {
|
|
|
234817
234882
|
curves.dispatchToGeometryHandler(context);
|
|
234818
234883
|
}
|
|
234819
234884
|
/**
|
|
234820
|
-
* Reverse and reorder loops in the xy-plane for
|
|
234821
|
-
* @param loops multiple loops in any order and orientation, z-coordinates ignored
|
|
234885
|
+
* Reverse and reorder loops in the xy-plane for consistent orientation and containment.
|
|
234886
|
+
* @param loops multiple loops in any order and orientation, z-coordinates ignored.
|
|
234887
|
+
* * For best results, all overlaps should be containments, i.e., loop boundaries can touch, but should not cross.
|
|
234822
234888
|
* @returns a region that captures the input pointers. This region is a:
|
|
234823
|
-
* *
|
|
234824
|
-
* *
|
|
234889
|
+
* * [[Loop]] if there is exactly one input loop. It is oriented counterclockwise.
|
|
234890
|
+
* * [[ParityRegion]] if input consists of exactly one outer loop with at least one hole loop.
|
|
234825
234891
|
* Its first child is an outer loop oriented counterclockwise; all subsequent children are holes oriented
|
|
234826
234892
|
* clockwise.
|
|
234827
|
-
* *
|
|
234893
|
+
* * [[UnionRegion]] if any other input configuration. Its children are individually ordered/oriented as in
|
|
234828
234894
|
* the above cases.
|
|
234829
234895
|
* @see [[PolygonOps.sortOuterAndHoleLoopsXY]]
|
|
234830
234896
|
*/
|
|
@@ -234844,13 +234910,13 @@ class RegionOps {
|
|
|
234844
234910
|
* Find all xy-areas bounded by the unstructured, possibly intersecting curves.
|
|
234845
234911
|
* * For best results, input curves should be parallel to the xy-plane, as z-coordinates are ignored.
|
|
234846
234912
|
* * A common use case of this method is to assemble the bounding "exterior" loop (or loops) containing the
|
|
234847
|
-
* input curves.
|
|
234913
|
+
* input curves. Note that "holes" implied by inputs are _not_ preserved in output.
|
|
234848
234914
|
* * This method does not add bridge edges to connect outer loops to inner loops. Each disconnected loop,
|
|
234849
234915
|
* regardless of its containment, is returned as its own SignedLoops object. Pre-process with [[regionBooleanXY]]
|
|
234850
234916
|
* to add bridge edges so that [[constructAllXYRegionLoops]] will return outer and inner loops in the same
|
|
234851
234917
|
* SignedLoops object.
|
|
234852
234918
|
* @param curvesAndRegions Any collection of curves. Each Loop/ParityRegion/UnionRegion contributes its curve
|
|
234853
|
-
* primitives.
|
|
234919
|
+
* primitives, stripped of parity context. This means holes are _not_ preserved in output.
|
|
234854
234920
|
* @param tolerance optional distance tolerance for coincidence.
|
|
234855
234921
|
* @returns array of [[SignedLoops]], each entry of which describes the faces in a single connected component:
|
|
234856
234922
|
* * `positiveAreaLoops` contains "interior" loops, _including holes in ParityRegion input_. These loops have
|
|
@@ -235015,12 +235081,10 @@ class RegionOps {
|
|
|
235015
235081
|
}
|
|
235016
235082
|
/**
|
|
235017
235083
|
* Facet the region according to stroke options.
|
|
235084
|
+
* @note For best results, [[UnionRegion]] input should consist of non-overlapping children. See [[regionBooleanXY]].
|
|
235085
|
+
* @note For best results, [[ParityRegion]] input should be correctly oriented. See [[sortOuterAndHoleLoopsXY]].
|
|
235018
235086
|
* @param region a closed xy-planar region, possibly with holes.
|
|
235019
235087
|
* * The z-coordinates of the region are ignored. Caller is responsible for rotating the region into plane local coordinates beforehand, and reversing the rotation afterwards.
|
|
235020
|
-
* * For best results, `UnionRegion` input should consist of non-overlapping children.
|
|
235021
|
-
* Caller can ensure this by passing in `region = RegionOps.regionBooleanXY(unionRegion, undefined, RegionBinaryOpType.Union)`.
|
|
235022
|
-
* * For best results, `ParityRegion` input should be correctly oriented (holes have opposite orientation to their containing loop).
|
|
235023
|
-
* Caller can ensure this for non-intersecting loops by passing in `region = RegionOps.sortOuterAndHoleLoopsXY(loops)`.
|
|
235024
235088
|
* @param options primarily how to stroke the region boundary, but also how to facet the region interior.
|
|
235025
235089
|
* * By default, a triangulation is returned, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
|
|
235026
235090
|
* @returns facets for the region, or undefined if facetting failed
|
|
@@ -235083,17 +235147,19 @@ function pushToInOnOutArrays(curve, select, arrayNegative, array0, arrayPositive
|
|
|
235083
235147
|
array0.push(curve);
|
|
235084
235148
|
}
|
|
235085
235149
|
/**
|
|
235086
|
-
* * Options to control method `RegionOps.consolidateAdjacentPrimitives
|
|
235150
|
+
* * Options to control method `RegionOps.consolidateAdjacentPrimitives`.
|
|
235087
235151
|
* @public
|
|
235088
235152
|
*/
|
|
235089
235153
|
class ConsolidateAdjacentCurvePrimitivesOptions {
|
|
235090
|
-
/** True to consolidate adjacent linear geometry into a single LineString3d */
|
|
235154
|
+
/** True to consolidate adjacent linear geometry into a single LineString3d. */
|
|
235091
235155
|
consolidateLinearGeometry = true;
|
|
235092
|
-
/** True to consolidate contiguous compatible arcs into a single Arc3d */
|
|
235156
|
+
/** True to consolidate contiguous compatible arcs into a single Arc3d. */
|
|
235093
235157
|
consolidateCompatibleArcs = true;
|
|
235094
|
-
/**
|
|
235158
|
+
/** Disable LineSegment3d and LineString3d point compression. */
|
|
235159
|
+
disableLinearCompression = false;
|
|
235160
|
+
/** Tolerance for collapsing identical points (if `!disableLinearCompression`). */
|
|
235095
235161
|
duplicatePointTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance;
|
|
235096
|
-
/** Tolerance for removing interior colinear points. */
|
|
235162
|
+
/** Tolerance for removing interior colinear points (if `!disableLinearCompression`). */
|
|
235097
235163
|
colinearPointTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance;
|
|
235098
235164
|
}
|
|
235099
235165
|
|
|
@@ -245766,17 +245832,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
245766
245832
|
/**
|
|
245767
245833
|
* An `AngleSweep` is a pair of angles at start and end of an interval.
|
|
245768
245834
|
*
|
|
245769
|
-
* *
|
|
245770
|
-
* by theta = start + f*(end-start)
|
|
245771
|
-
* *
|
|
245772
|
-
* *
|
|
245773
|
-
* *
|
|
245774
|
-
* *
|
|
245775
|
-
*
|
|
245776
|
-
*
|
|
245777
|
-
*
|
|
245778
|
-
*
|
|
245779
|
-
*
|
|
245835
|
+
* * For stroking purposes, the "included interval" is all angles numerically reached
|
|
245836
|
+
* by `theta = start + f * (end - start)`, where `0 <= f <= 1`.
|
|
245837
|
+
* * This stroking formula is simple numbers -- 2PI shifts are not involved.
|
|
245838
|
+
* * 2PI shifts do become important in the reverse mapping of an angle to a fraction.
|
|
245839
|
+
* * Angles greater than 360 and less than 0 are fine as endpoints.
|
|
245840
|
+
* * An AngleSweep determines orientation only _in concert with a reference vector_, e.g., a plane normal like (0,0,1).
|
|
245841
|
+
* * Be careful reading orientation from an AngleSweep without a reference vector!
|
|
245842
|
+
* * If "start < end" the angles in the sweep proceed counterclockwise around the reference vector.
|
|
245843
|
+
* * If "start > end" the angles in the sweep proceed clockwise around the reference vector.
|
|
245844
|
+
* * (350,370) covers the same angles as (-10,10), and both sweeps are counterclockwise around the reference vector.
|
|
245845
|
+
* * (370,350) covers the same angles as (10,-10), and both sweeps are clockwise around the reference vector.
|
|
245846
|
+
* * (370,350) covers the same angles as (-10,10), but the sweeps have opposite orientation.
|
|
245847
|
+
* * Math details can be found at docs/learning/geometry/Angle.md .
|
|
245848
|
+
* * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/AngleSweep .
|
|
245780
245849
|
* @public
|
|
245781
245850
|
*/
|
|
245782
245851
|
class AngleSweep {
|
|
@@ -251402,8 +251471,12 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
251402
251471
|
}
|
|
251403
251472
|
}
|
|
251404
251473
|
/** get range of points. */
|
|
251405
|
-
getRange(transform) {
|
|
251406
|
-
|
|
251474
|
+
getRange(transform, result) {
|
|
251475
|
+
let range = result;
|
|
251476
|
+
if (range)
|
|
251477
|
+
range.setNull();
|
|
251478
|
+
else
|
|
251479
|
+
range = _Range__WEBPACK_IMPORTED_MODULE_5__.Range3d.createNull();
|
|
251407
251480
|
this.extendRange(range, transform);
|
|
251408
251481
|
return range;
|
|
251409
251482
|
}
|
|
@@ -251756,6 +251829,20 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
251756
251829
|
this._data[i + componentIndex] = q;
|
|
251757
251830
|
}
|
|
251758
251831
|
}
|
|
251832
|
+
/**
|
|
251833
|
+
* Pass the (x,y,z) of each point to a function which returns a replacement for the point.
|
|
251834
|
+
* * @param func function to be called as `func(x,y,z)`, returning a replacement point.
|
|
251835
|
+
*/
|
|
251836
|
+
mapPoint(func) {
|
|
251837
|
+
const n = this._data.length;
|
|
251838
|
+
let q;
|
|
251839
|
+
for (let i = 0; i + 2 < n; i += 3) {
|
|
251840
|
+
q = func(this._data[i], this._data[i + 1], this._data[i + 2]);
|
|
251841
|
+
this._data[i] = q.x;
|
|
251842
|
+
this._data[i + 1] = q.y;
|
|
251843
|
+
this._data[i + 2] = q.z;
|
|
251844
|
+
}
|
|
251845
|
+
}
|
|
251759
251846
|
}
|
|
251760
251847
|
|
|
251761
251848
|
|
|
@@ -252091,13 +252178,17 @@ class IndexedXYZCollection {
|
|
|
252091
252178
|
return (i % this.length);
|
|
252092
252179
|
}
|
|
252093
252180
|
/** Return the range of the points. */
|
|
252094
|
-
getRange() {
|
|
252095
|
-
|
|
252181
|
+
getRange(transform, result) {
|
|
252182
|
+
let range = result;
|
|
252183
|
+
if (range)
|
|
252184
|
+
range.setNull();
|
|
252185
|
+
else
|
|
252186
|
+
range = _Range__WEBPACK_IMPORTED_MODULE_2__.Range3d.createNull();
|
|
252096
252187
|
const n = this.length;
|
|
252097
252188
|
const point = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
252098
252189
|
for (let i = 0; i < n; i++) {
|
|
252099
252190
|
this.getPoint3dAtUncheckedPointIndex(i, point);
|
|
252100
|
-
range.extendPoint(point);
|
|
252191
|
+
range.extendPoint(point, transform);
|
|
252101
252192
|
}
|
|
252102
252193
|
return range;
|
|
252103
252194
|
}
|
|
@@ -255572,7 +255663,12 @@ class Plane3d {
|
|
|
255572
255663
|
* * Classes with a purely implicit equation of their plane can accept the default implementation
|
|
255573
255664
|
*/
|
|
255574
255665
|
getAnyPointOnPlane(result) {
|
|
255575
|
-
return this.
|
|
255666
|
+
return this.projectXYZToPlane(0, 0, 0, result);
|
|
255667
|
+
}
|
|
255668
|
+
/** Return the projection of (x,y,z) onto the plane. */
|
|
255669
|
+
projectXYZToPlane(x, y, z, result) {
|
|
255670
|
+
const point = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(x, y, z, result);
|
|
255671
|
+
return this.projectPointToPlane(point, point);
|
|
255576
255672
|
}
|
|
255577
255673
|
}
|
|
255578
255674
|
|
|
@@ -255917,7 +256013,12 @@ class Plane3dByOriginAndUnitNormal extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__
|
|
|
255917
256013
|
}
|
|
255918
256014
|
/** Return the projection of spacePoint onto the plane. */
|
|
255919
256015
|
projectPointToPlane(spacePoint, result) {
|
|
255920
|
-
return
|
|
256016
|
+
return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);
|
|
256017
|
+
}
|
|
256018
|
+
/** Return the projection of (x,y,z) onto the plane. */
|
|
256019
|
+
projectXYZToPlane(x, y, z, result) {
|
|
256020
|
+
const scale = -this._normal.dotProductStartEndXYZ(this._origin, x, y, z);
|
|
256021
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(x + scale * this._normal.x, y + scale * this._normal.y, z + scale * this._normal.z, result);
|
|
255921
256022
|
}
|
|
255922
256023
|
/**
|
|
255923
256024
|
* Returns true if spacePoint is within distance tolerance of the plane.
|
|
@@ -256300,30 +256401,38 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
|
|
|
256300
256401
|
}
|
|
256301
256402
|
/**
|
|
256302
256403
|
* Return the projection of spacePoint onto the plane.
|
|
256303
|
-
* If the plane is degenerate to a ray, project to the ray.
|
|
256304
|
-
* If the plane is degenerate to its origin, return the point
|
|
256404
|
+
* * If the plane is degenerate to a ray, project to the ray.
|
|
256405
|
+
* * If the plane is degenerate to its origin, return the point.
|
|
256305
256406
|
*/
|
|
256306
256407
|
projectPointToPlane(spacePoint, result) {
|
|
256408
|
+
return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);
|
|
256409
|
+
}
|
|
256410
|
+
/**
|
|
256411
|
+
* Return the projection of (x,y,z) onto the plane.
|
|
256412
|
+
* * If the plane is degenerate to a ray, project to the ray.
|
|
256413
|
+
* * If the plane is degenerate to its origin, return the point.
|
|
256414
|
+
*/
|
|
256415
|
+
projectXYZToPlane(x, y, z, result) {
|
|
256307
256416
|
const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
|
|
256308
256417
|
if (unitNormal !== undefined) {
|
|
256309
|
-
const
|
|
256310
|
-
return
|
|
256418
|
+
const scale = -unitNormal.dotProductStartEndXYZ(this.origin, x, y, z);
|
|
256419
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x + scale * unitNormal.x, y + scale * unitNormal.y, z + scale * unitNormal.z, result);
|
|
256311
256420
|
}
|
|
256312
|
-
//
|
|
256313
|
-
//
|
|
256421
|
+
// vectorU and vectorV are colinear or zero.
|
|
256422
|
+
// Project to ray defined by the longer one, or just to origin.
|
|
256314
256423
|
const dotUU = this.vectorU.magnitudeSquared();
|
|
256315
256424
|
const dotVV = this.vectorV.magnitudeSquared();
|
|
256316
256425
|
if (dotUU >= dotVV) {
|
|
256317
|
-
const dotUW = this.vectorU.
|
|
256426
|
+
const dotUW = this.vectorU.dotProductStartEndXYZ(this.origin, x, y, z);
|
|
256318
256427
|
const f = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.conditionalDivideCoordinate(dotUW, dotUU, 0.0);
|
|
256319
256428
|
if (f !== undefined)
|
|
256320
|
-
return
|
|
256429
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x + f * this.vectorU.x, y + f * this.vectorU.y, z + f * this.vectorU.z, result);
|
|
256321
256430
|
}
|
|
256322
256431
|
else {
|
|
256323
|
-
const dotVW = this.vectorV.
|
|
256432
|
+
const dotVW = this.vectorV.dotProductStartEndXYZ(this.origin, x, y, z);
|
|
256324
256433
|
const f = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.conditionalDivideCoordinate(dotVW, dotVV, 0.0);
|
|
256325
256434
|
if (f !== undefined)
|
|
256326
|
-
return
|
|
256435
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x + f * this.vectorV.x, y + f * this.vectorV.y, z + f * this.vectorV.z, result);
|
|
256327
256436
|
}
|
|
256328
256437
|
return this.origin.clone(result);
|
|
256329
256438
|
}
|
|
@@ -258775,7 +258884,7 @@ class Vector3d extends XYZ {
|
|
|
258775
258884
|
/**
|
|
258776
258885
|
* Return the (strongly-typed) angle from this vector to vectorB, using only the xy parts.
|
|
258777
258886
|
* * The returned angle is between -180 and 180 degrees.
|
|
258778
|
-
* * Use
|
|
258887
|
+
* * Use [[planarAngleTo]] and [[signedAngleTo]] to return an angle measured in a specific plane.
|
|
258779
258888
|
* @param vectorB target vector.
|
|
258780
258889
|
*/
|
|
258781
258890
|
angleToXY(vectorB) {
|
|
@@ -258788,7 +258897,7 @@ class Vector3d extends XYZ {
|
|
|
258788
258897
|
* * If the cross product of `this` vector and `vectorB` lies on the same side of the plane as `vectorW`,
|
|
258789
258898
|
* this function returns `radiansTo(vectorB)`; otherwise, it returns `-radiansTo(vectorB)`.
|
|
258790
258899
|
* * `vectorW` does not have to be perpendicular to the plane.
|
|
258791
|
-
* * Use
|
|
258900
|
+
* * Use [[planarRadiansTo]] to measure the angle between vectors that are projected to another plane.
|
|
258792
258901
|
* @param vectorB target vector.
|
|
258793
258902
|
* @param vectorW determines the side of the plane in which the returned angle is measured
|
|
258794
258903
|
*/
|
|
@@ -258808,7 +258917,7 @@ class Vector3d extends XYZ {
|
|
|
258808
258917
|
* * If the cross product of this vector and vectorB lies on the same side of the plane as vectorW,
|
|
258809
258918
|
* this function returns `angleTo(vectorB)`; otherwise, it returns `-angleTo(vectorB)`.
|
|
258810
258919
|
* * `vectorW` does not have to be perpendicular to the plane.
|
|
258811
|
-
* * Use
|
|
258920
|
+
* * Use [[planarAngleTo]] to measure the angle between vectors that are projected to another plane.
|
|
258812
258921
|
* @param vectorB target vector.
|
|
258813
258922
|
* @param vectorW determines the side of the plane in which the returned angle is measured
|
|
258814
258923
|
*/
|
|
@@ -259071,9 +259180,9 @@ class NumberArray {
|
|
|
259071
259180
|
return a;
|
|
259072
259181
|
}
|
|
259073
259182
|
/**
|
|
259074
|
-
* Return an array with indicated start and end points, maximum step size
|
|
259075
|
-
* @param low
|
|
259076
|
-
* @param high
|
|
259183
|
+
* Return an array with indicated start and end points, and maximum step size.
|
|
259184
|
+
* @param low first value in returned array
|
|
259185
|
+
* @param high last value in returned array
|
|
259077
259186
|
* @param step max permitted step
|
|
259078
259187
|
*/
|
|
259079
259188
|
static createArrayWithMaxStepSize(low, high, step) {
|
|
@@ -259264,13 +259373,32 @@ class NumberArray {
|
|
|
259264
259373
|
*/
|
|
259265
259374
|
class Point2dArray {
|
|
259266
259375
|
/** Return true if arrays have same length and matching coordinates. */
|
|
259267
|
-
static isAlmostEqual(dataA, dataB) {
|
|
259376
|
+
static isAlmostEqual(dataA, dataB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
259268
259377
|
if (dataA && dataB) {
|
|
259269
|
-
if (dataA
|
|
259270
|
-
|
|
259271
|
-
|
|
259272
|
-
|
|
259378
|
+
if (dataA instanceof Float64Array && dataB instanceof Float64Array) {
|
|
259379
|
+
if (dataA.length !== dataB.length)
|
|
259380
|
+
return false;
|
|
259381
|
+
for (let i = 0; i < dataA.length; i++)
|
|
259382
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(dataA[i], dataB[i], tolerance))
|
|
259383
|
+
return false;
|
|
259384
|
+
}
|
|
259385
|
+
else if (Array.isArray(dataA) && Array.isArray(dataB)) {
|
|
259386
|
+
if (dataA.length !== dataB.length)
|
|
259387
|
+
return false;
|
|
259388
|
+
for (let i = 0; i < dataA.length; i++)
|
|
259389
|
+
if (!dataA[i].isAlmostEqual(dataB[i], tolerance))
|
|
259390
|
+
return false;
|
|
259391
|
+
}
|
|
259392
|
+
else { // different types
|
|
259393
|
+
const points = dataA instanceof Float64Array ? dataB : dataA;
|
|
259394
|
+
const numbers = dataA instanceof Float64Array ? dataA : dataB;
|
|
259395
|
+
if (numbers.length !== points.length * 2)
|
|
259273
259396
|
return false;
|
|
259397
|
+
for (let iPoint = 0; iPoint < points.length; ++iPoint) {
|
|
259398
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].x, numbers[2 * iPoint], tolerance) ||
|
|
259399
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].y, numbers[2 * iPoint + 1], tolerance))
|
|
259400
|
+
return false;
|
|
259401
|
+
}
|
|
259274
259402
|
}
|
|
259275
259403
|
return true;
|
|
259276
259404
|
}
|
|
@@ -259307,13 +259435,34 @@ class Point2dArray {
|
|
|
259307
259435
|
*/
|
|
259308
259436
|
class Vector3dArray {
|
|
259309
259437
|
/** Return true if arrays have same length and matching coordinates. */
|
|
259310
|
-
static isAlmostEqual(dataA, dataB) {
|
|
259438
|
+
static isAlmostEqual(dataA, dataB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
259311
259439
|
if (dataA && dataB) {
|
|
259312
|
-
if (dataA
|
|
259313
|
-
|
|
259314
|
-
for (let i = 0; i < dataA.length; i++)
|
|
259315
|
-
if (!dataA[i].isAlmostEqual(dataB[i]))
|
|
259440
|
+
if (dataA instanceof Float64Array && dataB instanceof Float64Array) {
|
|
259441
|
+
if (dataA.length !== dataB.length)
|
|
259316
259442
|
return false;
|
|
259443
|
+
for (let i = 0; i < dataA.length; i++)
|
|
259444
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(dataA[i], dataB[i], tolerance))
|
|
259445
|
+
return false;
|
|
259446
|
+
}
|
|
259447
|
+
else if (Array.isArray(dataA) && Array.isArray(dataB)) {
|
|
259448
|
+
if (dataA.length !== dataB.length)
|
|
259449
|
+
return false;
|
|
259450
|
+
for (let i = 0; i < dataA.length; i++)
|
|
259451
|
+
if (!dataA[i].isAlmostEqual(dataB[i], tolerance))
|
|
259452
|
+
return false;
|
|
259453
|
+
}
|
|
259454
|
+
else { // different types
|
|
259455
|
+
const points = dataA instanceof Float64Array ? dataB : dataA;
|
|
259456
|
+
const numbers = dataA instanceof Float64Array ? dataA : dataB;
|
|
259457
|
+
if (numbers.length !== points.length * 3)
|
|
259458
|
+
return false;
|
|
259459
|
+
for (let iPoint = 0; iPoint < points.length; ++iPoint) {
|
|
259460
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].x, numbers[3 * iPoint], tolerance) ||
|
|
259461
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].y, numbers[3 * iPoint + 1], tolerance) ||
|
|
259462
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].z, numbers[3 * iPoint + 2], tolerance))
|
|
259463
|
+
return false;
|
|
259464
|
+
}
|
|
259465
|
+
}
|
|
259317
259466
|
return true;
|
|
259318
259467
|
}
|
|
259319
259468
|
return (dataA === undefined && dataB === undefined);
|
|
@@ -259432,20 +259581,20 @@ class Point4dArray {
|
|
|
259432
259581
|
}
|
|
259433
259582
|
}
|
|
259434
259583
|
/** Test arrays for near equality of all corresponding numeric values, treated as coordinates. */
|
|
259435
|
-
static isAlmostEqual(dataA, dataB) {
|
|
259584
|
+
static isAlmostEqual(dataA, dataB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
259436
259585
|
if (dataA && dataB) {
|
|
259437
259586
|
if (dataA instanceof Float64Array && dataB instanceof Float64Array) {
|
|
259438
259587
|
if (dataA.length !== dataB.length)
|
|
259439
259588
|
return false;
|
|
259440
259589
|
for (let i = 0; i < dataA.length; i++)
|
|
259441
|
-
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(dataA[i], dataB[i]))
|
|
259590
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(dataA[i], dataB[i], tolerance))
|
|
259442
259591
|
return false;
|
|
259443
259592
|
}
|
|
259444
259593
|
else if (Array.isArray(dataA) && Array.isArray(dataB)) {
|
|
259445
259594
|
if (dataA.length !== dataB.length)
|
|
259446
259595
|
return false;
|
|
259447
259596
|
for (let i = 0; i < dataA.length; i++)
|
|
259448
|
-
if (!dataA[i].isAlmostEqual(dataB[i]))
|
|
259597
|
+
if (!dataA[i].isAlmostEqual(dataB[i], tolerance))
|
|
259449
259598
|
return false;
|
|
259450
259599
|
}
|
|
259451
259600
|
else { // different types
|
|
@@ -259454,10 +259603,10 @@ class Point4dArray {
|
|
|
259454
259603
|
if (numbers.length !== points.length * 4)
|
|
259455
259604
|
return false;
|
|
259456
259605
|
for (let iPoint = 0; iPoint < points.length; ++iPoint) {
|
|
259457
|
-
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].x, numbers[4 * iPoint]) ||
|
|
259458
|
-
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].y, numbers[4 * iPoint + 1]) ||
|
|
259459
|
-
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].z, numbers[4 * iPoint + 2]) ||
|
|
259460
|
-
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].w, numbers[4 * iPoint + 3]))
|
|
259606
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].x, numbers[4 * iPoint], tolerance) ||
|
|
259607
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].y, numbers[4 * iPoint + 1], tolerance) ||
|
|
259608
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].z, numbers[4 * iPoint + 2], tolerance) ||
|
|
259609
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].w, numbers[4 * iPoint + 3], tolerance))
|
|
259461
259610
|
return false;
|
|
259462
259611
|
}
|
|
259463
259612
|
}
|
|
@@ -259697,20 +259846,20 @@ class Point3dArray {
|
|
|
259697
259846
|
}
|
|
259698
259847
|
}
|
|
259699
259848
|
/** Test arrays for near equality of all corresponding numeric values, treated as coordinates. */
|
|
259700
|
-
static isAlmostEqual(dataA, dataB) {
|
|
259849
|
+
static isAlmostEqual(dataA, dataB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
259701
259850
|
if (dataA && dataB) {
|
|
259702
259851
|
if (dataA instanceof Float64Array && dataB instanceof Float64Array) {
|
|
259703
259852
|
if (dataA.length !== dataB.length)
|
|
259704
259853
|
return false;
|
|
259705
259854
|
for (let i = 0; i < dataA.length; i++)
|
|
259706
|
-
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(dataA[i], dataB[i]))
|
|
259855
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(dataA[i], dataB[i], tolerance))
|
|
259707
259856
|
return false;
|
|
259708
259857
|
}
|
|
259709
259858
|
else if (Array.isArray(dataA) && Array.isArray(dataB)) {
|
|
259710
259859
|
if (dataA.length !== dataB.length)
|
|
259711
259860
|
return false;
|
|
259712
259861
|
for (let i = 0; i < dataA.length; i++)
|
|
259713
|
-
if (!dataA[i].isAlmostEqual(dataB[i]))
|
|
259862
|
+
if (!dataA[i].isAlmostEqual(dataB[i], tolerance))
|
|
259714
259863
|
return false;
|
|
259715
259864
|
}
|
|
259716
259865
|
else { // different types
|
|
@@ -259719,9 +259868,9 @@ class Point3dArray {
|
|
|
259719
259868
|
if (numbers.length !== points.length * 3)
|
|
259720
259869
|
return false;
|
|
259721
259870
|
for (let iPoint = 0; iPoint < points.length; ++iPoint) {
|
|
259722
|
-
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].x, numbers[3 * iPoint]) ||
|
|
259723
|
-
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].y, numbers[3 * iPoint + 1]) ||
|
|
259724
|
-
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].z, numbers[3 * iPoint + 2]))
|
|
259871
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].x, numbers[3 * iPoint], tolerance) ||
|
|
259872
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].y, numbers[3 * iPoint + 1], tolerance) ||
|
|
259873
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].z, numbers[3 * iPoint + 2], tolerance))
|
|
259725
259874
|
return false;
|
|
259726
259875
|
}
|
|
259727
259876
|
}
|
|
@@ -261023,6 +261172,41 @@ class PolygonOps {
|
|
|
261023
261172
|
}
|
|
261024
261173
|
}
|
|
261025
261174
|
}
|
|
261175
|
+
/**
|
|
261176
|
+
* Compute the signed volume of the truncated prism between a facet and a plane.
|
|
261177
|
+
* * Useful for parallel algorithms.
|
|
261178
|
+
* @param facetPoints input 3D polygon; on return the points are projected onto the plane. Wraparound point is optional.
|
|
261179
|
+
* @param plane infinite plane bounding volume between the facet and (virtual) side facets perpendicular to the plane (unmodified).
|
|
261180
|
+
* @param options optional flags and pre-allocated temporary storage.
|
|
261181
|
+
* @returns computed data for this facet:
|
|
261182
|
+
* * `volume6`: six times the signed volume of the truncated prism between the facet and the plane.
|
|
261183
|
+
* * `area2`: two times the signed area of the facet's projection onto the plane.
|
|
261184
|
+
* * `origin`: origin of the facet used to accumulate area moments.
|
|
261185
|
+
* * `products`: raw accumulated second moment area products of the facet's projection onto the plane.
|
|
261186
|
+
* @see [[PolyfaceQuery.sumVolumeBetweenFacetsAndPlane]]
|
|
261187
|
+
*/
|
|
261188
|
+
static volumeBetweenPolygonAndPlane(facetPoints, plane, options) {
|
|
261189
|
+
let origin;
|
|
261190
|
+
let products;
|
|
261191
|
+
let singleProjectedFacetAreaTimes2 = 0.0;
|
|
261192
|
+
let signedTruncatedPrismVolumeTimes6 = 0.0;
|
|
261193
|
+
const h0 = facetPoints.evaluateUncheckedIndexPlaneAltitude(0, plane);
|
|
261194
|
+
for (let i = 1; i + 1 < facetPoints.length; i++) {
|
|
261195
|
+
const triangleNormal = facetPoints.crossProductIndexIndexIndex(0, i, i + 1, options?.workVector);
|
|
261196
|
+
const hA = facetPoints.evaluateUncheckedIndexPlaneAltitude(i, plane);
|
|
261197
|
+
const hB = facetPoints.evaluateUncheckedIndexPlaneAltitude(i + 1, plane);
|
|
261198
|
+
const signedProjectedTriangleAreaTimes2 = triangleNormal.dotProductXYZ(plane.normalX(), plane.normalY(), plane.normalZ());
|
|
261199
|
+
singleProjectedFacetAreaTimes2 += signedProjectedTriangleAreaTimes2;
|
|
261200
|
+
signedTruncatedPrismVolumeTimes6 += signedProjectedTriangleAreaTimes2 * (h0 + hA + hB);
|
|
261201
|
+
}
|
|
261202
|
+
if (!options?.skipMoments) {
|
|
261203
|
+
origin = facetPoints.getPoint3dAtUncheckedPointIndex(0, options?.workPoint0);
|
|
261204
|
+
products = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_4__.Matrix4d.createZero(options?.workMatrix);
|
|
261205
|
+
facetPoints.mapPoint((x, y, z) => plane.projectXYZToPlane(x, y, z, options?.workPoint1));
|
|
261206
|
+
PolygonOps.addSecondMomentAreaProducts(facetPoints, origin, products);
|
|
261207
|
+
}
|
|
261208
|
+
return { volume6: signedTruncatedPrismVolumeTimes6, area2: singleProjectedFacetAreaTimes2, origin, products };
|
|
261209
|
+
}
|
|
261026
261210
|
/** Test the direction of turn at the vertices of the polygon, ignoring z-coordinates.
|
|
261027
261211
|
* * For a polygon without self-intersections and successive colinear edges, this is a convexity and orientation test: all positive is convex and counterclockwise, all negative is convex and clockwise.
|
|
261028
261212
|
* * Beware that a polygon which turns through more than a full turn can cross itself and close, but is not convex.
|
|
@@ -261176,8 +261360,9 @@ class PolygonOps {
|
|
|
261176
261360
|
return numReverse;
|
|
261177
261361
|
}
|
|
261178
261362
|
/**
|
|
261179
|
-
* Reverse and reorder loops in the xy-plane for
|
|
261180
|
-
* @param loops multiple polygons in any order and orientation, z-coordinates ignored
|
|
261363
|
+
* Reverse and reorder loops in the xy-plane for consistent orientation and containment.
|
|
261364
|
+
* @param loops multiple polygons in any order and orientation, z-coordinates ignored.
|
|
261365
|
+
* * For best results, all overlaps should be containments, i.e., loop boundaries can touch, but should not cross.
|
|
261181
261366
|
* @returns array of arrays of polygons that capture the input pointers. In each first level array:
|
|
261182
261367
|
* * The first polygon is an outer loop, oriented counterclockwise.
|
|
261183
261368
|
* * Any subsequent polygons are holes of the outer loop, oriented clockwise.
|
|
@@ -262220,17 +262405,21 @@ class PolylineCompressionContext {
|
|
|
262220
262405
|
context.acceptPointByIndex(indexA);
|
|
262221
262406
|
context.recursiveCompressByChordErrorGo(indexA, indexB);
|
|
262222
262407
|
}
|
|
262223
|
-
/**
|
|
262224
|
-
*
|
|
262408
|
+
/**
|
|
262409
|
+
* Return a simplified subset of given points, omitting a point if very close to its predecessor.
|
|
262410
|
+
* * This is a local search, with a single pass over the data.
|
|
262411
|
+
* * First and last points are always retained.
|
|
262412
|
+
* @param data input points
|
|
262413
|
+
* @param maxEdgeLength length of largest edge to be compressed out
|
|
262225
262414
|
*/
|
|
262226
|
-
static compressInPlaceByShortEdgeLength(data,
|
|
262415
|
+
static compressInPlaceByShortEdgeLength(data, maxEdgeLength) {
|
|
262227
262416
|
const n = data.length;
|
|
262228
262417
|
if (n < 2)
|
|
262229
262418
|
return;
|
|
262230
262419
|
let lastAcceptedIndex = 0;
|
|
262231
262420
|
// back up from final point ..
|
|
262232
262421
|
let indexB = n - 1;
|
|
262233
|
-
while (indexB > 0 && data.distanceIndexIndex(indexB - 1, n - 1)
|
|
262422
|
+
while (indexB > 0 && data.distanceIndexIndex(indexB - 1, n - 1) <= maxEdgeLength)
|
|
262234
262423
|
indexB--;
|
|
262235
262424
|
if (indexB === 0) {
|
|
262236
262425
|
// Theres only one point there.
|
|
@@ -262243,7 +262432,7 @@ class PolylineCompressionContext {
|
|
|
262243
262432
|
let candidateIndex = lastAcceptedIndex + 1;
|
|
262244
262433
|
while (candidateIndex <= indexB) {
|
|
262245
262434
|
const d = data.distanceIndexIndex(lastAcceptedIndex, candidateIndex);
|
|
262246
|
-
if (d
|
|
262435
|
+
if (d > maxEdgeLength) {
|
|
262247
262436
|
data.moveIndexToIndex(candidateIndex, lastAcceptedIndex + 1);
|
|
262248
262437
|
lastAcceptedIndex++;
|
|
262249
262438
|
}
|
|
@@ -262251,10 +262440,13 @@ class PolylineCompressionContext {
|
|
|
262251
262440
|
}
|
|
262252
262441
|
data.length = lastAcceptedIndex + 1;
|
|
262253
262442
|
}
|
|
262254
|
-
/**
|
|
262255
|
-
*
|
|
262443
|
+
/**
|
|
262444
|
+
* Return a simplified subset of given points, omitting the middle of three successive points if the triangle they form is small.
|
|
262445
|
+
* * This is a local search, with a single pass over the data.
|
|
262446
|
+
* @param data input points
|
|
262447
|
+
* @param maxTriangleArea area of largest triangle to compress
|
|
262256
262448
|
*/
|
|
262257
|
-
static compressInPlaceBySmallTriangleArea(data,
|
|
262449
|
+
static compressInPlaceBySmallTriangleArea(data, maxTriangleArea) {
|
|
262258
262450
|
const n = data.length;
|
|
262259
262451
|
if (n < 3)
|
|
262260
262452
|
return;
|
|
@@ -262262,7 +262454,7 @@ class PolylineCompressionContext {
|
|
|
262262
262454
|
const cross = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
262263
262455
|
for (let i1 = 1; i1 + 1 < n; i1++) {
|
|
262264
262456
|
data.crossProductIndexIndexIndex(lastAcceptedIndex, i1, i1 + 1, cross);
|
|
262265
|
-
if (0.5 * cross.magnitude() >
|
|
262457
|
+
if (0.5 * cross.magnitude() > maxTriangleArea) {
|
|
262266
262458
|
data.moveIndexToIndex(i1, ++lastAcceptedIndex);
|
|
262267
262459
|
}
|
|
262268
262460
|
}
|
|
@@ -262403,10 +262595,11 @@ class PolylineOps {
|
|
|
262403
262595
|
return _PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_1__.PolylineCompressionContext.compressPoint3dArrayByChordError(source, chordTolerance);
|
|
262404
262596
|
}
|
|
262405
262597
|
/**
|
|
262406
|
-
* Return a simplified subset of given points, omitting
|
|
262598
|
+
* Return a simplified subset of given points, omitting a point if very close to its predecessor.
|
|
262407
262599
|
* * This is a local search, with a single pass over the data.
|
|
262600
|
+
* * First and last points are always retained.
|
|
262408
262601
|
* @param source input points
|
|
262409
|
-
* @param maxEdgeLength
|
|
262602
|
+
* @param maxEdgeLength length of largest edge to be compressed out
|
|
262410
262603
|
* @see [[GrowableXYZArray.cloneCompressed]]
|
|
262411
262604
|
*/
|
|
262412
262605
|
static compressShortEdges(source, maxEdgeLength) {
|
|
@@ -262415,10 +262608,10 @@ class PolylineOps {
|
|
|
262415
262608
|
return dest.getPoint3dArray();
|
|
262416
262609
|
}
|
|
262417
262610
|
/**
|
|
262418
|
-
* Return a simplified subset of given points, omitting
|
|
262611
|
+
* Return a simplified subset of given points, omitting the middle of three successive points if the triangle they form is small.
|
|
262419
262612
|
* * This is a local search, with a single pass over the data.
|
|
262420
262613
|
* @param source input points
|
|
262421
|
-
* @param
|
|
262614
|
+
* @param maxTriangleArea area of largest triangle to compress
|
|
262422
262615
|
*/
|
|
262423
262616
|
static compressSmallTriangles(source, maxTriangleArea) {
|
|
262424
262617
|
const dest = _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_2__.GrowableXYZArray.create(source);
|
|
@@ -264917,41 +265110,29 @@ class Ray3d {
|
|
|
264917
265110
|
*/
|
|
264918
265111
|
intersectionWithTriangle(vertex0, vertex1, vertex2, distanceTol, parameterTol, result) {
|
|
264919
265112
|
/**
|
|
264920
|
-
*
|
|
265113
|
+
* Let (w,u,v) be the barycentric coordinates of point P wrt the triangle (v0,v1,v2), such that
|
|
264921
265114
|
* P = w*v0 + u*v1 + v*v2 = (1-u-v)*v0 + u*v1 + v*v2 = v0 + u*(v1-v0) + v*(v2-v0)
|
|
264922
265115
|
*
|
|
264923
|
-
* Then if ray intersects triangle at
|
|
265116
|
+
* Then if the ray given by rayOrigin + t*rayVector intersects the triangle at P, we have
|
|
264924
265117
|
* v0 + u*(v1-v0) + v*(v2-v0) = rayOrigin + t*rayVector
|
|
264925
|
-
* or
|
|
264926
|
-
* -t*rayVector + u*(v1-v0) + v*(v2-v0) = rayOrigin - v0
|
|
264927
265118
|
*
|
|
264928
265119
|
* This equation can be reformulated as the following linear system:
|
|
264929
265120
|
*
|
|
264930
265121
|
* [ | | | ] [t] [ | ]
|
|
264931
265122
|
* [-rayVector v1-v0 v2-v0] [u] = [rayOrigin - v0]
|
|
264932
|
-
* [
|
|
264933
|
-
*
|
|
264934
|
-
* Then to find t, u, and v use Cramer's Rule and also the fact that if matrix A = [c1,c2,c3], then
|
|
264935
|
-
* det(A) = c1.(c2 x c3) which leads to
|
|
264936
|
-
*
|
|
264937
|
-
* t = [(rayOrigin - v0).((v1-v0) x (v2-v0))] / [-rayVector.((v1-v0) x (v2-v0))]
|
|
264938
|
-
* u = [-rayVector.((rayOrigin - v0) x (v2-v0))] / [-rayVector.((v1-v0) x (v2-v0))]
|
|
264939
|
-
* v = [-rayVector.((v1-v0) x (rayOrigin - v0))] / [-rayVector.((v1-v0) x (v2-v0))]
|
|
265123
|
+
* [ | | | ] [v] [ | ]
|
|
264940
265124
|
*
|
|
264941
|
-
*
|
|
264942
|
-
*
|
|
265125
|
+
* Then to find t, u, and v, use Cramer's Rule, the formulation of matrix determinant as column triple product,
|
|
265126
|
+
* and the fact that swapping any 2 vectors in the triple product negates it:
|
|
264943
265127
|
*
|
|
264944
|
-
*
|
|
264945
|
-
*
|
|
264946
|
-
*
|
|
264947
|
-
* v = [-rayVector.((rayOrigin - v0) x (v1-v0))] / [(v1-v0).(rayVector x (v2-v0))]
|
|
265128
|
+
* t = (v2-v0).(rayOrigin - v0) x (v1-v0) / (v1-v0).rayVector x (v2-v0)
|
|
265129
|
+
* u = (rayOrigin - v0).rayVector x (v2-v0) / (v1-v0).rayVector x (v2-v0)
|
|
265130
|
+
* v = -rayVector.(rayOrigin - v0) x (v1-v0) / (v1-v0).rayVector x (v2-v0)
|
|
264948
265131
|
*
|
|
264949
|
-
* Note that we
|
|
264950
|
-
*
|
|
264951
|
-
* 0 <= w <= 1.
|
|
265132
|
+
* Note that we verify 0 <= u,v,w <= 1. To do so we only need to check 0 <= u <= 1, 0 <= v, and u+v <= 1:
|
|
265133
|
+
* these 4 checks guarantee that v <= 1 and 0 <= u+v, and so with w = 1-(u+v), we have 0 <= w <= 1.
|
|
264952
265134
|
*
|
|
264953
|
-
* More info be found at
|
|
264954
|
-
* https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm
|
|
265135
|
+
* More info be found at https://en.wikipedia.org/wiki/Moller-Trumbore_intersection_algorithm.
|
|
264955
265136
|
*/
|
|
264956
265137
|
if (distanceTol === undefined || distanceTol < 0) // we explicitly allow zero tolerance
|
|
264957
265138
|
distanceTol = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance;
|
|
@@ -265994,27 +266175,46 @@ class Transform {
|
|
|
265994
266175
|
return result;
|
|
265995
266176
|
}
|
|
265996
266177
|
/**
|
|
265997
|
-
* Create a Transform
|
|
265998
|
-
* @
|
|
266178
|
+
* Create a Transform with given origin and a rigid matrix constructed from two column vectors.
|
|
266179
|
+
* @param origin origin of the local coordinate system. Default is the global origin (zero).
|
|
266180
|
+
* @param vectorX first axis passed into `Matrix3d.createRigidFromColumns`.
|
|
266181
|
+
* @param vectorY second axis passed into `Matrix3d.createRigidFromColumns`.
|
|
266182
|
+
* @param axisOrder order of axis construction in `Matrix3d.createRigidFromColumns(vectorX, vectorY, axisOrder)`.
|
|
266183
|
+
* @param result optional pre-allocated result to populate and return.
|
|
266184
|
+
* @returns localToWorld transform for a local coordinate system with given origin and ordered axes, or `undefined`
|
|
266185
|
+
* if the rigid matrix could not be created.
|
|
266186
|
+
* @see [[Matrix3d.createRigidFromColumns]]
|
|
265999
266187
|
*/
|
|
266000
266188
|
static createRigidFromOriginAndColumns(origin, vectorX, vectorY, axisOrder, result) {
|
|
266001
|
-
const matrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidFromColumns(vectorX, vectorY, axisOrder, result
|
|
266189
|
+
const matrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidFromColumns(vectorX, vectorY, axisOrder, result?._matrix);
|
|
266002
266190
|
if (!matrix)
|
|
266003
266191
|
return undefined;
|
|
266004
266192
|
if (result) {
|
|
266005
|
-
// result._matrix was already modified to become rigid via createRigidFromColumns
|
|
266006
266193
|
result._origin.setFrom(origin);
|
|
266007
266194
|
return result;
|
|
266008
266195
|
}
|
|
266009
|
-
|
|
266010
|
-
|
|
266011
|
-
|
|
266012
|
-
|
|
266013
|
-
|
|
266014
|
-
|
|
266015
|
-
|
|
266016
|
-
|
|
266017
|
-
|
|
266196
|
+
return Transform.createRefs(origin?.cloneAsPoint3d(), matrix);
|
|
266197
|
+
}
|
|
266198
|
+
/**
|
|
266199
|
+
* Create a Transform with given origin and a rigid matrix constructed from one column vector.
|
|
266200
|
+
* @param origin origin of the local coordinate system. Default is the global origin (zero).
|
|
266201
|
+
* @param vector direction of the axis of the local coordinate system indicated by the first letter of `axisOrder`.
|
|
266202
|
+
* @param axisOrder order of axis construction in `Matrix3d.createRigidHeadsUp(vector, axisOrder)`. Default value
|
|
266203
|
+
* is `AxisOrder.ZXY`, which means the z-column of the returned Transform is in the direction of `vector`.
|
|
266204
|
+
* @param result optional pre-allocated result to populate and return.
|
|
266205
|
+
* @returns localToWorld transform for a local coordinate system with given origin and axis, or `undefined`
|
|
266206
|
+
* if the rigid matrix could not be created.
|
|
266207
|
+
* @see [[Matrix3d.createRigidHeadsUp]]
|
|
266208
|
+
*/
|
|
266209
|
+
static createRigidFromOriginAndVector(origin, vector, axisOrder = _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.ZXY, result) {
|
|
266210
|
+
const matrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidHeadsUp(vector, axisOrder, result?._matrix);
|
|
266211
|
+
if (!matrix)
|
|
266212
|
+
return undefined;
|
|
266213
|
+
if (result) {
|
|
266214
|
+
result._origin.setFrom(origin);
|
|
266215
|
+
return result;
|
|
266216
|
+
}
|
|
266217
|
+
return Transform.createRefs(origin?.cloneAsPoint3d(), matrix);
|
|
266018
266218
|
}
|
|
266019
266219
|
/**
|
|
266020
266220
|
* Create a Transform with the specified `matrix`. Compute an `origin` (different from the given `fixedPoint`)
|
|
@@ -268570,11 +268770,11 @@ class Point4d extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
|
|
|
268570
268770
|
return result;
|
|
268571
268771
|
}
|
|
268572
268772
|
/** Near-equality test, using `Geometry.isSameCoordinate` on all 4 x,y,z,w */
|
|
268573
|
-
isAlmostEqual(other) {
|
|
268574
|
-
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.x, other.x)
|
|
268575
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.y, other.y)
|
|
268576
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.z, other.z)
|
|
268577
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.w, other.w);
|
|
268773
|
+
isAlmostEqual(other, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
268774
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.x, other.x, tolerance)
|
|
268775
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.y, other.y, tolerance)
|
|
268776
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.z, other.z, tolerance)
|
|
268777
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.w, other.w, tolerance);
|
|
268578
268778
|
}
|
|
268579
268779
|
/**
|
|
268580
268780
|
* Test for same coordinate by direct x,y,z,w args
|
|
@@ -268583,11 +268783,11 @@ class Point4d extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
|
|
|
268583
268783
|
* @param z z to test
|
|
268584
268784
|
* @param w w to test
|
|
268585
268785
|
*/
|
|
268586
|
-
isAlmostEqualXYZW(x, y, z, w) {
|
|
268587
|
-
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.x, x)
|
|
268588
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.y, y)
|
|
268589
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.z, z)
|
|
268590
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.w, w);
|
|
268786
|
+
isAlmostEqualXYZW(x, y, z, w, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
268787
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.x, x, tolerance)
|
|
268788
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.y, y, tolerance)
|
|
268789
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.z, z, tolerance)
|
|
268790
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.w, w, tolerance);
|
|
268591
268791
|
}
|
|
268592
268792
|
/**
|
|
268593
268793
|
* Convert an Angle to a JSON object.
|
|
@@ -268822,13 +269022,17 @@ class Point4d extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
|
|
|
268822
269022
|
* * If the xyz part of `this` are all zero, (a clone of) `spacePoint` is returned.
|
|
268823
269023
|
*/
|
|
268824
269024
|
projectPointToPlane(spacePoint, result) {
|
|
268825
|
-
|
|
269025
|
+
return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);
|
|
269026
|
+
}
|
|
269027
|
+
/** Return the projection of (x,y,z) onto the plane. */
|
|
269028
|
+
projectXYZToPlane(x, y, z, result) {
|
|
269029
|
+
const h = this.altitudeXYZ(x, y, z);
|
|
268826
269030
|
const nn = this.magnitudeSquaredXYZ();
|
|
268827
269031
|
// this unusual tol is needed so that toPlane3dByOriginAndUnitNormal agrees with its original implementation
|
|
268828
269032
|
const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.conditionalDivideCoordinate(-h, nn, _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.largeFractionResult * _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.largeFractionResult);
|
|
268829
269033
|
if (alpha === undefined)
|
|
268830
|
-
return
|
|
268831
|
-
return
|
|
269034
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x, y, z, result);
|
|
269035
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x + alpha * this.x, y + alpha * this.y, z + alpha * this.z, result);
|
|
268832
269036
|
}
|
|
268833
269037
|
/** scale all components (including w!!) */
|
|
268834
269038
|
scale(scale, result) {
|
|
@@ -276078,7 +276282,7 @@ class FacetOrientationFixup {
|
|
|
276078
276282
|
return this._facetOrientation[facetIndex];
|
|
276079
276283
|
}
|
|
276080
276284
|
/**
|
|
276081
|
-
* RETURN FALSE IF ANY EDGE HAS 3
|
|
276285
|
+
* RETURN FALSE IF ANY EDGE HAS 3 OR MORE FACETS
|
|
276082
276286
|
*/
|
|
276083
276287
|
setupUnoriented() {
|
|
276084
276288
|
this._edges.sort();
|
|
@@ -276536,97 +276740,107 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
276536
276740
|
* @module Polyface
|
|
276537
276741
|
*/
|
|
276538
276742
|
/**
|
|
276539
|
-
*
|
|
276540
|
-
* *
|
|
276541
|
-
*
|
|
276542
|
-
*
|
|
276543
|
-
* * [2] is facet index (or another number to associate with this edge).
|
|
276743
|
+
* Represent an [[IndexedPolyface]] edge as:
|
|
276744
|
+
* * vertex start index and vertex end index (CCW order around its facet)
|
|
276745
|
+
* * an additional number to associate with the edge (e.g., facet index)
|
|
276746
|
+
* @public
|
|
276544
276747
|
*/
|
|
276545
|
-
class SortableEdge
|
|
276748
|
+
class SortableEdge {
|
|
276749
|
+
_v;
|
|
276750
|
+
_a;
|
|
276751
|
+
/** Constructor. */
|
|
276752
|
+
constructor(startVertex, endVertex, facetIndex) {
|
|
276753
|
+
this._v = [startVertex, endVertex];
|
|
276754
|
+
this._a = facetIndex;
|
|
276755
|
+
}
|
|
276756
|
+
/** Clone the edge. */
|
|
276757
|
+
clone() {
|
|
276758
|
+
return new SortableEdge(this._v[0], this._v[1], this._a);
|
|
276759
|
+
}
|
|
276546
276760
|
/** Return the vertex index that appears first in the order stored. */
|
|
276547
|
-
get
|
|
276548
|
-
return this[0];
|
|
276761
|
+
get startVertex() {
|
|
276762
|
+
return this._v[0];
|
|
276549
276763
|
}
|
|
276550
276764
|
/** Return the vertex index that appears second in the order stored. */
|
|
276551
|
-
get
|
|
276552
|
-
return this[1];
|
|
276765
|
+
get endVertex() {
|
|
276766
|
+
return this._v[1];
|
|
276553
276767
|
}
|
|
276554
276768
|
/**
|
|
276555
276769
|
* Return the facet index.
|
|
276556
276770
|
* * This value is carried along during matching. Typically it is a facet index, but it does not have to be.
|
|
276557
276771
|
*/
|
|
276558
276772
|
get facetIndex() {
|
|
276559
|
-
return this
|
|
276773
|
+
return this._a;
|
|
276560
276774
|
}
|
|
276561
|
-
/** return true if
|
|
276775
|
+
/** return true if `startVertex` is less than `endVertex`. */
|
|
276562
276776
|
get isLowHigh() {
|
|
276563
|
-
return this[0] < this[1];
|
|
276777
|
+
return this._v[0] < this._v[1];
|
|
276564
276778
|
}
|
|
276565
276779
|
/** Return the vertex index with lower numeric value. */
|
|
276566
|
-
get
|
|
276567
|
-
return this
|
|
276780
|
+
get lowVertex() {
|
|
276781
|
+
return this.isLowHigh ? this._v[0] : this._v[1];
|
|
276568
276782
|
}
|
|
276569
276783
|
/** Return the vertex index with higher numeric value. */
|
|
276570
|
-
get
|
|
276571
|
-
return this
|
|
276784
|
+
get highVertex() {
|
|
276785
|
+
return this.isLowHigh ? this._v[1] : this._v[0];
|
|
276572
276786
|
}
|
|
276573
|
-
/** Return true if
|
|
276787
|
+
/** Return true if edgeA and edgeB traverse the same edge in the same direction. */
|
|
276788
|
+
static areSameEdge(edgeA, edgeB) {
|
|
276789
|
+
return edgeA._v[0] === edgeB._v[0] && edgeA._v[1] === edgeB._v[1];
|
|
276790
|
+
}
|
|
276791
|
+
/** Return true if edgeA and edgeB traverse the same edge in opposite directions. */
|
|
276574
276792
|
static areDirectedPartners(edgeA, edgeB) {
|
|
276575
|
-
return edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0];
|
|
276793
|
+
return edgeA._v[0] === edgeB._v[1] && edgeA._v[1] === edgeB._v[0];
|
|
276576
276794
|
}
|
|
276577
|
-
/** Return true if
|
|
276795
|
+
/** Return true if edgeA and edgeB traverse the same edge in the same or opposite directions. */
|
|
276578
276796
|
static areUndirectedPartners(edgeA, edgeB) {
|
|
276579
|
-
return (edgeA
|
|
276797
|
+
return this.areSameEdge(edgeA, edgeB) || this.areDirectedPartners(edgeA, edgeB);
|
|
276580
276798
|
}
|
|
276581
276799
|
/**
|
|
276582
|
-
* Return numeric relationship
|
|
276583
|
-
* * 1 if they share start and end in the same order.
|
|
276584
|
-
* * -1 if they share start and end in reversed order.
|
|
276800
|
+
* Return numeric identifier for the relationship between edgeA and edgeB:
|
|
276801
|
+
* * 1 if they share start and end vertex indices in the same order.
|
|
276802
|
+
* * -1 if they share start and end vertex indices in reversed order.
|
|
276585
276803
|
* * 0 otherwise.
|
|
276586
276804
|
*/
|
|
276587
276805
|
static relativeOrientation(edgeA, edgeB) {
|
|
276588
|
-
if (edgeA
|
|
276806
|
+
if (this.areSameEdge(edgeA, edgeB))
|
|
276589
276807
|
return 1;
|
|
276590
|
-
if (edgeA
|
|
276808
|
+
if (this.areDirectedPartners(edgeA, edgeB))
|
|
276591
276809
|
return -1;
|
|
276592
276810
|
return 0;
|
|
276593
276811
|
}
|
|
276812
|
+
/** Whether the start and end vertex indices are equal. */
|
|
276594
276813
|
get isNullEdge() {
|
|
276595
|
-
return this[0] === this[1];
|
|
276814
|
+
return this._v[0] === this._v[1];
|
|
276596
276815
|
}
|
|
276597
276816
|
/**
|
|
276598
276817
|
* Lexical comparison of two edges.
|
|
276599
|
-
* * If the edges have the same vertex pair (in same or opposite order) they will end up adjacent in a sort.
|
|
276600
|
-
* * If the edges have 0 or 1 shared vertex indices, the one with lowest low comes first.
|
|
276818
|
+
* * If the edges have the same vertex index pair (in same or opposite order) they will end up adjacent in a sort.
|
|
276601
276819
|
* @param edgeA first edge
|
|
276602
276820
|
* @param edgeB second edge
|
|
276603
276821
|
*/
|
|
276604
276822
|
static lessThan(edgeA, edgeB) {
|
|
276605
276823
|
// primary compare is based on indirect indices
|
|
276606
|
-
const lowA = edgeA.
|
|
276607
|
-
const lowB = edgeB.
|
|
276824
|
+
const lowA = edgeA.lowVertex;
|
|
276825
|
+
const lowB = edgeB.lowVertex;
|
|
276608
276826
|
if (lowA < lowB)
|
|
276609
276827
|
return -1;
|
|
276610
276828
|
if (lowB < lowA)
|
|
276611
276829
|
return 1;
|
|
276612
|
-
const highA = edgeA.
|
|
276613
|
-
const highB = edgeB.
|
|
276830
|
+
const highA = edgeA.highVertex;
|
|
276831
|
+
const highB = edgeB.highVertex;
|
|
276614
276832
|
if (highA < highB)
|
|
276615
276833
|
return -1;
|
|
276616
276834
|
if (highB < highA)
|
|
276617
276835
|
return 1;
|
|
276618
276836
|
// undirected indices match ... use directed vertexIndexA
|
|
276619
|
-
return edgeA.
|
|
276620
|
-
}
|
|
276621
|
-
constructor(vertexA, vertexB, facetIndex) {
|
|
276622
|
-
super(3);
|
|
276623
|
-
this[0] = vertexA;
|
|
276624
|
-
this[1] = vertexB;
|
|
276625
|
-
this[2] = facetIndex;
|
|
276837
|
+
return edgeA.startVertex - edgeB.startVertex;
|
|
276626
276838
|
}
|
|
276839
|
+
/** Return the edge data as a JSON array. */
|
|
276627
276840
|
toJSON() {
|
|
276628
|
-
return [this[0], this[1], this
|
|
276841
|
+
return [this._v[0], this._v[1], this._a];
|
|
276629
276842
|
}
|
|
276843
|
+
/** Return the edge cluster in JSON format. */
|
|
276630
276844
|
static clusterToJSON(data) {
|
|
276631
276845
|
if (data instanceof SortableEdge)
|
|
276632
276846
|
return data.toJSON();
|
|
@@ -276634,6 +276848,7 @@ class SortableEdge extends Float64Array {
|
|
|
276634
276848
|
for (const edge of data)
|
|
276635
276849
|
result.push(edge.toJSON());
|
|
276636
276850
|
}
|
|
276851
|
+
/** Return the edge cluster array in JSON format. */
|
|
276637
276852
|
static clusterArrayToJSON(data) {
|
|
276638
276853
|
const result = [];
|
|
276639
276854
|
for (const cluster of data)
|
|
@@ -276642,11 +276857,14 @@ class SortableEdge extends Float64Array {
|
|
|
276642
276857
|
}
|
|
276643
276858
|
}
|
|
276644
276859
|
/**
|
|
276645
|
-
* An IndexedEdgeMatcher carries an array of edge start
|
|
276646
|
-
*
|
|
276860
|
+
* An IndexedEdgeMatcher carries an array of edge start and end indices for sorting and subsequent analyses,
|
|
276861
|
+
* such as testing for closed mesh.
|
|
276862
|
+
* @public
|
|
276647
276863
|
*/
|
|
276648
276864
|
class IndexedEdgeMatcher {
|
|
276865
|
+
/** The array of edges to be sorted. */
|
|
276649
276866
|
edges;
|
|
276867
|
+
/** Constructor. Call [[addEdge]] or [[addPath]] to populate `edges`. */
|
|
276650
276868
|
constructor() {
|
|
276651
276869
|
this.edges = [];
|
|
276652
276870
|
}
|
|
@@ -276663,22 +276881,22 @@ class IndexedEdgeMatcher {
|
|
|
276663
276881
|
return edge;
|
|
276664
276882
|
}
|
|
276665
276883
|
/**
|
|
276666
|
-
* Push edges
|
|
276667
|
-
*
|
|
276668
|
-
* @param
|
|
276884
|
+
* Push edges along a path.
|
|
276885
|
+
* * Typically used to add edges around a facet.
|
|
276886
|
+
* @param vertexIndices array of vertex indices along an open or closed path.
|
|
276887
|
+
* @param facetIndex value to set on each edge pushed.
|
|
276669
276888
|
* @param closeLoop true to add an edge from last to first vertex.
|
|
276670
276889
|
*/
|
|
276671
|
-
addPath(
|
|
276672
|
-
if (
|
|
276890
|
+
addPath(vertexIndices, facetIndex, closeLoop) {
|
|
276891
|
+
if (vertexIndices.length === 0)
|
|
276673
276892
|
return;
|
|
276674
|
-
const m =
|
|
276675
|
-
for (let i = 0; i < m; i++)
|
|
276676
|
-
this.addEdge(
|
|
276677
|
-
}
|
|
276893
|
+
const m = vertexIndices.length - 1;
|
|
276894
|
+
for (let i = 0; i < m; i++)
|
|
276895
|
+
this.addEdge(vertexIndices[i], vertexIndices[i + 1], facetIndex);
|
|
276678
276896
|
if (closeLoop)
|
|
276679
|
-
this.addEdge(
|
|
276897
|
+
this.addEdge(vertexIndices[m], vertexIndices[0], facetIndex);
|
|
276680
276898
|
}
|
|
276681
|
-
/** Sort the
|
|
276899
|
+
/** Sort the edges. */
|
|
276682
276900
|
sort() {
|
|
276683
276901
|
this.edges.sort((edgeA, edgeB) => SortableEdge.lessThan(edgeA, edgeB));
|
|
276684
276902
|
}
|
|
@@ -276697,20 +276915,18 @@ class IndexedEdgeMatcher {
|
|
|
276697
276915
|
}
|
|
276698
276916
|
}
|
|
276699
276917
|
/**
|
|
276700
|
-
* Sort the edges, and
|
|
276701
|
-
*
|
|
276702
|
-
* *
|
|
276703
|
-
* * Any combination of the
|
|
276918
|
+
* Sort the edges, and collect up to four categories of edges: manifold pairs, singletons, null edges,
|
|
276919
|
+
* and everything else.
|
|
276920
|
+
* * Caller should allocate arrays of interest.
|
|
276921
|
+
* * Any combination of the arrays may be `undefined`, indicating that category is to be ignored.
|
|
276922
|
+
* * Any combination of the arrays may be aliased as the same target, in which case the aliased categories are
|
|
276704
276923
|
* merged into the target.
|
|
276705
|
-
* * For instance, to ignore manifold pairs and collect all
|
|
276706
|
-
* `
|
|
276707
|
-
*
|
|
276708
|
-
* @param
|
|
276709
|
-
*
|
|
276710
|
-
* @param
|
|
276711
|
-
* @param nullEdges optional array to receive arrays of null edges (same start and end vertex)
|
|
276712
|
-
* @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense
|
|
276713
|
-
* but not a simple directed pair.
|
|
276924
|
+
* * For instance, to ignore manifold pairs and collect all other edges in a single array:
|
|
276925
|
+
* `const foo = []; matcher.sortAndCollectClusters(undefined, foo, foo, foo);`
|
|
276926
|
+
* @param manifoldPairs array to receive pairs of properly mated edges, i.e. mesh interior edges.
|
|
276927
|
+
* @param singletons array to receive edges that have no partner, i.e., mesh boundary edges.
|
|
276928
|
+
* @param nullEdges array to receive arrays of matched null edges, for which start === end vertex index.
|
|
276929
|
+
* @param allOtherClusters array to receive arrays of edges that are partners in an undirected, non-manifold sense.
|
|
276714
276930
|
*/
|
|
276715
276931
|
sortAndCollectClusters(manifoldPairs, singletons, nullEdges, allOtherClusters) {
|
|
276716
276932
|
this.sort();
|
|
@@ -276731,18 +276947,14 @@ class IndexedEdgeMatcher {
|
|
|
276731
276947
|
SortableEdge.areUndirectedPartners(baseEdge, this.edges[index1]); index1++) {
|
|
276732
276948
|
clusterLength++;
|
|
276733
276949
|
}
|
|
276734
|
-
if (this.edges[index0].isNullEdge)
|
|
276950
|
+
if (this.edges[index0].isNullEdge)
|
|
276735
276951
|
this.collectSortableEdgeCluster(index0, index0 + clusterLength, nullEdges);
|
|
276736
|
-
|
|
276737
|
-
else if (clusterLength === 2 && SortableEdge.areDirectedPartners(baseEdge, this.edges[index0 + 1])) {
|
|
276952
|
+
else if (clusterLength === 2 && SortableEdge.areDirectedPartners(baseEdge, this.edges[index0 + 1]))
|
|
276738
276953
|
this.collectSortableEdgeCluster(index0, index0 + clusterLength, manifoldPairs);
|
|
276739
|
-
|
|
276740
|
-
else if (clusterLength === 1) {
|
|
276954
|
+
else if (clusterLength === 1)
|
|
276741
276955
|
this.collectSortableEdgeCluster(index0, index0 + 1, singletons);
|
|
276742
|
-
|
|
276743
|
-
else {
|
|
276956
|
+
else
|
|
276744
276957
|
this.collectSortableEdgeCluster(index0, index0 + clusterLength, allOtherClusters);
|
|
276745
|
-
}
|
|
276746
276958
|
}
|
|
276747
276959
|
}
|
|
276748
276960
|
}
|
|
@@ -276801,10 +277013,10 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
276801
277013
|
this.auxData = polyface.data.auxData.createForVisitor();
|
|
276802
277014
|
if (polyface.data.edgeMateIndex)
|
|
276803
277015
|
this.edgeMateIndex = [];
|
|
276804
|
-
this.reset();
|
|
276805
277016
|
this._numEdges = 0;
|
|
276806
277017
|
this._nextFacetIndex = 0;
|
|
276807
277018
|
this._currentFacetIndex = -1;
|
|
277019
|
+
this.reset();
|
|
276808
277020
|
}
|
|
276809
277021
|
/** Return the client polyface object. */
|
|
276810
277022
|
clientPolyface() {
|
|
@@ -276841,11 +277053,14 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
276841
277053
|
moveToReadIndex(facetIndex) {
|
|
276842
277054
|
if (!this._polyface.isValidFacetIndex(facetIndex))
|
|
276843
277055
|
return false;
|
|
276844
|
-
|
|
277056
|
+
const numEdges = this._polyface.numEdgeInFacet(facetIndex);
|
|
277057
|
+
if (this._currentFacetIndex !== facetIndex || numEdges + this._numWrap !== this.pointCount) {
|
|
277058
|
+
this._currentFacetIndex = facetIndex;
|
|
277059
|
+
this._numEdges = numEdges;
|
|
277060
|
+
this.resizeAllArrays(this._numEdges + this._numWrap);
|
|
277061
|
+
this.gatherIndexedData(this._polyface.data, this._polyface.facetIndex0(this._currentFacetIndex), this._polyface.facetIndex1(this._currentFacetIndex), this._numWrap);
|
|
277062
|
+
}
|
|
276845
277063
|
this._nextFacetIndex = facetIndex + 1;
|
|
276846
|
-
this._numEdges = this._polyface.numEdgeInFacet(facetIndex);
|
|
276847
|
-
this.resizeAllArrays(this._numEdges + this._numWrap);
|
|
276848
|
-
this.gatherIndexedData(this._polyface.data, this._polyface.facetIndex0(this._currentFacetIndex), this._polyface.facetIndex1(this._currentFacetIndex), this._numWrap);
|
|
276849
277064
|
return true;
|
|
276850
277065
|
}
|
|
276851
277066
|
/** Advance the iterator to a the 'next' facet in the client polyface. */
|
|
@@ -276855,7 +277070,7 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
276855
277070
|
this._nextFacetIndex++;
|
|
276856
277071
|
return true;
|
|
276857
277072
|
}
|
|
276858
|
-
/**
|
|
277073
|
+
/** Restart the visitor at the first facet. */
|
|
276859
277074
|
reset() {
|
|
276860
277075
|
this.moveToReadIndex(0);
|
|
276861
277076
|
this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.
|
|
@@ -276954,6 +277169,10 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
276954
277169
|
this.color.push(_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolateColor(other.color[index0], fraction, other.color[index1]));
|
|
276955
277170
|
// TODO: auxData? taggedNumericData?
|
|
276956
277171
|
}
|
|
277172
|
+
/** Create a visitor for a subset of the facets visitable by the instance. */
|
|
277173
|
+
createSubsetVisitor(facetIndices, numWrap = 0) {
|
|
277174
|
+
return IndexedPolyfaceSubsetVisitor.createSubsetVisitor(this._polyface, facetIndices, numWrap);
|
|
277175
|
+
}
|
|
276957
277176
|
}
|
|
276958
277177
|
/**
|
|
276959
277178
|
* An `IndexedPolyfaceSubsetVisitor` is an `IndexedPolyfaceVisitor` which only visits a subset of facets in the polyface.
|
|
@@ -276962,38 +277181,38 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
276962
277181
|
* @public
|
|
276963
277182
|
*/
|
|
276964
277183
|
class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {
|
|
276965
|
-
|
|
276966
|
-
|
|
276967
|
-
|
|
276968
|
-
constructor(polyface,
|
|
277184
|
+
_facetIndices;
|
|
277185
|
+
_currentSubsetIndex; // index within _facetIndices, or -1 after construction
|
|
277186
|
+
_nextSubsetIndex; // index within _facetIndices
|
|
277187
|
+
constructor(polyface, facetIndices, numWrap) {
|
|
276969
277188
|
super(polyface, numWrap);
|
|
276970
|
-
this.
|
|
276971
|
-
this.
|
|
276972
|
-
this.
|
|
277189
|
+
this._facetIndices = facetIndices.slice();
|
|
277190
|
+
this._currentSubsetIndex = -1;
|
|
277191
|
+
this._nextSubsetIndex = 0;
|
|
277192
|
+
this.reset();
|
|
276973
277193
|
}
|
|
276974
277194
|
isValidSubsetIndex(index) {
|
|
276975
|
-
return
|
|
277195
|
+
return index >= 0 && index < this._facetIndices.length;
|
|
276976
277196
|
}
|
|
276977
277197
|
/**
|
|
276978
277198
|
* Create a visitor for iterating a subset of the facets of `polyface`.
|
|
276979
277199
|
* @param polyface reference to the client polyface, supplying facets
|
|
276980
|
-
* @param
|
|
277200
|
+
* @param facetIndices array of indices of facets in the client polyface to visit. This array is cloned.
|
|
276981
277201
|
* @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.
|
|
276982
277202
|
*/
|
|
276983
|
-
static createSubsetVisitor(polyface,
|
|
276984
|
-
return new IndexedPolyfaceSubsetVisitor(polyface,
|
|
277203
|
+
static createSubsetVisitor(polyface, facetIndices, numWrap = 0) {
|
|
277204
|
+
return new IndexedPolyfaceSubsetVisitor(polyface, facetIndices, numWrap);
|
|
276985
277205
|
}
|
|
276986
277206
|
/**
|
|
276987
277207
|
* Advance the iterator to a particular facet in the subset of client polyface facets.
|
|
276988
|
-
* @param
|
|
276989
|
-
* the client polyface.
|
|
277208
|
+
* @param subsetIndex index into the subset array, not to be confused with the client facet index.
|
|
276990
277209
|
* @return whether the iterator was successfully moved.
|
|
276991
277210
|
*/
|
|
276992
|
-
moveToReadIndex(
|
|
276993
|
-
if (this.isValidSubsetIndex(
|
|
276994
|
-
this.
|
|
276995
|
-
this.
|
|
276996
|
-
return super.moveToReadIndex(this.
|
|
277211
|
+
moveToReadIndex(subsetIndex) {
|
|
277212
|
+
if (this.isValidSubsetIndex(subsetIndex)) {
|
|
277213
|
+
this._currentSubsetIndex = subsetIndex;
|
|
277214
|
+
this._nextSubsetIndex = subsetIndex + 1;
|
|
277215
|
+
return super.moveToReadIndex(this._facetIndices[subsetIndex]);
|
|
276997
277216
|
}
|
|
276998
277217
|
return false;
|
|
276999
277218
|
}
|
|
@@ -277002,29 +277221,31 @@ class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {
|
|
|
277002
277221
|
* @return whether the iterator was successfully moved.
|
|
277003
277222
|
*/
|
|
277004
277223
|
moveToNextFacet() {
|
|
277005
|
-
if (this.
|
|
277006
|
-
return this.moveToReadIndex(this.
|
|
277007
|
-
this.
|
|
277224
|
+
if (this._nextSubsetIndex !== this._currentSubsetIndex)
|
|
277225
|
+
return this.moveToReadIndex(this._nextSubsetIndex);
|
|
277226
|
+
this._nextSubsetIndex++;
|
|
277008
277227
|
return true;
|
|
277009
277228
|
}
|
|
277010
|
-
/**
|
|
277229
|
+
/** Restart the visitor at the first facet. */
|
|
277011
277230
|
reset() {
|
|
277012
|
-
this.
|
|
277013
|
-
|
|
277231
|
+
if (this._facetIndices) { // avoid crash during super ctor when we aren't yet initialized
|
|
277232
|
+
this.moveToReadIndex(0);
|
|
277233
|
+
this._nextSubsetIndex = 0; // so immediate moveToNextFacet stays here.
|
|
277234
|
+
}
|
|
277014
277235
|
}
|
|
277015
277236
|
/**
|
|
277016
|
-
* Return the
|
|
277017
|
-
* @param
|
|
277018
|
-
* @return valid client polyface facet index, or `undefined` if invalid
|
|
277237
|
+
* Return the client polyface facet index (aka "readIndex") for the given subset index.
|
|
277238
|
+
* @param subsetIndex index into the subset array. Default is the subset index of the currently visited facet.
|
|
277239
|
+
* @return valid client polyface facet index, or `undefined` if invalid subset index.
|
|
277019
277240
|
*/
|
|
277020
|
-
parentFacetIndex(
|
|
277021
|
-
if (undefined ===
|
|
277022
|
-
|
|
277023
|
-
return this.isValidSubsetIndex(
|
|
277241
|
+
parentFacetIndex(subsetIndex) {
|
|
277242
|
+
if (undefined === subsetIndex)
|
|
277243
|
+
subsetIndex = this._currentSubsetIndex;
|
|
277244
|
+
return this.isValidSubsetIndex(subsetIndex) ? this._facetIndices[subsetIndex] : undefined;
|
|
277024
277245
|
}
|
|
277025
277246
|
/** Return the number of facets this visitor is able to visit. */
|
|
277026
277247
|
getVisitableFacetCount() {
|
|
277027
|
-
return this.
|
|
277248
|
+
return this._facetIndices.length;
|
|
277028
277249
|
}
|
|
277029
277250
|
/**
|
|
277030
277251
|
* Create a visitor for those mesh facets with normal in the same half-space as the given vector.
|
|
@@ -277124,7 +277345,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
277124
277345
|
* * The [[previousAroundVertex]] step is clockwise around the vertex.
|
|
277125
277346
|
* * The `nextAroundFacet` steps for a walker and its [[edgeMate]] are in opposite directions along their shared edge,
|
|
277126
277347
|
* when that edge is interior. Thus the `edgeMate` step can be seen to iterate an "edge loop" of two locations for an
|
|
277127
|
-
* interior
|
|
277348
|
+
* interior edge.
|
|
277128
277349
|
* * Invalid Walkers:
|
|
277129
277350
|
* * An invalid walker has undefined [[edgeIndex]]. For these walkers, [[isUndefined]] returns true, and [[isValid]]
|
|
277130
277351
|
* returns false. Traversal operations on an invalid walker return an invalid walker.
|
|
@@ -277138,6 +277359,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
277138
277359
|
* * Invalid walkers can also occur while traversing a non-manifold mesh. Such meshes feature edge(s) with more than
|
|
277139
277360
|
* two adjacent facets, or with two adjacent facets that have opposite orientations. These meshes are uncommon, and
|
|
277140
277361
|
* usually indicate a construction problem.
|
|
277362
|
+
* * Note that a null edge, for which the start and end vertex is the same, does not yield an invalid walker.
|
|
277141
277363
|
* * See [[buildEdgeMateIndices]] for further description of the topological relations.
|
|
277142
277364
|
* @public
|
|
277143
277365
|
*/
|
|
@@ -277180,6 +277402,10 @@ class IndexedPolyfaceWalker {
|
|
|
277180
277402
|
get isUndefined() {
|
|
277181
277403
|
return this._edgeIndex === undefined;
|
|
277182
277404
|
}
|
|
277405
|
+
/** Whether the walker is at a null edge, i.e. an edge with no length. */
|
|
277406
|
+
get isNull() {
|
|
277407
|
+
return this.isValid && this._polyface.data.edgeIndexToEdgeMateIndex(this._edgeIndex) === this._edgeIndex;
|
|
277408
|
+
}
|
|
277183
277409
|
/**
|
|
277184
277410
|
* Create a walker for a given polyface at an optional edge.
|
|
277185
277411
|
* @param polyface reference to the client polyface. This reference is captured (the polyface is not copied).
|
|
@@ -277222,17 +277448,16 @@ class IndexedPolyfaceWalker {
|
|
|
277222
277448
|
}
|
|
277223
277449
|
/**
|
|
277224
277450
|
* Create a new IndexedPolyfaceWalker from the instance.
|
|
277225
|
-
* * The returned walker refers to the same polyface.
|
|
277226
|
-
*
|
|
277227
|
-
|
|
277228
|
-
|
|
277229
|
-
|
|
277230
|
-
|
|
277231
|
-
|
|
277232
|
-
|
|
277233
|
-
|
|
277234
|
-
|
|
277235
|
-
return undefined;
|
|
277451
|
+
* * The returned walker refers to the same polyface and edge as the instance.
|
|
277452
|
+
* @param result optional receiver to modify and return.
|
|
277453
|
+
*/
|
|
277454
|
+
clone(result) {
|
|
277455
|
+
if (result) {
|
|
277456
|
+
result._polyface = this._polyface;
|
|
277457
|
+
result._edgeIndex = this._edgeIndex;
|
|
277458
|
+
return result;
|
|
277459
|
+
}
|
|
277460
|
+
return new IndexedPolyfaceWalker(this._polyface, this._edgeIndex);
|
|
277236
277461
|
}
|
|
277237
277462
|
/**
|
|
277238
277463
|
* Load the walker's facet into the given visitor.
|
|
@@ -277361,29 +277586,35 @@ class IndexedPolyfaceWalker {
|
|
|
277361
277586
|
* Build the edgeMate index array into the polyface's [[PolyfaceData]].
|
|
277362
277587
|
* After this method:
|
|
277363
277588
|
* * The array `polyface.data.edgeMateIndex` is defined with the same length as the other PolyfaceData index arrays.
|
|
277364
|
-
* * For each interior edge, `polyface.data.edgeIndexToEdgeMateIndex` returns the
|
|
277589
|
+
* * For each interior edge, `polyface.data.edgeIndexToEdgeMateIndex` returns the edge index on the other side of the
|
|
277365
277590
|
* edge in the adjacent facet.
|
|
277366
277591
|
* * The conditions for edgeMate matching are:
|
|
277367
277592
|
* * Given facetIndex f, let `k0 = polyface.facetIndex0(f)` and `k1 = polyface.facetIndex1(f)`.
|
|
277368
|
-
* * Every
|
|
277369
|
-
* * The edge with
|
|
277370
|
-
* * Let kA be an
|
|
277593
|
+
* * Every edge index k in the face loop of facet f satisfies `k0 <= k < k1`.
|
|
277594
|
+
* * The edge with edge index k starts at the point with index `polyface.data.pointIndex[k]`.
|
|
277595
|
+
* * Let kA be an edge index in this range [k0,k1), and let kB be its in-range successor with cyclic wrap, i.e.,
|
|
277371
277596
|
* `kB === (kA + 1 === k1) ? k0 : kA + 1`.
|
|
277372
277597
|
* * Then `polyface.data.pointIndex[kA]` and `polyface.data.pointIndex[kB]` are the indices of the points at the
|
|
277373
277598
|
* start and end of an edge of that facet.
|
|
277374
|
-
* * We call kA the
|
|
277375
|
-
* * If kA is
|
|
277376
|
-
* whose face loop contains
|
|
277599
|
+
* * We call kA the _edge index_ for that edge, and kB the _edge index_ for the next edge around the facet.
|
|
277600
|
+
* * If kA is a positive-length interior edge in a 2-manifold mesh with properly oriented facets, then there is
|
|
277601
|
+
* an adjacent facet whose face loop contains edge indices kC and kD referencing the same edge vertices in reverse
|
|
277602
|
+
* order, i.e.,
|
|
277377
277603
|
* * `polyface.data.pointIndex[kA] === polyface.data.pointIndex[kD]`
|
|
277378
277604
|
* * `polyface.data.pointIndex[kB] === polyface.data.pointIndex[kC]`
|
|
277379
|
-
* *
|
|
277380
|
-
*
|
|
277381
|
-
*
|
|
277605
|
+
* * We call the edge indices kA and kC _edge mates_, denoted in the `edgeMateIndex` array by:
|
|
277606
|
+
* * `polyface.data.edgeMateIndex[kA] === kC`
|
|
277607
|
+
* * `polyface.data.edgeMateIndex[kC] === kA`
|
|
277608
|
+
* * If kA is zero-length interior edge, i.e, it has the same start and end point indices, then we call it a _null
|
|
277609
|
+
* edge_, and its edge mate is itself.
|
|
277610
|
+
* * A non-interior edge either lies on the boundary of the mesh, or is non-manifold (having more than 2 adjacent
|
|
277611
|
+
* facets, or 1 with the wrong orientation). These edges have no edge mate, represented as `undefined` in
|
|
277612
|
+
* the `edgeMateIndex` array.
|
|
277382
277613
|
* * These conditions define a conventional manifold mesh where each edge of a facet has at most one partner edge with
|
|
277383
277614
|
* opposite orientation in an adjacent facet.
|
|
277384
277615
|
* * After calling this method, the caller can construct `IndexedPolyfaceWalker` objects to traverse the mesh by
|
|
277385
|
-
* walking across edges, around faces, and around vertices. Let walkerA have
|
|
277386
|
-
* aforementioned
|
|
277616
|
+
* walking across edges, around faces, and around vertices. Let walkerA have edge index value kA. Then with the
|
|
277617
|
+
* aforementioned edge indices:
|
|
277387
277618
|
* * `walkerC = walkerA.edgeMate()` moves across the edge to its other end, at kC.
|
|
277388
277619
|
* * `walkerB = walkerA.nextAroundFacet()` moves around the facet to the next edge, at kB.
|
|
277389
277620
|
* * `walkerB.previousAroundFacet()` moves from kB back to kA.
|
|
@@ -277398,25 +277629,30 @@ class IndexedPolyfaceWalker {
|
|
|
277398
277629
|
const kStart = polyface.facetIndex0(facetIndex);
|
|
277399
277630
|
const kEnd = polyface.facetIndex1(facetIndex);
|
|
277400
277631
|
let k0 = kEnd - 1;
|
|
277401
|
-
// sneaky: addEdge 3rd arg is
|
|
277632
|
+
// sneaky: addEdge 3rd arg is edge index k0 instead of facetIndex; it gets carried around during matching
|
|
277402
277633
|
for (let k1 = kStart; k1 < kEnd; k0 = k1, k1++)
|
|
277403
277634
|
matcher.addEdge(polyface.data.pointIndex[k0], polyface.data.pointIndex[k1], k0);
|
|
277404
277635
|
}
|
|
277405
277636
|
const matchedPairs = [];
|
|
277406
|
-
const singletons = [];
|
|
277407
277637
|
const nullEdges = [];
|
|
277408
|
-
|
|
277409
|
-
matcher.sortAndCollectClusters(matchedPairs, singletons, nullEdges, allOtherClusters);
|
|
277638
|
+
matcher.sortAndCollectClusters(matchedPairs, undefined, nullEdges, undefined);
|
|
277410
277639
|
const numIndex = polyface.data.pointIndex.length;
|
|
277411
277640
|
polyface.data.edgeMateIndex = new Array(numIndex);
|
|
277412
277641
|
for (let i = 0; i < numIndex; i++)
|
|
277413
|
-
polyface.data.edgeMateIndex[i] = undefined;
|
|
277642
|
+
polyface.data.edgeMateIndex[i] = undefined; // boundary and non-manifold edges have no mate
|
|
277414
277643
|
for (const pair of matchedPairs) {
|
|
277415
277644
|
if (Array.isArray(pair) && pair.length === 2) {
|
|
277416
|
-
const
|
|
277417
|
-
const
|
|
277418
|
-
polyface.data.edgeMateIndex[
|
|
277419
|
-
polyface.data.edgeMateIndex[
|
|
277645
|
+
const edgeIndex0 = pair[0].facetIndex;
|
|
277646
|
+
const edgeIndex1 = pair[1].facetIndex;
|
|
277647
|
+
polyface.data.edgeMateIndex[edgeIndex0] = edgeIndex1; // paired edges point to each other
|
|
277648
|
+
polyface.data.edgeMateIndex[edgeIndex1] = edgeIndex0;
|
|
277649
|
+
}
|
|
277650
|
+
}
|
|
277651
|
+
for (const nullEdgeOrCluster of nullEdges) {
|
|
277652
|
+
const nullCluster = Array.isArray(nullEdgeOrCluster) ? nullEdgeOrCluster : [nullEdgeOrCluster];
|
|
277653
|
+
for (const nullEdge of nullCluster) {
|
|
277654
|
+
const edgeIndex = nullEdge.facetIndex;
|
|
277655
|
+
polyface.data.edgeMateIndex[edgeIndex] = edgeIndex; // a null edge points to itself
|
|
277420
277656
|
}
|
|
277421
277657
|
}
|
|
277422
277658
|
}
|
|
@@ -278103,6 +278339,22 @@ class IndexedPolyface extends Polyface {
|
|
|
278103
278339
|
dispatchToGeometryHandler(handler) {
|
|
278104
278340
|
return handler.handleIndexedPolyface(this);
|
|
278105
278341
|
}
|
|
278342
|
+
/** If the input accesses an edgeMateIndex array, return it along with the owning IndexedPolyface. */
|
|
278343
|
+
static hasEdgeMateIndex(polyface) {
|
|
278344
|
+
let parent;
|
|
278345
|
+
if (polyface instanceof Polyface) {
|
|
278346
|
+
if (polyface instanceof IndexedPolyface)
|
|
278347
|
+
parent = polyface;
|
|
278348
|
+
}
|
|
278349
|
+
else if (polyface.clientPolyface() && polyface.clientPolyface() instanceof IndexedPolyface)
|
|
278350
|
+
parent = polyface.clientPolyface();
|
|
278351
|
+
if (parent) {
|
|
278352
|
+
const edgeMateIndex = parent.data.edgeMateIndex;
|
|
278353
|
+
if (edgeMateIndex && edgeMateIndex.length > 0 && edgeMateIndex.length === parent.data.indexCount)
|
|
278354
|
+
return { parent, edgeMateIndex };
|
|
278355
|
+
}
|
|
278356
|
+
return undefined;
|
|
278357
|
+
}
|
|
278106
278358
|
}
|
|
278107
278359
|
|
|
278108
278360
|
|
|
@@ -280013,9 +280265,9 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
280013
280265
|
let indexA = -1;
|
|
280014
280266
|
let indexB = -1;
|
|
280015
280267
|
for (let i = this._polyface.facetIndex0(edge.facetIndex); i < this._polyface.facetIndex1(edge.facetIndex); ++i) {
|
|
280016
|
-
if (edge.
|
|
280268
|
+
if (edge.startVertex === this._polyface.data.pointIndex[i])
|
|
280017
280269
|
indexA = i;
|
|
280018
|
-
else if (edge.
|
|
280270
|
+
else if (edge.endVertex === this._polyface.data.pointIndex[i])
|
|
280019
280271
|
indexB = i;
|
|
280020
280272
|
}
|
|
280021
280273
|
return (indexA < 0 || indexB < 0) ? undefined : { edgeIndexA: indexA, edgeIndexB: indexB };
|
|
@@ -280153,7 +280405,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
280153
280405
|
/* harmony import */ var _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../curve/UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
|
|
280154
280406
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
280155
280407
|
/* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
|
|
280156
|
-
/* harmony import */ var
|
|
280408
|
+
/* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
|
|
280157
280409
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
280158
280410
|
/* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
|
|
280159
280411
|
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
@@ -280161,7 +280413,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
280161
280413
|
/* harmony import */ var _solid_SweepContour__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../solid/SweepContour */ "../../core/geometry/lib/esm/solid/SweepContour.js");
|
|
280162
280414
|
/* harmony import */ var _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../topology/ChainMerge */ "../../core/geometry/lib/esm/topology/ChainMerge.js");
|
|
280163
280415
|
/* harmony import */ var _multiclip_RangeSearch__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./multiclip/RangeSearch */ "../../core/geometry/lib/esm/polyface/multiclip/RangeSearch.js");
|
|
280164
|
-
/* harmony import */ var
|
|
280416
|
+
/* harmony import */ var _Polyface__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
280165
280417
|
/* harmony import */ var _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
|
|
280166
280418
|
/* harmony import */ var _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
|
|
280167
280419
|
/*---------------------------------------------------------------------------------------------
|
|
@@ -280257,26 +280509,28 @@ class PolyfaceClip {
|
|
|
280257
280509
|
* * Return all surviving clip as a new mesh.
|
|
280258
280510
|
* * WARNING: The new mesh is "points only" -- parameters, normals, etc are not interpolated
|
|
280259
280511
|
*/
|
|
280260
|
-
static clipPolyfaceClipPlaneWithClosureFace(
|
|
280261
|
-
return this.clipPolyfaceClipPlane(
|
|
280512
|
+
static clipPolyfaceClipPlaneWithClosureFace(source, clipper, insideClip = true, buildClosureFaces = true) {
|
|
280513
|
+
return this.clipPolyfaceClipPlane(source, clipper, insideClip, buildClosureFaces);
|
|
280262
280514
|
}
|
|
280263
280515
|
/** Clip each facet of polyface to the ClipPlane.
|
|
280264
280516
|
* * Return all surviving clip as a new mesh.
|
|
280265
280517
|
* * WARNING: The new mesh is "points only" -- parameters, normals, etc are not interpolated
|
|
280266
280518
|
*/
|
|
280267
|
-
static clipPolyfaceClipPlane(
|
|
280519
|
+
static clipPolyfaceClipPlane(source, clipper, insideClip = true, buildClosureFaces = false) {
|
|
280268
280520
|
const builders = ClippedPolyfaceBuilders.create(insideClip, !insideClip, buildClosureFaces);
|
|
280269
|
-
this.clipPolyfaceInsideOutside(
|
|
280521
|
+
this.clipPolyfaceInsideOutside(source, clipper, builders);
|
|
280270
280522
|
return builders.claimPolyface(insideClip ? 0 : 1, true);
|
|
280271
280523
|
}
|
|
280272
|
-
/**
|
|
280273
|
-
*
|
|
280524
|
+
/**
|
|
280525
|
+
* Clip each facet to the clipper.
|
|
280526
|
+
* * Return surviving facets as a new mesh.
|
|
280274
280527
|
* * WARNING: The new mesh is "points only".
|
|
280275
280528
|
*/
|
|
280276
|
-
static clipPolyfaceConvexClipPlaneSet(
|
|
280277
|
-
const visitor =
|
|
280529
|
+
static clipPolyfaceConvexClipPlaneSet(source, clipper) {
|
|
280530
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_4__.Polyface ? source.createVisitor(0) : source;
|
|
280531
|
+
visitor.setNumWrap(0);
|
|
280278
280532
|
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_1__.PolyfaceBuilder.create();
|
|
280279
|
-
const work = new
|
|
280533
|
+
const work = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__.GrowableXYZArray(10);
|
|
280280
280534
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
280281
280535
|
clipper.clipConvexPolygonInPlace(visitor.point, work);
|
|
280282
280536
|
if (visitor.point.length > 2)
|
|
@@ -280284,21 +280538,18 @@ class PolyfaceClip {
|
|
|
280284
280538
|
}
|
|
280285
280539
|
return builder.claimPolyface(true);
|
|
280286
280540
|
}
|
|
280287
|
-
/** Clip each facet
|
|
280541
|
+
/** Clip each facet to the clippers.
|
|
280288
280542
|
* * Add inside, outside fragments to builderA, builderB
|
|
280289
280543
|
* * This does not consider params, normals, colors. Just points.
|
|
280290
280544
|
* * outputSelect determines how the clip output is structured
|
|
280291
280545
|
* * 0 outputs all shards -- this may have many interior edges.
|
|
280292
280546
|
* * 1 stitches shards together to get cleaner facets.
|
|
280293
280547
|
*/
|
|
280294
|
-
static clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(
|
|
280295
|
-
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_5__.Polyface) {
|
|
280296
|
-
this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(polyface.createVisitor(0), allClippers, destination, outputSelector);
|
|
280297
|
-
return;
|
|
280298
|
-
}
|
|
280548
|
+
static clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(source, allClippers, destination, outputSelector = 1) {
|
|
280299
280549
|
const builderA = destination.builderA;
|
|
280300
280550
|
const builderB = destination.builderB;
|
|
280301
|
-
const visitor =
|
|
280551
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_4__.Polyface ? source.createVisitor(0) : source;
|
|
280552
|
+
visitor.setNumWrap(0);
|
|
280302
280553
|
const cache = new _geometry3d_ReusableObjectCache__WEBPACK_IMPORTED_MODULE_6__.GrowableXYZArrayCache();
|
|
280303
280554
|
const insideShards = [];
|
|
280304
280555
|
const outsideShards = [];
|
|
@@ -280385,7 +280636,7 @@ class PolyfaceClip {
|
|
|
280385
280636
|
static cleanupAndAddRegion(builder, shards, worldToLocal, localToWorld) {
|
|
280386
280637
|
if (builder !== undefined && shards.length > 0) {
|
|
280387
280638
|
if (worldToLocal)
|
|
280388
|
-
|
|
280639
|
+
_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__.GrowableXYZArray.multiplyTransformInPlace(worldToLocal, shards);
|
|
280389
280640
|
const outsidePieces = _curve_RegionOps__WEBPACK_IMPORTED_MODULE_11__.RegionOps.polygonBooleanXYToLoops(shards, _curve_RegionOps__WEBPACK_IMPORTED_MODULE_11__.RegionBinaryOpType.Union, []);
|
|
280390
280641
|
if (outsidePieces && outsidePieces.children.length > 0) {
|
|
280391
280642
|
_curve_RegionOps__WEBPACK_IMPORTED_MODULE_11__.RegionOps.consolidateAdjacentPrimitives(outsidePieces); // source of the T-vertices removed in claimPolyface
|
|
@@ -280429,24 +280680,23 @@ class PolyfaceClip {
|
|
|
280429
280680
|
}
|
|
280430
280681
|
return chainContexts;
|
|
280431
280682
|
}
|
|
280432
|
-
/** Clip each facet
|
|
280683
|
+
/** Clip each facet to the clippers.
|
|
280433
280684
|
* * Add inside, outside fragments to builderA, builderB
|
|
280434
280685
|
* * This does not consider params, normals, colors. Just points.
|
|
280435
280686
|
* @internal
|
|
280436
280687
|
*/
|
|
280437
|
-
static clipPolyfaceConvexClipPlaneSetToBuilders(
|
|
280688
|
+
static clipPolyfaceConvexClipPlaneSetToBuilders(source, clipper, destination) {
|
|
280438
280689
|
const builderA = destination.builderA;
|
|
280439
280690
|
const builderB = destination.builderB;
|
|
280440
|
-
const visitor =
|
|
280691
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_4__.Polyface ? source.createVisitor(0) : source;
|
|
280692
|
+
visitor.setNumWrap(0);
|
|
280441
280693
|
const cache = new _geometry3d_ReusableObjectCache__WEBPACK_IMPORTED_MODULE_6__.GrowableXYZArrayCache();
|
|
280442
280694
|
const outsideParts = [];
|
|
280443
280695
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
280444
|
-
// !!! currentCandidates and next candidates are empty at this point !!!
|
|
280445
280696
|
const insidePart = clipper.clipInsidePushOutside(visitor.point, outsideParts, cache);
|
|
280446
280697
|
if (insidePart === undefined) {
|
|
280447
280698
|
// everything is out ... outsideParts might be fragmented. Save only the original polygon
|
|
280448
280699
|
builderB?.addPolygonGrowableXYZArray(visitor.point);
|
|
280449
|
-
cache.dropToCache(insidePart);
|
|
280450
280700
|
cache.dropAllToCache(outsideParts);
|
|
280451
280701
|
}
|
|
280452
280702
|
this.addPolygonToBuilderAndDropToCache(insidePart, builderA, cache);
|
|
@@ -280582,15 +280832,16 @@ class PolyfaceClip {
|
|
|
280582
280832
|
}
|
|
280583
280833
|
}
|
|
280584
280834
|
}
|
|
280585
|
-
/** Clip each facet
|
|
280835
|
+
/** Clip each facet to the clippers.
|
|
280586
280836
|
* * Add inside, outside fragments to builderA, builderB
|
|
280587
280837
|
* * This does not consider params, normals, colors. Just points.
|
|
280588
280838
|
* @internal
|
|
280589
280839
|
*/
|
|
280590
|
-
static clipPolyfaceClipPlaneToBuilders(
|
|
280840
|
+
static clipPolyfaceClipPlaneToBuilders(source, clipper, destination) {
|
|
280591
280841
|
const builderA = destination.builderA;
|
|
280592
280842
|
const builderB = destination.builderB;
|
|
280593
|
-
const visitor =
|
|
280843
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_4__.Polyface ? source.createVisitor(0) : source;
|
|
280844
|
+
visitor.setNumWrap(0);
|
|
280594
280845
|
const cache = new _geometry3d_ReusableObjectCache__WEBPACK_IMPORTED_MODULE_6__.GrowableXYZArrayCache();
|
|
280595
280846
|
const inside = cache.grabFromCache();
|
|
280596
280847
|
const outside = cache.grabFromCache();
|
|
@@ -280607,34 +280858,31 @@ class PolyfaceClip {
|
|
|
280607
280858
|
cache.dropToCache(inside);
|
|
280608
280859
|
cache.dropToCache(outside);
|
|
280609
280860
|
}
|
|
280610
|
-
/** Clip each facet
|
|
280861
|
+
/** Clip each facet to the clipper.
|
|
280611
280862
|
* * accumulate inside and outside facets -- to destination.builderA and destination.builderB
|
|
280612
|
-
* * if `destination.buildClosureFaces` is set,
|
|
280613
|
-
* * This method parses
|
|
280863
|
+
* * if `destination.buildClosureFaces` is set, also build closure facets.
|
|
280864
|
+
* * This method parses the variant input types and calls a more specific method.
|
|
280614
280865
|
* * WARNING: The new mesh is "points only".
|
|
280615
280866
|
* * outputSelect applies only for UnionOfConvexClipPlaneSets -- see [[PolyfaceClip.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders]]
|
|
280616
280867
|
*/
|
|
280617
|
-
static clipPolyfaceInsideOutside(
|
|
280618
|
-
if (clipper instanceof _clipping_ClipPlane__WEBPACK_IMPORTED_MODULE_18__.ClipPlane)
|
|
280619
|
-
this.clipPolyfaceClipPlaneToBuilders(
|
|
280620
|
-
|
|
280621
|
-
|
|
280622
|
-
|
|
280623
|
-
|
|
280624
|
-
else if (clipper instanceof _clipping_UnionOfConvexClipPlaneSets__WEBPACK_IMPORTED_MODULE_20__.UnionOfConvexClipPlaneSets) {
|
|
280625
|
-
this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(polyface, clipper, destination, outputSelect);
|
|
280626
|
-
}
|
|
280868
|
+
static clipPolyfaceInsideOutside(source, clipper, destination, outputSelect = 0) {
|
|
280869
|
+
if (clipper instanceof _clipping_ClipPlane__WEBPACK_IMPORTED_MODULE_18__.ClipPlane)
|
|
280870
|
+
this.clipPolyfaceClipPlaneToBuilders(source, clipper, destination);
|
|
280871
|
+
else if (clipper instanceof _clipping_ConvexClipPlaneSet__WEBPACK_IMPORTED_MODULE_19__.ConvexClipPlaneSet)
|
|
280872
|
+
this.clipPolyfaceConvexClipPlaneSetToBuilders(source, clipper, destination);
|
|
280873
|
+
else if (clipper instanceof _clipping_UnionOfConvexClipPlaneSets__WEBPACK_IMPORTED_MODULE_20__.UnionOfConvexClipPlaneSets)
|
|
280874
|
+
this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(source, clipper, destination, outputSelect);
|
|
280627
280875
|
}
|
|
280628
|
-
/** Clip each facet
|
|
280876
|
+
/** Clip each facet to the clipper.
|
|
280629
280877
|
* * This method parses the variant input types and calls a more specific method.
|
|
280630
280878
|
* * To get both inside and outside parts, use clipPolyfaceInsideOutside
|
|
280631
280879
|
* * WARNING: The new mesh is "points only".
|
|
280632
280880
|
*/
|
|
280633
|
-
static clipPolyface(
|
|
280881
|
+
static clipPolyface(source, clipper) {
|
|
280634
280882
|
if (clipper instanceof _clipping_ClipPlane__WEBPACK_IMPORTED_MODULE_18__.ClipPlane)
|
|
280635
|
-
return this.clipPolyfaceClipPlane(
|
|
280883
|
+
return this.clipPolyfaceClipPlane(source, clipper);
|
|
280636
280884
|
if (clipper instanceof _clipping_ConvexClipPlaneSet__WEBPACK_IMPORTED_MODULE_19__.ConvexClipPlaneSet)
|
|
280637
|
-
return this.clipPolyfaceConvexClipPlaneSet(
|
|
280885
|
+
return this.clipPolyfaceConvexClipPlaneSet(source, clipper);
|
|
280638
280886
|
// (The if tests exhaust the type space -- this line is unreachable.)
|
|
280639
280887
|
return undefined;
|
|
280640
280888
|
}
|
|
@@ -280648,7 +280896,7 @@ class PolyfaceClip {
|
|
|
280648
280896
|
* @returns clipped facets. No other mesh data but vertices appear in output.
|
|
280649
280897
|
*/
|
|
280650
280898
|
static drapeRegion(mesh, region, sweepVector, options) {
|
|
280651
|
-
if (mesh instanceof
|
|
280899
|
+
if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_4__.Polyface)
|
|
280652
280900
|
return this.drapeRegion(mesh.createVisitor(0), region, sweepVector, options);
|
|
280653
280901
|
const contour = _solid_SweepContour__WEBPACK_IMPORTED_MODULE_16__.SweepContour.createForLinearSweep(region);
|
|
280654
280902
|
if (!contour)
|
|
@@ -280684,10 +280932,11 @@ class PolyfaceClip {
|
|
|
280684
280932
|
/** Intersect each facet with the clip plane. (Producing intersection edges.)
|
|
280685
280933
|
* * Return all edges chained as array of LineString3d.
|
|
280686
280934
|
*/
|
|
280687
|
-
static sectionPolyfaceClipPlane(
|
|
280935
|
+
static sectionPolyfaceClipPlane(source, clipper) {
|
|
280688
280936
|
const chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_13__.ChainMergeContext.create();
|
|
280689
|
-
const visitor =
|
|
280690
|
-
|
|
280937
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_4__.Polyface ? source.createVisitor(0) : source;
|
|
280938
|
+
visitor.setNumWrap(0);
|
|
280939
|
+
const work = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__.GrowableXYZArray(10);
|
|
280691
280940
|
const point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_15__.Point3d.create();
|
|
280692
280941
|
const point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_15__.Point3d.create();
|
|
280693
280942
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
@@ -280722,11 +280971,11 @@ class PolyfaceClip {
|
|
|
280722
280971
|
visitorA.point.setRange(range);
|
|
280723
280972
|
searchA.addRange(range, visitorA.currentReadIndex());
|
|
280724
280973
|
}
|
|
280725
|
-
const xyClip = new
|
|
280726
|
-
const workArray = new
|
|
280974
|
+
const xyClip = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__.GrowableXYZArray(10);
|
|
280975
|
+
const workArray = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__.GrowableXYZArray(10);
|
|
280727
280976
|
const xyFrustum = _clipping_ConvexClipPlaneSet__WEBPACK_IMPORTED_MODULE_19__.ConvexClipPlaneSet.createEmpty();
|
|
280728
|
-
const below = new
|
|
280729
|
-
const above = new
|
|
280977
|
+
const below = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__.GrowableXYZArray(10);
|
|
280978
|
+
const above = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__.GrowableXYZArray(10);
|
|
280730
280979
|
const planeOfFacet = _clipping_ClipPlane__WEBPACK_IMPORTED_MODULE_18__.ClipPlane.createNormalAndPointXYZXYZ(0, 0, 1, 0, 0, 0);
|
|
280731
280980
|
const altitudeRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_17__.Range1d.createNull();
|
|
280732
280981
|
for (visitorB.reset(); visitorB.moveToNextFacet();) {
|
|
@@ -281602,42 +281851,41 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
281602
281851
|
/* harmony export */ });
|
|
281603
281852
|
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
281604
281853
|
/* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
281605
|
-
/* harmony import */ var
|
|
281854
|
+
/* harmony import */ var _curve_CurveOps__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../curve/CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
|
|
281606
281855
|
/* harmony import */ var _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../curve/internalContexts/MultiChainCollector */ "../../core/geometry/lib/esm/curve/internalContexts/MultiChainCollector.js");
|
|
281607
281856
|
/* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
281608
281857
|
/* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
281609
281858
|
/* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
281610
|
-
/* harmony import */ var
|
|
281859
|
+
/* harmony import */ var _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../curve/StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
|
|
281611
281860
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
281612
281861
|
/* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
281613
|
-
/* harmony import */ var
|
|
281614
|
-
/* harmony import */ var
|
|
281862
|
+
/* harmony import */ var _geometry3d_BarycentricTriangle__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../geometry3d/BarycentricTriangle */ "../../core/geometry/lib/esm/geometry3d/BarycentricTriangle.js");
|
|
281863
|
+
/* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
|
|
281615
281864
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
281616
|
-
/* harmony import */ var
|
|
281865
|
+
/* harmony import */ var _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../geometry3d/PointHelpers */ "../../core/geometry/lib/esm/geometry3d/PointHelpers.js");
|
|
281617
281866
|
/* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
|
|
281618
|
-
/* harmony import */ var
|
|
281619
|
-
/* harmony import */ var
|
|
281620
|
-
/* harmony import */ var
|
|
281621
|
-
/* harmony import */ var
|
|
281622
|
-
/* harmony import */ var
|
|
281867
|
+
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
281868
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
281869
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
281870
|
+
/* harmony import */ var _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry4d/Matrix4d */ "../../core/geometry/lib/esm/geometry4d/Matrix4d.js");
|
|
281871
|
+
/* harmony import */ var _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geometry4d/MomentData */ "../../core/geometry/lib/esm/geometry4d/MomentData.js");
|
|
281623
281872
|
/* harmony import */ var _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../numerics/UnionFind */ "../../core/geometry/lib/esm/numerics/UnionFind.js");
|
|
281624
|
-
/* harmony import */ var
|
|
281625
|
-
/* harmony import */ var
|
|
281626
|
-
/* harmony import */ var
|
|
281627
|
-
/* harmony import */ var
|
|
281628
|
-
/* harmony import */ var
|
|
281629
|
-
/* harmony import */ var
|
|
281630
|
-
/* harmony import */ var
|
|
281631
|
-
/* harmony import */ var
|
|
281873
|
+
/* harmony import */ var _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../topology/ChainMerge */ "../../core/geometry/lib/esm/topology/ChainMerge.js");
|
|
281874
|
+
/* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
|
|
281875
|
+
/* harmony import */ var _topology_HalfEdgeGraphFromIndexedLoopsContext__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../topology/HalfEdgeGraphFromIndexedLoopsContext */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js");
|
|
281876
|
+
/* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
|
|
281877
|
+
/* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
|
|
281878
|
+
/* harmony import */ var _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../topology/SpaceTriangulation */ "../../core/geometry/lib/esm/topology/SpaceTriangulation.js");
|
|
281879
|
+
/* harmony import */ var _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./FacetLocationDetail */ "../../core/geometry/lib/esm/polyface/FacetLocationDetail.js");
|
|
281880
|
+
/* harmony import */ var _FacetOrientation__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./FacetOrientation */ "../../core/geometry/lib/esm/polyface/FacetOrientation.js");
|
|
281632
281881
|
/* harmony import */ var _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./IndexedEdgeMatcher */ "../../core/geometry/lib/esm/polyface/IndexedEdgeMatcher.js");
|
|
281633
|
-
/* harmony import */ var
|
|
281634
|
-
/* harmony import */ var
|
|
281635
|
-
/* harmony import */ var _multiclip_OffsetMeshContext__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./multiclip/OffsetMeshContext */ "../../core/geometry/lib/esm/polyface/multiclip/OffsetMeshContext.js");
|
|
281882
|
+
/* harmony import */ var _multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./multiclip/BuildAverageNormalsContext */ "../../core/geometry/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js");
|
|
281883
|
+
/* harmony import */ var _multiclip_OffsetMeshContext__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./multiclip/OffsetMeshContext */ "../../core/geometry/lib/esm/polyface/multiclip/OffsetMeshContext.js");
|
|
281636
281884
|
/* harmony import */ var _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./multiclip/SweepLineStringToFacetContext */ "../../core/geometry/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js");
|
|
281637
|
-
/* harmony import */ var
|
|
281885
|
+
/* harmony import */ var _multiclip_XYPointBuckets__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./multiclip/XYPointBuckets */ "../../core/geometry/lib/esm/polyface/multiclip/XYPointBuckets.js");
|
|
281638
281886
|
/* harmony import */ var _Polyface__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
281639
|
-
/* harmony import */ var
|
|
281640
|
-
/* harmony import */ var
|
|
281887
|
+
/* harmony import */ var _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
|
|
281888
|
+
/* harmony import */ var _RangeLengthData__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./RangeLengthData */ "../../core/geometry/lib/esm/polyface/RangeLengthData.js");
|
|
281641
281889
|
/*---------------------------------------------------------------------------------------------
|
|
281642
281890
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
281643
281891
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -281681,7 +281929,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
281681
281929
|
|
|
281682
281930
|
|
|
281683
281931
|
|
|
281684
|
-
|
|
281685
281932
|
|
|
281686
281933
|
|
|
281687
281934
|
/**
|
|
@@ -281709,14 +281956,27 @@ class SweepLineStringToFacetsOptions {
|
|
|
281709
281956
|
sideAngle;
|
|
281710
281957
|
/** Option to assemble lines into chains. */
|
|
281711
281958
|
assembleChains;
|
|
281959
|
+
/**
|
|
281960
|
+
* Optional searcher object for vertical sweep speedup. If provided, `vectorToEye` must be the positive Z vector.
|
|
281961
|
+
* @example To construct a 5x5 indexed search grid:
|
|
281962
|
+
* ````
|
|
281963
|
+
* const xyRange = Range2d.createFrom(myPolyface.range());
|
|
281964
|
+
* const searcher = GriddedRaggedRange2dSetWithOverflow.create<number>(xyRange, 5, 5)!;
|
|
281965
|
+
* for (const visitor = myPolyface.createVisitor(0); visitor.moveToNextFacet();) {
|
|
281966
|
+
* searcher.addRange(visitor.point.getRange(), visitor.currentReadIndex());
|
|
281967
|
+
* }
|
|
281968
|
+
* ````
|
|
281969
|
+
*/
|
|
281970
|
+
searcher;
|
|
281712
281971
|
/** Constructor. Captures fully-checked parameters from static create method. */
|
|
281713
|
-
constructor(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets) {
|
|
281972
|
+
constructor(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets, searcher) {
|
|
281714
281973
|
this.vectorToEye = vectorToEye;
|
|
281715
281974
|
this.sideAngle = sideAngle;
|
|
281716
281975
|
this.assembleChains = assembleChains;
|
|
281717
281976
|
this.collectOnForwardFacets = collectOnForwardFacets;
|
|
281718
281977
|
this.collectOnSideFacets = collectOnSideFacets;
|
|
281719
281978
|
this.collectOnRearFacets = collectOnRearFacets;
|
|
281979
|
+
this.searcher = searcher;
|
|
281720
281980
|
}
|
|
281721
281981
|
/**
|
|
281722
281982
|
* Create an options structure.
|
|
@@ -281725,14 +281985,12 @@ class SweepLineStringToFacetsOptions {
|
|
|
281725
281985
|
* * Default `assembleChains` is `true`.
|
|
281726
281986
|
* * Default `collectOnForwardFacets`, `collectOnSideFacets`, `collectOnRearFacets` are all `true`.
|
|
281727
281987
|
*/
|
|
281728
|
-
static create(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets) {
|
|
281729
|
-
return new SweepLineStringToFacetsOptions(vectorToEye
|
|
281988
|
+
static create(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets, searcher) {
|
|
281989
|
+
return new SweepLineStringToFacetsOptions((!vectorToEye || searcher) ? _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ() : vectorToEye.clone(), sideAngle?.clone() ?? _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createRadians(_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallAngleRadians), assembleChains ?? true, collectOnForwardFacets ?? true, collectOnSideFacets ?? true, collectOnRearFacets ?? true, searcher);
|
|
281730
281990
|
}
|
|
281731
281991
|
/** Return `true` if all outputs are requested. */
|
|
281732
281992
|
get collectAll() {
|
|
281733
|
-
return this.collectOnForwardFacets
|
|
281734
|
-
this.collectOnSideFacets === true &&
|
|
281735
|
-
this.collectOnRearFacets === true;
|
|
281993
|
+
return this.collectOnForwardFacets && this.collectOnSideFacets && this.collectOnRearFacets;
|
|
281736
281994
|
}
|
|
281737
281995
|
/**
|
|
281738
281996
|
* Decide if the instance collector flags accept a facet with the given normal.
|
|
@@ -281843,21 +282101,21 @@ class PolyfaceQuery {
|
|
|
281843
282101
|
* @param source polyface or visitor.
|
|
281844
282102
|
* @param vectorToEye compute sum of (signed) facet areas projected to a view plane perpendicular to `vectorToEye`.
|
|
281845
282103
|
* If `vectorToEye` is not provided, actual facet areas are calculated (without any projection).
|
|
281846
|
-
* @returns the sum of all facet areas.
|
|
282104
|
+
* @returns the sum of all facet areas.
|
|
281847
282105
|
*/
|
|
281848
282106
|
static sumFacetAreas(source, vectorToEye) {
|
|
281849
282107
|
let sum = 0;
|
|
281850
|
-
if (source
|
|
281851
|
-
|
|
281852
|
-
|
|
281853
|
-
|
|
281854
|
-
|
|
281855
|
-
|
|
281856
|
-
|
|
281857
|
-
|
|
281858
|
-
|
|
281859
|
-
|
|
281860
|
-
|
|
282108
|
+
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
|
|
282109
|
+
source = source.createVisitor(1);
|
|
282110
|
+
else
|
|
282111
|
+
source.setNumWrap(1);
|
|
282112
|
+
let unitVectorToEye;
|
|
282113
|
+
if (vectorToEye !== undefined)
|
|
282114
|
+
unitVectorToEye = vectorToEye.normalize();
|
|
282115
|
+
source.reset();
|
|
282116
|
+
while (source.moveToNextFacet()) {
|
|
282117
|
+
const areaNormal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.areaNormal(source.point.getPoint3dArray());
|
|
282118
|
+
sum += unitVectorToEye ? areaNormal.dotProduct(unitVectorToEye) : areaNormal.magnitude();
|
|
281861
282119
|
}
|
|
281862
282120
|
return sum;
|
|
281863
282121
|
}
|
|
@@ -281891,75 +282149,53 @@ class PolyfaceQuery {
|
|
|
281891
282149
|
}
|
|
281892
282150
|
/**
|
|
281893
282151
|
* Sum (signed) volumes between facets and a plane.
|
|
281894
|
-
*
|
|
281895
|
-
*
|
|
281896
|
-
*
|
|
281897
|
-
*
|
|
281898
|
-
|
|
281899
|
-
|
|
281900
|
-
|
|
281901
|
-
|
|
281902
|
-
|
|
281903
|
-
|
|
281904
|
-
const
|
|
281905
|
-
|
|
281906
|
-
const
|
|
281907
|
-
|
|
281908
|
-
|
|
281909
|
-
|
|
281910
|
-
let
|
|
281911
|
-
const
|
|
281912
|
-
const
|
|
281913
|
-
const singleFacetProducts = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_10__.Matrix4d.createZero();
|
|
281914
|
-
const projectToPlane = plane.getProjectionToPlane();
|
|
281915
|
-
source.reset();
|
|
282152
|
+
* @param source facet set
|
|
282153
|
+
* @param plane infinite plane bounding volume between the input facets and (virtual) side facets perpendicular to the plane.
|
|
282154
|
+
* @param skipMoments whether to skip computation of the area moments. Set to `true` if only volume is needed. Default is `false`.
|
|
282155
|
+
* @returns a structure with multiple sums:
|
|
282156
|
+
* * volume: the sum of (signed) volumes between facets and the plane.
|
|
282157
|
+
* * positiveProjectedFacetAreaMoments, negativeProjectedFacetAreaMoments: area moment data (centroid, signed area,
|
|
282158
|
+
* and second moments with respect to the centroid), separately computed for the input facets that project with
|
|
282159
|
+
* positive/negative area onto the plane.
|
|
282160
|
+
*/
|
|
282161
|
+
static sumVolumeBetweenFacetsAndPlane(source, plane, skipMoments) {
|
|
282162
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.createVisitor(0) : source;
|
|
282163
|
+
visitor.setNumWrap(0);
|
|
282164
|
+
const workPoint0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
282165
|
+
const workPoint1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
282166
|
+
const workVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
282167
|
+
const workMatrix = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__.Matrix4d.createZero();
|
|
282168
|
+
let signedVolumeTimes6 = 0.0;
|
|
282169
|
+
const posSums = skipMoments ? undefined : _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_10__.MomentData.create(undefined, true);
|
|
282170
|
+
const negSums = skipMoments ? undefined : _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_10__.MomentData.create(undefined, true);
|
|
281916
282171
|
// For each facet:
|
|
281917
282172
|
// - form triangles from facet origin to each far edge.
|
|
281918
|
-
// - sum signed area and volume contributions.
|
|
281919
|
-
// each projected area contribution is twice the area of a triangle.
|
|
281920
|
-
// each volume contribution is 3 times the actual volume --
|
|
281921
|
-
|
|
281922
|
-
|
|
281923
|
-
|
|
281924
|
-
|
|
281925
|
-
|
|
281926
|
-
|
|
281927
|
-
|
|
281928
|
-
|
|
281929
|
-
|
|
281930
|
-
|
|
281931
|
-
facetOrigin.crossProductToPoints(targetA, targetB, triangleNormal);
|
|
281932
|
-
hA = plane.altitude(targetA);
|
|
281933
|
-
hB = plane.altitude(targetB);
|
|
281934
|
-
signedTriangleArea = planeNormal.dotProduct(triangleNormal);
|
|
281935
|
-
singleFacetArea += signedTriangleArea;
|
|
281936
|
-
signedVolumeSum += signedTriangleArea * (h0 + hA + hB);
|
|
281937
|
-
}
|
|
281938
|
-
singleFacetProducts.setZero();
|
|
281939
|
-
source.point.multiplyTransformInPlace(projectToPlane);
|
|
281940
|
-
_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.addSecondMomentAreaProducts(source.point, facetOrigin, singleFacetProducts);
|
|
281941
|
-
if (singleFacetArea > 0) {
|
|
281942
|
-
positiveAreaMomentSums.accumulateProductsFromOrigin(facetOrigin, singleFacetProducts, 1.0);
|
|
281943
|
-
}
|
|
281944
|
-
else {
|
|
281945
|
-
negativeAreaMomentSums.accumulateProductsFromOrigin(facetOrigin, singleFacetProducts, 1.0);
|
|
282173
|
+
// - sum signed area and volume contributions (for non-convex facet, signs can be mixed).
|
|
282174
|
+
// - each projected area contribution is twice the area of a triangle.
|
|
282175
|
+
// - each volume contribution is 3 times the actual volume -- a third of the altitude sum is the centroid altitude.
|
|
282176
|
+
const options = { skipMoments, p0: workPoint0, p1: workPoint1, v0: workVector, m0: workMatrix };
|
|
282177
|
+
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
282178
|
+
const facetData = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.volumeBetweenPolygonAndPlane(visitor.point, plane, options);
|
|
282179
|
+
signedVolumeTimes6 += facetData.volume6;
|
|
282180
|
+
if (!skipMoments) {
|
|
282181
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(posSums !== undefined && negSums !== undefined && facetData.origin !== undefined && facetData.products !== undefined);
|
|
282182
|
+
if (facetData.area2 > 0)
|
|
282183
|
+
posSums.accumulateProductsFromOrigin(facetData.origin, facetData.products, 1.0);
|
|
282184
|
+
else
|
|
282185
|
+
negSums.accumulateProductsFromOrigin(facetData.origin, facetData.products, 1.0);
|
|
281946
282186
|
}
|
|
281947
282187
|
}
|
|
281948
|
-
positiveAreaMomentSums.shiftOriginAndSumsToCentroidOfSums();
|
|
281949
|
-
negativeAreaMomentSums.shiftOriginAndSumsToCentroidOfSums();
|
|
281950
|
-
const positiveAreaMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_9__.MomentData.inertiaProductsToPrincipalAxes(positiveAreaMomentSums.origin, positiveAreaMomentSums.sums);
|
|
281951
|
-
const negativeAreaMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_9__.MomentData.inertiaProductsToPrincipalAxes(negativeAreaMomentSums.origin, negativeAreaMomentSums.sums);
|
|
281952
282188
|
return {
|
|
281953
|
-
volume:
|
|
281954
|
-
positiveProjectedFacetAreaMoments:
|
|
281955
|
-
negativeProjectedFacetAreaMoments:
|
|
282189
|
+
volume: signedVolumeTimes6 / 6.0,
|
|
282190
|
+
positiveProjectedFacetAreaMoments: posSums ? _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_10__.MomentData.inertiaProductsToPrincipalAxes(posSums.origin, posSums.sums) : undefined,
|
|
282191
|
+
negativeProjectedFacetAreaMoments: negSums ? _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_10__.MomentData.inertiaProductsToPrincipalAxes(negSums.origin, negSums.sums) : undefined,
|
|
281956
282192
|
};
|
|
281957
282193
|
}
|
|
281958
282194
|
/** Return the inertia products [xx,xy,xz,xw,yw, etc] integrated over all all facets as viewed from origin. */
|
|
281959
282195
|
static sumFacetSecondAreaMomentProducts(source, origin) {
|
|
281960
282196
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
|
|
281961
282197
|
return PolyfaceQuery.sumFacetSecondAreaMomentProducts(source.createVisitor(0), origin);
|
|
281962
|
-
const products =
|
|
282198
|
+
const products = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__.Matrix4d.createZero();
|
|
281963
282199
|
source.reset();
|
|
281964
282200
|
while (source.moveToNextFacet()) {
|
|
281965
282201
|
_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.addSecondMomentAreaProducts(source.point, origin, products);
|
|
@@ -281970,7 +282206,7 @@ class PolyfaceQuery {
|
|
|
281970
282206
|
static sumFacetSecondVolumeMomentProducts(source, origin) {
|
|
281971
282207
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
|
|
281972
282208
|
return PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source.createVisitor(0), origin);
|
|
281973
|
-
const products =
|
|
282209
|
+
const products = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__.Matrix4d.createZero();
|
|
281974
282210
|
source.reset();
|
|
281975
282211
|
while (source.moveToNextFacet()) {
|
|
281976
282212
|
_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.addSecondMomentVolumeProducts(source.point, origin, products);
|
|
@@ -281988,7 +282224,7 @@ class PolyfaceQuery {
|
|
|
281988
282224
|
if (!origin)
|
|
281989
282225
|
return undefined;
|
|
281990
282226
|
const inertiaProducts = PolyfaceQuery.sumFacetSecondAreaMomentProducts(source, origin);
|
|
281991
|
-
return
|
|
282227
|
+
return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_10__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
|
|
281992
282228
|
}
|
|
281993
282229
|
/**
|
|
281994
282230
|
* Compute area moments for the mesh. In the returned MomentData:
|
|
@@ -282003,7 +282239,7 @@ class PolyfaceQuery {
|
|
|
282003
282239
|
if (!origin)
|
|
282004
282240
|
return undefined;
|
|
282005
282241
|
const inertiaProducts = PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source, origin);
|
|
282006
|
-
return
|
|
282242
|
+
return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_10__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
|
|
282007
282243
|
}
|
|
282008
282244
|
/**
|
|
282009
282245
|
* Determine whether all facets are convex.
|
|
@@ -282027,7 +282263,7 @@ class PolyfaceQuery {
|
|
|
282027
282263
|
* Compute a number summarizing the dihedral angles in the mesh.
|
|
282028
282264
|
* * A dihedral angle is the signed angle between adjacent facets' normals. This angle is positive when the cross
|
|
282029
282265
|
* product `normalA x normalB` has the same direction as facetA's traversal of the facets' shared edge.
|
|
282030
|
-
* @param source
|
|
282266
|
+
* @param source facets.
|
|
282031
282267
|
* @param ignoreBoundaries if `true` ignore simple boundary edges, i.e., allow unclosed meshes. Default is `false`.
|
|
282032
282268
|
* See [[isConvexByDihedralAngleCount]] for comments about passing true when there are multiple
|
|
282033
282269
|
* connected components.
|
|
@@ -282043,19 +282279,21 @@ class PolyfaceQuery {
|
|
|
282043
282279
|
static dihedralAngleSummary(source, ignoreBoundaries = false) {
|
|
282044
282280
|
// more info can be found at geometry/internaldocs/Polyface.md
|
|
282045
282281
|
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.IndexedEdgeMatcher();
|
|
282046
|
-
const
|
|
282047
|
-
visitor.
|
|
282048
|
-
|
|
282282
|
+
const vertices = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.data.point : undefined;
|
|
282283
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.createVisitor(1) : source;
|
|
282284
|
+
visitor.setNumWrap(1);
|
|
282049
282285
|
const centroidNormal = [];
|
|
282050
282286
|
let normalCounter = 0;
|
|
282051
|
-
|
|
282287
|
+
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
282052
282288
|
const numEdges = visitor.pointCount - 1;
|
|
282053
282289
|
const normal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.centroidAreaNormal(visitor.point);
|
|
282054
282290
|
if (normal === undefined)
|
|
282055
282291
|
return -2;
|
|
282056
282292
|
centroidNormal.push(normal);
|
|
282057
282293
|
for (let i = 0; i < numEdges; i++) {
|
|
282058
|
-
edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), normalCounter);
|
|
282294
|
+
const edge = edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), normalCounter);
|
|
282295
|
+
if (!vertices) // decorate if we don't have vertices to query later
|
|
282296
|
+
edge.edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createStartEnd(visitor.point.getPoint3dAtUncheckedPointIndex(i), visitor.point.getPoint3dAtUncheckedPointIndex(i + 1));
|
|
282059
282297
|
}
|
|
282060
282298
|
normalCounter++;
|
|
282061
282299
|
}
|
|
@@ -282073,11 +282311,16 @@ class PolyfaceQuery {
|
|
|
282073
282311
|
let numNegative = 0;
|
|
282074
282312
|
const edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
282075
282313
|
for (const cluster of manifoldClusters) {
|
|
282076
|
-
|
|
282077
|
-
|
|
282078
|
-
|
|
282079
|
-
|
|
282080
|
-
|
|
282314
|
+
if (Array.isArray(cluster) && cluster.length === 2) {
|
|
282315
|
+
const sideA = cluster[0];
|
|
282316
|
+
const sideB = cluster[1];
|
|
282317
|
+
if (vertices)
|
|
282318
|
+
vertices.vectorIndexIndex(sideA.startVertex, sideA.endVertex, edgeVector);
|
|
282319
|
+
else
|
|
282320
|
+
edgeVector.setFrom(sideA.edgeVector);
|
|
282321
|
+
const facetNormalA = centroidNormal[sideA.facetIndex].direction;
|
|
282322
|
+
const facetNormalB = centroidNormal[sideB.facetIndex].direction;
|
|
282323
|
+
const dihedralAngle = facetNormalA.signedAngleTo(facetNormalB, edgeVector);
|
|
282081
282324
|
if (dihedralAngle.isAlmostZero)
|
|
282082
282325
|
numPlanar++;
|
|
282083
282326
|
else if (dihedralAngle.radians > 0.0)
|
|
@@ -282113,26 +282356,50 @@ class PolyfaceQuery {
|
|
|
282113
282356
|
static isConvexByDihedralAngleCount(source, ignoreBoundaries = false) {
|
|
282114
282357
|
return this.dihedralAngleSummary(source, ignoreBoundaries) > 0;
|
|
282115
282358
|
}
|
|
282359
|
+
/** Helper function to detect a subset visitor. */
|
|
282360
|
+
static isSubsetVisitor(visitor) {
|
|
282361
|
+
if (visitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
|
|
282362
|
+
return false;
|
|
282363
|
+
const parentFacetCount = visitor.clientPolyface()?.facetCount;
|
|
282364
|
+
const visitableFacetCount = visitor.getVisitableFacetCount?.();
|
|
282365
|
+
if (parentFacetCount === undefined || visitableFacetCount === undefined)
|
|
282366
|
+
return false;
|
|
282367
|
+
return parentFacetCount > visitableFacetCount;
|
|
282368
|
+
}
|
|
282116
282369
|
/**
|
|
282117
|
-
*
|
|
282118
|
-
*
|
|
282119
|
-
|
|
282120
|
-
|
|
282370
|
+
* Faster version of isPolyfaceManifold for specific input.
|
|
282371
|
+
* @returns whether the mesh is manifold, or undefined if unsuccessful.
|
|
282372
|
+
*/
|
|
282373
|
+
static isPolyfaceManifoldFast(source, allowSimpleBoundaries) {
|
|
282374
|
+
if (allowSimpleBoundaries)
|
|
282375
|
+
return undefined; // edgeMateIndex does not distinguish boundary edges from non-manifold edges so we can only speed things up if we search for both
|
|
282376
|
+
if (this.isSubsetVisitor(source))
|
|
282377
|
+
return false; // edgeMateIndex doesn't capture the facet subset boundary
|
|
282378
|
+
const parentData = _Polyface__WEBPACK_IMPORTED_MODULE_7__.IndexedPolyface.hasEdgeMateIndex(source);
|
|
282379
|
+
if (!parentData)
|
|
282380
|
+
return undefined;
|
|
282381
|
+
for (const edgeMate of parentData.edgeMateIndex) {
|
|
282382
|
+
if (edgeMate === undefined)
|
|
282383
|
+
return false; // found a boundary or non-manifold edge
|
|
282384
|
+
}
|
|
282385
|
+
return true; // this is a 2-manifold closed surface
|
|
282386
|
+
}
|
|
282387
|
+
/**
|
|
282388
|
+
* Test edge pairing in `source` mesh.
|
|
282121
282389
|
* * Any edge with 3 or more adjacent facets triggers `false` return.
|
|
282122
|
-
* * Any edge with 2 adjacent facets in the same direction triggers
|
|
282390
|
+
* * Any edge with 2 adjacent facets in the same direction triggers `false` return.
|
|
282391
|
+
* * Null edges are ignored.
|
|
282392
|
+
* @param source facet set to examine
|
|
282393
|
+
* @param allowSimpleBoundaries if `false` (default), a return value of `true` means the facets form a closed
|
|
282394
|
+
* 2-manifold surface; if `true`, a return value of `true` means the facets form a 2-manifold surface which may
|
|
282395
|
+
* have a boundary, but is still properly matched internally.
|
|
282123
282396
|
*/
|
|
282124
282397
|
static isPolyfaceManifold(source, allowSimpleBoundaries = false) {
|
|
282125
|
-
const
|
|
282126
|
-
|
|
282127
|
-
|
|
282128
|
-
while (visitor.moveToNextFacet()) {
|
|
282129
|
-
const numEdges = visitor.pointCount - 1;
|
|
282130
|
-
for (let i = 0; i < numEdges; i++) {
|
|
282131
|
-
edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), visitor.currentReadIndex());
|
|
282132
|
-
}
|
|
282133
|
-
}
|
|
282398
|
+
const isManifold = this.isPolyfaceManifoldFast(source, allowSimpleBoundaries);
|
|
282399
|
+
if (isManifold !== undefined)
|
|
282400
|
+
return isManifold;
|
|
282134
282401
|
const badClusters = [];
|
|
282135
|
-
|
|
282402
|
+
this.createIndexedEdges(source).sortAndCollectClusters(undefined, allowSimpleBoundaries ? undefined : badClusters, undefined, badClusters);
|
|
282136
282403
|
return badClusters.length === 0;
|
|
282137
282404
|
}
|
|
282138
282405
|
/** Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume. */
|
|
@@ -282140,50 +282407,107 @@ class PolyfaceQuery {
|
|
|
282140
282407
|
return this.isPolyfaceManifold(source, false);
|
|
282141
282408
|
}
|
|
282142
282409
|
/**
|
|
282143
|
-
*
|
|
282144
|
-
*
|
|
282410
|
+
* Faster version of announceBoundaryEdges for specific input.
|
|
282411
|
+
* @returns true if successfully announced boundary edges.
|
|
282412
|
+
*/
|
|
282413
|
+
static announceBoundaryEdgesFast(source, announceEdge, includeTypical, includeMismatch, includeNull) {
|
|
282414
|
+
if (includeTypical !== includeMismatch)
|
|
282415
|
+
return false; // edgeMateIndex does not distinguish boundary edges from non-manifold edges
|
|
282416
|
+
if (!includeTypical && !includeNull)
|
|
282417
|
+
return true;
|
|
282418
|
+
if (this.isSubsetVisitor(source))
|
|
282419
|
+
return false; // edgeMateIndex doesn't capture the facet subset boundary
|
|
282420
|
+
const parentData = _Polyface__WEBPACK_IMPORTED_MODULE_7__.IndexedPolyface.hasEdgeMateIndex(source);
|
|
282421
|
+
if (!parentData)
|
|
282422
|
+
return false;
|
|
282423
|
+
const pointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
282424
|
+
const pointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
282425
|
+
for (let edgeIndex = 0; edgeIndex < parentData.edgeMateIndex.length; edgeIndex++) {
|
|
282426
|
+
const edgeMate = parentData.edgeMateIndex[edgeIndex];
|
|
282427
|
+
const announceBoundaryOrNonManifoldEdge = includeTypical && edgeMate === undefined;
|
|
282428
|
+
const announceNullEdge = includeNull && edgeMate === edgeIndex;
|
|
282429
|
+
if (announceBoundaryOrNonManifoldEdge || announceNullEdge) {
|
|
282430
|
+
const facetIndex = parentData.parent.edgeIndexToFacetIndex(edgeIndex);
|
|
282431
|
+
if (facetIndex !== undefined) { // should always be defined
|
|
282432
|
+
const pointIndexA = parentData.parent.data.pointIndex[edgeIndex];
|
|
282433
|
+
let nextEdgeIndex = edgeIndex + 1;
|
|
282434
|
+
if (nextEdgeIndex >= parentData.parent.facetIndex1(facetIndex))
|
|
282435
|
+
nextEdgeIndex = parentData.parent.facetIndex0(facetIndex);
|
|
282436
|
+
const pointIndexB = parentData.parent.data.pointIndex[nextEdgeIndex];
|
|
282437
|
+
parentData.parent.data.getPoint(pointIndexA, pointA);
|
|
282438
|
+
parentData.parent.data.getPoint(pointIndexB, pointB);
|
|
282439
|
+
announceEdge(pointA, pointB, pointIndexA, pointIndexB, facetIndex);
|
|
282440
|
+
}
|
|
282441
|
+
}
|
|
282442
|
+
}
|
|
282443
|
+
return true;
|
|
282444
|
+
}
|
|
282445
|
+
/**
|
|
282446
|
+
* Announce boundary edges of the facet set as line segments.
|
|
282145
282447
|
* @param source polyface or visitor.
|
|
282146
282448
|
* @param announceEdge function to be called with each boundary edge. The announcement is start and end points,
|
|
282147
|
-
* start and end indices, and facet index.
|
|
282148
|
-
* @param includeTypical true to announce typical boundary edges with a single adjacent facet.
|
|
282149
|
-
* @param includeMismatch true to announce edges
|
|
282150
|
-
*
|
|
282449
|
+
* start and end vertex indices, and facet index.
|
|
282450
|
+
* @param includeTypical true to announce typical boundary edges with a single adjacent facet. Default is true.
|
|
282451
|
+
* @param includeMismatch true to announce non-manifold edges (more than 2 adjacent facets, or mismatched
|
|
282452
|
+
* orientations). Default is true.
|
|
282453
|
+
* @param includeNull true to announce edges with identical start and end vertex indices. Default is true.
|
|
282454
|
+
* @see [[announceBoundaryChainsAsLineString3d]] for boundary linestring announcement
|
|
282455
|
+
* @see [[collectBoundaryEdges]] for boundary chain collection
|
|
282456
|
+
* @see [[boundaryEdges]] for boundary edge collection
|
|
282151
282457
|
*/
|
|
282152
282458
|
static announceBoundaryEdges(source, announceEdge, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
282153
|
-
if (source
|
|
282459
|
+
if (this.announceBoundaryEdgesFast(source, announceEdge, includeTypical, includeMismatch, includeNull))
|
|
282154
282460
|
return;
|
|
282155
|
-
|
|
282461
|
+
if (!includeTypical && !includeMismatch && !includeNull)
|
|
282462
|
+
return;
|
|
282463
|
+
const vertices = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.data.point : undefined;
|
|
282156
282464
|
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.createVisitor(1) : source;
|
|
282157
282465
|
visitor.setNumWrap(1);
|
|
282158
|
-
|
|
282159
|
-
|
|
282466
|
+
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.IndexedEdgeMatcher();
|
|
282467
|
+
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
282160
282468
|
const numEdges = visitor.pointCount - 1;
|
|
282161
282469
|
for (let i = 0; i < numEdges; i++) {
|
|
282162
|
-
edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), visitor.currentReadIndex());
|
|
282470
|
+
const edge = edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), visitor.currentReadIndex());
|
|
282471
|
+
if (!vertices) { // decorate if we don't have vertices to query later
|
|
282472
|
+
edge.pointA = visitor.point.getPoint3dAtUncheckedPointIndex(i);
|
|
282473
|
+
edge.pointB = visitor.point.getPoint3dAtUncheckedPointIndex(i + 1);
|
|
282474
|
+
}
|
|
282163
282475
|
}
|
|
282164
282476
|
}
|
|
282165
282477
|
const boundaryEdges = [];
|
|
282166
|
-
|
|
282478
|
+
const typicalEdges = includeTypical ? boundaryEdges : undefined;
|
|
282479
|
+
const nullEdges = includeNull ? boundaryEdges : undefined;
|
|
282480
|
+
const mismatchEdges = includeMismatch ? boundaryEdges : undefined;
|
|
282481
|
+
edges.sortAndCollectClusters(undefined, typicalEdges, nullEdges, mismatchEdges);
|
|
282167
282482
|
if (boundaryEdges.length === 0)
|
|
282168
282483
|
return;
|
|
282169
|
-
const sourcePolyface = visitor.clientPolyface();
|
|
282170
282484
|
const pointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
282171
282485
|
const pointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
282172
282486
|
for (const e of boundaryEdges) {
|
|
282173
|
-
const e1 = e instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.SortableEdge ? e : e[0];
|
|
282174
|
-
const indexA = e1.
|
|
282175
|
-
const indexB = e1.
|
|
282176
|
-
if (
|
|
282177
|
-
|
|
282487
|
+
const e1 = e instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.SortableEdge ? e : e[0]; // only report the first edge in a cluster!
|
|
282488
|
+
const indexA = e1.startVertex;
|
|
282489
|
+
const indexB = e1.endVertex;
|
|
282490
|
+
if (vertices) {
|
|
282491
|
+
vertices.getPoint3dAtUncheckedPointIndex(indexA, pointA);
|
|
282492
|
+
vertices.getPoint3dAtUncheckedPointIndex(indexB, pointB);
|
|
282493
|
+
}
|
|
282494
|
+
else {
|
|
282495
|
+
pointA.setFrom(e1.pointA);
|
|
282496
|
+
pointB.setFrom(e1.pointB);
|
|
282497
|
+
}
|
|
282498
|
+
announceEdge(pointA, pointB, indexA, indexB, e1.facetIndex);
|
|
282178
282499
|
}
|
|
282179
282500
|
}
|
|
282180
282501
|
/**
|
|
282181
|
-
*
|
|
282182
|
-
* * Each edge is a LineSegment3d.
|
|
282502
|
+
* Collect boundary edges of the facet set as an unordered collection of line segments.
|
|
282183
282503
|
* @param source polyface or visitor.
|
|
282184
|
-
* @param includeTypical true to
|
|
282185
|
-
* @param includeMismatch true to include edges
|
|
282186
|
-
*
|
|
282504
|
+
* @param includeTypical true to include typical boundary edges with a single adjacent facet. Default is true.
|
|
282505
|
+
* @param includeMismatch true to include non-manifold edges (more than 2 adjacent facets, or mismatched
|
|
282506
|
+
* orientations). Default is true.
|
|
282507
|
+
* @param includeNull true to include edges with identical start and end vertex indices. Default is true.
|
|
282508
|
+
* @see [[announceBoundaryChainsAsLineString3d]] for boundary linestring announcement
|
|
282509
|
+
* @see [[collectBoundaryEdges]] for boundary chain collection
|
|
282510
|
+
* @see [[announceBoundaryEdges]] for boundary edge announcement
|
|
282187
282511
|
*/
|
|
282188
282512
|
static boundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
282189
282513
|
const result = new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_6__.BagOfCurves();
|
|
@@ -282196,33 +282520,32 @@ class PolyfaceQuery {
|
|
|
282196
282520
|
return result;
|
|
282197
282521
|
}
|
|
282198
282522
|
/**
|
|
282199
|
-
* Collect boundary edges.
|
|
282200
|
-
* * Return the edges as the simplest collection of chains of line segments.
|
|
282523
|
+
* Collect boundary edges of the facet set as the simplest collection of chains of line segments.
|
|
282201
282524
|
* @param source polyface or visitor.
|
|
282202
|
-
* @param includeTypical true to include typical boundary edges with a single adjacent facet.
|
|
282203
|
-
* @param includeMismatch true to include edges
|
|
282204
|
-
*
|
|
282525
|
+
* @param includeTypical true to include typical boundary edges with a single adjacent facet. Default is true.
|
|
282526
|
+
* @param includeMismatch true to include non-manifold edges (more than 2 adjacent facets, or mismatched
|
|
282527
|
+
* orientations). Default is true.
|
|
282528
|
+
* @param includeNull true to include edges with identical start and end vertex indices. Default is true.
|
|
282529
|
+
* @see [[announceBoundaryChainsAsLineString3d]] for boundary linestring announcement
|
|
282530
|
+
* @see [[announceBoundaryEdges]] for boundary edge announcement
|
|
282531
|
+
* @see [[boundaryEdges]] for boundary edge collection
|
|
282205
282532
|
*/
|
|
282206
282533
|
static collectBoundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
282207
282534
|
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);
|
|
282208
|
-
|
|
282535
|
+
const announceEdge = (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(ptA, ptB));
|
|
282536
|
+
PolyfaceQuery.announceBoundaryEdges(source, announceEdge, includeTypical, includeMismatch, includeNull);
|
|
282209
282537
|
return collector.grabResult(true);
|
|
282210
282538
|
}
|
|
282211
282539
|
/**
|
|
282212
|
-
* Load
|
|
282213
|
-
* @param polyface a mesh or
|
|
282214
|
-
|
|
282540
|
+
* Load an IndexedEdgeMatcher from the edges of a mesh.
|
|
282541
|
+
* @param polyface a mesh or visitor
|
|
282542
|
+
*/
|
|
282215
282543
|
static createIndexedEdges(polyface) {
|
|
282216
|
-
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
|
|
282217
|
-
return this.createIndexedEdges(polyface.createVisitor(1));
|
|
282218
282544
|
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.IndexedEdgeMatcher();
|
|
282219
|
-
polyface.
|
|
282220
|
-
|
|
282221
|
-
|
|
282222
|
-
|
|
282223
|
-
edges.addEdge(polyface.clientPointIndex(i), polyface.clientPointIndex(i + 1), polyface.currentReadIndex());
|
|
282224
|
-
}
|
|
282225
|
-
}
|
|
282545
|
+
const visitor = polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? polyface.createVisitor(1) : polyface;
|
|
282546
|
+
visitor.setNumWrap(1);
|
|
282547
|
+
for (visitor.reset(); visitor.moveToNextFacet();)
|
|
282548
|
+
edges.addPath(visitor.pointIndex, visitor.currentReadIndex(), false);
|
|
282226
282549
|
return edges;
|
|
282227
282550
|
}
|
|
282228
282551
|
/**
|
|
@@ -282258,8 +282581,8 @@ class PolyfaceQuery {
|
|
|
282258
282581
|
for (const pair of manifoldEdges) {
|
|
282259
282582
|
if (!Array.isArray(pair) || pair.length !== 2)
|
|
282260
282583
|
continue;
|
|
282261
|
-
const indexA = pair[0].
|
|
282262
|
-
const indexB = pair[0].
|
|
282584
|
+
const indexA = pair[0].startVertex;
|
|
282585
|
+
const indexB = pair[0].endVertex;
|
|
282263
282586
|
if (!mesh.data.getPoint(indexA, pointA) || !mesh.data.getPoint(indexB, pointB))
|
|
282264
282587
|
continue;
|
|
282265
282588
|
const face0 = analyzeFace(pair[0].facetIndex);
|
|
@@ -282434,7 +282757,7 @@ class PolyfaceQuery {
|
|
|
282434
282757
|
}
|
|
282435
282758
|
/**
|
|
282436
282759
|
* Return the boundary of facets that are facing the eye.
|
|
282437
|
-
* @param polyface
|
|
282760
|
+
* @param source polyface or visitor. Must be capable of constructing a subset visitor.
|
|
282438
282761
|
* @param visibilitySubset selector among the visible facet sets extracted by partitionFacetIndicesByVisibilityVector
|
|
282439
282762
|
* * 0 ==> forward facing
|
|
282440
282763
|
* * 1 ==> rear facing
|
|
@@ -282442,21 +282765,29 @@ class PolyfaceQuery {
|
|
|
282442
282765
|
* @param vectorToEye the vector to eye
|
|
282443
282766
|
* @param sideAngleTolerance the tolerance of side angle
|
|
282444
282767
|
*/
|
|
282445
|
-
static boundaryOfVisibleSubset(
|
|
282446
|
-
const
|
|
282768
|
+
static boundaryOfVisibleSubset(source, visibilitySelect, vectorToEye, sideAngleTolerance = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(1.0e-3)) {
|
|
282769
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.createVisitor(0) : source;
|
|
282770
|
+
if (!visitor.createSubsetVisitor)
|
|
282771
|
+
return undefined;
|
|
282772
|
+
const partitionedIndices = this.partitionFacetIndicesByVisibilityVector(source, vectorToEye, sideAngleTolerance);
|
|
282447
282773
|
if (partitionedIndices[visibilitySelect].length === 0)
|
|
282448
282774
|
return undefined;
|
|
282449
|
-
const
|
|
282450
|
-
return this.boundaryEdges(
|
|
282775
|
+
const subsetVisitor = visitor.createSubsetVisitor(partitionedIndices[visibilitySelect], 1);
|
|
282776
|
+
return this.boundaryEdges(subsetVisitor, true, false, false);
|
|
282451
282777
|
}
|
|
282452
282778
|
/**
|
|
282453
|
-
*
|
|
282454
|
-
* *
|
|
282455
|
-
*
|
|
282779
|
+
* Announce boundary edges of the facet set as linestrings.
|
|
282780
|
+
* * Ignores non-manifold interior edges and null edges.
|
|
282781
|
+
* @param source polyface or visitor.
|
|
282782
|
+
* @param announceChain function to be called with each chain of boundary edges.
|
|
282783
|
+
* @see [[collectBoundaryEdges]] for boundary chain collection
|
|
282784
|
+
* @see [[announceBoundaryEdges]] for boundary edge announcement
|
|
282785
|
+
* @see [[boundaryEdges]] for boundary edge collection
|
|
282456
282786
|
*/
|
|
282457
|
-
static announceBoundaryChainsAsLineString3d(
|
|
282787
|
+
static announceBoundaryChainsAsLineString3d(source, announceChain) {
|
|
282458
282788
|
const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_13__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance); // no planarity tolerance needed
|
|
282459
|
-
|
|
282789
|
+
const announceEdge = (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(ptA, ptB));
|
|
282790
|
+
PolyfaceQuery.announceBoundaryEdges(source, announceEdge, true, false, false);
|
|
282460
282791
|
collector.announceChainsAsLineString3d(announceChain);
|
|
282461
282792
|
}
|
|
282462
282793
|
/**
|
|
@@ -282473,7 +282804,7 @@ class PolyfaceQuery {
|
|
|
282473
282804
|
const numFacets = PolyfaceQuery.visitorClientFacetCount(mesh);
|
|
282474
282805
|
const smoothEdges = PolyfaceQuery.collectEdgesByDihedralAngle(mesh, maxSmoothEdgeAngle);
|
|
282475
282806
|
const partitions = PolyfaceQuery.partitionFacetIndicesBySortableEdgeClusters(smoothEdges, numFacets);
|
|
282476
|
-
const builder =
|
|
282807
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
282477
282808
|
const visitor = mesh;
|
|
282478
282809
|
const planarPartitions = [];
|
|
282479
282810
|
const partitionNormals = []; // average normal in each nontrivial partition
|
|
@@ -282493,7 +282824,7 @@ class PolyfaceQuery {
|
|
|
282493
282824
|
if (_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.areaNormalGo(visitor.point, normal))
|
|
282494
282825
|
averageNormal.addInPlace(normal);
|
|
282495
282826
|
}
|
|
282496
|
-
partitionNormals.push(
|
|
282827
|
+
partitionNormals.push(_geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_17__.Ray3d.createCapture(point0, averageNormal));
|
|
282497
282828
|
planarPartitions.push(partition);
|
|
282498
282829
|
}
|
|
282499
282830
|
}
|
|
@@ -282502,8 +282833,8 @@ class PolyfaceQuery {
|
|
|
282502
282833
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(planarPartitions.length === fragmentPolyfaces.length);
|
|
282503
282834
|
const gapTolerance = 1.0e-4;
|
|
282504
282835
|
const planarityTolerance = 1.0e-4;
|
|
282505
|
-
const localToWorld =
|
|
282506
|
-
const worldToLocal =
|
|
282836
|
+
const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createIdentity();
|
|
282837
|
+
const worldToLocal = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createIdentity();
|
|
282507
282838
|
for (let i = 0; i < fragmentPolyfaces.length; ++i) {
|
|
282508
282839
|
const fragment = fragmentPolyfaces[i];
|
|
282509
282840
|
const edges = [];
|
|
@@ -282512,7 +282843,7 @@ class PolyfaceQuery {
|
|
|
282512
282843
|
edges.push(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(pointA, pointB));
|
|
282513
282844
|
edgeStrings.push([pointA.clone(), pointB.clone()]);
|
|
282514
282845
|
}, true, false, false);
|
|
282515
|
-
const chains =
|
|
282846
|
+
const chains = _curve_CurveOps__WEBPACK_IMPORTED_MODULE_19__.CurveOps.collectChains(edges, gapTolerance, planarityTolerance);
|
|
282516
282847
|
if (chains) {
|
|
282517
282848
|
// avoid FrameBuilder: it can flip the normal of a nonconvex facet!
|
|
282518
282849
|
partitionNormals[i].toRigidZFrame(localToWorld);
|
|
@@ -282522,11 +282853,11 @@ class PolyfaceQuery {
|
|
|
282522
282853
|
// But we aren't triangulating here. So if we don't have holes, we can skip regularization
|
|
282523
282854
|
// to avoid splitting the loop.
|
|
282524
282855
|
const regularize = !(chains instanceof _curve_Loop__WEBPACK_IMPORTED_MODULE_5__.Loop);
|
|
282525
|
-
const graph =
|
|
282856
|
+
const graph = _topology_Merging__WEBPACK_IMPORTED_MODULE_20__.HalfEdgeGraphMerge.formGraphFromChains(edgeStrings, regularize, _topology_Graph__WEBPACK_IMPORTED_MODULE_21__.HalfEdgeMask.BOUNDARY_EDGE);
|
|
282526
282857
|
if (graph) {
|
|
282527
|
-
|
|
282858
|
+
_topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_22__.HalfEdgeGraphSearch.collectConnectedComponentsWithExteriorParityMasks(graph, new _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_22__.HalfEdgeMaskTester(_topology_Graph__WEBPACK_IMPORTED_MODULE_21__.HalfEdgeMask.BOUNDARY_EDGE), _topology_Graph__WEBPACK_IMPORTED_MODULE_21__.HalfEdgeMask.EXTERIOR);
|
|
282528
282859
|
// this.purgeNullFaces(HalfEdgeMask.EXTERIOR);
|
|
282529
|
-
const polyface1 =
|
|
282860
|
+
const polyface1 = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.graphToPolyface(graph);
|
|
282530
282861
|
builder.addIndexedPolyface(polyface1, false, localToWorld);
|
|
282531
282862
|
}
|
|
282532
282863
|
}
|
|
@@ -282552,7 +282883,7 @@ class PolyfaceQuery {
|
|
|
282552
282883
|
static fillSimpleHoles(mesh, options, unfilledChains) {
|
|
282553
282884
|
if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
|
|
282554
282885
|
return this.fillSimpleHoles(mesh.createVisitor(0), options, unfilledChains);
|
|
282555
|
-
const builder =
|
|
282886
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
282556
282887
|
const chains = [];
|
|
282557
282888
|
PolyfaceQuery.announceBoundaryChainsAsLineString3d(mesh, (ls) => { ls.reverseInPlace(); chains.push(ls); });
|
|
282558
282889
|
for (const c of chains) {
|
|
@@ -282562,11 +282893,11 @@ class PolyfaceQuery {
|
|
|
282562
282893
|
rejected = true;
|
|
282563
282894
|
else if (options.maxEdgesAroundHole !== undefined && points.length > options.maxEdgesAroundHole)
|
|
282564
282895
|
rejected = true;
|
|
282565
|
-
else if (options.maxPerimeter !== undefined &&
|
|
282896
|
+
else if (options.maxPerimeter !== undefined && _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_23__.Point3dArray.sumEdgeLengths(points, false) > options.maxPerimeter)
|
|
282566
282897
|
rejected = true;
|
|
282567
282898
|
else if (options.upVector !== undefined && _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.sumTriangleAreasPerpendicularToUpVector(points, options.upVector) <= 0.0)
|
|
282568
282899
|
rejected = true;
|
|
282569
|
-
if (!rejected &&
|
|
282900
|
+
if (!rejected && _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_24__.SpacePolygonTriangulation.triangulateSimplestSpaceLoop(points, (_loop, triangles) => {
|
|
282570
282901
|
for (const t of triangles)
|
|
282571
282902
|
builder.addPolygon(t);
|
|
282572
282903
|
})) {
|
|
@@ -282590,13 +282921,13 @@ class PolyfaceQuery {
|
|
|
282590
282921
|
}
|
|
282591
282922
|
polyface.setNumWrap(0);
|
|
282592
282923
|
const polyfaces = [];
|
|
282593
|
-
const options =
|
|
282924
|
+
const options = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_25__.StrokeOptions.createForFacets();
|
|
282594
282925
|
options.needNormals = polyface.normal !== undefined;
|
|
282595
282926
|
options.needParams = polyface.param !== undefined;
|
|
282596
282927
|
options.needColors = polyface.color !== undefined;
|
|
282597
282928
|
options.needTwoSided = polyface.twoSided;
|
|
282598
282929
|
for (const partition of partitions) {
|
|
282599
|
-
const builder =
|
|
282930
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create(options);
|
|
282600
282931
|
polyface.reset();
|
|
282601
282932
|
for (const facetIndex of partition) {
|
|
282602
282933
|
polyface.moveToReadIndex(facetIndex);
|
|
@@ -282612,12 +282943,12 @@ class PolyfaceQuery {
|
|
|
282612
282943
|
return this.cloneFiltered(source.createVisitor(0), filter);
|
|
282613
282944
|
}
|
|
282614
282945
|
source.setNumWrap(0);
|
|
282615
|
-
const options =
|
|
282946
|
+
const options = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_25__.StrokeOptions.createForFacets();
|
|
282616
282947
|
options.needNormals = source.normal !== undefined;
|
|
282617
282948
|
options.needParams = source.param !== undefined;
|
|
282618
282949
|
options.needColors = source.color !== undefined;
|
|
282619
282950
|
options.needTwoSided = source.twoSided;
|
|
282620
|
-
const builder =
|
|
282951
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create(options);
|
|
282621
282952
|
source.reset();
|
|
282622
282953
|
for (; source.moveToNextFacet();) {
|
|
282623
282954
|
if (filter(source))
|
|
@@ -282629,12 +282960,12 @@ class PolyfaceQuery {
|
|
|
282629
282960
|
static cloneWithDanglingEdgesRemoved(source) {
|
|
282630
282961
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
|
|
282631
282962
|
return this.cloneWithDanglingEdgesRemoved(source.createVisitor(0));
|
|
282632
|
-
const options =
|
|
282963
|
+
const options = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_25__.StrokeOptions.createForFacets();
|
|
282633
282964
|
options.needNormals = source.normal !== undefined;
|
|
282634
282965
|
options.needParams = source.param !== undefined;
|
|
282635
282966
|
options.needColors = source.color !== undefined;
|
|
282636
282967
|
options.needTwoSided = source.twoSided;
|
|
282637
|
-
const builder =
|
|
282968
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create(options);
|
|
282638
282969
|
// Finds an odd palindrome in data as indexed by indices.
|
|
282639
282970
|
// An odd palindrome in a face loop corresponds to dangling edges in the face.
|
|
282640
282971
|
// If one is found, indices is mutated to excise the palindrome (data is untouched).
|
|
@@ -282792,7 +283123,7 @@ class PolyfaceQuery {
|
|
|
282792
283123
|
* * Input facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
282793
283124
|
*/
|
|
282794
283125
|
static sweepLineStringToFacetsXYReturnSweptFacets(lineStringPoints, polyface) {
|
|
282795
|
-
const builder =
|
|
283126
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
282796
283127
|
this.announceSweepLinestringToConvexPolyfaceXY(lineStringPoints, polyface, (_linestring, _segmentIndex, _polyface, _facetIndex, points) => {
|
|
282797
283128
|
if (points.length === 4)
|
|
282798
283129
|
builder.addQuadFacet(points);
|
|
@@ -282806,89 +283137,94 @@ class PolyfaceQuery {
|
|
|
282806
283137
|
return this.sweepLineStringToFacetsXYReturnSweptFacets(linestringPoints, polyface);
|
|
282807
283138
|
}
|
|
282808
283139
|
/**
|
|
282809
|
-
* Sweep the line string to intersections with a mesh.
|
|
282810
|
-
* * Return collected line segments.
|
|
282811
|
-
* * If no options are given, the default sweep direction is the z-axis, and chains are assembled and returned.
|
|
282812
|
-
* * See [[SweepLineStringToFacetsOptions]] for input and output options, including filtering by forward/side/rear facets.
|
|
283140
|
+
* Sweep the line string to intersections with a mesh and return collected line segments.
|
|
282813
283141
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the sweep direction.
|
|
282814
|
-
|
|
282815
|
-
|
|
283142
|
+
* @param points the linestring to drape onto the mesh.
|
|
283143
|
+
* @param source target facet set. For best results, facets should be convex and planar.
|
|
283144
|
+
* @param options input, filtering, search, and output options.
|
|
283145
|
+
* * If `undefined`, the default sweep direction is the positive z-axis, and chains are assembled and returned.
|
|
283146
|
+
* * For faster _vertical_ sweep, a pre-computed range tree can be supplied in `options.searcher`.
|
|
283147
|
+
* * For faster _non-vertical_ sweep, first transform inputs with the inverse of the transform
|
|
283148
|
+
* `T = Transform.createRigidFromOriginAndVector(undefined, options.vectorToEye)`, construct the searcher on these
|
|
283149
|
+
* local facets, call `sweepLineStringToFacets/XY` with these local inputs (and default sweep direction), and lastly,
|
|
283150
|
+
* transform the returned draped linework back to world coordinates with `T`.
|
|
283151
|
+
*/
|
|
283152
|
+
static sweepLineStringToFacets(points, source, options) {
|
|
282816
283153
|
let result = [];
|
|
282817
|
-
// setup default options
|
|
282818
283154
|
if (options === undefined)
|
|
282819
|
-
options = SweepLineStringToFacetsOptions.create(
|
|
282820
|
-
true, true, true, true);
|
|
283155
|
+
options = SweepLineStringToFacetsOptions.create();
|
|
282821
283156
|
let chainContext;
|
|
282822
283157
|
if (options.assembleChains)
|
|
282823
|
-
chainContext =
|
|
282824
|
-
const
|
|
282825
|
-
|
|
282826
|
-
|
|
282827
|
-
|
|
282828
|
-
|
|
282829
|
-
|
|
282830
|
-
|
|
282831
|
-
const
|
|
282832
|
-
|
|
282833
|
-
|
|
282834
|
-
|
|
282835
|
-
|
|
282836
|
-
|
|
282837
|
-
|
|
282838
|
-
|
|
282839
|
-
|
|
283158
|
+
chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_26__.ChainMergeContext.create();
|
|
283159
|
+
const addSegment = chainContext ? (ptA, ptB) => chainContext.addSegment(ptA, ptB) : (ptA, ptB) => result.push(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(ptA, ptB));
|
|
283160
|
+
const workNormal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
|
|
283161
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.createVisitor(0) : source;
|
|
283162
|
+
visitor.setNumWrap(0);
|
|
283163
|
+
if (options.searcher && options.vectorToEye.isParallelTo(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ())) {
|
|
283164
|
+
const searchRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_27__.Range3d.createNull();
|
|
283165
|
+
const workPoint0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero();
|
|
283166
|
+
const workPoint1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero();
|
|
283167
|
+
let edgeClipper;
|
|
283168
|
+
const clipEdgeToConvexPolygon = (_facetRange, readIndex) => {
|
|
283169
|
+
if (visitor.moveToReadIndex(readIndex) && (options.collectAll || options.collectFromThisFacetNormal(_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.areaNormalGo(visitor.point, workNormal))))
|
|
283170
|
+
edgeClipper?.processPolygon(visitor.point, (ptA, ptB) => addSegment(ptA, ptB));
|
|
283171
|
+
return true;
|
|
283172
|
+
};
|
|
283173
|
+
for (let i = 1; i < points.length; i++) {
|
|
283174
|
+
points.getPoint3dAtUncheckedPointIndex(i - 1, workPoint0);
|
|
283175
|
+
points.getPoint3dAtUncheckedPointIndex(i, workPoint1);
|
|
283176
|
+
if (edgeClipper = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_14__.EdgeClipData.createPointPointSweep(workPoint0, workPoint1, options.vectorToEye)) {
|
|
283177
|
+
searchRange.setNull();
|
|
283178
|
+
searchRange.extend(workPoint0, workPoint1);
|
|
283179
|
+
options.searcher.searchRange2d(searchRange, clipEdgeToConvexPolygon);
|
|
282840
283180
|
}
|
|
282841
283181
|
}
|
|
282842
|
-
|
|
282843
|
-
|
|
282844
|
-
|
|
283182
|
+
}
|
|
283183
|
+
else {
|
|
283184
|
+
const context = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_14__.ClipSweptLineStringContext.create(points, options.vectorToEye);
|
|
283185
|
+
if (context) {
|
|
283186
|
+
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
283187
|
+
if (options.collectAll || options.collectFromThisFacetNormal(_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.areaNormalGo(visitor.point, workNormal)))
|
|
283188
|
+
context.processPolygon(visitor.point.getArray(), addSegment);
|
|
283189
|
+
}
|
|
282845
283190
|
}
|
|
282846
283191
|
}
|
|
283192
|
+
if (chainContext) {
|
|
283193
|
+
chainContext.clusterAndMergeVerticesXYZ();
|
|
283194
|
+
result = chainContext.collectMaximalChains();
|
|
283195
|
+
}
|
|
282847
283196
|
return result;
|
|
282848
283197
|
}
|
|
282849
283198
|
/**
|
|
282850
283199
|
* Sweep the line string in the z-direction to intersections with a mesh, using a search object for speedup.
|
|
282851
|
-
* @param
|
|
282852
|
-
* @param
|
|
282853
|
-
* @param
|
|
282854
|
-
* @example Using a 5x5 indexed search grid:
|
|
282855
|
-
* ```
|
|
282856
|
-
* const xyRange = Range2d.createFrom(myPolyface.range());
|
|
282857
|
-
* const searcher = GriddedRaggedRange2dSetWithOverflow.create<number>(xyRange, 5, 5)!;
|
|
282858
|
-
* for (const visitor = myPolyface.createVisitor(0); visitor.moveToNextFacet();) {
|
|
282859
|
-
* searcher.addRange(visitor.point.getRange(), visitor.currentReadIndex());
|
|
282860
|
-
* }
|
|
282861
|
-
* const drapedLineStrings = PolyfaceQuery.sweepLineStringToFacetsXY(lineString, myPolyface, searcher);
|
|
282862
|
-
* ```
|
|
283200
|
+
* @param points the linestring to drape onto the mesh.
|
|
283201
|
+
* @param source target facet set. For best results, facets should be convex and planar.
|
|
283202
|
+
* @param searcher object for searching facet 2D ranges tagged by mesh read index.
|
|
282863
283203
|
* @returns the collected line strings.
|
|
282864
|
-
|
|
282865
|
-
|
|
282866
|
-
|
|
282867
|
-
const
|
|
282868
|
-
const
|
|
282869
|
-
|
|
282870
|
-
|
|
282871
|
-
|
|
282872
|
-
|
|
282873
|
-
|
|
282874
|
-
let
|
|
282875
|
-
|
|
282876
|
-
|
|
282877
|
-
|
|
282878
|
-
|
|
283204
|
+
* @see [[sweepLineStringToFacets]] for further options.
|
|
283205
|
+
*/
|
|
283206
|
+
static sweepLineStringToFacetsXY(points, source, searcher) {
|
|
283207
|
+
const chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_26__.ChainMergeContext.create();
|
|
283208
|
+
const vectorToEye = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ();
|
|
283209
|
+
const searchRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_27__.Range3d.create();
|
|
283210
|
+
const workPoint0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero();
|
|
283211
|
+
const workPoint1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero();
|
|
283212
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.createVisitor(0) : source;
|
|
283213
|
+
visitor.setNumWrap(0);
|
|
283214
|
+
let edgeClipper;
|
|
283215
|
+
const clipEdgeToConvexPolygon = (_facetRange, readIndex) => {
|
|
283216
|
+
if (visitor.moveToReadIndex(readIndex))
|
|
283217
|
+
edgeClipper?.processPolygon(visitor.point, (ptA, ptB) => chainContext.addSegment(ptA, ptB));
|
|
283218
|
+
return true;
|
|
283219
|
+
};
|
|
283220
|
+
const lineStringSource = Array.isArray(points) ? new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_28__.Point3dArrayCarrier(points) : points;
|
|
282879
283221
|
for (let i = 1; i < lineStringSource.length; i++) {
|
|
282880
|
-
|
|
282881
|
-
|
|
282882
|
-
|
|
282883
|
-
|
|
282884
|
-
|
|
282885
|
-
|
|
282886
|
-
searchRange.extendPoint(point1);
|
|
282887
|
-
searchByReadIndex.searchRange2d(searchRange, (_facetRange, readIndex) => {
|
|
282888
|
-
if (visitor.moveToReadIndex(readIndex))
|
|
282889
|
-
edgeClipper.processPolygon(visitor.point, (pointA, pointB) => chainContext.addSegment(pointA, pointB));
|
|
282890
|
-
return true;
|
|
282891
|
-
});
|
|
283222
|
+
lineStringSource.getPoint3dAtUncheckedPointIndex(i - 1, workPoint0);
|
|
283223
|
+
lineStringSource.getPoint3dAtUncheckedPointIndex(i, workPoint1);
|
|
283224
|
+
if (edgeClipper = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_14__.EdgeClipData.createPointPointSweep(workPoint0, workPoint1, vectorToEye)) {
|
|
283225
|
+
searchRange.setNull();
|
|
283226
|
+
searchRange.extend(workPoint0, workPoint1);
|
|
283227
|
+
searcher.searchRange2d(searchRange, clipEdgeToConvexPolygon);
|
|
282892
283228
|
}
|
|
282893
283229
|
}
|
|
282894
283230
|
chainContext.clusterAndMergeVerticesXYZ();
|
|
@@ -282903,20 +283239,16 @@ class PolyfaceQuery {
|
|
|
282903
283239
|
*/
|
|
282904
283240
|
static sweepLinestringToFacetsXYReturnLines(linestringPoints, polyface) {
|
|
282905
283241
|
const options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createSmallAngle(), false, true, true, true);
|
|
282906
|
-
|
|
282907
|
-
return result;
|
|
283242
|
+
return PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface, options);
|
|
282908
283243
|
}
|
|
282909
283244
|
/**
|
|
282910
283245
|
* Find segments (within the linestring) which project to facets.
|
|
282911
283246
|
* * Return chains.
|
|
282912
|
-
* * This calls [[sweepLineStringToFacets]] with options
|
|
282913
|
-
* `const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(),true, true, true, true);`
|
|
283247
|
+
* * This calls [[sweepLineStringToFacets]] with default options.
|
|
282914
283248
|
* @deprecated in 4.x. Use [[PolyfaceQuery.sweepLineStringToFacets]] to get further options.
|
|
282915
283249
|
*/
|
|
282916
283250
|
static sweepLinestringToFacetsXYReturnChains(linestringPoints, polyface) {
|
|
282917
|
-
|
|
282918
|
-
const result = PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface, options);
|
|
282919
|
-
return result;
|
|
283251
|
+
return PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface);
|
|
282920
283252
|
}
|
|
282921
283253
|
/**
|
|
282922
283254
|
* Find segments (within the linestring) which project to facets.
|
|
@@ -282928,7 +283260,7 @@ class PolyfaceQuery {
|
|
|
282928
283260
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
282929
283261
|
*/
|
|
282930
283262
|
static async asyncSweepLinestringToFacetsXYReturnChains(linestringPoints, polyface) {
|
|
282931
|
-
const chainContext =
|
|
283263
|
+
const chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_26__.ChainMergeContext.create();
|
|
282932
283264
|
await Promise.resolve(this.asyncAnnounceSweepLinestringToConvexPolyfaceXY(linestringPoints, polyface, (_linestring, _segmentIndex, _polyface, _facetIndex, points, indexA, indexB) => {
|
|
282933
283265
|
chainContext.addSegment(points[indexA], points[indexB]);
|
|
282934
283266
|
}));
|
|
@@ -282944,7 +283276,7 @@ class PolyfaceQuery {
|
|
|
282944
283276
|
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface) {
|
|
282945
283277
|
return this.collectRangeLengthData(polyface.createVisitor(0));
|
|
282946
283278
|
}
|
|
282947
|
-
const rangeData = new
|
|
283279
|
+
const rangeData = new _RangeLengthData__WEBPACK_IMPORTED_MODULE_29__.RangeLengthData();
|
|
282948
283280
|
// polyface is a visitor
|
|
282949
283281
|
for (polyface.reset(); polyface.moveToNextFacet();)
|
|
282950
283282
|
rangeData.accumulateGrowableXYZArrayRange(polyface.point);
|
|
@@ -282957,9 +283289,9 @@ class PolyfaceQuery {
|
|
|
282957
283289
|
static cloneWithTVertexFixup(polyface) {
|
|
282958
283290
|
const oldFacetVisitor = polyface.createVisitor(1); // this is to visit the existing facets
|
|
282959
283291
|
const newFacetVisitor = polyface.createVisitor(0); // this is to build the new facets
|
|
282960
|
-
const rangeSearcher =
|
|
282961
|
-
const builder =
|
|
282962
|
-
const edgeRange =
|
|
283292
|
+
const rangeSearcher = _multiclip_XYPointBuckets__WEBPACK_IMPORTED_MODULE_30__.XYPointBuckets.create(polyface.data.point, 30);
|
|
283293
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
283294
|
+
const edgeRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_27__.Range3d.createNull();
|
|
282963
283295
|
const point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
282964
283296
|
const point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
282965
283297
|
const spacePoint = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
@@ -283091,7 +283423,7 @@ class PolyfaceQuery {
|
|
|
283091
283423
|
* @param clusterSelector indicates whether to copy 0, 1, or all facets in each cluster of duplicate facets.
|
|
283092
283424
|
*/
|
|
283093
283425
|
static cloneByFacetDuplication(source, includeSingletons, clusterSelector) {
|
|
283094
|
-
const builder =
|
|
283426
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
283095
283427
|
const visitor = source.createVisitor(0);
|
|
283096
283428
|
this.announceDuplicateFacetIndices(source, (clusterFacetIndices) => {
|
|
283097
283429
|
let numToSelect = 0;
|
|
@@ -283118,7 +283450,7 @@ class PolyfaceQuery {
|
|
|
283118
283450
|
static cloneWithColinearEdgeFixup(polyface) {
|
|
283119
283451
|
const oldFacetVisitor = polyface.createVisitor(2); // this is to visit the existing facets
|
|
283120
283452
|
const newFacetVisitor = polyface.createVisitor(0); // this is to build the new facets
|
|
283121
|
-
const builder =
|
|
283453
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
283122
283454
|
const vector01 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
283123
283455
|
const vector12 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
283124
283456
|
const numPoint = polyface.data.point.length;
|
|
@@ -283168,11 +283500,11 @@ class PolyfaceQuery {
|
|
|
283168
283500
|
static setEdgeVisibility(polyface, clusters, value) {
|
|
283169
283501
|
for (const cluster of clusters) {
|
|
283170
283502
|
if (cluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.SortableEdge) {
|
|
283171
|
-
this.setSingleEdgeVisibility(polyface, cluster.facetIndex, cluster.
|
|
283503
|
+
this.setSingleEdgeVisibility(polyface, cluster.facetIndex, cluster.startVertex, value);
|
|
283172
283504
|
}
|
|
283173
283505
|
else if (Array.isArray(cluster)) {
|
|
283174
283506
|
for (const e1 of cluster)
|
|
283175
|
-
this.setSingleEdgeVisibility(polyface, e1.facetIndex, e1.
|
|
283507
|
+
this.setSingleEdgeVisibility(polyface, e1.facetIndex, e1.startVertex, value);
|
|
283176
283508
|
}
|
|
283177
283509
|
}
|
|
283178
283510
|
}
|
|
@@ -283274,8 +283606,8 @@ class PolyfaceQuery {
|
|
|
283274
283606
|
&& undefined !== PolyfaceQuery.computeFacetUnitNormal(visitor, e1.facetIndex, normal1)) {
|
|
283275
283607
|
const edgeAngle = normal0.smallerUnorientedAngleTo(normal1);
|
|
283276
283608
|
if (edgeAngle.radians > sharpEdgeAngle.radians) {
|
|
283277
|
-
this.setSingleEdgeVisibility(mesh, e0.facetIndex, e0.
|
|
283278
|
-
this.setSingleEdgeVisibility(mesh, e1.facetIndex, e1.
|
|
283609
|
+
this.setSingleEdgeVisibility(mesh, e0.facetIndex, e0.startVertex, true);
|
|
283610
|
+
this.setSingleEdgeVisibility(mesh, e1.facetIndex, e1.startVertex, true);
|
|
283279
283611
|
}
|
|
283280
283612
|
}
|
|
283281
283613
|
}
|
|
@@ -283311,7 +283643,7 @@ class PolyfaceQuery {
|
|
|
283311
283643
|
* @internal
|
|
283312
283644
|
*/
|
|
283313
283645
|
static convertToHalfEdgeGraph(mesh) {
|
|
283314
|
-
const builder = new
|
|
283646
|
+
const builder = new _topology_HalfEdgeGraphFromIndexedLoopsContext__WEBPACK_IMPORTED_MODULE_31__.HalfEdgeGraphFromIndexedLoopsContext();
|
|
283315
283647
|
const visitor = mesh.createVisitor(0);
|
|
283316
283648
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
283317
283649
|
builder.insertLoop(visitor.pointIndex);
|
|
@@ -283328,11 +283660,11 @@ class PolyfaceQuery {
|
|
|
283328
283660
|
}
|
|
283329
283661
|
/** Examine adjacent facet orientations throughout the mesh. If possible, reverse a subset to achieve proper pairing. */
|
|
283330
283662
|
static reorientVertexOrderAroundFacetsForConsistentOrientation(mesh) {
|
|
283331
|
-
return
|
|
283663
|
+
return _FacetOrientation__WEBPACK_IMPORTED_MODULE_32__.FacetOrientationFixup.doFixup(mesh);
|
|
283332
283664
|
}
|
|
283333
283665
|
/** Set up indexed normals with one normal in the plane of each facet of the mesh. */
|
|
283334
283666
|
static buildPerFaceNormals(polyface) {
|
|
283335
|
-
|
|
283667
|
+
_multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_33__.BuildAverageNormalsContext.buildPerFaceNormals(polyface);
|
|
283336
283668
|
}
|
|
283337
283669
|
/**
|
|
283338
283670
|
* * At each vertex of the mesh:
|
|
@@ -283346,7 +283678,7 @@ class PolyfaceQuery {
|
|
|
283346
283678
|
* @param toleranceAngle averaging is done between normals up to this angle.
|
|
283347
283679
|
*/
|
|
283348
283680
|
static buildAverageNormals(polyface, toleranceAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(31.0)) {
|
|
283349
|
-
|
|
283681
|
+
_multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_33__.BuildAverageNormalsContext.buildFastAverageNormals(polyface, toleranceAngle);
|
|
283350
283682
|
}
|
|
283351
283683
|
/**
|
|
283352
283684
|
* Offset the faces of the mesh.
|
|
@@ -283356,9 +283688,9 @@ class PolyfaceQuery {
|
|
|
283356
283688
|
* @returns shifted mesh.
|
|
283357
283689
|
*/
|
|
283358
283690
|
static cloneOffset(source, signedOffsetDistance, offsetOptions = OffsetMeshOptions.create()) {
|
|
283359
|
-
const strokeOptions =
|
|
283360
|
-
const offsetBuilder =
|
|
283361
|
-
|
|
283691
|
+
const strokeOptions = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_25__.StrokeOptions.createForFacets();
|
|
283692
|
+
const offsetBuilder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create(strokeOptions);
|
|
283693
|
+
_multiclip_OffsetMeshContext__WEBPACK_IMPORTED_MODULE_34__.OffsetMeshContext.buildOffsetMeshWithEdgeChamfers(source, offsetBuilder, signedOffsetDistance, offsetOptions);
|
|
283362
283694
|
return offsetBuilder.claimPolyface();
|
|
283363
283695
|
}
|
|
283364
283696
|
static _workTriangle;
|
|
@@ -283395,17 +283727,17 @@ class PolyfaceQuery {
|
|
|
283395
283727
|
const numEdges = visitor.pointCount; // #vertices = #edges since numWrap is zero
|
|
283396
283728
|
const vertices = visitor.point;
|
|
283397
283729
|
if (3 === numEdges) {
|
|
283398
|
-
const tri = this._workTriangle =
|
|
283730
|
+
const tri = this._workTriangle = _geometry3d_BarycentricTriangle__WEBPACK_IMPORTED_MODULE_35__.BarycentricTriangle.create(vertices.getPoint3dAtUncheckedPointIndex(0), vertices.getPoint3dAtUncheckedPointIndex(1), vertices.getPoint3dAtUncheckedPointIndex(2), this._workTriangle);
|
|
283399
283731
|
const detail3 = this._workTriDetail = tri.intersectRay3d(ray, this._workTriDetail);
|
|
283400
283732
|
tri.snapLocationToEdge(detail3, options?.distanceTolerance, options?.parameterTolerance);
|
|
283401
|
-
detail = this._workFacetDetail3 =
|
|
283733
|
+
detail = this._workFacetDetail3 = _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_36__.TriangularFacetLocationDetail.create(visitor.currentReadIndex(), detail3, this._workFacetDetail3);
|
|
283402
283734
|
}
|
|
283403
283735
|
else {
|
|
283404
283736
|
const detailN = this._workPolyDetail = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.intersectRay3d(vertices, ray, tol, this._workPolyDetail);
|
|
283405
283737
|
if (_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.isConvex(vertices))
|
|
283406
|
-
detail = this._workFacetDetailC =
|
|
283738
|
+
detail = this._workFacetDetailC = _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_36__.ConvexFacetLocationDetail.create(visitor.currentReadIndex(), numEdges, detailN, this._workFacetDetailC);
|
|
283407
283739
|
else
|
|
283408
|
-
detail = this._workFacetDetailNC =
|
|
283740
|
+
detail = this._workFacetDetailNC = _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_36__.NonConvexFacetLocationDetail.create(visitor.currentReadIndex(), numEdges, detailN, this._workFacetDetailNC);
|
|
283409
283741
|
}
|
|
283410
283742
|
if (detail.isInsideOrOn) { // set optional caches, process the intersection
|
|
283411
283743
|
if (options?.needNormal && visitor.normal)
|
|
@@ -284045,14 +284377,14 @@ let numNodeCreated = 0;
|
|
|
284045
284377
|
* * _range = the union of ranges below in the heap
|
|
284046
284378
|
* * _appData = application data associated with the node.
|
|
284047
284379
|
* * Construction methods may place multiple _appData items in each node.
|
|
284048
|
-
*
|
|
284380
|
+
* * In common use, only the leaves will have _appData. However, the class definitions allow _appData at all nodes, and search algorithms must include them.
|
|
284049
284381
|
* * CONSTRUCTION
|
|
284050
284382
|
* * The RangeTreeNode.createByIndexSplits method constructs the tree with simple right-left splits within an array of input items.
|
|
284051
284383
|
* * The appData is placed entirely in the leaves.
|
|
284052
|
-
* * caller can specify:
|
|
284384
|
+
* * The caller can specify:
|
|
284053
284385
|
* * the number of _appData items per leaf
|
|
284054
284386
|
* * the number of children per node within the tree.
|
|
284055
|
-
* * "
|
|
284387
|
+
* * Compared to "shallow" trees with many children per node and many appData per leaf, "deep" trees with 2 children per node and 1 appData per leaf may have:
|
|
284056
284388
|
* * faster search because lower nodes have smaller ranges that will be skipped by search algorithms.
|
|
284057
284389
|
* * larger memory use because of more nodes
|
|
284058
284390
|
* * For future construction methods:
|
|
@@ -286965,15 +287297,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
286965
287297
|
/* harmony export */ EdgeClipData: () => (/* binding */ EdgeClipData),
|
|
286966
287298
|
/* harmony export */ SweepLineStringToFacetContext: () => (/* binding */ SweepLineStringToFacetContext)
|
|
286967
287299
|
/* harmony export */ });
|
|
286968
|
-
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
286969
|
-
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
286970
|
-
/* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
|
|
286971
|
-
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
286972
|
-
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
286973
287300
|
/* harmony import */ var _clipping_ClipPlane__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../clipping/ClipPlane */ "../../core/geometry/lib/esm/clipping/ClipPlane.js");
|
|
286974
287301
|
/* harmony import */ var _clipping_ConvexClipPlaneSet__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../clipping/ConvexClipPlaneSet */ "../../core/geometry/lib/esm/clipping/ConvexClipPlaneSet.js");
|
|
286975
|
-
/* harmony import */ var
|
|
287302
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
286976
287303
|
/* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
|
|
287304
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
287305
|
+
/* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
|
|
287306
|
+
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
287307
|
+
/* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
|
|
287308
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
286977
287309
|
/*---------------------------------------------------------------------------------------------
|
|
286978
287310
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
286979
287311
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -286996,24 +287328,23 @@ class SweepLineStringToFacetContext {
|
|
|
286996
287328
|
_numSpacePoints;
|
|
286997
287329
|
constructor(spacePoints) {
|
|
286998
287330
|
this._spacePoints = spacePoints;
|
|
286999
|
-
this._spacePointsRange =
|
|
287000
|
-
spacePoints.setRange(this._spacePointsRange);
|
|
287331
|
+
this._spacePointsRange = spacePoints.getRange();
|
|
287001
287332
|
this._numSpacePoints = this._spacePoints.length;
|
|
287002
287333
|
}
|
|
287003
287334
|
static create(xyz) {
|
|
287004
287335
|
if (xyz.length > 1) {
|
|
287005
|
-
return new SweepLineStringToFacetContext(xyz
|
|
287336
|
+
return new SweepLineStringToFacetContext(xyz);
|
|
287006
287337
|
}
|
|
287007
287338
|
return undefined;
|
|
287008
287339
|
}
|
|
287009
287340
|
// temporaries reused over multiple calls to process a single facet . ..
|
|
287010
|
-
_segmentPoint0 =
|
|
287011
|
-
_segmentPoint1 =
|
|
287012
|
-
_localSegmentPoint0 =
|
|
287013
|
-
_localSegmentPoint1 =
|
|
287014
|
-
_clipFractions =
|
|
287015
|
-
_localFrame =
|
|
287016
|
-
_polygonRange =
|
|
287341
|
+
_segmentPoint0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
287342
|
+
_segmentPoint1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
287343
|
+
_localSegmentPoint0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
287344
|
+
_localSegmentPoint1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
287345
|
+
_clipFractions = _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_1__.Segment1d.create(0, 1);
|
|
287346
|
+
_localFrame = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity();
|
|
287347
|
+
_polygonRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_3__.Range3d.create();
|
|
287017
287348
|
/** process a single polygon.
|
|
287018
287349
|
* @returns number crudely indicating how much work was done.
|
|
287019
287350
|
*/
|
|
@@ -287089,7 +287420,7 @@ class EdgeClipData {
|
|
|
287089
287420
|
}
|
|
287090
287421
|
/** create object from segment and sweep. Inputs are not captured. */
|
|
287091
287422
|
static createPointPointSweep(pointA, pointB, sweep) {
|
|
287092
|
-
const edgeVector =
|
|
287423
|
+
const edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.createStartEnd(pointA, pointB);
|
|
287093
287424
|
const fraction = edgeVector.fractionOfProjectionToVector(sweep);
|
|
287094
287425
|
// The unbounded plane of the swept edge will intersect facets in lines that may extend beyond the swept bounded line.
|
|
287095
287426
|
// That linework will be clipped between two facing planes with normal along the perpendicular dropped from the edge vector to the sweep vector.
|
|
@@ -287138,16 +287469,16 @@ class ClipSweptLineStringContext {
|
|
|
287138
287469
|
}
|
|
287139
287470
|
static create(xyz, sweepVector) {
|
|
287140
287471
|
if (sweepVector === undefined)
|
|
287141
|
-
sweepVector =
|
|
287472
|
+
sweepVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create(0, 0, 1);
|
|
287142
287473
|
if (xyz.length > 1) {
|
|
287143
|
-
const point =
|
|
287144
|
-
const newPoint =
|
|
287474
|
+
const point = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
|
|
287475
|
+
const newPoint = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
|
|
287145
287476
|
const edgeData = [];
|
|
287146
287477
|
xyz.getPoint3dAtUncheckedPointIndex(0, point);
|
|
287147
287478
|
let localToWorldMatrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_8__.Matrix3d.createRigidHeadsUp(sweepVector);
|
|
287148
287479
|
if (localToWorldMatrix === undefined)
|
|
287149
287480
|
localToWorldMatrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_8__.Matrix3d.createIdentity();
|
|
287150
|
-
const localToWorld =
|
|
287481
|
+
const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createOriginAndMatrix(point, localToWorldMatrix);
|
|
287151
287482
|
const worldToLocal = localToWorld.inverse();
|
|
287152
287483
|
const localRange = xyz.getRange(worldToLocal);
|
|
287153
287484
|
for (let i = 1; i < xyz.length; i++) {
|
|
@@ -287168,7 +287499,7 @@ class ClipSweptLineStringContext {
|
|
|
287168
287499
|
*/
|
|
287169
287500
|
processPolygon(polygon, announceEdge) {
|
|
287170
287501
|
if (this._worldToLocal !== undefined && this._localRange !== undefined) {
|
|
287171
|
-
const polygonRange =
|
|
287502
|
+
const polygonRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_3__.Range3d.createTransformedArray(this._worldToLocal, polygon);
|
|
287172
287503
|
if (!polygonRange.intersectsRangeXY(this._localRange))
|
|
287173
287504
|
return;
|
|
287174
287505
|
}
|
|
@@ -299925,10 +300256,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
299925
300256
|
|
|
299926
300257
|
|
|
299927
300258
|
/**
|
|
299928
|
-
* A LinearSweep is a `SolidPrimitive` defined by
|
|
299929
|
-
* * A set of curves (any Loop, Path, or parityRegion)
|
|
300259
|
+
* A LinearSweep is a `SolidPrimitive` defined by:
|
|
300260
|
+
* * A set of curves (any Loop, Path, or parityRegion). If the object is "capped", the curves must be planar.
|
|
299930
300261
|
* * A sweep vector
|
|
299931
|
-
* If the object is "capped", the curves must be planar.
|
|
299932
300262
|
* @public
|
|
299933
300263
|
*/
|
|
299934
300264
|
class LinearSweep extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
|
|
@@ -300095,8 +300425,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
300095
300425
|
|
|
300096
300426
|
|
|
300097
300427
|
/**
|
|
300098
|
-
* A RotationalSweep is
|
|
300099
|
-
* * A planar contour (any Loop, Path, or parityRegion)
|
|
300428
|
+
* A RotationalSweep is:
|
|
300429
|
+
* * A planar contour (any Loop, Path, or parityRegion)
|
|
300100
300430
|
* * An axis vector.
|
|
300101
300431
|
* * The planar contour is expected to be in the plane of the axis vector.
|
|
300102
300432
|
* * The contour may have points and/or lines that are on the axis, but otherwise is entirely on one side of the axis.
|
|
@@ -301816,7 +302146,7 @@ class ChainMergeContext {
|
|
|
301816
302146
|
}
|
|
301817
302147
|
return n;
|
|
301818
302148
|
}
|
|
301819
|
-
/** Collect chains which have maximum edge count, broken at
|
|
302149
|
+
/** Collect chains which have maximum edge count, broken at vertices with more than 2 edges.
|
|
301820
302150
|
* * This is assumed to be preceded by a call to a vertex-cluster step such as `clusterAndMergeVerticesYXZ`
|
|
301821
302151
|
*/
|
|
301822
302152
|
collectMaximalChains() {
|
|
@@ -329901,7 +330231,7 @@ class TestContext {
|
|
|
329901
330231
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
329902
330232
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
329903
330233
|
await core_frontend_1.NoRenderApp.startup({
|
|
329904
|
-
applicationVersion: "5.1.0-dev.
|
|
330234
|
+
applicationVersion: "5.1.0-dev.18",
|
|
329905
330235
|
applicationId: this.settings.gprid,
|
|
329906
330236
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.serviceAuthToken),
|
|
329907
330237
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -354949,7 +355279,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
354949
355279
|
/***/ ((module) => {
|
|
354950
355280
|
|
|
354951
355281
|
"use strict";
|
|
354952
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.
|
|
355282
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.18","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/eslint-plugin":"5.0.0-dev.1","@types/chai-as-promised":"^7","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.13.0","glob":"^10.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.3.0","@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
354953
355283
|
|
|
354954
355284
|
/***/ }),
|
|
354955
355285
|
|