@itwin/rpcinterface-full-stack-tests 4.7.0-dev.7 → 4.7.0-dev.8
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 +1048 -851
- 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_loaders_gl_draco_3_1_6_node_modules_loaders_gl_draco_di-0642a6.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_meshoptimizer_0_20_0_node_modules_meshoptimizer_index_m-a5ae61.bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -202651,17 +202651,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
202651
202651
|
/* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
|
|
202652
202652
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
202653
202653
|
/* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
|
|
202654
|
-
/* harmony import */ var
|
|
202654
|
+
/* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
|
|
202655
202655
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
202656
202656
|
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
202657
202657
|
/* harmony import */ var _numerics_Newton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../numerics/Newton */ "../../core/geometry/lib/esm/numerics/Newton.js");
|
|
202658
|
-
/* harmony import */ var
|
|
202658
|
+
/* harmony import */ var _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../numerics/Polynomials */ "../../core/geometry/lib/esm/numerics/Polynomials.js");
|
|
202659
202659
|
/* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
202660
202660
|
/* harmony import */ var _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../CurveChainWithDistanceIndex */ "../../core/geometry/lib/esm/curve/CurveChainWithDistanceIndex.js");
|
|
202661
202661
|
/* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
202662
202662
|
/* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
|
|
202663
202663
|
/* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
202664
|
-
/* harmony import */ var
|
|
202664
|
+
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
202665
202665
|
/*---------------------------------------------------------------------------------------------
|
|
202666
202666
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
202667
202667
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -202991,6 +202991,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
202991
202991
|
* Check different combination of fractions on curveA and curveB. If distance between points at 2 fractions
|
|
202992
202992
|
* is less than maxDistance, record CurveLocationDetailPair which is the approach between the 2 points.
|
|
202993
202993
|
* Optionally, record close approaches of one curve's points if they fall between the other curve's points.
|
|
202994
|
+
* * If an input curve is a LineString3d, then the corresponding fractions must define a segment of the line string.
|
|
202994
202995
|
* @param cpA curveA
|
|
202995
202996
|
* @param fA0 fraction0 on curveA
|
|
202996
202997
|
* @param fA1 fraction1 on curveA
|
|
@@ -203026,7 +203027,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203026
203027
|
*/
|
|
203027
203028
|
getPointCurveClosestApproachXYNewton(curveP, pointQ) {
|
|
203028
203029
|
if (!(curveP instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) && !(curveP instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d)) {
|
|
203029
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
203030
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"getPointCurveClosestApproachXYNewton only supports Arc3d and LineSegment");
|
|
203030
203031
|
return undefined;
|
|
203031
203032
|
}
|
|
203032
203033
|
const seeds = [0.2, 0.4, 0.6, 0.8]; // HEURISTIC: arcs have up to 4 perpendiculars; lines have only 1
|
|
@@ -203054,9 +203055,24 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203054
203055
|
return _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveFractionPoint(curveP, minCurvePFraction, minPointP);
|
|
203055
203056
|
return undefined;
|
|
203056
203057
|
}
|
|
203057
|
-
/**
|
|
203058
|
+
/**
|
|
203059
|
+
* Find the closest approach between `pointA` and `cpB`. Add the approach if it's within `fB0` and `fB1`.
|
|
203060
|
+
* * Does not test the endpoints of `cpB`.
|
|
203061
|
+
* * The only types supported for `cpB` are Arc3d, LineSegment3d, and LineString3d.
|
|
203062
|
+
* * If `cpB` is a LineString3d, then the interval `[fB0, fB1]` must correspond to a segment of the line string.
|
|
203063
|
+
*/
|
|
203058
203064
|
testAndRecordProjection(cpA, fA, pointA, cpB, fB0, fB1, reversed) {
|
|
203059
|
-
|
|
203065
|
+
let detail;
|
|
203066
|
+
if (cpB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
203067
|
+
const segParamsB = cpB.globalFractionToSegmentIndexAndLocalFraction(fB0 <= fB1 ? fB0 : fB1);
|
|
203068
|
+
const segIndexB = (segParamsB.fraction < 0.999999) ? segParamsB.index : segParamsB.index + 1;
|
|
203069
|
+
const segmentB = cpB.getIndexedSegment(segIndexB);
|
|
203070
|
+
if (segmentB && (detail = this.getPointCurveClosestApproachXYNewton(segmentB, pointA)))
|
|
203071
|
+
_LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.convertLocalToGlobalDetail(detail, segIndexB, cpB.numEdges(), cpB);
|
|
203072
|
+
}
|
|
203073
|
+
else {
|
|
203074
|
+
detail = this.getPointCurveClosestApproachXYNewton(cpB, pointA);
|
|
203075
|
+
}
|
|
203060
203076
|
if (detail) {
|
|
203061
203077
|
const fB = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.restrictToInterval(detail.fraction, fB0, fB1);
|
|
203062
203078
|
if (fB === detail.fraction) { // if fraction is within fB0 and fB1
|
|
@@ -203116,15 +203132,15 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203116
203132
|
const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.center, 1); // det(A0, A1, C)
|
|
203117
203133
|
const beta = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector0, 0); // det(A0, A1, U)
|
|
203118
203134
|
const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector90, 0); // det(A0, A1, V)
|
|
203119
|
-
const cosines = new
|
|
203120
|
-
const sines = new
|
|
203121
|
-
const radians = new
|
|
203122
|
-
const numRoots =
|
|
203135
|
+
const cosines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__.GrowableFloat64Array(2);
|
|
203136
|
+
const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__.GrowableFloat64Array(2);
|
|
203137
|
+
const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__.GrowableFloat64Array(2);
|
|
203138
|
+
const numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_9__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(// solve the equation
|
|
203123
203139
|
alpha, beta, gamma, cosines, sines, radians);
|
|
203124
203140
|
for (let i = 0; i < numRoots; i++) {
|
|
203125
203141
|
const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
|
|
203126
203142
|
const arcFraction = data.sweep.radiansToSignedPeriodicFraction(radians.atUncheckedIndex(i));
|
|
203127
|
-
const lineFraction =
|
|
203143
|
+
const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_9__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
|
|
203128
203144
|
// only add if the point is within the start and end fractions of both line segment and arc
|
|
203129
203145
|
if (lineFraction !== undefined && this.acceptFraction(lineFraction) && this.acceptFraction(arcFraction)) {
|
|
203130
203146
|
this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
|
|
@@ -203144,7 +203160,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203144
203160
|
for (const radians1 of [parallelRadians, parallelRadians + Math.PI]) {
|
|
203145
203161
|
const arcPoint = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
|
|
203146
203162
|
const arcFraction = data.sweep.radiansToSignedPeriodicFraction(radians1);
|
|
203147
|
-
const lineFraction =
|
|
203163
|
+
const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_9__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
|
|
203148
203164
|
// only add if the point is within the start and end fractions of both line segment and arc
|
|
203149
203165
|
if (lineFraction !== undefined && this.acceptFraction(lineFraction) && this.acceptFraction(arcFraction)) {
|
|
203150
203166
|
this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
|
|
@@ -203188,27 +203204,27 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203188
203204
|
}
|
|
203189
203205
|
/** Low level dispatch of arc with (beziers of) a bspline curve */
|
|
203190
203206
|
dispatchArcBsplineCurve3d(cpA, cpB, reversed) {
|
|
203191
|
-
const ls =
|
|
203207
|
+
const ls = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
203192
203208
|
cpB.emitStrokes(ls);
|
|
203193
203209
|
this.computeArcLineString(cpA, ls, reversed);
|
|
203194
203210
|
}
|
|
203195
203211
|
/** Low level dispatch of (beziers of) a bspline curve with (beziers of) a bspline curve */
|
|
203196
203212
|
dispatchBSplineCurve3dBSplineCurve3d(bcurveA, bcurveB, reversed) {
|
|
203197
|
-
const lsA =
|
|
203213
|
+
const lsA = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
203198
203214
|
bcurveA.emitStrokes(lsA);
|
|
203199
|
-
const lsB =
|
|
203215
|
+
const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
203200
203216
|
bcurveB.emitStrokes(lsB);
|
|
203201
203217
|
this.computeLineStringLineString(lsA, lsB, reversed);
|
|
203202
203218
|
}
|
|
203203
203219
|
/** Low level dispatch of linestring with (beziers of) a bspline curve */
|
|
203204
203220
|
dispatchLineStringBSplineCurve(lsA, curveB, reversed) {
|
|
203205
|
-
const lsB =
|
|
203221
|
+
const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
203206
203222
|
curveB.emitStrokes(lsB);
|
|
203207
203223
|
this.computeLineStringLineString(lsA, lsB, reversed);
|
|
203208
203224
|
}
|
|
203209
203225
|
/** Low level dispatch of segment with (beziers of) a bspline curve */
|
|
203210
203226
|
dispatchSegmentBsplineCurve(segA, curveB, reversed) {
|
|
203211
|
-
const lsB =
|
|
203227
|
+
const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
203212
203228
|
curveB.emitStrokes(lsB);
|
|
203213
203229
|
this.computeSegmentLineString(segA, lsB, reversed);
|
|
203214
203230
|
}
|
|
@@ -203268,7 +203284,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203268
203284
|
if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_11__.CurveChainWithDistanceIndex))
|
|
203269
203285
|
return;
|
|
203270
203286
|
if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_11__.CurveChainWithDistanceIndex) {
|
|
203271
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
203287
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
203272
203288
|
return;
|
|
203273
203289
|
}
|
|
203274
203290
|
const index0 = this._results.length;
|
|
@@ -203286,7 +203302,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203286
203302
|
const segmentB = this._geometryB;
|
|
203287
203303
|
this.dispatchSegmentSegment(segmentA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, segmentB, segmentB.point0Ref, 0.0, segmentB.point1Ref, 1.0, false);
|
|
203288
203304
|
}
|
|
203289
|
-
else if (this._geometryB instanceof
|
|
203305
|
+
else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
203290
203306
|
this.computeSegmentLineString(segmentA, this._geometryB, false);
|
|
203291
203307
|
}
|
|
203292
203308
|
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
|
|
@@ -203381,7 +203397,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203381
203397
|
}
|
|
203382
203398
|
/** Double dispatch handler for strongly typed linestring. */
|
|
203383
203399
|
handleLineString3d(lsA) {
|
|
203384
|
-
if (this._geometryB instanceof
|
|
203400
|
+
if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
203385
203401
|
const lsB = this._geometryB;
|
|
203386
203402
|
this.computeLineStringLineString(lsA, lsB, false);
|
|
203387
203403
|
}
|
|
@@ -203407,7 +203423,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203407
203423
|
if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d) {
|
|
203408
203424
|
this.dispatchSegmentArc(this._geometryB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, arc0, true);
|
|
203409
203425
|
}
|
|
203410
|
-
else if (this._geometryB instanceof
|
|
203426
|
+
else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
203411
203427
|
this.computeArcLineString(arc0, this._geometryB, false);
|
|
203412
203428
|
}
|
|
203413
203429
|
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
|
|
@@ -203429,7 +203445,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
203429
203445
|
if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d) {
|
|
203430
203446
|
this.dispatchSegmentBsplineCurve(this._geometryB, curve, true);
|
|
203431
203447
|
}
|
|
203432
|
-
else if (this._geometryB instanceof
|
|
203448
|
+
else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
203433
203449
|
this.dispatchLineStringBSplineCurve(this._geometryB, curve, true);
|
|
203434
203450
|
}
|
|
203435
203451
|
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
|
|
@@ -204218,7 +204234,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
204218
204234
|
if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_12__.CurveChainWithDistanceIndex))
|
|
204219
204235
|
return;
|
|
204220
204236
|
if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_12__.CurveChainWithDistanceIndex) {
|
|
204221
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
204237
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
204222
204238
|
return;
|
|
204223
204239
|
}
|
|
204224
204240
|
const index0 = this._results.length;
|
|
@@ -205006,7 +205022,7 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
205006
205022
|
if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_8__.CurveChainWithDistanceIndex))
|
|
205007
205023
|
return;
|
|
205008
205024
|
if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_8__.CurveChainWithDistanceIndex) {
|
|
205009
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
205025
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
205010
205026
|
return;
|
|
205011
205027
|
}
|
|
205012
205028
|
const index0 = this._results.length;
|
|
@@ -222387,10 +222403,10 @@ class Vector3d extends XYZ {
|
|
|
222387
222403
|
return _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createAtan2(this.crossProductXY(vectorB), this.dotProductXY(vectorB));
|
|
222388
222404
|
}
|
|
222389
222405
|
/**
|
|
222390
|
-
* Return the angle in radians (not as strongly-typed Angle) from this vector to vectorB
|
|
222391
|
-
* in their containing plane whose normal lies in the same half-space as vectorW
|
|
222406
|
+
* Return the angle in radians (not as strongly-typed Angle) from `this` vector to `vectorB`, measured
|
|
222407
|
+
* in their containing plane whose normal lies in the same half-space as `vectorW`.
|
|
222392
222408
|
* * The returned angle is between `-Math.PI` and `Math.PI`.
|
|
222393
|
-
* * If the cross product of this vector and vectorB lies on the same side of the plane as vectorW
|
|
222409
|
+
* * If the cross product of `this` vector and `vectorB` lies on the same side of the plane as `vectorW`,
|
|
222394
222410
|
* this function returns `radiansTo(vectorB)`; otherwise, it returns `-radiansTo(vectorB)`.
|
|
222395
222411
|
* * `vectorW` does not have to be perpendicular to the plane.
|
|
222396
222412
|
* * Use `planarRadiansTo` to measure the angle between vectors that are projected to another plane.
|
|
@@ -222398,6 +222414,7 @@ class Vector3d extends XYZ {
|
|
|
222398
222414
|
* @param vectorW determines the side of the plane in which the returned angle is measured
|
|
222399
222415
|
*/
|
|
222400
222416
|
signedRadiansTo(vectorB, vectorW) {
|
|
222417
|
+
// A.B = |A||B|cos(theta) and |AxB| = |A||B|sin(theta) so theta = arctan(|AxB|/A.B)
|
|
222401
222418
|
const p = this.crossProduct(vectorB);
|
|
222402
222419
|
const theta = Math.atan2(p.magnitude(), this.dotProduct(vectorB));
|
|
222403
222420
|
if (vectorW.dotProduct(p) < 0.0)
|
|
@@ -223091,6 +223108,25 @@ class Point3dArray {
|
|
|
223091
223108
|
}
|
|
223092
223109
|
return result;
|
|
223093
223110
|
}
|
|
223111
|
+
/**
|
|
223112
|
+
* Copy 3d points into a packed number array.
|
|
223113
|
+
* @param data array of xyz
|
|
223114
|
+
* @param result optional destination array.
|
|
223115
|
+
* @return packed number array
|
|
223116
|
+
*/
|
|
223117
|
+
static packToNumberArray(data, result) {
|
|
223118
|
+
const numValues = 3 * data.length;
|
|
223119
|
+
if (!result)
|
|
223120
|
+
result = Array(numValues);
|
|
223121
|
+
result.length = numValues;
|
|
223122
|
+
let i = 0;
|
|
223123
|
+
for (const p of data) {
|
|
223124
|
+
result[i++] = p.x;
|
|
223125
|
+
result[i++] = p.y;
|
|
223126
|
+
result[i++] = p.z;
|
|
223127
|
+
}
|
|
223128
|
+
return result;
|
|
223129
|
+
}
|
|
223094
223130
|
/**
|
|
223095
223131
|
* Compute the 8 weights of trilinear mapping
|
|
223096
223132
|
* By appropriate choice of weights, this can be used for both point and derivative mappings.
|
|
@@ -238249,7 +238285,7 @@ var AuxChannelDataType;
|
|
|
238249
238285
|
* @public
|
|
238250
238286
|
*/
|
|
238251
238287
|
class AuxChannelData {
|
|
238252
|
-
/**
|
|
238288
|
+
/** Constructor. If `values` is a number array, it is captured. */
|
|
238253
238289
|
constructor(input, values) {
|
|
238254
238290
|
this.input = input;
|
|
238255
238291
|
if (values instanceof Float64Array) {
|
|
@@ -238281,7 +238317,7 @@ class AuxChannelData {
|
|
|
238281
238317
|
* @public
|
|
238282
238318
|
*/
|
|
238283
238319
|
class AuxChannel {
|
|
238284
|
-
/**
|
|
238320
|
+
/** Constructor with CAPTURED inputs. */
|
|
238285
238321
|
constructor(data, dataType, name, inputName) {
|
|
238286
238322
|
this.data = data;
|
|
238287
238323
|
this.dataType = dataType;
|
|
@@ -238307,15 +238343,23 @@ class AuxChannel {
|
|
|
238307
238343
|
return false;
|
|
238308
238344
|
return true;
|
|
238309
238345
|
}
|
|
238310
|
-
/** True if
|
|
238346
|
+
/** True if the data type is 1-dimensional. */
|
|
238347
|
+
static isScalar(dataType) {
|
|
238348
|
+
return dataType === AuxChannelDataType.Distance || dataType === AuxChannelDataType.Scalar;
|
|
238349
|
+
}
|
|
238350
|
+
/** True if the data stored in this AuxChannel is 1-dimensional. */
|
|
238311
238351
|
get isScalar() {
|
|
238312
|
-
return
|
|
238352
|
+
return AuxChannel.isScalar(this.dataType);
|
|
238313
238353
|
}
|
|
238314
|
-
/** The
|
|
238354
|
+
/** The dimension (1D or 3D) of each datum of an AuxChannel of the given type. */
|
|
238355
|
+
static entriesPerValue(dataType) {
|
|
238356
|
+
return this.isScalar(dataType) ? 1 : 3;
|
|
238357
|
+
}
|
|
238358
|
+
/** The dimension (1D or 3D) of each datum in the data arrays of this AuxChannel. */
|
|
238315
238359
|
get entriesPerValue() {
|
|
238316
|
-
return this.
|
|
238360
|
+
return AuxChannel.entriesPerValue(this.dataType);
|
|
238317
238361
|
}
|
|
238318
|
-
/** The number of
|
|
238362
|
+
/** The number of data stored in each data array of this AuxChannel, equal to the length of the array divided by `entriesPerValue`. */
|
|
238319
238363
|
get valueCount() {
|
|
238320
238364
|
return 0 === this.data.length ? 0 : this.data[0].values.length / this.entriesPerValue;
|
|
238321
238365
|
}
|
|
@@ -238345,16 +238389,20 @@ class AuxChannel {
|
|
|
238345
238389
|
return result;
|
|
238346
238390
|
}
|
|
238347
238391
|
}
|
|
238348
|
-
/**
|
|
238392
|
+
/**
|
|
238393
|
+
* The `PolyfaceAuxData` structure contains one or more analytical data channels for each vertex of a [[Polyface]], allowing the polyface to be styled
|
|
238349
238394
|
* using an [AnalysisStyle]($common).
|
|
238350
|
-
* Typically a polyface will contain only vertex data required for its basic display:
|
|
238351
|
-
*
|
|
238352
|
-
*
|
|
238353
|
-
*
|
|
238395
|
+
* Typically a polyface will contain only vertex data required for its basic display: vertex position, normal, texture parameter, color.
|
|
238396
|
+
* `PolyfaceAuxData` provides supplemental per-vertex data that is generally computed in an analysis program or other external data source.
|
|
238397
|
+
* This supplemental data can be either 1D (e.g., height, override color) or 3D (e.g., displacement vector, override normal); see [[AuxChannel.entriesPerValue]], [[AuxChannel.dataType]].
|
|
238398
|
+
* All data channels are indexed by the same indices, which must have the same length and structure as the other Polyface indices.
|
|
238399
|
+
* This means that if a facet's face loop is found at index range [i0,i1] in the Polyface vertex index array, then the same index range [i0,i1]
|
|
238400
|
+
* locates the data for this facet in all the other Polyface index arrays, including the `PolyfaceAuxData` indices.
|
|
238354
238401
|
* @see [[PolyfaceData.auxData]] to associate auxiliary data with a polyface.
|
|
238355
238402
|
* @public
|
|
238356
238403
|
*/
|
|
238357
238404
|
class PolyfaceAuxData {
|
|
238405
|
+
/** Constructor with CAPTURED inputs. */
|
|
238358
238406
|
constructor(channels, indices) {
|
|
238359
238407
|
this.channels = channels;
|
|
238360
238408
|
this.indices = indices;
|
|
@@ -239876,7 +239924,8 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
239876
239924
|
* * Example: suppose `[6,7,8]` is the pointIndex array representing a triangle. First edge would be `6,7`. Second
|
|
239877
239925
|
* edge is `7,8`. Third edge is `8,6`. To access `6` for the third edge, we have to go back to the start of array.
|
|
239878
239926
|
* Therefore, it is useful to store `6` at the end of pointIndex array, i.e., `[6,7,8,6]` meaning `numWrap = 1`.
|
|
239879
|
-
*
|
|
239927
|
+
* Continuing this example, `numWrap = 2` (i.e., `[6,7,8,6,7]`) is useful when each vertex visit requires the next
|
|
239928
|
+
* two points, e.g., to form two adjacent vectors for a cross product.
|
|
239880
239929
|
*/
|
|
239881
239930
|
setNumWrap(numWrap) {
|
|
239882
239931
|
this._numWrap = numWrap;
|
|
@@ -240530,11 +240579,38 @@ class IndexedPolyface extends Polyface {
|
|
|
240530
240579
|
cleanupOpenFacet() {
|
|
240531
240580
|
this.data.trimAllIndexArrays(this.data.pointIndex.length);
|
|
240532
240581
|
}
|
|
240582
|
+
/**
|
|
240583
|
+
* Validate (the tail of) the active index arrays: point, normal, param, color.
|
|
240584
|
+
* @param index0 optional offset into the index arrays at which to start validating indices. Default 0.
|
|
240585
|
+
* @param errors optional array appended with error message(s) if invalid indices are encountered
|
|
240586
|
+
* @return whether the indices are valid
|
|
240587
|
+
*/
|
|
240588
|
+
validateAllIndices(index0 = 0, errors) {
|
|
240589
|
+
const numPointIndices = this.data.pointIndex.length;
|
|
240590
|
+
const messages = errors ?? [];
|
|
240591
|
+
if (this.data.normalIndex && this.data.normalIndex.length !== numPointIndices)
|
|
240592
|
+
messages.push("normalIndex count must match pointIndex count");
|
|
240593
|
+
if (this.data.paramIndex && this.data.paramIndex.length !== numPointIndices)
|
|
240594
|
+
messages.push("paramIndex count must equal pointIndex count");
|
|
240595
|
+
if (this.data.colorIndex && this.data.colorIndex.length !== numPointIndices)
|
|
240596
|
+
messages.push("colorIndex count must equal pointIndex count");
|
|
240597
|
+
if (this.data.edgeVisible.length !== numPointIndices)
|
|
240598
|
+
messages.push("visibleIndex count must equal pointIndex count");
|
|
240599
|
+
if (!Polyface.areIndicesValid(this.data.pointIndex, index0, numPointIndices, this.data.point, this.data.point ? this.data.point.length : 0))
|
|
240600
|
+
messages.push("invalid point indices in the last facet");
|
|
240601
|
+
if (!Polyface.areIndicesValid(this.data.normalIndex, index0, numPointIndices, this.data.normal, this.data.normal ? this.data.normal.length : 0))
|
|
240602
|
+
messages.push("invalid normal indices in the last facet");
|
|
240603
|
+
if (!Polyface.areIndicesValid(this.data.paramIndex, index0, numPointIndices, this.data.param, this.data.param ? this.data.param.length : 0))
|
|
240604
|
+
messages.push("invalid param indices in the last facet");
|
|
240605
|
+
if (!Polyface.areIndicesValid(this.data.colorIndex, index0, numPointIndices, this.data.color, this.data.color ? this.data.color.length : 0))
|
|
240606
|
+
messages.push("invalid color indices in the last facet");
|
|
240607
|
+
return 0 === messages.length;
|
|
240608
|
+
}
|
|
240533
240609
|
/**
|
|
240534
240610
|
* Announce the end of construction of a facet.
|
|
240535
240611
|
* * Optionally check for:
|
|
240536
240612
|
* * Same number of indices among all active index arrays -- point, normal, param, color
|
|
240537
|
-
* * All indices are within bounds of the respective data arrays.
|
|
240613
|
+
* * All indices for the latest facet are within bounds of the respective data arrays.
|
|
240538
240614
|
* * In error cases, all index arrays are trimmed back to the size when previous facet was terminated.
|
|
240539
240615
|
* * A return value of `undefined` is normal. Otherwise, a string array of error messages is returned.
|
|
240540
240616
|
*/
|
|
@@ -240548,22 +240624,7 @@ class IndexedPolyface extends Polyface {
|
|
|
240548
240624
|
const messages = [];
|
|
240549
240625
|
if (lengthB < lengthA + 2)
|
|
240550
240626
|
messages.push("Less than 3 indices in the last facet");
|
|
240551
|
-
|
|
240552
|
-
messages.push("normalIndex count must match pointIndex count");
|
|
240553
|
-
if (this.data.paramIndex && this.data.paramIndex.length !== lengthB)
|
|
240554
|
-
messages.push("paramIndex count must equal pointIndex count");
|
|
240555
|
-
if (this.data.colorIndex && this.data.colorIndex.length !== lengthB)
|
|
240556
|
-
messages.push("colorIndex count must equal pointIndex count");
|
|
240557
|
-
if (this.data.edgeVisible.length !== lengthB)
|
|
240558
|
-
messages.push("visibleIndex count must equal pointIndex count");
|
|
240559
|
-
if (!Polyface.areIndicesValid(this.data.pointIndex, lengthA, lengthB, this.data.point, this.data.point ? this.data.point.length : 0))
|
|
240560
|
-
messages.push("invalid point indices in the last facet");
|
|
240561
|
-
if (!Polyface.areIndicesValid(this.data.normalIndex, lengthA, lengthB, this.data.normal, this.data.normal ? this.data.normal.length : 0))
|
|
240562
|
-
messages.push("invalid normal indices in the last facet");
|
|
240563
|
-
if (!Polyface.areIndicesValid(this.data.paramIndex, lengthA, lengthB, this.data.param, this.data.param ? this.data.param.length : 0))
|
|
240564
|
-
messages.push("invalid param indices in the last facet");
|
|
240565
|
-
if (!Polyface.areIndicesValid(this.data.colorIndex, lengthA, lengthB, this.data.color, this.data.color ? this.data.color.length : 0))
|
|
240566
|
-
messages.push("invalid color indices in the last facet");
|
|
240627
|
+
this.validateAllIndices(lengthA, messages);
|
|
240567
240628
|
if (messages.length > 0) {
|
|
240568
240629
|
this.data.trimAllIndexArrays(lengthA);
|
|
240569
240630
|
return messages;
|
|
@@ -243795,10 +243856,11 @@ class PolyfaceData {
|
|
|
243795
243856
|
}
|
|
243796
243857
|
/**
|
|
243797
243858
|
* Compress the instance by equating duplicate data.
|
|
243798
|
-
* * Search for duplicates within
|
|
243859
|
+
* * Search for duplicates within vertices, normals, params, and colors.
|
|
243799
243860
|
* * Compress each data array.
|
|
243800
243861
|
* * Revise all indexing for the relocated data.
|
|
243801
|
-
*
|
|
243862
|
+
* * [[PolyfaceAuxData]] is compressed if and only if exactly one [[AuxChannelData]] is present.
|
|
243863
|
+
* @param tolerance (optional) tolerance for clustering mesh vertices only. Default value, and the tolerance used to cluster all other data, is [[Geometry.smallMetricDistance]].
|
|
243802
243864
|
*/
|
|
243803
243865
|
compress(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.smallMetricDistance) {
|
|
243804
243866
|
// more info can be found at geometry/internaldocs/Polyface.md
|
|
@@ -243821,6 +243883,20 @@ class PolyfaceData {
|
|
|
243821
243883
|
this.color = packedColors.packedNumbers;
|
|
243822
243884
|
packedColors.updateIndices(this.colorIndex);
|
|
243823
243885
|
}
|
|
243886
|
+
if (this.auxData && this.auxData.channels.length === 1 && this.auxData.channels[0].data.length === 1) {
|
|
243887
|
+
const dataSize = this.auxData.channels[0].entriesPerValue;
|
|
243888
|
+
if (1 === dataSize) {
|
|
243889
|
+
const packedData = _numerics_ClusterableArray__WEBPACK_IMPORTED_MODULE_9__.ClusterableArray.clusterNumberArray(this.auxData.channels[0].data[0].values);
|
|
243890
|
+
this.auxData.channels[0].data[0].values = packedData.packedNumbers;
|
|
243891
|
+
packedData.updateIndices(this.auxData.indices);
|
|
243892
|
+
}
|
|
243893
|
+
else if (3 === dataSize) {
|
|
243894
|
+
const blockedData = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_0__.GrowableXYZArray.create(this.auxData.channels[0].data[0].values);
|
|
243895
|
+
const packedData = _numerics_ClusterableArray__WEBPACK_IMPORTED_MODULE_9__.ClusterableArray.clusterGrowablePoint3dArray(blockedData);
|
|
243896
|
+
this.auxData.channels[0].data[0].values = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.NumberArray.create(packedData.growablePackedPoints.float64Data());
|
|
243897
|
+
packedData.updateIndices(this.auxData.indices);
|
|
243898
|
+
}
|
|
243899
|
+
}
|
|
243824
243900
|
}
|
|
243825
243901
|
/**
|
|
243826
243902
|
* Test if `facetStartIndex` is (minimally) valid.
|
|
@@ -244033,6 +244109,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
244033
244109
|
* @module Polyface
|
|
244034
244110
|
*/
|
|
244035
244111
|
/* eslint-disable @typescript-eslint/naming-convention, no-empty */
|
|
244112
|
+
// cspell:word internaldocs
|
|
244036
244113
|
|
|
244037
244114
|
|
|
244038
244115
|
|
|
@@ -244075,8 +244152,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
244075
244152
|
* @public
|
|
244076
244153
|
*/
|
|
244077
244154
|
class SweepLineStringToFacetsOptions {
|
|
244078
|
-
/**
|
|
244079
|
-
*/
|
|
244155
|
+
/** Constructor. Captures fully-checked parameters from static create method. */
|
|
244080
244156
|
constructor(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets) {
|
|
244081
244157
|
this.vectorToEye = vectorToEye;
|
|
244082
244158
|
this.sideAngle = sideAngle;
|
|
@@ -244085,20 +244161,27 @@ class SweepLineStringToFacetsOptions {
|
|
|
244085
244161
|
this.collectOnSideFacets = collectOnSideFacets;
|
|
244086
244162
|
this.collectOnRearFacets = collectOnRearFacets;
|
|
244087
244163
|
}
|
|
244088
|
-
/**
|
|
244089
|
-
*
|
|
244090
|
-
* * Default
|
|
244091
|
-
* * Default
|
|
244092
|
-
* * Default
|
|
244164
|
+
/**
|
|
244165
|
+
* Create an options structure.
|
|
244166
|
+
* * Default `vectorToEye` is (0,0,1).
|
|
244167
|
+
* * Default `sideAngle` is `Geometry.smallAngleRadians`.
|
|
244168
|
+
* * Default `assembleChains` is `true`.
|
|
244169
|
+
* * Default `collectOnForwardFacets`, `collectOnSideFacets`, `collectOnRearFacets` are all `true`.
|
|
244093
244170
|
*/
|
|
244094
244171
|
static create(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets) {
|
|
244095
244172
|
return new SweepLineStringToFacetsOptions(vectorToEye === undefined ? _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.unitZ() : vectorToEye.clone(), sideAngle === undefined ? _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallAngleRadians) : sideAngle.clone(), _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.resolveValue(assembleChains, true), _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.resolveValue(collectOnForwardFacets, true), _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.resolveValue(collectOnSideFacets, true), _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.resolveValue(collectOnRearFacets, true));
|
|
244096
244173
|
}
|
|
244097
|
-
/** Return true if all outputs are requested */
|
|
244098
|
-
get collectAll() {
|
|
244099
|
-
|
|
244100
|
-
|
|
244101
|
-
|
|
244174
|
+
/** Return `true` if all outputs are requested. */
|
|
244175
|
+
get collectAll() {
|
|
244176
|
+
return this.collectOnForwardFacets === true &&
|
|
244177
|
+
this.collectOnSideFacets === true &&
|
|
244178
|
+
this.collectOnRearFacets === true;
|
|
244179
|
+
}
|
|
244180
|
+
/**
|
|
244181
|
+
* Decide if the instance collector flags accept a facet with the given normal.
|
|
244182
|
+
* * A facet whose facet normal has a positive, zero, or negative dot product with `vectorToEye` is classified
|
|
244183
|
+
* as forward, side, or rear, respectively.
|
|
244184
|
+
* * `undefined` facet normal returns `false`.
|
|
244102
244185
|
*/
|
|
244103
244186
|
collectFromThisFacetNormal(facetNormal) {
|
|
244104
244187
|
if (facetNormal === undefined)
|
|
@@ -244112,22 +244195,27 @@ class SweepLineStringToFacetsOptions {
|
|
|
244112
244195
|
/**
|
|
244113
244196
|
* Options carrier for [[PolyfaceQuery.cloneOffset]].
|
|
244114
244197
|
* * Default options are strongly recommended.
|
|
244115
|
-
* * The option most likely to be changed is
|
|
244198
|
+
* * The option most likely to be changed is `chamferAngleBetweenNormals`.
|
|
244116
244199
|
* @public
|
|
244117
244200
|
*/
|
|
244118
244201
|
class OffsetMeshOptions {
|
|
244119
|
-
/** Constructor -- CAPTURE parameters
|
|
244120
|
-
constructor(smoothSingleAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(25), smoothAccumulatedAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(60),
|
|
244202
|
+
/** Constructor -- CAPTURE parameters. */
|
|
244203
|
+
constructor(smoothSingleAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(25), smoothAccumulatedAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(60), chamferAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(90)) {
|
|
244121
244204
|
this.smoothSingleAngleBetweenNormals = smoothSingleAngleBetweenNormals.clone();
|
|
244122
244205
|
this.smoothAccumulatedAngleBetweenNormals = smoothAccumulatedAngleBetweenNormals.clone();
|
|
244123
|
-
this.chamferAngleBetweenNormals =
|
|
244206
|
+
this.chamferAngleBetweenNormals = chamferAngleBetweenNormals.clone();
|
|
244124
244207
|
}
|
|
244125
|
-
/**
|
|
244208
|
+
/**
|
|
244209
|
+
* Construct and return an `OffsetMeshOptions` with given parameters.
|
|
244126
244210
|
* * Angles are forced to minimum values.
|
|
244127
244211
|
* * Clones of the angles are given to the constructor.
|
|
244128
|
-
* @param smoothSingleRadiansBetweenNormals an angle larger than this (between facets) is considered a sharp edge
|
|
244129
|
-
*
|
|
244130
|
-
* @param
|
|
244212
|
+
* @param smoothSingleRadiansBetweenNormals an angle larger than this (between facets) is considered a sharp edge.
|
|
244213
|
+
* Default value is `25` degrees.
|
|
244214
|
+
* @param smoothAccumulatedAngleBetweenNormals angles that sum to this much may be consolidated for average normal.
|
|
244215
|
+
* Default value is `60` degrees.
|
|
244216
|
+
* @param chamferTurnAngleBetweenNormals when facets meet and the turn angle (i.e., angle between facet normals)
|
|
244217
|
+
* is larger than `chamferTurnAngleBetweenNormals`, a chamfer edge may be added to prevent offset mesh from having
|
|
244218
|
+
* facets that extend out too far away from the source mesh. Default value is `120` degrees.
|
|
244131
244219
|
*/
|
|
244132
244220
|
static create(smoothSingleAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(25), smoothAccumulatedAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(60), chamferTurnAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(120)) {
|
|
244133
244221
|
const mySmoothSingleRadiansBetweenNormals = smoothSingleAngleBetweenNormals.clone();
|
|
@@ -244143,25 +244231,27 @@ class OffsetMeshOptions {
|
|
|
244143
244231
|
}
|
|
244144
244232
|
}
|
|
244145
244233
|
/**
|
|
244146
|
-
* Enumeration of cases for retaining facets among duplicates
|
|
244234
|
+
* Enumeration of cases for retaining facets among duplicates.
|
|
244147
244235
|
* @public
|
|
244148
244236
|
*/
|
|
244149
244237
|
var DuplicateFacetClusterSelector;
|
|
244150
244238
|
(function (DuplicateFacetClusterSelector) {
|
|
244151
|
-
/**
|
|
244239
|
+
/** Retain none of the duplicates. */
|
|
244152
244240
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectNone"] = 0] = "SelectNone";
|
|
244153
|
-
/**
|
|
244241
|
+
/** Retain any one member among duplicates. */
|
|
244154
244242
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectAny"] = 1] = "SelectAny";
|
|
244155
|
-
/**
|
|
244243
|
+
/** Retain all members among duplicates. */
|
|
244156
244244
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectAll"] = 2] = "SelectAll";
|
|
244157
|
-
/**
|
|
244245
|
+
/** Retain one from any cluster with an odd number of faces. */
|
|
244158
244246
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectOneByParity"] = 3] = "SelectOneByParity";
|
|
244159
244247
|
})(DuplicateFacetClusterSelector || (DuplicateFacetClusterSelector = {}));
|
|
244160
|
-
/**
|
|
244248
|
+
/**
|
|
244249
|
+
* PolyfaceQuery is a static class whose methods implement queries on a `Polyface` or `PolyfaceVisitor` provided as a
|
|
244250
|
+
* parameter to each method.
|
|
244161
244251
|
* @public
|
|
244162
244252
|
*/
|
|
244163
244253
|
class PolyfaceQuery {
|
|
244164
|
-
/**
|
|
244254
|
+
/** Copy the points from a visitor into a linestring loop. */
|
|
244165
244255
|
static visitorToLoop(visitor) {
|
|
244166
244256
|
const ls = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d.createPoints(visitor.point.getPoint3dArray());
|
|
244167
244257
|
return _curve_Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.create(ls);
|
|
@@ -244176,11 +244266,15 @@ class PolyfaceQuery {
|
|
|
244176
244266
|
}
|
|
244177
244267
|
return result;
|
|
244178
244268
|
}
|
|
244179
|
-
/**
|
|
244180
|
-
*
|
|
244181
|
-
|
|
244269
|
+
/**
|
|
244270
|
+
* Sum all facet areas.
|
|
244271
|
+
* @param source polyface or visitor.
|
|
244272
|
+
* @param vectorToEye compute sum of (signed) facet areas projected to a view plane perpendicular to `vectorToEye`.
|
|
244273
|
+
* If `vectorToEye` is not provided, actual facet areas are calculated (without any projection).
|
|
244274
|
+
* @returns the sum of all facet areas. Return 0 if `source` is `undefined`.
|
|
244275
|
+
*/
|
|
244182
244276
|
static sumFacetAreas(source, vectorToEye) {
|
|
244183
|
-
let
|
|
244277
|
+
let sum = 0;
|
|
244184
244278
|
if (source !== undefined) {
|
|
244185
244279
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
244186
244280
|
return PolyfaceQuery.sumFacetAreas(source.createVisitor(1), vectorToEye);
|
|
@@ -244189,20 +244283,21 @@ class PolyfaceQuery {
|
|
|
244189
244283
|
unitVectorToEye = vectorToEye.normalize();
|
|
244190
244284
|
source.reset();
|
|
244191
244285
|
while (source.moveToNextFacet()) {
|
|
244192
|
-
const
|
|
244193
|
-
|
|
244286
|
+
const areaNormal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.areaNormal(source.point.getPoint3dArray());
|
|
244287
|
+
sum += unitVectorToEye ? areaNormal.dotProduct(unitVectorToEye) : areaNormal.magnitude();
|
|
244194
244288
|
}
|
|
244195
244289
|
}
|
|
244196
|
-
return
|
|
244290
|
+
return sum;
|
|
244197
244291
|
}
|
|
244198
|
-
/**
|
|
244199
|
-
*
|
|
244292
|
+
/**
|
|
244293
|
+
* Sum volumes of tetrahedra from origin to all facets.
|
|
244294
|
+
* * If origin is `undefined`, the first point encountered (by the visitor) is used as origin.
|
|
244200
244295
|
* * If the mesh is closed, this sum is the volume.
|
|
244201
|
-
* * If the mesh is not closed, this sum is the volume of a mesh with various additional facets
|
|
244202
|
-
*
|
|
244203
|
-
|
|
244296
|
+
* * If the mesh is not closed, this sum is the volume of a mesh with various additional facets from the origin
|
|
244297
|
+
* to facets.
|
|
244298
|
+
*/
|
|
244204
244299
|
static sumTetrahedralVolumes(source, origin) {
|
|
244205
|
-
let
|
|
244300
|
+
let sum = 0;
|
|
244206
244301
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
244207
244302
|
return PolyfaceQuery.sumTetrahedralVolumes(source.createVisitor(0), origin);
|
|
244208
244303
|
let myOrigin = origin;
|
|
@@ -244217,17 +244312,18 @@ class PolyfaceQuery {
|
|
|
244217
244312
|
for (let i = 1; i + 1 < source.point.length; i++) {
|
|
244218
244313
|
source.point.getPoint3dAtUncheckedPointIndex(i, targetA);
|
|
244219
244314
|
source.point.getPoint3dAtUncheckedPointIndex(i + 1, targetB);
|
|
244220
|
-
|
|
244315
|
+
sum += myOrigin.tripleProductToPoints(facetOrigin, targetA, targetB);
|
|
244221
244316
|
}
|
|
244222
244317
|
}
|
|
244223
|
-
return
|
|
244318
|
+
return sum / 6.0;
|
|
244224
244319
|
}
|
|
244225
|
-
/**
|
|
244320
|
+
/**
|
|
244321
|
+
* Sum (signed) volumes between facets and a plane.
|
|
244226
244322
|
* Return a structure with multiple sums:
|
|
244227
244323
|
* * volume = the sum of (signed) volumes between facets and the plane.
|
|
244228
|
-
* *
|
|
244229
|
-
*
|
|
244230
|
-
|
|
244324
|
+
* * positiveProjectedFacetAreaMoments, negativeProjectedFacetAreaMoments = moment data with centroid, area, and second
|
|
244325
|
+
* moments with respect to the centroid.
|
|
244326
|
+
*/
|
|
244231
244327
|
static sumVolumeBetweenFacetsAndPlane(source, plane) {
|
|
244232
244328
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
244233
244329
|
return PolyfaceQuery.sumVolumeBetweenFacetsAndPlane(source.createVisitor(0), plane);
|
|
@@ -244245,18 +244341,18 @@ class PolyfaceQuery {
|
|
|
244245
244341
|
const singleFacetProducts = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__.Matrix4d.createZero();
|
|
244246
244342
|
const projectToPlane = plane.getProjectionToPlane();
|
|
244247
244343
|
source.reset();
|
|
244248
|
-
// For each facet
|
|
244249
|
-
//
|
|
244250
|
-
//
|
|
244251
|
-
// each
|
|
244252
|
-
// each volume contribution is
|
|
244344
|
+
// For each facet:
|
|
244345
|
+
// - form triangles from facet origin to each far edge.
|
|
244346
|
+
// - sum signed area and volume contributions.
|
|
244347
|
+
// each projected area contribution is twice the area of a triangle.
|
|
244348
|
+
// each volume contribution is 3 times the actual volume -- (1/3) of the altitude sums was the centroid altitude.
|
|
244253
244349
|
while (source.moveToNextFacet()) {
|
|
244254
244350
|
source.point.getPoint3dAtUncheckedPointIndex(0, facetOrigin);
|
|
244255
244351
|
h0 = plane.altitude(facetOrigin);
|
|
244256
244352
|
singleFacetArea = 0;
|
|
244257
244353
|
// within a single facets, the singleFacetArea sum is accumulated with signs of individual triangles.
|
|
244258
|
-
//
|
|
244259
|
-
//
|
|
244354
|
+
// for a non-convex facet, this can be a mixture of positive and negative areas.
|
|
244355
|
+
// the absoluteProjectedAreaSum contribution is forced positive after the sum for the facet.
|
|
244260
244356
|
for (let i = 1; i + 1 < source.point.length; i++) {
|
|
244261
244357
|
source.point.getPoint3dAtUncheckedPointIndex(i, targetA);
|
|
244262
244358
|
source.point.getPoint3dAtUncheckedPointIndex(i + 1, targetB);
|
|
@@ -244287,7 +244383,7 @@ class PolyfaceQuery {
|
|
|
244287
244383
|
negativeProjectedFacetAreaMoments: negativeAreaMoments,
|
|
244288
244384
|
};
|
|
244289
244385
|
}
|
|
244290
|
-
/** Return the inertia products [xx,xy,xz,xw,
|
|
244386
|
+
/** Return the inertia products [xx,xy,xz,xw,yw, etc] integrated over all all facets as viewed from origin. */
|
|
244291
244387
|
static sumFacetSecondAreaMomentProducts(source, origin) {
|
|
244292
244388
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
244293
244389
|
return PolyfaceQuery.sumFacetSecondAreaMomentProducts(source.createVisitor(0), origin);
|
|
@@ -244298,7 +244394,7 @@ class PolyfaceQuery {
|
|
|
244298
244394
|
}
|
|
244299
244395
|
return products;
|
|
244300
244396
|
}
|
|
244301
|
-
/** Return the inertia products [xx,xy,xz,xw,
|
|
244397
|
+
/** Return the inertia products [xx,xy,xz,xw,yw, etc] integrated over all tetrahedral volumes from origin. */
|
|
244302
244398
|
static sumFacetSecondVolumeMomentProducts(source, origin) {
|
|
244303
244399
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
244304
244400
|
return PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source.createVisitor(0), origin);
|
|
@@ -244309,10 +244405,11 @@ class PolyfaceQuery {
|
|
|
244309
244405
|
}
|
|
244310
244406
|
return products;
|
|
244311
244407
|
}
|
|
244312
|
-
/**
|
|
244313
|
-
*
|
|
244314
|
-
* *
|
|
244315
|
-
* *
|
|
244408
|
+
/**
|
|
244409
|
+
* Compute area moments for the mesh. In the returned `MomentData`:
|
|
244410
|
+
* * `origin` is the centroid.
|
|
244411
|
+
* * `localToWorldMap` has the origin and principal directions.
|
|
244412
|
+
* * `radiiOfGyration` radii for rotation around the x,y,z axes.
|
|
244316
244413
|
*/
|
|
244317
244414
|
static computePrincipalAreaMoments(source) {
|
|
244318
244415
|
const origin = source.data.getPoint(0);
|
|
@@ -244321,12 +244418,13 @@ class PolyfaceQuery {
|
|
|
244321
244418
|
const inertiaProducts = PolyfaceQuery.sumFacetSecondAreaMomentProducts(source, origin);
|
|
244322
244419
|
return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
|
|
244323
244420
|
}
|
|
244324
|
-
/**
|
|
244325
|
-
*
|
|
244326
|
-
* *
|
|
244327
|
-
* *
|
|
244421
|
+
/**
|
|
244422
|
+
* Compute area moments for the mesh. In the returned MomentData:
|
|
244423
|
+
* * `origin` is the centroid.
|
|
244424
|
+
* * `localToWorldMap` has the origin and principal directions.
|
|
244425
|
+
* * `radiiOfGyration` radii for rotation around the x,y,z axes.
|
|
244328
244426
|
* * The result is only valid if the mesh is closed.
|
|
244329
|
-
* * There is no test for closure.
|
|
244427
|
+
* * There is no test for closure. Use `PolyfaceQuery.isPolyfaceClosedByEdgePairing(polyface)` to test for closure.
|
|
244330
244428
|
*/
|
|
244331
244429
|
static computePrincipalVolumeMoments(source) {
|
|
244332
244430
|
const origin = source.data.getPoint(0);
|
|
@@ -244335,8 +244433,10 @@ class PolyfaceQuery {
|
|
|
244335
244433
|
const inertiaProducts = PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source, origin);
|
|
244336
244434
|
return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
|
|
244337
244435
|
}
|
|
244338
|
-
/**
|
|
244339
|
-
*
|
|
244436
|
+
/**
|
|
244437
|
+
* Determine whether all facets are convex.
|
|
244438
|
+
* @param source polyface or visitor.
|
|
244439
|
+
* @returns `true` if all facets are convex; `false` otherwise.
|
|
244340
244440
|
*/
|
|
244341
244441
|
static areFacetsConvex(source) {
|
|
244342
244442
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -244353,55 +244453,67 @@ class PolyfaceQuery {
|
|
|
244353
244453
|
}
|
|
244354
244454
|
/**
|
|
244355
244455
|
* Test for convex volume by dihedral angle tests on all edges.
|
|
244356
|
-
* * This tests if all dihedral angles are positive.
|
|
244357
|
-
* * In a closed solid, this is a strong test for overall convexity.
|
|
244358
|
-
* *
|
|
244456
|
+
* * This tests if all dihedral angles of the mesh are positive.
|
|
244457
|
+
* * In a closed solid, this is a strong test for overall mesh convexity with outward facing normals.
|
|
244458
|
+
* * See [[dihedralAngleSummary]] for the definition of "dihedral angle".
|
|
244459
|
+
* * With `ignoreBoundaries` true, this may be a useful test when all the facets are in a single edge-connected
|
|
244460
|
+
* component, such as a pyramid with no underside.
|
|
244359
244461
|
* * It is not a correct test if there are multiple, disjoint components.
|
|
244360
|
-
*
|
|
244361
|
-
*
|
|
244362
|
-
*
|
|
244363
|
-
* @param source mesh
|
|
244364
|
-
* @param ignoreBoundaries if true
|
|
244365
|
-
* @returns true if
|
|
244462
|
+
* * Take the above-mentioned pyramid with no underside.
|
|
244463
|
+
* * Within the same mesh, have a second pyramid placed to the side, still facing upward.
|
|
244464
|
+
* * The angles will pass the dihedral convexity test, but the composite thing surely is not convex.
|
|
244465
|
+
* @param source mesh.
|
|
244466
|
+
* @param ignoreBoundaries if `true` ignore simple boundary edges, i.e., allow unclosed meshes. Default is `false`.
|
|
244467
|
+
* @returns true if all dihedral angles of the mesh are positive.
|
|
244366
244468
|
*/
|
|
244367
244469
|
static isConvexByDihedralAngleCount(source, ignoreBoundaries = false) {
|
|
244368
244470
|
return this.dihedralAngleSummary(source, ignoreBoundaries) > 0;
|
|
244369
244471
|
}
|
|
244370
244472
|
/**
|
|
244371
244473
|
* Compute a number summarizing the dihedral angles in the mesh.
|
|
244372
|
-
*
|
|
244373
|
-
*
|
|
244374
|
-
* @param
|
|
244375
|
-
* @
|
|
244376
|
-
*
|
|
244377
|
-
*
|
|
244378
|
-
*
|
|
244379
|
-
*
|
|
244380
|
-
*
|
|
244381
|
-
*
|
|
244474
|
+
* * A dihedral angle is the signed angle between adjacent facets' normals. This angle is positive when the cross
|
|
244475
|
+
* product `normalA x normalB` has the same direction as facetA's traversal of the facets' shared edge.
|
|
244476
|
+
* @param source mesh.
|
|
244477
|
+
* @param ignoreBoundaries if `true` ignore simple boundary edges, i.e., allow unclosed meshes. Default is `false`.
|
|
244478
|
+
* See [[isConvexByDihedralAngleCount]] for comments about passing true when there are multiple
|
|
244479
|
+
* connected components.
|
|
244480
|
+
* * Return `0` if all dihedral angles are zero (and `ignoreBoundaries === true`). The mesh is planar.
|
|
244481
|
+
* * Otherwise, return `1` if all dihedral angles are non-negative. The mesh probably encloses a convex volume and
|
|
244482
|
+
* has outward normals.
|
|
244483
|
+
* * Otherwise, return `-1` if all dihedral angles are non-positive. The mesh probably encloses a convex volume and
|
|
244484
|
+
* has inward normals.
|
|
244485
|
+
* * Otherwise, return `-2`. Also return `-2` if a non-manifold condition was detected, or a facet normal could not
|
|
244486
|
+
* be computed. A non-manifold condition is a positive-length edge adjacent to more than 2 facets or (if
|
|
244487
|
+
* `ignoreBoundaries` is false) adjacent to exactly one facet.
|
|
244382
244488
|
*/
|
|
244383
244489
|
static dihedralAngleSummary(source, ignoreBoundaries = false) {
|
|
244490
|
+
// more info can be found at geometry/internaldocs/Polyface.md
|
|
244384
244491
|
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
|
|
244385
244492
|
const visitor = source.createVisitor(1);
|
|
244386
244493
|
visitor.reset();
|
|
244494
|
+
// find centroid normals of all facets
|
|
244387
244495
|
const centroidNormal = [];
|
|
244388
244496
|
let normalCounter = 0;
|
|
244389
244497
|
while (visitor.moveToNextFacet()) {
|
|
244390
244498
|
const numEdges = visitor.pointCount - 1;
|
|
244391
244499
|
const normal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.centroidAreaNormal(visitor.point);
|
|
244392
244500
|
if (normal === undefined)
|
|
244393
|
-
return
|
|
244501
|
+
return -2;
|
|
244394
244502
|
centroidNormal.push(normal);
|
|
244395
244503
|
for (let i = 0; i < numEdges; i++) {
|
|
244396
244504
|
edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), normalCounter);
|
|
244397
244505
|
}
|
|
244398
244506
|
normalCounter++;
|
|
244399
244507
|
}
|
|
244508
|
+
// find "manifold clusters" and "bad clusters"
|
|
244509
|
+
// manifold clusters are edges adjacent to 2 facets
|
|
244510
|
+
// bad clusters are edges adjacent to more than 2 facets or (if ignoreBoundaries is false) adjacent to 1 facet
|
|
244400
244511
|
const badClusters = [];
|
|
244401
244512
|
const manifoldClusters = [];
|
|
244402
244513
|
edges.sortAndCollectClusters(manifoldClusters, ignoreBoundaries ? undefined : badClusters, undefined, badClusters);
|
|
244403
244514
|
if (badClusters.length > 0)
|
|
244404
|
-
return
|
|
244515
|
+
return -2;
|
|
244516
|
+
// find angle between facet centroid normals (dihedral angles)
|
|
244405
244517
|
let numPositive = 0;
|
|
244406
244518
|
let numPlanar = 0;
|
|
244407
244519
|
let numNegative = 0;
|
|
@@ -244409,8 +244521,7 @@ class PolyfaceQuery {
|
|
|
244409
244521
|
for (const cluster of manifoldClusters) {
|
|
244410
244522
|
const sideA = cluster[0];
|
|
244411
244523
|
const sideB = cluster[1];
|
|
244412
|
-
if (sideA instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge
|
|
244413
|
-
&& sideB instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge
|
|
244524
|
+
if (sideA instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge && sideB instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge
|
|
244414
244525
|
&& source.data.point.vectorIndexIndex(sideA.vertexIndexA, sideA.vertexIndexB, edgeVector)) {
|
|
244415
244526
|
const dihedralAngle = centroidNormal[sideA.facetIndex].direction.signedAngleTo(centroidNormal[sideB.facetIndex].direction, edgeVector);
|
|
244416
244527
|
if (dihedralAngle.isAlmostZero)
|
|
@@ -244421,26 +244532,26 @@ class PolyfaceQuery {
|
|
|
244421
244532
|
numNegative++;
|
|
244422
244533
|
}
|
|
244423
244534
|
}
|
|
244535
|
+
// categorize the mesh
|
|
244424
244536
|
if (numPositive > 0 && numNegative === 0)
|
|
244425
244537
|
return 1;
|
|
244426
244538
|
if (numNegative > 0 && numPositive === 0)
|
|
244427
244539
|
return -1;
|
|
244428
|
-
|
|
244429
|
-
|
|
244430
|
-
|
|
244431
|
-
return 0;
|
|
244540
|
+
if (numPlanar > 0 && numPositive === 0 && numNegative === 0) // planar mesh
|
|
244541
|
+
return 0;
|
|
244542
|
+
return -2;
|
|
244432
244543
|
}
|
|
244433
|
-
/**
|
|
244434
|
-
* Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume.
|
|
244435
|
-
*/
|
|
244544
|
+
/** Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume. */
|
|
244436
244545
|
static isPolyfaceClosedByEdgePairing(source) {
|
|
244437
244546
|
return this.isPolyfaceManifold(source, false);
|
|
244438
244547
|
}
|
|
244439
|
-
/**
|
|
244440
|
-
*
|
|
244441
|
-
* *
|
|
244442
|
-
* *
|
|
244443
|
-
*
|
|
244548
|
+
/**
|
|
244549
|
+
* Test edges pairing in `source` mesh.
|
|
244550
|
+
* * For `allowSimpleBoundaries === false` true return means this is a closed 2-manifold surface.
|
|
244551
|
+
* * For `allowSimpleBoundaries === true` true means this is a 2-manifold surface which may have boundary, but is
|
|
244552
|
+
* still properly matched internally.
|
|
244553
|
+
* * Any edge with 3 or more adjacent facets triggers `false` return.
|
|
244554
|
+
* * Any edge with 2 adjacent facets in the same direction triggers a `false` return.
|
|
244444
244555
|
*/
|
|
244445
244556
|
static isPolyfaceManifold(source, allowSimpleBoundaries = false) {
|
|
244446
244557
|
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
|
|
@@ -244457,11 +244568,11 @@ class PolyfaceQuery {
|
|
|
244457
244568
|
return badClusters.length === 0;
|
|
244458
244569
|
}
|
|
244459
244570
|
/**
|
|
244460
|
-
*
|
|
244461
|
-
*
|
|
244462
|
-
* @param source polyface or visitor
|
|
244463
|
-
* @param includeTypical true to in include typical boundary edges with a single
|
|
244464
|
-
* @param includeMismatch true to include edges with more than 2
|
|
244571
|
+
* Construct a CurveCollection containing boundary edges.
|
|
244572
|
+
* * Each edge is a LineSegment3d.
|
|
244573
|
+
* @param source polyface or visitor.
|
|
244574
|
+
* @param includeTypical true to in include typical boundary edges with a single adjacent facet.
|
|
244575
|
+
* @param includeMismatch true to include edges with more than 2 adjacent facets.
|
|
244465
244576
|
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
244466
244577
|
*/
|
|
244467
244578
|
static boundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
@@ -244477,9 +244588,9 @@ class PolyfaceQuery {
|
|
|
244477
244588
|
/**
|
|
244478
244589
|
* Collect boundary edges.
|
|
244479
244590
|
* * Return the edges as the simplest collection of chains of line segments.
|
|
244480
|
-
* @param source
|
|
244481
|
-
* @param includeTypical true to in include typical boundary edges with a single
|
|
244482
|
-
* @param includeMismatch true to include edges with more than 2
|
|
244591
|
+
* @param source polyface or visitor.
|
|
244592
|
+
* @param includeTypical true to in include typical boundary edges with a single adjacent facet.
|
|
244593
|
+
* @param includeMismatch true to include edges with more than 2 adjacent facets.
|
|
244483
244594
|
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
244484
244595
|
*/
|
|
244485
244596
|
static collectBoundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
@@ -244490,10 +244601,11 @@ class PolyfaceQuery {
|
|
|
244490
244601
|
/**
|
|
244491
244602
|
* Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume.
|
|
244492
244603
|
* If not, extract the boundary edges as lines.
|
|
244493
|
-
* @param source polyface or visitor
|
|
244494
|
-
* @param announceEdge function to be called with each boundary edge. The announcement is start and end points,
|
|
244495
|
-
*
|
|
244496
|
-
* @param
|
|
244604
|
+
* @param source polyface or visitor.
|
|
244605
|
+
* @param announceEdge function to be called with each boundary edge. The announcement is start and end points,
|
|
244606
|
+
* start and end indices, and facet index.
|
|
244607
|
+
* @param includeTypical true to announce typical boundary edges with a single adjacent facet.
|
|
244608
|
+
* @param includeMismatch true to announce edges with more than 2 adjacent facets.
|
|
244497
244609
|
* @param includeNull true to announce edges with identical start and end vertex indices.
|
|
244498
244610
|
*/
|
|
244499
244611
|
static announceBoundaryEdges(source, announceEdge, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
@@ -244509,17 +244621,17 @@ class PolyfaceQuery {
|
|
|
244509
244621
|
edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), visitor.currentReadIndex());
|
|
244510
244622
|
}
|
|
244511
244623
|
}
|
|
244512
|
-
const
|
|
244513
|
-
const
|
|
244514
|
-
const
|
|
244515
|
-
edges.sortAndCollectClusters(undefined,
|
|
244624
|
+
const boundaryEdges = [];
|
|
244625
|
+
const nullEdges = [];
|
|
244626
|
+
const allOtherEdges = [];
|
|
244627
|
+
edges.sortAndCollectClusters(undefined, boundaryEdges, nullEdges, allOtherEdges);
|
|
244516
244628
|
const badList = [];
|
|
244517
|
-
if (includeTypical &&
|
|
244518
|
-
badList.push(
|
|
244519
|
-
if (
|
|
244520
|
-
badList.push(
|
|
244521
|
-
if (
|
|
244522
|
-
badList.push(
|
|
244629
|
+
if (includeTypical && boundaryEdges.length > 0)
|
|
244630
|
+
badList.push(boundaryEdges);
|
|
244631
|
+
if (includeNull && nullEdges.length > 0)
|
|
244632
|
+
badList.push(nullEdges);
|
|
244633
|
+
if (includeMismatch && allOtherEdges.length > 0)
|
|
244634
|
+
badList.push(allOtherEdges);
|
|
244523
244635
|
if (badList.length === 0)
|
|
244524
244636
|
return undefined;
|
|
244525
244637
|
const sourcePolyface = visitor.clientPolyface();
|
|
@@ -244536,12 +244648,30 @@ class PolyfaceQuery {
|
|
|
244536
244648
|
}
|
|
244537
244649
|
}
|
|
244538
244650
|
/**
|
|
244539
|
-
*
|
|
244651
|
+
* Load all half edges from a mesh to an IndexedEdgeMatcher.
|
|
244652
|
+
* @param polyface a mesh or a visitor assumed to have numWrap === 1.
|
|
244653
|
+
*/
|
|
244654
|
+
static createIndexedEdges(polyface) {
|
|
244655
|
+
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
244656
|
+
return this.createIndexedEdges(polyface.createVisitor(1));
|
|
244657
|
+
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
|
|
244658
|
+
polyface.reset();
|
|
244659
|
+
while (polyface.moveToNextFacet()) {
|
|
244660
|
+
const numEdges = polyface.pointCount - 1;
|
|
244661
|
+
for (let i = 0; i < numEdges; i++) {
|
|
244662
|
+
edges.addEdge(polyface.clientPointIndex(i), polyface.clientPointIndex(i + 1), polyface.currentReadIndex());
|
|
244663
|
+
}
|
|
244664
|
+
}
|
|
244665
|
+
return edges;
|
|
244666
|
+
}
|
|
244667
|
+
/**
|
|
244668
|
+
* Invoke the callback on each manifold edge whose adjacent facet normals form vectorToEye dot products
|
|
244669
|
+
* with opposite sign.
|
|
244540
244670
|
* * The callback is not called on boundary edges.
|
|
244541
|
-
* @param source
|
|
244542
|
-
* @param announce callback function invoked on manifold silhouette edges
|
|
244543
|
-
* @param vectorToEye normal of plane in which to compute silhouette edges
|
|
244544
|
-
* @param sideAngle angular tolerance for perpendicularity test
|
|
244671
|
+
* @param source polyface or visitor.
|
|
244672
|
+
* @param announce callback function invoked on manifold silhouette edges.
|
|
244673
|
+
* @param vectorToEye normal of plane in which to compute silhouette edges.
|
|
244674
|
+
* @param sideAngle angular tolerance for perpendicularity test.
|
|
244545
244675
|
*/
|
|
244546
244676
|
static announceSilhouetteEdges(source, announce, vectorToEye, sideAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle()) {
|
|
244547
244677
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -244591,16 +244721,17 @@ class PolyfaceQuery {
|
|
|
244591
244721
|
* Collect manifold edges whose adjacent facet normals form vectorToEye dot products with opposite sign.
|
|
244592
244722
|
* * Does not return boundary edges.
|
|
244593
244723
|
* * Return the edges as chains of line segments.
|
|
244594
|
-
* @param source
|
|
244595
|
-
* @param vectorToEye normal of plane in which to compute silhouette edges
|
|
244596
|
-
* @param sideAngle angular tolerance for perpendicularity test
|
|
244724
|
+
* @param source polyface or visitor.
|
|
244725
|
+
* @param vectorToEye normal of plane in which to compute silhouette edges.
|
|
244726
|
+
* @param sideAngle angular tolerance for perpendicularity test.
|
|
244597
244727
|
*/
|
|
244598
244728
|
static collectSilhouetteEdges(source, vectorToEye, sideAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle()) {
|
|
244599
244729
|
const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_12__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance);
|
|
244600
244730
|
PolyfaceQuery.announceSilhouetteEdges(source, (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(ptA, ptB)), vectorToEye, sideAngle);
|
|
244601
244731
|
return collector.grabResult(true);
|
|
244602
244732
|
}
|
|
244603
|
-
/**
|
|
244733
|
+
/**
|
|
244734
|
+
* Find segments (within the linestring) which project to facets.
|
|
244604
244735
|
* * Announce each pair of linestring segment and on-facet segment through a callback.
|
|
244605
244736
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
244606
244737
|
*/
|
|
@@ -244613,7 +244744,24 @@ class PolyfaceQuery {
|
|
|
244613
244744
|
}
|
|
244614
244745
|
}
|
|
244615
244746
|
}
|
|
244616
|
-
/**
|
|
244747
|
+
/**
|
|
244748
|
+
* Set the limit on work during an async time blocks, and return the old value.
|
|
244749
|
+
* * This should be a large number -- default is 1.0e6
|
|
244750
|
+
* @internal
|
|
244751
|
+
*/
|
|
244752
|
+
static setAsyncWorkLimit(value) {
|
|
244753
|
+
const oldValue = this._asyncWorkLimit;
|
|
244754
|
+
this._asyncWorkLimit = value;
|
|
244755
|
+
return oldValue;
|
|
244756
|
+
}
|
|
244757
|
+
/**
|
|
244758
|
+
* Query the current limit on work during an async time block.
|
|
244759
|
+
* @internal
|
|
244760
|
+
*/
|
|
244761
|
+
static get asyncWorkLimit() {
|
|
244762
|
+
return this._asyncWorkLimit;
|
|
244763
|
+
}
|
|
244764
|
+
/** Execute `context.projectToPolygon` until its work estimates accumulate to workLimit. */
|
|
244617
244765
|
static async continueAnnounceSweepLinestringToConvexPolyfaceXY(context, visitor, announce) {
|
|
244618
244766
|
let workCount = 0;
|
|
244619
244767
|
while ((workCount < this.asyncWorkLimit) && visitor.moveToNextFacet()) {
|
|
@@ -244621,16 +244769,8 @@ class PolyfaceQuery {
|
|
|
244621
244769
|
}
|
|
244622
244770
|
return workCount;
|
|
244623
244771
|
}
|
|
244624
|
-
/**
|
|
244625
|
-
*
|
|
244626
|
-
* @internal
|
|
244627
|
-
*/
|
|
244628
|
-
static setAsyncWorkLimit(value) { const a = this._asyncWorkLimit; this._asyncWorkLimit = value; return a; }
|
|
244629
|
-
/** Query the current limit on work during an async time block.
|
|
244630
|
-
* @internal
|
|
244631
|
-
*/
|
|
244632
|
-
static get asyncWorkLimit() { return this._asyncWorkLimit; }
|
|
244633
|
-
/** Find segments (within the linestring) which project to facets.
|
|
244772
|
+
/**
|
|
244773
|
+
* Find segments (within the linestring) which project to facets.
|
|
244634
244774
|
* * Announce each pair of linestring segment and on-facet segment through a callback.
|
|
244635
244775
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
244636
244776
|
* * REMARK: Although this is public, the usual use is via slightly higher level public methods, viz:
|
|
@@ -244653,14 +244793,15 @@ class PolyfaceQuery {
|
|
|
244653
244793
|
// GeometryCoreTestIO.consoleLog({ myWorkTotal: workTotal, myBlockCount: this.awaitBlockCount });
|
|
244654
244794
|
return workTotal;
|
|
244655
244795
|
}
|
|
244656
|
-
/**
|
|
244796
|
+
/**
|
|
244797
|
+
* Search the facets for facet subsets that are connected with at least vertex contact.
|
|
244657
244798
|
* * Return array of arrays of facet indices.
|
|
244658
244799
|
*/
|
|
244659
244800
|
static partitionFacetIndicesByVertexConnectedComponent(polyface) {
|
|
244660
244801
|
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
244661
244802
|
return this.partitionFacetIndicesByVertexConnectedComponent(polyface.createVisitor(0));
|
|
244662
244803
|
}
|
|
244663
|
-
// The polyface is really a visitor
|
|
244804
|
+
// The polyface is really a visitor
|
|
244664
244805
|
const context = new _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_14__.UnionFindContext(this.visitorClientPointCount(polyface));
|
|
244665
244806
|
for (polyface.reset(); polyface.moveToNextFacet();) {
|
|
244666
244807
|
const firstVertexIndexOnThisFacet = polyface.pointIndex[0];
|
|
@@ -244688,9 +244829,9 @@ class PolyfaceQuery {
|
|
|
244688
244829
|
/**
|
|
244689
244830
|
* * Examine the normal orientation for each faces.
|
|
244690
244831
|
* * Separate to 3 partitions:
|
|
244691
|
-
* *
|
|
244692
|
-
* *
|
|
244693
|
-
* *
|
|
244832
|
+
* * Facets with normal in the positive direction of the vectorToEye (partition 0).
|
|
244833
|
+
* * Facets with normal in the negative direction of the vectorToEye (partition 1).
|
|
244834
|
+
* * Facets nearly perpendicular to the view vector (partition 2).
|
|
244694
244835
|
* * Return array of arrays of facet indices.
|
|
244695
244836
|
*/
|
|
244696
244837
|
static partitionFacetIndicesByVisibilityVector(polyface, vectorToEye, sideAngleTolerance) {
|
|
@@ -244725,13 +244866,13 @@ class PolyfaceQuery {
|
|
|
244725
244866
|
}
|
|
244726
244867
|
/**
|
|
244727
244868
|
* Return the boundary of facets that are facing the eye.
|
|
244728
|
-
* @param polyface
|
|
244869
|
+
* @param polyface the indexed polyface
|
|
244729
244870
|
* @param visibilitySubset selector among the visible facet sets extracted by partitionFacetIndicesByVisibilityVector
|
|
244730
244871
|
* * 0 ==> forward facing
|
|
244731
244872
|
* * 1 ==> rear facing
|
|
244732
244873
|
* * 2 ==> side facing
|
|
244733
|
-
* @param vectorToEye
|
|
244734
|
-
* @param sideAngleTolerance
|
|
244874
|
+
* @param vectorToEye the vector to eye
|
|
244875
|
+
* @param sideAngleTolerance the tolerance of side angle
|
|
244735
244876
|
*/
|
|
244736
244877
|
static boundaryOfVisibleSubset(polyface, visibilitySelect, vectorToEye, sideAngleTolerance = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(1.0e-3)) {
|
|
244737
244878
|
const partitionedIndices = this.partitionFacetIndicesByVisibilityVector(polyface, vectorToEye, sideAngleTolerance);
|
|
@@ -244741,10 +244882,9 @@ class PolyfaceQuery {
|
|
|
244741
244882
|
return this.boundaryEdges(visitor, true, false, false);
|
|
244742
244883
|
}
|
|
244743
244884
|
/**
|
|
244744
|
-
* Search for edges with only 1
|
|
244745
|
-
* *
|
|
244746
|
-
* *
|
|
244747
|
-
* @param mesh
|
|
244885
|
+
* Search for edges with only 1 adjacent facet.
|
|
244886
|
+
* * Chain them into loops.
|
|
244887
|
+
* * Emit the loops to the announceLoop function.
|
|
244748
244888
|
*/
|
|
244749
244889
|
static announceBoundaryChainsAsLineString3d(mesh, announceLoop) {
|
|
244750
244890
|
const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_12__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, 1000);
|
|
@@ -244755,9 +244895,9 @@ class PolyfaceQuery {
|
|
|
244755
244895
|
* Return a mesh with
|
|
244756
244896
|
* * clusters of adjacent, coplanar facets merged into larger facets.
|
|
244757
244897
|
* * other facets included unchanged.
|
|
244758
|
-
* @param mesh existing mesh or visitor
|
|
244759
|
-
* @param maxSmoothEdgeAngle maximum dihedral angle across an edge between facets deemed coplanar. If undefined,
|
|
244760
|
-
*
|
|
244898
|
+
* @param mesh existing mesh or visitor.
|
|
244899
|
+
* @param maxSmoothEdgeAngle maximum dihedral angle across an edge between facets deemed coplanar. If undefined,
|
|
244900
|
+
* uses `Geometry.smallAngleRadians`.
|
|
244761
244901
|
*/
|
|
244762
244902
|
static cloneWithMaximalPlanarFacets(mesh, maxSmoothEdgeAngle) {
|
|
244763
244903
|
if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -244816,14 +244956,14 @@ class PolyfaceQuery {
|
|
|
244816
244956
|
* * Unclosed chains are rejected.
|
|
244817
244957
|
* * Closed chains are triangulated and returned as a mesh.
|
|
244818
244958
|
* * The options structure enforces restrictions on how complicated the hole filling can be:
|
|
244819
|
-
* * maxEdgesAroundHole -- holes with more edges are skipped
|
|
244959
|
+
* * maxEdgesAroundHole -- holes with more edges are skipped.
|
|
244820
244960
|
* * maxPerimeter -- holes with larger summed edge lengths are skipped.
|
|
244821
244961
|
* * upVector -- holes that do not have positive area along this view are skipped.
|
|
244822
|
-
* * includeOriginalMesh -- includes the original mesh in the output mesh, so the composite mesh is a
|
|
244823
|
-
*
|
|
244962
|
+
* * includeOriginalMesh -- includes the original mesh in the output mesh, so the composite mesh is a
|
|
244963
|
+
* clone with holes filled.
|
|
244964
|
+
* @param mesh existing mesh.
|
|
244824
244965
|
* @param options options controlling the hole fill.
|
|
244825
244966
|
* @param unfilledChains optional array to receive the points around holes that were not filled.
|
|
244826
|
-
* @returns
|
|
244827
244967
|
*/
|
|
244828
244968
|
static fillSimpleHoles(mesh, options, unfilledChains) {
|
|
244829
244969
|
if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -244859,9 +244999,7 @@ class PolyfaceQuery {
|
|
|
244859
244999
|
}
|
|
244860
245000
|
return builder.claimPolyface(true);
|
|
244861
245001
|
}
|
|
244862
|
-
/** Clone the facets in each partition to a separate polyface.
|
|
244863
|
-
*
|
|
244864
|
-
*/
|
|
245002
|
+
/** Clone the facets in each partition to a separate polyface. */
|
|
244865
245003
|
static clonePartitions(polyface, partitions) {
|
|
244866
245004
|
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
244867
245005
|
return this.clonePartitions(polyface.createVisitor(0), partitions);
|
|
@@ -244884,7 +245022,7 @@ class PolyfaceQuery {
|
|
|
244884
245022
|
}
|
|
244885
245023
|
return polyfaces;
|
|
244886
245024
|
}
|
|
244887
|
-
/** Clone facets that pass a filter function */
|
|
245025
|
+
/** Clone facets that pass a filter function. */
|
|
244888
245026
|
static cloneFiltered(source, filter) {
|
|
244889
245027
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
244890
245028
|
return this.cloneFiltered(source.createVisitor(0), filter);
|
|
@@ -244954,46 +245092,44 @@ class PolyfaceQuery {
|
|
|
244954
245092
|
}
|
|
244955
245093
|
return builder.claimPolyface(true);
|
|
244956
245094
|
}
|
|
244957
|
-
/**
|
|
244958
|
-
|
|
244959
|
-
|
|
244960
|
-
|
|
244961
|
-
|
|
244962
|
-
return visitor.data.point.length;
|
|
244963
|
-
const polyface = visitor.clientPolyface();
|
|
245095
|
+
/** Return the point count of the `source`. */
|
|
245096
|
+
static visitorClientPointCount(source) {
|
|
245097
|
+
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
245098
|
+
return source.data.point.length;
|
|
245099
|
+
const polyface = source.clientPolyface();
|
|
244964
245100
|
if (polyface !== undefined)
|
|
244965
245101
|
return polyface.data.point.length;
|
|
244966
|
-
|
|
245102
|
+
source.reset();
|
|
244967
245103
|
let maxIndex = -1;
|
|
244968
|
-
while (
|
|
244969
|
-
for (const pointIndex of
|
|
245104
|
+
while (source.moveToNextFacet()) {
|
|
245105
|
+
for (const pointIndex of source.pointIndex)
|
|
244970
245106
|
if (pointIndex > maxIndex)
|
|
244971
245107
|
maxIndex = pointIndex;
|
|
244972
245108
|
}
|
|
244973
245109
|
return maxIndex + 1;
|
|
244974
245110
|
}
|
|
244975
|
-
/**
|
|
244976
|
-
|
|
244977
|
-
|
|
244978
|
-
|
|
244979
|
-
|
|
244980
|
-
|
|
244981
|
-
return visitor.facetCount;
|
|
244982
|
-
visitor = visitor.createVisitor(0);
|
|
245111
|
+
/** Return the facet count of the `source`. */
|
|
245112
|
+
static visitorClientFacetCount(source) {
|
|
245113
|
+
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
245114
|
+
if (source.facetCount !== undefined)
|
|
245115
|
+
return source.facetCount;
|
|
245116
|
+
source = source.createVisitor(0);
|
|
244983
245117
|
}
|
|
244984
|
-
const polyface =
|
|
245118
|
+
const polyface = source.clientPolyface();
|
|
244985
245119
|
if (polyface !== undefined && polyface.facetCount !== undefined)
|
|
244986
245120
|
return polyface.facetCount;
|
|
244987
245121
|
let facetCount = 0;
|
|
244988
|
-
|
|
244989
|
-
while (
|
|
245122
|
+
source.reset();
|
|
245123
|
+
while (source.moveToNextFacet())
|
|
244990
245124
|
++facetCount;
|
|
244991
245125
|
return facetCount;
|
|
244992
245126
|
}
|
|
244993
|
-
/**
|
|
245127
|
+
/**
|
|
245128
|
+
* Partition the facet set into connected components such that two adjacent facets are in the same component if and
|
|
245129
|
+
* only if they are adjacent across a clustered edge.
|
|
244994
245130
|
* @param edgeClusters sorted and clustered edges (cf. `IndexedEdgeMatcher.sortAndCollectClusters`).
|
|
244995
245131
|
* @param numFacets facet count in the parent mesh. In particular, `edge.facetIndex < numFacets` for every input edge.
|
|
244996
|
-
* @return collection of facet index arrays, one array per connected component
|
|
245132
|
+
* @return collection of facet index arrays, one array per connected component.
|
|
244997
245133
|
*/
|
|
244998
245134
|
static partitionFacetIndicesBySortableEdgeClusters(edgeClusters, numFacets) {
|
|
244999
245135
|
const context = new _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_14__.UnionFindContext(numFacets);
|
|
@@ -245024,10 +245160,12 @@ class PolyfaceQuery {
|
|
|
245024
245160
|
}
|
|
245025
245161
|
return facetsInComponent;
|
|
245026
245162
|
}
|
|
245027
|
-
/**
|
|
245028
|
-
*
|
|
245029
|
-
*
|
|
245030
|
-
* @
|
|
245163
|
+
/**
|
|
245164
|
+
* Partition the facet set into connected components. Each facet in a given component shares an edge only with
|
|
245165
|
+
* other facets in the component (or is a boundary edge).
|
|
245166
|
+
* @param polyface facets to partition.
|
|
245167
|
+
* @param stopAtVisibleEdges whether to further split connected components by visible edges of the polyface.
|
|
245168
|
+
* @return collection of facet index arrays, one per connected component.
|
|
245031
245169
|
*/
|
|
245032
245170
|
static partitionFacetIndicesByEdgeConnectedComponent(polyface, stopAtVisibleEdges = false) {
|
|
245033
245171
|
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
@@ -245052,7 +245190,8 @@ class PolyfaceQuery {
|
|
|
245052
245190
|
matcher.sortAndCollectClusters(allEdges, allEdges, allEdges, allEdges);
|
|
245053
245191
|
return this.partitionFacetIndicesBySortableEdgeClusters(allEdges, numFacets);
|
|
245054
245192
|
}
|
|
245055
|
-
/**
|
|
245193
|
+
/**
|
|
245194
|
+
* Find segments (within the line string) which project to facets.
|
|
245056
245195
|
* * Assemble each input segment paired with its projected segment/point as a quad/triangle facet in a new polyface.
|
|
245057
245196
|
* * Input facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
245058
245197
|
*/
|
|
@@ -245066,7 +245205,7 @@ class PolyfaceQuery {
|
|
|
245066
245205
|
});
|
|
245067
245206
|
return builder.claimPolyface(true);
|
|
245068
245207
|
}
|
|
245069
|
-
/** @deprecated in 4.x. Use sweepLineStringToFacetsXYReturnSweptFacets instead. */
|
|
245208
|
+
/** @deprecated in 4.x. Use [[sweepLineStringToFacetsXYReturnSweptFacets]] instead. */
|
|
245070
245209
|
static sweepLinestringToFacetsXYreturnSweptFacets(linestringPoints, polyface) {
|
|
245071
245210
|
return this.sweepLineStringToFacetsXYReturnSweptFacets(linestringPoints, polyface);
|
|
245072
245211
|
}
|
|
@@ -245079,11 +245218,10 @@ class PolyfaceQuery {
|
|
|
245079
245218
|
*/
|
|
245080
245219
|
static sweepLineStringToFacets(linestringPoints, polyfaceOrVisitor, options) {
|
|
245081
245220
|
let result = [];
|
|
245082
|
-
// setup default options
|
|
245221
|
+
// setup default options
|
|
245083
245222
|
if (options === undefined)
|
|
245084
245223
|
options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallAngleRadians), // tight geometry tolerance for vertical side facets
|
|
245085
|
-
true,
|
|
245086
|
-
true, true, true); // accept all outputs
|
|
245224
|
+
true, true, true, true);
|
|
245087
245225
|
let chainContext;
|
|
245088
245226
|
if (options.assembleChains)
|
|
245089
245227
|
chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_25__.ChainMergeContext.create();
|
|
@@ -245114,9 +245252,9 @@ class PolyfaceQuery {
|
|
|
245114
245252
|
}
|
|
245115
245253
|
/**
|
|
245116
245254
|
* Sweep the line string in the z-direction to intersections with a mesh, using a search object for speedup.
|
|
245117
|
-
* @param lineStringPoints input line string to drape on the mesh
|
|
245118
|
-
* @param polyfaceOrVisitor mesh, or mesh visitor to traverse only part of a mesh
|
|
245119
|
-
* @param searchByReadIndex object for searching facet 2D ranges tagged by mesh read index
|
|
245255
|
+
* @param lineStringPoints input line string to drape on the mesh.
|
|
245256
|
+
* @param polyfaceOrVisitor mesh, or mesh visitor to traverse only part of a mesh.
|
|
245257
|
+
* @param searchByReadIndex object for searching facet 2D ranges tagged by mesh read index.
|
|
245120
245258
|
* @example Using a 5x5 indexed search grid:
|
|
245121
245259
|
* ```
|
|
245122
245260
|
* const xyRange = Range2d.createFrom(myPolyface.range());
|
|
@@ -245126,7 +245264,7 @@ class PolyfaceQuery {
|
|
|
245126
245264
|
* }
|
|
245127
245265
|
* const drapedLineStrings = PolyfaceQuery.sweepLineStringToFacetsXY(lineString, myPolyface, searcher);
|
|
245128
245266
|
* ```
|
|
245129
|
-
* @returns collected line strings
|
|
245267
|
+
* @returns the collected line strings.
|
|
245130
245268
|
*/
|
|
245131
245269
|
static sweepLineStringToFacetsXY(lineStringPoints, polyfaceOrVisitor, searchByReadIndex) {
|
|
245132
245270
|
const chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_25__.ChainMergeContext.create();
|
|
@@ -245160,32 +245298,36 @@ class PolyfaceQuery {
|
|
|
245160
245298
|
chainContext.clusterAndMergeVerticesXYZ();
|
|
245161
245299
|
return chainContext.collectMaximalChains();
|
|
245162
245300
|
}
|
|
245163
|
-
/**
|
|
245301
|
+
/**
|
|
245302
|
+
* Find segments (within the linestring) which project to facets.
|
|
245164
245303
|
* * Return collected line segments.
|
|
245165
245304
|
* * This calls [[sweepLineStringToFacets]] with options created by
|
|
245166
|
-
* `const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(),false, true, true, true);`
|
|
245167
|
-
* @deprecated in 4.x. Use [[sweepLineStringToFacets]] to get further options.
|
|
245305
|
+
* `const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(), false, true, true, true);`
|
|
245306
|
+
* @deprecated in 4.x. Use [[PolyfaceQuery.sweepLineStringToFacets]] to get further options.
|
|
245168
245307
|
*/
|
|
245169
245308
|
static sweepLinestringToFacetsXYReturnLines(linestringPoints, polyface) {
|
|
245170
245309
|
const options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle(), false, true, true, true);
|
|
245171
245310
|
const result = PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface, options);
|
|
245172
245311
|
return result;
|
|
245173
245312
|
}
|
|
245174
|
-
/**
|
|
245313
|
+
/**
|
|
245314
|
+
* Find segments (within the linestring) which project to facets.
|
|
245175
245315
|
* * Return chains.
|
|
245176
245316
|
* * This calls [[sweepLineStringToFacets]] with options created by
|
|
245177
245317
|
* `const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(),true, true, true, true);`
|
|
245178
|
-
* @deprecated in 4.x. Use [[sweepLineStringToFacets]] to get further options.
|
|
245318
|
+
* @deprecated in 4.x. Use [[PolyfaceQuery.sweepLineStringToFacets]] to get further options.
|
|
245179
245319
|
*/
|
|
245180
245320
|
static sweepLinestringToFacetsXYReturnChains(linestringPoints, polyface) {
|
|
245181
245321
|
const options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle(), true, true, true, true);
|
|
245182
245322
|
const result = PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface, options);
|
|
245183
245323
|
return result;
|
|
245184
245324
|
}
|
|
245185
|
-
/**
|
|
245325
|
+
/**
|
|
245326
|
+
* Find segments (within the linestring) which project to facets.
|
|
245186
245327
|
* * This is done as a sequence of "await" steps.
|
|
245187
|
-
* * Each "await" step deals with approximately PolyfaceQuery.asyncWorkLimit pairings of
|
|
245188
|
-
*
|
|
245328
|
+
* * Each "await" step deals with approximately PolyfaceQuery.asyncWorkLimit pairings of "linestring edge"
|
|
245329
|
+
* with "facet edge".
|
|
245330
|
+
* * PolyfaceQuery.setAsyncWorkLimit() to change work blocks from default.
|
|
245189
245331
|
* * Return chains.
|
|
245190
245332
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
245191
245333
|
*/
|
|
@@ -245199,7 +245341,7 @@ class PolyfaceQuery {
|
|
|
245199
245341
|
return chains;
|
|
245200
245342
|
}
|
|
245201
245343
|
/**
|
|
245202
|
-
*
|
|
245344
|
+
* Examine ranges of facets.
|
|
245203
245345
|
* * Return statistical summary of x,y,z ranges.
|
|
245204
245346
|
*/
|
|
245205
245347
|
static collectRangeLengthData(polyface) {
|
|
@@ -245207,17 +245349,18 @@ class PolyfaceQuery {
|
|
|
245207
245349
|
return this.collectRangeLengthData(polyface.createVisitor(0));
|
|
245208
245350
|
}
|
|
245209
245351
|
const rangeData = new _RangeLengthData__WEBPACK_IMPORTED_MODULE_28__.RangeLengthData();
|
|
245210
|
-
// polyface is a visitor
|
|
245352
|
+
// polyface is a visitor
|
|
245211
245353
|
for (polyface.reset(); polyface.moveToNextFacet();)
|
|
245212
245354
|
rangeData.accumulateGrowableXYZArrayRange(polyface.point);
|
|
245213
245355
|
return rangeData;
|
|
245214
245356
|
}
|
|
245215
|
-
/**
|
|
245216
|
-
*
|
|
245357
|
+
/**
|
|
245358
|
+
* Clone the facets, inserting vertices (within edges) where points not part of each facet's vertex indices
|
|
245359
|
+
* impinge within edges.
|
|
245217
245360
|
*/
|
|
245218
245361
|
static cloneWithTVertexFixup(polyface) {
|
|
245219
|
-
const oldFacetVisitor = polyface.createVisitor(1); //
|
|
245220
|
-
const newFacetVisitor = polyface.createVisitor(0); //
|
|
245362
|
+
const oldFacetVisitor = polyface.createVisitor(1); // this is to visit the existing facets
|
|
245363
|
+
const newFacetVisitor = polyface.createVisitor(0); // this is to build the new facets
|
|
245221
245364
|
const rangeSearcher = _multiclip_XYPointBuckets__WEBPACK_IMPORTED_MODULE_29__.XYPointBuckets.create(polyface.data.point, 30);
|
|
245222
245365
|
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
245223
245366
|
const edgeRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_26__.Range3d.createNull();
|
|
@@ -245228,7 +245371,7 @@ class PolyfaceQuery {
|
|
|
245228
245371
|
for (oldFacetVisitor.reset(); oldFacetVisitor.moveToNextFacet();) {
|
|
245229
245372
|
newFacetVisitor.clearArrays();
|
|
245230
245373
|
for (let i = 0; i + 1 < oldFacetVisitor.point.length; i++) {
|
|
245231
|
-
// each base vertex is part of the result
|
|
245374
|
+
// each base vertex is part of the result
|
|
245232
245375
|
oldFacetVisitor.point.getPoint3dAtUncheckedPointIndex(i, point0);
|
|
245233
245376
|
oldFacetVisitor.point.getPoint3dAtUncheckedPointIndex(i + 1, point1);
|
|
245234
245377
|
newFacetVisitor.pushDataFrom(oldFacetVisitor, i);
|
|
@@ -245239,12 +245382,12 @@ class PolyfaceQuery {
|
|
|
245239
245382
|
edgeRange.extend(point1);
|
|
245240
245383
|
edgeRange.ensureMinLengths(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance); // add some slop in case segment is axis-aligned
|
|
245241
245384
|
rangeSearcher.announcePointsInRange(edgeRange, (index, _x, _y, _z) => {
|
|
245242
|
-
// x,y,z has x,y within the range of the search
|
|
245385
|
+
// x,y,z has x,y within the range of the search; test for exact on (in full 3d)
|
|
245243
245386
|
polyface.data.point.getPoint3dAtUncheckedPointIndex(index, spacePoint);
|
|
245244
245387
|
const detail = segment.closestPoint(spacePoint, false);
|
|
245245
245388
|
if (undefined !== detail) {
|
|
245246
|
-
if (detail.fraction > 0.0 && detail.fraction < 1.0 && !detail.point.isAlmostEqual(point0) &&
|
|
245247
|
-
&& spacePoint.isAlmostEqual(detail.point)) {
|
|
245389
|
+
if (detail.fraction > 0.0 && detail.fraction < 1.0 && !detail.point.isAlmostEqual(point0) &&
|
|
245390
|
+
!detail.point.isAlmostEqual(point1) && spacePoint.isAlmostEqual(detail.point)) {
|
|
245248
245391
|
if (detailArray === undefined)
|
|
245249
245392
|
detailArray = [];
|
|
245250
245393
|
detail.a = index;
|
|
@@ -245265,14 +245408,13 @@ class PolyfaceQuery {
|
|
|
245265
245408
|
return builder.claimPolyface();
|
|
245266
245409
|
}
|
|
245267
245410
|
/**
|
|
245411
|
+
* Compare index arrays formatted as follows. Return 0 if arrays are the same.
|
|
245268
245412
|
* * Each array input structure is: [facetIndex, vertexIndex0, vertexIndex1, ....]
|
|
245269
|
-
* * Vertex indices assumed reversed so
|
|
245270
|
-
* * vertexIndex0 is the lowest index on the facet
|
|
245271
|
-
* * vertexIndex1 is the lowest neighbor of vertex0
|
|
245413
|
+
* * Vertex indices assumed reversed so:
|
|
245414
|
+
* * vertexIndex0 is the lowest index on the facet.
|
|
245415
|
+
* * vertexIndex1 is the lowest neighbor of vertex0.
|
|
245272
245416
|
* * first different entry among vertex indices determines lexical result.
|
|
245273
|
-
* *
|
|
245274
|
-
* @param arrayA
|
|
245275
|
-
* @param arrayB
|
|
245417
|
+
* * hence facets with duplicate indices (whether forward or reversed) are considered equal.
|
|
245276
245418
|
*/
|
|
245277
245419
|
static compareFacetIndexAndVertexIndices(arrayA, arrayB) {
|
|
245278
245420
|
if (arrayA.length !== arrayB.length)
|
|
@@ -245285,9 +245427,11 @@ class PolyfaceQuery {
|
|
|
245285
245427
|
return 0;
|
|
245286
245428
|
}
|
|
245287
245429
|
/**
|
|
245288
|
-
*
|
|
245430
|
+
* Collect facet duplicates.
|
|
245431
|
+
* @param polyface the polyface.
|
|
245289
245432
|
* @param includeSingletons if true, non-duplicated facets are included in the output.
|
|
245290
|
-
*
|
|
245433
|
+
* @returns an array of arrays describing facet duplication. Each array `entry` in the output contains read
|
|
245434
|
+
* indices of a cluster of facets with the same vertex indices.
|
|
245291
245435
|
*/
|
|
245292
245436
|
static collectDuplicateFacetIndices(polyface, includeSingletons = false) {
|
|
245293
245437
|
const result = [];
|
|
@@ -245298,12 +245442,12 @@ class PolyfaceQuery {
|
|
|
245298
245442
|
return result;
|
|
245299
245443
|
}
|
|
245300
245444
|
/**
|
|
245301
|
-
*
|
|
245302
|
-
* @
|
|
245303
|
-
*
|
|
245445
|
+
* Announce facet duplicates.
|
|
245446
|
+
* @returns an array of arrays describing facet duplication. Each array `entry` in the output contains read
|
|
245447
|
+
* indices of a cluster of facets with the same vertex indices.
|
|
245304
245448
|
*/
|
|
245305
245449
|
static announceDuplicateFacetIndices(polyface, announceCluster) {
|
|
245306
|
-
const visitor = polyface.createVisitor(0); //
|
|
245450
|
+
const visitor = polyface.createVisitor(0); // this is to visit the existing facets
|
|
245307
245451
|
const facetIndexAndVertexIndices = [];
|
|
245308
245452
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
245309
245453
|
const facetIndex = visitor.currentReadIndex();
|
|
@@ -245311,12 +245455,12 @@ class PolyfaceQuery {
|
|
|
245311
245455
|
const pointIndex = visitor.pointIndex;
|
|
245312
245456
|
const numPointsThisFacet = pointIndex.length;
|
|
245313
245457
|
let lowIndex = 0;
|
|
245314
|
-
// find the lowest point index
|
|
245458
|
+
// find the lowest point index
|
|
245315
245459
|
for (let i = 1; i < visitor.pointIndex.length; i++) {
|
|
245316
245460
|
if (pointIndex[i] < pointIndex[lowIndex])
|
|
245317
245461
|
lowIndex = i;
|
|
245318
245462
|
}
|
|
245319
|
-
// find its lowest neighbor
|
|
245463
|
+
// find its lowest neighbor; assemble sort array in that direction
|
|
245320
245464
|
if (pointIndex[(lowIndex + 1) % numPointsThisFacet] < pointIndex[(lowIndex + numPointsThisFacet - 1) % numPointsThisFacet]) {
|
|
245321
245465
|
for (let i = 0; i < numPointsThisFacet; i++) {
|
|
245322
245466
|
entry.push(pointIndex[(lowIndex + i) % numPointsThisFacet]);
|
|
@@ -245344,9 +245488,11 @@ class PolyfaceQuery {
|
|
|
245344
245488
|
announceCluster(clusterArray);
|
|
245345
245489
|
}
|
|
245346
245490
|
}
|
|
245347
|
-
/**
|
|
245491
|
+
/**
|
|
245492
|
+
* Return a new facet set with a subset of facets in polyface.
|
|
245493
|
+
* @param source the polyface.
|
|
245348
245494
|
* @param includeSingletons true to copy facets that only appear once
|
|
245349
|
-
* @param clusterSelector indicates whether duplicate clusters are to have 0, 1, or all facets included
|
|
245495
|
+
* @param clusterSelector indicates whether duplicate clusters are to have 0, 1, or all facets included.
|
|
245350
245496
|
*/
|
|
245351
245497
|
static cloneByFacetDuplication(source, includeSingletons, clusterSelector) {
|
|
245352
245498
|
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
@@ -245372,25 +245518,23 @@ class PolyfaceQuery {
|
|
|
245372
245518
|
});
|
|
245373
245519
|
return builder.claimPolyface();
|
|
245374
245520
|
}
|
|
245375
|
-
/** Clone the facets,
|
|
245376
|
-
*
|
|
245377
|
-
*/
|
|
245521
|
+
/** Clone the facets, removing points that are simply within colinear edges. */
|
|
245378
245522
|
static cloneWithColinearEdgeFixup(polyface) {
|
|
245379
|
-
const oldFacetVisitor = polyface.createVisitor(2); //
|
|
245380
|
-
const newFacetVisitor = polyface.createVisitor(0); //
|
|
245523
|
+
const oldFacetVisitor = polyface.createVisitor(2); // this is to visit the existing facets
|
|
245524
|
+
const newFacetVisitor = polyface.createVisitor(0); // this is to build the new facets
|
|
245381
245525
|
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
245382
245526
|
const vector01 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
245383
245527
|
const vector12 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
245384
245528
|
const numPoint = polyface.data.point.length;
|
|
245385
245529
|
const pointState = new Int32Array(numPoint);
|
|
245386
|
-
// FIRST PASS
|
|
245387
|
-
//
|
|
245388
|
-
//
|
|
245389
|
-
//
|
|
245390
|
-
//
|
|
245530
|
+
// FIRST PASS: in each sector of each facet, determine if the sector has colinear incoming and outgoing vectors.
|
|
245531
|
+
// Mark each point as
|
|
245532
|
+
// 0 unvisited
|
|
245533
|
+
// -1 adjacent to a non-colinear sector
|
|
245534
|
+
// n adjacent to n colinear sectors
|
|
245391
245535
|
for (oldFacetVisitor.reset(); oldFacetVisitor.moveToNextFacet();) {
|
|
245392
245536
|
for (let i = 0; i + 2 < oldFacetVisitor.point.length; i++) {
|
|
245393
|
-
// each base vertex is part of the result
|
|
245537
|
+
// each base vertex is part of the result
|
|
245394
245538
|
oldFacetVisitor.point.vectorIndexIndex(i, i + 1, vector01);
|
|
245395
245539
|
oldFacetVisitor.point.vectorIndexIndex(i + 1, i + 2, vector12);
|
|
245396
245540
|
const pointIndex = oldFacetVisitor.clientPointIndex(i + 1);
|
|
@@ -245405,7 +245549,7 @@ class PolyfaceQuery {
|
|
|
245405
245549
|
}
|
|
245406
245550
|
}
|
|
245407
245551
|
}
|
|
245408
|
-
// SECOND PASS
|
|
245552
|
+
// SECOND PASS: make copies, omitting references to points at colinear sectors.
|
|
245409
245553
|
for (oldFacetVisitor.reset(); oldFacetVisitor.moveToNextFacet();) {
|
|
245410
245554
|
newFacetVisitor.clearArrays();
|
|
245411
245555
|
for (let i = 0; i + 2 < oldFacetVisitor.point.length; i++) {
|
|
@@ -245421,9 +245565,9 @@ class PolyfaceQuery {
|
|
|
245421
245565
|
}
|
|
245422
245566
|
/**
|
|
245423
245567
|
* Set the edge visibility for specified edges in the polyface.
|
|
245424
|
-
* @param polyface mesh to be edited
|
|
245425
|
-
* @param clusters array of edge references
|
|
245426
|
-
* @param value visibility value (true or false)
|
|
245568
|
+
* @param polyface mesh to be edited.
|
|
245569
|
+
* @param clusters array of edge references.
|
|
245570
|
+
* @param value visibility value (true or false).
|
|
245427
245571
|
*/
|
|
245428
245572
|
static setEdgeVisibility(polyface, clusters, value) {
|
|
245429
245573
|
for (const cluster of clusters) {
|
|
@@ -245438,9 +245582,9 @@ class PolyfaceQuery {
|
|
|
245438
245582
|
}
|
|
245439
245583
|
/**
|
|
245440
245584
|
* Set the visibility of a particular edge of a particular facet.
|
|
245441
|
-
* @param polyface containing polyface
|
|
245442
|
-
* @param facetIndex facet index
|
|
245443
|
-
* @param vertexIndex vertex index (in vertex array) at which the edge starts
|
|
245585
|
+
* @param polyface containing polyface.
|
|
245586
|
+
* @param facetIndex facet index.
|
|
245587
|
+
* @param vertexIndex vertex index (in vertex array) at which the edge starts.
|
|
245444
245588
|
* @param value visibility value.
|
|
245445
245589
|
*/
|
|
245446
245590
|
static setSingleEdgeVisibility(polyface, facetIndex, vertexIndex, value) {
|
|
@@ -245453,9 +245597,9 @@ class PolyfaceQuery {
|
|
|
245453
245597
|
}
|
|
245454
245598
|
/**
|
|
245455
245599
|
* Get the visibility of a particular edge of a particular facet.
|
|
245456
|
-
* @param polyface containing polyface
|
|
245457
|
-
* @param facetIndex facet index
|
|
245458
|
-
* @param vertexIndex vertex index (in vertex array) at which the edge starts
|
|
245600
|
+
* @param polyface containing polyface.
|
|
245601
|
+
* @param facetIndex facet index.
|
|
245602
|
+
* @param vertexIndex vertex index (in vertex array) at which the edge starts.
|
|
245459
245603
|
*/
|
|
245460
245604
|
static getSingleEdgeVisibility(polyface, facetIndex, vertexIndex) {
|
|
245461
245605
|
const data = polyface.data;
|
|
@@ -245466,29 +245610,13 @@ class PolyfaceQuery {
|
|
|
245466
245610
|
return data.edgeVisible[i]; // return visibility of first edge in the face that starts at this vertex
|
|
245467
245611
|
return undefined;
|
|
245468
245612
|
}
|
|
245469
|
-
/** Load all half edges from a mesh to an IndexedEdgeMatcher.
|
|
245470
|
-
* @param polyface a mesh, or a visitor assumed to have numWrap === 1
|
|
245471
|
-
*/
|
|
245472
|
-
static createIndexedEdges(polyface) {
|
|
245473
|
-
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
245474
|
-
return this.createIndexedEdges(polyface.createVisitor(1));
|
|
245475
|
-
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
|
|
245476
|
-
polyface.reset();
|
|
245477
|
-
while (polyface.moveToNextFacet()) {
|
|
245478
|
-
const numEdges = polyface.pointCount - 1;
|
|
245479
|
-
for (let i = 0; i < numEdges; i++) {
|
|
245480
|
-
edges.addEdge(polyface.clientPointIndex(i), polyface.clientPointIndex(i + 1), polyface.currentReadIndex());
|
|
245481
|
-
}
|
|
245482
|
-
}
|
|
245483
|
-
return edges;
|
|
245484
|
-
}
|
|
245485
245613
|
/**
|
|
245486
245614
|
* Return manifold edge pairs whose dihedral angle is bounded by the given angle.
|
|
245487
245615
|
* * The dihedral angle of a manifold edge is measured between the normals of its two adjacent faces.
|
|
245488
245616
|
* * Boundary edges are not returned as they are not manifold.
|
|
245489
|
-
* @param mesh existing polyface or visitor
|
|
245490
|
-
* @param maxSmoothEdgeAngle maximum dihedral angle of a smooth edge. If undefined
|
|
245491
|
-
* @param sharpEdges true to reverse the angle threshold test and return sharp edges; otherwise return smooth edges (default)
|
|
245617
|
+
* @param mesh existing polyface or visitor.
|
|
245618
|
+
* @param maxSmoothEdgeAngle maximum dihedral angle of a smooth edge. If `undefined`, uses `Geometry.smallAngleRadians`.
|
|
245619
|
+
* @param sharpEdges true to reverse the angle threshold test and return sharp edges; otherwise return smooth edges (default).
|
|
245492
245620
|
*/
|
|
245493
245621
|
static collectEdgesByDihedralAngle(mesh, maxSmoothEdgeAngle, sharpEdges = false) {
|
|
245494
245622
|
if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -245523,13 +245651,13 @@ class PolyfaceQuery {
|
|
|
245523
245651
|
return outEdges;
|
|
245524
245652
|
}
|
|
245525
245653
|
/**
|
|
245654
|
+
* Make paired edges invisible.
|
|
245526
245655
|
* * Find mated pairs among facet edges.
|
|
245527
245656
|
* * Mated pairs have the same vertex indices appearing in opposite order.
|
|
245528
245657
|
* * Mark all non-mated pairs visible.
|
|
245529
245658
|
* * At mated pairs
|
|
245530
245659
|
* * if angle across the edge is larger than `sharpEdgeAngle`, mark visible
|
|
245531
245660
|
* * otherwise mark invisible.
|
|
245532
|
-
* @param mesh mesh to be marked
|
|
245533
245661
|
*/
|
|
245534
245662
|
static markPairedEdgesInvisible(mesh, sharpEdgeAngle) {
|
|
245535
245663
|
const visitor = mesh.createVisitor(1);
|
|
@@ -245558,7 +245686,8 @@ class PolyfaceQuery {
|
|
|
245558
245686
|
}
|
|
245559
245687
|
}
|
|
245560
245688
|
}
|
|
245561
|
-
/**
|
|
245689
|
+
/**
|
|
245690
|
+
* Try to compute a unit normal for a facet accessible through a visitor.
|
|
245562
245691
|
* * Unit normal is computed by `PolygonOps.unitNormal` with the points around the facet.
|
|
245563
245692
|
*/
|
|
245564
245693
|
static computeFacetUnitNormal(visitor, facetIndex, result) {
|
|
@@ -245571,18 +245700,18 @@ class PolyfaceQuery {
|
|
|
245571
245700
|
return undefined;
|
|
245572
245701
|
}
|
|
245573
245702
|
/**
|
|
245574
|
-
|
|
245575
|
-
|
|
245576
|
-
|
|
245577
|
-
|
|
245703
|
+
* * Mark all edge visibilities in the IndexedPolyface.
|
|
245704
|
+
* @param mesh mesh to be marked.
|
|
245705
|
+
* @param value true for visible, false for hidden.
|
|
245706
|
+
*/
|
|
245578
245707
|
static markAllEdgeVisibility(mesh, value) {
|
|
245579
245708
|
const data = mesh.data;
|
|
245580
245709
|
for (let i = 0; i < data.edgeVisible.length; i++)
|
|
245581
245710
|
data.edgeVisible[i] = value;
|
|
245582
245711
|
}
|
|
245583
245712
|
/**
|
|
245584
|
-
* Create a HalfEdgeGraph with a face for each facet of the IndexedPolyface
|
|
245585
|
-
* @param mesh mesh to convert
|
|
245713
|
+
* Create a HalfEdgeGraph with a face for each facet of the IndexedPolyface.
|
|
245714
|
+
* @param mesh mesh to convert.
|
|
245586
245715
|
* @internal
|
|
245587
245716
|
*/
|
|
245588
245717
|
static convertToHalfEdgeGraph(mesh) {
|
|
@@ -245601,28 +245730,22 @@ class PolyfaceQuery {
|
|
|
245601
245730
|
});
|
|
245602
245731
|
return graph;
|
|
245603
245732
|
}
|
|
245604
|
-
/**
|
|
245605
|
-
* * Examine adjacent facet orientations throughout the mesh
|
|
245606
|
-
* * If possible, reverse a subset to achieve proper pairing.
|
|
245607
|
-
* @param mesh
|
|
245608
|
-
*/
|
|
245733
|
+
/** Examine adjacent facet orientations throughout the mesh. If possible, reverse a subset to achieve proper pairing. */
|
|
245609
245734
|
static reorientVertexOrderAroundFacetsForConsistentOrientation(mesh) {
|
|
245610
245735
|
return _FacetOrientation__WEBPACK_IMPORTED_MODULE_31__.FacetOrientationFixup.doFixup(mesh);
|
|
245611
245736
|
}
|
|
245612
|
-
/**
|
|
245613
|
-
* Set up indexed normals with one normal in the plane of each facet of the mesh.
|
|
245614
|
-
* @param polyface
|
|
245615
|
-
*/
|
|
245737
|
+
/** Set up indexed normals with one normal in the plane of each facet of the mesh. */
|
|
245616
245738
|
static buildPerFaceNormals(polyface) {
|
|
245617
245739
|
_multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_32__.BuildAverageNormalsContext.buildPerFaceNormals(polyface);
|
|
245618
245740
|
}
|
|
245619
245741
|
/**
|
|
245620
|
-
* * At each vertex of the mesh
|
|
245621
|
-
* * Find clusters of almost parallel normals
|
|
245622
|
-
* * Compute simple average of those normals
|
|
245623
|
-
* * Index to the averages
|
|
245742
|
+
* * At each vertex of the mesh:
|
|
245743
|
+
* * Find clusters of almost parallel normals.
|
|
245744
|
+
* * Compute simple average of those normals.
|
|
245745
|
+
* * Index to the averages.
|
|
245624
245746
|
* * For typical meshes, this correctly clusters adjacent normals.
|
|
245625
|
-
* * One can imagine a vertex with multiple "smooth cone-like" sets of
|
|
245747
|
+
* * One can imagine a vertex with multiple "smooth cone-like" sets of adjacent facets such that averaging occurs
|
|
245748
|
+
* among two nonadjacent cones. But this does not seem to be a problem in practice.
|
|
245626
245749
|
* @param polyface polyface to update.
|
|
245627
245750
|
* @param toleranceAngle averaging is done between normals up to this angle.
|
|
245628
245751
|
*/
|
|
@@ -245631,9 +245754,9 @@ class PolyfaceQuery {
|
|
|
245631
245754
|
}
|
|
245632
245755
|
/**
|
|
245633
245756
|
* Offset the faces of the mesh.
|
|
245634
|
-
* @param source original mesh
|
|
245757
|
+
* @param source original mesh.
|
|
245635
245758
|
* @param signedOffsetDistance distance to offset
|
|
245636
|
-
* @param offsetOptions angle options.
|
|
245759
|
+
* @param offsetOptions angle options. The default options are recommended.
|
|
245637
245760
|
* @returns shifted mesh.
|
|
245638
245761
|
*/
|
|
245639
245762
|
static cloneOffset(source, signedOffsetDistance, offsetOptions = OffsetMeshOptions.create()) {
|
|
@@ -245642,16 +245765,22 @@ class PolyfaceQuery {
|
|
|
245642
245765
|
_multiclip_OffsetMeshContext__WEBPACK_IMPORTED_MODULE_33__.OffsetMeshContext.buildOffsetMeshWithEdgeChamfers(source, offsetBuilder, signedOffsetDistance, offsetOptions);
|
|
245643
245766
|
return offsetBuilder.claimPolyface();
|
|
245644
245767
|
}
|
|
245645
|
-
/**
|
|
245646
|
-
*
|
|
245647
|
-
*
|
|
245768
|
+
/**
|
|
245769
|
+
* Search facets for the first one that intersects the infinite line.
|
|
245770
|
+
* * To process _all_ intersections, callers can supply an `options.acceptIntersection` callback that always
|
|
245771
|
+
* returns `false`.
|
|
245772
|
+
* In this case, `intersectRay3d` will return `undefined`, but the callback will be invoked for each intersection.
|
|
245648
245773
|
* * Example callback logic:
|
|
245649
245774
|
* * Accept the first found facet that intersects the half-line specified by the ray: `return detail.a >= 0.0;`
|
|
245650
|
-
* * Collect all intersections: `myIntersections.push(detail.clone()); return false;` Then after `intersectRay3d`
|
|
245651
|
-
*
|
|
245652
|
-
* @param
|
|
245653
|
-
* @param
|
|
245654
|
-
*
|
|
245775
|
+
* * Collect all intersections: `myIntersections.push(detail.clone()); return false;` Then after `intersectRay3d`
|
|
245776
|
+
* returns, sort along `ray` with `myIntersections.sort((d0, d1) => d0.a - d1.a);`
|
|
245777
|
+
* @param visitor facet iterator.
|
|
245778
|
+
* @param ray infinite line parameterized as a ray. The returned `detail.a` is the intersection parameter on the
|
|
245779
|
+
* ray, e.g., zero at `ray.origin` and increasing in `ray.direction`.
|
|
245780
|
+
* @param options options for computing and populating an intersection detail, and an optional callback for
|
|
245781
|
+
* accepting one.
|
|
245782
|
+
* @return detail for the (accepted) intersection with `detail.IsInsideOrOn === true`, or `undefined` if no
|
|
245783
|
+
* (accepted) intersection.
|
|
245655
245784
|
* @see PolygonOps.intersectRay3d
|
|
245656
245785
|
*/
|
|
245657
245786
|
static intersectRay3d(visitor, ray, options) {
|
|
@@ -245694,7 +245823,8 @@ class PolyfaceQuery {
|
|
|
245694
245823
|
}
|
|
245695
245824
|
// amount of computation to do per step of async methods.
|
|
245696
245825
|
PolyfaceQuery._asyncWorkLimit = 1.e06;
|
|
245697
|
-
/**
|
|
245826
|
+
/**
|
|
245827
|
+
* Number of "await" steps executed in recent async calls.
|
|
245698
245828
|
* @internal
|
|
245699
245829
|
*/
|
|
245700
245830
|
PolyfaceQuery.awaitBlockCount = 0;
|
|
@@ -255058,44 +255188,45 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
255058
255188
|
/* harmony export */ "DgnSpiralTypeQueries": () => (/* binding */ DgnSpiralTypeQueries)
|
|
255059
255189
|
/* harmony export */ });
|
|
255060
255190
|
/* harmony import */ var flatbuffers__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! flatbuffers */ "../../common/temp/node_modules/.pnpm/flatbuffers@1.12.0/node_modules/flatbuffers/js/flatbuffers.mjs");
|
|
255061
|
-
/* harmony import */ var
|
|
255062
|
-
/* harmony import */ var
|
|
255063
|
-
/* harmony import */ var
|
|
255064
|
-
/* harmony import */ var
|
|
255065
|
-
/* harmony import */ var
|
|
255066
|
-
/* harmony import */ var
|
|
255067
|
-
/* harmony import */ var
|
|
255068
|
-
/* harmony import */ var
|
|
255069
|
-
/* harmony import */ var
|
|
255070
|
-
/* harmony import */ var
|
|
255071
|
-
/* harmony import */ var
|
|
255072
|
-
/* harmony import */ var
|
|
255073
|
-
/* harmony import */ var
|
|
255074
|
-
/* harmony import */ var
|
|
255075
|
-
/* harmony import */ var
|
|
255076
|
-
/* harmony import */ var
|
|
255077
|
-
/* harmony import */ var
|
|
255078
|
-
/* harmony import */ var
|
|
255079
|
-
/* harmony import */ var
|
|
255080
|
-
/* harmony import */ var
|
|
255081
|
-
/* harmony import */ var
|
|
255082
|
-
/* harmony import */ var
|
|
255083
|
-
/* harmony import */ var
|
|
255084
|
-
/* harmony import */ var
|
|
255085
|
-
/* harmony import */ var
|
|
255086
|
-
/* harmony import */ var
|
|
255087
|
-
/* harmony import */ var
|
|
255088
|
-
/* harmony import */ var
|
|
255089
|
-
/* harmony import */ var
|
|
255090
|
-
/* harmony import */ var
|
|
255091
|
-
/* harmony import */ var
|
|
255092
|
-
/* harmony import */ var
|
|
255093
|
-
/* harmony import */ var
|
|
255094
|
-
/* harmony import */ var
|
|
255095
|
-
/* harmony import */ var
|
|
255096
|
-
/* harmony import */ var
|
|
255097
|
-
/* harmony import */ var
|
|
255098
|
-
/* harmony import */ var
|
|
255191
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
255192
|
+
/* harmony import */ var _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../bspline/AkimaCurve3d */ "../../core/geometry/lib/esm/bspline/AkimaCurve3d.js");
|
|
255193
|
+
/* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
|
|
255194
|
+
/* harmony import */ var _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../bspline/BSplineCurve3dH */ "../../core/geometry/lib/esm/bspline/BSplineCurve3dH.js");
|
|
255195
|
+
/* harmony import */ var _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../bspline/BSplineSurface */ "../../core/geometry/lib/esm/bspline/BSplineSurface.js");
|
|
255196
|
+
/* harmony import */ var _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../bspline/InterpolationCurve3d */ "../../core/geometry/lib/esm/bspline/InterpolationCurve3d.js");
|
|
255197
|
+
/* harmony import */ var _curve_Arc3d__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../curve/Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
255198
|
+
/* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
255199
|
+
/* harmony import */ var _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../curve/GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
255200
|
+
/* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
255201
|
+
/* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
255202
|
+
/* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
255203
|
+
/* harmony import */ var _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../curve/ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
|
|
255204
|
+
/* harmony import */ var _curve_Path__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../curve/Path */ "../../core/geometry/lib/esm/curve/Path.js");
|
|
255205
|
+
/* harmony import */ var _curve_PointString3d__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../curve/PointString3d */ "../../core/geometry/lib/esm/curve/PointString3d.js");
|
|
255206
|
+
/* harmony import */ var _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../curve/spiral/DirectSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/DirectSpiral3d.js");
|
|
255207
|
+
/* harmony import */ var _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../curve/spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
|
|
255208
|
+
/* harmony import */ var _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../curve/spiral/TransitionSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/TransitionSpiral3d.js");
|
|
255209
|
+
/* harmony import */ var _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../curve/UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
|
|
255210
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
255211
|
+
/* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
255212
|
+
/* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
|
|
255213
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
255214
|
+
/* harmony import */ var _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/PointHelpers */ "../../core/geometry/lib/esm/geometry3d/PointHelpers.js");
|
|
255215
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
255216
|
+
/* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
|
|
255217
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
255218
|
+
/* harmony import */ var _polyface_AuxData__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../polyface/AuxData */ "../../core/geometry/lib/esm/polyface/AuxData.js");
|
|
255219
|
+
/* harmony import */ var _polyface_Polyface__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../polyface/Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
255220
|
+
/* harmony import */ var _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../polyface/TaggedNumericData */ "../../core/geometry/lib/esm/polyface/TaggedNumericData.js");
|
|
255221
|
+
/* harmony import */ var _solid_Box__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../solid/Box */ "../../core/geometry/lib/esm/solid/Box.js");
|
|
255222
|
+
/* harmony import */ var _solid_Cone__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../solid/Cone */ "../../core/geometry/lib/esm/solid/Cone.js");
|
|
255223
|
+
/* harmony import */ var _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../solid/LinearSweep */ "../../core/geometry/lib/esm/solid/LinearSweep.js");
|
|
255224
|
+
/* harmony import */ var _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../solid/RotationalSweep */ "../../core/geometry/lib/esm/solid/RotationalSweep.js");
|
|
255225
|
+
/* harmony import */ var _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../solid/RuledSweep */ "../../core/geometry/lib/esm/solid/RuledSweep.js");
|
|
255226
|
+
/* harmony import */ var _solid_Sphere__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../solid/Sphere */ "../../core/geometry/lib/esm/solid/Sphere.js");
|
|
255227
|
+
/* harmony import */ var _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../solid/TorusPipe */ "../../core/geometry/lib/esm/solid/TorusPipe.js");
|
|
255228
|
+
/* harmony import */ var _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BGFBAccessors */ "../../core/geometry/lib/esm/serialization/BGFBAccessors.js");
|
|
255229
|
+
/* harmony import */ var _SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SerializationHelpers */ "../../core/geometry/lib/esm/serialization/SerializationHelpers.js");
|
|
255099
255230
|
/*---------------------------------------------------------------------------------------------
|
|
255100
255231
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
255101
255232
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -255137,6 +255268,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
255137
255268
|
|
|
255138
255269
|
|
|
255139
255270
|
|
|
255271
|
+
|
|
255140
255272
|
|
|
255141
255273
|
|
|
255142
255274
|
/** * Context to write to a flatbuffer blob.
|
|
@@ -255154,8 +255286,8 @@ class BGFBReader {
|
|
|
255154
255286
|
readBSplineSurfaceFromVariant(variantHeader) {
|
|
255155
255287
|
let newSurface;
|
|
255156
255288
|
const geometryType = variantHeader.geometryType();
|
|
255157
|
-
if (geometryType ===
|
|
255158
|
-
const bsurfHeader = variantHeader.geometry(new
|
|
255289
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagBsplineSurface) {
|
|
255290
|
+
const bsurfHeader = variantHeader.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.BsplineSurface());
|
|
255159
255291
|
if (bsurfHeader !== null) {
|
|
255160
255292
|
const orderU = bsurfHeader.orderU();
|
|
255161
255293
|
const orderV = bsurfHeader.orderV();
|
|
@@ -255168,23 +255300,23 @@ class BGFBReader {
|
|
|
255168
255300
|
const closedU = bsurfHeader.closedU();
|
|
255169
255301
|
const closedV = bsurfHeader.closedV();
|
|
255170
255302
|
if (xyzArray !== null && knotArrayU !== null && knotArrayV !== null) {
|
|
255171
|
-
const myData =
|
|
255303
|
+
const myData = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.createBSplineSurfaceData(xyzArray, 3, knotArrayU, numPolesU, orderU, knotArrayV, numPolesV, orderV);
|
|
255172
255304
|
if (weightArray !== null)
|
|
255173
255305
|
myData.weights = weightArray;
|
|
255174
255306
|
if (closedU)
|
|
255175
255307
|
myData.uParams.closed = true;
|
|
255176
255308
|
if (closedV)
|
|
255177
255309
|
myData.vParams.closed = true;
|
|
255178
|
-
if (
|
|
255310
|
+
if (_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.Import.prepareBSplineSurfaceData(myData, { jsonPoles: false })) {
|
|
255179
255311
|
if (undefined === myData.weights)
|
|
255180
|
-
newSurface =
|
|
255312
|
+
newSurface = _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_4__.BSplineSurface3d.create(myData.poles, myData.uParams.numPoles, myData.uParams.order, myData.uParams.knots, myData.vParams.numPoles, myData.vParams.order, myData.vParams.knots);
|
|
255181
255313
|
else
|
|
255182
|
-
newSurface =
|
|
255314
|
+
newSurface = _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_4__.BSplineSurface3dH.create(myData.poles, myData.weights, myData.uParams.numPoles, myData.uParams.order, myData.uParams.knots, myData.vParams.numPoles, myData.vParams.order, myData.vParams.knots);
|
|
255183
255315
|
if (undefined !== newSurface) {
|
|
255184
255316
|
if (undefined !== myData.uParams.wrapMode)
|
|
255185
|
-
newSurface.setWrappable(
|
|
255317
|
+
newSurface.setWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_4__.UVSelect.uDirection, myData.uParams.wrapMode);
|
|
255186
255318
|
if (undefined !== myData.vParams.wrapMode)
|
|
255187
|
-
newSurface.setWrappable(
|
|
255319
|
+
newSurface.setWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_4__.UVSelect.vDirection, myData.vParams.wrapMode);
|
|
255188
255320
|
}
|
|
255189
255321
|
}
|
|
255190
255322
|
}
|
|
@@ -255200,11 +255332,11 @@ class BGFBReader {
|
|
|
255200
255332
|
const xyzArray = header.fitPointsArray();
|
|
255201
255333
|
if (xyzArray instanceof Float64Array) {
|
|
255202
255334
|
const knots = header.knotsArray();
|
|
255203
|
-
const options = new
|
|
255335
|
+
const options = new _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_5__.InterpolationCurve3dOptions(_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_6__.Point3dArray.clonePoint3dArray(xyzArray), knots ? _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_6__.NumberArray.create(knots) : undefined);
|
|
255204
255336
|
const startTangent = header.startTangent();
|
|
255205
255337
|
const endTangent = header.endTangent();
|
|
255206
|
-
options.captureOptionalProps(header.order(), header.closed(), header.isChordLenKnots(), header.isColinearTangents(), header.isChordLenTangents(), header.isNaturalTangents(), startTangent !== null ?
|
|
255207
|
-
return
|
|
255338
|
+
options.captureOptionalProps(header.order(), header.closed(), header.isChordLenKnots(), header.isColinearTangents(), header.isChordLenTangents(), header.isNaturalTangents(), startTangent !== null ? _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(startTangent.x(), startTangent.y(), startTangent.z()) : undefined, endTangent !== null ? _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(endTangent.x(), endTangent.y(), endTangent.z()) : undefined);
|
|
255339
|
+
return _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_5__.InterpolationCurve3d.createCapture(options);
|
|
255208
255340
|
}
|
|
255209
255341
|
return undefined;
|
|
255210
255342
|
}
|
|
@@ -255215,8 +255347,8 @@ class BGFBReader {
|
|
|
255215
255347
|
readAkimaCurve3d(header) {
|
|
255216
255348
|
const xyzArray = header.pointsArray();
|
|
255217
255349
|
if (xyzArray instanceof Float64Array) {
|
|
255218
|
-
const options = new
|
|
255219
|
-
return
|
|
255350
|
+
const options = new _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_8__.AkimaCurve3dOptions(_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_6__.Point3dArray.clonePoint3dArray(xyzArray));
|
|
255351
|
+
return _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_8__.AkimaCurve3d.createCapture(options);
|
|
255220
255352
|
}
|
|
255221
255353
|
return undefined;
|
|
255222
255354
|
}
|
|
@@ -255233,17 +255365,17 @@ class BGFBReader {
|
|
|
255233
255365
|
const closed = header.closed();
|
|
255234
255366
|
if (xyzArray !== null && knots !== null) {
|
|
255235
255367
|
const numPoles = Math.floor(xyzArray.length / 3);
|
|
255236
|
-
const myData =
|
|
255368
|
+
const myData = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.createBSplineCurveData(xyzArray, 3, knots, numPoles, order);
|
|
255237
255369
|
if (closed)
|
|
255238
255370
|
myData.params.closed = true;
|
|
255239
255371
|
if (weightsArray === null) {
|
|
255240
|
-
if (
|
|
255241
|
-
newCurve =
|
|
255372
|
+
if (_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.Import.prepareBSplineCurveData(myData))
|
|
255373
|
+
newCurve = _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_9__.BSplineCurve3d.create(myData.poles, myData.params.knots, myData.params.order);
|
|
255242
255374
|
}
|
|
255243
255375
|
else {
|
|
255244
255376
|
myData.weights = weightsArray;
|
|
255245
|
-
if (
|
|
255246
|
-
newCurve =
|
|
255377
|
+
if (_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.Import.prepareBSplineCurveData(myData, { jsonPoles: false }))
|
|
255378
|
+
newCurve = _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_10__.BSplineCurve3dH.create({ xyz: myData.poles, weights: myData.weights }, myData.params.knots, myData.params.order);
|
|
255247
255379
|
}
|
|
255248
255380
|
if (undefined !== newCurve) {
|
|
255249
255381
|
if (undefined !== myData.params.wrapMode)
|
|
@@ -255267,17 +255399,17 @@ class BGFBReader {
|
|
|
255267
255399
|
const bearing0Radians = detailHeader.bearing0Radians();
|
|
255268
255400
|
const bearing1Radians = detailHeader.bearing1Radians();
|
|
255269
255401
|
const fbTransform = detailHeader.transform();
|
|
255270
|
-
const localToWorld = fbTransform ?
|
|
255271
|
-
|
|
255272
|
-
const activeFractionInterval =
|
|
255402
|
+
const localToWorld = fbTransform ? _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_11__.Transform.createRowValues(fbTransform.axx(), fbTransform.axy(), fbTransform.axz(), fbTransform.axw(), fbTransform.ayx(), fbTransform.ayy(), fbTransform.ayz(), fbTransform.ayw(), fbTransform.azx(), fbTransform.azy(), fbTransform.azz(), fbTransform.azw()) :
|
|
255403
|
+
_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_11__.Transform.createIdentity();
|
|
255404
|
+
const activeFractionInterval = _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_12__.Segment1d.create(detailHeader.fractionA(), detailHeader.fractionB());
|
|
255273
255405
|
if (!directDetailHeader) {
|
|
255274
|
-
const integratedSpiral =
|
|
255406
|
+
const integratedSpiral = _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_13__.IntegratedSpiral3d.createRadiusRadiusBearingBearing(_geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_12__.Segment1d.create(_curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_13__.IntegratedSpiral3d.curvatureToRadius(curvature0), _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_13__.IntegratedSpiral3d.curvatureToRadius(curvature1)), _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_14__.AngleSweep.createStartEndRadians(bearing0Radians, bearing1Radians), activeFractionInterval, localToWorld, spiralTypeName);
|
|
255275
255407
|
if (integratedSpiral)
|
|
255276
255408
|
return integratedSpiral;
|
|
255277
|
-
const radius0 =
|
|
255278
|
-
const radius1 =
|
|
255279
|
-
const arcLength =
|
|
255280
|
-
const directSpiral =
|
|
255409
|
+
const radius0 = _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_15__.TransitionSpiral3d.curvatureToRadius(curvature0);
|
|
255410
|
+
const radius1 = _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_15__.TransitionSpiral3d.curvatureToRadius(curvature1);
|
|
255411
|
+
const arcLength = _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_15__.TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(radius0, radius1, bearing1Radians - bearing0Radians);
|
|
255412
|
+
const directSpiral = _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_16__.DirectSpiral3d.createFromLengthAndRadius(spiralTypeName, radius0, radius1, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_17__.Angle.createRadians(bearing0Radians), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_17__.Angle.createRadians(bearing1Radians), arcLength, activeFractionInterval, localToWorld);
|
|
255281
255413
|
if (directSpiral)
|
|
255282
255414
|
return directSpiral;
|
|
255283
255415
|
}
|
|
@@ -255290,42 +255422,42 @@ class BGFBReader {
|
|
|
255290
255422
|
*/
|
|
255291
255423
|
readCurvePrimitiveFromVariant(variant) {
|
|
255292
255424
|
const geometryType = variant.geometryType();
|
|
255293
|
-
if (geometryType ===
|
|
255294
|
-
const offsetToLineSegment = variant.geometry(new
|
|
255425
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagLineSegment) {
|
|
255426
|
+
const offsetToLineSegment = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.LineSegment());
|
|
255295
255427
|
const offsetToCoordinates = offsetToLineSegment.segment();
|
|
255296
|
-
return
|
|
255428
|
+
return _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_18__.LineSegment3d.createXYZXYZ(offsetToCoordinates.point0X(), offsetToCoordinates.point0Y(), offsetToCoordinates.point0Z(), offsetToCoordinates.point1X(), offsetToCoordinates.point1Y(), offsetToCoordinates.point1Z());
|
|
255297
255429
|
}
|
|
255298
|
-
else if (geometryType ===
|
|
255299
|
-
const offsetToEllipticArc = variant.geometry(new
|
|
255430
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagEllipticArc) {
|
|
255431
|
+
const offsetToEllipticArc = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.EllipticArc());
|
|
255300
255432
|
const offsetToCoordinates = offsetToEllipticArc.arc();
|
|
255301
|
-
return
|
|
255433
|
+
return _curve_Arc3d__WEBPACK_IMPORTED_MODULE_19__.Arc3d.createXYZXYZXYZ(offsetToCoordinates.centerX(), offsetToCoordinates.centerY(), offsetToCoordinates.centerZ(), offsetToCoordinates.vector0X(), offsetToCoordinates.vector0Y(), offsetToCoordinates.vector0Z(), offsetToCoordinates.vector90X(), offsetToCoordinates.vector90Y(), offsetToCoordinates.vector90Z(), _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_14__.AngleSweep.createStartSweepRadians(offsetToCoordinates.startRadians(), offsetToCoordinates?.sweepRadians()));
|
|
255302
255434
|
}
|
|
255303
|
-
else if (geometryType ===
|
|
255304
|
-
const offsetToLineString = variant.geometry(new
|
|
255435
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagLineString) {
|
|
255436
|
+
const offsetToLineString = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.LineString());
|
|
255305
255437
|
const numCoordinates = offsetToLineString.pointsLength();
|
|
255306
|
-
const result =
|
|
255438
|
+
const result = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_20__.LineString3d.create();
|
|
255307
255439
|
for (let i = 0; i + 2 < numCoordinates; i += 3) {
|
|
255308
255440
|
result.packedPoints.pushXYZ(offsetToLineString.points(i), offsetToLineString.points(i + 1), offsetToLineString.points(i + 2));
|
|
255309
255441
|
}
|
|
255310
255442
|
return result;
|
|
255311
255443
|
}
|
|
255312
|
-
else if (geometryType ===
|
|
255313
|
-
const offsetToBCurve = variant.geometry(new
|
|
255444
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagBsplineCurve) {
|
|
255445
|
+
const offsetToBCurve = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.BsplineCurve());
|
|
255314
255446
|
if (offsetToBCurve !== null)
|
|
255315
255447
|
return this.readBSplineCurve(offsetToBCurve);
|
|
255316
255448
|
}
|
|
255317
|
-
else if (geometryType ===
|
|
255318
|
-
const offsetToTransitionSpiralTable = variant.geometry(new
|
|
255449
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagTransitionSpiral) {
|
|
255450
|
+
const offsetToTransitionSpiralTable = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.TransitionSpiral());
|
|
255319
255451
|
if (offsetToTransitionSpiralTable !== null)
|
|
255320
255452
|
return this.readTransitionSpiral(offsetToTransitionSpiralTable);
|
|
255321
255453
|
}
|
|
255322
|
-
else if (geometryType ===
|
|
255323
|
-
const offsetToInterpolationCurveTable = variant.geometry(new
|
|
255454
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagInterpolationCurve) {
|
|
255455
|
+
const offsetToInterpolationCurveTable = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.InterpolationCurve());
|
|
255324
255456
|
if (offsetToInterpolationCurveTable !== null)
|
|
255325
255457
|
return this.readInterpolationCurve3d(offsetToInterpolationCurveTable);
|
|
255326
255458
|
}
|
|
255327
|
-
else if (geometryType ===
|
|
255328
|
-
const offsetToAkimaCurveTable = variant.geometry(new
|
|
255459
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagAkimaCurve) {
|
|
255460
|
+
const offsetToAkimaCurveTable = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.AkimaCurve());
|
|
255329
255461
|
if (offsetToAkimaCurveTable !== null)
|
|
255330
255462
|
return this.readAkimaCurve3d(offsetToAkimaCurveTable);
|
|
255331
255463
|
}
|
|
@@ -255337,34 +255469,28 @@ class BGFBReader {
|
|
|
255337
255469
|
*/
|
|
255338
255470
|
readPointStringFromVariant(variant) {
|
|
255339
255471
|
const geometryType = variant.geometryType();
|
|
255340
|
-
if (geometryType ===
|
|
255341
|
-
const offsetToLineString = variant.geometry(new
|
|
255472
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagPointString) {
|
|
255473
|
+
const offsetToLineString = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.PointString());
|
|
255342
255474
|
const numCoordinates = offsetToLineString.pointsLength();
|
|
255343
|
-
const result =
|
|
255475
|
+
const result = _curve_PointString3d__WEBPACK_IMPORTED_MODULE_21__.PointString3d.create();
|
|
255344
255476
|
for (let i = 0; i + 2 < numCoordinates; i += 3) {
|
|
255345
|
-
result.points.push(
|
|
255477
|
+
result.points.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(offsetToLineString.points(i), offsetToLineString.points(i + 1), offsetToLineString.points(i + 2)));
|
|
255346
255478
|
}
|
|
255347
255479
|
return result;
|
|
255348
255480
|
}
|
|
255349
255481
|
return undefined;
|
|
255350
255482
|
}
|
|
255351
|
-
/**
|
|
255352
|
-
* Extract auxData for a mesh
|
|
255353
|
-
* @param variant read position in the flat buffer.
|
|
255354
|
-
*/
|
|
255483
|
+
/** Extract auxData channel data for a mesh */
|
|
255355
255484
|
readPolyfaceAuxChannelData(channelDataHeader) {
|
|
255356
255485
|
if (channelDataHeader !== null) {
|
|
255357
255486
|
const input = channelDataHeader.input();
|
|
255358
255487
|
const values = channelDataHeader.valuesArray();
|
|
255359
255488
|
if (values !== null)
|
|
255360
|
-
return new
|
|
255489
|
+
return new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_22__.AuxChannelData(input, values);
|
|
255361
255490
|
}
|
|
255362
255491
|
return undefined;
|
|
255363
255492
|
}
|
|
255364
|
-
/**
|
|
255365
|
-
* Extract auxData for a mesh
|
|
255366
|
-
* @param variant read position in the flat buffer.
|
|
255367
|
-
*/
|
|
255493
|
+
/** Extract auxData channel for a mesh */
|
|
255368
255494
|
readPolyfaceAuxChannel(channelHeader) {
|
|
255369
255495
|
if (channelHeader) {
|
|
255370
255496
|
const dataType = channelHeader.dataType();
|
|
@@ -255377,43 +255503,107 @@ class BGFBReader {
|
|
|
255377
255503
|
if (channelData)
|
|
255378
255504
|
channelDataArray.push(channelData);
|
|
255379
255505
|
}
|
|
255380
|
-
return new
|
|
255506
|
+
return new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_22__.AuxChannel(channelDataArray, dataType, name ? name : undefined, inputName ? inputName : undefined);
|
|
255381
255507
|
}
|
|
255382
255508
|
return undefined;
|
|
255383
255509
|
}
|
|
255384
|
-
/**
|
|
255385
|
-
|
|
255386
|
-
|
|
255387
|
-
|
|
255388
|
-
|
|
255389
|
-
if (
|
|
255390
|
-
|
|
255391
|
-
|
|
255392
|
-
|
|
255393
|
-
|
|
255394
|
-
|
|
255395
|
-
|
|
255396
|
-
|
|
255397
|
-
|
|
255398
|
-
|
|
255399
|
-
|
|
255400
|
-
|
|
255401
|
-
|
|
255402
|
-
|
|
255403
|
-
|
|
255404
|
-
|
|
255405
|
-
|
|
255406
|
-
|
|
255510
|
+
/** Compute the number of logical entries in every flat data array in the AuxData */
|
|
255511
|
+
static channelDataLength(fbAuxData) {
|
|
255512
|
+
if (fbAuxData.channelsLength() <= 0)
|
|
255513
|
+
return 0;
|
|
255514
|
+
const fbChannel0 = nullToUndefined(fbAuxData.channels(0));
|
|
255515
|
+
if (!fbChannel0)
|
|
255516
|
+
return 0;
|
|
255517
|
+
const numChannel0Data = fbChannel0.dataLength();
|
|
255518
|
+
if (numChannel0Data <= 0)
|
|
255519
|
+
return 0;
|
|
255520
|
+
const fbChannel0Data0 = nullToUndefined(fbChannel0.data(0));
|
|
255521
|
+
if (!fbChannel0Data0)
|
|
255522
|
+
return 0;
|
|
255523
|
+
const numChannelDataValues = fbChannel0Data0.valuesLength();
|
|
255524
|
+
if (numChannelDataValues <= 0)
|
|
255525
|
+
return 0;
|
|
255526
|
+
return numChannelDataValues / _polyface_AuxData__WEBPACK_IMPORTED_MODULE_22__.AuxChannel.entriesPerValue(fbChannel0.dataType());
|
|
255527
|
+
}
|
|
255528
|
+
/** Examine int array for range and zero count */
|
|
255529
|
+
countIntArray(ints) {
|
|
255530
|
+
let min = Infinity;
|
|
255531
|
+
let max = -Infinity;
|
|
255532
|
+
let numZeroes = 0;
|
|
255533
|
+
for (const i of ints) {
|
|
255534
|
+
if (min > i)
|
|
255535
|
+
min = i;
|
|
255536
|
+
if (max < i)
|
|
255537
|
+
max = i;
|
|
255538
|
+
if (0 === i)
|
|
255539
|
+
++numZeroes;
|
|
255540
|
+
}
|
|
255541
|
+
return { min, max, numZeroes };
|
|
255542
|
+
}
|
|
255543
|
+
/**
|
|
255544
|
+
* Extract auxData for a mesh.
|
|
255545
|
+
* Typescript object format for Polyface/PolyfaceAuxData indices is 0-based, unterminated.
|
|
255546
|
+
* FlatBuffer format for Polyface/PolyfaceAuxData indices is 1-based, 0-terminated/padded.
|
|
255547
|
+
* Typescript API previously wrote FlatBuffer PolyfaceAuxData indices as 0-based, unterminated;
|
|
255548
|
+
* heuristics are used herein to identify this legacy format so it can still be read.
|
|
255549
|
+
*/
|
|
255550
|
+
readPolyfaceAuxData(fbPolyface, fbAuxData) {
|
|
255551
|
+
if (!fbPolyface || !fbAuxData)
|
|
255552
|
+
return undefined;
|
|
255553
|
+
const fbPointIndices = nullToUndefined(fbPolyface.pointIndexArray());
|
|
255554
|
+
const fbAuxIndices = nullToUndefined(fbAuxData.indicesArray());
|
|
255555
|
+
const numChannels = fbAuxData.channelsLength();
|
|
255556
|
+
const fbNumData = BGFBReader.channelDataLength(fbAuxData);
|
|
255557
|
+
if (!fbPointIndices || !fbPointIndices.length || !fbAuxIndices || !fbAuxIndices.length || numChannels <= 0 || fbNumData <= 0)
|
|
255558
|
+
return undefined;
|
|
255559
|
+
const numPerFace = fbPolyface.numPerFace();
|
|
255560
|
+
// HEURISTICS to detect legacy AuxData indices, previously mistakenly serialized by BGFBWriter.writePolyfaceAsFBVariantGeometry as 0-based unblocked indices
|
|
255561
|
+
let isLegacy = false;
|
|
255562
|
+
const pointIndicesPadCount = fbPointIndices.filter((index) => index === 0).length;
|
|
255563
|
+
if (numPerFace > 1) {
|
|
255564
|
+
const auxIndexCounts = this.countIntArray(fbAuxIndices);
|
|
255565
|
+
if (auxIndexCounts.max > fbNumData) // auxIndices invalid
|
|
255566
|
+
return undefined;
|
|
255567
|
+
if (auxIndexCounts.max === fbNumData) // auxIndices 1-based
|
|
255568
|
+
isLegacy = false;
|
|
255569
|
+
else if (auxIndexCounts.max <= 0 || auxIndexCounts.min < 0) // auxIndices 1-based (signed)
|
|
255570
|
+
isLegacy = false;
|
|
255571
|
+
else if (auxIndexCounts.min === 0) // auxIndices likely legacy 0-based index, but could be modern with padding
|
|
255572
|
+
isLegacy = pointIndicesPadCount !== auxIndexCounts.numZeroes;
|
|
255573
|
+
else if (auxIndexCounts.min > 0) // auxIndices likely modern without padding, but could be legacy if first datum not indexed
|
|
255574
|
+
isLegacy = pointIndicesPadCount > 0;
|
|
255407
255575
|
}
|
|
255408
|
-
|
|
255576
|
+
else {
|
|
255577
|
+
isLegacy = (fbAuxIndices.length < fbPointIndices.length) && (fbAuxIndices.length + pointIndicesPadCount === fbPointIndices.length);
|
|
255578
|
+
}
|
|
255579
|
+
if (!isLegacy && fbAuxIndices.length !== fbPointIndices.length)
|
|
255580
|
+
return undefined; // auxIndices invalid
|
|
255581
|
+
const indices = [];
|
|
255582
|
+
if (isLegacy)
|
|
255583
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesWithExternalBlocking(fbAuxIndices, fbPointIndices, numPerFace, (i0) => { indices.push(i0); });
|
|
255584
|
+
else
|
|
255585
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(fbAuxIndices, numPerFace, (i0) => { indices.push(i0); });
|
|
255586
|
+
if (indices.length + pointIndicesPadCount !== fbPointIndices.length)
|
|
255587
|
+
return undefined;
|
|
255588
|
+
const maxIndex = Math.max(...indices);
|
|
255589
|
+
const channels = [];
|
|
255590
|
+
for (let i = 0; i < numChannels; i++) {
|
|
255591
|
+
const channelHeader = fbAuxData.channels(i);
|
|
255592
|
+
const channelContent = this.readPolyfaceAuxChannel(channelHeader);
|
|
255593
|
+
if (channelContent) {
|
|
255594
|
+
if (maxIndex >= channelContent.valueCount)
|
|
255595
|
+
return undefined; // invalid index
|
|
255596
|
+
channels.push(channelContent);
|
|
255597
|
+
}
|
|
255598
|
+
}
|
|
255599
|
+
if (!channels.length)
|
|
255600
|
+
return undefined;
|
|
255601
|
+
return new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_22__.PolyfaceAuxData(channels, indices);
|
|
255409
255602
|
}
|
|
255410
|
-
/**
|
|
255411
|
-
* Extract auxData for a mesh
|
|
255412
|
-
* @param variant read position in the flat buffer.
|
|
255413
|
-
*/
|
|
255603
|
+
/** Extract tagged numeric data for a mesh */
|
|
255414
255604
|
readTaggedNumericData(accessor) {
|
|
255415
255605
|
if (accessor) {
|
|
255416
|
-
const taggedNumericData = new
|
|
255606
|
+
const taggedNumericData = new _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_23__.TaggedNumericData(accessor.tagA(), accessor.tagB());
|
|
255417
255607
|
const intDataArray = nullToUndefined(accessor.intDataArray());
|
|
255418
255608
|
const doubleDataArray = nullToUndefined(accessor.doubleDataArray());
|
|
255419
255609
|
if (intDataArray) {
|
|
@@ -255431,13 +255621,13 @@ class BGFBReader {
|
|
|
255431
255621
|
return undefined;
|
|
255432
255622
|
}
|
|
255433
255623
|
/**
|
|
255434
|
-
|
|
255435
|
-
|
|
255436
|
-
|
|
255624
|
+
* Extract a mesh
|
|
255625
|
+
* @param variant read position in the flat buffer.
|
|
255626
|
+
*/
|
|
255437
255627
|
readPolyfaceFromVariant(variant) {
|
|
255438
255628
|
const geometryType = variant.geometryType();
|
|
255439
|
-
if (geometryType ===
|
|
255440
|
-
const polyfaceHeader = variant.geometry(new
|
|
255629
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagPolyface) {
|
|
255630
|
+
const polyfaceHeader = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.Polyface());
|
|
255441
255631
|
if (polyfaceHeader) {
|
|
255442
255632
|
const twoSided = polyfaceHeader.twoSided();
|
|
255443
255633
|
const expectedClosure = polyfaceHeader.expectedClosure();
|
|
@@ -255452,59 +255642,35 @@ class BGFBReader {
|
|
|
255452
255642
|
const normalIndexI32 = nullToUndefined(polyfaceHeader.normalIndexArray());
|
|
255453
255643
|
const colorIndexI32 = nullToUndefined(polyfaceHeader.colorIndexArray());
|
|
255454
255644
|
const taggedNumericDataOffset = polyfaceHeader.taggedNumericData();
|
|
255645
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__.assert)(meshStyle === 1, "Unrecognized flatbuffer mesh style");
|
|
255646
|
+
// The flatbuffer data is one based.
|
|
255647
|
+
// If numPerFace is less than 2, facets are variable size and zero terminated
|
|
255648
|
+
// If numPerFace is 2 or more, indices are blocked
|
|
255455
255649
|
if (meshStyle === 1 && pointF64 && pointIndexI32) {
|
|
255456
|
-
const polyface =
|
|
255650
|
+
const polyface = _polyface_Polyface__WEBPACK_IMPORTED_MODULE_24__.IndexedPolyface.create();
|
|
255651
|
+
polyface.twoSided = twoSided;
|
|
255457
255652
|
polyface.expectedClosure = expectedClosure;
|
|
255458
|
-
|
|
255459
|
-
|
|
255460
|
-
|
|
255461
|
-
|
|
255462
|
-
polyface.data.param.pushXY(paramF64[i], paramF64[i + 1]);
|
|
255653
|
+
if (normalF64 && normalIndexI32) {
|
|
255654
|
+
for (let i = 0; i + 2 < normalF64.length; i += 3)
|
|
255655
|
+
polyface.addNormalXYZ(normalF64[i], normalF64[i + 1], normalF64[i + 2]);
|
|
255656
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(normalIndexI32, numPerFace, (i) => { polyface.addNormalIndex(i); });
|
|
255463
255657
|
}
|
|
255464
|
-
if (
|
|
255465
|
-
for (let i = 0; i +
|
|
255466
|
-
polyface.
|
|
255658
|
+
if (paramF64 && paramIndexI32) {
|
|
255659
|
+
for (let i = 0; i + 1 < paramF64.length; i += 2)
|
|
255660
|
+
polyface.addParamUV(paramF64[i], paramF64[i + 1]);
|
|
255661
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(paramIndexI32, numPerFace, (i) => { polyface.addParamIndex(i); });
|
|
255467
255662
|
}
|
|
255468
|
-
if (intColorU32) {
|
|
255663
|
+
if (intColorU32 && colorIndexI32) {
|
|
255469
255664
|
for (const c of intColorU32)
|
|
255470
|
-
polyface.
|
|
255471
|
-
|
|
255472
|
-
// The flatbuffer data is one based.
|
|
255473
|
-
// If numPerFace is less than 2, facets are variable size and zero terminated
|
|
255474
|
-
// If numPerFace is 2 or more, indices are blocked
|
|
255475
|
-
const numIndex = pointIndexI32.length;
|
|
255476
|
-
const addIndicesInBlock = (k0, k1) => {
|
|
255477
|
-
for (let k = k0; k < k1; k++) {
|
|
255478
|
-
const q = pointIndexI32[k];
|
|
255479
|
-
polyface.addPointIndex(Math.abs(q) - 1, q > 0);
|
|
255480
|
-
if (normalF64 && normalIndexI32) {
|
|
255481
|
-
polyface.addNormalIndex(Math.abs(normalIndexI32[k]) - 1);
|
|
255482
|
-
}
|
|
255483
|
-
if (paramF64 && paramIndexI32) {
|
|
255484
|
-
polyface.addParamIndex(Math.abs(paramIndexI32[k]) - 1);
|
|
255485
|
-
}
|
|
255486
|
-
if (intColorU32 && colorIndexI32) {
|
|
255487
|
-
polyface.addColorIndex(Math.abs(colorIndexI32[k]) - 1);
|
|
255488
|
-
}
|
|
255489
|
-
}
|
|
255490
|
-
};
|
|
255491
|
-
if (numPerFace > 1) {
|
|
255492
|
-
for (let i0 = 0; i0 + numPerFace <= numIndex; i0 += numPerFace) {
|
|
255493
|
-
addIndicesInBlock(i0, i0 + numPerFace);
|
|
255494
|
-
polyface.terminateFacet(true);
|
|
255495
|
-
}
|
|
255665
|
+
polyface.addColor(c);
|
|
255666
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(colorIndexI32, numPerFace, (i) => { polyface.addColorIndex(i); });
|
|
255496
255667
|
}
|
|
255497
|
-
|
|
255498
|
-
|
|
255499
|
-
|
|
255500
|
-
|
|
255501
|
-
|
|
255502
|
-
|
|
255503
|
-
i0 = i1 + 1;
|
|
255504
|
-
}
|
|
255505
|
-
}
|
|
255506
|
-
}
|
|
255507
|
-
polyface.data.auxData = this.readPolyfaceAuxData(polyfaceHeader.auxData());
|
|
255668
|
+
for (let i = 0; i + 2 < pointF64.length; i += 3)
|
|
255669
|
+
polyface.addPointXYZ(pointF64[i], pointF64[i + 1], pointF64[i + 2]);
|
|
255670
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(pointIndexI32, numPerFace, (i, v) => { polyface.addPointIndex(i, v); }, () => { polyface.terminateFacet(false); });
|
|
255671
|
+
if (!polyface.validateAllIndices())
|
|
255672
|
+
return undefined;
|
|
255673
|
+
polyface.data.auxData = this.readPolyfaceAuxData(polyfaceHeader, polyfaceHeader.auxData());
|
|
255508
255674
|
if (taggedNumericDataOffset) {
|
|
255509
255675
|
const taggedNumericDataAccessor = nullToUndefined(taggedNumericDataOffset);
|
|
255510
255676
|
if (taggedNumericDataAccessor !== undefined) {
|
|
@@ -255544,8 +255710,8 @@ class BGFBReader {
|
|
|
255544
255710
|
*/
|
|
255545
255711
|
readCurveCollectionFromVariantGeometry(variant) {
|
|
255546
255712
|
const geometryType = variant.geometryType();
|
|
255547
|
-
if (geometryType ===
|
|
255548
|
-
const cvTable = variant.geometry(new
|
|
255713
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagCurveVector) {
|
|
255714
|
+
const cvTable = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.CurveVector());
|
|
255549
255715
|
return this.readCurveCollectionFromCurveVectorTable(cvTable);
|
|
255550
255716
|
}
|
|
255551
255717
|
return undefined;
|
|
@@ -255556,66 +255722,66 @@ class BGFBReader {
|
|
|
255556
255722
|
*/
|
|
255557
255723
|
readSolidPrimitiveFromVariant(variant) {
|
|
255558
255724
|
const geometryType = variant.geometryType();
|
|
255559
|
-
if (geometryType ===
|
|
255560
|
-
const header = variant.geometry(new
|
|
255725
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnBox) {
|
|
255726
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnBox());
|
|
255561
255727
|
const detail = header.detail();
|
|
255562
|
-
return
|
|
255728
|
+
return _solid_Box__WEBPACK_IMPORTED_MODULE_25__.Box.createDgnBox(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(detail.baseOriginX(), detail.baseOriginY(), detail.baseOriginZ()), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vectorXX(), detail.vectorXY(), detail.vectorXZ()), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vectorYX(), detail.vectorYY(), detail.vectorYZ()), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(detail.topOriginX(), detail.topOriginY(), detail.topOriginZ()), detail.baseX(), detail.baseY(), detail.topX(), detail.topY(), detail.capped());
|
|
255563
255729
|
}
|
|
255564
|
-
if (geometryType ===
|
|
255565
|
-
const header = variant.geometry(new
|
|
255730
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnSphere) {
|
|
255731
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnSphere());
|
|
255566
255732
|
const detail = header.detail();
|
|
255567
255733
|
const lToWDetail = detail.localToWorld();
|
|
255568
|
-
const localToWorld =
|
|
255569
|
-
return
|
|
255734
|
+
const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_11__.Transform.createRowValues(lToWDetail.axx(), lToWDetail.axy(), lToWDetail.axz(), lToWDetail.axw(), lToWDetail.ayx(), lToWDetail.ayy(), lToWDetail.ayz(), lToWDetail.ayw(), lToWDetail.azx(), lToWDetail.azy(), lToWDetail.azz(), lToWDetail.azw());
|
|
255735
|
+
return _solid_Sphere__WEBPACK_IMPORTED_MODULE_26__.Sphere.createEllipsoid(localToWorld, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_14__.AngleSweep.createStartSweepRadians(detail.startLatitudeRadians(), detail.latitudeSweepRadians()), detail.capped());
|
|
255570
255736
|
}
|
|
255571
|
-
if (geometryType ===
|
|
255572
|
-
const header = variant.geometry(new
|
|
255737
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnCone) {
|
|
255738
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnCone());
|
|
255573
255739
|
const detail = header.detail();
|
|
255574
|
-
const centerA =
|
|
255575
|
-
const centerB =
|
|
255576
|
-
const vector0 =
|
|
255577
|
-
const vector90 =
|
|
255740
|
+
const centerA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(detail.centerAX(), detail.centerAY(), detail.centerAZ());
|
|
255741
|
+
const centerB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(detail.centerBX(), detail.centerBY(), detail.centerBZ());
|
|
255742
|
+
const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vector0X(), detail.vector0Y(), detail.vector0Z());
|
|
255743
|
+
const vector90 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vector90X(), detail.vector90Y(), detail.vector90Z());
|
|
255578
255744
|
const radiusA = detail.radiusA();
|
|
255579
255745
|
const radiusB = detail.radiusB();
|
|
255580
|
-
return
|
|
255746
|
+
return _solid_Cone__WEBPACK_IMPORTED_MODULE_27__.Cone.createBaseAndTarget(centerA, centerB, vector0, vector90, radiusA, radiusB, detail.capped());
|
|
255581
255747
|
}
|
|
255582
|
-
if (geometryType ===
|
|
255583
|
-
const header = variant.geometry(new
|
|
255748
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnTorusPipe) {
|
|
255749
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnTorusPipe());
|
|
255584
255750
|
const detail = header.detail();
|
|
255585
|
-
const center =
|
|
255586
|
-
const vectorX =
|
|
255587
|
-
const vectorY =
|
|
255751
|
+
const center = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(detail.centerX(), detail.centerY(), detail.centerZ());
|
|
255752
|
+
const vectorX = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vectorXX(), detail.vectorXY(), detail.vectorXZ());
|
|
255753
|
+
const vectorY = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vectorYX(), detail.vectorYY(), detail.vectorYZ());
|
|
255588
255754
|
const sweepRadians = detail.sweepRadians();
|
|
255589
255755
|
const majorRadius = detail.majorRadius();
|
|
255590
255756
|
const minorRadius = detail.minorRadius();
|
|
255591
|
-
return
|
|
255757
|
+
return _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_28__.TorusPipe.createDgnTorusPipe(center, vectorX, vectorY, majorRadius, minorRadius, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_17__.Angle.createRadians(sweepRadians), detail.capped());
|
|
255592
255758
|
}
|
|
255593
|
-
if (geometryType ===
|
|
255594
|
-
const header = variant.geometry(new
|
|
255595
|
-
const dVector = new
|
|
255759
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnExtrusion) {
|
|
255760
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnExtrusion());
|
|
255761
|
+
const dVector = new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DVector3d();
|
|
255596
255762
|
header.extrusionVector(dVector);
|
|
255597
|
-
const extrusionVector =
|
|
255763
|
+
const extrusionVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(dVector.x(), dVector.y(), dVector.z());
|
|
255598
255764
|
const baseCurve = header.baseCurve();
|
|
255599
255765
|
if (baseCurve !== null) {
|
|
255600
255766
|
const contour = this.readCurveCollectionFromCurveVectorTable(baseCurve);
|
|
255601
|
-
return
|
|
255767
|
+
return _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_29__.LinearSweep.create(contour, extrusionVector, header.capped());
|
|
255602
255768
|
}
|
|
255603
255769
|
}
|
|
255604
|
-
if (geometryType ===
|
|
255605
|
-
const header = variant.geometry(new
|
|
255606
|
-
const dAxis = new
|
|
255770
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnRotationalSweep) {
|
|
255771
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnRotationalSweep());
|
|
255772
|
+
const dAxis = new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DRay3d();
|
|
255607
255773
|
header.axis(dAxis);
|
|
255608
|
-
const axis =
|
|
255609
|
-
const sweepAngle =
|
|
255774
|
+
const axis = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_30__.Ray3d.createXYZUVW(dAxis.x(), dAxis.y(), dAxis.z(), dAxis.ux(), dAxis.uy(), dAxis.uz());
|
|
255775
|
+
const sweepAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_17__.Angle.createRadians(header.sweepRadians());
|
|
255610
255776
|
// const numVRules = header.numVRules();
|
|
255611
255777
|
const baseCurve = header.baseCurve();
|
|
255612
255778
|
if (baseCurve !== null) {
|
|
255613
255779
|
const contour = this.readCurveCollectionFromCurveVectorTable(baseCurve);
|
|
255614
|
-
return
|
|
255780
|
+
return _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_31__.RotationalSweep.create(contour, axis, sweepAngle, header.capped());
|
|
255615
255781
|
}
|
|
255616
255782
|
}
|
|
255617
|
-
if (geometryType ===
|
|
255618
|
-
const header = variant.geometry(new
|
|
255783
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnRuledSweep) {
|
|
255784
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnRuledSweep());
|
|
255619
255785
|
const numCurves = header.curvesLength();
|
|
255620
255786
|
const contours = [];
|
|
255621
255787
|
for (let i = 0; i < numCurves; i++) {
|
|
@@ -255627,7 +255793,7 @@ class BGFBReader {
|
|
|
255627
255793
|
}
|
|
255628
255794
|
}
|
|
255629
255795
|
if (contours.length > 0) {
|
|
255630
|
-
return
|
|
255796
|
+
return _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_32__.RuledSweep.create(contours, header.capped());
|
|
255631
255797
|
}
|
|
255632
255798
|
}
|
|
255633
255799
|
return undefined;
|
|
@@ -255639,43 +255805,43 @@ class BGFBReader {
|
|
|
255639
255805
|
readGeometryQueryFromVariant(variant) {
|
|
255640
255806
|
const rootType = variant.geometryType();
|
|
255641
255807
|
switch (rootType) {
|
|
255642
|
-
case
|
|
255643
|
-
case
|
|
255644
|
-
case
|
|
255645
|
-
case
|
|
255646
|
-
case
|
|
255647
|
-
case
|
|
255648
|
-
case
|
|
255808
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagLineSegment:
|
|
255809
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagLineString:
|
|
255810
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagEllipticArc:
|
|
255811
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagBsplineCurve:
|
|
255812
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagTransitionSpiral:
|
|
255813
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagInterpolationCurve:
|
|
255814
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagAkimaCurve:
|
|
255649
255815
|
{
|
|
255650
255816
|
return this.readCurvePrimitiveFromVariant(variant);
|
|
255651
255817
|
}
|
|
255652
|
-
case
|
|
255818
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagCurveVector:
|
|
255653
255819
|
{
|
|
255654
255820
|
return this.readCurveCollectionFromVariantGeometry(variant);
|
|
255655
255821
|
}
|
|
255656
|
-
case
|
|
255822
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagPolyface:
|
|
255657
255823
|
{
|
|
255658
255824
|
return this.readPolyfaceFromVariant(variant);
|
|
255659
255825
|
}
|
|
255660
|
-
case
|
|
255661
|
-
case
|
|
255662
|
-
case
|
|
255663
|
-
case
|
|
255664
|
-
case
|
|
255665
|
-
case
|
|
255666
|
-
case
|
|
255826
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnBox:
|
|
255827
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnCone:
|
|
255828
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnTorusPipe:
|
|
255829
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnSphere:
|
|
255830
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnExtrusion:
|
|
255831
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnRotationalSweep:
|
|
255832
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnRuledSweep:
|
|
255667
255833
|
{
|
|
255668
255834
|
return this.readSolidPrimitiveFromVariant(variant);
|
|
255669
255835
|
}
|
|
255670
|
-
case
|
|
255836
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagVectorOfVariantGeometry:
|
|
255671
255837
|
{
|
|
255672
255838
|
const geometry = [];
|
|
255673
|
-
const offsetToVectorOfVariantGeometry = variant.geometry(new
|
|
255839
|
+
const offsetToVectorOfVariantGeometry = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VectorOfVariantGeometry());
|
|
255674
255840
|
for (let i = 0; i < offsetToVectorOfVariantGeometry.membersLength(); i++) {
|
|
255675
255841
|
const child = offsetToVectorOfVariantGeometry.members(i);
|
|
255676
255842
|
if (child !== null) {
|
|
255677
255843
|
const childGeometry = this.readGeometryQueryFromVariant(child);
|
|
255678
|
-
if (childGeometry instanceof
|
|
255844
|
+
if (childGeometry instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_33__.GeometryQuery) {
|
|
255679
255845
|
geometry.push(childGeometry);
|
|
255680
255846
|
}
|
|
255681
255847
|
else if (Array.isArray(childGeometry)) {
|
|
@@ -255685,10 +255851,10 @@ class BGFBReader {
|
|
|
255685
255851
|
}
|
|
255686
255852
|
return geometry;
|
|
255687
255853
|
}
|
|
255688
|
-
case
|
|
255854
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagBsplineSurface: {
|
|
255689
255855
|
return this.readBSplineSurfaceFromVariant(variant);
|
|
255690
255856
|
}
|
|
255691
|
-
case
|
|
255857
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagPointString:
|
|
255692
255858
|
{
|
|
255693
255859
|
return this.readPointStringFromVariant(variant);
|
|
255694
255860
|
}
|
|
@@ -255709,7 +255875,7 @@ class BGFBReader {
|
|
|
255709
255875
|
return undefined;
|
|
255710
255876
|
newByteBuffer.setPosition(signature.length);
|
|
255711
255877
|
}
|
|
255712
|
-
const root =
|
|
255878
|
+
const root = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometry.getRootAsVariantGeometry(newByteBuffer);
|
|
255713
255879
|
const reader = new BGFBReader();
|
|
255714
255880
|
return reader.readGeometryQueryFromVariant(root);
|
|
255715
255881
|
}
|
|
@@ -255725,14 +255891,14 @@ function nullToUndefined(data) {
|
|
|
255725
255891
|
}
|
|
255726
255892
|
function createTypedCurveCollection(collectionType) {
|
|
255727
255893
|
if (collectionType === 1)
|
|
255728
|
-
return new
|
|
255894
|
+
return new _curve_Path__WEBPACK_IMPORTED_MODULE_34__.Path();
|
|
255729
255895
|
if (collectionType === 2 || collectionType === 3)
|
|
255730
|
-
return new
|
|
255896
|
+
return new _curve_Loop__WEBPACK_IMPORTED_MODULE_35__.Loop();
|
|
255731
255897
|
if (collectionType === 4)
|
|
255732
|
-
return new
|
|
255898
|
+
return new _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_36__.ParityRegion();
|
|
255733
255899
|
if (collectionType === 5)
|
|
255734
|
-
return new
|
|
255735
|
-
return new
|
|
255900
|
+
return new _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_37__.UnionRegion();
|
|
255901
|
+
return new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_38__.BagOfCurves();
|
|
255736
255902
|
}
|
|
255737
255903
|
/**
|
|
255738
255904
|
* mappings between typescript spiral type strings and native integers.
|
|
@@ -255750,7 +255916,7 @@ class DgnSpiralTypeQueries {
|
|
|
255750
255916
|
/** Convert typescript string to native integer type */
|
|
255751
255917
|
static stringToTypeCode(s, defaultToClothoid = true) {
|
|
255752
255918
|
for (const entry of DgnSpiralTypeQueries.spiralTypeCodeMap) {
|
|
255753
|
-
if (
|
|
255919
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_39__.Geometry.equalStringNoCase(s, entry[1]))
|
|
255754
255920
|
return entry[0];
|
|
255755
255921
|
}
|
|
255756
255922
|
return defaultToClothoid ? 10 : undefined;
|
|
@@ -256254,14 +256420,15 @@ class BGFBWriter {
|
|
|
256254
256420
|
}
|
|
256255
256421
|
return undefined;
|
|
256256
256422
|
}
|
|
256257
|
-
writePolyfaceAuxDataAsFBVariantGeometry(data) {
|
|
256423
|
+
writePolyfaceAuxDataAsFBVariantGeometry(mesh, data) {
|
|
256258
256424
|
if (data instanceof _polyface_AuxData__WEBPACK_IMPORTED_MODULE_31__.PolyfaceAuxData) {
|
|
256259
256425
|
const channelOffsets = [];
|
|
256260
|
-
for (const channel of data.channels)
|
|
256426
|
+
for (const channel of data.channels)
|
|
256261
256427
|
channelOffsets.push(this.writePolyfaceAuxChannelAsFBVariantGeometry(channel));
|
|
256262
|
-
}
|
|
256263
256428
|
const channelOffsetsOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.PolyfaceAuxChannel.createDataVector(this.builder, channelOffsets);
|
|
256264
|
-
const
|
|
256429
|
+
const indexArray = [];
|
|
256430
|
+
this.fillOneBasedIndexArray(mesh, data.indices, undefined, 0, indexArray);
|
|
256431
|
+
const indicesOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.PolyfaceAuxData.createIndicesVector(this.builder, indexArray);
|
|
256265
256432
|
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.PolyfaceAuxData.createPolyfaceAuxData(this.builder, indicesOffset, channelOffsetsOffset);
|
|
256266
256433
|
}
|
|
256267
256434
|
return undefined;
|
|
@@ -256289,8 +256456,8 @@ class BGFBWriter {
|
|
|
256289
256456
|
let paramOffset = 0;
|
|
256290
256457
|
let auxDataOffset = 0;
|
|
256291
256458
|
let taggedNumericDataOffset = 0;
|
|
256292
|
-
const meshStyle = 1; // That is . . . MESH_ELM_STYLE_INDEXED_FACE_LOOPS
|
|
256293
|
-
const numPerFace = 0;
|
|
256459
|
+
const meshStyle = 1; // That is . . . MESH_ELM_STYLE_INDEXED_FACE_LOOPS
|
|
256460
|
+
const numPerFace = 0; // specifically, variable size with 0 terminators
|
|
256294
256461
|
this.fillOneBasedIndexArray(mesh, mesh.data.pointIndex, mesh.data.edgeVisible, 0, indexArray);
|
|
256295
256462
|
const twoSided = mesh.twoSided;
|
|
256296
256463
|
const pointIndexOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.Polyface.createPointIndexVector(this.builder, indexArray);
|
|
@@ -256309,12 +256476,6 @@ class BGFBWriter {
|
|
|
256309
256476
|
if (mesh.data.color !== undefined && mesh.data.color.length > 0) {
|
|
256310
256477
|
intColorOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.Polyface.createIntColorVector(this.builder, mesh.data.color);
|
|
256311
256478
|
}
|
|
256312
|
-
/*
|
|
256313
|
-
if (mesh.data.face !== undefined && mesh.data.face.length > 0) {
|
|
256314
|
-
this.writeOneBasedIndexArray(mesh, mesh.data.face, undefined, 0, indexArray);
|
|
256315
|
-
BGFBAccessors.Polyface.createFaceDataVector(this.builder, indexArray);
|
|
256316
|
-
}
|
|
256317
|
-
*/
|
|
256318
256479
|
if (mesh.data.normal) {
|
|
256319
256480
|
copyToPackedNumberArray(numberArray, mesh.data.normal.float64Data(), mesh.data.normal.float64Length);
|
|
256320
256481
|
normalOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.Polyface.createNormalVector(this.builder, numberArray);
|
|
@@ -256323,12 +256484,12 @@ class BGFBWriter {
|
|
|
256323
256484
|
copyToPackedNumberArray(numberArray, mesh.data.param.float64Data(), mesh.data.param.float64Length);
|
|
256324
256485
|
paramOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.Polyface.createPointVector(this.builder, numberArray);
|
|
256325
256486
|
}
|
|
256326
|
-
if (mesh.data.auxData)
|
|
256327
|
-
auxDataOffset = this.writePolyfaceAuxDataAsFBVariantGeometry(mesh.data.auxData);
|
|
256328
|
-
}
|
|
256487
|
+
if (mesh.data.auxData)
|
|
256488
|
+
auxDataOffset = this.writePolyfaceAuxDataAsFBVariantGeometry(mesh, mesh.data.auxData);
|
|
256329
256489
|
if (mesh.data.taggedNumericData)
|
|
256330
256490
|
taggedNumericDataOffset = this.writeTaggedNumericDataArray(mesh.data.taggedNumericData);
|
|
256331
256491
|
const expectedClosure = mesh.expectedClosure;
|
|
256492
|
+
// NOTE: mesh.data.face is not persistent
|
|
256332
256493
|
const polyfaceOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.Polyface.createPolyface(this.builder, pointOffset, paramOffset, normalOffset, 0, intColorOffset, pointIndexOffset, paramIndexOffset, normalIndexOffset, colorIndexOffset, 0, 0, 0, meshStyle, twoSided, numPerFace, 0, auxDataOffset, expectedClosure, taggedNumericDataOffset);
|
|
256333
256494
|
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.VariantGeometryUnion.tagPolyface, polyfaceOffset, 0);
|
|
256334
256495
|
}
|
|
@@ -259193,48 +259354,49 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
259193
259354
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
259194
259355
|
/* harmony export */ "IModelJson": () => (/* binding */ IModelJson)
|
|
259195
259356
|
/* harmony export */ });
|
|
259196
|
-
/* harmony import */ var
|
|
259197
|
-
/* harmony import */ var
|
|
259198
|
-
/* harmony import */ var
|
|
259199
|
-
/* harmony import */ var
|
|
259200
|
-
/* harmony import */ var
|
|
259201
|
-
/* harmony import */ var
|
|
259202
|
-
/* harmony import */ var
|
|
259203
|
-
/* harmony import */ var
|
|
259204
|
-
/* harmony import */ var
|
|
259205
|
-
/* harmony import */ var
|
|
259206
|
-
/* harmony import */ var
|
|
259207
|
-
/* harmony import */ var
|
|
259208
|
-
/* harmony import */ var
|
|
259209
|
-
/* harmony import */ var
|
|
259210
|
-
/* harmony import */ var
|
|
259211
|
-
/* harmony import */ var
|
|
259212
|
-
/* harmony import */ var
|
|
259213
|
-
/* harmony import */ var
|
|
259214
|
-
/* harmony import */ var
|
|
259215
|
-
/* harmony import */ var
|
|
259216
|
-
/* harmony import */ var
|
|
259217
|
-
/* harmony import */ var
|
|
259218
|
-
/* harmony import */ var
|
|
259219
|
-
/* harmony import */ var
|
|
259220
|
-
/* harmony import */ var
|
|
259221
|
-
/* harmony import */ var
|
|
259222
|
-
/* harmony import */ var
|
|
259223
|
-
/* harmony import */ var
|
|
259224
|
-
/* harmony import */ var
|
|
259225
|
-
/* harmony import */ var
|
|
259226
|
-
/* harmony import */ var
|
|
259227
|
-
/* harmony import */ var
|
|
259228
|
-
/* harmony import */ var
|
|
259229
|
-
/* harmony import */ var
|
|
259230
|
-
/* harmony import */ var
|
|
259231
|
-
/* harmony import */ var
|
|
259232
|
-
/* harmony import */ var
|
|
259233
|
-
/* harmony import */ var
|
|
259234
|
-
/* harmony import */ var
|
|
259235
|
-
/* harmony import */ var
|
|
259236
|
-
/* harmony import */ var
|
|
259237
|
-
/* harmony import */ var
|
|
259357
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
259358
|
+
/* harmony import */ var _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../bspline/AkimaCurve3d */ "../../core/geometry/lib/esm/bspline/AkimaCurve3d.js");
|
|
259359
|
+
/* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
|
|
259360
|
+
/* harmony import */ var _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../bspline/BSplineCurve3dH */ "../../core/geometry/lib/esm/bspline/BSplineCurve3dH.js");
|
|
259361
|
+
/* harmony import */ var _bspline_BSplineCurveOps__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../bspline/BSplineCurveOps */ "../../core/geometry/lib/esm/bspline/BSplineCurveOps.js");
|
|
259362
|
+
/* harmony import */ var _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../bspline/BSplineSurface */ "../../core/geometry/lib/esm/bspline/BSplineSurface.js");
|
|
259363
|
+
/* harmony import */ var _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../bspline/InterpolationCurve3d */ "../../core/geometry/lib/esm/bspline/InterpolationCurve3d.js");
|
|
259364
|
+
/* harmony import */ var _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../bspline/KnotVector */ "../../core/geometry/lib/esm/bspline/KnotVector.js");
|
|
259365
|
+
/* harmony import */ var _curve_Arc3d__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../curve/Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
259366
|
+
/* harmony import */ var _curve_CoordinateXYZ__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../curve/CoordinateXYZ */ "../../core/geometry/lib/esm/curve/CoordinateXYZ.js");
|
|
259367
|
+
/* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
259368
|
+
/* harmony import */ var _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../curve/GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
259369
|
+
/* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
259370
|
+
/* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
259371
|
+
/* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
259372
|
+
/* harmony import */ var _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../curve/ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
|
|
259373
|
+
/* harmony import */ var _curve_Path__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../curve/Path */ "../../core/geometry/lib/esm/curve/Path.js");
|
|
259374
|
+
/* harmony import */ var _curve_PointString3d__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../curve/PointString3d */ "../../core/geometry/lib/esm/curve/PointString3d.js");
|
|
259375
|
+
/* harmony import */ var _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../curve/spiral/DirectSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/DirectSpiral3d.js");
|
|
259376
|
+
/* harmony import */ var _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../curve/spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
|
|
259377
|
+
/* harmony import */ var _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../curve/UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
|
|
259378
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
259379
|
+
/* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
259380
|
+
/* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
|
|
259381
|
+
/* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
|
|
259382
|
+
/* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
|
|
259383
|
+
/* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
|
|
259384
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
259385
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
259386
|
+
/* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
|
|
259387
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
259388
|
+
/* harmony import */ var _geometry3d_YawPitchRollAngles__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/YawPitchRollAngles */ "../../core/geometry/lib/esm/geometry3d/YawPitchRollAngles.js");
|
|
259389
|
+
/* harmony import */ var _polyface_AuxData__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../polyface/AuxData */ "../../core/geometry/lib/esm/polyface/AuxData.js");
|
|
259390
|
+
/* harmony import */ var _polyface_Polyface__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../polyface/Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
259391
|
+
/* harmony import */ var _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../polyface/TaggedNumericData */ "../../core/geometry/lib/esm/polyface/TaggedNumericData.js");
|
|
259392
|
+
/* harmony import */ var _solid_Box__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../solid/Box */ "../../core/geometry/lib/esm/solid/Box.js");
|
|
259393
|
+
/* harmony import */ var _solid_Cone__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../solid/Cone */ "../../core/geometry/lib/esm/solid/Cone.js");
|
|
259394
|
+
/* harmony import */ var _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../solid/LinearSweep */ "../../core/geometry/lib/esm/solid/LinearSweep.js");
|
|
259395
|
+
/* harmony import */ var _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../solid/RotationalSweep */ "../../core/geometry/lib/esm/solid/RotationalSweep.js");
|
|
259396
|
+
/* harmony import */ var _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../solid/RuledSweep */ "../../core/geometry/lib/esm/solid/RuledSweep.js");
|
|
259397
|
+
/* harmony import */ var _solid_Sphere__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../solid/Sphere */ "../../core/geometry/lib/esm/solid/Sphere.js");
|
|
259398
|
+
/* harmony import */ var _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../solid/TorusPipe */ "../../core/geometry/lib/esm/solid/TorusPipe.js");
|
|
259399
|
+
/* harmony import */ var _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./SerializationHelpers */ "../../core/geometry/lib/esm/serialization/SerializationHelpers.js");
|
|
259238
259400
|
/*---------------------------------------------------------------------------------------------
|
|
259239
259401
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
259240
259402
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -259282,6 +259444,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
259282
259444
|
|
|
259283
259445
|
|
|
259284
259446
|
|
|
259447
|
+
|
|
259285
259448
|
|
|
259286
259449
|
|
|
259287
259450
|
// cspell:word bagof
|
|
@@ -259302,32 +259465,32 @@ var IModelJson;
|
|
|
259302
259465
|
static parseVector3dProperty(json, propertyName, defaultValue) {
|
|
259303
259466
|
if (json.hasOwnProperty(propertyName)) {
|
|
259304
259467
|
const value = json[propertyName];
|
|
259305
|
-
if (
|
|
259306
|
-
return
|
|
259307
|
-
if (
|
|
259308
|
-
return
|
|
259309
|
-
if (
|
|
259310
|
-
return
|
|
259468
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(value, 3))
|
|
259469
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(value[0], value[1], value[2]);
|
|
259470
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(value, 2))
|
|
259471
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(value[0], value[1]);
|
|
259472
|
+
if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.XYZ.isXAndY(value))
|
|
259473
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(value);
|
|
259311
259474
|
}
|
|
259312
259475
|
return defaultValue;
|
|
259313
259476
|
}
|
|
259314
259477
|
static parsePoint3dProperty(json, propertyName, defaultValue) {
|
|
259315
259478
|
if (json.hasOwnProperty(propertyName)) {
|
|
259316
259479
|
const value = json[propertyName];
|
|
259317
|
-
if (
|
|
259318
|
-
return
|
|
259319
|
-
if (
|
|
259320
|
-
return
|
|
259321
|
-
if (
|
|
259322
|
-
return
|
|
259480
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(value, 3))
|
|
259481
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(value[0], value[1], value[2]);
|
|
259482
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(value, 2))
|
|
259483
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(value[0], value[1]);
|
|
259484
|
+
if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.XYZ.isXAndY(value))
|
|
259485
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(value);
|
|
259323
259486
|
}
|
|
259324
259487
|
return defaultValue;
|
|
259325
259488
|
}
|
|
259326
259489
|
static parseSegment1dProperty(json, propertyName, defaultValue) {
|
|
259327
259490
|
if (json.hasOwnProperty(propertyName)) {
|
|
259328
259491
|
const value = json[propertyName];
|
|
259329
|
-
if (
|
|
259330
|
-
return
|
|
259492
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(value, 2))
|
|
259493
|
+
return _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_3__.Segment1d.create(value[0], value[1]);
|
|
259331
259494
|
}
|
|
259332
259495
|
return defaultValue;
|
|
259333
259496
|
}
|
|
@@ -259346,7 +259509,7 @@ var IModelJson;
|
|
|
259346
259509
|
const tagA = this.parseNumberProperty(json, "tagA");
|
|
259347
259510
|
const tagB = this.parseNumberProperty(json, "tagB", 0);
|
|
259348
259511
|
if (tagA !== undefined) {
|
|
259349
|
-
const result = new
|
|
259512
|
+
const result = new _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_4__.TaggedNumericData(tagA, tagB);
|
|
259350
259513
|
if (json.hasOwnProperty("intData"))
|
|
259351
259514
|
result.intData = this.parseNumberArrayProperty(json, "intData", 0, undefined);
|
|
259352
259515
|
if (json.hasOwnProperty("doubleData"))
|
|
@@ -259372,7 +259535,7 @@ var IModelJson;
|
|
|
259372
259535
|
static parseAngleProperty(json, propertyName, defaultValue) {
|
|
259373
259536
|
if (json.hasOwnProperty(propertyName)) {
|
|
259374
259537
|
const value = json[propertyName];
|
|
259375
|
-
return
|
|
259538
|
+
return _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_5__.Angle.fromJSON(value);
|
|
259376
259539
|
}
|
|
259377
259540
|
return defaultValue;
|
|
259378
259541
|
}
|
|
@@ -259382,7 +259545,7 @@ var IModelJson;
|
|
|
259382
259545
|
static parseAngleSweepProps(json, propertyName, defaultFunction) {
|
|
259383
259546
|
if (json.hasOwnProperty(propertyName)) {
|
|
259384
259547
|
const value = json[propertyName];
|
|
259385
|
-
return
|
|
259548
|
+
return _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_6__.AngleSweep.fromJSON(value);
|
|
259386
259549
|
}
|
|
259387
259550
|
if (defaultFunction === undefined)
|
|
259388
259551
|
return undefined;
|
|
@@ -259405,7 +259568,7 @@ var IModelJson;
|
|
|
259405
259568
|
const result = [];
|
|
259406
259569
|
for (const contourData of value) {
|
|
259407
259570
|
const contour = Reader.parse(contourData);
|
|
259408
|
-
if (contour instanceof
|
|
259571
|
+
if (contour instanceof _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_7__.CurveCollection) {
|
|
259409
259572
|
result.push(contour);
|
|
259410
259573
|
}
|
|
259411
259574
|
}
|
|
@@ -259416,7 +259579,7 @@ var IModelJson;
|
|
|
259416
259579
|
return undefined;
|
|
259417
259580
|
}
|
|
259418
259581
|
static parseYawPitchRollAnglesToMatrix3d(json) {
|
|
259419
|
-
const ypr =
|
|
259582
|
+
const ypr = _geometry3d_YawPitchRollAngles__WEBPACK_IMPORTED_MODULE_8__.YawPitchRollAngles.fromJSON(json);
|
|
259420
259583
|
return ypr.toMatrix3d();
|
|
259421
259584
|
}
|
|
259422
259585
|
static parseStringProperty(json, propertyName, defaultValue) {
|
|
@@ -259429,14 +259592,14 @@ var IModelJson;
|
|
|
259429
259592
|
}
|
|
259430
259593
|
static parseAxesFromVectors(json, axisOrder, createDefaultIdentity) {
|
|
259431
259594
|
if (Array.isArray(json) && json.length === 2) {
|
|
259432
|
-
const xVector =
|
|
259433
|
-
const yVector =
|
|
259434
|
-
const matrix =
|
|
259595
|
+
const xVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[0]);
|
|
259596
|
+
const yVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[1]);
|
|
259597
|
+
const matrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createRigidFromColumns(xVector, yVector, axisOrder);
|
|
259435
259598
|
if (matrix)
|
|
259436
259599
|
return matrix;
|
|
259437
259600
|
}
|
|
259438
259601
|
if (createDefaultIdentity)
|
|
259439
|
-
return
|
|
259602
|
+
return _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createIdentity();
|
|
259440
259603
|
return undefined;
|
|
259441
259604
|
}
|
|
259442
259605
|
/**
|
|
@@ -259453,13 +259616,13 @@ var IModelJson;
|
|
|
259453
259616
|
return Reader.parseYawPitchRollAnglesToMatrix3d(json.yawPitchRollAngles);
|
|
259454
259617
|
}
|
|
259455
259618
|
else if (json.xyVectors) {
|
|
259456
|
-
return Reader.parseAxesFromVectors(json.xyVectors,
|
|
259619
|
+
return Reader.parseAxesFromVectors(json.xyVectors, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.XYZ, createDefaultIdentity);
|
|
259457
259620
|
}
|
|
259458
259621
|
else if (json.zxVectors) {
|
|
259459
|
-
return Reader.parseAxesFromVectors(json.zxVectors,
|
|
259622
|
+
return Reader.parseAxesFromVectors(json.zxVectors, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.ZXY, createDefaultIdentity);
|
|
259460
259623
|
}
|
|
259461
259624
|
if (createDefaultIdentity)
|
|
259462
|
-
return
|
|
259625
|
+
return _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createIdentity();
|
|
259463
259626
|
return undefined;
|
|
259464
259627
|
}
|
|
259465
259628
|
static parseArcByVectorProps(data) {
|
|
@@ -259468,17 +259631,17 @@ var IModelJson;
|
|
|
259468
259631
|
&& data.vectorX !== undefined
|
|
259469
259632
|
&& data.vectorY !== undefined
|
|
259470
259633
|
&& data.sweepStartEnd !== undefined) {
|
|
259471
|
-
return
|
|
259634
|
+
return _curve_Arc3d__WEBPACK_IMPORTED_MODULE_10__.Arc3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(data.center), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(data.vectorX), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(data.vectorY), _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_6__.AngleSweep.fromJSON(data.sweepStartEnd));
|
|
259472
259635
|
}
|
|
259473
259636
|
return undefined;
|
|
259474
259637
|
}
|
|
259475
259638
|
// remark: Returns LineString3d as last default when give points are colinear.
|
|
259476
259639
|
static parseArcBy3Points(data) {
|
|
259477
259640
|
if (Array.isArray(data) && data.length > 2) {
|
|
259478
|
-
const pointA =
|
|
259479
|
-
const pointB =
|
|
259480
|
-
const pointC =
|
|
259481
|
-
return
|
|
259641
|
+
const pointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(data[0]);
|
|
259642
|
+
const pointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(data[1]);
|
|
259643
|
+
const pointC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(data[2]);
|
|
259644
|
+
return _curve_Arc3d__WEBPACK_IMPORTED_MODULE_10__.Arc3d.createCircularStartMiddleEnd(pointA, pointB, pointC);
|
|
259482
259645
|
}
|
|
259483
259646
|
return undefined;
|
|
259484
259647
|
}
|
|
@@ -259491,9 +259654,9 @@ var IModelJson;
|
|
|
259491
259654
|
}
|
|
259492
259655
|
/** Parse point content (right side) `[1,2,3]` to a CoordinateXYZ object. */
|
|
259493
259656
|
static parseCoordinate(data) {
|
|
259494
|
-
const point =
|
|
259657
|
+
const point = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(data);
|
|
259495
259658
|
if (point)
|
|
259496
|
-
return
|
|
259659
|
+
return _curve_CoordinateXYZ__WEBPACK_IMPORTED_MODULE_11__.CoordinateXYZ.create(point);
|
|
259497
259660
|
return undefined;
|
|
259498
259661
|
}
|
|
259499
259662
|
/** Parse TransitionSpiral content (right side) to TransitionSpiral3d. */
|
|
@@ -259517,10 +259680,10 @@ var IModelJson;
|
|
|
259517
259680
|
// REMARK: Our job is to parse and pass data along -- inscrutable validation happens in the implementation classes . . .
|
|
259518
259681
|
if (origin) {
|
|
259519
259682
|
let candidate;
|
|
259520
|
-
candidate =
|
|
259683
|
+
candidate = _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_12__.IntegratedSpiral3d.createFrom4OutOf5(spiralType, startRadius, endRadius, startBearing, endBearing, length, interval, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_13__.Transform.createOriginAndMatrix(origin, axes));
|
|
259521
259684
|
if (candidate)
|
|
259522
259685
|
return candidate;
|
|
259523
|
-
candidate =
|
|
259686
|
+
candidate = _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_14__.DirectSpiral3d.createFromLengthAndRadius(spiralType, startRadius, endRadius, startBearing, endBearing, length, interval, _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_13__.Transform.createOriginAndMatrix(origin, axes));
|
|
259524
259687
|
if (candidate)
|
|
259525
259688
|
return candidate;
|
|
259526
259689
|
}
|
|
@@ -259535,14 +259698,14 @@ var IModelJson;
|
|
|
259535
259698
|
&& data.hasOwnProperty("order") && Number.isFinite(data.order)
|
|
259536
259699
|
&& data.hasOwnProperty("points") && Array.isArray(data.points) && Array.isArray(data.points[0])
|
|
259537
259700
|
&& (dim = data.points[0].length) >= 3 && dim <= 4) {
|
|
259538
|
-
const myData =
|
|
259701
|
+
const myData = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.createBSplineCurveData(data.points, dim, data.knots, data.points.length, data.order);
|
|
259539
259702
|
if (data.hasOwnProperty("closed") && true === data.closed)
|
|
259540
259703
|
myData.params.closed = true;
|
|
259541
|
-
if (
|
|
259704
|
+
if (_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.Import.prepareBSplineCurveData(myData)) {
|
|
259542
259705
|
if (dim === 3)
|
|
259543
|
-
newCurve =
|
|
259706
|
+
newCurve = _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_16__.BSplineCurve3d.create(myData.poles, myData.params.knots, myData.params.order);
|
|
259544
259707
|
else
|
|
259545
|
-
newCurve =
|
|
259708
|
+
newCurve = _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_17__.BSplineCurve3dH.create(myData.poles, myData.params.knots, myData.params.order);
|
|
259546
259709
|
if (undefined !== newCurve) {
|
|
259547
259710
|
if (undefined !== myData.params.wrapMode)
|
|
259548
259711
|
newCurve.setWrappable(myData.params.wrapMode);
|
|
@@ -259555,13 +259718,13 @@ var IModelJson;
|
|
|
259555
259718
|
static parseInterpolationCurve(data) {
|
|
259556
259719
|
if (data === undefined)
|
|
259557
259720
|
return undefined;
|
|
259558
|
-
return
|
|
259721
|
+
return _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_18__.InterpolationCurve3d.create(data);
|
|
259559
259722
|
}
|
|
259560
259723
|
/** Parse `bcurve` content to an Akima curve object. */
|
|
259561
259724
|
static parseAkimaCurve3d(data) {
|
|
259562
259725
|
if (data === undefined)
|
|
259563
259726
|
return undefined;
|
|
259564
|
-
return
|
|
259727
|
+
return _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_19__.AkimaCurve3d.create(data);
|
|
259565
259728
|
}
|
|
259566
259729
|
/** Parse array of json objects to array of instances. */
|
|
259567
259730
|
static parseArray(data) {
|
|
@@ -259577,24 +259740,6 @@ var IModelJson;
|
|
|
259577
259740
|
}
|
|
259578
259741
|
return undefined;
|
|
259579
259742
|
}
|
|
259580
|
-
// For each nonzero index, Announce Math.abs (value) -1
|
|
259581
|
-
static addZeroBasedIndicesFromSignedOneBased(data, numPerFace, f) {
|
|
259582
|
-
if (data && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isNumberArray(data)) {
|
|
259583
|
-
if (numPerFace > 1) {
|
|
259584
|
-
// all indices are used ...
|
|
259585
|
-
for (const value of data) {
|
|
259586
|
-
f(Math.abs(value) - 1);
|
|
259587
|
-
}
|
|
259588
|
-
}
|
|
259589
|
-
else {
|
|
259590
|
-
// ignore separator zeros ...
|
|
259591
|
-
for (const value of data) {
|
|
259592
|
-
if (value !== 0)
|
|
259593
|
-
f(Math.abs(value) - 1);
|
|
259594
|
-
}
|
|
259595
|
-
}
|
|
259596
|
-
}
|
|
259597
|
-
}
|
|
259598
259743
|
/** parse polyface aux data content to PolyfaceAuxData instance */
|
|
259599
259744
|
static parsePolyfaceAuxData(data = undefined, numPerFace = 0) {
|
|
259600
259745
|
if (!Array.isArray(data.channels) || !Array.isArray(data.indices))
|
|
@@ -259605,13 +259750,13 @@ var IModelJson;
|
|
|
259605
259750
|
const outChannelData = [];
|
|
259606
259751
|
for (const inChannelData of inChannel.data) {
|
|
259607
259752
|
if (inChannelData.hasOwnProperty("input") && Array.isArray(inChannelData.values))
|
|
259608
|
-
outChannelData.push(new
|
|
259753
|
+
outChannelData.push(new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_20__.AuxChannelData(inChannelData.input, inChannelData.values));
|
|
259609
259754
|
}
|
|
259610
|
-
outChannels.push(new
|
|
259755
|
+
outChannels.push(new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_20__.AuxChannel(outChannelData, inChannel.dataType, inChannel.name, inChannel.inputName));
|
|
259611
259756
|
}
|
|
259612
259757
|
}
|
|
259613
|
-
const auxData = new
|
|
259614
|
-
|
|
259758
|
+
const auxData = new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_20__.PolyfaceAuxData(outChannels, []);
|
|
259759
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.indices, numPerFace, (x) => { auxData.indices.push(x); });
|
|
259615
259760
|
return auxData;
|
|
259616
259761
|
}
|
|
259617
259762
|
/** parse indexed mesh content to an IndexedPolyface instance */
|
|
@@ -259620,75 +259765,50 @@ var IModelJson;
|
|
|
259620
259765
|
// CoordIndex[1,2,3,0] -- zero-terminated, one based !!!
|
|
259621
259766
|
if (data.hasOwnProperty("point") && Array.isArray(data.point)
|
|
259622
259767
|
&& data.hasOwnProperty("pointIndex") && Array.isArray(data.pointIndex)) {
|
|
259623
|
-
const polyface =
|
|
259624
|
-
|
|
259625
|
-
// for normals, addNormal() is overeager to detect the (common) case of duplicate normals in sequence.
|
|
259626
|
-
// use addNormalXYZ which always creates a new one.
|
|
259627
|
-
// likewise for params
|
|
259628
|
-
for (const uvw of data.normal) {
|
|
259629
|
-
if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isNumberArray(uvw, 3))
|
|
259630
|
-
polyface.addNormalXYZ(uvw[0], uvw[1], uvw[2]);
|
|
259631
|
-
}
|
|
259632
|
-
}
|
|
259768
|
+
const polyface = _polyface_Polyface__WEBPACK_IMPORTED_MODULE_21__.IndexedPolyface.create();
|
|
259769
|
+
const numPerFace = data.hasOwnProperty("numPerFace") ? data.numPerFace : 0;
|
|
259633
259770
|
if (data.hasOwnProperty("twoSided")) {
|
|
259634
259771
|
const q = data.twoSided;
|
|
259635
259772
|
if (q === true || q === false) {
|
|
259636
259773
|
polyface.twoSided = q;
|
|
259637
259774
|
}
|
|
259638
259775
|
}
|
|
259639
|
-
const numPerFace = data.hasOwnProperty("numPerFace") ? data.numPerFace : 0;
|
|
259640
259776
|
if (data.hasOwnProperty("expectedClosure")) {
|
|
259641
259777
|
const q = data.expectedClosure;
|
|
259642
259778
|
if (Number.isFinite(q)) {
|
|
259643
259779
|
polyface.expectedClosure = q;
|
|
259644
259780
|
}
|
|
259645
259781
|
}
|
|
259646
|
-
if (data.hasOwnProperty("
|
|
259782
|
+
if (data.hasOwnProperty("normal") && Array.isArray(data.normal) && data.hasOwnProperty("normalIndex")) {
|
|
259783
|
+
// For normals, addNormal() is overeager to detect the (common) case of duplicate normals in sequence.
|
|
259784
|
+
// Use addNormalXYZ which always creates a new one. Likewise for params.
|
|
259785
|
+
for (const uvw of data.normal) {
|
|
259786
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(uvw, 3))
|
|
259787
|
+
polyface.addNormalXYZ(uvw[0], uvw[1], uvw[2]);
|
|
259788
|
+
}
|
|
259789
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.normalIndex, numPerFace, (x) => { polyface.addNormalIndex(x); });
|
|
259790
|
+
}
|
|
259791
|
+
if (data.hasOwnProperty("param") && Array.isArray(data.param) && data.hasOwnProperty("paramIndex")) {
|
|
259647
259792
|
for (const uv of data.param) {
|
|
259648
|
-
if (
|
|
259793
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(uv, 2))
|
|
259649
259794
|
polyface.addParamUV(uv[0], uv[1]);
|
|
259650
259795
|
}
|
|
259796
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.paramIndex, numPerFace, (x) => { polyface.addParamIndex(x); });
|
|
259651
259797
|
}
|
|
259652
|
-
if (data.hasOwnProperty("color") && Array.isArray(data.color)) {
|
|
259653
|
-
for (const c of data.color)
|
|
259798
|
+
if (data.hasOwnProperty("color") && Array.isArray(data.color) && data.hasOwnProperty("colorIndex")) {
|
|
259799
|
+
for (const c of data.color)
|
|
259654
259800
|
polyface.addColor(c);
|
|
259655
|
-
}
|
|
259801
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.colorIndex, numPerFace, (x) => { polyface.addColorIndex(x); });
|
|
259656
259802
|
}
|
|
259657
259803
|
for (const p of data.point)
|
|
259658
259804
|
polyface.addPointXYZ(p[0], p[1], p[2]);
|
|
259659
|
-
|
|
259660
|
-
|
|
259661
|
-
|
|
259662
|
-
const p0 = Math.abs(p) - 1;
|
|
259663
|
-
polyface.addPointIndex(p0, p > 0);
|
|
259664
|
-
if ((i + 1) % numPerFace === 0)
|
|
259665
|
-
polyface.terminateFacet(false);
|
|
259666
|
-
}
|
|
259667
|
-
}
|
|
259668
|
-
else {
|
|
259669
|
-
for (const p of data.pointIndex) {
|
|
259670
|
-
if (p === 0)
|
|
259671
|
-
polyface.terminateFacet(false); // we are responsible for index checking !!!
|
|
259672
|
-
else {
|
|
259673
|
-
const p0 = Math.abs(p) - 1;
|
|
259674
|
-
polyface.addPointIndex(p0, p > 0);
|
|
259675
|
-
}
|
|
259676
|
-
}
|
|
259677
|
-
}
|
|
259678
|
-
if (data.hasOwnProperty("normalIndex")) {
|
|
259679
|
-
Reader.addZeroBasedIndicesFromSignedOneBased(data.normalIndex, numPerFace, (x) => { polyface.addNormalIndex(x); });
|
|
259680
|
-
}
|
|
259681
|
-
if (data.hasOwnProperty("paramIndex")) {
|
|
259682
|
-
Reader.addZeroBasedIndicesFromSignedOneBased(data.paramIndex, numPerFace, (x) => { polyface.addParamIndex(x); });
|
|
259683
|
-
}
|
|
259684
|
-
if (data.hasOwnProperty("colorIndex")) {
|
|
259685
|
-
Reader.addZeroBasedIndicesFromSignedOneBased(data.colorIndex, numPerFace, (x) => { polyface.addColorIndex(x); });
|
|
259686
|
-
}
|
|
259805
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.pointIndex, numPerFace, (i, v) => { polyface.addPointIndex(i, v); }, () => { polyface.terminateFacet(false); });
|
|
259806
|
+
if (!polyface.validateAllIndices())
|
|
259807
|
+
return undefined;
|
|
259687
259808
|
if (data.hasOwnProperty("auxData"))
|
|
259688
259809
|
polyface.data.auxData = Reader.parsePolyfaceAuxData(data.auxData, numPerFace);
|
|
259689
|
-
if (data.hasOwnProperty("tags"))
|
|
259810
|
+
if (data.hasOwnProperty("tags"))
|
|
259690
259811
|
polyface.data.taggedNumericData = Reader.parseTaggedNumericProps(data.tags);
|
|
259691
|
-
}
|
|
259692
259812
|
return polyface;
|
|
259693
259813
|
}
|
|
259694
259814
|
return undefined;
|
|
@@ -259698,7 +259818,7 @@ var IModelJson;
|
|
|
259698
259818
|
if (data && Array.isArray(data)) {
|
|
259699
259819
|
for (const c of data) {
|
|
259700
259820
|
const g = Reader.parse(c);
|
|
259701
|
-
if (g instanceof
|
|
259821
|
+
if (g instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_22__.GeometryQuery && ("curveCollection" === g.geometryCategory || "curvePrimitive" === g.geometryCategory))
|
|
259702
259822
|
result.tryAddChild(g);
|
|
259703
259823
|
}
|
|
259704
259824
|
return result;
|
|
@@ -259716,21 +259836,21 @@ var IModelJson;
|
|
|
259716
259836
|
&& data.hasOwnProperty("orderV") && Number.isFinite(data.orderV)
|
|
259717
259837
|
&& data.hasOwnProperty("points") && Array.isArray(data.points) && Array.isArray(data.points[0]) && Array.isArray(data.points[0][0])
|
|
259718
259838
|
&& (dim = data.points[0][0].length) >= 3 && dim <= 4) {
|
|
259719
|
-
const myData =
|
|
259839
|
+
const myData = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.createBSplineSurfaceData(data.points, dim, data.uKnots, data.points[0].length, data.orderU, data.vKnots, data.points.length, data.orderV);
|
|
259720
259840
|
if (data.hasOwnProperty("closedU") && true === data.closedU)
|
|
259721
259841
|
myData.uParams.closed = true;
|
|
259722
259842
|
if (data.hasOwnProperty("closedV") && true === data.closedV)
|
|
259723
259843
|
myData.vParams.closed = true;
|
|
259724
|
-
if (
|
|
259844
|
+
if (_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.Import.prepareBSplineSurfaceData(myData, { jsonPoles: true })) {
|
|
259725
259845
|
if (dim === 3)
|
|
259726
|
-
newSurface =
|
|
259846
|
+
newSurface = _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.BSplineSurface3d.createGrid(myData.poles, myData.uParams.order, myData.uParams.knots, myData.vParams.order, myData.vParams.knots);
|
|
259727
259847
|
else
|
|
259728
|
-
newSurface =
|
|
259848
|
+
newSurface = _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.BSplineSurface3dH.createGrid(myData.poles, _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.WeightStyle.WeightsAlreadyAppliedToCoordinates, myData.uParams.order, myData.uParams.knots, myData.vParams.order, myData.vParams.knots);
|
|
259729
259849
|
if (undefined !== newSurface) {
|
|
259730
259850
|
if (undefined !== myData.uParams.wrapMode)
|
|
259731
|
-
newSurface.setWrappable(
|
|
259851
|
+
newSurface.setWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.uDirection, myData.uParams.wrapMode);
|
|
259732
259852
|
if (undefined !== myData.vParams.wrapMode)
|
|
259733
|
-
newSurface.setWrappable(
|
|
259853
|
+
newSurface.setWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.vDirection, myData.vParams.wrapMode);
|
|
259734
259854
|
}
|
|
259735
259855
|
}
|
|
259736
259856
|
}
|
|
@@ -259750,14 +259870,14 @@ var IModelJson;
|
|
|
259750
259870
|
&& startRadius !== undefined
|
|
259751
259871
|
&& endRadius !== undefined) {
|
|
259752
259872
|
if (axes === undefined) {
|
|
259753
|
-
const axisVector =
|
|
259754
|
-
const frame =
|
|
259873
|
+
const axisVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(start, end);
|
|
259874
|
+
const frame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createRigidHeadsUp(axisVector, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.ZXY);
|
|
259755
259875
|
const vectorX = frame.columnX();
|
|
259756
259876
|
const vectorY = frame.columnY();
|
|
259757
|
-
return
|
|
259877
|
+
return _solid_Cone__WEBPACK_IMPORTED_MODULE_24__.Cone.createBaseAndTarget(start, end, vectorX, vectorY, startRadius, endRadius, capped);
|
|
259758
259878
|
}
|
|
259759
259879
|
else {
|
|
259760
|
-
return
|
|
259880
|
+
return _solid_Cone__WEBPACK_IMPORTED_MODULE_24__.Cone.createBaseAndTarget(start, end, axes.columnX(), axes.columnY(), startRadius, endRadius, capped);
|
|
259761
259881
|
}
|
|
259762
259882
|
}
|
|
259763
259883
|
return undefined;
|
|
@@ -259771,14 +259891,14 @@ var IModelJson;
|
|
|
259771
259891
|
if (start
|
|
259772
259892
|
&& end
|
|
259773
259893
|
&& radius !== undefined) {
|
|
259774
|
-
return
|
|
259894
|
+
return _solid_Cone__WEBPACK_IMPORTED_MODULE_24__.Cone.createAxisPoints(start, end, radius, radius, capped);
|
|
259775
259895
|
}
|
|
259776
259896
|
return undefined;
|
|
259777
259897
|
}
|
|
259778
259898
|
/** Parse line segment (array of 2 points) properties to `LineSegment3d` instance */
|
|
259779
259899
|
static parseLineSegmentProps(value) {
|
|
259780
259900
|
if (Array.isArray(value) && value.length > 1)
|
|
259781
|
-
return
|
|
259901
|
+
return _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_25__.LineSegment3d.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(value[0]), _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(value[1]));
|
|
259782
259902
|
else
|
|
259783
259903
|
return undefined;
|
|
259784
259904
|
}
|
|
@@ -259787,11 +259907,11 @@ var IModelJson;
|
|
|
259787
259907
|
const contour = Reader.parse(json.contour);
|
|
259788
259908
|
const capped = Reader.parseBooleanProperty(json, "capped");
|
|
259789
259909
|
const extrusionVector = Reader.parseVector3dProperty(json, "vector");
|
|
259790
|
-
if (contour instanceof
|
|
259910
|
+
if (contour instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_22__.GeometryQuery
|
|
259791
259911
|
&& "curveCollection" === contour.geometryCategory
|
|
259792
259912
|
&& capped !== undefined
|
|
259793
259913
|
&& extrusionVector) {
|
|
259794
|
-
return
|
|
259914
|
+
return _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_26__.LinearSweep.create(contour, extrusionVector, capped);
|
|
259795
259915
|
}
|
|
259796
259916
|
return undefined;
|
|
259797
259917
|
}
|
|
@@ -259804,13 +259924,13 @@ var IModelJson;
|
|
|
259804
259924
|
const axisVector = Reader.parseVector3dProperty(json, "axis");
|
|
259805
259925
|
const center = Reader.parsePoint3dProperty(json, "center");
|
|
259806
259926
|
const sweepDegrees = Reader.parseNumberProperty(json, "sweepAngle");
|
|
259807
|
-
if (contour instanceof
|
|
259927
|
+
if (contour instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_22__.GeometryQuery
|
|
259808
259928
|
&& "curveCollection" === contour.geometryCategory
|
|
259809
259929
|
&& sweepDegrees !== undefined
|
|
259810
259930
|
&& capped !== undefined
|
|
259811
259931
|
&& axisVector
|
|
259812
259932
|
&& center) {
|
|
259813
|
-
return
|
|
259933
|
+
return _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_27__.RotationalSweep.create(contour, _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_28__.Ray3d.createCapture(center, axisVector), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_5__.Angle.createDegrees(sweepDegrees), capped);
|
|
259814
259934
|
}
|
|
259815
259935
|
return undefined;
|
|
259816
259936
|
}
|
|
@@ -259828,7 +259948,7 @@ var IModelJson;
|
|
|
259828
259948
|
const height = Reader.parseNumberProperty(json, "height", baseX);
|
|
259829
259949
|
const axes = Reader.parseOrientation(json, true);
|
|
259830
259950
|
if (origin && !topOrigin && height)
|
|
259831
|
-
topOrigin =
|
|
259951
|
+
topOrigin = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.xyzPlusMatrixTimesXYZ(origin, axes, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, height));
|
|
259832
259952
|
if (capped !== undefined
|
|
259833
259953
|
&& baseX !== undefined
|
|
259834
259954
|
&& baseY !== undefined
|
|
@@ -259837,7 +259957,7 @@ var IModelJson;
|
|
|
259837
259957
|
&& axes
|
|
259838
259958
|
&& origin
|
|
259839
259959
|
&& topOrigin) {
|
|
259840
|
-
return
|
|
259960
|
+
return _solid_Box__WEBPACK_IMPORTED_MODULE_29__.Box.createDgnBoxWithAxes(origin, axes, topOrigin, baseX, baseY, topX, topY, capped);
|
|
259841
259961
|
}
|
|
259842
259962
|
return undefined;
|
|
259843
259963
|
}
|
|
@@ -259859,7 +259979,7 @@ var IModelJson;
|
|
|
259859
259979
|
&& radiusY !== undefined
|
|
259860
259980
|
&& radiusZ !== undefined
|
|
259861
259981
|
&& capped !== undefined) {
|
|
259862
|
-
return
|
|
259982
|
+
return _solid_Sphere__WEBPACK_IMPORTED_MODULE_30__.Sphere.createFromAxesAndScales(center, axes, radiusX, radiusY, radiusZ, latitudeStartEnd, capped);
|
|
259863
259983
|
}
|
|
259864
259984
|
return undefined;
|
|
259865
259985
|
}
|
|
@@ -259869,7 +259989,7 @@ var IModelJson;
|
|
|
259869
259989
|
const contours = this.loadContourArray(json, "contour");
|
|
259870
259990
|
if (contours !== undefined
|
|
259871
259991
|
&& capped !== undefined) {
|
|
259872
|
-
return
|
|
259992
|
+
return _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_31__.RuledSweep.create(contours, capped);
|
|
259873
259993
|
}
|
|
259874
259994
|
return undefined;
|
|
259875
259995
|
}
|
|
@@ -259884,7 +260004,7 @@ var IModelJson;
|
|
|
259884
260004
|
if (center
|
|
259885
260005
|
&& radiusA !== undefined
|
|
259886
260006
|
&& radiusB !== undefined) {
|
|
259887
|
-
return
|
|
260007
|
+
return _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_32__.TorusPipe.createDgnTorusPipe(center, axes.columnX(), axes.columnY(), radiusA, radiusB, sweepAngle ? sweepAngle : _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_5__.Angle.createDegrees(360), capped);
|
|
259888
260008
|
}
|
|
259889
260009
|
return undefined;
|
|
259890
260010
|
}
|
|
@@ -259893,11 +260013,11 @@ var IModelJson;
|
|
|
259893
260013
|
const points = [];
|
|
259894
260014
|
if (json && Array.isArray(json)) {
|
|
259895
260015
|
for (const member of json) {
|
|
259896
|
-
if (
|
|
259897
|
-
points.push(
|
|
260016
|
+
if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.XYZ.isXAndY(member)) {
|
|
260017
|
+
points.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(member));
|
|
259898
260018
|
}
|
|
259899
|
-
else if (
|
|
259900
|
-
points.push(
|
|
260019
|
+
else if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(member, 2)) {
|
|
260020
|
+
points.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(member));
|
|
259901
260021
|
}
|
|
259902
260022
|
}
|
|
259903
260023
|
}
|
|
@@ -259910,7 +260030,7 @@ var IModelJson;
|
|
|
259910
260030
|
return Reader.parseLineSegmentProps(json.lineSegment);
|
|
259911
260031
|
}
|
|
259912
260032
|
else if (json.lineString !== undefined) {
|
|
259913
|
-
return
|
|
260033
|
+
return _curve_LineString3d__WEBPACK_IMPORTED_MODULE_33__.LineString3d.create(Reader.parsePointArray(json.lineString));
|
|
259914
260034
|
}
|
|
259915
260035
|
else if (json.arc !== undefined) {
|
|
259916
260036
|
return Reader.parseArcObject(json.arc);
|
|
@@ -259928,19 +260048,19 @@ var IModelJson;
|
|
|
259928
260048
|
return Reader.parseAkimaCurve3d(json.akimaCurve);
|
|
259929
260049
|
}
|
|
259930
260050
|
else if (json.hasOwnProperty("path")) {
|
|
259931
|
-
return Reader.parseCurveCollectionMembers(new
|
|
260051
|
+
return Reader.parseCurveCollectionMembers(new _curve_Path__WEBPACK_IMPORTED_MODULE_34__.Path(), json.path);
|
|
259932
260052
|
}
|
|
259933
260053
|
else if (json.hasOwnProperty("loop")) {
|
|
259934
|
-
return Reader.parseCurveCollectionMembers(new
|
|
260054
|
+
return Reader.parseCurveCollectionMembers(new _curve_Loop__WEBPACK_IMPORTED_MODULE_35__.Loop(), json.loop);
|
|
259935
260055
|
}
|
|
259936
260056
|
else if (json.hasOwnProperty("parityRegion")) {
|
|
259937
|
-
return Reader.parseCurveCollectionMembers(new
|
|
260057
|
+
return Reader.parseCurveCollectionMembers(new _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_36__.ParityRegion(), json.parityRegion);
|
|
259938
260058
|
}
|
|
259939
260059
|
else if (json.hasOwnProperty("unionRegion")) {
|
|
259940
|
-
return Reader.parseCurveCollectionMembers(new
|
|
260060
|
+
return Reader.parseCurveCollectionMembers(new _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_37__.UnionRegion(), json.unionRegion);
|
|
259941
260061
|
}
|
|
259942
260062
|
else if (json.hasOwnProperty("bagOfCurves")) {
|
|
259943
|
-
return Reader.parseCurveCollectionMembers(new
|
|
260063
|
+
return Reader.parseCurveCollectionMembers(new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_7__.BagOfCurves(), json.bagOfCurves);
|
|
259944
260064
|
}
|
|
259945
260065
|
else if (json.hasOwnProperty("indexedMesh")) {
|
|
259946
260066
|
return Reader.parseIndexedMesh(json.indexedMesh);
|
|
@@ -259973,7 +260093,7 @@ var IModelJson;
|
|
|
259973
260093
|
return Reader.parseTorusPipe(json.torusPipe);
|
|
259974
260094
|
}
|
|
259975
260095
|
else if (json.hasOwnProperty("pointString")) {
|
|
259976
|
-
return
|
|
260096
|
+
return _curve_PointString3d__WEBPACK_IMPORTED_MODULE_38__.PointString3d.create(Reader.parsePointArray(json.pointString));
|
|
259977
260097
|
}
|
|
259978
260098
|
else if (json.hasOwnProperty("transitionSpiral")) {
|
|
259979
260099
|
return Reader.parseTransitionSpiral(json.transitionSpiral);
|
|
@@ -259994,7 +260114,7 @@ var IModelJson;
|
|
|
259994
260114
|
* Class to deserialize json objects into GeometryQuery objects
|
|
259995
260115
|
* @public
|
|
259996
260116
|
*/
|
|
259997
|
-
class Writer extends
|
|
260117
|
+
class Writer extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_39__.GeometryHandler {
|
|
259998
260118
|
handleTaggedNumericData(data) {
|
|
259999
260119
|
const result = { tagA: data.tagA, tagB: data.tagB };
|
|
260000
260120
|
if (data.intData !== undefined && data.intData.length > 0)
|
|
@@ -260074,7 +260194,7 @@ var IModelJson;
|
|
|
260074
260194
|
// TODO: HANDLE NONRIGID TRANSFORM !!
|
|
260075
260195
|
// the spiral may have indication of how it was defined. If so, use defined/undefined state of the original data
|
|
260076
260196
|
// as indication of what current data to use. (Current data may have changed due to transforms.)
|
|
260077
|
-
if (data instanceof
|
|
260197
|
+
if (data instanceof _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_14__.DirectSpiral3d) {
|
|
260078
260198
|
const value = {
|
|
260079
260199
|
origin: data.localToWorld.origin.toJSON(),
|
|
260080
260200
|
type: data.spiralType,
|
|
@@ -260088,7 +260208,7 @@ var IModelJson;
|
|
|
260088
260208
|
value.length = data.nominalL1;
|
|
260089
260209
|
return { transitionSpiral: value };
|
|
260090
260210
|
}
|
|
260091
|
-
else if (data instanceof
|
|
260211
|
+
else if (data instanceof _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_12__.IntegratedSpiral3d) {
|
|
260092
260212
|
// TODO: HANDLE NONRIGID TRANSFORM !!
|
|
260093
260213
|
// the spiral may have indication of how it was defined. If so, use defined/undefined state of the original data
|
|
260094
260214
|
// as indication of what current data to use. (Current data may have changed due to transforms.)
|
|
@@ -260138,12 +260258,12 @@ var IModelJson;
|
|
|
260138
260258
|
const centerB = data.getCenterB();
|
|
260139
260259
|
const vectorX = data.getVectorX();
|
|
260140
260260
|
const vectorY = data.getVectorY();
|
|
260141
|
-
const axisVector =
|
|
260142
|
-
if (
|
|
260261
|
+
const axisVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(centerA, centerB);
|
|
260262
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(radiusA, radiusB)
|
|
260143
260263
|
&& vectorX.isPerpendicularTo(axisVector)
|
|
260144
260264
|
&& vectorY.isPerpendicularTo(axisVector)
|
|
260145
|
-
&&
|
|
260146
|
-
&&
|
|
260265
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(vectorX.magnitude(), 1.0)
|
|
260266
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(vectorY.magnitude(), 1.0)) {
|
|
260147
260267
|
return {
|
|
260148
260268
|
cylinder: {
|
|
260149
260269
|
capped: data.capped,
|
|
@@ -260183,7 +260303,7 @@ var IModelJson;
|
|
|
260183
260303
|
const fullSweep = latitudeSweep.isFullLatitudeSweep;
|
|
260184
260304
|
if (data.capped && !fullSweep)
|
|
260185
260305
|
value.capped = data.capped;
|
|
260186
|
-
if (
|
|
260306
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(rX, rY) && _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(rX, rZ))
|
|
260187
260307
|
value.radius = rX;
|
|
260188
260308
|
else {
|
|
260189
260309
|
value.radiusX = rX;
|
|
@@ -260337,35 +260457,25 @@ var IModelJson;
|
|
|
260337
260457
|
};
|
|
260338
260458
|
const outBox = out.box;
|
|
260339
260459
|
Writer.insertXYOrientation(outBox, box.getVectorX(), box.getVectorY(), true);
|
|
260340
|
-
if (!
|
|
260460
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(box.getTopX(), box.getBaseX()))
|
|
260341
260461
|
outBox.topX = box.getTopX();
|
|
260342
|
-
if (!
|
|
260462
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(box.getTopY(), box.getBaseY()))
|
|
260343
260463
|
outBox.topY = box.getTopY();
|
|
260344
260464
|
return out;
|
|
260345
260465
|
}
|
|
260346
260466
|
handlePolyfaceAuxData(auxData, pf) {
|
|
260347
|
-
|
|
260348
|
-
contents
|
|
260467
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(auxData === pf.data.auxData);
|
|
260468
|
+
const contents = { indices: [], channels: [] };
|
|
260349
260469
|
const visitor = pf.createVisitor(0);
|
|
260350
|
-
if (!visitor.auxData)
|
|
260351
|
-
return;
|
|
260352
260470
|
while (visitor.moveToNextFacet()) {
|
|
260353
|
-
for (let i = 0; i < visitor.indexCount; i++)
|
|
260471
|
+
for (let i = 0; i < visitor.indexCount; i++)
|
|
260354
260472
|
contents.indices.push(visitor.auxData.indices[i] + 1);
|
|
260355
|
-
}
|
|
260356
260473
|
contents.indices.push(0); // facet terminator.
|
|
260357
260474
|
}
|
|
260358
|
-
contents.channels = [];
|
|
260359
260475
|
for (const inChannel of auxData.channels) {
|
|
260360
|
-
const outChannel = {};
|
|
260361
|
-
outChannel.dataType = inChannel.dataType;
|
|
260362
|
-
outChannel.name = inChannel.name;
|
|
260363
|
-
outChannel.inputName = inChannel.inputName;
|
|
260364
|
-
outChannel.data = [];
|
|
260476
|
+
const outChannel = { data: [], dataType: inChannel.dataType, name: inChannel.name, inputName: inChannel.inputName };
|
|
260365
260477
|
for (const inData of inChannel.data) {
|
|
260366
|
-
const outData = {};
|
|
260367
|
-
outData.input = inData.input;
|
|
260368
|
-
outData.values = inData.values.slice(0);
|
|
260478
|
+
const outData = { input: inData.input, values: inData.values.slice(0) };
|
|
260369
260479
|
outChannel.data.push(outData);
|
|
260370
260480
|
}
|
|
260371
260481
|
contents.channels.push(outChannel);
|
|
@@ -260380,20 +260490,20 @@ var IModelJson;
|
|
|
260380
260490
|
const params = [];
|
|
260381
260491
|
const colors = [];
|
|
260382
260492
|
{
|
|
260383
|
-
const p =
|
|
260493
|
+
const p = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create();
|
|
260384
260494
|
for (let i = 0; pf.data.point.getPoint3dAtCheckedPointIndex(i, p); i++)
|
|
260385
260495
|
points.push(p.toJSON());
|
|
260386
260496
|
}
|
|
260387
260497
|
if (pf.data.normal) {
|
|
260388
260498
|
const numNormal = pf.data.normal.length;
|
|
260389
|
-
const normal =
|
|
260499
|
+
const normal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create();
|
|
260390
260500
|
for (let i = 0; i < numNormal; i++) {
|
|
260391
260501
|
pf.data.normal.getVector3dAtCheckedVectorIndex(i, normal);
|
|
260392
260502
|
normals.push(normal.toJSON());
|
|
260393
260503
|
}
|
|
260394
260504
|
}
|
|
260395
260505
|
if (pf.data.param) {
|
|
260396
|
-
const uv =
|
|
260506
|
+
const uv = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_40__.Point2d.create();
|
|
260397
260507
|
for (let i = 0; pf.data.param.getPoint2dAtCheckedPointIndex(i, uv); i++)
|
|
260398
260508
|
params.push(uv.toJSON());
|
|
260399
260509
|
}
|
|
@@ -260464,11 +260574,11 @@ var IModelJson;
|
|
|
260464
260574
|
return { indexedMesh: contents };
|
|
260465
260575
|
}
|
|
260466
260576
|
handleBSplineCurve(curve) {
|
|
260467
|
-
const data =
|
|
260577
|
+
const data = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.createBSplineCurveData(curve.polesRef, curve.poleDimension, curve.knotsRef, curve.numPoles, curve.order);
|
|
260468
260578
|
const wrapMode = curve.getWrappable();
|
|
260469
|
-
if (
|
|
260579
|
+
if (_bspline_KnotVector__WEBPACK_IMPORTED_MODULE_41__.BSplineWrapMode.None !== wrapMode)
|
|
260470
260580
|
data.params.wrapMode = wrapMode;
|
|
260471
|
-
if (!
|
|
260581
|
+
if (!_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.Export.prepareBSplineCurveData(data, { jsonPoles: true, jsonKnots: true }))
|
|
260472
260582
|
return undefined;
|
|
260473
260583
|
return {
|
|
260474
260584
|
bcurve: {
|
|
@@ -260486,7 +260596,7 @@ var IModelJson;
|
|
|
260486
260596
|
/** Convert strongly typed instance to tagged json */
|
|
260487
260597
|
handleInterpolationCurve3d(curve) {
|
|
260488
260598
|
const props = curve.cloneProps();
|
|
260489
|
-
|
|
260599
|
+
_bspline_BSplineCurveOps__WEBPACK_IMPORTED_MODULE_42__.BSplineCurveOps.C2CubicFit.convertToJsonKnots(props);
|
|
260490
260600
|
return { interpolationCurve: props };
|
|
260491
260601
|
}
|
|
260492
260602
|
/** Convert strongly typed instance to tagged json */
|
|
@@ -260535,14 +260645,14 @@ var IModelJson;
|
|
|
260535
260645
|
}
|
|
260536
260646
|
/** Convert strongly typed instance to tagged json */
|
|
260537
260647
|
handleBSplineSurface(surface) {
|
|
260538
|
-
const data =
|
|
260539
|
-
const wrapModeU = surface.getWrappable(
|
|
260540
|
-
const wrapModeV = surface.getWrappable(
|
|
260541
|
-
if (
|
|
260648
|
+
const data = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.createBSplineSurfaceData(surface.coffs, surface.poleDimension, surface.knots[_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.uDirection].knots, surface.numPolesUV(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.uDirection), surface.orderUV(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.uDirection), surface.knots[_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.vDirection].knots, surface.numPolesUV(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.vDirection), surface.orderUV(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.vDirection));
|
|
260649
|
+
const wrapModeU = surface.getWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.uDirection);
|
|
260650
|
+
const wrapModeV = surface.getWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.vDirection);
|
|
260651
|
+
if (_bspline_KnotVector__WEBPACK_IMPORTED_MODULE_41__.BSplineWrapMode.None !== wrapModeU)
|
|
260542
260652
|
data.uParams.wrapMode = wrapModeU;
|
|
260543
|
-
if (
|
|
260653
|
+
if (_bspline_KnotVector__WEBPACK_IMPORTED_MODULE_41__.BSplineWrapMode.None !== wrapModeV)
|
|
260544
260654
|
data.vParams.wrapMode = wrapModeV;
|
|
260545
|
-
if (!
|
|
260655
|
+
if (!_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.Export.prepareBSplineSurfaceData(data, { jsonPoles: true, jsonKnots: true }))
|
|
260546
260656
|
return undefined;
|
|
260547
260657
|
return {
|
|
260548
260658
|
bsurf: {
|
|
@@ -260573,10 +260683,10 @@ var IModelJson;
|
|
|
260573
260683
|
emit(data) {
|
|
260574
260684
|
if (Array.isArray(data))
|
|
260575
260685
|
return this.emitArray(data);
|
|
260576
|
-
if (data instanceof
|
|
260686
|
+
if (data instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_22__.GeometryQuery) {
|
|
260577
260687
|
return data.dispatchToGeometryHandler(this);
|
|
260578
260688
|
}
|
|
260579
|
-
else if (data instanceof
|
|
260689
|
+
else if (data instanceof _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_4__.TaggedNumericData) {
|
|
260580
260690
|
return this.handleTaggedNumericData(data);
|
|
260581
260691
|
}
|
|
260582
260692
|
return undefined;
|
|
@@ -260829,6 +260939,91 @@ var SerializationHelpers;
|
|
|
260829
260939
|
data.vParams.knots = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_0__.NumberArray.pack(data.vParams.knots);
|
|
260830
260940
|
}
|
|
260831
260941
|
}
|
|
260942
|
+
/**
|
|
260943
|
+
* Process 1-based blocked indices into 0-based indices.
|
|
260944
|
+
* @param sourceIndices signed, 1-based, 0-terminated/padded source indices, blocking specified by `numPerBlock`
|
|
260945
|
+
* @param numPerBlock index blocking: fixed blocks of size numPerBlock > 1, possibly 0-padded; otherwise, variable-sized blocks terminated by 0
|
|
260946
|
+
* @param announceZeroBasedIndex callback to receive a 0-based index and optional flag indicating whether the sign of the source index is positive
|
|
260947
|
+
* @param terminateBlock optional callback called after each index block has been announced
|
|
260948
|
+
*/
|
|
260949
|
+
function announceZeroBasedIndicesFromSignedOneBasedIndices(sourceIndices, numPerBlock, announceZeroBasedIndex, terminateBlock) {
|
|
260950
|
+
let numIndices = sourceIndices.length;
|
|
260951
|
+
if (!numIndices)
|
|
260952
|
+
return;
|
|
260953
|
+
if (numPerBlock > 1) {
|
|
260954
|
+
numIndices -= sourceIndices.length % numPerBlock;
|
|
260955
|
+
for (let i = 0; i < numIndices; i++) {
|
|
260956
|
+
const p = sourceIndices[i];
|
|
260957
|
+
if (p !== 0) // skip padding
|
|
260958
|
+
announceZeroBasedIndex(Math.abs(p) - 1, p > 0);
|
|
260959
|
+
if (terminateBlock && ((i + 1) % numPerBlock) === 0)
|
|
260960
|
+
terminateBlock();
|
|
260961
|
+
}
|
|
260962
|
+
}
|
|
260963
|
+
else {
|
|
260964
|
+
for (let i = 0; i < numIndices; i++) {
|
|
260965
|
+
const p = sourceIndices[i];
|
|
260966
|
+
if (p !== 0) // skip terminator
|
|
260967
|
+
announceZeroBasedIndex(Math.abs(p) - 1, p > 0);
|
|
260968
|
+
if (terminateBlock) {
|
|
260969
|
+
if (p === 0) {
|
|
260970
|
+
if (i + 1 === numIndices || sourceIndices[i + 1] !== 0) // skip extra terminators
|
|
260971
|
+
terminateBlock();
|
|
260972
|
+
}
|
|
260973
|
+
else {
|
|
260974
|
+
if (i + 1 === numIndices) // missing last terminator
|
|
260975
|
+
terminateBlock();
|
|
260976
|
+
}
|
|
260977
|
+
}
|
|
260978
|
+
}
|
|
260979
|
+
}
|
|
260980
|
+
}
|
|
260981
|
+
SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices = announceZeroBasedIndicesFromSignedOneBasedIndices;
|
|
260982
|
+
/**
|
|
260983
|
+
* Process 0-based indices with blocking specified by another index array.
|
|
260984
|
+
* @param sourceIndices 0-based source indices. This array is compressed (has no blocking).
|
|
260985
|
+
* @param blockingIndices 1-based source indices, blocking specified by `numPerBlock`. Assumed to have length equal to its zero count plus `sourceIndices.length`.
|
|
260986
|
+
* @param numPerBlock index blocking: fixed blocks of size numPerBlock > 1, possibly 0-padded; otherwise, variable-sized blocks terminated by 0
|
|
260987
|
+
* @param announceZeroBasedIndex callback to receive a 0-based index
|
|
260988
|
+
* @param terminateBlock optional callback called after each index block has been announced
|
|
260989
|
+
*/
|
|
260990
|
+
function announceZeroBasedIndicesWithExternalBlocking(sourceIndices, blockingIndices, numPerBlock, announceZeroBasedIndex, terminateBlock) {
|
|
260991
|
+
if (!sourceIndices.length || !blockingIndices.length)
|
|
260992
|
+
return;
|
|
260993
|
+
const blockingZeroCount = blockingIndices.filter((i) => i === 0).length;
|
|
260994
|
+
if (sourceIndices.length + blockingZeroCount !== blockingIndices.length)
|
|
260995
|
+
return; // invalid input
|
|
260996
|
+
let iSource = 0;
|
|
260997
|
+
let numBlocking = blockingIndices.length;
|
|
260998
|
+
if (numPerBlock > 1) {
|
|
260999
|
+
numBlocking -= blockingIndices.length % numPerBlock;
|
|
261000
|
+
for (let iBlocking = 0; iBlocking < numBlocking && iSource < sourceIndices.length; iBlocking++) {
|
|
261001
|
+
const p = blockingIndices[iBlocking];
|
|
261002
|
+
if (p !== 0) // skip padding
|
|
261003
|
+
announceZeroBasedIndex(sourceIndices[iSource++]);
|
|
261004
|
+
if (terminateBlock && ((iBlocking + 1) % numPerBlock) === 0)
|
|
261005
|
+
terminateBlock();
|
|
261006
|
+
}
|
|
261007
|
+
}
|
|
261008
|
+
else {
|
|
261009
|
+
for (let iBlocking = 0; iBlocking < numBlocking && iSource < sourceIndices.length; iBlocking++) {
|
|
261010
|
+
const p = blockingIndices[iBlocking];
|
|
261011
|
+
if (p !== 0) // skip terminator
|
|
261012
|
+
announceZeroBasedIndex(sourceIndices[iSource++]);
|
|
261013
|
+
if (terminateBlock) {
|
|
261014
|
+
if (p === 0) {
|
|
261015
|
+
if (iBlocking + 1 === numBlocking || blockingIndices[iBlocking + 1] !== 0) // skip extra terminators
|
|
261016
|
+
terminateBlock();
|
|
261017
|
+
}
|
|
261018
|
+
else {
|
|
261019
|
+
if (iBlocking + 1 === numBlocking) // missing last terminator
|
|
261020
|
+
terminateBlock();
|
|
261021
|
+
}
|
|
261022
|
+
}
|
|
261023
|
+
}
|
|
261024
|
+
}
|
|
261025
|
+
}
|
|
261026
|
+
SerializationHelpers.announceZeroBasedIndicesWithExternalBlocking = announceZeroBasedIndicesWithExternalBlocking;
|
|
260832
261027
|
/** Helper class for preparing geometry data for import. */
|
|
260833
261028
|
class Import {
|
|
260834
261029
|
/** copy knots, with options to control destination type and extraneous knot removal */
|
|
@@ -262383,12 +262578,14 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
262383
262578
|
uFractionToRadians(u) {
|
|
262384
262579
|
return u * Math.PI * 2.0;
|
|
262385
262580
|
}
|
|
262581
|
+
/** Constructor CAPTURES inputs */
|
|
262386
262582
|
constructor(localToWorld, latitudeSweep, capped) {
|
|
262387
262583
|
super(capped);
|
|
262388
262584
|
/** String name for schema properties */
|
|
262389
262585
|
this.solidPrimitiveType = "sphere";
|
|
262390
262586
|
this._localToWorld = localToWorld;
|
|
262391
262587
|
this._latitudeSweep = latitudeSweep ? latitudeSweep : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_1__.AngleSweep.createFullLatitude();
|
|
262588
|
+
this._latitudeSweep.capLatitudeInPlace();
|
|
262392
262589
|
}
|
|
262393
262590
|
/** return a deep clone */
|
|
262394
262591
|
clone() {
|
|
@@ -262427,11 +262624,11 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
262427
262624
|
/** Create from center and radius, with optional restricted latitudes. */
|
|
262428
262625
|
static createCenterRadius(center, radius, latitudeSweep) {
|
|
262429
262626
|
const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createOriginAndMatrix(center, _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__.Matrix3d.createUniformScale(radius));
|
|
262430
|
-
return new Sphere(localToWorld, latitudeSweep ? latitudeSweep : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_1__.AngleSweep.createFullLatitude(), false);
|
|
262627
|
+
return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_1__.AngleSweep.createFullLatitude(), false);
|
|
262431
262628
|
}
|
|
262432
262629
|
/** Create an ellipsoid which is a unit sphere mapped to position by an (arbitrary, possibly skewed and scaled) transform. */
|
|
262433
262630
|
static createEllipsoid(localToWorld, latitudeSweep, capped) {
|
|
262434
|
-
return new Sphere(localToWorld, latitudeSweep, capped);
|
|
262631
|
+
return new Sphere(localToWorld.clone(), latitudeSweep.clone(), capped);
|
|
262435
262632
|
}
|
|
262436
262633
|
/** Create a sphere from the typical parameters of the Dgn file */
|
|
262437
262634
|
static createDgnSphere(center, vectorX, vectorZ, radiusXY, radiusZ, latitudeSweep, capped) {
|
|
@@ -290028,7 +290225,7 @@ class TestContext {
|
|
|
290028
290225
|
this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
|
|
290029
290226
|
const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
|
|
290030
290227
|
await core_frontend_1.NoRenderApp.startup({
|
|
290031
|
-
applicationVersion: "4.7.0-dev.
|
|
290228
|
+
applicationVersion: "4.7.0-dev.8",
|
|
290032
290229
|
applicationId: this.settings.gprid,
|
|
290033
290230
|
authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
|
|
290034
290231
|
hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
|
|
@@ -314023,7 +314220,7 @@ function __disposeResources(env) {
|
|
|
314023
314220
|
/***/ ((module) => {
|
|
314024
314221
|
|
|
314025
314222
|
"use strict";
|
|
314026
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.7.0-dev.
|
|
314223
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.7.0-dev.8","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.7.0-dev.8","@itwin/core-bentley":"workspace:^4.7.0-dev.8","@itwin/core-common":"workspace:^4.7.0-dev.8","@itwin/core-geometry":"workspace:^4.7.0-dev.8","@itwin/core-orbitgt":"workspace:^4.7.0-dev.8","@itwin/core-quantity":"workspace:^4.7.0-dev.8"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"^4.0.2","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.56.0","glob":"^10.3.12","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.3.3","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.2.2","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","meshoptimizer":"~0.20.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
|
|
314027
314224
|
|
|
314028
314225
|
/***/ }),
|
|
314029
314226
|
|