@itwin/ecschema-rpcinterface-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 +1147 -817
- 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 +16 -16
|
@@ -174952,25 +174952,48 @@ class InteractiveTool extends Tool {
|
|
|
174952
174952
|
return foundProperty;
|
|
174953
174953
|
throw new Error(`property not found: ${propertyName}`);
|
|
174954
174954
|
}
|
|
174955
|
-
/** Override to return the property that is
|
|
174955
|
+
/** Override to return the property that is locked by the supplied property if it is a lock property.
|
|
174956
|
+
* Used to enable/disable the returned property according to the current lock state.
|
|
174957
|
+
* @note Only applicable when [[getToolSettingLockProperty]] is not being used automatically enable the lock on a change of value.
|
|
174956
174958
|
* @see [[changeToolSettingPropertyValue]]
|
|
174957
174959
|
* @public
|
|
174958
174960
|
*/
|
|
174959
174961
|
getToolSettingPropertyLocked(_property) {
|
|
174960
174962
|
return undefined;
|
|
174961
174963
|
}
|
|
174964
|
+
/** Override to return the lock property associated with the supplied non-lock property.
|
|
174965
|
+
* Used to enable the lock property after the value of the supplied property is changed.
|
|
174966
|
+
* @see [[changeToolSettingPropertyValue]]
|
|
174967
|
+
* @beta
|
|
174968
|
+
*/
|
|
174969
|
+
getToolSettingLockProperty(_property) {
|
|
174970
|
+
return undefined;
|
|
174971
|
+
}
|
|
174962
174972
|
/** Helper method for responding to a tool setting property value change by updating saved settings.
|
|
174963
174973
|
* @see [[applyToolSettingPropertyChange]]
|
|
174964
174974
|
* @see [[getToolSettingPropertyLocked]] to return the corresponding locked property, if any.
|
|
174975
|
+
* @see [[getToolSettingLockProperty]] to return the corresponding property's lock property, if any.
|
|
174965
174976
|
* @public
|
|
174966
174977
|
*/
|
|
174967
174978
|
changeToolSettingPropertyValue(syncItem) {
|
|
174968
174979
|
const property = this.getToolSettingPropertyByName(syncItem.propertyName);
|
|
174969
174980
|
if (!this.saveToolSettingPropertyValue(property, syncItem.value))
|
|
174970
174981
|
return false;
|
|
174971
|
-
|
|
174972
|
-
|
|
174973
|
-
|
|
174982
|
+
// Either enable lock when corresponding property value changes, or enable/disable property according to value of lock...
|
|
174983
|
+
const lockProperty = this.getToolSettingLockProperty(property);
|
|
174984
|
+
if (undefined !== lockProperty) {
|
|
174985
|
+
if (!lockProperty.value) {
|
|
174986
|
+
this.saveToolSettingPropertyValue(lockProperty, { value: true });
|
|
174987
|
+
this.syncToolSettingPropertyValue(lockProperty);
|
|
174988
|
+
}
|
|
174989
|
+
}
|
|
174990
|
+
else {
|
|
174991
|
+
const propertyToLock = this.getToolSettingPropertyLocked(property);
|
|
174992
|
+
if (undefined !== propertyToLock) {
|
|
174993
|
+
if (undefined === this.getToolSettingLockProperty(propertyToLock))
|
|
174994
|
+
this.syncToolSettingPropertyValue(propertyToLock, !property.value);
|
|
174995
|
+
}
|
|
174996
|
+
}
|
|
174974
174997
|
return true;
|
|
174975
174998
|
}
|
|
174976
174999
|
/** Helper method to establish initial values for tool setting properties from saved settings.
|
|
@@ -181044,7 +181067,7 @@ class SetupCameraTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_17__.Primi
|
|
|
181044
181067
|
_cameraHeightProperty;
|
|
181045
181068
|
get cameraHeightProperty() {
|
|
181046
181069
|
if (!this._cameraHeightProperty)
|
|
181047
|
-
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
|
|
181070
|
+
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);
|
|
181048
181071
|
return this._cameraHeightProperty;
|
|
181049
181072
|
}
|
|
181050
181073
|
get cameraHeight() { return this.cameraHeightProperty.value; }
|
|
@@ -181060,16 +181083,16 @@ class SetupCameraTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_17__.Primi
|
|
|
181060
181083
|
_targetHeightProperty;
|
|
181061
181084
|
get targetHeightProperty() {
|
|
181062
181085
|
if (!this._targetHeightProperty)
|
|
181063
|
-
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
|
|
181086
|
+
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);
|
|
181064
181087
|
return this._targetHeightProperty;
|
|
181065
181088
|
}
|
|
181066
181089
|
get targetHeight() { return this.targetHeightProperty.value; }
|
|
181067
181090
|
set targetHeight(value) { this.targetHeightProperty.value = value; }
|
|
181068
|
-
|
|
181069
|
-
if (property === this.
|
|
181070
|
-
return this.
|
|
181071
|
-
else if (property === this.
|
|
181072
|
-
return this.
|
|
181091
|
+
getToolSettingLockProperty(property) {
|
|
181092
|
+
if (property === this.cameraHeightProperty)
|
|
181093
|
+
return this.useCameraHeightProperty;
|
|
181094
|
+
else if (property === this.targetHeightProperty)
|
|
181095
|
+
return this.useTargetHeightProperty;
|
|
181073
181096
|
return undefined;
|
|
181074
181097
|
}
|
|
181075
181098
|
async applyToolSettingPropertyChange(updatedValue) {
|
|
@@ -181077,9 +181100,6 @@ class SetupCameraTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_17__.Primi
|
|
|
181077
181100
|
}
|
|
181078
181101
|
supplyToolSettingsProperties() {
|
|
181079
181102
|
this.initializeToolSettingPropertyValues([this.useCameraHeightProperty, this.useTargetHeightProperty, this.cameraHeightProperty, this.targetHeightProperty]);
|
|
181080
|
-
// ensure controls are enabled/disabled base on current lock property state
|
|
181081
|
-
this.targetHeightProperty.isDisabled = !this.useTargetHeight;
|
|
181082
|
-
this.cameraHeightProperty.isDisabled = !this.useCameraHeight;
|
|
181083
181103
|
const cameraHeightLock = this.useCameraHeightProperty.toDialogItem({ rowPriority: 1, columnIndex: 0 });
|
|
181084
181104
|
const targetHeightLock = this.useTargetHeightProperty.toDialogItem({ rowPriority: 2, columnIndex: 0 });
|
|
181085
181105
|
const toolSettings = new Array();
|
|
@@ -189671,11 +189691,11 @@ class ClipPlane extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d
|
|
|
189671
189691
|
get inwardNormalRef() {
|
|
189672
189692
|
return this._inwardNormal;
|
|
189673
189693
|
}
|
|
189674
|
-
/** Return the "interior" property
|
|
189694
|
+
/** Return the "interior" property flag. Interpretation of this flag is algorithm-specific. */
|
|
189675
189695
|
get interior() {
|
|
189676
189696
|
return this._interior;
|
|
189677
189697
|
}
|
|
189678
|
-
/** Return the "invisible" property
|
|
189698
|
+
/** Return the "invisible" property flag. Interpretation of this flag is algorithm-specific. */
|
|
189679
189699
|
get invisible() {
|
|
189680
189700
|
return this._invisible;
|
|
189681
189701
|
}
|
|
@@ -189894,7 +189914,7 @@ class ClipPlane extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d
|
|
|
189894
189914
|
this._distanceFromOrigin = this._inwardNormal.dotProduct(plane.getOriginRef());
|
|
189895
189915
|
return true;
|
|
189896
189916
|
}
|
|
189897
|
-
/** Set the invisible flag. Interpretation of this is
|
|
189917
|
+
/** Set the invisible flag. Interpretation of this flag is algorithm-specific. */
|
|
189898
189918
|
setInvisible(invisible) {
|
|
189899
189919
|
this._invisible = invisible;
|
|
189900
189920
|
}
|
|
@@ -190038,8 +190058,12 @@ class ClipPlane extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d
|
|
|
190038
190058
|
}
|
|
190039
190059
|
/** Project a point in space to the plane. */
|
|
190040
190060
|
projectPointToPlane(spacePoint, result) {
|
|
190041
|
-
|
|
190042
|
-
|
|
190061
|
+
return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);
|
|
190062
|
+
}
|
|
190063
|
+
/** Return the projection of (x,y,z) onto the plane. */
|
|
190064
|
+
projectXYZToPlane(x, y, z, result) {
|
|
190065
|
+
const scale = -this.altitudeXYZ(x, y, z);
|
|
190066
|
+
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);
|
|
190043
190067
|
}
|
|
190044
190068
|
}
|
|
190045
190069
|
|
|
@@ -192338,8 +192362,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
192338
192362
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
192339
192363
|
/* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
|
|
192340
192364
|
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
192341
|
-
/* harmony import */ var
|
|
192342
|
-
/* harmony import */ var
|
|
192365
|
+
/* harmony import */ var _polyface_Polyface__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../polyface/Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
192366
|
+
/* harmony import */ var _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../polyface/PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
|
|
192343
192367
|
/* harmony import */ var _ClipPlane__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ClipPlane */ "../../core/geometry/lib/esm/clipping/ClipPlane.js");
|
|
192344
192368
|
/* harmony import */ var _ClipUtils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./ClipUtils */ "../../core/geometry/lib/esm/clipping/ClipUtils.js");
|
|
192345
192369
|
/*---------------------------------------------------------------------------------------------
|
|
@@ -193079,29 +193103,18 @@ class ConvexClipPlaneSet {
|
|
|
193079
193103
|
static createConvexPolyface(convexMesh, result) {
|
|
193080
193104
|
result = this.createEmpty(result);
|
|
193081
193105
|
let vol = 0;
|
|
193082
|
-
|
|
193083
|
-
|
|
193084
|
-
|
|
193085
|
-
|
|
193086
|
-
|
|
193087
|
-
|
|
193088
|
-
|
|
193089
|
-
|
|
193090
|
-
|
|
193091
|
-
|
|
193092
|
-
|
|
193093
|
-
|
|
193094
|
-
vol = _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_11__.PolyfaceQuery.sumTetrahedralVolumes(myVisitor);
|
|
193095
|
-
const scale = vol > 0.0 ? -1.0 : 1.0; // point clipper normals inward if mesh normals point outward
|
|
193096
|
-
const normal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create();
|
|
193097
|
-
const plane = _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_1__.Plane3dByOriginAndUnitNormal.createXYPlane();
|
|
193098
|
-
myVisitor.reset();
|
|
193099
|
-
while (myVisitor.moveToNextFacet()) {
|
|
193100
|
-
if (undefined !== _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.areaNormalGo(myVisitor.point, normal)) {
|
|
193101
|
-
normal.scaleInPlace(scale);
|
|
193102
|
-
if (undefined !== _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_1__.Plane3dByOriginAndUnitNormal.create(myVisitor.point.front(), normal, plane))
|
|
193103
|
-
result.addPlaneToConvexSet(plane);
|
|
193104
|
-
}
|
|
193106
|
+
if (_polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_10__.PolyfaceQuery.isPolyfaceClosedByEdgePairing(convexMesh))
|
|
193107
|
+
vol = _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_10__.PolyfaceQuery.sumTetrahedralVolumes(convexMesh);
|
|
193108
|
+
const scale = vol > 0.0 ? -1.0 : 1.0; // point clipper normals inward if mesh normals point outward
|
|
193109
|
+
const normal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create();
|
|
193110
|
+
const plane = _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_1__.Plane3dByOriginAndUnitNormal.createXYPlane();
|
|
193111
|
+
const visitor = convexMesh instanceof _polyface_Polyface__WEBPACK_IMPORTED_MODULE_11__.Polyface ? convexMesh.createVisitor(0) : convexMesh;
|
|
193112
|
+
visitor.setNumWrap(0);
|
|
193113
|
+
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
193114
|
+
if (undefined !== _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.areaNormalGo(visitor.point, normal)) {
|
|
193115
|
+
normal.scaleInPlace(scale);
|
|
193116
|
+
if (undefined !== _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_1__.Plane3dByOriginAndUnitNormal.create(visitor.point.front(), normal, plane))
|
|
193117
|
+
result.addPlaneToConvexSet(plane);
|
|
193105
193118
|
}
|
|
193106
193119
|
}
|
|
193107
193120
|
return { clipper: result, volume: vol };
|
|
@@ -193696,7 +193709,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
193696
193709
|
/* harmony export */ BSplineWrapMode: () => (/* reexport safe */ _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_108__.BSplineWrapMode),
|
|
193697
193710
|
/* harmony export */ BagOfCurves: () => (/* reexport safe */ _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_64__.BagOfCurves),
|
|
193698
193711
|
/* harmony export */ BarycentricTriangle: () => (/* reexport safe */ _geometry3d_BarycentricTriangle__WEBPACK_IMPORTED_MODULE_3__.BarycentricTriangle),
|
|
193699
|
-
/* harmony export */ BentleyGeometryFlatBuffer: () => (/* reexport safe */
|
|
193712
|
+
/* harmony export */ BentleyGeometryFlatBuffer: () => (/* reexport safe */ _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_132__.BentleyGeometryFlatBuffer),
|
|
193700
193713
|
/* harmony export */ Bezier1dNd: () => (/* reexport safe */ _bspline_Bezier1dNd__WEBPACK_IMPORTED_MODULE_98__.Bezier1dNd),
|
|
193701
193714
|
/* harmony export */ BezierCoffs: () => (/* reexport safe */ _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_51__.BezierCoffs),
|
|
193702
193715
|
/* harmony export */ BezierCurve3d: () => (/* reexport safe */ _bspline_BezierCurve3d__WEBPACK_IMPORTED_MODULE_100__.BezierCurve3d),
|
|
@@ -193716,7 +193729,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
193716
193729
|
/* harmony export */ ClipStepAction: () => (/* reexport safe */ _clipping_ClipUtils__WEBPACK_IMPORTED_MODULE_44__.ClipStepAction),
|
|
193717
193730
|
/* harmony export */ ClipUtilities: () => (/* reexport safe */ _clipping_ClipUtils__WEBPACK_IMPORTED_MODULE_44__.ClipUtilities),
|
|
193718
193731
|
/* harmony export */ ClipVector: () => (/* reexport safe */ _clipping_ClipVector__WEBPACK_IMPORTED_MODULE_43__.ClipVector),
|
|
193719
|
-
/* harmony export */ ClippedPolyfaceBuilders: () => (/* reexport safe */
|
|
193732
|
+
/* harmony export */ ClippedPolyfaceBuilders: () => (/* reexport safe */ _polyface_PolyfaceClip__WEBPACK_IMPORTED_MODULE_122__.ClippedPolyfaceBuilders),
|
|
193720
193733
|
/* harmony export */ ClusterableArray: () => (/* reexport safe */ _numerics_ClusterableArray__WEBPACK_IMPORTED_MODULE_52__.ClusterableArray),
|
|
193721
193734
|
/* harmony export */ Complex: () => (/* reexport safe */ _numerics_Complex__WEBPACK_IMPORTED_MODULE_53__.Complex),
|
|
193722
193735
|
/* harmony export */ Cone: () => (/* reexport safe */ _solid_Cone__WEBPACK_IMPORTED_MODULE_89__.Cone),
|
|
@@ -193744,9 +193757,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
193744
193757
|
/* harmony export */ CurveSearchStatus: () => (/* reexport safe */ _curve_CurveLocationDetail__WEBPACK_IMPORTED_MODULE_66__.CurveSearchStatus),
|
|
193745
193758
|
/* harmony export */ CutLoop: () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.CutLoop),
|
|
193746
193759
|
/* harmony export */ CutLoopMergeContext: () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.CutLoopMergeContext),
|
|
193747
|
-
/* harmony export */ DeepCompare: () => (/* reexport safe */
|
|
193760
|
+
/* harmony export */ DeepCompare: () => (/* reexport safe */ _serialization_DeepCompare__WEBPACK_IMPORTED_MODULE_129__.DeepCompare),
|
|
193748
193761
|
/* harmony export */ DirectSpiral3d: () => (/* reexport safe */ _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_85__.DirectSpiral3d),
|
|
193749
|
-
/* harmony export */ DuplicateFacetClusterSelector: () => (/* reexport safe */
|
|
193762
|
+
/* harmony export */ DuplicateFacetClusterSelector: () => (/* reexport safe */ _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_121__.DuplicateFacetClusterSelector),
|
|
193750
193763
|
/* harmony export */ Ellipsoid: () => (/* reexport safe */ _geometry3d_Ellipsoid__WEBPACK_IMPORTED_MODULE_5__.Ellipsoid),
|
|
193751
193764
|
/* harmony export */ EllipsoidPatch: () => (/* reexport safe */ _geometry3d_Ellipsoid__WEBPACK_IMPORTED_MODULE_5__.EllipsoidPatch),
|
|
193752
193765
|
/* harmony export */ EllipticalArcApproximationOptions: () => (/* reexport safe */ _curve_Arc3d__WEBPACK_IMPORTED_MODULE_59__.EllipticalArcApproximationOptions),
|
|
@@ -193761,18 +193774,19 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
193761
193774
|
/* harmony export */ Geometry: () => (/* reexport safe */ _Geometry__WEBPACK_IMPORTED_MODULE_36__.Geometry),
|
|
193762
193775
|
/* harmony export */ GeometryHandler: () => (/* reexport safe */ _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_8__.GeometryHandler),
|
|
193763
193776
|
/* harmony export */ GeometryQuery: () => (/* reexport safe */ _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_71__.GeometryQuery),
|
|
193764
|
-
/* harmony export */ GriddedRaggedRange2dSet: () => (/* reexport safe */
|
|
193765
|
-
/* harmony export */ GriddedRaggedRange2dSetWithOverflow: () => (/* reexport safe */
|
|
193777
|
+
/* harmony export */ GriddedRaggedRange2dSet: () => (/* reexport safe */ _polyface_multiclip_GriddedRaggedRange2dSet__WEBPACK_IMPORTED_MODULE_117__.GriddedRaggedRange2dSet),
|
|
193778
|
+
/* harmony export */ GriddedRaggedRange2dSetWithOverflow: () => (/* reexport safe */ _polyface_multiclip_GriddedRaggedRange2dSetWithOverflow__WEBPACK_IMPORTED_MODULE_118__.GriddedRaggedRange2dSetWithOverflow),
|
|
193766
193779
|
/* harmony export */ GrowableBlockedArray: () => (/* reexport safe */ _geometry3d_GrowableBlockedArray__WEBPACK_IMPORTED_MODULE_9__.GrowableBlockedArray),
|
|
193767
193780
|
/* harmony export */ GrowableFloat64Array: () => (/* reexport safe */ _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_10__.GrowableFloat64Array),
|
|
193768
193781
|
/* harmony export */ GrowableXYArray: () => (/* reexport safe */ _geometry3d_GrowableXYArray__WEBPACK_IMPORTED_MODULE_11__.GrowableXYArray),
|
|
193769
193782
|
/* harmony export */ GrowableXYZArray: () => (/* reexport safe */ _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_12__.GrowableXYZArray),
|
|
193770
|
-
/* harmony export */ IModelJson: () => (/* reexport safe */
|
|
193783
|
+
/* harmony export */ IModelJson: () => (/* reexport safe */ _serialization_IModelJsonSchema__WEBPACK_IMPORTED_MODULE_128__.IModelJson),
|
|
193771
193784
|
/* harmony export */ IndexedCollectionInterval: () => (/* reexport safe */ _geometry3d_IndexedCollectionInterval__WEBPACK_IMPORTED_MODULE_13__.IndexedCollectionInterval),
|
|
193785
|
+
/* harmony export */ IndexedEdgeMatcher: () => (/* reexport safe */ _polyface_IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_114__.IndexedEdgeMatcher),
|
|
193772
193786
|
/* harmony export */ IndexedPolyface: () => (/* reexport safe */ _polyface_Polyface__WEBPACK_IMPORTED_MODULE_112__.IndexedPolyface),
|
|
193773
|
-
/* harmony export */ IndexedPolyfaceSubsetVisitor: () => (/* reexport safe */
|
|
193774
|
-
/* harmony export */ IndexedPolyfaceVisitor: () => (/* reexport safe */
|
|
193775
|
-
/* harmony export */ IndexedPolyfaceWalker: () => (/* reexport safe */
|
|
193787
|
+
/* harmony export */ IndexedPolyfaceSubsetVisitor: () => (/* reexport safe */ _polyface_IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_115__.IndexedPolyfaceSubsetVisitor),
|
|
193788
|
+
/* harmony export */ IndexedPolyfaceVisitor: () => (/* reexport safe */ _polyface_IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_115__.IndexedPolyfaceVisitor),
|
|
193789
|
+
/* harmony export */ IndexedPolyfaceWalker: () => (/* reexport safe */ _polyface_IndexedPolyfaceWalker__WEBPACK_IMPORTED_MODULE_116__.IndexedPolyfaceWalker),
|
|
193776
193790
|
/* harmony export */ IndexedReadWriteXYZCollection: () => (/* reexport safe */ _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_15__.IndexedReadWriteXYZCollection),
|
|
193777
193791
|
/* harmony export */ IndexedXYCollection: () => (/* reexport safe */ _geometry3d_IndexedXYCollection__WEBPACK_IMPORTED_MODULE_14__.IndexedXYCollection),
|
|
193778
193792
|
/* harmony export */ IndexedXYZCollection: () => (/* reexport safe */ _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_15__.IndexedXYZCollection),
|
|
@@ -193786,7 +193800,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
193786
193800
|
/* harmony export */ KnotVector: () => (/* reexport safe */ _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_108__.KnotVector),
|
|
193787
193801
|
/* harmony export */ LineSegment3d: () => (/* reexport safe */ _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_72__.LineSegment3d),
|
|
193788
193802
|
/* harmony export */ LineString3d: () => (/* reexport safe */ _curve_LineString3d__WEBPACK_IMPORTED_MODULE_73__.LineString3d),
|
|
193789
|
-
/* harmony export */ LineString3dRangeTreeContext: () => (/* reexport safe */
|
|
193803
|
+
/* harmony export */ LineString3dRangeTreeContext: () => (/* reexport safe */ _polyface_RangeTree_LineString3dRangeTreeContext__WEBPACK_IMPORTED_MODULE_124__.LineString3dRangeTreeContext),
|
|
193790
193804
|
/* harmony export */ LinearSweep: () => (/* reexport safe */ _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_90__.LinearSweep),
|
|
193791
193805
|
/* harmony export */ LongitudeLatitudeNumber: () => (/* reexport safe */ _geometry3d_LongitudeLatitudeAltitude__WEBPACK_IMPORTED_MODULE_2__.LongitudeLatitudeNumber),
|
|
193792
193806
|
/* harmony export */ Loop: () => (/* reexport safe */ _curve_Loop__WEBPACK_IMPORTED_MODULE_74__.Loop),
|
|
@@ -193799,7 +193813,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
193799
193813
|
/* harmony export */ NonConvexFacetLocationDetail: () => (/* reexport safe */ _polyface_FacetLocationDetail__WEBPACK_IMPORTED_MODULE_113__.NonConvexFacetLocationDetail),
|
|
193800
193814
|
/* harmony export */ NullGeometryHandler: () => (/* reexport safe */ _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_8__.NullGeometryHandler),
|
|
193801
193815
|
/* harmony export */ NumberArray: () => (/* reexport safe */ _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_24__.NumberArray),
|
|
193802
|
-
/* harmony export */ OffsetMeshOptions: () => (/* reexport safe */
|
|
193816
|
+
/* harmony export */ OffsetMeshOptions: () => (/* reexport safe */ _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_121__.OffsetMeshOptions),
|
|
193803
193817
|
/* harmony export */ OffsetOptions: () => (/* reexport safe */ _curve_OffsetOptions__WEBPACK_IMPORTED_MODULE_75__.OffsetOptions),
|
|
193804
193818
|
/* harmony export */ Order2Bezier: () => (/* reexport safe */ _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_51__.Order2Bezier),
|
|
193805
193819
|
/* harmony export */ Order3Bezier: () => (/* reexport safe */ _numerics_BezierPolynomials__WEBPACK_IMPORTED_MODULE_51__.Order3Bezier),
|
|
@@ -193822,17 +193836,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
193822
193836
|
/* harmony export */ Point3dArray: () => (/* reexport safe */ _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_24__.Point3dArray),
|
|
193823
193837
|
/* harmony export */ Point3dArrayCarrier: () => (/* reexport safe */ _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_25__.Point3dArrayCarrier),
|
|
193824
193838
|
/* harmony export */ Point3dArrayPolygonOps: () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.Point3dArrayPolygonOps),
|
|
193825
|
-
/* harmony export */ Point3dArrayRangeTreeContext: () => (/* reexport safe */
|
|
193839
|
+
/* harmony export */ Point3dArrayRangeTreeContext: () => (/* reexport safe */ _polyface_RangeTree_Point3dArrayRangeTreeContext__WEBPACK_IMPORTED_MODULE_123__.Point3dArrayRangeTreeContext),
|
|
193826
193840
|
/* harmony export */ Point4d: () => (/* reexport safe */ _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_47__.Point4d),
|
|
193827
193841
|
/* harmony export */ Point4dArray: () => (/* reexport safe */ _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_24__.Point4dArray),
|
|
193828
193842
|
/* harmony export */ PointString3d: () => (/* reexport safe */ _curve_PointString3d__WEBPACK_IMPORTED_MODULE_80__.PointString3d),
|
|
193829
193843
|
/* harmony export */ Polyface: () => (/* reexport safe */ _polyface_Polyface__WEBPACK_IMPORTED_MODULE_112__.Polyface),
|
|
193830
193844
|
/* harmony export */ PolyfaceAuxData: () => (/* reexport safe */ _polyface_AuxData__WEBPACK_IMPORTED_MODULE_109__.PolyfaceAuxData),
|
|
193831
|
-
/* harmony export */ PolyfaceBuilder: () => (/* reexport safe */
|
|
193832
|
-
/* harmony export */ PolyfaceClip: () => (/* reexport safe */
|
|
193833
|
-
/* harmony export */ PolyfaceData: () => (/* reexport safe */
|
|
193834
|
-
/* harmony export */ PolyfaceQuery: () => (/* reexport safe */
|
|
193835
|
-
/* harmony export */ PolyfaceRangeTreeContext: () => (/* reexport safe */
|
|
193845
|
+
/* harmony export */ PolyfaceBuilder: () => (/* reexport safe */ _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_119__.PolyfaceBuilder),
|
|
193846
|
+
/* harmony export */ PolyfaceClip: () => (/* reexport safe */ _polyface_PolyfaceClip__WEBPACK_IMPORTED_MODULE_122__.PolyfaceClip),
|
|
193847
|
+
/* harmony export */ PolyfaceData: () => (/* reexport safe */ _polyface_PolyfaceData__WEBPACK_IMPORTED_MODULE_120__.PolyfaceData),
|
|
193848
|
+
/* harmony export */ PolyfaceQuery: () => (/* reexport safe */ _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_121__.PolyfaceQuery),
|
|
193849
|
+
/* harmony export */ PolyfaceRangeTreeContext: () => (/* reexport safe */ _polyface_RangeTree_PolyfaceRangeTreeContext__WEBPACK_IMPORTED_MODULE_125__.PolyfaceRangeTreeContext),
|
|
193836
193850
|
/* harmony export */ PolygonLocation: () => (/* reexport safe */ _Geometry__WEBPACK_IMPORTED_MODULE_36__.PolygonLocation),
|
|
193837
193851
|
/* harmony export */ PolygonLocationDetail: () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.PolygonLocationDetail),
|
|
193838
193852
|
/* harmony export */ PolygonLocationDetailPair: () => (/* reexport safe */ _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_27__.PolygonLocationDetailPair),
|
|
@@ -193855,23 +193869,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
193855
193869
|
/* harmony export */ RegionOps: () => (/* reexport safe */ _curve_RegionOps__WEBPACK_IMPORTED_MODULE_79__.RegionOps),
|
|
193856
193870
|
/* harmony export */ RotationalSweep: () => (/* reexport safe */ _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_91__.RotationalSweep),
|
|
193857
193871
|
/* harmony export */ RuledSweep: () => (/* reexport safe */ _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_92__.RuledSweep),
|
|
193858
|
-
/* harmony export */ Sample: () => (/* reexport safe */
|
|
193872
|
+
/* harmony export */ Sample: () => (/* reexport safe */ _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_130__.Sample),
|
|
193859
193873
|
/* harmony export */ Segment1d: () => (/* reexport safe */ _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_31__.Segment1d),
|
|
193860
|
-
/* harmony export */ SerializationHelpers: () => (/* reexport safe */
|
|
193874
|
+
/* harmony export */ SerializationHelpers: () => (/* reexport safe */ _serialization_SerializationHelpers__WEBPACK_IMPORTED_MODULE_131__.SerializationHelpers),
|
|
193861
193875
|
/* harmony export */ SmallSystem: () => (/* reexport safe */ _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_57__.SmallSystem),
|
|
193862
193876
|
/* harmony export */ SmoothTransformBetweenFrusta: () => (/* reexport safe */ _geometry3d_FrustumAnimation__WEBPACK_IMPORTED_MODULE_7__.SmoothTransformBetweenFrusta),
|
|
193863
193877
|
/* harmony export */ SolidPrimitive: () => (/* reexport safe */ _solid_SolidPrimitive__WEBPACK_IMPORTED_MODULE_93__.SolidPrimitive),
|
|
193864
|
-
/* harmony export */
|
|
193878
|
+
/* harmony export */ SortableEdge: () => (/* reexport safe */ _polyface_IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_114__.SortableEdge),
|
|
193879
|
+
/* harmony export */ SpacePolygonTriangulation: () => (/* reexport safe */ _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_127__.SpacePolygonTriangulation),
|
|
193865
193880
|
/* harmony export */ Sphere: () => (/* reexport safe */ _solid_Sphere__WEBPACK_IMPORTED_MODULE_94__.Sphere),
|
|
193866
193881
|
/* harmony export */ StandardViewIndex: () => (/* reexport safe */ _Geometry__WEBPACK_IMPORTED_MODULE_36__.StandardViewIndex),
|
|
193867
|
-
/* harmony export */ SteppedIndexFunctionFactory: () => (/* reexport safe */
|
|
193882
|
+
/* harmony export */ SteppedIndexFunctionFactory: () => (/* reexport safe */ _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_130__.SteppedIndexFunctionFactory),
|
|
193868
193883
|
/* harmony export */ StringifiedClipVector: () => (/* reexport safe */ _clipping_ClipVector__WEBPACK_IMPORTED_MODULE_43__.StringifiedClipVector),
|
|
193869
193884
|
/* harmony export */ StrokeCountMap: () => (/* reexport safe */ _curve_Query_StrokeCountMap__WEBPACK_IMPORTED_MODULE_87__.StrokeCountMap),
|
|
193870
193885
|
/* harmony export */ StrokeOptions: () => (/* reexport safe */ _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_82__.StrokeOptions),
|
|
193871
193886
|
/* harmony export */ SweepContour: () => (/* reexport safe */ _solid_SweepContour__WEBPACK_IMPORTED_MODULE_95__.SweepContour),
|
|
193872
|
-
/* harmony export */ SweepLineStringToFacetsOptions: () => (/* reexport safe */
|
|
193873
|
-
/* harmony export */ TaggedNumericConstants: () => (/* reexport safe */
|
|
193874
|
-
/* harmony export */ TaggedNumericData: () => (/* reexport safe */
|
|
193887
|
+
/* harmony export */ SweepLineStringToFacetsOptions: () => (/* reexport safe */ _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_121__.SweepLineStringToFacetsOptions),
|
|
193888
|
+
/* harmony export */ TaggedNumericConstants: () => (/* reexport safe */ _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_126__.TaggedNumericConstants),
|
|
193889
|
+
/* harmony export */ TaggedNumericData: () => (/* reexport safe */ _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_126__.TaggedNumericData),
|
|
193875
193890
|
/* harmony export */ TorusPipe: () => (/* reexport safe */ _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_96__.TorusPipe),
|
|
193876
193891
|
/* harmony export */ Transform: () => (/* reexport safe */ _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_32__.Transform),
|
|
193877
193892
|
/* harmony export */ TransitionSpiral3d: () => (/* reexport safe */ _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_83__.TransitionSpiral3d),
|
|
@@ -194007,24 +194022,25 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
194007
194022
|
/* harmony import */ var _polyface_FacetFaceData__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(/*! ./polyface/FacetFaceData */ "../../core/geometry/lib/esm/polyface/FacetFaceData.js");
|
|
194008
194023
|
/* harmony import */ var _polyface_Polyface__WEBPACK_IMPORTED_MODULE_112__ = __webpack_require__(/*! ./polyface/Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
194009
194024
|
/* harmony import */ var _polyface_FacetLocationDetail__WEBPACK_IMPORTED_MODULE_113__ = __webpack_require__(/*! ./polyface/FacetLocationDetail */ "../../core/geometry/lib/esm/polyface/FacetLocationDetail.js");
|
|
194010
|
-
/* harmony import */ var
|
|
194011
|
-
/* harmony import */ var
|
|
194012
|
-
/* harmony import */ var
|
|
194013
|
-
/* harmony import */ var
|
|
194014
|
-
/* harmony import */ var
|
|
194015
|
-
/* harmony import */ var
|
|
194016
|
-
/* harmony import */ var
|
|
194017
|
-
/* harmony import */ var
|
|
194018
|
-
/* harmony import */ var
|
|
194019
|
-
/* harmony import */ var
|
|
194020
|
-
/* harmony import */ var
|
|
194021
|
-
/* harmony import */ var
|
|
194022
|
-
/* harmony import */ var
|
|
194023
|
-
/* harmony import */ var
|
|
194024
|
-
/* harmony import */ var
|
|
194025
|
-
/* harmony import */ var
|
|
194026
|
-
/* harmony import */ var
|
|
194027
|
-
/* harmony import */ var
|
|
194025
|
+
/* harmony import */ var _polyface_IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_114__ = __webpack_require__(/*! ./polyface/IndexedEdgeMatcher */ "../../core/geometry/lib/esm/polyface/IndexedEdgeMatcher.js");
|
|
194026
|
+
/* harmony import */ var _polyface_IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_115__ = __webpack_require__(/*! ./polyface/IndexedPolyfaceVisitor */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceVisitor.js");
|
|
194027
|
+
/* harmony import */ var _polyface_IndexedPolyfaceWalker__WEBPACK_IMPORTED_MODULE_116__ = __webpack_require__(/*! ./polyface/IndexedPolyfaceWalker */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceWalker.js");
|
|
194028
|
+
/* harmony import */ var _polyface_multiclip_GriddedRaggedRange2dSet__WEBPACK_IMPORTED_MODULE_117__ = __webpack_require__(/*! ./polyface/multiclip/GriddedRaggedRange2dSet */ "../../core/geometry/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js");
|
|
194029
|
+
/* harmony import */ var _polyface_multiclip_GriddedRaggedRange2dSetWithOverflow__WEBPACK_IMPORTED_MODULE_118__ = __webpack_require__(/*! ./polyface/multiclip/GriddedRaggedRange2dSetWithOverflow */ "../../core/geometry/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js");
|
|
194030
|
+
/* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_119__ = __webpack_require__(/*! ./polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
|
|
194031
|
+
/* harmony import */ var _polyface_PolyfaceData__WEBPACK_IMPORTED_MODULE_120__ = __webpack_require__(/*! ./polyface/PolyfaceData */ "../../core/geometry/lib/esm/polyface/PolyfaceData.js");
|
|
194032
|
+
/* harmony import */ var _polyface_PolyfaceQuery__WEBPACK_IMPORTED_MODULE_121__ = __webpack_require__(/*! ./polyface/PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
|
|
194033
|
+
/* harmony import */ var _polyface_PolyfaceClip__WEBPACK_IMPORTED_MODULE_122__ = __webpack_require__(/*! ./polyface/PolyfaceClip */ "../../core/geometry/lib/esm/polyface/PolyfaceClip.js");
|
|
194034
|
+
/* harmony import */ var _polyface_RangeTree_Point3dArrayRangeTreeContext__WEBPACK_IMPORTED_MODULE_123__ = __webpack_require__(/*! ./polyface/RangeTree/Point3dArrayRangeTreeContext */ "../../core/geometry/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js");
|
|
194035
|
+
/* harmony import */ var _polyface_RangeTree_LineString3dRangeTreeContext__WEBPACK_IMPORTED_MODULE_124__ = __webpack_require__(/*! ./polyface/RangeTree/LineString3dRangeTreeContext */ "../../core/geometry/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js");
|
|
194036
|
+
/* harmony import */ var _polyface_RangeTree_PolyfaceRangeTreeContext__WEBPACK_IMPORTED_MODULE_125__ = __webpack_require__(/*! ./polyface/RangeTree/PolyfaceRangeTreeContext */ "../../core/geometry/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js");
|
|
194037
|
+
/* harmony import */ var _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_126__ = __webpack_require__(/*! ./polyface/TaggedNumericData */ "../../core/geometry/lib/esm/polyface/TaggedNumericData.js");
|
|
194038
|
+
/* harmony import */ var _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_127__ = __webpack_require__(/*! ./topology/SpaceTriangulation */ "../../core/geometry/lib/esm/topology/SpaceTriangulation.js");
|
|
194039
|
+
/* harmony import */ var _serialization_IModelJsonSchema__WEBPACK_IMPORTED_MODULE_128__ = __webpack_require__(/*! ./serialization/IModelJsonSchema */ "../../core/geometry/lib/esm/serialization/IModelJsonSchema.js");
|
|
194040
|
+
/* harmony import */ var _serialization_DeepCompare__WEBPACK_IMPORTED_MODULE_129__ = __webpack_require__(/*! ./serialization/DeepCompare */ "../../core/geometry/lib/esm/serialization/DeepCompare.js");
|
|
194041
|
+
/* harmony import */ var _serialization_GeometrySamples__WEBPACK_IMPORTED_MODULE_130__ = __webpack_require__(/*! ./serialization/GeometrySamples */ "../../core/geometry/lib/esm/serialization/GeometrySamples.js");
|
|
194042
|
+
/* harmony import */ var _serialization_SerializationHelpers__WEBPACK_IMPORTED_MODULE_131__ = __webpack_require__(/*! ./serialization/SerializationHelpers */ "../../core/geometry/lib/esm/serialization/SerializationHelpers.js");
|
|
194043
|
+
/* harmony import */ var _serialization_BentleyGeometryFlatBuffer__WEBPACK_IMPORTED_MODULE_132__ = __webpack_require__(/*! ./serialization/BentleyGeometryFlatBuffer */ "../../core/geometry/lib/esm/serialization/BentleyGeometryFlatBuffer.js");
|
|
194028
194044
|
/*---------------------------------------------------------------------------------------------
|
|
194029
194045
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
194030
194046
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -194278,6 +194294,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
194278
194294
|
|
|
194279
194295
|
|
|
194280
194296
|
|
|
194297
|
+
|
|
194281
194298
|
|
|
194282
194299
|
|
|
194283
194300
|
/***/ }),
|
|
@@ -194461,15 +194478,26 @@ class EllipticalArcApproximationOptions {
|
|
|
194461
194478
|
* Circular or elliptic arc.
|
|
194462
194479
|
* * The angle to point equation is:
|
|
194463
194480
|
* * `X = center + cos(theta) * vector0 + sin(theta) * vector90`
|
|
194464
|
-
* *
|
|
194465
|
-
* *
|
|
194466
|
-
* *
|
|
194467
|
-
* *
|
|
194468
|
-
* *
|
|
194469
|
-
*
|
|
194481
|
+
* * The arc's `sweep` determines the range of theta values (angles). In particular:
|
|
194482
|
+
* * The point at `theta = n*360` degrees is `center + vector0` for any integer n.
|
|
194483
|
+
* * The point at `theta = 90 + n*360` degrees is `center + vector90` for any integer n.
|
|
194484
|
+
* * The arc's `sweep` _together with_ `vector0` and `vector90` determine the arc's orientation:
|
|
194485
|
+
* * If `sweep.startDegrees < sweep.endDegrees`, the arc's orientation is counterclockwise with respect to its
|
|
194486
|
+
* `perpendicularVector` (i.e., looking at the arc from the head of this vector).
|
|
194487
|
+
* * Similarly, if `sweep.startDegrees > sweep.endDegrees`, the arc's orientation is clockwise with respect to
|
|
194488
|
+
* its `perpendicularVector`.
|
|
194489
|
+
* * The arc's orientation is _always_ counterclockwise with respect to its `binormalVector`.
|
|
194490
|
+
* * When `vector0` and `vector90` are perpendicular and have equal length, the arc is circular.
|
|
194491
|
+
* * When they are non-perpendicular, the arc is always elliptic.
|
|
194492
|
+
* * When they have unequal length, the arc is always elliptic.
|
|
194493
|
+
* * To create an ellipse in standard major-minor axis form:
|
|
194494
|
+
* * `vector0` is the vector from the center to the major axis extreme.
|
|
194495
|
+
* * `vector90` is the vector from the center to the minor axis extreme.
|
|
194470
194496
|
* * Note that constructing these vectors to the extreme points makes them perpendicular.
|
|
194471
|
-
* * The method toScaledMatrix3d
|
|
194472
|
-
*
|
|
194497
|
+
* * The method [[Arc3d.toScaledMatrix3d]] can be called to convert an arc with unrestricted `vector0` and `vector90`
|
|
194498
|
+
* to an arc in standard major-minor axis form.
|
|
194499
|
+
* * The unrestricted form is much easier to work with for common calculations: stroking, projection to 2d,
|
|
194500
|
+
* intersection with plane.
|
|
194473
194501
|
* @public
|
|
194474
194502
|
*/
|
|
194475
194503
|
class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive {
|
|
@@ -194480,7 +194508,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
194480
194508
|
return other instanceof Arc3d;
|
|
194481
194509
|
}
|
|
194482
194510
|
_center;
|
|
194483
|
-
_matrix; // columns are [vector0, vector90,
|
|
194511
|
+
_matrix; // columns are [vector0, vector90, unit normal]
|
|
194484
194512
|
_sweep; // sweep limits
|
|
194485
194513
|
static _workPointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create();
|
|
194486
194514
|
static _workPointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create();
|
|
@@ -194495,21 +194523,27 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
194495
194523
|
set center(center) {
|
|
194496
194524
|
this._center.setFrom(center);
|
|
194497
194525
|
}
|
|
194498
|
-
/** Read property for (reference to) center. */
|
|
194526
|
+
/** Read property for (reference to) the arc center. */
|
|
194499
194527
|
get centerRef() {
|
|
194500
194528
|
return this._center;
|
|
194501
194529
|
}
|
|
194502
|
-
/**
|
|
194530
|
+
/**
|
|
194531
|
+
* Read property for (clone of) the x-column of the arc matrix.
|
|
194532
|
+
* * This vector determines the point on the arc corresponding to angles n*360 degrees.
|
|
194533
|
+
*/
|
|
194503
194534
|
get vector0() {
|
|
194504
194535
|
return this._matrix.columnX();
|
|
194505
194536
|
}
|
|
194506
|
-
/**
|
|
194537
|
+
/**
|
|
194538
|
+
* Read property for (clone of) the y-column of the arc matrix.
|
|
194539
|
+
* * This vector determines the point on the arc corresponding to angles 90 + n*360 degrees.
|
|
194540
|
+
*/
|
|
194507
194541
|
get vector90() {
|
|
194508
194542
|
return this._matrix.columnY();
|
|
194509
194543
|
}
|
|
194510
194544
|
/**
|
|
194511
194545
|
* Compute an arc binormal vector with arbitrary length.
|
|
194512
|
-
* * The arc parameterization is
|
|
194546
|
+
* * The arc parameterization is counterclockwise with respect to this vector.
|
|
194513
194547
|
* * This vector is parallel to [[perpendicularVector]] and possibly opposite.
|
|
194514
194548
|
*/
|
|
194515
194549
|
binormalVector(result) {
|
|
@@ -194517,17 +194551,18 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
194517
194551
|
return plane.vectorU.crossProduct(plane.vectorV, result);
|
|
194518
194552
|
}
|
|
194519
194553
|
/**
|
|
194520
|
-
* Read property for (clone of)
|
|
194521
|
-
* *
|
|
194554
|
+
* Read property for (clone of) the z-column of the arc matrix.
|
|
194555
|
+
* * This vector is nominally the normalized cross product: `vector0 x vector90`.
|
|
194556
|
+
* * To compute a vector with respect to which the arc sweep is counterclockwise, use [[binormalVector]].
|
|
194522
194557
|
*/
|
|
194523
194558
|
get perpendicularVector() {
|
|
194524
194559
|
return this._matrix.columnZ();
|
|
194525
194560
|
}
|
|
194526
|
-
/**
|
|
194561
|
+
/** Return a clone of the arc matrix. */
|
|
194527
194562
|
matrixClone() {
|
|
194528
194563
|
return this._matrix.clone();
|
|
194529
194564
|
}
|
|
194530
|
-
/** Read property for (reference to)
|
|
194565
|
+
/** Read property for (reference to) the arc matrix. */
|
|
194531
194566
|
get matrixRef() {
|
|
194532
194567
|
return this._matrix;
|
|
194533
194568
|
}
|
|
@@ -194542,17 +194577,14 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
194542
194577
|
get isExtensibleFractionSpace() {
|
|
194543
194578
|
return true;
|
|
194544
194579
|
}
|
|
194545
|
-
|
|
194580
|
+
/** Constructor. Captures the inputs. */
|
|
194546
194581
|
constructor(center, matrix, sweep) {
|
|
194547
194582
|
super();
|
|
194548
194583
|
this._center = center;
|
|
194549
194584
|
this._matrix = matrix;
|
|
194550
194585
|
this._sweep = sweep.clampToFullCircle(sweep);
|
|
194551
194586
|
}
|
|
194552
|
-
/**
|
|
194553
|
-
* Return a clone of the arc, with transform applied.
|
|
194554
|
-
* @param transform
|
|
194555
|
-
*/
|
|
194587
|
+
/** Return a clone of the arc, with transform applied. */
|
|
194556
194588
|
cloneTransformed(transform) {
|
|
194557
194589
|
const c = this.clone();
|
|
194558
194590
|
c.tryTransformInPlace(transform);
|
|
@@ -194561,7 +194593,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
194561
194593
|
/**
|
|
194562
194594
|
* Redefine the arc with (captured references to) given data.
|
|
194563
194595
|
* @param center arc center.
|
|
194564
|
-
* @param matrix matrix with columns vector0,
|
|
194596
|
+
* @param matrix matrix with columns vector0, vector90, and their unit cross product.
|
|
194565
194597
|
* @param sweep angle sweep.
|
|
194566
194598
|
*/
|
|
194567
194599
|
setRefs(center, matrix, sweep) {
|
|
@@ -194572,7 +194604,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
194572
194604
|
/**
|
|
194573
194605
|
* Redefine the arc with (clones of) given data.
|
|
194574
194606
|
* @param center arc center.
|
|
194575
|
-
* @param matrix matrix with columns vector0,
|
|
194607
|
+
* @param matrix matrix with columns vector0, vector90, and their unit cross product.
|
|
194576
194608
|
* @param sweep angle sweep.
|
|
194577
194609
|
*/
|
|
194578
194610
|
set(center, matrix, sweep) {
|
|
@@ -194591,7 +194623,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
194591
194623
|
/**
|
|
194592
194624
|
* Create an arc, capturing references to center, matrix and sweep.
|
|
194593
194625
|
* @param center center point.
|
|
194594
|
-
* @param matrix matrix with columns vector0, vector90, and unit cross product.
|
|
194626
|
+
* @param matrix matrix with columns vector0, vector90, and their unit cross product.
|
|
194595
194627
|
* @param sweep sweep limits.
|
|
194596
194628
|
* @param result optional preallocated result.
|
|
194597
194629
|
*/
|
|
@@ -194605,9 +194637,10 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
194605
194637
|
/**
|
|
194606
194638
|
* Create an arc from center, x column to be scaled, and y column to be scaled.
|
|
194607
194639
|
* @param center center of ellipse.
|
|
194608
|
-
* @param matrix
|
|
194609
|
-
*
|
|
194610
|
-
* @param
|
|
194640
|
+
* @param matrix the x-column and y-column of this matrix are scaled by `radius0` and `radius90` to define the
|
|
194641
|
+
* arc's `vector0` and `vector90`.
|
|
194642
|
+
* @param radius0 radius along `vector0`.
|
|
194643
|
+
* @param radius90 radius along `vector90`.
|
|
194611
194644
|
* @param sweep sweep limits.
|
|
194612
194645
|
* @param result optional preallocated result.
|
|
194613
194646
|
*/
|
|
@@ -194617,10 +194650,10 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
194617
194650
|
return Arc3d.create(center, vector0.scale(radius0, vector0), vector90.scale(radius90, vector90), sweep, result);
|
|
194618
194651
|
}
|
|
194619
194652
|
/**
|
|
194620
|
-
* Create a
|
|
194621
|
-
* @param center center of
|
|
194653
|
+
* Create a full circle from center, normal and radius.
|
|
194654
|
+
* @param center center of circle. If undefined, use 000.
|
|
194622
194655
|
* @param normal normal vector.
|
|
194623
|
-
* @param radius radius
|
|
194656
|
+
* @param radius radius of the circle.
|
|
194624
194657
|
* @param result optional preallocated result.
|
|
194625
194658
|
*/
|
|
194626
194659
|
static createCenterNormalRadius(center, normal, radius, result) {
|
|
@@ -194628,7 +194661,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
194628
194661
|
return Arc3d.createScaledXYColumns(center, frame, radius, radius, undefined, result);
|
|
194629
194662
|
}
|
|
194630
194663
|
/**
|
|
194631
|
-
* Create an arc by center with vectors to points at 0 and 90 degrees in parameter space.
|
|
194664
|
+
* Create an elliptical arc by center with vectors to points at 0 and 90 degrees in parameter space.
|
|
194632
194665
|
* @param center arc center.
|
|
194633
194666
|
* @param vector0 vector to 0 degrees (commonly major axis).
|
|
194634
194667
|
* @param vector90 vector to 90 degree point (commonly minor axis).
|
|
@@ -194945,10 +194978,13 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
194945
194978
|
curveLength() {
|
|
194946
194979
|
return this.curveLengthBetweenFractions(0, 1);
|
|
194947
194980
|
}
|
|
194948
|
-
|
|
194949
|
-
|
|
194950
|
-
|
|
194981
|
+
/**
|
|
194982
|
+
* Gauss point quadrature count for evaluating curve length. (The number of intervals is adjusted to the arc sweep).
|
|
194983
|
+
* @deprecated in 5.0. Use correct spelling quadratureGaussCount.
|
|
194984
|
+
*/
|
|
194951
194985
|
static quadratureGuassCount = 5;
|
|
194986
|
+
/** Gauss point quadrature count for evaluating curve length. (The number of intervals is adjusted to the arc sweep). */
|
|
194987
|
+
static quadratureGaussCount = 5;
|
|
194952
194988
|
/** In quadrature for arc length, use this interval (divided by quickEccentricity). */
|
|
194953
194989
|
static quadratureIntervalAngleDegrees = 10.0;
|
|
194954
194990
|
/**
|
|
@@ -194975,7 +195011,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
194975
195011
|
numInterval = 400;
|
|
194976
195012
|
if (numInterval < 1)
|
|
194977
195013
|
numInterval = 1;
|
|
194978
|
-
return super.curveLengthWithFixedIntervalCountQuadrature(f0, f1, numInterval, Arc3d.
|
|
195014
|
+
return super.curveLengthWithFixedIntervalCountQuadrature(f0, f1, numInterval, Arc3d.quadratureGaussCount);
|
|
194979
195015
|
}
|
|
194980
195016
|
/**
|
|
194981
195017
|
* Return an approximate (but easy to compute) arc length.
|
|
@@ -196953,6 +196989,20 @@ class CurveCollection extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geomet
|
|
|
196953
196989
|
projectedParameterRange(ray, lowHigh) {
|
|
196954
196990
|
return _internalContexts_PlaneAltitudeRangeContext__WEBPACK_IMPORTED_MODULE_9__.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
|
|
196955
196991
|
}
|
|
196992
|
+
/** Return the immediate parent of the input curve in the instance, or undefined if it is not a descendant. */
|
|
196993
|
+
findParentOfDescendant(descendant) {
|
|
196994
|
+
for (const child of this.children) {
|
|
196995
|
+
if (child === descendant)
|
|
196996
|
+
return this;
|
|
196997
|
+
if (child instanceof CurveCollection) {
|
|
196998
|
+
const parent = child.findParentOfDescendant(descendant);
|
|
196999
|
+
if (parent)
|
|
197000
|
+
return parent;
|
|
197001
|
+
}
|
|
197002
|
+
}
|
|
197003
|
+
return undefined;
|
|
197004
|
+
}
|
|
197005
|
+
;
|
|
196956
197006
|
}
|
|
196957
197007
|
/**
|
|
196958
197008
|
* Shared base class for use by both open and closed paths.
|
|
@@ -199957,6 +200007,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
199957
200007
|
|
|
199958
200008
|
|
|
199959
200009
|
|
|
200010
|
+
// cspell:words CCWXY
|
|
199960
200011
|
/**
|
|
199961
200012
|
* A LineSegment3d is:
|
|
199962
200013
|
* * A 3d line segment represented by its start and end coordinates
|
|
@@ -202930,11 +202981,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
202930
202981
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
202931
202982
|
/* harmony export */ ConsolidateAdjacentCurvePrimitivesContext: () => (/* binding */ ConsolidateAdjacentCurvePrimitivesContext)
|
|
202932
202983
|
/* harmony export */ });
|
|
202984
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
202933
202985
|
/* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
|
|
202934
|
-
/* harmony import */ var
|
|
202986
|
+
/* harmony import */ var _geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../geometry3d/PolylineCompressionByEdgeOffset */ "../../core/geometry/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js");
|
|
202935
202987
|
/* harmony import */ var _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../geometry3d/PolylineOps */ "../../core/geometry/lib/esm/geometry3d/PolylineOps.js");
|
|
202936
|
-
/* harmony import */ var
|
|
202937
|
-
/* harmony import */ var
|
|
202988
|
+
/* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
202989
|
+
/* harmony import */ var _CurveFactory__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../CurveFactory */ "../../core/geometry/lib/esm/curve/CurveFactory.js");
|
|
202938
202990
|
/* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
202939
202991
|
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
202940
202992
|
/* harmony import */ var _RegionOps__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
|
|
@@ -202953,6 +203005,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
202953
203005
|
|
|
202954
203006
|
|
|
202955
203007
|
|
|
203008
|
+
|
|
202956
203009
|
/**
|
|
202957
203010
|
* * Implementation class for ConsolidateAdjacentCurvePrimitives.
|
|
202958
203011
|
*
|
|
@@ -202994,12 +203047,19 @@ class ConsolidateAdjacentCurvePrimitivesContext extends _geometry3d_GeometryHand
|
|
|
202994
203047
|
break;
|
|
202995
203048
|
}
|
|
202996
203049
|
}
|
|
202997
|
-
if (points.length
|
|
203050
|
+
if (points.length <= 1) {
|
|
203051
|
+
g.children[numAccept++] = basePrimitive;
|
|
203052
|
+
}
|
|
203053
|
+
else if (this._options.disableLinearCompression) {
|
|
203054
|
+
const pointsDeduped = _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_4__.PolylineOps.compressShortEdges(points, _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.smallFloatingPoint); // remove only exact duplicate interior points
|
|
203055
|
+
g.children[numAccept++] = _LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d.createPoints(pointsDeduped);
|
|
203056
|
+
}
|
|
203057
|
+
else { // compress points
|
|
202998
203058
|
const compressedPointsA = _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_4__.PolylineOps.compressShortEdges(points, this._options.duplicatePointTolerance);
|
|
202999
203059
|
const compressedPointsB = _geometry3d_PolylineOps__WEBPACK_IMPORTED_MODULE_4__.PolylineOps.compressByPerpendicularDistance(compressedPointsA, this._options.colinearPointTolerance);
|
|
203000
203060
|
if (i0 === 0 && i1 === numOriginal) {
|
|
203001
203061
|
// points is the entire curve, and the curve is closed. Maybe the first and last segments are colinear.
|
|
203002
|
-
|
|
203062
|
+
_geometry3d_PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_6__.PolylineCompressionContext.compressColinearWrapInPlace(compressedPointsB, this._options.duplicatePointTolerance, this._options.colinearPointTolerance);
|
|
203003
203063
|
}
|
|
203004
203064
|
if (compressedPointsB.length < 2) {
|
|
203005
203065
|
// Collapsed to a point? Make a single point linestring
|
|
@@ -203012,19 +203072,16 @@ class ConsolidateAdjacentCurvePrimitivesContext extends _geometry3d_GeometryHand
|
|
|
203012
203072
|
g.children[numAccept++] = _LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d.createPoints(compressedPointsB);
|
|
203013
203073
|
}
|
|
203014
203074
|
}
|
|
203015
|
-
else {
|
|
203016
|
-
g.children[numAccept++] = basePrimitive;
|
|
203017
|
-
}
|
|
203018
203075
|
i0 = i1;
|
|
203019
203076
|
}
|
|
203020
|
-
else if (this._options.consolidateCompatibleArcs && basePrimitive instanceof
|
|
203077
|
+
else if (this._options.consolidateCompatibleArcs && basePrimitive instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_7__.Arc3d) {
|
|
203021
203078
|
// subsume subsequent arcs into basePrimitive.
|
|
203022
203079
|
// always accept base primitive.
|
|
203023
203080
|
for (; ++i0 < g.children.length;) {
|
|
203024
203081
|
const nextPrimitive = g.children[i0];
|
|
203025
|
-
if (!(nextPrimitive instanceof
|
|
203082
|
+
if (!(nextPrimitive instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_7__.Arc3d))
|
|
203026
203083
|
break;
|
|
203027
|
-
if (!
|
|
203084
|
+
if (!_CurveFactory__WEBPACK_IMPORTED_MODULE_8__.CurveFactory.appendToArcInPlace(basePrimitive, nextPrimitive)) // TODO: use this._options.duplicatePointTolerance
|
|
203028
203085
|
break;
|
|
203029
203086
|
}
|
|
203030
203087
|
// i0 has already advanced
|
|
@@ -203527,13 +203584,18 @@ class MapCurvePrimitiveToCurveLocationDetailPairArray {
|
|
|
203527
203584
|
if (primitiveB)
|
|
203528
203585
|
this.insertPrimitiveToPair(primitiveB, pair);
|
|
203529
203586
|
}
|
|
203530
|
-
/**
|
|
203587
|
+
/**
|
|
203588
|
+
* Split closed missing primitives in half and add new intersection pairs.
|
|
203589
|
+
* * When bridge edges aren't included in the primitives array, a closed primitive with no intersections will not be
|
|
203590
|
+
* added to the graph because it isn't in the `primitiveToPair` map. By splitting such a missing primitive in two, we
|
|
203591
|
+
* introduce two intersections for each half, which allows the primitive to be represented in the map.
|
|
203592
|
+
*/
|
|
203531
203593
|
splitAndAppendMissingClosedPrimitives(primitives, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
203532
203594
|
for (const p of primitives) {
|
|
203533
203595
|
let closedCurveSplitCandidate = false;
|
|
203534
203596
|
if (p instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_1__.Arc3d)
|
|
203535
203597
|
closedCurveSplitCandidate = p.sweep.isFullCircle;
|
|
203536
|
-
else if (!(p instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d) && !(p instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d))
|
|
203598
|
+
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.
|
|
203537
203599
|
closedCurveSplitCandidate = p.startPoint().isAlmostEqualXY(p.endPoint(), tolerance);
|
|
203538
203600
|
if (closedCurveSplitCandidate && !this.primitiveToPair.has(p)) {
|
|
203539
203601
|
const p0 = p.clonePartialCurve(0.0, 0.5);
|
|
@@ -204489,7 +204551,7 @@ class RegionMomentsXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
204489
204551
|
handleUnionRegion(region) {
|
|
204490
204552
|
return this.handleAnyRegion(region);
|
|
204491
204553
|
}
|
|
204492
|
-
_strokeOptions;
|
|
204554
|
+
_strokeOptions; // TODO: expose to callers in RegionOps
|
|
204493
204555
|
getStrokeOptions() {
|
|
204494
204556
|
if (this._strokeOptions)
|
|
204495
204557
|
return this._strokeOptions;
|
|
@@ -204638,13 +204700,14 @@ var RegionBinaryOpType;
|
|
|
204638
204700
|
})(RegionBinaryOpType || (RegionBinaryOpType = {}));
|
|
204639
204701
|
/**
|
|
204640
204702
|
* Class `RegionOps` has static members for calculations on regions (areas).
|
|
204641
|
-
* * Regions are represented by these
|
|
204642
|
-
* *
|
|
204643
|
-
* *
|
|
204644
|
-
* The common "One outer loop and many
|
|
204645
|
-
* *
|
|
204646
|
-
* *
|
|
204647
|
-
* been rotated parallel to the xy-plane.
|
|
204703
|
+
* * Regions are represented by these [[CurveCollection]] subclasses:
|
|
204704
|
+
* * [[Loop]] -- a single loop
|
|
204705
|
+
* * [[ParityRegion]] -- a collection of loops, interpreted by parity rules.
|
|
204706
|
+
* The common "One outer loop and many inner loops" is a parity region.
|
|
204707
|
+
* * [[UnionRegion]] -- a collection of `Loop` and `ParityRegion` objects understood as a (probably disjoint) union.
|
|
204708
|
+
* * Most of the methods in this class:
|
|
204709
|
+
* * Ignore z-coordinates, so callers should ensure that input geometry has been rotated parallel to the xy-plane.
|
|
204710
|
+
* * Assume consistent Loop orientation: "solid" Loops are counterclockwise; "hole" Loops are clockwise.
|
|
204648
204711
|
* @public
|
|
204649
204712
|
*/
|
|
204650
204713
|
class RegionOps {
|
|
@@ -204679,7 +204742,8 @@ class RegionOps {
|
|
|
204679
204742
|
/**
|
|
204680
204743
|
* Return a (signed) xy area for a region.
|
|
204681
204744
|
* * The input region should lie in a plane parallel to the xy-plane, as z-coords will be ignored.
|
|
204682
|
-
* *
|
|
204745
|
+
* * For a non-self-intersecting Loop, the returned area is negative if and only if the Loop is oriented clockwise
|
|
204746
|
+
* with respect to the positive z-axis.
|
|
204683
204747
|
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
204684
204748
|
*/
|
|
204685
204749
|
static computeXYArea(region) {
|
|
@@ -204861,10 +204925,11 @@ class RegionOps {
|
|
|
204861
204925
|
}
|
|
204862
204926
|
/**
|
|
204863
204927
|
* Return areas defined by a boolean operation.
|
|
204864
|
-
*
|
|
204865
|
-
*
|
|
204866
|
-
*
|
|
204867
|
-
* @param
|
|
204928
|
+
* @note For best results, input regions should have correctly oriented loops. See [[sortOuterAndHoleLoopsXY]].
|
|
204929
|
+
* @note A common use case of this method is to convert a region with overlapping children into one with
|
|
204930
|
+
* non-overlapping children: `regionOut = RegionOps.regionBooleanXY(regionIn, undefined, RegionBinaryOpType.Union)`.
|
|
204931
|
+
* @param loopsA first set of loops (treated as a union)
|
|
204932
|
+
* @param loopsB second set of loops (treated as a union)
|
|
204868
204933
|
* @param operation indicates Union, Intersection, Parity, AMinusB, or BMinusA
|
|
204869
204934
|
* @param mergeTolerance absolute distance tolerance for merging loops
|
|
204870
204935
|
* @returns a region resulting from merging input loops and the boolean operation. May contain bridge edges added
|
|
@@ -205182,14 +205247,15 @@ class RegionOps {
|
|
|
205182
205247
|
curves.dispatchToGeometryHandler(context);
|
|
205183
205248
|
}
|
|
205184
205249
|
/**
|
|
205185
|
-
* Reverse and reorder loops in the xy-plane for
|
|
205186
|
-
* @param loops multiple loops in any order and orientation, z-coordinates ignored
|
|
205250
|
+
* Reverse and reorder loops in the xy-plane for consistent orientation and containment.
|
|
205251
|
+
* @param loops multiple loops in any order and orientation, z-coordinates ignored.
|
|
205252
|
+
* * For best results, all overlaps should be containments, i.e., loop boundaries can touch, but should not cross.
|
|
205187
205253
|
* @returns a region that captures the input pointers. This region is a:
|
|
205188
|
-
* *
|
|
205189
|
-
* *
|
|
205254
|
+
* * [[Loop]] if there is exactly one input loop. It is oriented counterclockwise.
|
|
205255
|
+
* * [[ParityRegion]] if input consists of exactly one outer loop with at least one hole loop.
|
|
205190
205256
|
* Its first child is an outer loop oriented counterclockwise; all subsequent children are holes oriented
|
|
205191
205257
|
* clockwise.
|
|
205192
|
-
* *
|
|
205258
|
+
* * [[UnionRegion]] if any other input configuration. Its children are individually ordered/oriented as in
|
|
205193
205259
|
* the above cases.
|
|
205194
205260
|
* @see [[PolygonOps.sortOuterAndHoleLoopsXY]]
|
|
205195
205261
|
*/
|
|
@@ -205209,13 +205275,13 @@ class RegionOps {
|
|
|
205209
205275
|
* Find all xy-areas bounded by the unstructured, possibly intersecting curves.
|
|
205210
205276
|
* * For best results, input curves should be parallel to the xy-plane, as z-coordinates are ignored.
|
|
205211
205277
|
* * A common use case of this method is to assemble the bounding "exterior" loop (or loops) containing the
|
|
205212
|
-
* input curves.
|
|
205278
|
+
* input curves. Note that "holes" implied by inputs are _not_ preserved in output.
|
|
205213
205279
|
* * This method does not add bridge edges to connect outer loops to inner loops. Each disconnected loop,
|
|
205214
205280
|
* regardless of its containment, is returned as its own SignedLoops object. Pre-process with [[regionBooleanXY]]
|
|
205215
205281
|
* to add bridge edges so that [[constructAllXYRegionLoops]] will return outer and inner loops in the same
|
|
205216
205282
|
* SignedLoops object.
|
|
205217
205283
|
* @param curvesAndRegions Any collection of curves. Each Loop/ParityRegion/UnionRegion contributes its curve
|
|
205218
|
-
* primitives.
|
|
205284
|
+
* primitives, stripped of parity context. This means holes are _not_ preserved in output.
|
|
205219
205285
|
* @param tolerance optional distance tolerance for coincidence.
|
|
205220
205286
|
* @returns array of [[SignedLoops]], each entry of which describes the faces in a single connected component:
|
|
205221
205287
|
* * `positiveAreaLoops` contains "interior" loops, _including holes in ParityRegion input_. These loops have
|
|
@@ -205380,12 +205446,10 @@ class RegionOps {
|
|
|
205380
205446
|
}
|
|
205381
205447
|
/**
|
|
205382
205448
|
* Facet the region according to stroke options.
|
|
205449
|
+
* @note For best results, [[UnionRegion]] input should consist of non-overlapping children. See [[regionBooleanXY]].
|
|
205450
|
+
* @note For best results, [[ParityRegion]] input should be correctly oriented. See [[sortOuterAndHoleLoopsXY]].
|
|
205383
205451
|
* @param region a closed xy-planar region, possibly with holes.
|
|
205384
205452
|
* * 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.
|
|
205385
|
-
* * For best results, `UnionRegion` input should consist of non-overlapping children.
|
|
205386
|
-
* Caller can ensure this by passing in `region = RegionOps.regionBooleanXY(unionRegion, undefined, RegionBinaryOpType.Union)`.
|
|
205387
|
-
* * For best results, `ParityRegion` input should be correctly oriented (holes have opposite orientation to their containing loop).
|
|
205388
|
-
* Caller can ensure this for non-intersecting loops by passing in `region = RegionOps.sortOuterAndHoleLoopsXY(loops)`.
|
|
205389
205453
|
* @param options primarily how to stroke the region boundary, but also how to facet the region interior.
|
|
205390
205454
|
* * By default, a triangulation is returned, but if `options.maximizeConvexFacets === true`, edges between coplanar triangles are removed to return maximally convex facets.
|
|
205391
205455
|
* @returns facets for the region, or undefined if facetting failed
|
|
@@ -205448,17 +205512,19 @@ function pushToInOnOutArrays(curve, select, arrayNegative, array0, arrayPositive
|
|
|
205448
205512
|
array0.push(curve);
|
|
205449
205513
|
}
|
|
205450
205514
|
/**
|
|
205451
|
-
* * Options to control method `RegionOps.consolidateAdjacentPrimitives
|
|
205515
|
+
* * Options to control method `RegionOps.consolidateAdjacentPrimitives`.
|
|
205452
205516
|
* @public
|
|
205453
205517
|
*/
|
|
205454
205518
|
class ConsolidateAdjacentCurvePrimitivesOptions {
|
|
205455
|
-
/** True to consolidate adjacent linear geometry into a single LineString3d */
|
|
205519
|
+
/** True to consolidate adjacent linear geometry into a single LineString3d. */
|
|
205456
205520
|
consolidateLinearGeometry = true;
|
|
205457
|
-
/** True to consolidate contiguous compatible arcs into a single Arc3d */
|
|
205521
|
+
/** True to consolidate contiguous compatible arcs into a single Arc3d. */
|
|
205458
205522
|
consolidateCompatibleArcs = true;
|
|
205459
|
-
/**
|
|
205523
|
+
/** Disable LineSegment3d and LineString3d point compression. */
|
|
205524
|
+
disableLinearCompression = false;
|
|
205525
|
+
/** Tolerance for collapsing identical points (if `!disableLinearCompression`). */
|
|
205460
205526
|
duplicatePointTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance;
|
|
205461
|
-
/** Tolerance for removing interior colinear points. */
|
|
205527
|
+
/** Tolerance for removing interior colinear points (if `!disableLinearCompression`). */
|
|
205462
205528
|
colinearPointTolerance = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance;
|
|
205463
205529
|
}
|
|
205464
205530
|
|
|
@@ -216131,17 +216197,20 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
216131
216197
|
/**
|
|
216132
216198
|
* An `AngleSweep` is a pair of angles at start and end of an interval.
|
|
216133
216199
|
*
|
|
216134
|
-
* *
|
|
216135
|
-
* by theta = start + f*(end-start)
|
|
216136
|
-
* *
|
|
216137
|
-
* *
|
|
216138
|
-
* *
|
|
216139
|
-
* *
|
|
216140
|
-
*
|
|
216141
|
-
*
|
|
216142
|
-
*
|
|
216143
|
-
*
|
|
216144
|
-
*
|
|
216200
|
+
* * For stroking purposes, the "included interval" is all angles numerically reached
|
|
216201
|
+
* by `theta = start + f * (end - start)`, where `0 <= f <= 1`.
|
|
216202
|
+
* * This stroking formula is simple numbers -- 2PI shifts are not involved.
|
|
216203
|
+
* * 2PI shifts do become important in the reverse mapping of an angle to a fraction.
|
|
216204
|
+
* * Angles greater than 360 and less than 0 are fine as endpoints.
|
|
216205
|
+
* * An AngleSweep determines orientation only _in concert with a reference vector_, e.g., a plane normal like (0,0,1).
|
|
216206
|
+
* * Be careful reading orientation from an AngleSweep without a reference vector!
|
|
216207
|
+
* * If "start < end" the angles in the sweep proceed counterclockwise around the reference vector.
|
|
216208
|
+
* * If "start > end" the angles in the sweep proceed clockwise around the reference vector.
|
|
216209
|
+
* * (350,370) covers the same angles as (-10,10), and both sweeps are counterclockwise around the reference vector.
|
|
216210
|
+
* * (370,350) covers the same angles as (10,-10), and both sweeps are clockwise around the reference vector.
|
|
216211
|
+
* * (370,350) covers the same angles as (-10,10), but the sweeps have opposite orientation.
|
|
216212
|
+
* * Math details can be found at docs/learning/geometry/Angle.md .
|
|
216213
|
+
* * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/AngleSweep .
|
|
216145
216214
|
* @public
|
|
216146
216215
|
*/
|
|
216147
216216
|
class AngleSweep {
|
|
@@ -221767,8 +221836,12 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
221767
221836
|
}
|
|
221768
221837
|
}
|
|
221769
221838
|
/** get range of points. */
|
|
221770
|
-
getRange(transform) {
|
|
221771
|
-
|
|
221839
|
+
getRange(transform, result) {
|
|
221840
|
+
let range = result;
|
|
221841
|
+
if (range)
|
|
221842
|
+
range.setNull();
|
|
221843
|
+
else
|
|
221844
|
+
range = _Range__WEBPACK_IMPORTED_MODULE_5__.Range3d.createNull();
|
|
221772
221845
|
this.extendRange(range, transform);
|
|
221773
221846
|
return range;
|
|
221774
221847
|
}
|
|
@@ -222121,6 +222194,20 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
|
|
|
222121
222194
|
this._data[i + componentIndex] = q;
|
|
222122
222195
|
}
|
|
222123
222196
|
}
|
|
222197
|
+
/**
|
|
222198
|
+
* Pass the (x,y,z) of each point to a function which returns a replacement for the point.
|
|
222199
|
+
* * @param func function to be called as `func(x,y,z)`, returning a replacement point.
|
|
222200
|
+
*/
|
|
222201
|
+
mapPoint(func) {
|
|
222202
|
+
const n = this._data.length;
|
|
222203
|
+
let q;
|
|
222204
|
+
for (let i = 0; i + 2 < n; i += 3) {
|
|
222205
|
+
q = func(this._data[i], this._data[i + 1], this._data[i + 2]);
|
|
222206
|
+
this._data[i] = q.x;
|
|
222207
|
+
this._data[i + 1] = q.y;
|
|
222208
|
+
this._data[i + 2] = q.z;
|
|
222209
|
+
}
|
|
222210
|
+
}
|
|
222124
222211
|
}
|
|
222125
222212
|
|
|
222126
222213
|
|
|
@@ -222456,13 +222543,17 @@ class IndexedXYZCollection {
|
|
|
222456
222543
|
return (i % this.length);
|
|
222457
222544
|
}
|
|
222458
222545
|
/** Return the range of the points. */
|
|
222459
|
-
getRange() {
|
|
222460
|
-
|
|
222546
|
+
getRange(transform, result) {
|
|
222547
|
+
let range = result;
|
|
222548
|
+
if (range)
|
|
222549
|
+
range.setNull();
|
|
222550
|
+
else
|
|
222551
|
+
range = _Range__WEBPACK_IMPORTED_MODULE_2__.Range3d.createNull();
|
|
222461
222552
|
const n = this.length;
|
|
222462
222553
|
const point = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
222463
222554
|
for (let i = 0; i < n; i++) {
|
|
222464
222555
|
this.getPoint3dAtUncheckedPointIndex(i, point);
|
|
222465
|
-
range.extendPoint(point);
|
|
222556
|
+
range.extendPoint(point, transform);
|
|
222466
222557
|
}
|
|
222467
222558
|
return range;
|
|
222468
222559
|
}
|
|
@@ -225937,7 +226028,12 @@ class Plane3d {
|
|
|
225937
226028
|
* * Classes with a purely implicit equation of their plane can accept the default implementation
|
|
225938
226029
|
*/
|
|
225939
226030
|
getAnyPointOnPlane(result) {
|
|
225940
|
-
return this.
|
|
226031
|
+
return this.projectXYZToPlane(0, 0, 0, result);
|
|
226032
|
+
}
|
|
226033
|
+
/** Return the projection of (x,y,z) onto the plane. */
|
|
226034
|
+
projectXYZToPlane(x, y, z, result) {
|
|
226035
|
+
const point = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(x, y, z, result);
|
|
226036
|
+
return this.projectPointToPlane(point, point);
|
|
225941
226037
|
}
|
|
225942
226038
|
}
|
|
225943
226039
|
|
|
@@ -226282,7 +226378,12 @@ class Plane3dByOriginAndUnitNormal extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__
|
|
|
226282
226378
|
}
|
|
226283
226379
|
/** Return the projection of spacePoint onto the plane. */
|
|
226284
226380
|
projectPointToPlane(spacePoint, result) {
|
|
226285
|
-
return
|
|
226381
|
+
return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);
|
|
226382
|
+
}
|
|
226383
|
+
/** Return the projection of (x,y,z) onto the plane. */
|
|
226384
|
+
projectXYZToPlane(x, y, z, result) {
|
|
226385
|
+
const scale = -this._normal.dotProductStartEndXYZ(this._origin, x, y, z);
|
|
226386
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(x + scale * this._normal.x, y + scale * this._normal.y, z + scale * this._normal.z, result);
|
|
226286
226387
|
}
|
|
226287
226388
|
/**
|
|
226288
226389
|
* Returns true if spacePoint is within distance tolerance of the plane.
|
|
@@ -226665,30 +226766,38 @@ class Plane3dByOriginAndVectors extends _Plane3d__WEBPACK_IMPORTED_MODULE_0__.Pl
|
|
|
226665
226766
|
}
|
|
226666
226767
|
/**
|
|
226667
226768
|
* Return the projection of spacePoint onto the plane.
|
|
226668
|
-
* If the plane is degenerate to a ray, project to the ray.
|
|
226669
|
-
* If the plane is degenerate to its origin, return the point
|
|
226769
|
+
* * If the plane is degenerate to a ray, project to the ray.
|
|
226770
|
+
* * If the plane is degenerate to its origin, return the point.
|
|
226670
226771
|
*/
|
|
226671
226772
|
projectPointToPlane(spacePoint, result) {
|
|
226773
|
+
return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);
|
|
226774
|
+
}
|
|
226775
|
+
/**
|
|
226776
|
+
* Return the projection of (x,y,z) onto the plane.
|
|
226777
|
+
* * If the plane is degenerate to a ray, project to the ray.
|
|
226778
|
+
* * If the plane is degenerate to its origin, return the point.
|
|
226779
|
+
*/
|
|
226780
|
+
projectXYZToPlane(x, y, z, result) {
|
|
226672
226781
|
const unitNormal = this.vectorU.unitCrossProduct(this.vectorV);
|
|
226673
226782
|
if (unitNormal !== undefined) {
|
|
226674
|
-
const
|
|
226675
|
-
return
|
|
226783
|
+
const scale = -unitNormal.dotProductStartEndXYZ(this.origin, x, y, z);
|
|
226784
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x + scale * unitNormal.x, y + scale * unitNormal.y, z + scale * unitNormal.z, result);
|
|
226676
226785
|
}
|
|
226677
|
-
//
|
|
226678
|
-
//
|
|
226786
|
+
// vectorU and vectorV are colinear or zero.
|
|
226787
|
+
// Project to ray defined by the longer one, or just to origin.
|
|
226679
226788
|
const dotUU = this.vectorU.magnitudeSquared();
|
|
226680
226789
|
const dotVV = this.vectorV.magnitudeSquared();
|
|
226681
226790
|
if (dotUU >= dotVV) {
|
|
226682
|
-
const dotUW = this.vectorU.
|
|
226791
|
+
const dotUW = this.vectorU.dotProductStartEndXYZ(this.origin, x, y, z);
|
|
226683
226792
|
const f = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.conditionalDivideCoordinate(dotUW, dotUU, 0.0);
|
|
226684
226793
|
if (f !== undefined)
|
|
226685
|
-
return
|
|
226794
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x + f * this.vectorU.x, y + f * this.vectorU.y, z + f * this.vectorU.z, result);
|
|
226686
226795
|
}
|
|
226687
226796
|
else {
|
|
226688
|
-
const dotVW = this.vectorV.
|
|
226797
|
+
const dotVW = this.vectorV.dotProductStartEndXYZ(this.origin, x, y, z);
|
|
226689
226798
|
const f = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.conditionalDivideCoordinate(dotVW, dotVV, 0.0);
|
|
226690
226799
|
if (f !== undefined)
|
|
226691
|
-
return
|
|
226800
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x + f * this.vectorV.x, y + f * this.vectorV.y, z + f * this.vectorV.z, result);
|
|
226692
226801
|
}
|
|
226693
226802
|
return this.origin.clone(result);
|
|
226694
226803
|
}
|
|
@@ -229140,7 +229249,7 @@ class Vector3d extends XYZ {
|
|
|
229140
229249
|
/**
|
|
229141
229250
|
* Return the (strongly-typed) angle from this vector to vectorB, using only the xy parts.
|
|
229142
229251
|
* * The returned angle is between -180 and 180 degrees.
|
|
229143
|
-
* * Use
|
|
229252
|
+
* * Use [[planarAngleTo]] and [[signedAngleTo]] to return an angle measured in a specific plane.
|
|
229144
229253
|
* @param vectorB target vector.
|
|
229145
229254
|
*/
|
|
229146
229255
|
angleToXY(vectorB) {
|
|
@@ -229153,7 +229262,7 @@ class Vector3d extends XYZ {
|
|
|
229153
229262
|
* * If the cross product of `this` vector and `vectorB` lies on the same side of the plane as `vectorW`,
|
|
229154
229263
|
* this function returns `radiansTo(vectorB)`; otherwise, it returns `-radiansTo(vectorB)`.
|
|
229155
229264
|
* * `vectorW` does not have to be perpendicular to the plane.
|
|
229156
|
-
* * Use
|
|
229265
|
+
* * Use [[planarRadiansTo]] to measure the angle between vectors that are projected to another plane.
|
|
229157
229266
|
* @param vectorB target vector.
|
|
229158
229267
|
* @param vectorW determines the side of the plane in which the returned angle is measured
|
|
229159
229268
|
*/
|
|
@@ -229173,7 +229282,7 @@ class Vector3d extends XYZ {
|
|
|
229173
229282
|
* * If the cross product of this vector and vectorB lies on the same side of the plane as vectorW,
|
|
229174
229283
|
* this function returns `angleTo(vectorB)`; otherwise, it returns `-angleTo(vectorB)`.
|
|
229175
229284
|
* * `vectorW` does not have to be perpendicular to the plane.
|
|
229176
|
-
* * Use
|
|
229285
|
+
* * Use [[planarAngleTo]] to measure the angle between vectors that are projected to another plane.
|
|
229177
229286
|
* @param vectorB target vector.
|
|
229178
229287
|
* @param vectorW determines the side of the plane in which the returned angle is measured
|
|
229179
229288
|
*/
|
|
@@ -229436,9 +229545,9 @@ class NumberArray {
|
|
|
229436
229545
|
return a;
|
|
229437
229546
|
}
|
|
229438
229547
|
/**
|
|
229439
|
-
* Return an array with indicated start and end points, maximum step size
|
|
229440
|
-
* @param low
|
|
229441
|
-
* @param high
|
|
229548
|
+
* Return an array with indicated start and end points, and maximum step size.
|
|
229549
|
+
* @param low first value in returned array
|
|
229550
|
+
* @param high last value in returned array
|
|
229442
229551
|
* @param step max permitted step
|
|
229443
229552
|
*/
|
|
229444
229553
|
static createArrayWithMaxStepSize(low, high, step) {
|
|
@@ -229629,13 +229738,32 @@ class NumberArray {
|
|
|
229629
229738
|
*/
|
|
229630
229739
|
class Point2dArray {
|
|
229631
229740
|
/** Return true if arrays have same length and matching coordinates. */
|
|
229632
|
-
static isAlmostEqual(dataA, dataB) {
|
|
229741
|
+
static isAlmostEqual(dataA, dataB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
229633
229742
|
if (dataA && dataB) {
|
|
229634
|
-
if (dataA
|
|
229635
|
-
|
|
229636
|
-
|
|
229637
|
-
|
|
229743
|
+
if (dataA instanceof Float64Array && dataB instanceof Float64Array) {
|
|
229744
|
+
if (dataA.length !== dataB.length)
|
|
229745
|
+
return false;
|
|
229746
|
+
for (let i = 0; i < dataA.length; i++)
|
|
229747
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(dataA[i], dataB[i], tolerance))
|
|
229748
|
+
return false;
|
|
229749
|
+
}
|
|
229750
|
+
else if (Array.isArray(dataA) && Array.isArray(dataB)) {
|
|
229751
|
+
if (dataA.length !== dataB.length)
|
|
229752
|
+
return false;
|
|
229753
|
+
for (let i = 0; i < dataA.length; i++)
|
|
229754
|
+
if (!dataA[i].isAlmostEqual(dataB[i], tolerance))
|
|
229755
|
+
return false;
|
|
229756
|
+
}
|
|
229757
|
+
else { // different types
|
|
229758
|
+
const points = dataA instanceof Float64Array ? dataB : dataA;
|
|
229759
|
+
const numbers = dataA instanceof Float64Array ? dataA : dataB;
|
|
229760
|
+
if (numbers.length !== points.length * 2)
|
|
229638
229761
|
return false;
|
|
229762
|
+
for (let iPoint = 0; iPoint < points.length; ++iPoint) {
|
|
229763
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].x, numbers[2 * iPoint], tolerance) ||
|
|
229764
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].y, numbers[2 * iPoint + 1], tolerance))
|
|
229765
|
+
return false;
|
|
229766
|
+
}
|
|
229639
229767
|
}
|
|
229640
229768
|
return true;
|
|
229641
229769
|
}
|
|
@@ -229672,13 +229800,34 @@ class Point2dArray {
|
|
|
229672
229800
|
*/
|
|
229673
229801
|
class Vector3dArray {
|
|
229674
229802
|
/** Return true if arrays have same length and matching coordinates. */
|
|
229675
|
-
static isAlmostEqual(dataA, dataB) {
|
|
229803
|
+
static isAlmostEqual(dataA, dataB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
229676
229804
|
if (dataA && dataB) {
|
|
229677
|
-
if (dataA
|
|
229678
|
-
|
|
229679
|
-
for (let i = 0; i < dataA.length; i++)
|
|
229680
|
-
if (!dataA[i].isAlmostEqual(dataB[i]))
|
|
229805
|
+
if (dataA instanceof Float64Array && dataB instanceof Float64Array) {
|
|
229806
|
+
if (dataA.length !== dataB.length)
|
|
229681
229807
|
return false;
|
|
229808
|
+
for (let i = 0; i < dataA.length; i++)
|
|
229809
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(dataA[i], dataB[i], tolerance))
|
|
229810
|
+
return false;
|
|
229811
|
+
}
|
|
229812
|
+
else if (Array.isArray(dataA) && Array.isArray(dataB)) {
|
|
229813
|
+
if (dataA.length !== dataB.length)
|
|
229814
|
+
return false;
|
|
229815
|
+
for (let i = 0; i < dataA.length; i++)
|
|
229816
|
+
if (!dataA[i].isAlmostEqual(dataB[i], tolerance))
|
|
229817
|
+
return false;
|
|
229818
|
+
}
|
|
229819
|
+
else { // different types
|
|
229820
|
+
const points = dataA instanceof Float64Array ? dataB : dataA;
|
|
229821
|
+
const numbers = dataA instanceof Float64Array ? dataA : dataB;
|
|
229822
|
+
if (numbers.length !== points.length * 3)
|
|
229823
|
+
return false;
|
|
229824
|
+
for (let iPoint = 0; iPoint < points.length; ++iPoint) {
|
|
229825
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].x, numbers[3 * iPoint], tolerance) ||
|
|
229826
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].y, numbers[3 * iPoint + 1], tolerance) ||
|
|
229827
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].z, numbers[3 * iPoint + 2], tolerance))
|
|
229828
|
+
return false;
|
|
229829
|
+
}
|
|
229830
|
+
}
|
|
229682
229831
|
return true;
|
|
229683
229832
|
}
|
|
229684
229833
|
return (dataA === undefined && dataB === undefined);
|
|
@@ -229797,20 +229946,20 @@ class Point4dArray {
|
|
|
229797
229946
|
}
|
|
229798
229947
|
}
|
|
229799
229948
|
/** Test arrays for near equality of all corresponding numeric values, treated as coordinates. */
|
|
229800
|
-
static isAlmostEqual(dataA, dataB) {
|
|
229949
|
+
static isAlmostEqual(dataA, dataB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
229801
229950
|
if (dataA && dataB) {
|
|
229802
229951
|
if (dataA instanceof Float64Array && dataB instanceof Float64Array) {
|
|
229803
229952
|
if (dataA.length !== dataB.length)
|
|
229804
229953
|
return false;
|
|
229805
229954
|
for (let i = 0; i < dataA.length; i++)
|
|
229806
|
-
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(dataA[i], dataB[i]))
|
|
229955
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(dataA[i], dataB[i], tolerance))
|
|
229807
229956
|
return false;
|
|
229808
229957
|
}
|
|
229809
229958
|
else if (Array.isArray(dataA) && Array.isArray(dataB)) {
|
|
229810
229959
|
if (dataA.length !== dataB.length)
|
|
229811
229960
|
return false;
|
|
229812
229961
|
for (let i = 0; i < dataA.length; i++)
|
|
229813
|
-
if (!dataA[i].isAlmostEqual(dataB[i]))
|
|
229962
|
+
if (!dataA[i].isAlmostEqual(dataB[i], tolerance))
|
|
229814
229963
|
return false;
|
|
229815
229964
|
}
|
|
229816
229965
|
else { // different types
|
|
@@ -229819,10 +229968,10 @@ class Point4dArray {
|
|
|
229819
229968
|
if (numbers.length !== points.length * 4)
|
|
229820
229969
|
return false;
|
|
229821
229970
|
for (let iPoint = 0; iPoint < points.length; ++iPoint) {
|
|
229822
|
-
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].x, numbers[4 * iPoint]) ||
|
|
229823
|
-
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].y, numbers[4 * iPoint + 1]) ||
|
|
229824
|
-
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].z, numbers[4 * iPoint + 2]) ||
|
|
229825
|
-
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].w, numbers[4 * iPoint + 3]))
|
|
229971
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].x, numbers[4 * iPoint], tolerance) ||
|
|
229972
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].y, numbers[4 * iPoint + 1], tolerance) ||
|
|
229973
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].z, numbers[4 * iPoint + 2], tolerance) ||
|
|
229974
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].w, numbers[4 * iPoint + 3], tolerance))
|
|
229826
229975
|
return false;
|
|
229827
229976
|
}
|
|
229828
229977
|
}
|
|
@@ -230062,20 +230211,20 @@ class Point3dArray {
|
|
|
230062
230211
|
}
|
|
230063
230212
|
}
|
|
230064
230213
|
/** Test arrays for near equality of all corresponding numeric values, treated as coordinates. */
|
|
230065
|
-
static isAlmostEqual(dataA, dataB) {
|
|
230214
|
+
static isAlmostEqual(dataA, dataB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
230066
230215
|
if (dataA && dataB) {
|
|
230067
230216
|
if (dataA instanceof Float64Array && dataB instanceof Float64Array) {
|
|
230068
230217
|
if (dataA.length !== dataB.length)
|
|
230069
230218
|
return false;
|
|
230070
230219
|
for (let i = 0; i < dataA.length; i++)
|
|
230071
|
-
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(dataA[i], dataB[i]))
|
|
230220
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(dataA[i], dataB[i], tolerance))
|
|
230072
230221
|
return false;
|
|
230073
230222
|
}
|
|
230074
230223
|
else if (Array.isArray(dataA) && Array.isArray(dataB)) {
|
|
230075
230224
|
if (dataA.length !== dataB.length)
|
|
230076
230225
|
return false;
|
|
230077
230226
|
for (let i = 0; i < dataA.length; i++)
|
|
230078
|
-
if (!dataA[i].isAlmostEqual(dataB[i]))
|
|
230227
|
+
if (!dataA[i].isAlmostEqual(dataB[i], tolerance))
|
|
230079
230228
|
return false;
|
|
230080
230229
|
}
|
|
230081
230230
|
else { // different types
|
|
@@ -230084,9 +230233,9 @@ class Point3dArray {
|
|
|
230084
230233
|
if (numbers.length !== points.length * 3)
|
|
230085
230234
|
return false;
|
|
230086
230235
|
for (let iPoint = 0; iPoint < points.length; ++iPoint) {
|
|
230087
|
-
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].x, numbers[3 * iPoint]) ||
|
|
230088
|
-
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].y, numbers[3 * iPoint + 1]) ||
|
|
230089
|
-
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].z, numbers[3 * iPoint + 2]))
|
|
230236
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].x, numbers[3 * iPoint], tolerance) ||
|
|
230237
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].y, numbers[3 * iPoint + 1], tolerance) ||
|
|
230238
|
+
!_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(points[iPoint].z, numbers[3 * iPoint + 2], tolerance))
|
|
230090
230239
|
return false;
|
|
230091
230240
|
}
|
|
230092
230241
|
}
|
|
@@ -231388,6 +231537,41 @@ class PolygonOps {
|
|
|
231388
231537
|
}
|
|
231389
231538
|
}
|
|
231390
231539
|
}
|
|
231540
|
+
/**
|
|
231541
|
+
* Compute the signed volume of the truncated prism between a facet and a plane.
|
|
231542
|
+
* * Useful for parallel algorithms.
|
|
231543
|
+
* @param facetPoints input 3D polygon; on return the points are projected onto the plane. Wraparound point is optional.
|
|
231544
|
+
* @param plane infinite plane bounding volume between the facet and (virtual) side facets perpendicular to the plane (unmodified).
|
|
231545
|
+
* @param options optional flags and pre-allocated temporary storage.
|
|
231546
|
+
* @returns computed data for this facet:
|
|
231547
|
+
* * `volume6`: six times the signed volume of the truncated prism between the facet and the plane.
|
|
231548
|
+
* * `area2`: two times the signed area of the facet's projection onto the plane.
|
|
231549
|
+
* * `origin`: origin of the facet used to accumulate area moments.
|
|
231550
|
+
* * `products`: raw accumulated second moment area products of the facet's projection onto the plane.
|
|
231551
|
+
* @see [[PolyfaceQuery.sumVolumeBetweenFacetsAndPlane]]
|
|
231552
|
+
*/
|
|
231553
|
+
static volumeBetweenPolygonAndPlane(facetPoints, plane, options) {
|
|
231554
|
+
let origin;
|
|
231555
|
+
let products;
|
|
231556
|
+
let singleProjectedFacetAreaTimes2 = 0.0;
|
|
231557
|
+
let signedTruncatedPrismVolumeTimes6 = 0.0;
|
|
231558
|
+
const h0 = facetPoints.evaluateUncheckedIndexPlaneAltitude(0, plane);
|
|
231559
|
+
for (let i = 1; i + 1 < facetPoints.length; i++) {
|
|
231560
|
+
const triangleNormal = facetPoints.crossProductIndexIndexIndex(0, i, i + 1, options?.workVector);
|
|
231561
|
+
const hA = facetPoints.evaluateUncheckedIndexPlaneAltitude(i, plane);
|
|
231562
|
+
const hB = facetPoints.evaluateUncheckedIndexPlaneAltitude(i + 1, plane);
|
|
231563
|
+
const signedProjectedTriangleAreaTimes2 = triangleNormal.dotProductXYZ(plane.normalX(), plane.normalY(), plane.normalZ());
|
|
231564
|
+
singleProjectedFacetAreaTimes2 += signedProjectedTriangleAreaTimes2;
|
|
231565
|
+
signedTruncatedPrismVolumeTimes6 += signedProjectedTriangleAreaTimes2 * (h0 + hA + hB);
|
|
231566
|
+
}
|
|
231567
|
+
if (!options?.skipMoments) {
|
|
231568
|
+
origin = facetPoints.getPoint3dAtUncheckedPointIndex(0, options?.workPoint0);
|
|
231569
|
+
products = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_4__.Matrix4d.createZero(options?.workMatrix);
|
|
231570
|
+
facetPoints.mapPoint((x, y, z) => plane.projectXYZToPlane(x, y, z, options?.workPoint1));
|
|
231571
|
+
PolygonOps.addSecondMomentAreaProducts(facetPoints, origin, products);
|
|
231572
|
+
}
|
|
231573
|
+
return { volume6: signedTruncatedPrismVolumeTimes6, area2: singleProjectedFacetAreaTimes2, origin, products };
|
|
231574
|
+
}
|
|
231391
231575
|
/** Test the direction of turn at the vertices of the polygon, ignoring z-coordinates.
|
|
231392
231576
|
* * 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.
|
|
231393
231577
|
* * Beware that a polygon which turns through more than a full turn can cross itself and close, but is not convex.
|
|
@@ -231541,8 +231725,9 @@ class PolygonOps {
|
|
|
231541
231725
|
return numReverse;
|
|
231542
231726
|
}
|
|
231543
231727
|
/**
|
|
231544
|
-
* Reverse and reorder loops in the xy-plane for
|
|
231545
|
-
* @param loops multiple polygons in any order and orientation, z-coordinates ignored
|
|
231728
|
+
* Reverse and reorder loops in the xy-plane for consistent orientation and containment.
|
|
231729
|
+
* @param loops multiple polygons in any order and orientation, z-coordinates ignored.
|
|
231730
|
+
* * For best results, all overlaps should be containments, i.e., loop boundaries can touch, but should not cross.
|
|
231546
231731
|
* @returns array of arrays of polygons that capture the input pointers. In each first level array:
|
|
231547
231732
|
* * The first polygon is an outer loop, oriented counterclockwise.
|
|
231548
231733
|
* * Any subsequent polygons are holes of the outer loop, oriented clockwise.
|
|
@@ -232585,17 +232770,21 @@ class PolylineCompressionContext {
|
|
|
232585
232770
|
context.acceptPointByIndex(indexA);
|
|
232586
232771
|
context.recursiveCompressByChordErrorGo(indexA, indexB);
|
|
232587
232772
|
}
|
|
232588
|
-
/**
|
|
232589
|
-
*
|
|
232773
|
+
/**
|
|
232774
|
+
* Return a simplified subset of given points, omitting a point if very close to its predecessor.
|
|
232775
|
+
* * This is a local search, with a single pass over the data.
|
|
232776
|
+
* * First and last points are always retained.
|
|
232777
|
+
* @param data input points
|
|
232778
|
+
* @param maxEdgeLength length of largest edge to be compressed out
|
|
232590
232779
|
*/
|
|
232591
|
-
static compressInPlaceByShortEdgeLength(data,
|
|
232780
|
+
static compressInPlaceByShortEdgeLength(data, maxEdgeLength) {
|
|
232592
232781
|
const n = data.length;
|
|
232593
232782
|
if (n < 2)
|
|
232594
232783
|
return;
|
|
232595
232784
|
let lastAcceptedIndex = 0;
|
|
232596
232785
|
// back up from final point ..
|
|
232597
232786
|
let indexB = n - 1;
|
|
232598
|
-
while (indexB > 0 && data.distanceIndexIndex(indexB - 1, n - 1)
|
|
232787
|
+
while (indexB > 0 && data.distanceIndexIndex(indexB - 1, n - 1) <= maxEdgeLength)
|
|
232599
232788
|
indexB--;
|
|
232600
232789
|
if (indexB === 0) {
|
|
232601
232790
|
// Theres only one point there.
|
|
@@ -232608,7 +232797,7 @@ class PolylineCompressionContext {
|
|
|
232608
232797
|
let candidateIndex = lastAcceptedIndex + 1;
|
|
232609
232798
|
while (candidateIndex <= indexB) {
|
|
232610
232799
|
const d = data.distanceIndexIndex(lastAcceptedIndex, candidateIndex);
|
|
232611
|
-
if (d
|
|
232800
|
+
if (d > maxEdgeLength) {
|
|
232612
232801
|
data.moveIndexToIndex(candidateIndex, lastAcceptedIndex + 1);
|
|
232613
232802
|
lastAcceptedIndex++;
|
|
232614
232803
|
}
|
|
@@ -232616,10 +232805,13 @@ class PolylineCompressionContext {
|
|
|
232616
232805
|
}
|
|
232617
232806
|
data.length = lastAcceptedIndex + 1;
|
|
232618
232807
|
}
|
|
232619
|
-
/**
|
|
232620
|
-
*
|
|
232808
|
+
/**
|
|
232809
|
+
* Return a simplified subset of given points, omitting the middle of three successive points if the triangle they form is small.
|
|
232810
|
+
* * This is a local search, with a single pass over the data.
|
|
232811
|
+
* @param data input points
|
|
232812
|
+
* @param maxTriangleArea area of largest triangle to compress
|
|
232621
232813
|
*/
|
|
232622
|
-
static compressInPlaceBySmallTriangleArea(data,
|
|
232814
|
+
static compressInPlaceBySmallTriangleArea(data, maxTriangleArea) {
|
|
232623
232815
|
const n = data.length;
|
|
232624
232816
|
if (n < 3)
|
|
232625
232817
|
return;
|
|
@@ -232627,7 +232819,7 @@ class PolylineCompressionContext {
|
|
|
232627
232819
|
const cross = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
232628
232820
|
for (let i1 = 1; i1 + 1 < n; i1++) {
|
|
232629
232821
|
data.crossProductIndexIndexIndex(lastAcceptedIndex, i1, i1 + 1, cross);
|
|
232630
|
-
if (0.5 * cross.magnitude() >
|
|
232822
|
+
if (0.5 * cross.magnitude() > maxTriangleArea) {
|
|
232631
232823
|
data.moveIndexToIndex(i1, ++lastAcceptedIndex);
|
|
232632
232824
|
}
|
|
232633
232825
|
}
|
|
@@ -232768,10 +232960,11 @@ class PolylineOps {
|
|
|
232768
232960
|
return _PolylineCompressionByEdgeOffset__WEBPACK_IMPORTED_MODULE_1__.PolylineCompressionContext.compressPoint3dArrayByChordError(source, chordTolerance);
|
|
232769
232961
|
}
|
|
232770
232962
|
/**
|
|
232771
|
-
* Return a simplified subset of given points, omitting
|
|
232963
|
+
* Return a simplified subset of given points, omitting a point if very close to its predecessor.
|
|
232772
232964
|
* * This is a local search, with a single pass over the data.
|
|
232965
|
+
* * First and last points are always retained.
|
|
232773
232966
|
* @param source input points
|
|
232774
|
-
* @param maxEdgeLength
|
|
232967
|
+
* @param maxEdgeLength length of largest edge to be compressed out
|
|
232775
232968
|
* @see [[GrowableXYZArray.cloneCompressed]]
|
|
232776
232969
|
*/
|
|
232777
232970
|
static compressShortEdges(source, maxEdgeLength) {
|
|
@@ -232780,10 +232973,10 @@ class PolylineOps {
|
|
|
232780
232973
|
return dest.getPoint3dArray();
|
|
232781
232974
|
}
|
|
232782
232975
|
/**
|
|
232783
|
-
* Return a simplified subset of given points, omitting
|
|
232976
|
+
* Return a simplified subset of given points, omitting the middle of three successive points if the triangle they form is small.
|
|
232784
232977
|
* * This is a local search, with a single pass over the data.
|
|
232785
232978
|
* @param source input points
|
|
232786
|
-
* @param
|
|
232979
|
+
* @param maxTriangleArea area of largest triangle to compress
|
|
232787
232980
|
*/
|
|
232788
232981
|
static compressSmallTriangles(source, maxTriangleArea) {
|
|
232789
232982
|
const dest = _GrowableXYZArray__WEBPACK_IMPORTED_MODULE_2__.GrowableXYZArray.create(source);
|
|
@@ -235282,41 +235475,29 @@ class Ray3d {
|
|
|
235282
235475
|
*/
|
|
235283
235476
|
intersectionWithTriangle(vertex0, vertex1, vertex2, distanceTol, parameterTol, result) {
|
|
235284
235477
|
/**
|
|
235285
|
-
*
|
|
235478
|
+
* Let (w,u,v) be the barycentric coordinates of point P wrt the triangle (v0,v1,v2), such that
|
|
235286
235479
|
* P = w*v0 + u*v1 + v*v2 = (1-u-v)*v0 + u*v1 + v*v2 = v0 + u*(v1-v0) + v*(v2-v0)
|
|
235287
235480
|
*
|
|
235288
|
-
* Then if ray intersects triangle at
|
|
235481
|
+
* Then if the ray given by rayOrigin + t*rayVector intersects the triangle at P, we have
|
|
235289
235482
|
* v0 + u*(v1-v0) + v*(v2-v0) = rayOrigin + t*rayVector
|
|
235290
|
-
* or
|
|
235291
|
-
* -t*rayVector + u*(v1-v0) + v*(v2-v0) = rayOrigin - v0
|
|
235292
235483
|
*
|
|
235293
235484
|
* This equation can be reformulated as the following linear system:
|
|
235294
235485
|
*
|
|
235295
235486
|
* [ | | | ] [t] [ | ]
|
|
235296
235487
|
* [-rayVector v1-v0 v2-v0] [u] = [rayOrigin - v0]
|
|
235297
|
-
* [
|
|
235298
|
-
*
|
|
235299
|
-
* Then to find t, u, and v use Cramer's Rule and also the fact that if matrix A = [c1,c2,c3], then
|
|
235300
|
-
* det(A) = c1.(c2 x c3) which leads to
|
|
235301
|
-
*
|
|
235302
|
-
* t = [(rayOrigin - v0).((v1-v0) x (v2-v0))] / [-rayVector.((v1-v0) x (v2-v0))]
|
|
235303
|
-
* u = [-rayVector.((rayOrigin - v0) x (v2-v0))] / [-rayVector.((v1-v0) x (v2-v0))]
|
|
235304
|
-
* v = [-rayVector.((v1-v0) x (rayOrigin - v0))] / [-rayVector.((v1-v0) x (v2-v0))]
|
|
235488
|
+
* [ | | | ] [v] [ | ]
|
|
235305
235489
|
*
|
|
235306
|
-
*
|
|
235307
|
-
*
|
|
235490
|
+
* Then to find t, u, and v, use Cramer's Rule, the formulation of matrix determinant as column triple product,
|
|
235491
|
+
* and the fact that swapping any 2 vectors in the triple product negates it:
|
|
235308
235492
|
*
|
|
235309
|
-
*
|
|
235310
|
-
*
|
|
235311
|
-
*
|
|
235312
|
-
* v = [-rayVector.((rayOrigin - v0) x (v1-v0))] / [(v1-v0).(rayVector x (v2-v0))]
|
|
235493
|
+
* t = (v2-v0).(rayOrigin - v0) x (v1-v0) / (v1-v0).rayVector x (v2-v0)
|
|
235494
|
+
* u = (rayOrigin - v0).rayVector x (v2-v0) / (v1-v0).rayVector x (v2-v0)
|
|
235495
|
+
* v = -rayVector.(rayOrigin - v0) x (v1-v0) / (v1-v0).rayVector x (v2-v0)
|
|
235313
235496
|
*
|
|
235314
|
-
* Note that we
|
|
235315
|
-
*
|
|
235316
|
-
* 0 <= w <= 1.
|
|
235497
|
+
* 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:
|
|
235498
|
+
* these 4 checks guarantee that v <= 1 and 0 <= u+v, and so with w = 1-(u+v), we have 0 <= w <= 1.
|
|
235317
235499
|
*
|
|
235318
|
-
* More info be found at
|
|
235319
|
-
* https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm
|
|
235500
|
+
* More info be found at https://en.wikipedia.org/wiki/Moller-Trumbore_intersection_algorithm.
|
|
235320
235501
|
*/
|
|
235321
235502
|
if (distanceTol === undefined || distanceTol < 0) // we explicitly allow zero tolerance
|
|
235322
235503
|
distanceTol = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance;
|
|
@@ -236359,27 +236540,46 @@ class Transform {
|
|
|
236359
236540
|
return result;
|
|
236360
236541
|
}
|
|
236361
236542
|
/**
|
|
236362
|
-
* Create a Transform
|
|
236363
|
-
* @
|
|
236543
|
+
* Create a Transform with given origin and a rigid matrix constructed from two column vectors.
|
|
236544
|
+
* @param origin origin of the local coordinate system. Default is the global origin (zero).
|
|
236545
|
+
* @param vectorX first axis passed into `Matrix3d.createRigidFromColumns`.
|
|
236546
|
+
* @param vectorY second axis passed into `Matrix3d.createRigidFromColumns`.
|
|
236547
|
+
* @param axisOrder order of axis construction in `Matrix3d.createRigidFromColumns(vectorX, vectorY, axisOrder)`.
|
|
236548
|
+
* @param result optional pre-allocated result to populate and return.
|
|
236549
|
+
* @returns localToWorld transform for a local coordinate system with given origin and ordered axes, or `undefined`
|
|
236550
|
+
* if the rigid matrix could not be created.
|
|
236551
|
+
* @see [[Matrix3d.createRigidFromColumns]]
|
|
236364
236552
|
*/
|
|
236365
236553
|
static createRigidFromOriginAndColumns(origin, vectorX, vectorY, axisOrder, result) {
|
|
236366
|
-
const matrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidFromColumns(vectorX, vectorY, axisOrder, result
|
|
236554
|
+
const matrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidFromColumns(vectorX, vectorY, axisOrder, result?._matrix);
|
|
236367
236555
|
if (!matrix)
|
|
236368
236556
|
return undefined;
|
|
236369
236557
|
if (result) {
|
|
236370
|
-
// result._matrix was already modified to become rigid via createRigidFromColumns
|
|
236371
236558
|
result._origin.setFrom(origin);
|
|
236372
236559
|
return result;
|
|
236373
236560
|
}
|
|
236374
|
-
|
|
236375
|
-
|
|
236376
|
-
|
|
236377
|
-
|
|
236378
|
-
|
|
236379
|
-
|
|
236380
|
-
|
|
236381
|
-
|
|
236382
|
-
|
|
236561
|
+
return Transform.createRefs(origin?.cloneAsPoint3d(), matrix);
|
|
236562
|
+
}
|
|
236563
|
+
/**
|
|
236564
|
+
* Create a Transform with given origin and a rigid matrix constructed from one column vector.
|
|
236565
|
+
* @param origin origin of the local coordinate system. Default is the global origin (zero).
|
|
236566
|
+
* @param vector direction of the axis of the local coordinate system indicated by the first letter of `axisOrder`.
|
|
236567
|
+
* @param axisOrder order of axis construction in `Matrix3d.createRigidHeadsUp(vector, axisOrder)`. Default value
|
|
236568
|
+
* is `AxisOrder.ZXY`, which means the z-column of the returned Transform is in the direction of `vector`.
|
|
236569
|
+
* @param result optional pre-allocated result to populate and return.
|
|
236570
|
+
* @returns localToWorld transform for a local coordinate system with given origin and axis, or `undefined`
|
|
236571
|
+
* if the rigid matrix could not be created.
|
|
236572
|
+
* @see [[Matrix3d.createRigidHeadsUp]]
|
|
236573
|
+
*/
|
|
236574
|
+
static createRigidFromOriginAndVector(origin, vector, axisOrder = _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.ZXY, result) {
|
|
236575
|
+
const matrix = _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.createRigidHeadsUp(vector, axisOrder, result?._matrix);
|
|
236576
|
+
if (!matrix)
|
|
236577
|
+
return undefined;
|
|
236578
|
+
if (result) {
|
|
236579
|
+
result._origin.setFrom(origin);
|
|
236580
|
+
return result;
|
|
236581
|
+
}
|
|
236582
|
+
return Transform.createRefs(origin?.cloneAsPoint3d(), matrix);
|
|
236383
236583
|
}
|
|
236384
236584
|
/**
|
|
236385
236585
|
* Create a Transform with the specified `matrix`. Compute an `origin` (different from the given `fixedPoint`)
|
|
@@ -238935,11 +239135,11 @@ class Point4d extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
|
|
|
238935
239135
|
return result;
|
|
238936
239136
|
}
|
|
238937
239137
|
/** Near-equality test, using `Geometry.isSameCoordinate` on all 4 x,y,z,w */
|
|
238938
|
-
isAlmostEqual(other) {
|
|
238939
|
-
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.x, other.x)
|
|
238940
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.y, other.y)
|
|
238941
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.z, other.z)
|
|
238942
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.w, other.w);
|
|
239138
|
+
isAlmostEqual(other, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
239139
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.x, other.x, tolerance)
|
|
239140
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.y, other.y, tolerance)
|
|
239141
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.z, other.z, tolerance)
|
|
239142
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.w, other.w, tolerance);
|
|
238943
239143
|
}
|
|
238944
239144
|
/**
|
|
238945
239145
|
* Test for same coordinate by direct x,y,z,w args
|
|
@@ -238948,11 +239148,11 @@ class Point4d extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
|
|
|
238948
239148
|
* @param z z to test
|
|
238949
239149
|
* @param w w to test
|
|
238950
239150
|
*/
|
|
238951
|
-
isAlmostEqualXYZW(x, y, z, w) {
|
|
238952
|
-
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.x, x)
|
|
238953
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.y, y)
|
|
238954
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.z, z)
|
|
238955
|
-
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.w, w);
|
|
239151
|
+
isAlmostEqualXYZW(x, y, z, w, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance) {
|
|
239152
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.x, x, tolerance)
|
|
239153
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.y, y, tolerance)
|
|
239154
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.z, z, tolerance)
|
|
239155
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(this.w, w, tolerance);
|
|
238956
239156
|
}
|
|
238957
239157
|
/**
|
|
238958
239158
|
* Convert an Angle to a JSON object.
|
|
@@ -239187,13 +239387,17 @@ class Point4d extends _geometry3d_Plane3d__WEBPACK_IMPORTED_MODULE_0__.Plane3d {
|
|
|
239187
239387
|
* * If the xyz part of `this` are all zero, (a clone of) `spacePoint` is returned.
|
|
239188
239388
|
*/
|
|
239189
239389
|
projectPointToPlane(spacePoint, result) {
|
|
239190
|
-
|
|
239390
|
+
return this.projectXYZToPlane(spacePoint.x, spacePoint.y, spacePoint.z, result);
|
|
239391
|
+
}
|
|
239392
|
+
/** Return the projection of (x,y,z) onto the plane. */
|
|
239393
|
+
projectXYZToPlane(x, y, z, result) {
|
|
239394
|
+
const h = this.altitudeXYZ(x, y, z);
|
|
239191
239395
|
const nn = this.magnitudeSquaredXYZ();
|
|
239192
239396
|
// this unusual tol is needed so that toPlane3dByOriginAndUnitNormal agrees with its original implementation
|
|
239193
239397
|
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);
|
|
239194
239398
|
if (alpha === undefined)
|
|
239195
|
-
return
|
|
239196
|
-
return
|
|
239399
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x, y, z, result);
|
|
239400
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(x + alpha * this.x, y + alpha * this.y, z + alpha * this.z, result);
|
|
239197
239401
|
}
|
|
239198
239402
|
/** scale all components (including w!!) */
|
|
239199
239403
|
scale(scale, result) {
|
|
@@ -246443,7 +246647,7 @@ class FacetOrientationFixup {
|
|
|
246443
246647
|
return this._facetOrientation[facetIndex];
|
|
246444
246648
|
}
|
|
246445
246649
|
/**
|
|
246446
|
-
* RETURN FALSE IF ANY EDGE HAS 3
|
|
246650
|
+
* RETURN FALSE IF ANY EDGE HAS 3 OR MORE FACETS
|
|
246447
246651
|
*/
|
|
246448
246652
|
setupUnoriented() {
|
|
246449
246653
|
this._edges.sort();
|
|
@@ -246901,97 +247105,107 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
246901
247105
|
* @module Polyface
|
|
246902
247106
|
*/
|
|
246903
247107
|
/**
|
|
246904
|
-
*
|
|
246905
|
-
* *
|
|
246906
|
-
*
|
|
246907
|
-
*
|
|
246908
|
-
* * [2] is facet index (or another number to associate with this edge).
|
|
247108
|
+
* Represent an [[IndexedPolyface]] edge as:
|
|
247109
|
+
* * vertex start index and vertex end index (CCW order around its facet)
|
|
247110
|
+
* * an additional number to associate with the edge (e.g., facet index)
|
|
247111
|
+
* @public
|
|
246909
247112
|
*/
|
|
246910
|
-
class SortableEdge
|
|
247113
|
+
class SortableEdge {
|
|
247114
|
+
_v;
|
|
247115
|
+
_a;
|
|
247116
|
+
/** Constructor. */
|
|
247117
|
+
constructor(startVertex, endVertex, facetIndex) {
|
|
247118
|
+
this._v = [startVertex, endVertex];
|
|
247119
|
+
this._a = facetIndex;
|
|
247120
|
+
}
|
|
247121
|
+
/** Clone the edge. */
|
|
247122
|
+
clone() {
|
|
247123
|
+
return new SortableEdge(this._v[0], this._v[1], this._a);
|
|
247124
|
+
}
|
|
246911
247125
|
/** Return the vertex index that appears first in the order stored. */
|
|
246912
|
-
get
|
|
246913
|
-
return this[0];
|
|
247126
|
+
get startVertex() {
|
|
247127
|
+
return this._v[0];
|
|
246914
247128
|
}
|
|
246915
247129
|
/** Return the vertex index that appears second in the order stored. */
|
|
246916
|
-
get
|
|
246917
|
-
return this[1];
|
|
247130
|
+
get endVertex() {
|
|
247131
|
+
return this._v[1];
|
|
246918
247132
|
}
|
|
246919
247133
|
/**
|
|
246920
247134
|
* Return the facet index.
|
|
246921
247135
|
* * This value is carried along during matching. Typically it is a facet index, but it does not have to be.
|
|
246922
247136
|
*/
|
|
246923
247137
|
get facetIndex() {
|
|
246924
|
-
return this
|
|
247138
|
+
return this._a;
|
|
246925
247139
|
}
|
|
246926
|
-
/** return true if
|
|
247140
|
+
/** return true if `startVertex` is less than `endVertex`. */
|
|
246927
247141
|
get isLowHigh() {
|
|
246928
|
-
return this[0] < this[1];
|
|
247142
|
+
return this._v[0] < this._v[1];
|
|
246929
247143
|
}
|
|
246930
247144
|
/** Return the vertex index with lower numeric value. */
|
|
246931
|
-
get
|
|
246932
|
-
return this
|
|
247145
|
+
get lowVertex() {
|
|
247146
|
+
return this.isLowHigh ? this._v[0] : this._v[1];
|
|
246933
247147
|
}
|
|
246934
247148
|
/** Return the vertex index with higher numeric value. */
|
|
246935
|
-
get
|
|
246936
|
-
return this
|
|
247149
|
+
get highVertex() {
|
|
247150
|
+
return this.isLowHigh ? this._v[1] : this._v[0];
|
|
246937
247151
|
}
|
|
246938
|
-
/** Return true if
|
|
247152
|
+
/** Return true if edgeA and edgeB traverse the same edge in the same direction. */
|
|
247153
|
+
static areSameEdge(edgeA, edgeB) {
|
|
247154
|
+
return edgeA._v[0] === edgeB._v[0] && edgeA._v[1] === edgeB._v[1];
|
|
247155
|
+
}
|
|
247156
|
+
/** Return true if edgeA and edgeB traverse the same edge in opposite directions. */
|
|
246939
247157
|
static areDirectedPartners(edgeA, edgeB) {
|
|
246940
|
-
return edgeA[0] === edgeB[1] && edgeA[1] === edgeB[0];
|
|
247158
|
+
return edgeA._v[0] === edgeB._v[1] && edgeA._v[1] === edgeB._v[0];
|
|
246941
247159
|
}
|
|
246942
|
-
/** Return true if
|
|
247160
|
+
/** Return true if edgeA and edgeB traverse the same edge in the same or opposite directions. */
|
|
246943
247161
|
static areUndirectedPartners(edgeA, edgeB) {
|
|
246944
|
-
return (edgeA
|
|
247162
|
+
return this.areSameEdge(edgeA, edgeB) || this.areDirectedPartners(edgeA, edgeB);
|
|
246945
247163
|
}
|
|
246946
247164
|
/**
|
|
246947
|
-
* Return numeric relationship
|
|
246948
|
-
* * 1 if they share start and end in the same order.
|
|
246949
|
-
* * -1 if they share start and end in reversed order.
|
|
247165
|
+
* Return numeric identifier for the relationship between edgeA and edgeB:
|
|
247166
|
+
* * 1 if they share start and end vertex indices in the same order.
|
|
247167
|
+
* * -1 if they share start and end vertex indices in reversed order.
|
|
246950
247168
|
* * 0 otherwise.
|
|
246951
247169
|
*/
|
|
246952
247170
|
static relativeOrientation(edgeA, edgeB) {
|
|
246953
|
-
if (edgeA
|
|
247171
|
+
if (this.areSameEdge(edgeA, edgeB))
|
|
246954
247172
|
return 1;
|
|
246955
|
-
if (edgeA
|
|
247173
|
+
if (this.areDirectedPartners(edgeA, edgeB))
|
|
246956
247174
|
return -1;
|
|
246957
247175
|
return 0;
|
|
246958
247176
|
}
|
|
247177
|
+
/** Whether the start and end vertex indices are equal. */
|
|
246959
247178
|
get isNullEdge() {
|
|
246960
|
-
return this[0] === this[1];
|
|
247179
|
+
return this._v[0] === this._v[1];
|
|
246961
247180
|
}
|
|
246962
247181
|
/**
|
|
246963
247182
|
* Lexical comparison of two edges.
|
|
246964
|
-
* * If the edges have the same vertex pair (in same or opposite order) they will end up adjacent in a sort.
|
|
246965
|
-
* * If the edges have 0 or 1 shared vertex indices, the one with lowest low comes first.
|
|
247183
|
+
* * If the edges have the same vertex index pair (in same or opposite order) they will end up adjacent in a sort.
|
|
246966
247184
|
* @param edgeA first edge
|
|
246967
247185
|
* @param edgeB second edge
|
|
246968
247186
|
*/
|
|
246969
247187
|
static lessThan(edgeA, edgeB) {
|
|
246970
247188
|
// primary compare is based on indirect indices
|
|
246971
|
-
const lowA = edgeA.
|
|
246972
|
-
const lowB = edgeB.
|
|
247189
|
+
const lowA = edgeA.lowVertex;
|
|
247190
|
+
const lowB = edgeB.lowVertex;
|
|
246973
247191
|
if (lowA < lowB)
|
|
246974
247192
|
return -1;
|
|
246975
247193
|
if (lowB < lowA)
|
|
246976
247194
|
return 1;
|
|
246977
|
-
const highA = edgeA.
|
|
246978
|
-
const highB = edgeB.
|
|
247195
|
+
const highA = edgeA.highVertex;
|
|
247196
|
+
const highB = edgeB.highVertex;
|
|
246979
247197
|
if (highA < highB)
|
|
246980
247198
|
return -1;
|
|
246981
247199
|
if (highB < highA)
|
|
246982
247200
|
return 1;
|
|
246983
247201
|
// undirected indices match ... use directed vertexIndexA
|
|
246984
|
-
return edgeA.
|
|
246985
|
-
}
|
|
246986
|
-
constructor(vertexA, vertexB, facetIndex) {
|
|
246987
|
-
super(3);
|
|
246988
|
-
this[0] = vertexA;
|
|
246989
|
-
this[1] = vertexB;
|
|
246990
|
-
this[2] = facetIndex;
|
|
247202
|
+
return edgeA.startVertex - edgeB.startVertex;
|
|
246991
247203
|
}
|
|
247204
|
+
/** Return the edge data as a JSON array. */
|
|
246992
247205
|
toJSON() {
|
|
246993
|
-
return [this[0], this[1], this
|
|
247206
|
+
return [this._v[0], this._v[1], this._a];
|
|
246994
247207
|
}
|
|
247208
|
+
/** Return the edge cluster in JSON format. */
|
|
246995
247209
|
static clusterToJSON(data) {
|
|
246996
247210
|
if (data instanceof SortableEdge)
|
|
246997
247211
|
return data.toJSON();
|
|
@@ -246999,6 +247213,7 @@ class SortableEdge extends Float64Array {
|
|
|
246999
247213
|
for (const edge of data)
|
|
247000
247214
|
result.push(edge.toJSON());
|
|
247001
247215
|
}
|
|
247216
|
+
/** Return the edge cluster array in JSON format. */
|
|
247002
247217
|
static clusterArrayToJSON(data) {
|
|
247003
247218
|
const result = [];
|
|
247004
247219
|
for (const cluster of data)
|
|
@@ -247007,11 +247222,14 @@ class SortableEdge extends Float64Array {
|
|
|
247007
247222
|
}
|
|
247008
247223
|
}
|
|
247009
247224
|
/**
|
|
247010
|
-
* An IndexedEdgeMatcher carries an array of edge start
|
|
247011
|
-
*
|
|
247225
|
+
* An IndexedEdgeMatcher carries an array of edge start and end indices for sorting and subsequent analyses,
|
|
247226
|
+
* such as testing for closed mesh.
|
|
247227
|
+
* @public
|
|
247012
247228
|
*/
|
|
247013
247229
|
class IndexedEdgeMatcher {
|
|
247230
|
+
/** The array of edges to be sorted. */
|
|
247014
247231
|
edges;
|
|
247232
|
+
/** Constructor. Call [[addEdge]] or [[addPath]] to populate `edges`. */
|
|
247015
247233
|
constructor() {
|
|
247016
247234
|
this.edges = [];
|
|
247017
247235
|
}
|
|
@@ -247028,22 +247246,22 @@ class IndexedEdgeMatcher {
|
|
|
247028
247246
|
return edge;
|
|
247029
247247
|
}
|
|
247030
247248
|
/**
|
|
247031
|
-
* Push edges
|
|
247032
|
-
*
|
|
247033
|
-
* @param
|
|
247249
|
+
* Push edges along a path.
|
|
247250
|
+
* * Typically used to add edges around a facet.
|
|
247251
|
+
* @param vertexIndices array of vertex indices along an open or closed path.
|
|
247252
|
+
* @param facetIndex value to set on each edge pushed.
|
|
247034
247253
|
* @param closeLoop true to add an edge from last to first vertex.
|
|
247035
247254
|
*/
|
|
247036
|
-
addPath(
|
|
247037
|
-
if (
|
|
247255
|
+
addPath(vertexIndices, facetIndex, closeLoop) {
|
|
247256
|
+
if (vertexIndices.length === 0)
|
|
247038
247257
|
return;
|
|
247039
|
-
const m =
|
|
247040
|
-
for (let i = 0; i < m; i++)
|
|
247041
|
-
this.addEdge(
|
|
247042
|
-
}
|
|
247258
|
+
const m = vertexIndices.length - 1;
|
|
247259
|
+
for (let i = 0; i < m; i++)
|
|
247260
|
+
this.addEdge(vertexIndices[i], vertexIndices[i + 1], facetIndex);
|
|
247043
247261
|
if (closeLoop)
|
|
247044
|
-
this.addEdge(
|
|
247262
|
+
this.addEdge(vertexIndices[m], vertexIndices[0], facetIndex);
|
|
247045
247263
|
}
|
|
247046
|
-
/** Sort the
|
|
247264
|
+
/** Sort the edges. */
|
|
247047
247265
|
sort() {
|
|
247048
247266
|
this.edges.sort((edgeA, edgeB) => SortableEdge.lessThan(edgeA, edgeB));
|
|
247049
247267
|
}
|
|
@@ -247062,20 +247280,18 @@ class IndexedEdgeMatcher {
|
|
|
247062
247280
|
}
|
|
247063
247281
|
}
|
|
247064
247282
|
/**
|
|
247065
|
-
* Sort the edges, and
|
|
247066
|
-
*
|
|
247067
|
-
* *
|
|
247068
|
-
* * Any combination of the
|
|
247283
|
+
* Sort the edges, and collect up to four categories of edges: manifold pairs, singletons, null edges,
|
|
247284
|
+
* and everything else.
|
|
247285
|
+
* * Caller should allocate arrays of interest.
|
|
247286
|
+
* * Any combination of the arrays may be `undefined`, indicating that category is to be ignored.
|
|
247287
|
+
* * Any combination of the arrays may be aliased as the same target, in which case the aliased categories are
|
|
247069
247288
|
* merged into the target.
|
|
247070
|
-
* * For instance, to ignore manifold pairs and collect all
|
|
247071
|
-
* `
|
|
247072
|
-
*
|
|
247073
|
-
* @param
|
|
247074
|
-
*
|
|
247075
|
-
* @param
|
|
247076
|
-
* @param nullEdges optional array to receive arrays of null edges (same start and end vertex)
|
|
247077
|
-
* @param allOtherClusters optional array to receive arrays in which all the edges are partners in an undirected sense
|
|
247078
|
-
* but not a simple directed pair.
|
|
247289
|
+
* * For instance, to ignore manifold pairs and collect all other edges in a single array:
|
|
247290
|
+
* `const foo = []; matcher.sortAndCollectClusters(undefined, foo, foo, foo);`
|
|
247291
|
+
* @param manifoldPairs array to receive pairs of properly mated edges, i.e. mesh interior edges.
|
|
247292
|
+
* @param singletons array to receive edges that have no partner, i.e., mesh boundary edges.
|
|
247293
|
+
* @param nullEdges array to receive arrays of matched null edges, for which start === end vertex index.
|
|
247294
|
+
* @param allOtherClusters array to receive arrays of edges that are partners in an undirected, non-manifold sense.
|
|
247079
247295
|
*/
|
|
247080
247296
|
sortAndCollectClusters(manifoldPairs, singletons, nullEdges, allOtherClusters) {
|
|
247081
247297
|
this.sort();
|
|
@@ -247096,18 +247312,14 @@ class IndexedEdgeMatcher {
|
|
|
247096
247312
|
SortableEdge.areUndirectedPartners(baseEdge, this.edges[index1]); index1++) {
|
|
247097
247313
|
clusterLength++;
|
|
247098
247314
|
}
|
|
247099
|
-
if (this.edges[index0].isNullEdge)
|
|
247315
|
+
if (this.edges[index0].isNullEdge)
|
|
247100
247316
|
this.collectSortableEdgeCluster(index0, index0 + clusterLength, nullEdges);
|
|
247101
|
-
|
|
247102
|
-
else if (clusterLength === 2 && SortableEdge.areDirectedPartners(baseEdge, this.edges[index0 + 1])) {
|
|
247317
|
+
else if (clusterLength === 2 && SortableEdge.areDirectedPartners(baseEdge, this.edges[index0 + 1]))
|
|
247103
247318
|
this.collectSortableEdgeCluster(index0, index0 + clusterLength, manifoldPairs);
|
|
247104
|
-
|
|
247105
|
-
else if (clusterLength === 1) {
|
|
247319
|
+
else if (clusterLength === 1)
|
|
247106
247320
|
this.collectSortableEdgeCluster(index0, index0 + 1, singletons);
|
|
247107
|
-
|
|
247108
|
-
else {
|
|
247321
|
+
else
|
|
247109
247322
|
this.collectSortableEdgeCluster(index0, index0 + clusterLength, allOtherClusters);
|
|
247110
|
-
}
|
|
247111
247323
|
}
|
|
247112
247324
|
}
|
|
247113
247325
|
}
|
|
@@ -247166,10 +247378,10 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
247166
247378
|
this.auxData = polyface.data.auxData.createForVisitor();
|
|
247167
247379
|
if (polyface.data.edgeMateIndex)
|
|
247168
247380
|
this.edgeMateIndex = [];
|
|
247169
|
-
this.reset();
|
|
247170
247381
|
this._numEdges = 0;
|
|
247171
247382
|
this._nextFacetIndex = 0;
|
|
247172
247383
|
this._currentFacetIndex = -1;
|
|
247384
|
+
this.reset();
|
|
247173
247385
|
}
|
|
247174
247386
|
/** Return the client polyface object. */
|
|
247175
247387
|
clientPolyface() {
|
|
@@ -247206,11 +247418,14 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
247206
247418
|
moveToReadIndex(facetIndex) {
|
|
247207
247419
|
if (!this._polyface.isValidFacetIndex(facetIndex))
|
|
247208
247420
|
return false;
|
|
247209
|
-
|
|
247421
|
+
const numEdges = this._polyface.numEdgeInFacet(facetIndex);
|
|
247422
|
+
if (this._currentFacetIndex !== facetIndex || numEdges + this._numWrap !== this.pointCount) {
|
|
247423
|
+
this._currentFacetIndex = facetIndex;
|
|
247424
|
+
this._numEdges = numEdges;
|
|
247425
|
+
this.resizeAllArrays(this._numEdges + this._numWrap);
|
|
247426
|
+
this.gatherIndexedData(this._polyface.data, this._polyface.facetIndex0(this._currentFacetIndex), this._polyface.facetIndex1(this._currentFacetIndex), this._numWrap);
|
|
247427
|
+
}
|
|
247210
247428
|
this._nextFacetIndex = facetIndex + 1;
|
|
247211
|
-
this._numEdges = this._polyface.numEdgeInFacet(facetIndex);
|
|
247212
|
-
this.resizeAllArrays(this._numEdges + this._numWrap);
|
|
247213
|
-
this.gatherIndexedData(this._polyface.data, this._polyface.facetIndex0(this._currentFacetIndex), this._polyface.facetIndex1(this._currentFacetIndex), this._numWrap);
|
|
247214
247429
|
return true;
|
|
247215
247430
|
}
|
|
247216
247431
|
/** Advance the iterator to a the 'next' facet in the client polyface. */
|
|
@@ -247220,7 +247435,7 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
247220
247435
|
this._nextFacetIndex++;
|
|
247221
247436
|
return true;
|
|
247222
247437
|
}
|
|
247223
|
-
/**
|
|
247438
|
+
/** Restart the visitor at the first facet. */
|
|
247224
247439
|
reset() {
|
|
247225
247440
|
this.moveToReadIndex(0);
|
|
247226
247441
|
this._nextFacetIndex = 0; // so immediate moveToNextFacet stays here.
|
|
@@ -247319,6 +247534,10 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
247319
247534
|
this.color.push(_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.interpolateColor(other.color[index0], fraction, other.color[index1]));
|
|
247320
247535
|
// TODO: auxData? taggedNumericData?
|
|
247321
247536
|
}
|
|
247537
|
+
/** Create a visitor for a subset of the facets visitable by the instance. */
|
|
247538
|
+
createSubsetVisitor(facetIndices, numWrap = 0) {
|
|
247539
|
+
return IndexedPolyfaceSubsetVisitor.createSubsetVisitor(this._polyface, facetIndices, numWrap);
|
|
247540
|
+
}
|
|
247322
247541
|
}
|
|
247323
247542
|
/**
|
|
247324
247543
|
* An `IndexedPolyfaceSubsetVisitor` is an `IndexedPolyfaceVisitor` which only visits a subset of facets in the polyface.
|
|
@@ -247327,38 +247546,38 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
247327
247546
|
* @public
|
|
247328
247547
|
*/
|
|
247329
247548
|
class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {
|
|
247330
|
-
|
|
247331
|
-
|
|
247332
|
-
|
|
247333
|
-
constructor(polyface,
|
|
247549
|
+
_facetIndices;
|
|
247550
|
+
_currentSubsetIndex; // index within _facetIndices, or -1 after construction
|
|
247551
|
+
_nextSubsetIndex; // index within _facetIndices
|
|
247552
|
+
constructor(polyface, facetIndices, numWrap) {
|
|
247334
247553
|
super(polyface, numWrap);
|
|
247335
|
-
this.
|
|
247336
|
-
this.
|
|
247337
|
-
this.
|
|
247554
|
+
this._facetIndices = facetIndices.slice();
|
|
247555
|
+
this._currentSubsetIndex = -1;
|
|
247556
|
+
this._nextSubsetIndex = 0;
|
|
247557
|
+
this.reset();
|
|
247338
247558
|
}
|
|
247339
247559
|
isValidSubsetIndex(index) {
|
|
247340
|
-
return
|
|
247560
|
+
return index >= 0 && index < this._facetIndices.length;
|
|
247341
247561
|
}
|
|
247342
247562
|
/**
|
|
247343
247563
|
* Create a visitor for iterating a subset of the facets of `polyface`.
|
|
247344
247564
|
* @param polyface reference to the client polyface, supplying facets
|
|
247345
|
-
* @param
|
|
247565
|
+
* @param facetIndices array of indices of facets in the client polyface to visit. This array is cloned.
|
|
247346
247566
|
* @param numWrap number of vertices replicated in the visitor arrays to facilitate simpler caller code. Default is zero.
|
|
247347
247567
|
*/
|
|
247348
|
-
static createSubsetVisitor(polyface,
|
|
247349
|
-
return new IndexedPolyfaceSubsetVisitor(polyface,
|
|
247568
|
+
static createSubsetVisitor(polyface, facetIndices, numWrap = 0) {
|
|
247569
|
+
return new IndexedPolyfaceSubsetVisitor(polyface, facetIndices, numWrap);
|
|
247350
247570
|
}
|
|
247351
247571
|
/**
|
|
247352
247572
|
* Advance the iterator to a particular facet in the subset of client polyface facets.
|
|
247353
|
-
* @param
|
|
247354
|
-
* the client polyface.
|
|
247573
|
+
* @param subsetIndex index into the subset array, not to be confused with the client facet index.
|
|
247355
247574
|
* @return whether the iterator was successfully moved.
|
|
247356
247575
|
*/
|
|
247357
|
-
moveToReadIndex(
|
|
247358
|
-
if (this.isValidSubsetIndex(
|
|
247359
|
-
this.
|
|
247360
|
-
this.
|
|
247361
|
-
return super.moveToReadIndex(this.
|
|
247576
|
+
moveToReadIndex(subsetIndex) {
|
|
247577
|
+
if (this.isValidSubsetIndex(subsetIndex)) {
|
|
247578
|
+
this._currentSubsetIndex = subsetIndex;
|
|
247579
|
+
this._nextSubsetIndex = subsetIndex + 1;
|
|
247580
|
+
return super.moveToReadIndex(this._facetIndices[subsetIndex]);
|
|
247362
247581
|
}
|
|
247363
247582
|
return false;
|
|
247364
247583
|
}
|
|
@@ -247367,29 +247586,31 @@ class IndexedPolyfaceSubsetVisitor extends IndexedPolyfaceVisitor {
|
|
|
247367
247586
|
* @return whether the iterator was successfully moved.
|
|
247368
247587
|
*/
|
|
247369
247588
|
moveToNextFacet() {
|
|
247370
|
-
if (this.
|
|
247371
|
-
return this.moveToReadIndex(this.
|
|
247372
|
-
this.
|
|
247589
|
+
if (this._nextSubsetIndex !== this._currentSubsetIndex)
|
|
247590
|
+
return this.moveToReadIndex(this._nextSubsetIndex);
|
|
247591
|
+
this._nextSubsetIndex++;
|
|
247373
247592
|
return true;
|
|
247374
247593
|
}
|
|
247375
|
-
/**
|
|
247594
|
+
/** Restart the visitor at the first facet. */
|
|
247376
247595
|
reset() {
|
|
247377
|
-
this.
|
|
247378
|
-
|
|
247596
|
+
if (this._facetIndices) { // avoid crash during super ctor when we aren't yet initialized
|
|
247597
|
+
this.moveToReadIndex(0);
|
|
247598
|
+
this._nextSubsetIndex = 0; // so immediate moveToNextFacet stays here.
|
|
247599
|
+
}
|
|
247379
247600
|
}
|
|
247380
247601
|
/**
|
|
247381
|
-
* Return the
|
|
247382
|
-
* @param
|
|
247383
|
-
* @return valid client polyface facet index, or `undefined` if invalid
|
|
247602
|
+
* Return the client polyface facet index (aka "readIndex") for the given subset index.
|
|
247603
|
+
* @param subsetIndex index into the subset array. Default is the subset index of the currently visited facet.
|
|
247604
|
+
* @return valid client polyface facet index, or `undefined` if invalid subset index.
|
|
247384
247605
|
*/
|
|
247385
|
-
parentFacetIndex(
|
|
247386
|
-
if (undefined ===
|
|
247387
|
-
|
|
247388
|
-
return this.isValidSubsetIndex(
|
|
247606
|
+
parentFacetIndex(subsetIndex) {
|
|
247607
|
+
if (undefined === subsetIndex)
|
|
247608
|
+
subsetIndex = this._currentSubsetIndex;
|
|
247609
|
+
return this.isValidSubsetIndex(subsetIndex) ? this._facetIndices[subsetIndex] : undefined;
|
|
247389
247610
|
}
|
|
247390
247611
|
/** Return the number of facets this visitor is able to visit. */
|
|
247391
247612
|
getVisitableFacetCount() {
|
|
247392
|
-
return this.
|
|
247613
|
+
return this._facetIndices.length;
|
|
247393
247614
|
}
|
|
247394
247615
|
/**
|
|
247395
247616
|
* Create a visitor for those mesh facets with normal in the same half-space as the given vector.
|
|
@@ -247489,7 +247710,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
247489
247710
|
* * The [[previousAroundVertex]] step is clockwise around the vertex.
|
|
247490
247711
|
* * The `nextAroundFacet` steps for a walker and its [[edgeMate]] are in opposite directions along their shared edge,
|
|
247491
247712
|
* when that edge is interior. Thus the `edgeMate` step can be seen to iterate an "edge loop" of two locations for an
|
|
247492
|
-
* interior
|
|
247713
|
+
* interior edge.
|
|
247493
247714
|
* * Invalid Walkers:
|
|
247494
247715
|
* * An invalid walker has undefined [[edgeIndex]]. For these walkers, [[isUndefined]] returns true, and [[isValid]]
|
|
247495
247716
|
* returns false. Traversal operations on an invalid walker return an invalid walker.
|
|
@@ -247503,6 +247724,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
247503
247724
|
* * Invalid walkers can also occur while traversing a non-manifold mesh. Such meshes feature edge(s) with more than
|
|
247504
247725
|
* two adjacent facets, or with two adjacent facets that have opposite orientations. These meshes are uncommon, and
|
|
247505
247726
|
* usually indicate a construction problem.
|
|
247727
|
+
* * Note that a null edge, for which the start and end vertex is the same, does not yield an invalid walker.
|
|
247506
247728
|
* * See [[buildEdgeMateIndices]] for further description of the topological relations.
|
|
247507
247729
|
* @public
|
|
247508
247730
|
*/
|
|
@@ -247545,6 +247767,10 @@ class IndexedPolyfaceWalker {
|
|
|
247545
247767
|
get isUndefined() {
|
|
247546
247768
|
return this._edgeIndex === undefined;
|
|
247547
247769
|
}
|
|
247770
|
+
/** Whether the walker is at a null edge, i.e. an edge with no length. */
|
|
247771
|
+
get isNull() {
|
|
247772
|
+
return this.isValid && this._polyface.data.edgeIndexToEdgeMateIndex(this._edgeIndex) === this._edgeIndex;
|
|
247773
|
+
}
|
|
247548
247774
|
/**
|
|
247549
247775
|
* Create a walker for a given polyface at an optional edge.
|
|
247550
247776
|
* @param polyface reference to the client polyface. This reference is captured (the polyface is not copied).
|
|
@@ -247587,17 +247813,16 @@ class IndexedPolyfaceWalker {
|
|
|
247587
247813
|
}
|
|
247588
247814
|
/**
|
|
247589
247815
|
* Create a new IndexedPolyfaceWalker from the instance.
|
|
247590
|
-
* * The returned walker refers to the same polyface.
|
|
247591
|
-
*
|
|
247592
|
-
|
|
247593
|
-
|
|
247594
|
-
|
|
247595
|
-
|
|
247596
|
-
|
|
247597
|
-
|
|
247598
|
-
|
|
247599
|
-
|
|
247600
|
-
return undefined;
|
|
247816
|
+
* * The returned walker refers to the same polyface and edge as the instance.
|
|
247817
|
+
* @param result optional receiver to modify and return.
|
|
247818
|
+
*/
|
|
247819
|
+
clone(result) {
|
|
247820
|
+
if (result) {
|
|
247821
|
+
result._polyface = this._polyface;
|
|
247822
|
+
result._edgeIndex = this._edgeIndex;
|
|
247823
|
+
return result;
|
|
247824
|
+
}
|
|
247825
|
+
return new IndexedPolyfaceWalker(this._polyface, this._edgeIndex);
|
|
247601
247826
|
}
|
|
247602
247827
|
/**
|
|
247603
247828
|
* Load the walker's facet into the given visitor.
|
|
@@ -247726,29 +247951,35 @@ class IndexedPolyfaceWalker {
|
|
|
247726
247951
|
* Build the edgeMate index array into the polyface's [[PolyfaceData]].
|
|
247727
247952
|
* After this method:
|
|
247728
247953
|
* * The array `polyface.data.edgeMateIndex` is defined with the same length as the other PolyfaceData index arrays.
|
|
247729
|
-
* * For each interior edge, `polyface.data.edgeIndexToEdgeMateIndex` returns the
|
|
247954
|
+
* * For each interior edge, `polyface.data.edgeIndexToEdgeMateIndex` returns the edge index on the other side of the
|
|
247730
247955
|
* edge in the adjacent facet.
|
|
247731
247956
|
* * The conditions for edgeMate matching are:
|
|
247732
247957
|
* * Given facetIndex f, let `k0 = polyface.facetIndex0(f)` and `k1 = polyface.facetIndex1(f)`.
|
|
247733
|
-
* * Every
|
|
247734
|
-
* * The edge with
|
|
247735
|
-
* * Let kA be an
|
|
247958
|
+
* * Every edge index k in the face loop of facet f satisfies `k0 <= k < k1`.
|
|
247959
|
+
* * The edge with edge index k starts at the point with index `polyface.data.pointIndex[k]`.
|
|
247960
|
+
* * Let kA be an edge index in this range [k0,k1), and let kB be its in-range successor with cyclic wrap, i.e.,
|
|
247736
247961
|
* `kB === (kA + 1 === k1) ? k0 : kA + 1`.
|
|
247737
247962
|
* * Then `polyface.data.pointIndex[kA]` and `polyface.data.pointIndex[kB]` are the indices of the points at the
|
|
247738
247963
|
* start and end of an edge of that facet.
|
|
247739
|
-
* * We call kA the
|
|
247740
|
-
* * If kA is
|
|
247741
|
-
* whose face loop contains
|
|
247964
|
+
* * We call kA the _edge index_ for that edge, and kB the _edge index_ for the next edge around the facet.
|
|
247965
|
+
* * If kA is a positive-length interior edge in a 2-manifold mesh with properly oriented facets, then there is
|
|
247966
|
+
* an adjacent facet whose face loop contains edge indices kC and kD referencing the same edge vertices in reverse
|
|
247967
|
+
* order, i.e.,
|
|
247742
247968
|
* * `polyface.data.pointIndex[kA] === polyface.data.pointIndex[kD]`
|
|
247743
247969
|
* * `polyface.data.pointIndex[kB] === polyface.data.pointIndex[kC]`
|
|
247744
|
-
* *
|
|
247745
|
-
*
|
|
247746
|
-
*
|
|
247970
|
+
* * We call the edge indices kA and kC _edge mates_, denoted in the `edgeMateIndex` array by:
|
|
247971
|
+
* * `polyface.data.edgeMateIndex[kA] === kC`
|
|
247972
|
+
* * `polyface.data.edgeMateIndex[kC] === kA`
|
|
247973
|
+
* * If kA is zero-length interior edge, i.e, it has the same start and end point indices, then we call it a _null
|
|
247974
|
+
* edge_, and its edge mate is itself.
|
|
247975
|
+
* * A non-interior edge either lies on the boundary of the mesh, or is non-manifold (having more than 2 adjacent
|
|
247976
|
+
* facets, or 1 with the wrong orientation). These edges have no edge mate, represented as `undefined` in
|
|
247977
|
+
* the `edgeMateIndex` array.
|
|
247747
247978
|
* * These conditions define a conventional manifold mesh where each edge of a facet has at most one partner edge with
|
|
247748
247979
|
* opposite orientation in an adjacent facet.
|
|
247749
247980
|
* * After calling this method, the caller can construct `IndexedPolyfaceWalker` objects to traverse the mesh by
|
|
247750
|
-
* walking across edges, around faces, and around vertices. Let walkerA have
|
|
247751
|
-
* aforementioned
|
|
247981
|
+
* walking across edges, around faces, and around vertices. Let walkerA have edge index value kA. Then with the
|
|
247982
|
+
* aforementioned edge indices:
|
|
247752
247983
|
* * `walkerC = walkerA.edgeMate()` moves across the edge to its other end, at kC.
|
|
247753
247984
|
* * `walkerB = walkerA.nextAroundFacet()` moves around the facet to the next edge, at kB.
|
|
247754
247985
|
* * `walkerB.previousAroundFacet()` moves from kB back to kA.
|
|
@@ -247763,25 +247994,30 @@ class IndexedPolyfaceWalker {
|
|
|
247763
247994
|
const kStart = polyface.facetIndex0(facetIndex);
|
|
247764
247995
|
const kEnd = polyface.facetIndex1(facetIndex);
|
|
247765
247996
|
let k0 = kEnd - 1;
|
|
247766
|
-
// sneaky: addEdge 3rd arg is
|
|
247997
|
+
// sneaky: addEdge 3rd arg is edge index k0 instead of facetIndex; it gets carried around during matching
|
|
247767
247998
|
for (let k1 = kStart; k1 < kEnd; k0 = k1, k1++)
|
|
247768
247999
|
matcher.addEdge(polyface.data.pointIndex[k0], polyface.data.pointIndex[k1], k0);
|
|
247769
248000
|
}
|
|
247770
248001
|
const matchedPairs = [];
|
|
247771
|
-
const singletons = [];
|
|
247772
248002
|
const nullEdges = [];
|
|
247773
|
-
|
|
247774
|
-
matcher.sortAndCollectClusters(matchedPairs, singletons, nullEdges, allOtherClusters);
|
|
248003
|
+
matcher.sortAndCollectClusters(matchedPairs, undefined, nullEdges, undefined);
|
|
247775
248004
|
const numIndex = polyface.data.pointIndex.length;
|
|
247776
248005
|
polyface.data.edgeMateIndex = new Array(numIndex);
|
|
247777
248006
|
for (let i = 0; i < numIndex; i++)
|
|
247778
|
-
polyface.data.edgeMateIndex[i] = undefined;
|
|
248007
|
+
polyface.data.edgeMateIndex[i] = undefined; // boundary and non-manifold edges have no mate
|
|
247779
248008
|
for (const pair of matchedPairs) {
|
|
247780
248009
|
if (Array.isArray(pair) && pair.length === 2) {
|
|
247781
|
-
const
|
|
247782
|
-
const
|
|
247783
|
-
polyface.data.edgeMateIndex[
|
|
247784
|
-
polyface.data.edgeMateIndex[
|
|
248010
|
+
const edgeIndex0 = pair[0].facetIndex;
|
|
248011
|
+
const edgeIndex1 = pair[1].facetIndex;
|
|
248012
|
+
polyface.data.edgeMateIndex[edgeIndex0] = edgeIndex1; // paired edges point to each other
|
|
248013
|
+
polyface.data.edgeMateIndex[edgeIndex1] = edgeIndex0;
|
|
248014
|
+
}
|
|
248015
|
+
}
|
|
248016
|
+
for (const nullEdgeOrCluster of nullEdges) {
|
|
248017
|
+
const nullCluster = Array.isArray(nullEdgeOrCluster) ? nullEdgeOrCluster : [nullEdgeOrCluster];
|
|
248018
|
+
for (const nullEdge of nullCluster) {
|
|
248019
|
+
const edgeIndex = nullEdge.facetIndex;
|
|
248020
|
+
polyface.data.edgeMateIndex[edgeIndex] = edgeIndex; // a null edge points to itself
|
|
247785
248021
|
}
|
|
247786
248022
|
}
|
|
247787
248023
|
}
|
|
@@ -248468,6 +248704,22 @@ class IndexedPolyface extends Polyface {
|
|
|
248468
248704
|
dispatchToGeometryHandler(handler) {
|
|
248469
248705
|
return handler.handleIndexedPolyface(this);
|
|
248470
248706
|
}
|
|
248707
|
+
/** If the input accesses an edgeMateIndex array, return it along with the owning IndexedPolyface. */
|
|
248708
|
+
static hasEdgeMateIndex(polyface) {
|
|
248709
|
+
let parent;
|
|
248710
|
+
if (polyface instanceof Polyface) {
|
|
248711
|
+
if (polyface instanceof IndexedPolyface)
|
|
248712
|
+
parent = polyface;
|
|
248713
|
+
}
|
|
248714
|
+
else if (polyface.clientPolyface() && polyface.clientPolyface() instanceof IndexedPolyface)
|
|
248715
|
+
parent = polyface.clientPolyface();
|
|
248716
|
+
if (parent) {
|
|
248717
|
+
const edgeMateIndex = parent.data.edgeMateIndex;
|
|
248718
|
+
if (edgeMateIndex && edgeMateIndex.length > 0 && edgeMateIndex.length === parent.data.indexCount)
|
|
248719
|
+
return { parent, edgeMateIndex };
|
|
248720
|
+
}
|
|
248721
|
+
return undefined;
|
|
248722
|
+
}
|
|
248471
248723
|
}
|
|
248472
248724
|
|
|
248473
248725
|
|
|
@@ -250378,9 +250630,9 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
250378
250630
|
let indexA = -1;
|
|
250379
250631
|
let indexB = -1;
|
|
250380
250632
|
for (let i = this._polyface.facetIndex0(edge.facetIndex); i < this._polyface.facetIndex1(edge.facetIndex); ++i) {
|
|
250381
|
-
if (edge.
|
|
250633
|
+
if (edge.startVertex === this._polyface.data.pointIndex[i])
|
|
250382
250634
|
indexA = i;
|
|
250383
|
-
else if (edge.
|
|
250635
|
+
else if (edge.endVertex === this._polyface.data.pointIndex[i])
|
|
250384
250636
|
indexB = i;
|
|
250385
250637
|
}
|
|
250386
250638
|
return (indexA < 0 || indexB < 0) ? undefined : { edgeIndexA: indexA, edgeIndexB: indexB };
|
|
@@ -250518,7 +250770,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
250518
250770
|
/* harmony import */ var _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../curve/UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
|
|
250519
250771
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
250520
250772
|
/* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
|
|
250521
|
-
/* harmony import */ var
|
|
250773
|
+
/* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
|
|
250522
250774
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
250523
250775
|
/* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
|
|
250524
250776
|
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
@@ -250526,7 +250778,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
250526
250778
|
/* harmony import */ var _solid_SweepContour__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../solid/SweepContour */ "../../core/geometry/lib/esm/solid/SweepContour.js");
|
|
250527
250779
|
/* harmony import */ var _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../topology/ChainMerge */ "../../core/geometry/lib/esm/topology/ChainMerge.js");
|
|
250528
250780
|
/* harmony import */ var _multiclip_RangeSearch__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./multiclip/RangeSearch */ "../../core/geometry/lib/esm/polyface/multiclip/RangeSearch.js");
|
|
250529
|
-
/* harmony import */ var
|
|
250781
|
+
/* harmony import */ var _Polyface__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
250530
250782
|
/* harmony import */ var _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
|
|
250531
250783
|
/* harmony import */ var _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
|
|
250532
250784
|
/*---------------------------------------------------------------------------------------------
|
|
@@ -250622,26 +250874,28 @@ class PolyfaceClip {
|
|
|
250622
250874
|
* * Return all surviving clip as a new mesh.
|
|
250623
250875
|
* * WARNING: The new mesh is "points only" -- parameters, normals, etc are not interpolated
|
|
250624
250876
|
*/
|
|
250625
|
-
static clipPolyfaceClipPlaneWithClosureFace(
|
|
250626
|
-
return this.clipPolyfaceClipPlane(
|
|
250877
|
+
static clipPolyfaceClipPlaneWithClosureFace(source, clipper, insideClip = true, buildClosureFaces = true) {
|
|
250878
|
+
return this.clipPolyfaceClipPlane(source, clipper, insideClip, buildClosureFaces);
|
|
250627
250879
|
}
|
|
250628
250880
|
/** Clip each facet of polyface to the ClipPlane.
|
|
250629
250881
|
* * Return all surviving clip as a new mesh.
|
|
250630
250882
|
* * WARNING: The new mesh is "points only" -- parameters, normals, etc are not interpolated
|
|
250631
250883
|
*/
|
|
250632
|
-
static clipPolyfaceClipPlane(
|
|
250884
|
+
static clipPolyfaceClipPlane(source, clipper, insideClip = true, buildClosureFaces = false) {
|
|
250633
250885
|
const builders = ClippedPolyfaceBuilders.create(insideClip, !insideClip, buildClosureFaces);
|
|
250634
|
-
this.clipPolyfaceInsideOutside(
|
|
250886
|
+
this.clipPolyfaceInsideOutside(source, clipper, builders);
|
|
250635
250887
|
return builders.claimPolyface(insideClip ? 0 : 1, true);
|
|
250636
250888
|
}
|
|
250637
|
-
/**
|
|
250638
|
-
*
|
|
250889
|
+
/**
|
|
250890
|
+
* Clip each facet to the clipper.
|
|
250891
|
+
* * Return surviving facets as a new mesh.
|
|
250639
250892
|
* * WARNING: The new mesh is "points only".
|
|
250640
250893
|
*/
|
|
250641
|
-
static clipPolyfaceConvexClipPlaneSet(
|
|
250642
|
-
const visitor =
|
|
250894
|
+
static clipPolyfaceConvexClipPlaneSet(source, clipper) {
|
|
250895
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_4__.Polyface ? source.createVisitor(0) : source;
|
|
250896
|
+
visitor.setNumWrap(0);
|
|
250643
250897
|
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_1__.PolyfaceBuilder.create();
|
|
250644
|
-
const work = new
|
|
250898
|
+
const work = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__.GrowableXYZArray(10);
|
|
250645
250899
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
250646
250900
|
clipper.clipConvexPolygonInPlace(visitor.point, work);
|
|
250647
250901
|
if (visitor.point.length > 2)
|
|
@@ -250649,21 +250903,18 @@ class PolyfaceClip {
|
|
|
250649
250903
|
}
|
|
250650
250904
|
return builder.claimPolyface(true);
|
|
250651
250905
|
}
|
|
250652
|
-
/** Clip each facet
|
|
250906
|
+
/** Clip each facet to the clippers.
|
|
250653
250907
|
* * Add inside, outside fragments to builderA, builderB
|
|
250654
250908
|
* * This does not consider params, normals, colors. Just points.
|
|
250655
250909
|
* * outputSelect determines how the clip output is structured
|
|
250656
250910
|
* * 0 outputs all shards -- this may have many interior edges.
|
|
250657
250911
|
* * 1 stitches shards together to get cleaner facets.
|
|
250658
250912
|
*/
|
|
250659
|
-
static clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(
|
|
250660
|
-
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_5__.Polyface) {
|
|
250661
|
-
this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(polyface.createVisitor(0), allClippers, destination, outputSelector);
|
|
250662
|
-
return;
|
|
250663
|
-
}
|
|
250913
|
+
static clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(source, allClippers, destination, outputSelector = 1) {
|
|
250664
250914
|
const builderA = destination.builderA;
|
|
250665
250915
|
const builderB = destination.builderB;
|
|
250666
|
-
const visitor =
|
|
250916
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_4__.Polyface ? source.createVisitor(0) : source;
|
|
250917
|
+
visitor.setNumWrap(0);
|
|
250667
250918
|
const cache = new _geometry3d_ReusableObjectCache__WEBPACK_IMPORTED_MODULE_6__.GrowableXYZArrayCache();
|
|
250668
250919
|
const insideShards = [];
|
|
250669
250920
|
const outsideShards = [];
|
|
@@ -250750,7 +251001,7 @@ class PolyfaceClip {
|
|
|
250750
251001
|
static cleanupAndAddRegion(builder, shards, worldToLocal, localToWorld) {
|
|
250751
251002
|
if (builder !== undefined && shards.length > 0) {
|
|
250752
251003
|
if (worldToLocal)
|
|
250753
|
-
|
|
251004
|
+
_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__.GrowableXYZArray.multiplyTransformInPlace(worldToLocal, shards);
|
|
250754
251005
|
const outsidePieces = _curve_RegionOps__WEBPACK_IMPORTED_MODULE_11__.RegionOps.polygonBooleanXYToLoops(shards, _curve_RegionOps__WEBPACK_IMPORTED_MODULE_11__.RegionBinaryOpType.Union, []);
|
|
250755
251006
|
if (outsidePieces && outsidePieces.children.length > 0) {
|
|
250756
251007
|
_curve_RegionOps__WEBPACK_IMPORTED_MODULE_11__.RegionOps.consolidateAdjacentPrimitives(outsidePieces); // source of the T-vertices removed in claimPolyface
|
|
@@ -250794,24 +251045,23 @@ class PolyfaceClip {
|
|
|
250794
251045
|
}
|
|
250795
251046
|
return chainContexts;
|
|
250796
251047
|
}
|
|
250797
|
-
/** Clip each facet
|
|
251048
|
+
/** Clip each facet to the clippers.
|
|
250798
251049
|
* * Add inside, outside fragments to builderA, builderB
|
|
250799
251050
|
* * This does not consider params, normals, colors. Just points.
|
|
250800
251051
|
* @internal
|
|
250801
251052
|
*/
|
|
250802
|
-
static clipPolyfaceConvexClipPlaneSetToBuilders(
|
|
251053
|
+
static clipPolyfaceConvexClipPlaneSetToBuilders(source, clipper, destination) {
|
|
250803
251054
|
const builderA = destination.builderA;
|
|
250804
251055
|
const builderB = destination.builderB;
|
|
250805
|
-
const visitor =
|
|
251056
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_4__.Polyface ? source.createVisitor(0) : source;
|
|
251057
|
+
visitor.setNumWrap(0);
|
|
250806
251058
|
const cache = new _geometry3d_ReusableObjectCache__WEBPACK_IMPORTED_MODULE_6__.GrowableXYZArrayCache();
|
|
250807
251059
|
const outsideParts = [];
|
|
250808
251060
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
250809
|
-
// !!! currentCandidates and next candidates are empty at this point !!!
|
|
250810
251061
|
const insidePart = clipper.clipInsidePushOutside(visitor.point, outsideParts, cache);
|
|
250811
251062
|
if (insidePart === undefined) {
|
|
250812
251063
|
// everything is out ... outsideParts might be fragmented. Save only the original polygon
|
|
250813
251064
|
builderB?.addPolygonGrowableXYZArray(visitor.point);
|
|
250814
|
-
cache.dropToCache(insidePart);
|
|
250815
251065
|
cache.dropAllToCache(outsideParts);
|
|
250816
251066
|
}
|
|
250817
251067
|
this.addPolygonToBuilderAndDropToCache(insidePart, builderA, cache);
|
|
@@ -250947,15 +251197,16 @@ class PolyfaceClip {
|
|
|
250947
251197
|
}
|
|
250948
251198
|
}
|
|
250949
251199
|
}
|
|
250950
|
-
/** Clip each facet
|
|
251200
|
+
/** Clip each facet to the clippers.
|
|
250951
251201
|
* * Add inside, outside fragments to builderA, builderB
|
|
250952
251202
|
* * This does not consider params, normals, colors. Just points.
|
|
250953
251203
|
* @internal
|
|
250954
251204
|
*/
|
|
250955
|
-
static clipPolyfaceClipPlaneToBuilders(
|
|
251205
|
+
static clipPolyfaceClipPlaneToBuilders(source, clipper, destination) {
|
|
250956
251206
|
const builderA = destination.builderA;
|
|
250957
251207
|
const builderB = destination.builderB;
|
|
250958
|
-
const visitor =
|
|
251208
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_4__.Polyface ? source.createVisitor(0) : source;
|
|
251209
|
+
visitor.setNumWrap(0);
|
|
250959
251210
|
const cache = new _geometry3d_ReusableObjectCache__WEBPACK_IMPORTED_MODULE_6__.GrowableXYZArrayCache();
|
|
250960
251211
|
const inside = cache.grabFromCache();
|
|
250961
251212
|
const outside = cache.grabFromCache();
|
|
@@ -250972,34 +251223,31 @@ class PolyfaceClip {
|
|
|
250972
251223
|
cache.dropToCache(inside);
|
|
250973
251224
|
cache.dropToCache(outside);
|
|
250974
251225
|
}
|
|
250975
|
-
/** Clip each facet
|
|
251226
|
+
/** Clip each facet to the clipper.
|
|
250976
251227
|
* * accumulate inside and outside facets -- to destination.builderA and destination.builderB
|
|
250977
|
-
* * if `destination.buildClosureFaces` is set,
|
|
250978
|
-
* * This method parses
|
|
251228
|
+
* * if `destination.buildClosureFaces` is set, also build closure facets.
|
|
251229
|
+
* * This method parses the variant input types and calls a more specific method.
|
|
250979
251230
|
* * WARNING: The new mesh is "points only".
|
|
250980
251231
|
* * outputSelect applies only for UnionOfConvexClipPlaneSets -- see [[PolyfaceClip.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders]]
|
|
250981
251232
|
*/
|
|
250982
|
-
static clipPolyfaceInsideOutside(
|
|
250983
|
-
if (clipper instanceof _clipping_ClipPlane__WEBPACK_IMPORTED_MODULE_18__.ClipPlane)
|
|
250984
|
-
this.clipPolyfaceClipPlaneToBuilders(
|
|
250985
|
-
|
|
250986
|
-
|
|
250987
|
-
|
|
250988
|
-
|
|
250989
|
-
else if (clipper instanceof _clipping_UnionOfConvexClipPlaneSets__WEBPACK_IMPORTED_MODULE_20__.UnionOfConvexClipPlaneSets) {
|
|
250990
|
-
this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(polyface, clipper, destination, outputSelect);
|
|
250991
|
-
}
|
|
251233
|
+
static clipPolyfaceInsideOutside(source, clipper, destination, outputSelect = 0) {
|
|
251234
|
+
if (clipper instanceof _clipping_ClipPlane__WEBPACK_IMPORTED_MODULE_18__.ClipPlane)
|
|
251235
|
+
this.clipPolyfaceClipPlaneToBuilders(source, clipper, destination);
|
|
251236
|
+
else if (clipper instanceof _clipping_ConvexClipPlaneSet__WEBPACK_IMPORTED_MODULE_19__.ConvexClipPlaneSet)
|
|
251237
|
+
this.clipPolyfaceConvexClipPlaneSetToBuilders(source, clipper, destination);
|
|
251238
|
+
else if (clipper instanceof _clipping_UnionOfConvexClipPlaneSets__WEBPACK_IMPORTED_MODULE_20__.UnionOfConvexClipPlaneSets)
|
|
251239
|
+
this.clipPolyfaceUnionOfConvexClipPlaneSetsToBuilders(source, clipper, destination, outputSelect);
|
|
250992
251240
|
}
|
|
250993
|
-
/** Clip each facet
|
|
251241
|
+
/** Clip each facet to the clipper.
|
|
250994
251242
|
* * This method parses the variant input types and calls a more specific method.
|
|
250995
251243
|
* * To get both inside and outside parts, use clipPolyfaceInsideOutside
|
|
250996
251244
|
* * WARNING: The new mesh is "points only".
|
|
250997
251245
|
*/
|
|
250998
|
-
static clipPolyface(
|
|
251246
|
+
static clipPolyface(source, clipper) {
|
|
250999
251247
|
if (clipper instanceof _clipping_ClipPlane__WEBPACK_IMPORTED_MODULE_18__.ClipPlane)
|
|
251000
|
-
return this.clipPolyfaceClipPlane(
|
|
251248
|
+
return this.clipPolyfaceClipPlane(source, clipper);
|
|
251001
251249
|
if (clipper instanceof _clipping_ConvexClipPlaneSet__WEBPACK_IMPORTED_MODULE_19__.ConvexClipPlaneSet)
|
|
251002
|
-
return this.clipPolyfaceConvexClipPlaneSet(
|
|
251250
|
+
return this.clipPolyfaceConvexClipPlaneSet(source, clipper);
|
|
251003
251251
|
// (The if tests exhaust the type space -- this line is unreachable.)
|
|
251004
251252
|
return undefined;
|
|
251005
251253
|
}
|
|
@@ -251013,7 +251261,7 @@ class PolyfaceClip {
|
|
|
251013
251261
|
* @returns clipped facets. No other mesh data but vertices appear in output.
|
|
251014
251262
|
*/
|
|
251015
251263
|
static drapeRegion(mesh, region, sweepVector, options) {
|
|
251016
|
-
if (mesh instanceof
|
|
251264
|
+
if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_4__.Polyface)
|
|
251017
251265
|
return this.drapeRegion(mesh.createVisitor(0), region, sweepVector, options);
|
|
251018
251266
|
const contour = _solid_SweepContour__WEBPACK_IMPORTED_MODULE_16__.SweepContour.createForLinearSweep(region);
|
|
251019
251267
|
if (!contour)
|
|
@@ -251049,10 +251297,11 @@ class PolyfaceClip {
|
|
|
251049
251297
|
/** Intersect each facet with the clip plane. (Producing intersection edges.)
|
|
251050
251298
|
* * Return all edges chained as array of LineString3d.
|
|
251051
251299
|
*/
|
|
251052
|
-
static sectionPolyfaceClipPlane(
|
|
251300
|
+
static sectionPolyfaceClipPlane(source, clipper) {
|
|
251053
251301
|
const chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_13__.ChainMergeContext.create();
|
|
251054
|
-
const visitor =
|
|
251055
|
-
|
|
251302
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_4__.Polyface ? source.createVisitor(0) : source;
|
|
251303
|
+
visitor.setNumWrap(0);
|
|
251304
|
+
const work = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__.GrowableXYZArray(10);
|
|
251056
251305
|
const point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_15__.Point3d.create();
|
|
251057
251306
|
const point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_15__.Point3d.create();
|
|
251058
251307
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
@@ -251087,11 +251336,11 @@ class PolyfaceClip {
|
|
|
251087
251336
|
visitorA.point.setRange(range);
|
|
251088
251337
|
searchA.addRange(range, visitorA.currentReadIndex());
|
|
251089
251338
|
}
|
|
251090
|
-
const xyClip = new
|
|
251091
|
-
const workArray = new
|
|
251339
|
+
const xyClip = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__.GrowableXYZArray(10);
|
|
251340
|
+
const workArray = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__.GrowableXYZArray(10);
|
|
251092
251341
|
const xyFrustum = _clipping_ConvexClipPlaneSet__WEBPACK_IMPORTED_MODULE_19__.ConvexClipPlaneSet.createEmpty();
|
|
251093
|
-
const below = new
|
|
251094
|
-
const above = new
|
|
251342
|
+
const below = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__.GrowableXYZArray(10);
|
|
251343
|
+
const above = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_5__.GrowableXYZArray(10);
|
|
251095
251344
|
const planeOfFacet = _clipping_ClipPlane__WEBPACK_IMPORTED_MODULE_18__.ClipPlane.createNormalAndPointXYZXYZ(0, 0, 1, 0, 0, 0);
|
|
251096
251345
|
const altitudeRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_17__.Range1d.createNull();
|
|
251097
251346
|
for (visitorB.reset(); visitorB.moveToNextFacet();) {
|
|
@@ -251967,42 +252216,41 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
251967
252216
|
/* harmony export */ });
|
|
251968
252217
|
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
251969
252218
|
/* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
251970
|
-
/* harmony import */ var
|
|
252219
|
+
/* harmony import */ var _curve_CurveOps__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../curve/CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
|
|
251971
252220
|
/* harmony import */ var _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../curve/internalContexts/MultiChainCollector */ "../../core/geometry/lib/esm/curve/internalContexts/MultiChainCollector.js");
|
|
251972
252221
|
/* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
251973
252222
|
/* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
251974
252223
|
/* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
251975
|
-
/* harmony import */ var
|
|
252224
|
+
/* harmony import */ var _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../curve/StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
|
|
251976
252225
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
251977
252226
|
/* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
251978
|
-
/* harmony import */ var
|
|
251979
|
-
/* harmony import */ var
|
|
252227
|
+
/* harmony import */ var _geometry3d_BarycentricTriangle__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../geometry3d/BarycentricTriangle */ "../../core/geometry/lib/esm/geometry3d/BarycentricTriangle.js");
|
|
252228
|
+
/* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
|
|
251980
252229
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
251981
|
-
/* harmony import */ var
|
|
252230
|
+
/* harmony import */ var _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../geometry3d/PointHelpers */ "../../core/geometry/lib/esm/geometry3d/PointHelpers.js");
|
|
251982
252231
|
/* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
|
|
251983
|
-
/* harmony import */ var
|
|
251984
|
-
/* harmony import */ var
|
|
251985
|
-
/* harmony import */ var
|
|
251986
|
-
/* harmony import */ var
|
|
251987
|
-
/* harmony import */ var
|
|
252232
|
+
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
252233
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
252234
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
252235
|
+
/* harmony import */ var _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry4d/Matrix4d */ "../../core/geometry/lib/esm/geometry4d/Matrix4d.js");
|
|
252236
|
+
/* harmony import */ var _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geometry4d/MomentData */ "../../core/geometry/lib/esm/geometry4d/MomentData.js");
|
|
251988
252237
|
/* harmony import */ var _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../numerics/UnionFind */ "../../core/geometry/lib/esm/numerics/UnionFind.js");
|
|
251989
|
-
/* harmony import */ var
|
|
251990
|
-
/* harmony import */ var
|
|
251991
|
-
/* harmony import */ var
|
|
251992
|
-
/* harmony import */ var
|
|
251993
|
-
/* harmony import */ var
|
|
251994
|
-
/* harmony import */ var
|
|
251995
|
-
/* harmony import */ var
|
|
251996
|
-
/* harmony import */ var
|
|
252238
|
+
/* harmony import */ var _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../topology/ChainMerge */ "../../core/geometry/lib/esm/topology/ChainMerge.js");
|
|
252239
|
+
/* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
|
|
252240
|
+
/* harmony import */ var _topology_HalfEdgeGraphFromIndexedLoopsContext__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../topology/HalfEdgeGraphFromIndexedLoopsContext */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js");
|
|
252241
|
+
/* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
|
|
252242
|
+
/* harmony import */ var _topology_Merging__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../topology/Merging */ "../../core/geometry/lib/esm/topology/Merging.js");
|
|
252243
|
+
/* harmony import */ var _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../topology/SpaceTriangulation */ "../../core/geometry/lib/esm/topology/SpaceTriangulation.js");
|
|
252244
|
+
/* harmony import */ var _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./FacetLocationDetail */ "../../core/geometry/lib/esm/polyface/FacetLocationDetail.js");
|
|
252245
|
+
/* harmony import */ var _FacetOrientation__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./FacetOrientation */ "../../core/geometry/lib/esm/polyface/FacetOrientation.js");
|
|
251997
252246
|
/* harmony import */ var _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./IndexedEdgeMatcher */ "../../core/geometry/lib/esm/polyface/IndexedEdgeMatcher.js");
|
|
251998
|
-
/* harmony import */ var
|
|
251999
|
-
/* harmony import */ var
|
|
252000
|
-
/* harmony import */ var _multiclip_OffsetMeshContext__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./multiclip/OffsetMeshContext */ "../../core/geometry/lib/esm/polyface/multiclip/OffsetMeshContext.js");
|
|
252247
|
+
/* harmony import */ var _multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./multiclip/BuildAverageNormalsContext */ "../../core/geometry/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js");
|
|
252248
|
+
/* harmony import */ var _multiclip_OffsetMeshContext__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./multiclip/OffsetMeshContext */ "../../core/geometry/lib/esm/polyface/multiclip/OffsetMeshContext.js");
|
|
252001
252249
|
/* harmony import */ var _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./multiclip/SweepLineStringToFacetContext */ "../../core/geometry/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js");
|
|
252002
|
-
/* harmony import */ var
|
|
252250
|
+
/* harmony import */ var _multiclip_XYPointBuckets__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./multiclip/XYPointBuckets */ "../../core/geometry/lib/esm/polyface/multiclip/XYPointBuckets.js");
|
|
252003
252251
|
/* harmony import */ var _Polyface__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
252004
|
-
/* harmony import */ var
|
|
252005
|
-
/* harmony import */ var
|
|
252252
|
+
/* harmony import */ var _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
|
|
252253
|
+
/* harmony import */ var _RangeLengthData__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./RangeLengthData */ "../../core/geometry/lib/esm/polyface/RangeLengthData.js");
|
|
252006
252254
|
/*---------------------------------------------------------------------------------------------
|
|
252007
252255
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
252008
252256
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -252046,7 +252294,6 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
252046
252294
|
|
|
252047
252295
|
|
|
252048
252296
|
|
|
252049
|
-
|
|
252050
252297
|
|
|
252051
252298
|
|
|
252052
252299
|
/**
|
|
@@ -252074,14 +252321,27 @@ class SweepLineStringToFacetsOptions {
|
|
|
252074
252321
|
sideAngle;
|
|
252075
252322
|
/** Option to assemble lines into chains. */
|
|
252076
252323
|
assembleChains;
|
|
252324
|
+
/**
|
|
252325
|
+
* Optional searcher object for vertical sweep speedup. If provided, `vectorToEye` must be the positive Z vector.
|
|
252326
|
+
* @example To construct a 5x5 indexed search grid:
|
|
252327
|
+
* ````
|
|
252328
|
+
* const xyRange = Range2d.createFrom(myPolyface.range());
|
|
252329
|
+
* const searcher = GriddedRaggedRange2dSetWithOverflow.create<number>(xyRange, 5, 5)!;
|
|
252330
|
+
* for (const visitor = myPolyface.createVisitor(0); visitor.moveToNextFacet();) {
|
|
252331
|
+
* searcher.addRange(visitor.point.getRange(), visitor.currentReadIndex());
|
|
252332
|
+
* }
|
|
252333
|
+
* ````
|
|
252334
|
+
*/
|
|
252335
|
+
searcher;
|
|
252077
252336
|
/** Constructor. Captures fully-checked parameters from static create method. */
|
|
252078
|
-
constructor(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets) {
|
|
252337
|
+
constructor(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets, searcher) {
|
|
252079
252338
|
this.vectorToEye = vectorToEye;
|
|
252080
252339
|
this.sideAngle = sideAngle;
|
|
252081
252340
|
this.assembleChains = assembleChains;
|
|
252082
252341
|
this.collectOnForwardFacets = collectOnForwardFacets;
|
|
252083
252342
|
this.collectOnSideFacets = collectOnSideFacets;
|
|
252084
252343
|
this.collectOnRearFacets = collectOnRearFacets;
|
|
252344
|
+
this.searcher = searcher;
|
|
252085
252345
|
}
|
|
252086
252346
|
/**
|
|
252087
252347
|
* Create an options structure.
|
|
@@ -252090,14 +252350,12 @@ class SweepLineStringToFacetsOptions {
|
|
|
252090
252350
|
* * Default `assembleChains` is `true`.
|
|
252091
252351
|
* * Default `collectOnForwardFacets`, `collectOnSideFacets`, `collectOnRearFacets` are all `true`.
|
|
252092
252352
|
*/
|
|
252093
|
-
static create(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets) {
|
|
252094
|
-
return new SweepLineStringToFacetsOptions(vectorToEye
|
|
252353
|
+
static create(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets, searcher) {
|
|
252354
|
+
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);
|
|
252095
252355
|
}
|
|
252096
252356
|
/** Return `true` if all outputs are requested. */
|
|
252097
252357
|
get collectAll() {
|
|
252098
|
-
return this.collectOnForwardFacets
|
|
252099
|
-
this.collectOnSideFacets === true &&
|
|
252100
|
-
this.collectOnRearFacets === true;
|
|
252358
|
+
return this.collectOnForwardFacets && this.collectOnSideFacets && this.collectOnRearFacets;
|
|
252101
252359
|
}
|
|
252102
252360
|
/**
|
|
252103
252361
|
* Decide if the instance collector flags accept a facet with the given normal.
|
|
@@ -252208,21 +252466,21 @@ class PolyfaceQuery {
|
|
|
252208
252466
|
* @param source polyface or visitor.
|
|
252209
252467
|
* @param vectorToEye compute sum of (signed) facet areas projected to a view plane perpendicular to `vectorToEye`.
|
|
252210
252468
|
* If `vectorToEye` is not provided, actual facet areas are calculated (without any projection).
|
|
252211
|
-
* @returns the sum of all facet areas.
|
|
252469
|
+
* @returns the sum of all facet areas.
|
|
252212
252470
|
*/
|
|
252213
252471
|
static sumFacetAreas(source, vectorToEye) {
|
|
252214
252472
|
let sum = 0;
|
|
252215
|
-
if (source
|
|
252216
|
-
|
|
252217
|
-
|
|
252218
|
-
|
|
252219
|
-
|
|
252220
|
-
|
|
252221
|
-
|
|
252222
|
-
|
|
252223
|
-
|
|
252224
|
-
|
|
252225
|
-
|
|
252473
|
+
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
|
|
252474
|
+
source = source.createVisitor(1);
|
|
252475
|
+
else
|
|
252476
|
+
source.setNumWrap(1);
|
|
252477
|
+
let unitVectorToEye;
|
|
252478
|
+
if (vectorToEye !== undefined)
|
|
252479
|
+
unitVectorToEye = vectorToEye.normalize();
|
|
252480
|
+
source.reset();
|
|
252481
|
+
while (source.moveToNextFacet()) {
|
|
252482
|
+
const areaNormal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.areaNormal(source.point.getPoint3dArray());
|
|
252483
|
+
sum += unitVectorToEye ? areaNormal.dotProduct(unitVectorToEye) : areaNormal.magnitude();
|
|
252226
252484
|
}
|
|
252227
252485
|
return sum;
|
|
252228
252486
|
}
|
|
@@ -252256,75 +252514,53 @@ class PolyfaceQuery {
|
|
|
252256
252514
|
}
|
|
252257
252515
|
/**
|
|
252258
252516
|
* Sum (signed) volumes between facets and a plane.
|
|
252259
|
-
*
|
|
252260
|
-
*
|
|
252261
|
-
*
|
|
252262
|
-
*
|
|
252263
|
-
|
|
252264
|
-
|
|
252265
|
-
|
|
252266
|
-
|
|
252267
|
-
|
|
252268
|
-
|
|
252269
|
-
const
|
|
252270
|
-
|
|
252271
|
-
const
|
|
252272
|
-
|
|
252273
|
-
|
|
252274
|
-
|
|
252275
|
-
let
|
|
252276
|
-
const
|
|
252277
|
-
const
|
|
252278
|
-
const singleFacetProducts = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_10__.Matrix4d.createZero();
|
|
252279
|
-
const projectToPlane = plane.getProjectionToPlane();
|
|
252280
|
-
source.reset();
|
|
252517
|
+
* @param source facet set
|
|
252518
|
+
* @param plane infinite plane bounding volume between the input facets and (virtual) side facets perpendicular to the plane.
|
|
252519
|
+
* @param skipMoments whether to skip computation of the area moments. Set to `true` if only volume is needed. Default is `false`.
|
|
252520
|
+
* @returns a structure with multiple sums:
|
|
252521
|
+
* * volume: the sum of (signed) volumes between facets and the plane.
|
|
252522
|
+
* * positiveProjectedFacetAreaMoments, negativeProjectedFacetAreaMoments: area moment data (centroid, signed area,
|
|
252523
|
+
* and second moments with respect to the centroid), separately computed for the input facets that project with
|
|
252524
|
+
* positive/negative area onto the plane.
|
|
252525
|
+
*/
|
|
252526
|
+
static sumVolumeBetweenFacetsAndPlane(source, plane, skipMoments) {
|
|
252527
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.createVisitor(0) : source;
|
|
252528
|
+
visitor.setNumWrap(0);
|
|
252529
|
+
const workPoint0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
252530
|
+
const workPoint1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
252531
|
+
const workVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
252532
|
+
const workMatrix = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__.Matrix4d.createZero();
|
|
252533
|
+
let signedVolumeTimes6 = 0.0;
|
|
252534
|
+
const posSums = skipMoments ? undefined : _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_10__.MomentData.create(undefined, true);
|
|
252535
|
+
const negSums = skipMoments ? undefined : _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_10__.MomentData.create(undefined, true);
|
|
252281
252536
|
// For each facet:
|
|
252282
252537
|
// - form triangles from facet origin to each far edge.
|
|
252283
|
-
// - sum signed area and volume contributions.
|
|
252284
|
-
// each projected area contribution is twice the area of a triangle.
|
|
252285
|
-
// each volume contribution is 3 times the actual volume --
|
|
252286
|
-
|
|
252287
|
-
|
|
252288
|
-
|
|
252289
|
-
|
|
252290
|
-
|
|
252291
|
-
|
|
252292
|
-
|
|
252293
|
-
|
|
252294
|
-
|
|
252295
|
-
|
|
252296
|
-
facetOrigin.crossProductToPoints(targetA, targetB, triangleNormal);
|
|
252297
|
-
hA = plane.altitude(targetA);
|
|
252298
|
-
hB = plane.altitude(targetB);
|
|
252299
|
-
signedTriangleArea = planeNormal.dotProduct(triangleNormal);
|
|
252300
|
-
singleFacetArea += signedTriangleArea;
|
|
252301
|
-
signedVolumeSum += signedTriangleArea * (h0 + hA + hB);
|
|
252302
|
-
}
|
|
252303
|
-
singleFacetProducts.setZero();
|
|
252304
|
-
source.point.multiplyTransformInPlace(projectToPlane);
|
|
252305
|
-
_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.addSecondMomentAreaProducts(source.point, facetOrigin, singleFacetProducts);
|
|
252306
|
-
if (singleFacetArea > 0) {
|
|
252307
|
-
positiveAreaMomentSums.accumulateProductsFromOrigin(facetOrigin, singleFacetProducts, 1.0);
|
|
252308
|
-
}
|
|
252309
|
-
else {
|
|
252310
|
-
negativeAreaMomentSums.accumulateProductsFromOrigin(facetOrigin, singleFacetProducts, 1.0);
|
|
252538
|
+
// - sum signed area and volume contributions (for non-convex facet, signs can be mixed).
|
|
252539
|
+
// - each projected area contribution is twice the area of a triangle.
|
|
252540
|
+
// - each volume contribution is 3 times the actual volume -- a third of the altitude sum is the centroid altitude.
|
|
252541
|
+
const options = { skipMoments, p0: workPoint0, p1: workPoint1, v0: workVector, m0: workMatrix };
|
|
252542
|
+
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
252543
|
+
const facetData = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.volumeBetweenPolygonAndPlane(visitor.point, plane, options);
|
|
252544
|
+
signedVolumeTimes6 += facetData.volume6;
|
|
252545
|
+
if (!skipMoments) {
|
|
252546
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(posSums !== undefined && negSums !== undefined && facetData.origin !== undefined && facetData.products !== undefined);
|
|
252547
|
+
if (facetData.area2 > 0)
|
|
252548
|
+
posSums.accumulateProductsFromOrigin(facetData.origin, facetData.products, 1.0);
|
|
252549
|
+
else
|
|
252550
|
+
negSums.accumulateProductsFromOrigin(facetData.origin, facetData.products, 1.0);
|
|
252311
252551
|
}
|
|
252312
252552
|
}
|
|
252313
|
-
positiveAreaMomentSums.shiftOriginAndSumsToCentroidOfSums();
|
|
252314
|
-
negativeAreaMomentSums.shiftOriginAndSumsToCentroidOfSums();
|
|
252315
|
-
const positiveAreaMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_9__.MomentData.inertiaProductsToPrincipalAxes(positiveAreaMomentSums.origin, positiveAreaMomentSums.sums);
|
|
252316
|
-
const negativeAreaMoments = _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_9__.MomentData.inertiaProductsToPrincipalAxes(negativeAreaMomentSums.origin, negativeAreaMomentSums.sums);
|
|
252317
252553
|
return {
|
|
252318
|
-
volume:
|
|
252319
|
-
positiveProjectedFacetAreaMoments:
|
|
252320
|
-
negativeProjectedFacetAreaMoments:
|
|
252554
|
+
volume: signedVolumeTimes6 / 6.0,
|
|
252555
|
+
positiveProjectedFacetAreaMoments: posSums ? _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_10__.MomentData.inertiaProductsToPrincipalAxes(posSums.origin, posSums.sums) : undefined,
|
|
252556
|
+
negativeProjectedFacetAreaMoments: negSums ? _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_10__.MomentData.inertiaProductsToPrincipalAxes(negSums.origin, negSums.sums) : undefined,
|
|
252321
252557
|
};
|
|
252322
252558
|
}
|
|
252323
252559
|
/** Return the inertia products [xx,xy,xz,xw,yw, etc] integrated over all all facets as viewed from origin. */
|
|
252324
252560
|
static sumFacetSecondAreaMomentProducts(source, origin) {
|
|
252325
252561
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
|
|
252326
252562
|
return PolyfaceQuery.sumFacetSecondAreaMomentProducts(source.createVisitor(0), origin);
|
|
252327
|
-
const products =
|
|
252563
|
+
const products = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__.Matrix4d.createZero();
|
|
252328
252564
|
source.reset();
|
|
252329
252565
|
while (source.moveToNextFacet()) {
|
|
252330
252566
|
_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.addSecondMomentAreaProducts(source.point, origin, products);
|
|
@@ -252335,7 +252571,7 @@ class PolyfaceQuery {
|
|
|
252335
252571
|
static sumFacetSecondVolumeMomentProducts(source, origin) {
|
|
252336
252572
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
|
|
252337
252573
|
return PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source.createVisitor(0), origin);
|
|
252338
|
-
const products =
|
|
252574
|
+
const products = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__.Matrix4d.createZero();
|
|
252339
252575
|
source.reset();
|
|
252340
252576
|
while (source.moveToNextFacet()) {
|
|
252341
252577
|
_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.addSecondMomentVolumeProducts(source.point, origin, products);
|
|
@@ -252353,7 +252589,7 @@ class PolyfaceQuery {
|
|
|
252353
252589
|
if (!origin)
|
|
252354
252590
|
return undefined;
|
|
252355
252591
|
const inertiaProducts = PolyfaceQuery.sumFacetSecondAreaMomentProducts(source, origin);
|
|
252356
|
-
return
|
|
252592
|
+
return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_10__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
|
|
252357
252593
|
}
|
|
252358
252594
|
/**
|
|
252359
252595
|
* Compute area moments for the mesh. In the returned MomentData:
|
|
@@ -252368,7 +252604,7 @@ class PolyfaceQuery {
|
|
|
252368
252604
|
if (!origin)
|
|
252369
252605
|
return undefined;
|
|
252370
252606
|
const inertiaProducts = PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source, origin);
|
|
252371
|
-
return
|
|
252607
|
+
return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_10__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
|
|
252372
252608
|
}
|
|
252373
252609
|
/**
|
|
252374
252610
|
* Determine whether all facets are convex.
|
|
@@ -252392,7 +252628,7 @@ class PolyfaceQuery {
|
|
|
252392
252628
|
* Compute a number summarizing the dihedral angles in the mesh.
|
|
252393
252629
|
* * A dihedral angle is the signed angle between adjacent facets' normals. This angle is positive when the cross
|
|
252394
252630
|
* product `normalA x normalB` has the same direction as facetA's traversal of the facets' shared edge.
|
|
252395
|
-
* @param source
|
|
252631
|
+
* @param source facets.
|
|
252396
252632
|
* @param ignoreBoundaries if `true` ignore simple boundary edges, i.e., allow unclosed meshes. Default is `false`.
|
|
252397
252633
|
* See [[isConvexByDihedralAngleCount]] for comments about passing true when there are multiple
|
|
252398
252634
|
* connected components.
|
|
@@ -252408,19 +252644,21 @@ class PolyfaceQuery {
|
|
|
252408
252644
|
static dihedralAngleSummary(source, ignoreBoundaries = false) {
|
|
252409
252645
|
// more info can be found at geometry/internaldocs/Polyface.md
|
|
252410
252646
|
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.IndexedEdgeMatcher();
|
|
252411
|
-
const
|
|
252412
|
-
visitor.
|
|
252413
|
-
|
|
252647
|
+
const vertices = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.data.point : undefined;
|
|
252648
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.createVisitor(1) : source;
|
|
252649
|
+
visitor.setNumWrap(1);
|
|
252414
252650
|
const centroidNormal = [];
|
|
252415
252651
|
let normalCounter = 0;
|
|
252416
|
-
|
|
252652
|
+
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
252417
252653
|
const numEdges = visitor.pointCount - 1;
|
|
252418
252654
|
const normal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.centroidAreaNormal(visitor.point);
|
|
252419
252655
|
if (normal === undefined)
|
|
252420
252656
|
return -2;
|
|
252421
252657
|
centroidNormal.push(normal);
|
|
252422
252658
|
for (let i = 0; i < numEdges; i++) {
|
|
252423
|
-
edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), normalCounter);
|
|
252659
|
+
const edge = edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), normalCounter);
|
|
252660
|
+
if (!vertices) // decorate if we don't have vertices to query later
|
|
252661
|
+
edge.edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createStartEnd(visitor.point.getPoint3dAtUncheckedPointIndex(i), visitor.point.getPoint3dAtUncheckedPointIndex(i + 1));
|
|
252424
252662
|
}
|
|
252425
252663
|
normalCounter++;
|
|
252426
252664
|
}
|
|
@@ -252438,11 +252676,16 @@ class PolyfaceQuery {
|
|
|
252438
252676
|
let numNegative = 0;
|
|
252439
252677
|
const edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
252440
252678
|
for (const cluster of manifoldClusters) {
|
|
252441
|
-
|
|
252442
|
-
|
|
252443
|
-
|
|
252444
|
-
|
|
252445
|
-
|
|
252679
|
+
if (Array.isArray(cluster) && cluster.length === 2) {
|
|
252680
|
+
const sideA = cluster[0];
|
|
252681
|
+
const sideB = cluster[1];
|
|
252682
|
+
if (vertices)
|
|
252683
|
+
vertices.vectorIndexIndex(sideA.startVertex, sideA.endVertex, edgeVector);
|
|
252684
|
+
else
|
|
252685
|
+
edgeVector.setFrom(sideA.edgeVector);
|
|
252686
|
+
const facetNormalA = centroidNormal[sideA.facetIndex].direction;
|
|
252687
|
+
const facetNormalB = centroidNormal[sideB.facetIndex].direction;
|
|
252688
|
+
const dihedralAngle = facetNormalA.signedAngleTo(facetNormalB, edgeVector);
|
|
252446
252689
|
if (dihedralAngle.isAlmostZero)
|
|
252447
252690
|
numPlanar++;
|
|
252448
252691
|
else if (dihedralAngle.radians > 0.0)
|
|
@@ -252478,26 +252721,50 @@ class PolyfaceQuery {
|
|
|
252478
252721
|
static isConvexByDihedralAngleCount(source, ignoreBoundaries = false) {
|
|
252479
252722
|
return this.dihedralAngleSummary(source, ignoreBoundaries) > 0;
|
|
252480
252723
|
}
|
|
252724
|
+
/** Helper function to detect a subset visitor. */
|
|
252725
|
+
static isSubsetVisitor(visitor) {
|
|
252726
|
+
if (visitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
|
|
252727
|
+
return false;
|
|
252728
|
+
const parentFacetCount = visitor.clientPolyface()?.facetCount;
|
|
252729
|
+
const visitableFacetCount = visitor.getVisitableFacetCount?.();
|
|
252730
|
+
if (parentFacetCount === undefined || visitableFacetCount === undefined)
|
|
252731
|
+
return false;
|
|
252732
|
+
return parentFacetCount > visitableFacetCount;
|
|
252733
|
+
}
|
|
252481
252734
|
/**
|
|
252482
|
-
*
|
|
252483
|
-
*
|
|
252484
|
-
|
|
252485
|
-
|
|
252735
|
+
* Faster version of isPolyfaceManifold for specific input.
|
|
252736
|
+
* @returns whether the mesh is manifold, or undefined if unsuccessful.
|
|
252737
|
+
*/
|
|
252738
|
+
static isPolyfaceManifoldFast(source, allowSimpleBoundaries) {
|
|
252739
|
+
if (allowSimpleBoundaries)
|
|
252740
|
+
return undefined; // edgeMateIndex does not distinguish boundary edges from non-manifold edges so we can only speed things up if we search for both
|
|
252741
|
+
if (this.isSubsetVisitor(source))
|
|
252742
|
+
return false; // edgeMateIndex doesn't capture the facet subset boundary
|
|
252743
|
+
const parentData = _Polyface__WEBPACK_IMPORTED_MODULE_7__.IndexedPolyface.hasEdgeMateIndex(source);
|
|
252744
|
+
if (!parentData)
|
|
252745
|
+
return undefined;
|
|
252746
|
+
for (const edgeMate of parentData.edgeMateIndex) {
|
|
252747
|
+
if (edgeMate === undefined)
|
|
252748
|
+
return false; // found a boundary or non-manifold edge
|
|
252749
|
+
}
|
|
252750
|
+
return true; // this is a 2-manifold closed surface
|
|
252751
|
+
}
|
|
252752
|
+
/**
|
|
252753
|
+
* Test edge pairing in `source` mesh.
|
|
252486
252754
|
* * Any edge with 3 or more adjacent facets triggers `false` return.
|
|
252487
|
-
* * Any edge with 2 adjacent facets in the same direction triggers
|
|
252755
|
+
* * Any edge with 2 adjacent facets in the same direction triggers `false` return.
|
|
252756
|
+
* * Null edges are ignored.
|
|
252757
|
+
* @param source facet set to examine
|
|
252758
|
+
* @param allowSimpleBoundaries if `false` (default), a return value of `true` means the facets form a closed
|
|
252759
|
+
* 2-manifold surface; if `true`, a return value of `true` means the facets form a 2-manifold surface which may
|
|
252760
|
+
* have a boundary, but is still properly matched internally.
|
|
252488
252761
|
*/
|
|
252489
252762
|
static isPolyfaceManifold(source, allowSimpleBoundaries = false) {
|
|
252490
|
-
const
|
|
252491
|
-
|
|
252492
|
-
|
|
252493
|
-
while (visitor.moveToNextFacet()) {
|
|
252494
|
-
const numEdges = visitor.pointCount - 1;
|
|
252495
|
-
for (let i = 0; i < numEdges; i++) {
|
|
252496
|
-
edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), visitor.currentReadIndex());
|
|
252497
|
-
}
|
|
252498
|
-
}
|
|
252763
|
+
const isManifold = this.isPolyfaceManifoldFast(source, allowSimpleBoundaries);
|
|
252764
|
+
if (isManifold !== undefined)
|
|
252765
|
+
return isManifold;
|
|
252499
252766
|
const badClusters = [];
|
|
252500
|
-
|
|
252767
|
+
this.createIndexedEdges(source).sortAndCollectClusters(undefined, allowSimpleBoundaries ? undefined : badClusters, undefined, badClusters);
|
|
252501
252768
|
return badClusters.length === 0;
|
|
252502
252769
|
}
|
|
252503
252770
|
/** Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume. */
|
|
@@ -252505,50 +252772,107 @@ class PolyfaceQuery {
|
|
|
252505
252772
|
return this.isPolyfaceManifold(source, false);
|
|
252506
252773
|
}
|
|
252507
252774
|
/**
|
|
252508
|
-
*
|
|
252509
|
-
*
|
|
252775
|
+
* Faster version of announceBoundaryEdges for specific input.
|
|
252776
|
+
* @returns true if successfully announced boundary edges.
|
|
252777
|
+
*/
|
|
252778
|
+
static announceBoundaryEdgesFast(source, announceEdge, includeTypical, includeMismatch, includeNull) {
|
|
252779
|
+
if (includeTypical !== includeMismatch)
|
|
252780
|
+
return false; // edgeMateIndex does not distinguish boundary edges from non-manifold edges
|
|
252781
|
+
if (!includeTypical && !includeNull)
|
|
252782
|
+
return true;
|
|
252783
|
+
if (this.isSubsetVisitor(source))
|
|
252784
|
+
return false; // edgeMateIndex doesn't capture the facet subset boundary
|
|
252785
|
+
const parentData = _Polyface__WEBPACK_IMPORTED_MODULE_7__.IndexedPolyface.hasEdgeMateIndex(source);
|
|
252786
|
+
if (!parentData)
|
|
252787
|
+
return false;
|
|
252788
|
+
const pointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
252789
|
+
const pointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
252790
|
+
for (let edgeIndex = 0; edgeIndex < parentData.edgeMateIndex.length; edgeIndex++) {
|
|
252791
|
+
const edgeMate = parentData.edgeMateIndex[edgeIndex];
|
|
252792
|
+
const announceBoundaryOrNonManifoldEdge = includeTypical && edgeMate === undefined;
|
|
252793
|
+
const announceNullEdge = includeNull && edgeMate === edgeIndex;
|
|
252794
|
+
if (announceBoundaryOrNonManifoldEdge || announceNullEdge) {
|
|
252795
|
+
const facetIndex = parentData.parent.edgeIndexToFacetIndex(edgeIndex);
|
|
252796
|
+
if (facetIndex !== undefined) { // should always be defined
|
|
252797
|
+
const pointIndexA = parentData.parent.data.pointIndex[edgeIndex];
|
|
252798
|
+
let nextEdgeIndex = edgeIndex + 1;
|
|
252799
|
+
if (nextEdgeIndex >= parentData.parent.facetIndex1(facetIndex))
|
|
252800
|
+
nextEdgeIndex = parentData.parent.facetIndex0(facetIndex);
|
|
252801
|
+
const pointIndexB = parentData.parent.data.pointIndex[nextEdgeIndex];
|
|
252802
|
+
parentData.parent.data.getPoint(pointIndexA, pointA);
|
|
252803
|
+
parentData.parent.data.getPoint(pointIndexB, pointB);
|
|
252804
|
+
announceEdge(pointA, pointB, pointIndexA, pointIndexB, facetIndex);
|
|
252805
|
+
}
|
|
252806
|
+
}
|
|
252807
|
+
}
|
|
252808
|
+
return true;
|
|
252809
|
+
}
|
|
252810
|
+
/**
|
|
252811
|
+
* Announce boundary edges of the facet set as line segments.
|
|
252510
252812
|
* @param source polyface or visitor.
|
|
252511
252813
|
* @param announceEdge function to be called with each boundary edge. The announcement is start and end points,
|
|
252512
|
-
* start and end indices, and facet index.
|
|
252513
|
-
* @param includeTypical true to announce typical boundary edges with a single adjacent facet.
|
|
252514
|
-
* @param includeMismatch true to announce edges
|
|
252515
|
-
*
|
|
252814
|
+
* start and end vertex indices, and facet index.
|
|
252815
|
+
* @param includeTypical true to announce typical boundary edges with a single adjacent facet. Default is true.
|
|
252816
|
+
* @param includeMismatch true to announce non-manifold edges (more than 2 adjacent facets, or mismatched
|
|
252817
|
+
* orientations). Default is true.
|
|
252818
|
+
* @param includeNull true to announce edges with identical start and end vertex indices. Default is true.
|
|
252819
|
+
* @see [[announceBoundaryChainsAsLineString3d]] for boundary linestring announcement
|
|
252820
|
+
* @see [[collectBoundaryEdges]] for boundary chain collection
|
|
252821
|
+
* @see [[boundaryEdges]] for boundary edge collection
|
|
252516
252822
|
*/
|
|
252517
252823
|
static announceBoundaryEdges(source, announceEdge, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
252518
|
-
if (source
|
|
252824
|
+
if (this.announceBoundaryEdgesFast(source, announceEdge, includeTypical, includeMismatch, includeNull))
|
|
252519
252825
|
return;
|
|
252520
|
-
|
|
252826
|
+
if (!includeTypical && !includeMismatch && !includeNull)
|
|
252827
|
+
return;
|
|
252828
|
+
const vertices = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.data.point : undefined;
|
|
252521
252829
|
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.createVisitor(1) : source;
|
|
252522
252830
|
visitor.setNumWrap(1);
|
|
252523
|
-
|
|
252524
|
-
|
|
252831
|
+
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.IndexedEdgeMatcher();
|
|
252832
|
+
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
252525
252833
|
const numEdges = visitor.pointCount - 1;
|
|
252526
252834
|
for (let i = 0; i < numEdges; i++) {
|
|
252527
|
-
edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), visitor.currentReadIndex());
|
|
252835
|
+
const edge = edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), visitor.currentReadIndex());
|
|
252836
|
+
if (!vertices) { // decorate if we don't have vertices to query later
|
|
252837
|
+
edge.pointA = visitor.point.getPoint3dAtUncheckedPointIndex(i);
|
|
252838
|
+
edge.pointB = visitor.point.getPoint3dAtUncheckedPointIndex(i + 1);
|
|
252839
|
+
}
|
|
252528
252840
|
}
|
|
252529
252841
|
}
|
|
252530
252842
|
const boundaryEdges = [];
|
|
252531
|
-
|
|
252843
|
+
const typicalEdges = includeTypical ? boundaryEdges : undefined;
|
|
252844
|
+
const nullEdges = includeNull ? boundaryEdges : undefined;
|
|
252845
|
+
const mismatchEdges = includeMismatch ? boundaryEdges : undefined;
|
|
252846
|
+
edges.sortAndCollectClusters(undefined, typicalEdges, nullEdges, mismatchEdges);
|
|
252532
252847
|
if (boundaryEdges.length === 0)
|
|
252533
252848
|
return;
|
|
252534
|
-
const sourcePolyface = visitor.clientPolyface();
|
|
252535
252849
|
const pointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
252536
252850
|
const pointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
252537
252851
|
for (const e of boundaryEdges) {
|
|
252538
|
-
const e1 = e instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.SortableEdge ? e : e[0];
|
|
252539
|
-
const indexA = e1.
|
|
252540
|
-
const indexB = e1.
|
|
252541
|
-
if (
|
|
252542
|
-
|
|
252852
|
+
const e1 = e instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.SortableEdge ? e : e[0]; // only report the first edge in a cluster!
|
|
252853
|
+
const indexA = e1.startVertex;
|
|
252854
|
+
const indexB = e1.endVertex;
|
|
252855
|
+
if (vertices) {
|
|
252856
|
+
vertices.getPoint3dAtUncheckedPointIndex(indexA, pointA);
|
|
252857
|
+
vertices.getPoint3dAtUncheckedPointIndex(indexB, pointB);
|
|
252858
|
+
}
|
|
252859
|
+
else {
|
|
252860
|
+
pointA.setFrom(e1.pointA);
|
|
252861
|
+
pointB.setFrom(e1.pointB);
|
|
252862
|
+
}
|
|
252863
|
+
announceEdge(pointA, pointB, indexA, indexB, e1.facetIndex);
|
|
252543
252864
|
}
|
|
252544
252865
|
}
|
|
252545
252866
|
/**
|
|
252546
|
-
*
|
|
252547
|
-
* * Each edge is a LineSegment3d.
|
|
252867
|
+
* Collect boundary edges of the facet set as an unordered collection of line segments.
|
|
252548
252868
|
* @param source polyface or visitor.
|
|
252549
|
-
* @param includeTypical true to
|
|
252550
|
-
* @param includeMismatch true to include edges
|
|
252551
|
-
*
|
|
252869
|
+
* @param includeTypical true to include typical boundary edges with a single adjacent facet. Default is true.
|
|
252870
|
+
* @param includeMismatch true to include non-manifold edges (more than 2 adjacent facets, or mismatched
|
|
252871
|
+
* orientations). Default is true.
|
|
252872
|
+
* @param includeNull true to include edges with identical start and end vertex indices. Default is true.
|
|
252873
|
+
* @see [[announceBoundaryChainsAsLineString3d]] for boundary linestring announcement
|
|
252874
|
+
* @see [[collectBoundaryEdges]] for boundary chain collection
|
|
252875
|
+
* @see [[announceBoundaryEdges]] for boundary edge announcement
|
|
252552
252876
|
*/
|
|
252553
252877
|
static boundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
252554
252878
|
const result = new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_6__.BagOfCurves();
|
|
@@ -252561,33 +252885,32 @@ class PolyfaceQuery {
|
|
|
252561
252885
|
return result;
|
|
252562
252886
|
}
|
|
252563
252887
|
/**
|
|
252564
|
-
* Collect boundary edges.
|
|
252565
|
-
* * Return the edges as the simplest collection of chains of line segments.
|
|
252888
|
+
* Collect boundary edges of the facet set as the simplest collection of chains of line segments.
|
|
252566
252889
|
* @param source polyface or visitor.
|
|
252567
|
-
* @param includeTypical true to include typical boundary edges with a single adjacent facet.
|
|
252568
|
-
* @param includeMismatch true to include edges
|
|
252569
|
-
*
|
|
252890
|
+
* @param includeTypical true to include typical boundary edges with a single adjacent facet. Default is true.
|
|
252891
|
+
* @param includeMismatch true to include non-manifold edges (more than 2 adjacent facets, or mismatched
|
|
252892
|
+
* orientations). Default is true.
|
|
252893
|
+
* @param includeNull true to include edges with identical start and end vertex indices. Default is true.
|
|
252894
|
+
* @see [[announceBoundaryChainsAsLineString3d]] for boundary linestring announcement
|
|
252895
|
+
* @see [[announceBoundaryEdges]] for boundary edge announcement
|
|
252896
|
+
* @see [[boundaryEdges]] for boundary edge collection
|
|
252570
252897
|
*/
|
|
252571
252898
|
static collectBoundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
252572
252899
|
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);
|
|
252573
|
-
|
|
252900
|
+
const announceEdge = (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(ptA, ptB));
|
|
252901
|
+
PolyfaceQuery.announceBoundaryEdges(source, announceEdge, includeTypical, includeMismatch, includeNull);
|
|
252574
252902
|
return collector.grabResult(true);
|
|
252575
252903
|
}
|
|
252576
252904
|
/**
|
|
252577
|
-
* Load
|
|
252578
|
-
* @param polyface a mesh or
|
|
252579
|
-
|
|
252905
|
+
* Load an IndexedEdgeMatcher from the edges of a mesh.
|
|
252906
|
+
* @param polyface a mesh or visitor
|
|
252907
|
+
*/
|
|
252580
252908
|
static createIndexedEdges(polyface) {
|
|
252581
|
-
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
|
|
252582
|
-
return this.createIndexedEdges(polyface.createVisitor(1));
|
|
252583
252909
|
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.IndexedEdgeMatcher();
|
|
252584
|
-
polyface.
|
|
252585
|
-
|
|
252586
|
-
|
|
252587
|
-
|
|
252588
|
-
edges.addEdge(polyface.clientPointIndex(i), polyface.clientPointIndex(i + 1), polyface.currentReadIndex());
|
|
252589
|
-
}
|
|
252590
|
-
}
|
|
252910
|
+
const visitor = polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? polyface.createVisitor(1) : polyface;
|
|
252911
|
+
visitor.setNumWrap(1);
|
|
252912
|
+
for (visitor.reset(); visitor.moveToNextFacet();)
|
|
252913
|
+
edges.addPath(visitor.pointIndex, visitor.currentReadIndex(), false);
|
|
252591
252914
|
return edges;
|
|
252592
252915
|
}
|
|
252593
252916
|
/**
|
|
@@ -252623,8 +252946,8 @@ class PolyfaceQuery {
|
|
|
252623
252946
|
for (const pair of manifoldEdges) {
|
|
252624
252947
|
if (!Array.isArray(pair) || pair.length !== 2)
|
|
252625
252948
|
continue;
|
|
252626
|
-
const indexA = pair[0].
|
|
252627
|
-
const indexB = pair[0].
|
|
252949
|
+
const indexA = pair[0].startVertex;
|
|
252950
|
+
const indexB = pair[0].endVertex;
|
|
252628
252951
|
if (!mesh.data.getPoint(indexA, pointA) || !mesh.data.getPoint(indexB, pointB))
|
|
252629
252952
|
continue;
|
|
252630
252953
|
const face0 = analyzeFace(pair[0].facetIndex);
|
|
@@ -252799,7 +253122,7 @@ class PolyfaceQuery {
|
|
|
252799
253122
|
}
|
|
252800
253123
|
/**
|
|
252801
253124
|
* Return the boundary of facets that are facing the eye.
|
|
252802
|
-
* @param polyface
|
|
253125
|
+
* @param source polyface or visitor. Must be capable of constructing a subset visitor.
|
|
252803
253126
|
* @param visibilitySubset selector among the visible facet sets extracted by partitionFacetIndicesByVisibilityVector
|
|
252804
253127
|
* * 0 ==> forward facing
|
|
252805
253128
|
* * 1 ==> rear facing
|
|
@@ -252807,21 +253130,29 @@ class PolyfaceQuery {
|
|
|
252807
253130
|
* @param vectorToEye the vector to eye
|
|
252808
253131
|
* @param sideAngleTolerance the tolerance of side angle
|
|
252809
253132
|
*/
|
|
252810
|
-
static boundaryOfVisibleSubset(
|
|
252811
|
-
const
|
|
253133
|
+
static boundaryOfVisibleSubset(source, visibilitySelect, vectorToEye, sideAngleTolerance = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(1.0e-3)) {
|
|
253134
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.createVisitor(0) : source;
|
|
253135
|
+
if (!visitor.createSubsetVisitor)
|
|
253136
|
+
return undefined;
|
|
253137
|
+
const partitionedIndices = this.partitionFacetIndicesByVisibilityVector(source, vectorToEye, sideAngleTolerance);
|
|
252812
253138
|
if (partitionedIndices[visibilitySelect].length === 0)
|
|
252813
253139
|
return undefined;
|
|
252814
|
-
const
|
|
252815
|
-
return this.boundaryEdges(
|
|
253140
|
+
const subsetVisitor = visitor.createSubsetVisitor(partitionedIndices[visibilitySelect], 1);
|
|
253141
|
+
return this.boundaryEdges(subsetVisitor, true, false, false);
|
|
252816
253142
|
}
|
|
252817
253143
|
/**
|
|
252818
|
-
*
|
|
252819
|
-
* *
|
|
252820
|
-
*
|
|
253144
|
+
* Announce boundary edges of the facet set as linestrings.
|
|
253145
|
+
* * Ignores non-manifold interior edges and null edges.
|
|
253146
|
+
* @param source polyface or visitor.
|
|
253147
|
+
* @param announceChain function to be called with each chain of boundary edges.
|
|
253148
|
+
* @see [[collectBoundaryEdges]] for boundary chain collection
|
|
253149
|
+
* @see [[announceBoundaryEdges]] for boundary edge announcement
|
|
253150
|
+
* @see [[boundaryEdges]] for boundary edge collection
|
|
252821
253151
|
*/
|
|
252822
|
-
static announceBoundaryChainsAsLineString3d(
|
|
253152
|
+
static announceBoundaryChainsAsLineString3d(source, announceChain) {
|
|
252823
253153
|
const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_13__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance); // no planarity tolerance needed
|
|
252824
|
-
|
|
253154
|
+
const announceEdge = (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(ptA, ptB));
|
|
253155
|
+
PolyfaceQuery.announceBoundaryEdges(source, announceEdge, true, false, false);
|
|
252825
253156
|
collector.announceChainsAsLineString3d(announceChain);
|
|
252826
253157
|
}
|
|
252827
253158
|
/**
|
|
@@ -252838,7 +253169,7 @@ class PolyfaceQuery {
|
|
|
252838
253169
|
const numFacets = PolyfaceQuery.visitorClientFacetCount(mesh);
|
|
252839
253170
|
const smoothEdges = PolyfaceQuery.collectEdgesByDihedralAngle(mesh, maxSmoothEdgeAngle);
|
|
252840
253171
|
const partitions = PolyfaceQuery.partitionFacetIndicesBySortableEdgeClusters(smoothEdges, numFacets);
|
|
252841
|
-
const builder =
|
|
253172
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
252842
253173
|
const visitor = mesh;
|
|
252843
253174
|
const planarPartitions = [];
|
|
252844
253175
|
const partitionNormals = []; // average normal in each nontrivial partition
|
|
@@ -252858,7 +253189,7 @@ class PolyfaceQuery {
|
|
|
252858
253189
|
if (_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.areaNormalGo(visitor.point, normal))
|
|
252859
253190
|
averageNormal.addInPlace(normal);
|
|
252860
253191
|
}
|
|
252861
|
-
partitionNormals.push(
|
|
253192
|
+
partitionNormals.push(_geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_17__.Ray3d.createCapture(point0, averageNormal));
|
|
252862
253193
|
planarPartitions.push(partition);
|
|
252863
253194
|
}
|
|
252864
253195
|
}
|
|
@@ -252867,8 +253198,8 @@ class PolyfaceQuery {
|
|
|
252867
253198
|
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(planarPartitions.length === fragmentPolyfaces.length);
|
|
252868
253199
|
const gapTolerance = 1.0e-4;
|
|
252869
253200
|
const planarityTolerance = 1.0e-4;
|
|
252870
|
-
const localToWorld =
|
|
252871
|
-
const worldToLocal =
|
|
253201
|
+
const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createIdentity();
|
|
253202
|
+
const worldToLocal = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_18__.Transform.createIdentity();
|
|
252872
253203
|
for (let i = 0; i < fragmentPolyfaces.length; ++i) {
|
|
252873
253204
|
const fragment = fragmentPolyfaces[i];
|
|
252874
253205
|
const edges = [];
|
|
@@ -252877,7 +253208,7 @@ class PolyfaceQuery {
|
|
|
252877
253208
|
edges.push(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(pointA, pointB));
|
|
252878
253209
|
edgeStrings.push([pointA.clone(), pointB.clone()]);
|
|
252879
253210
|
}, true, false, false);
|
|
252880
|
-
const chains =
|
|
253211
|
+
const chains = _curve_CurveOps__WEBPACK_IMPORTED_MODULE_19__.CurveOps.collectChains(edges, gapTolerance, planarityTolerance);
|
|
252881
253212
|
if (chains) {
|
|
252882
253213
|
// avoid FrameBuilder: it can flip the normal of a nonconvex facet!
|
|
252883
253214
|
partitionNormals[i].toRigidZFrame(localToWorld);
|
|
@@ -252887,11 +253218,11 @@ class PolyfaceQuery {
|
|
|
252887
253218
|
// But we aren't triangulating here. So if we don't have holes, we can skip regularization
|
|
252888
253219
|
// to avoid splitting the loop.
|
|
252889
253220
|
const regularize = !(chains instanceof _curve_Loop__WEBPACK_IMPORTED_MODULE_5__.Loop);
|
|
252890
|
-
const graph =
|
|
253221
|
+
const graph = _topology_Merging__WEBPACK_IMPORTED_MODULE_20__.HalfEdgeGraphMerge.formGraphFromChains(edgeStrings, regularize, _topology_Graph__WEBPACK_IMPORTED_MODULE_21__.HalfEdgeMask.BOUNDARY_EDGE);
|
|
252891
253222
|
if (graph) {
|
|
252892
|
-
|
|
253223
|
+
_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);
|
|
252893
253224
|
// this.purgeNullFaces(HalfEdgeMask.EXTERIOR);
|
|
252894
|
-
const polyface1 =
|
|
253225
|
+
const polyface1 = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.graphToPolyface(graph);
|
|
252895
253226
|
builder.addIndexedPolyface(polyface1, false, localToWorld);
|
|
252896
253227
|
}
|
|
252897
253228
|
}
|
|
@@ -252917,7 +253248,7 @@ class PolyfaceQuery {
|
|
|
252917
253248
|
static fillSimpleHoles(mesh, options, unfilledChains) {
|
|
252918
253249
|
if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
|
|
252919
253250
|
return this.fillSimpleHoles(mesh.createVisitor(0), options, unfilledChains);
|
|
252920
|
-
const builder =
|
|
253251
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
252921
253252
|
const chains = [];
|
|
252922
253253
|
PolyfaceQuery.announceBoundaryChainsAsLineString3d(mesh, (ls) => { ls.reverseInPlace(); chains.push(ls); });
|
|
252923
253254
|
for (const c of chains) {
|
|
@@ -252927,11 +253258,11 @@ class PolyfaceQuery {
|
|
|
252927
253258
|
rejected = true;
|
|
252928
253259
|
else if (options.maxEdgesAroundHole !== undefined && points.length > options.maxEdgesAroundHole)
|
|
252929
253260
|
rejected = true;
|
|
252930
|
-
else if (options.maxPerimeter !== undefined &&
|
|
253261
|
+
else if (options.maxPerimeter !== undefined && _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_23__.Point3dArray.sumEdgeLengths(points, false) > options.maxPerimeter)
|
|
252931
253262
|
rejected = true;
|
|
252932
253263
|
else if (options.upVector !== undefined && _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.sumTriangleAreasPerpendicularToUpVector(points, options.upVector) <= 0.0)
|
|
252933
253264
|
rejected = true;
|
|
252934
|
-
if (!rejected &&
|
|
253265
|
+
if (!rejected && _topology_SpaceTriangulation__WEBPACK_IMPORTED_MODULE_24__.SpacePolygonTriangulation.triangulateSimplestSpaceLoop(points, (_loop, triangles) => {
|
|
252935
253266
|
for (const t of triangles)
|
|
252936
253267
|
builder.addPolygon(t);
|
|
252937
253268
|
})) {
|
|
@@ -252955,13 +253286,13 @@ class PolyfaceQuery {
|
|
|
252955
253286
|
}
|
|
252956
253287
|
polyface.setNumWrap(0);
|
|
252957
253288
|
const polyfaces = [];
|
|
252958
|
-
const options =
|
|
253289
|
+
const options = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_25__.StrokeOptions.createForFacets();
|
|
252959
253290
|
options.needNormals = polyface.normal !== undefined;
|
|
252960
253291
|
options.needParams = polyface.param !== undefined;
|
|
252961
253292
|
options.needColors = polyface.color !== undefined;
|
|
252962
253293
|
options.needTwoSided = polyface.twoSided;
|
|
252963
253294
|
for (const partition of partitions) {
|
|
252964
|
-
const builder =
|
|
253295
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create(options);
|
|
252965
253296
|
polyface.reset();
|
|
252966
253297
|
for (const facetIndex of partition) {
|
|
252967
253298
|
polyface.moveToReadIndex(facetIndex);
|
|
@@ -252977,12 +253308,12 @@ class PolyfaceQuery {
|
|
|
252977
253308
|
return this.cloneFiltered(source.createVisitor(0), filter);
|
|
252978
253309
|
}
|
|
252979
253310
|
source.setNumWrap(0);
|
|
252980
|
-
const options =
|
|
253311
|
+
const options = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_25__.StrokeOptions.createForFacets();
|
|
252981
253312
|
options.needNormals = source.normal !== undefined;
|
|
252982
253313
|
options.needParams = source.param !== undefined;
|
|
252983
253314
|
options.needColors = source.color !== undefined;
|
|
252984
253315
|
options.needTwoSided = source.twoSided;
|
|
252985
|
-
const builder =
|
|
253316
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create(options);
|
|
252986
253317
|
source.reset();
|
|
252987
253318
|
for (; source.moveToNextFacet();) {
|
|
252988
253319
|
if (filter(source))
|
|
@@ -252994,12 +253325,12 @@ class PolyfaceQuery {
|
|
|
252994
253325
|
static cloneWithDanglingEdgesRemoved(source) {
|
|
252995
253326
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface)
|
|
252996
253327
|
return this.cloneWithDanglingEdgesRemoved(source.createVisitor(0));
|
|
252997
|
-
const options =
|
|
253328
|
+
const options = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_25__.StrokeOptions.createForFacets();
|
|
252998
253329
|
options.needNormals = source.normal !== undefined;
|
|
252999
253330
|
options.needParams = source.param !== undefined;
|
|
253000
253331
|
options.needColors = source.color !== undefined;
|
|
253001
253332
|
options.needTwoSided = source.twoSided;
|
|
253002
|
-
const builder =
|
|
253333
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create(options);
|
|
253003
253334
|
// Finds an odd palindrome in data as indexed by indices.
|
|
253004
253335
|
// An odd palindrome in a face loop corresponds to dangling edges in the face.
|
|
253005
253336
|
// If one is found, indices is mutated to excise the palindrome (data is untouched).
|
|
@@ -253157,7 +253488,7 @@ class PolyfaceQuery {
|
|
|
253157
253488
|
* * Input facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
253158
253489
|
*/
|
|
253159
253490
|
static sweepLineStringToFacetsXYReturnSweptFacets(lineStringPoints, polyface) {
|
|
253160
|
-
const builder =
|
|
253491
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
253161
253492
|
this.announceSweepLinestringToConvexPolyfaceXY(lineStringPoints, polyface, (_linestring, _segmentIndex, _polyface, _facetIndex, points) => {
|
|
253162
253493
|
if (points.length === 4)
|
|
253163
253494
|
builder.addQuadFacet(points);
|
|
@@ -253171,89 +253502,94 @@ class PolyfaceQuery {
|
|
|
253171
253502
|
return this.sweepLineStringToFacetsXYReturnSweptFacets(linestringPoints, polyface);
|
|
253172
253503
|
}
|
|
253173
253504
|
/**
|
|
253174
|
-
* Sweep the line string to intersections with a mesh.
|
|
253175
|
-
* * Return collected line segments.
|
|
253176
|
-
* * If no options are given, the default sweep direction is the z-axis, and chains are assembled and returned.
|
|
253177
|
-
* * See [[SweepLineStringToFacetsOptions]] for input and output options, including filtering by forward/side/rear facets.
|
|
253505
|
+
* Sweep the line string to intersections with a mesh and return collected line segments.
|
|
253178
253506
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the sweep direction.
|
|
253179
|
-
|
|
253180
|
-
|
|
253507
|
+
* @param points the linestring to drape onto the mesh.
|
|
253508
|
+
* @param source target facet set. For best results, facets should be convex and planar.
|
|
253509
|
+
* @param options input, filtering, search, and output options.
|
|
253510
|
+
* * If `undefined`, the default sweep direction is the positive z-axis, and chains are assembled and returned.
|
|
253511
|
+
* * For faster _vertical_ sweep, a pre-computed range tree can be supplied in `options.searcher`.
|
|
253512
|
+
* * For faster _non-vertical_ sweep, first transform inputs with the inverse of the transform
|
|
253513
|
+
* `T = Transform.createRigidFromOriginAndVector(undefined, options.vectorToEye)`, construct the searcher on these
|
|
253514
|
+
* local facets, call `sweepLineStringToFacets/XY` with these local inputs (and default sweep direction), and lastly,
|
|
253515
|
+
* transform the returned draped linework back to world coordinates with `T`.
|
|
253516
|
+
*/
|
|
253517
|
+
static sweepLineStringToFacets(points, source, options) {
|
|
253181
253518
|
let result = [];
|
|
253182
|
-
// setup default options
|
|
253183
253519
|
if (options === undefined)
|
|
253184
|
-
options = SweepLineStringToFacetsOptions.create(
|
|
253185
|
-
true, true, true, true);
|
|
253520
|
+
options = SweepLineStringToFacetsOptions.create();
|
|
253186
253521
|
let chainContext;
|
|
253187
253522
|
if (options.assembleChains)
|
|
253188
|
-
chainContext =
|
|
253189
|
-
const
|
|
253190
|
-
|
|
253191
|
-
|
|
253192
|
-
|
|
253193
|
-
|
|
253194
|
-
|
|
253195
|
-
|
|
253196
|
-
const
|
|
253197
|
-
|
|
253198
|
-
|
|
253199
|
-
|
|
253200
|
-
|
|
253201
|
-
|
|
253202
|
-
|
|
253203
|
-
|
|
253204
|
-
|
|
253523
|
+
chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_26__.ChainMergeContext.create();
|
|
253524
|
+
const addSegment = chainContext ? (ptA, ptB) => chainContext.addSegment(ptA, ptB) : (ptA, ptB) => result.push(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_12__.LineSegment3d.create(ptA, ptB));
|
|
253525
|
+
const workNormal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createZero();
|
|
253526
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.createVisitor(0) : source;
|
|
253527
|
+
visitor.setNumWrap(0);
|
|
253528
|
+
if (options.searcher && options.vectorToEye.isParallelTo(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ())) {
|
|
253529
|
+
const searchRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_27__.Range3d.createNull();
|
|
253530
|
+
const workPoint0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero();
|
|
253531
|
+
const workPoint1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero();
|
|
253532
|
+
let edgeClipper;
|
|
253533
|
+
const clipEdgeToConvexPolygon = (_facetRange, readIndex) => {
|
|
253534
|
+
if (visitor.moveToReadIndex(readIndex) && (options.collectAll || options.collectFromThisFacetNormal(_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.areaNormalGo(visitor.point, workNormal))))
|
|
253535
|
+
edgeClipper?.processPolygon(visitor.point, (ptA, ptB) => addSegment(ptA, ptB));
|
|
253536
|
+
return true;
|
|
253537
|
+
};
|
|
253538
|
+
for (let i = 1; i < points.length; i++) {
|
|
253539
|
+
points.getPoint3dAtUncheckedPointIndex(i - 1, workPoint0);
|
|
253540
|
+
points.getPoint3dAtUncheckedPointIndex(i, workPoint1);
|
|
253541
|
+
if (edgeClipper = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_14__.EdgeClipData.createPointPointSweep(workPoint0, workPoint1, options.vectorToEye)) {
|
|
253542
|
+
searchRange.setNull();
|
|
253543
|
+
searchRange.extend(workPoint0, workPoint1);
|
|
253544
|
+
options.searcher.searchRange2d(searchRange, clipEdgeToConvexPolygon);
|
|
253205
253545
|
}
|
|
253206
253546
|
}
|
|
253207
|
-
|
|
253208
|
-
|
|
253209
|
-
|
|
253547
|
+
}
|
|
253548
|
+
else {
|
|
253549
|
+
const context = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_14__.ClipSweptLineStringContext.create(points, options.vectorToEye);
|
|
253550
|
+
if (context) {
|
|
253551
|
+
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
253552
|
+
if (options.collectAll || options.collectFromThisFacetNormal(_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.areaNormalGo(visitor.point, workNormal)))
|
|
253553
|
+
context.processPolygon(visitor.point.getArray(), addSegment);
|
|
253554
|
+
}
|
|
253210
253555
|
}
|
|
253211
253556
|
}
|
|
253557
|
+
if (chainContext) {
|
|
253558
|
+
chainContext.clusterAndMergeVerticesXYZ();
|
|
253559
|
+
result = chainContext.collectMaximalChains();
|
|
253560
|
+
}
|
|
253212
253561
|
return result;
|
|
253213
253562
|
}
|
|
253214
253563
|
/**
|
|
253215
253564
|
* Sweep the line string in the z-direction to intersections with a mesh, using a search object for speedup.
|
|
253216
|
-
* @param
|
|
253217
|
-
* @param
|
|
253218
|
-
* @param
|
|
253219
|
-
* @example Using a 5x5 indexed search grid:
|
|
253220
|
-
* ```
|
|
253221
|
-
* const xyRange = Range2d.createFrom(myPolyface.range());
|
|
253222
|
-
* const searcher = GriddedRaggedRange2dSetWithOverflow.create<number>(xyRange, 5, 5)!;
|
|
253223
|
-
* for (const visitor = myPolyface.createVisitor(0); visitor.moveToNextFacet();) {
|
|
253224
|
-
* searcher.addRange(visitor.point.getRange(), visitor.currentReadIndex());
|
|
253225
|
-
* }
|
|
253226
|
-
* const drapedLineStrings = PolyfaceQuery.sweepLineStringToFacetsXY(lineString, myPolyface, searcher);
|
|
253227
|
-
* ```
|
|
253565
|
+
* @param points the linestring to drape onto the mesh.
|
|
253566
|
+
* @param source target facet set. For best results, facets should be convex and planar.
|
|
253567
|
+
* @param searcher object for searching facet 2D ranges tagged by mesh read index.
|
|
253228
253568
|
* @returns the collected line strings.
|
|
253229
|
-
|
|
253230
|
-
|
|
253231
|
-
|
|
253232
|
-
const
|
|
253233
|
-
const
|
|
253234
|
-
|
|
253235
|
-
|
|
253236
|
-
|
|
253237
|
-
|
|
253238
|
-
|
|
253239
|
-
let
|
|
253240
|
-
|
|
253241
|
-
|
|
253242
|
-
|
|
253243
|
-
|
|
253569
|
+
* @see [[sweepLineStringToFacets]] for further options.
|
|
253570
|
+
*/
|
|
253571
|
+
static sweepLineStringToFacetsXY(points, source, searcher) {
|
|
253572
|
+
const chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_26__.ChainMergeContext.create();
|
|
253573
|
+
const vectorToEye = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ();
|
|
253574
|
+
const searchRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_27__.Range3d.create();
|
|
253575
|
+
const workPoint0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero();
|
|
253576
|
+
const workPoint1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.createZero();
|
|
253577
|
+
const visitor = source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface ? source.createVisitor(0) : source;
|
|
253578
|
+
visitor.setNumWrap(0);
|
|
253579
|
+
let edgeClipper;
|
|
253580
|
+
const clipEdgeToConvexPolygon = (_facetRange, readIndex) => {
|
|
253581
|
+
if (visitor.moveToReadIndex(readIndex))
|
|
253582
|
+
edgeClipper?.processPolygon(visitor.point, (ptA, ptB) => chainContext.addSegment(ptA, ptB));
|
|
253583
|
+
return true;
|
|
253584
|
+
};
|
|
253585
|
+
const lineStringSource = Array.isArray(points) ? new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_28__.Point3dArrayCarrier(points) : points;
|
|
253244
253586
|
for (let i = 1; i < lineStringSource.length; i++) {
|
|
253245
|
-
|
|
253246
|
-
|
|
253247
|
-
|
|
253248
|
-
|
|
253249
|
-
|
|
253250
|
-
|
|
253251
|
-
searchRange.extendPoint(point1);
|
|
253252
|
-
searchByReadIndex.searchRange2d(searchRange, (_facetRange, readIndex) => {
|
|
253253
|
-
if (visitor.moveToReadIndex(readIndex))
|
|
253254
|
-
edgeClipper.processPolygon(visitor.point, (pointA, pointB) => chainContext.addSegment(pointA, pointB));
|
|
253255
|
-
return true;
|
|
253256
|
-
});
|
|
253587
|
+
lineStringSource.getPoint3dAtUncheckedPointIndex(i - 1, workPoint0);
|
|
253588
|
+
lineStringSource.getPoint3dAtUncheckedPointIndex(i, workPoint1);
|
|
253589
|
+
if (edgeClipper = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_14__.EdgeClipData.createPointPointSweep(workPoint0, workPoint1, vectorToEye)) {
|
|
253590
|
+
searchRange.setNull();
|
|
253591
|
+
searchRange.extend(workPoint0, workPoint1);
|
|
253592
|
+
searcher.searchRange2d(searchRange, clipEdgeToConvexPolygon);
|
|
253257
253593
|
}
|
|
253258
253594
|
}
|
|
253259
253595
|
chainContext.clusterAndMergeVerticesXYZ();
|
|
@@ -253268,20 +253604,16 @@ class PolyfaceQuery {
|
|
|
253268
253604
|
*/
|
|
253269
253605
|
static sweepLinestringToFacetsXYReturnLines(linestringPoints, polyface) {
|
|
253270
253606
|
const options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createSmallAngle(), false, true, true, true);
|
|
253271
|
-
|
|
253272
|
-
return result;
|
|
253607
|
+
return PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface, options);
|
|
253273
253608
|
}
|
|
253274
253609
|
/**
|
|
253275
253610
|
* Find segments (within the linestring) which project to facets.
|
|
253276
253611
|
* * Return chains.
|
|
253277
|
-
* * This calls [[sweepLineStringToFacets]] with options
|
|
253278
|
-
* `const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(),true, true, true, true);`
|
|
253612
|
+
* * This calls [[sweepLineStringToFacets]] with default options.
|
|
253279
253613
|
* @deprecated in 4.x. Use [[PolyfaceQuery.sweepLineStringToFacets]] to get further options.
|
|
253280
253614
|
*/
|
|
253281
253615
|
static sweepLinestringToFacetsXYReturnChains(linestringPoints, polyface) {
|
|
253282
|
-
|
|
253283
|
-
const result = PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface, options);
|
|
253284
|
-
return result;
|
|
253616
|
+
return PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface);
|
|
253285
253617
|
}
|
|
253286
253618
|
/**
|
|
253287
253619
|
* Find segments (within the linestring) which project to facets.
|
|
@@ -253293,7 +253625,7 @@ class PolyfaceQuery {
|
|
|
253293
253625
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
253294
253626
|
*/
|
|
253295
253627
|
static async asyncSweepLinestringToFacetsXYReturnChains(linestringPoints, polyface) {
|
|
253296
|
-
const chainContext =
|
|
253628
|
+
const chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_26__.ChainMergeContext.create();
|
|
253297
253629
|
await Promise.resolve(this.asyncAnnounceSweepLinestringToConvexPolyfaceXY(linestringPoints, polyface, (_linestring, _segmentIndex, _polyface, _facetIndex, points, indexA, indexB) => {
|
|
253298
253630
|
chainContext.addSegment(points[indexA], points[indexB]);
|
|
253299
253631
|
}));
|
|
@@ -253309,7 +253641,7 @@ class PolyfaceQuery {
|
|
|
253309
253641
|
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_7__.Polyface) {
|
|
253310
253642
|
return this.collectRangeLengthData(polyface.createVisitor(0));
|
|
253311
253643
|
}
|
|
253312
|
-
const rangeData = new
|
|
253644
|
+
const rangeData = new _RangeLengthData__WEBPACK_IMPORTED_MODULE_29__.RangeLengthData();
|
|
253313
253645
|
// polyface is a visitor
|
|
253314
253646
|
for (polyface.reset(); polyface.moveToNextFacet();)
|
|
253315
253647
|
rangeData.accumulateGrowableXYZArrayRange(polyface.point);
|
|
@@ -253322,9 +253654,9 @@ class PolyfaceQuery {
|
|
|
253322
253654
|
static cloneWithTVertexFixup(polyface) {
|
|
253323
253655
|
const oldFacetVisitor = polyface.createVisitor(1); // this is to visit the existing facets
|
|
253324
253656
|
const newFacetVisitor = polyface.createVisitor(0); // this is to build the new facets
|
|
253325
|
-
const rangeSearcher =
|
|
253326
|
-
const builder =
|
|
253327
|
-
const edgeRange =
|
|
253657
|
+
const rangeSearcher = _multiclip_XYPointBuckets__WEBPACK_IMPORTED_MODULE_30__.XYPointBuckets.create(polyface.data.point, 30);
|
|
253658
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
253659
|
+
const edgeRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_27__.Range3d.createNull();
|
|
253328
253660
|
const point0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
253329
253661
|
const point1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
253330
253662
|
const spacePoint = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
@@ -253456,7 +253788,7 @@ class PolyfaceQuery {
|
|
|
253456
253788
|
* @param clusterSelector indicates whether to copy 0, 1, or all facets in each cluster of duplicate facets.
|
|
253457
253789
|
*/
|
|
253458
253790
|
static cloneByFacetDuplication(source, includeSingletons, clusterSelector) {
|
|
253459
|
-
const builder =
|
|
253791
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
253460
253792
|
const visitor = source.createVisitor(0);
|
|
253461
253793
|
this.announceDuplicateFacetIndices(source, (clusterFacetIndices) => {
|
|
253462
253794
|
let numToSelect = 0;
|
|
@@ -253483,7 +253815,7 @@ class PolyfaceQuery {
|
|
|
253483
253815
|
static cloneWithColinearEdgeFixup(polyface) {
|
|
253484
253816
|
const oldFacetVisitor = polyface.createVisitor(2); // this is to visit the existing facets
|
|
253485
253817
|
const newFacetVisitor = polyface.createVisitor(0); // this is to build the new facets
|
|
253486
|
-
const builder =
|
|
253818
|
+
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
253487
253819
|
const vector01 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
253488
253820
|
const vector12 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create();
|
|
253489
253821
|
const numPoint = polyface.data.point.length;
|
|
@@ -253533,11 +253865,11 @@ class PolyfaceQuery {
|
|
|
253533
253865
|
static setEdgeVisibility(polyface, clusters, value) {
|
|
253534
253866
|
for (const cluster of clusters) {
|
|
253535
253867
|
if (cluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_11__.SortableEdge) {
|
|
253536
|
-
this.setSingleEdgeVisibility(polyface, cluster.facetIndex, cluster.
|
|
253868
|
+
this.setSingleEdgeVisibility(polyface, cluster.facetIndex, cluster.startVertex, value);
|
|
253537
253869
|
}
|
|
253538
253870
|
else if (Array.isArray(cluster)) {
|
|
253539
253871
|
for (const e1 of cluster)
|
|
253540
|
-
this.setSingleEdgeVisibility(polyface, e1.facetIndex, e1.
|
|
253872
|
+
this.setSingleEdgeVisibility(polyface, e1.facetIndex, e1.startVertex, value);
|
|
253541
253873
|
}
|
|
253542
253874
|
}
|
|
253543
253875
|
}
|
|
@@ -253639,8 +253971,8 @@ class PolyfaceQuery {
|
|
|
253639
253971
|
&& undefined !== PolyfaceQuery.computeFacetUnitNormal(visitor, e1.facetIndex, normal1)) {
|
|
253640
253972
|
const edgeAngle = normal0.smallerUnorientedAngleTo(normal1);
|
|
253641
253973
|
if (edgeAngle.radians > sharpEdgeAngle.radians) {
|
|
253642
|
-
this.setSingleEdgeVisibility(mesh, e0.facetIndex, e0.
|
|
253643
|
-
this.setSingleEdgeVisibility(mesh, e1.facetIndex, e1.
|
|
253974
|
+
this.setSingleEdgeVisibility(mesh, e0.facetIndex, e0.startVertex, true);
|
|
253975
|
+
this.setSingleEdgeVisibility(mesh, e1.facetIndex, e1.startVertex, true);
|
|
253644
253976
|
}
|
|
253645
253977
|
}
|
|
253646
253978
|
}
|
|
@@ -253676,7 +254008,7 @@ class PolyfaceQuery {
|
|
|
253676
254008
|
* @internal
|
|
253677
254009
|
*/
|
|
253678
254010
|
static convertToHalfEdgeGraph(mesh) {
|
|
253679
|
-
const builder = new
|
|
254011
|
+
const builder = new _topology_HalfEdgeGraphFromIndexedLoopsContext__WEBPACK_IMPORTED_MODULE_31__.HalfEdgeGraphFromIndexedLoopsContext();
|
|
253680
254012
|
const visitor = mesh.createVisitor(0);
|
|
253681
254013
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
253682
254014
|
builder.insertLoop(visitor.pointIndex);
|
|
@@ -253693,11 +254025,11 @@ class PolyfaceQuery {
|
|
|
253693
254025
|
}
|
|
253694
254026
|
/** Examine adjacent facet orientations throughout the mesh. If possible, reverse a subset to achieve proper pairing. */
|
|
253695
254027
|
static reorientVertexOrderAroundFacetsForConsistentOrientation(mesh) {
|
|
253696
|
-
return
|
|
254028
|
+
return _FacetOrientation__WEBPACK_IMPORTED_MODULE_32__.FacetOrientationFixup.doFixup(mesh);
|
|
253697
254029
|
}
|
|
253698
254030
|
/** Set up indexed normals with one normal in the plane of each facet of the mesh. */
|
|
253699
254031
|
static buildPerFaceNormals(polyface) {
|
|
253700
|
-
|
|
254032
|
+
_multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_33__.BuildAverageNormalsContext.buildPerFaceNormals(polyface);
|
|
253701
254033
|
}
|
|
253702
254034
|
/**
|
|
253703
254035
|
* * At each vertex of the mesh:
|
|
@@ -253711,7 +254043,7 @@ class PolyfaceQuery {
|
|
|
253711
254043
|
* @param toleranceAngle averaging is done between normals up to this angle.
|
|
253712
254044
|
*/
|
|
253713
254045
|
static buildAverageNormals(polyface, toleranceAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createDegrees(31.0)) {
|
|
253714
|
-
|
|
254046
|
+
_multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_33__.BuildAverageNormalsContext.buildFastAverageNormals(polyface, toleranceAngle);
|
|
253715
254047
|
}
|
|
253716
254048
|
/**
|
|
253717
254049
|
* Offset the faces of the mesh.
|
|
@@ -253721,9 +254053,9 @@ class PolyfaceQuery {
|
|
|
253721
254053
|
* @returns shifted mesh.
|
|
253722
254054
|
*/
|
|
253723
254055
|
static cloneOffset(source, signedOffsetDistance, offsetOptions = OffsetMeshOptions.create()) {
|
|
253724
|
-
const strokeOptions =
|
|
253725
|
-
const offsetBuilder =
|
|
253726
|
-
|
|
254056
|
+
const strokeOptions = _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_25__.StrokeOptions.createForFacets();
|
|
254057
|
+
const offsetBuilder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create(strokeOptions);
|
|
254058
|
+
_multiclip_OffsetMeshContext__WEBPACK_IMPORTED_MODULE_34__.OffsetMeshContext.buildOffsetMeshWithEdgeChamfers(source, offsetBuilder, signedOffsetDistance, offsetOptions);
|
|
253727
254059
|
return offsetBuilder.claimPolyface();
|
|
253728
254060
|
}
|
|
253729
254061
|
static _workTriangle;
|
|
@@ -253760,17 +254092,17 @@ class PolyfaceQuery {
|
|
|
253760
254092
|
const numEdges = visitor.pointCount; // #vertices = #edges since numWrap is zero
|
|
253761
254093
|
const vertices = visitor.point;
|
|
253762
254094
|
if (3 === numEdges) {
|
|
253763
|
-
const tri = this._workTriangle =
|
|
254095
|
+
const tri = this._workTriangle = _geometry3d_BarycentricTriangle__WEBPACK_IMPORTED_MODULE_35__.BarycentricTriangle.create(vertices.getPoint3dAtUncheckedPointIndex(0), vertices.getPoint3dAtUncheckedPointIndex(1), vertices.getPoint3dAtUncheckedPointIndex(2), this._workTriangle);
|
|
253764
254096
|
const detail3 = this._workTriDetail = tri.intersectRay3d(ray, this._workTriDetail);
|
|
253765
254097
|
tri.snapLocationToEdge(detail3, options?.distanceTolerance, options?.parameterTolerance);
|
|
253766
|
-
detail = this._workFacetDetail3 =
|
|
254098
|
+
detail = this._workFacetDetail3 = _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_36__.TriangularFacetLocationDetail.create(visitor.currentReadIndex(), detail3, this._workFacetDetail3);
|
|
253767
254099
|
}
|
|
253768
254100
|
else {
|
|
253769
254101
|
const detailN = this._workPolyDetail = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.intersectRay3d(vertices, ray, tol, this._workPolyDetail);
|
|
253770
254102
|
if (_geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_8__.PolygonOps.isConvex(vertices))
|
|
253771
|
-
detail = this._workFacetDetailC =
|
|
254103
|
+
detail = this._workFacetDetailC = _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_36__.ConvexFacetLocationDetail.create(visitor.currentReadIndex(), numEdges, detailN, this._workFacetDetailC);
|
|
253772
254104
|
else
|
|
253773
|
-
detail = this._workFacetDetailNC =
|
|
254105
|
+
detail = this._workFacetDetailNC = _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_36__.NonConvexFacetLocationDetail.create(visitor.currentReadIndex(), numEdges, detailN, this._workFacetDetailNC);
|
|
253774
254106
|
}
|
|
253775
254107
|
if (detail.isInsideOrOn) { // set optional caches, process the intersection
|
|
253776
254108
|
if (options?.needNormal && visitor.normal)
|
|
@@ -254410,14 +254742,14 @@ let numNodeCreated = 0;
|
|
|
254410
254742
|
* * _range = the union of ranges below in the heap
|
|
254411
254743
|
* * _appData = application data associated with the node.
|
|
254412
254744
|
* * Construction methods may place multiple _appData items in each node.
|
|
254413
|
-
*
|
|
254745
|
+
* * In common use, only the leaves will have _appData. However, the class definitions allow _appData at all nodes, and search algorithms must include them.
|
|
254414
254746
|
* * CONSTRUCTION
|
|
254415
254747
|
* * The RangeTreeNode.createByIndexSplits method constructs the tree with simple right-left splits within an array of input items.
|
|
254416
254748
|
* * The appData is placed entirely in the leaves.
|
|
254417
|
-
* * caller can specify:
|
|
254749
|
+
* * The caller can specify:
|
|
254418
254750
|
* * the number of _appData items per leaf
|
|
254419
254751
|
* * the number of children per node within the tree.
|
|
254420
|
-
* * "
|
|
254752
|
+
* * 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:
|
|
254421
254753
|
* * faster search because lower nodes have smaller ranges that will be skipped by search algorithms.
|
|
254422
254754
|
* * larger memory use because of more nodes
|
|
254423
254755
|
* * For future construction methods:
|
|
@@ -257330,15 +257662,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
257330
257662
|
/* harmony export */ EdgeClipData: () => (/* binding */ EdgeClipData),
|
|
257331
257663
|
/* harmony export */ SweepLineStringToFacetContext: () => (/* binding */ SweepLineStringToFacetContext)
|
|
257332
257664
|
/* harmony export */ });
|
|
257333
|
-
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
257334
|
-
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
257335
|
-
/* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
|
|
257336
|
-
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
257337
|
-
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
257338
257665
|
/* harmony import */ var _clipping_ClipPlane__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../clipping/ClipPlane */ "../../core/geometry/lib/esm/clipping/ClipPlane.js");
|
|
257339
257666
|
/* harmony import */ var _clipping_ConvexClipPlaneSet__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../clipping/ConvexClipPlaneSet */ "../../core/geometry/lib/esm/clipping/ConvexClipPlaneSet.js");
|
|
257340
|
-
/* harmony import */ var
|
|
257667
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
257341
257668
|
/* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
|
|
257669
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
257670
|
+
/* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
|
|
257671
|
+
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
257672
|
+
/* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
|
|
257673
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
257342
257674
|
/*---------------------------------------------------------------------------------------------
|
|
257343
257675
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
257344
257676
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -257361,24 +257693,23 @@ class SweepLineStringToFacetContext {
|
|
|
257361
257693
|
_numSpacePoints;
|
|
257362
257694
|
constructor(spacePoints) {
|
|
257363
257695
|
this._spacePoints = spacePoints;
|
|
257364
|
-
this._spacePointsRange =
|
|
257365
|
-
spacePoints.setRange(this._spacePointsRange);
|
|
257696
|
+
this._spacePointsRange = spacePoints.getRange();
|
|
257366
257697
|
this._numSpacePoints = this._spacePoints.length;
|
|
257367
257698
|
}
|
|
257368
257699
|
static create(xyz) {
|
|
257369
257700
|
if (xyz.length > 1) {
|
|
257370
|
-
return new SweepLineStringToFacetContext(xyz
|
|
257701
|
+
return new SweepLineStringToFacetContext(xyz);
|
|
257371
257702
|
}
|
|
257372
257703
|
return undefined;
|
|
257373
257704
|
}
|
|
257374
257705
|
// temporaries reused over multiple calls to process a single facet . ..
|
|
257375
|
-
_segmentPoint0 =
|
|
257376
|
-
_segmentPoint1 =
|
|
257377
|
-
_localSegmentPoint0 =
|
|
257378
|
-
_localSegmentPoint1 =
|
|
257379
|
-
_clipFractions =
|
|
257380
|
-
_localFrame =
|
|
257381
|
-
_polygonRange =
|
|
257706
|
+
_segmentPoint0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
257707
|
+
_segmentPoint1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
257708
|
+
_localSegmentPoint0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
257709
|
+
_localSegmentPoint1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
257710
|
+
_clipFractions = _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_1__.Segment1d.create(0, 1);
|
|
257711
|
+
_localFrame = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createIdentity();
|
|
257712
|
+
_polygonRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_3__.Range3d.create();
|
|
257382
257713
|
/** process a single polygon.
|
|
257383
257714
|
* @returns number crudely indicating how much work was done.
|
|
257384
257715
|
*/
|
|
@@ -257454,7 +257785,7 @@ class EdgeClipData {
|
|
|
257454
257785
|
}
|
|
257455
257786
|
/** create object from segment and sweep. Inputs are not captured. */
|
|
257456
257787
|
static createPointPointSweep(pointA, pointB, sweep) {
|
|
257457
|
-
const edgeVector =
|
|
257788
|
+
const edgeVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.createStartEnd(pointA, pointB);
|
|
257458
257789
|
const fraction = edgeVector.fractionOfProjectionToVector(sweep);
|
|
257459
257790
|
// The unbounded plane of the swept edge will intersect facets in lines that may extend beyond the swept bounded line.
|
|
257460
257791
|
// That linework will be clipped between two facing planes with normal along the perpendicular dropped from the edge vector to the sweep vector.
|
|
@@ -257503,16 +257834,16 @@ class ClipSweptLineStringContext {
|
|
|
257503
257834
|
}
|
|
257504
257835
|
static create(xyz, sweepVector) {
|
|
257505
257836
|
if (sweepVector === undefined)
|
|
257506
|
-
sweepVector =
|
|
257837
|
+
sweepVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create(0, 0, 1);
|
|
257507
257838
|
if (xyz.length > 1) {
|
|
257508
|
-
const point =
|
|
257509
|
-
const newPoint =
|
|
257839
|
+
const point = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
|
|
257840
|
+
const newPoint = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.createZero();
|
|
257510
257841
|
const edgeData = [];
|
|
257511
257842
|
xyz.getPoint3dAtUncheckedPointIndex(0, point);
|
|
257512
257843
|
let localToWorldMatrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_8__.Matrix3d.createRigidHeadsUp(sweepVector);
|
|
257513
257844
|
if (localToWorldMatrix === undefined)
|
|
257514
257845
|
localToWorldMatrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_8__.Matrix3d.createIdentity();
|
|
257515
|
-
const localToWorld =
|
|
257846
|
+
const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createOriginAndMatrix(point, localToWorldMatrix);
|
|
257516
257847
|
const worldToLocal = localToWorld.inverse();
|
|
257517
257848
|
const localRange = xyz.getRange(worldToLocal);
|
|
257518
257849
|
for (let i = 1; i < xyz.length; i++) {
|
|
@@ -257533,7 +257864,7 @@ class ClipSweptLineStringContext {
|
|
|
257533
257864
|
*/
|
|
257534
257865
|
processPolygon(polygon, announceEdge) {
|
|
257535
257866
|
if (this._worldToLocal !== undefined && this._localRange !== undefined) {
|
|
257536
|
-
const polygonRange =
|
|
257867
|
+
const polygonRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_3__.Range3d.createTransformedArray(this._worldToLocal, polygon);
|
|
257537
257868
|
if (!polygonRange.intersectsRangeXY(this._localRange))
|
|
257538
257869
|
return;
|
|
257539
257870
|
}
|
|
@@ -270290,10 +270621,9 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
270290
270621
|
|
|
270291
270622
|
|
|
270292
270623
|
/**
|
|
270293
|
-
* A LinearSweep is a `SolidPrimitive` defined by
|
|
270294
|
-
* * A set of curves (any Loop, Path, or parityRegion)
|
|
270624
|
+
* A LinearSweep is a `SolidPrimitive` defined by:
|
|
270625
|
+
* * A set of curves (any Loop, Path, or parityRegion). If the object is "capped", the curves must be planar.
|
|
270295
270626
|
* * A sweep vector
|
|
270296
|
-
* If the object is "capped", the curves must be planar.
|
|
270297
270627
|
* @public
|
|
270298
270628
|
*/
|
|
270299
270629
|
class LinearSweep extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive {
|
|
@@ -270460,8 +270790,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
270460
270790
|
|
|
270461
270791
|
|
|
270462
270792
|
/**
|
|
270463
|
-
* A RotationalSweep is
|
|
270464
|
-
* * A planar contour (any Loop, Path, or parityRegion)
|
|
270793
|
+
* A RotationalSweep is:
|
|
270794
|
+
* * A planar contour (any Loop, Path, or parityRegion)
|
|
270465
270795
|
* * An axis vector.
|
|
270466
270796
|
* * The planar contour is expected to be in the plane of the axis vector.
|
|
270467
270797
|
* * The contour may have points and/or lines that are on the axis, but otherwise is entirely on one side of the axis.
|
|
@@ -272181,7 +272511,7 @@ class ChainMergeContext {
|
|
|
272181
272511
|
}
|
|
272182
272512
|
return n;
|
|
272183
272513
|
}
|
|
272184
|
-
/** Collect chains which have maximum edge count, broken at
|
|
272514
|
+
/** Collect chains which have maximum edge count, broken at vertices with more than 2 edges.
|
|
272185
272515
|
* * This is assumed to be preceded by a call to a vertex-cluster step such as `clusterAndMergeVerticesYXZ`
|
|
272186
272516
|
*/
|
|
272187
272517
|
collectMaximalChains() {
|
|
@@ -312813,7 +313143,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
312813
313143
|
/***/ ((module) => {
|
|
312814
313144
|
|
|
312815
313145
|
"use strict";
|
|
312816
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.0-dev.
|
|
313146
|
+
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"}}');
|
|
312817
313147
|
|
|
312818
313148
|
/***/ })
|
|
312819
313149
|
|