@itwin/ecschema-rpcinterface-tests 4.7.0-dev.7 → 4.7.0-dev.9
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 +1090 -893
- 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
|
@@ -196555,17 +196555,17 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
196555
196555
|
/* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
|
|
196556
196556
|
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
196557
196557
|
/* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
|
|
196558
|
-
/* harmony import */ var
|
|
196558
|
+
/* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
|
|
196559
196559
|
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
196560
196560
|
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
196561
196561
|
/* harmony import */ var _numerics_Newton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../numerics/Newton */ "../../core/geometry/lib/esm/numerics/Newton.js");
|
|
196562
|
-
/* harmony import */ var
|
|
196562
|
+
/* harmony import */ var _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../numerics/Polynomials */ "../../core/geometry/lib/esm/numerics/Polynomials.js");
|
|
196563
196563
|
/* harmony import */ var _Arc3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
196564
196564
|
/* harmony import */ var _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../CurveChainWithDistanceIndex */ "../../core/geometry/lib/esm/curve/CurveChainWithDistanceIndex.js");
|
|
196565
196565
|
/* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
196566
196566
|
/* harmony import */ var _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../CurveLocationDetail */ "../../core/geometry/lib/esm/curve/CurveLocationDetail.js");
|
|
196567
196567
|
/* harmony import */ var _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
196568
|
-
/* harmony import */ var
|
|
196568
|
+
/* harmony import */ var _LineString3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
196569
196569
|
/*---------------------------------------------------------------------------------------------
|
|
196570
196570
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
196571
196571
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -196895,6 +196895,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
196895
196895
|
* Check different combination of fractions on curveA and curveB. If distance between points at 2 fractions
|
|
196896
196896
|
* is less than maxDistance, record CurveLocationDetailPair which is the approach between the 2 points.
|
|
196897
196897
|
* Optionally, record close approaches of one curve's points if they fall between the other curve's points.
|
|
196898
|
+
* * If an input curve is a LineString3d, then the corresponding fractions must define a segment of the line string.
|
|
196898
196899
|
* @param cpA curveA
|
|
196899
196900
|
* @param fA0 fraction0 on curveA
|
|
196900
196901
|
* @param fA1 fraction1 on curveA
|
|
@@ -196930,7 +196931,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
196930
196931
|
*/
|
|
196931
196932
|
getPointCurveClosestApproachXYNewton(curveP, pointQ) {
|
|
196932
196933
|
if (!(curveP instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) && !(curveP instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d)) {
|
|
196933
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
196934
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"getPointCurveClosestApproachXYNewton only supports Arc3d and LineSegment");
|
|
196934
196935
|
return undefined;
|
|
196935
196936
|
}
|
|
196936
196937
|
const seeds = [0.2, 0.4, 0.6, 0.8]; // HEURISTIC: arcs have up to 4 perpendiculars; lines have only 1
|
|
@@ -196958,9 +196959,24 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
196958
196959
|
return _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_4__.CurveLocationDetail.createCurveFractionPoint(curveP, minCurvePFraction, minPointP);
|
|
196959
196960
|
return undefined;
|
|
196960
196961
|
}
|
|
196961
|
-
/**
|
|
196962
|
+
/**
|
|
196963
|
+
* Find the closest approach between `pointA` and `cpB`. Add the approach if it's within `fB0` and `fB1`.
|
|
196964
|
+
* * Does not test the endpoints of `cpB`.
|
|
196965
|
+
* * The only types supported for `cpB` are Arc3d, LineSegment3d, and LineString3d.
|
|
196966
|
+
* * If `cpB` is a LineString3d, then the interval `[fB0, fB1]` must correspond to a segment of the line string.
|
|
196967
|
+
*/
|
|
196962
196968
|
testAndRecordProjection(cpA, fA, pointA, cpB, fB0, fB1, reversed) {
|
|
196963
|
-
|
|
196969
|
+
let detail;
|
|
196970
|
+
if (cpB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
196971
|
+
const segParamsB = cpB.globalFractionToSegmentIndexAndLocalFraction(fB0 <= fB1 ? fB0 : fB1);
|
|
196972
|
+
const segIndexB = (segParamsB.fraction < 0.999999) ? segParamsB.index : segParamsB.index + 1;
|
|
196973
|
+
const segmentB = cpB.getIndexedSegment(segIndexB);
|
|
196974
|
+
if (segmentB && (detail = this.getPointCurveClosestApproachXYNewton(segmentB, pointA)))
|
|
196975
|
+
_LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.convertLocalToGlobalDetail(detail, segIndexB, cpB.numEdges(), cpB);
|
|
196976
|
+
}
|
|
196977
|
+
else {
|
|
196978
|
+
detail = this.getPointCurveClosestApproachXYNewton(cpB, pointA);
|
|
196979
|
+
}
|
|
196964
196980
|
if (detail) {
|
|
196965
196981
|
const fB = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.restrictToInterval(detail.fraction, fB0, fB1);
|
|
196966
196982
|
if (fB === detail.fraction) { // if fraction is within fB0 and fB1
|
|
@@ -197020,15 +197036,15 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
197020
197036
|
const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.center, 1); // det(A0, A1, C)
|
|
197021
197037
|
const beta = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector0, 0); // det(A0, A1, U)
|
|
197022
197038
|
const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector90, 0); // det(A0, A1, V)
|
|
197023
|
-
const cosines = new
|
|
197024
|
-
const sines = new
|
|
197025
|
-
const radians = new
|
|
197026
|
-
const numRoots =
|
|
197039
|
+
const cosines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__.GrowableFloat64Array(2);
|
|
197040
|
+
const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__.GrowableFloat64Array(2);
|
|
197041
|
+
const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_8__.GrowableFloat64Array(2);
|
|
197042
|
+
const numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_9__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(// solve the equation
|
|
197027
197043
|
alpha, beta, gamma, cosines, sines, radians);
|
|
197028
197044
|
for (let i = 0; i < numRoots; i++) {
|
|
197029
197045
|
const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
|
|
197030
197046
|
const arcFraction = data.sweep.radiansToSignedPeriodicFraction(radians.atUncheckedIndex(i));
|
|
197031
|
-
const lineFraction =
|
|
197047
|
+
const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_9__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
|
|
197032
197048
|
// only add if the point is within the start and end fractions of both line segment and arc
|
|
197033
197049
|
if (lineFraction !== undefined && this.acceptFraction(lineFraction) && this.acceptFraction(arcFraction)) {
|
|
197034
197050
|
this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
|
|
@@ -197048,7 +197064,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
197048
197064
|
for (const radians1 of [parallelRadians, parallelRadians + Math.PI]) {
|
|
197049
197065
|
const arcPoint = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
|
|
197050
197066
|
const arcFraction = data.sweep.radiansToSignedPeriodicFraction(radians1);
|
|
197051
|
-
const lineFraction =
|
|
197067
|
+
const lineFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_9__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
|
|
197052
197068
|
// only add if the point is within the start and end fractions of both line segment and arc
|
|
197053
197069
|
if (lineFraction !== undefined && this.acceptFraction(lineFraction) && this.acceptFraction(arcFraction)) {
|
|
197054
197070
|
this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
|
|
@@ -197092,27 +197108,27 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
197092
197108
|
}
|
|
197093
197109
|
/** Low level dispatch of arc with (beziers of) a bspline curve */
|
|
197094
197110
|
dispatchArcBsplineCurve3d(cpA, cpB, reversed) {
|
|
197095
|
-
const ls =
|
|
197111
|
+
const ls = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
197096
197112
|
cpB.emitStrokes(ls);
|
|
197097
197113
|
this.computeArcLineString(cpA, ls, reversed);
|
|
197098
197114
|
}
|
|
197099
197115
|
/** Low level dispatch of (beziers of) a bspline curve with (beziers of) a bspline curve */
|
|
197100
197116
|
dispatchBSplineCurve3dBSplineCurve3d(bcurveA, bcurveB, reversed) {
|
|
197101
|
-
const lsA =
|
|
197117
|
+
const lsA = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
197102
197118
|
bcurveA.emitStrokes(lsA);
|
|
197103
|
-
const lsB =
|
|
197119
|
+
const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
197104
197120
|
bcurveB.emitStrokes(lsB);
|
|
197105
197121
|
this.computeLineStringLineString(lsA, lsB, reversed);
|
|
197106
197122
|
}
|
|
197107
197123
|
/** Low level dispatch of linestring with (beziers of) a bspline curve */
|
|
197108
197124
|
dispatchLineStringBSplineCurve(lsA, curveB, reversed) {
|
|
197109
|
-
const lsB =
|
|
197125
|
+
const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
197110
197126
|
curveB.emitStrokes(lsB);
|
|
197111
197127
|
this.computeLineStringLineString(lsA, lsB, reversed);
|
|
197112
197128
|
}
|
|
197113
197129
|
/** Low level dispatch of segment with (beziers of) a bspline curve */
|
|
197114
197130
|
dispatchSegmentBsplineCurve(segA, curveB, reversed) {
|
|
197115
|
-
const lsB =
|
|
197131
|
+
const lsB = _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d.create();
|
|
197116
197132
|
curveB.emitStrokes(lsB);
|
|
197117
197133
|
this.computeSegmentLineString(segA, lsB, reversed);
|
|
197118
197134
|
}
|
|
@@ -197172,7 +197188,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
197172
197188
|
if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_11__.CurveChainWithDistanceIndex))
|
|
197173
197189
|
return;
|
|
197174
197190
|
if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_11__.CurveChainWithDistanceIndex) {
|
|
197175
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
197191
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
197176
197192
|
return;
|
|
197177
197193
|
}
|
|
197178
197194
|
const index0 = this._results.length;
|
|
@@ -197190,7 +197206,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
197190
197206
|
const segmentB = this._geometryB;
|
|
197191
197207
|
this.dispatchSegmentSegment(segmentA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, segmentB, segmentB.point0Ref, 0.0, segmentB.point1Ref, 1.0, false);
|
|
197192
197208
|
}
|
|
197193
|
-
else if (this._geometryB instanceof
|
|
197209
|
+
else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
197194
197210
|
this.computeSegmentLineString(segmentA, this._geometryB, false);
|
|
197195
197211
|
}
|
|
197196
197212
|
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
|
|
@@ -197285,7 +197301,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
197285
197301
|
}
|
|
197286
197302
|
/** Double dispatch handler for strongly typed linestring. */
|
|
197287
197303
|
handleLineString3d(lsA) {
|
|
197288
|
-
if (this._geometryB instanceof
|
|
197304
|
+
if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
197289
197305
|
const lsB = this._geometryB;
|
|
197290
197306
|
this.computeLineStringLineString(lsA, lsB, false);
|
|
197291
197307
|
}
|
|
@@ -197311,7 +197327,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
197311
197327
|
if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d) {
|
|
197312
197328
|
this.dispatchSegmentArc(this._geometryB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, arc0, true);
|
|
197313
197329
|
}
|
|
197314
|
-
else if (this._geometryB instanceof
|
|
197330
|
+
else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
197315
197331
|
this.computeArcLineString(arc0, this._geometryB, false);
|
|
197316
197332
|
}
|
|
197317
197333
|
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
|
|
@@ -197333,7 +197349,7 @@ class CurveCurveCloseApproachXY extends _geometry3d_GeometryHandler__WEBPACK_IMP
|
|
|
197333
197349
|
if (this._geometryB instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_5__.LineSegment3d) {
|
|
197334
197350
|
this.dispatchSegmentBsplineCurve(this._geometryB, curve, true);
|
|
197335
197351
|
}
|
|
197336
|
-
else if (this._geometryB instanceof
|
|
197352
|
+
else if (this._geometryB instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_7__.LineString3d) {
|
|
197337
197353
|
this.dispatchLineStringBSplineCurve(this._geometryB, curve, true);
|
|
197338
197354
|
}
|
|
197339
197355
|
else if (this._geometryB instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_2__.Arc3d) {
|
|
@@ -198122,7 +198138,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
198122
198138
|
if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_12__.CurveChainWithDistanceIndex))
|
|
198123
198139
|
return;
|
|
198124
198140
|
if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_12__.CurveChainWithDistanceIndex) {
|
|
198125
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
198141
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
198126
198142
|
return;
|
|
198127
198143
|
}
|
|
198128
198144
|
const index0 = this._results.length;
|
|
@@ -198910,7 +198926,7 @@ class CurveCurveIntersectXYZ extends _geometry3d_GeometryHandler__WEBPACK_IMPORT
|
|
|
198910
198926
|
if (!this._geometryB || !(this._geometryB instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_8__.CurveChainWithDistanceIndex))
|
|
198911
198927
|
return;
|
|
198912
198928
|
if (geomA instanceof _CurveChainWithDistanceIndex__WEBPACK_IMPORTED_MODULE_8__.CurveChainWithDistanceIndex) {
|
|
198913
|
-
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(
|
|
198929
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(!"call handleCurveChainWithDistanceIndex(geomA) instead");
|
|
198914
198930
|
return;
|
|
198915
198931
|
}
|
|
198916
198932
|
const index0 = this._results.length;
|
|
@@ -216291,10 +216307,10 @@ class Vector3d extends XYZ {
|
|
|
216291
216307
|
return _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createAtan2(this.crossProductXY(vectorB), this.dotProductXY(vectorB));
|
|
216292
216308
|
}
|
|
216293
216309
|
/**
|
|
216294
|
-
* Return the angle in radians (not as strongly-typed Angle) from this vector to vectorB
|
|
216295
|
-
* in their containing plane whose normal lies in the same half-space as vectorW
|
|
216310
|
+
* Return the angle in radians (not as strongly-typed Angle) from `this` vector to `vectorB`, measured
|
|
216311
|
+
* in their containing plane whose normal lies in the same half-space as `vectorW`.
|
|
216296
216312
|
* * The returned angle is between `-Math.PI` and `Math.PI`.
|
|
216297
|
-
* * If the cross product of this vector and vectorB lies on the same side of the plane as vectorW
|
|
216313
|
+
* * If the cross product of `this` vector and `vectorB` lies on the same side of the plane as `vectorW`,
|
|
216298
216314
|
* this function returns `radiansTo(vectorB)`; otherwise, it returns `-radiansTo(vectorB)`.
|
|
216299
216315
|
* * `vectorW` does not have to be perpendicular to the plane.
|
|
216300
216316
|
* * Use `planarRadiansTo` to measure the angle between vectors that are projected to another plane.
|
|
@@ -216302,6 +216318,7 @@ class Vector3d extends XYZ {
|
|
|
216302
216318
|
* @param vectorW determines the side of the plane in which the returned angle is measured
|
|
216303
216319
|
*/
|
|
216304
216320
|
signedRadiansTo(vectorB, vectorW) {
|
|
216321
|
+
// A.B = |A||B|cos(theta) and |AxB| = |A||B|sin(theta) so theta = arctan(|AxB|/A.B)
|
|
216305
216322
|
const p = this.crossProduct(vectorB);
|
|
216306
216323
|
const theta = Math.atan2(p.magnitude(), this.dotProduct(vectorB));
|
|
216307
216324
|
if (vectorW.dotProduct(p) < 0.0)
|
|
@@ -216995,6 +217012,25 @@ class Point3dArray {
|
|
|
216995
217012
|
}
|
|
216996
217013
|
return result;
|
|
216997
217014
|
}
|
|
217015
|
+
/**
|
|
217016
|
+
* Copy 3d points into a packed number array.
|
|
217017
|
+
* @param data array of xyz
|
|
217018
|
+
* @param result optional destination array.
|
|
217019
|
+
* @return packed number array
|
|
217020
|
+
*/
|
|
217021
|
+
static packToNumberArray(data, result) {
|
|
217022
|
+
const numValues = 3 * data.length;
|
|
217023
|
+
if (!result)
|
|
217024
|
+
result = Array(numValues);
|
|
217025
|
+
result.length = numValues;
|
|
217026
|
+
let i = 0;
|
|
217027
|
+
for (const p of data) {
|
|
217028
|
+
result[i++] = p.x;
|
|
217029
|
+
result[i++] = p.y;
|
|
217030
|
+
result[i++] = p.z;
|
|
217031
|
+
}
|
|
217032
|
+
return result;
|
|
217033
|
+
}
|
|
216998
217034
|
/**
|
|
216999
217035
|
* Compute the 8 weights of trilinear mapping
|
|
217000
217036
|
* By appropriate choice of weights, this can be used for both point and derivative mappings.
|
|
@@ -232153,7 +232189,7 @@ var AuxChannelDataType;
|
|
|
232153
232189
|
* @public
|
|
232154
232190
|
*/
|
|
232155
232191
|
class AuxChannelData {
|
|
232156
|
-
/**
|
|
232192
|
+
/** Constructor. If `values` is a number array, it is captured. */
|
|
232157
232193
|
constructor(input, values) {
|
|
232158
232194
|
this.input = input;
|
|
232159
232195
|
if (values instanceof Float64Array) {
|
|
@@ -232185,7 +232221,7 @@ class AuxChannelData {
|
|
|
232185
232221
|
* @public
|
|
232186
232222
|
*/
|
|
232187
232223
|
class AuxChannel {
|
|
232188
|
-
/**
|
|
232224
|
+
/** Constructor with CAPTURED inputs. */
|
|
232189
232225
|
constructor(data, dataType, name, inputName) {
|
|
232190
232226
|
this.data = data;
|
|
232191
232227
|
this.dataType = dataType;
|
|
@@ -232211,15 +232247,23 @@ class AuxChannel {
|
|
|
232211
232247
|
return false;
|
|
232212
232248
|
return true;
|
|
232213
232249
|
}
|
|
232214
|
-
/** True if
|
|
232250
|
+
/** True if the data type is 1-dimensional. */
|
|
232251
|
+
static isScalar(dataType) {
|
|
232252
|
+
return dataType === AuxChannelDataType.Distance || dataType === AuxChannelDataType.Scalar;
|
|
232253
|
+
}
|
|
232254
|
+
/** True if the data stored in this AuxChannel is 1-dimensional. */
|
|
232215
232255
|
get isScalar() {
|
|
232216
|
-
return
|
|
232256
|
+
return AuxChannel.isScalar(this.dataType);
|
|
232257
|
+
}
|
|
232258
|
+
/** The dimension (1D or 3D) of each datum of an AuxChannel of the given type. */
|
|
232259
|
+
static entriesPerValue(dataType) {
|
|
232260
|
+
return this.isScalar(dataType) ? 1 : 3;
|
|
232217
232261
|
}
|
|
232218
|
-
/** The
|
|
232262
|
+
/** The dimension (1D or 3D) of each datum in the data arrays of this AuxChannel. */
|
|
232219
232263
|
get entriesPerValue() {
|
|
232220
|
-
return this.
|
|
232264
|
+
return AuxChannel.entriesPerValue(this.dataType);
|
|
232221
232265
|
}
|
|
232222
|
-
/** The number of
|
|
232266
|
+
/** The number of data stored in each data array of this AuxChannel, equal to the length of the array divided by `entriesPerValue`. */
|
|
232223
232267
|
get valueCount() {
|
|
232224
232268
|
return 0 === this.data.length ? 0 : this.data[0].values.length / this.entriesPerValue;
|
|
232225
232269
|
}
|
|
@@ -232249,16 +232293,20 @@ class AuxChannel {
|
|
|
232249
232293
|
return result;
|
|
232250
232294
|
}
|
|
232251
232295
|
}
|
|
232252
|
-
/**
|
|
232296
|
+
/**
|
|
232297
|
+
* The `PolyfaceAuxData` structure contains one or more analytical data channels for each vertex of a [[Polyface]], allowing the polyface to be styled
|
|
232253
232298
|
* using an [AnalysisStyle]($common).
|
|
232254
|
-
* Typically a polyface will contain only vertex data required for its basic display:
|
|
232255
|
-
*
|
|
232256
|
-
*
|
|
232257
|
-
*
|
|
232299
|
+
* Typically a polyface will contain only vertex data required for its basic display: vertex position, normal, texture parameter, color.
|
|
232300
|
+
* `PolyfaceAuxData` provides supplemental per-vertex data that is generally computed in an analysis program or other external data source.
|
|
232301
|
+
* 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]].
|
|
232302
|
+
* All data channels are indexed by the same indices, which must have the same length and structure as the other Polyface indices.
|
|
232303
|
+
* 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]
|
|
232304
|
+
* locates the data for this facet in all the other Polyface index arrays, including the `PolyfaceAuxData` indices.
|
|
232258
232305
|
* @see [[PolyfaceData.auxData]] to associate auxiliary data with a polyface.
|
|
232259
232306
|
* @public
|
|
232260
232307
|
*/
|
|
232261
232308
|
class PolyfaceAuxData {
|
|
232309
|
+
/** Constructor with CAPTURED inputs. */
|
|
232262
232310
|
constructor(channels, indices) {
|
|
232263
232311
|
this.channels = channels;
|
|
232264
232312
|
this.indices = indices;
|
|
@@ -233780,7 +233828,8 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
|
|
|
233780
233828
|
* * Example: suppose `[6,7,8]` is the pointIndex array representing a triangle. First edge would be `6,7`. Second
|
|
233781
233829
|
* 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.
|
|
233782
233830
|
* Therefore, it is useful to store `6` at the end of pointIndex array, i.e., `[6,7,8,6]` meaning `numWrap = 1`.
|
|
233783
|
-
*
|
|
233831
|
+
* Continuing this example, `numWrap = 2` (i.e., `[6,7,8,6,7]`) is useful when each vertex visit requires the next
|
|
233832
|
+
* two points, e.g., to form two adjacent vectors for a cross product.
|
|
233784
233833
|
*/
|
|
233785
233834
|
setNumWrap(numWrap) {
|
|
233786
233835
|
this._numWrap = numWrap;
|
|
@@ -234434,11 +234483,38 @@ class IndexedPolyface extends Polyface {
|
|
|
234434
234483
|
cleanupOpenFacet() {
|
|
234435
234484
|
this.data.trimAllIndexArrays(this.data.pointIndex.length);
|
|
234436
234485
|
}
|
|
234486
|
+
/**
|
|
234487
|
+
* Validate (the tail of) the active index arrays: point, normal, param, color.
|
|
234488
|
+
* @param index0 optional offset into the index arrays at which to start validating indices. Default 0.
|
|
234489
|
+
* @param errors optional array appended with error message(s) if invalid indices are encountered
|
|
234490
|
+
* @return whether the indices are valid
|
|
234491
|
+
*/
|
|
234492
|
+
validateAllIndices(index0 = 0, errors) {
|
|
234493
|
+
const numPointIndices = this.data.pointIndex.length;
|
|
234494
|
+
const messages = errors ?? [];
|
|
234495
|
+
if (this.data.normalIndex && this.data.normalIndex.length !== numPointIndices)
|
|
234496
|
+
messages.push("normalIndex count must match pointIndex count");
|
|
234497
|
+
if (this.data.paramIndex && this.data.paramIndex.length !== numPointIndices)
|
|
234498
|
+
messages.push("paramIndex count must equal pointIndex count");
|
|
234499
|
+
if (this.data.colorIndex && this.data.colorIndex.length !== numPointIndices)
|
|
234500
|
+
messages.push("colorIndex count must equal pointIndex count");
|
|
234501
|
+
if (this.data.edgeVisible.length !== numPointIndices)
|
|
234502
|
+
messages.push("visibleIndex count must equal pointIndex count");
|
|
234503
|
+
if (!Polyface.areIndicesValid(this.data.pointIndex, index0, numPointIndices, this.data.point, this.data.point ? this.data.point.length : 0))
|
|
234504
|
+
messages.push("invalid point indices in the last facet");
|
|
234505
|
+
if (!Polyface.areIndicesValid(this.data.normalIndex, index0, numPointIndices, this.data.normal, this.data.normal ? this.data.normal.length : 0))
|
|
234506
|
+
messages.push("invalid normal indices in the last facet");
|
|
234507
|
+
if (!Polyface.areIndicesValid(this.data.paramIndex, index0, numPointIndices, this.data.param, this.data.param ? this.data.param.length : 0))
|
|
234508
|
+
messages.push("invalid param indices in the last facet");
|
|
234509
|
+
if (!Polyface.areIndicesValid(this.data.colorIndex, index0, numPointIndices, this.data.color, this.data.color ? this.data.color.length : 0))
|
|
234510
|
+
messages.push("invalid color indices in the last facet");
|
|
234511
|
+
return 0 === messages.length;
|
|
234512
|
+
}
|
|
234437
234513
|
/**
|
|
234438
234514
|
* Announce the end of construction of a facet.
|
|
234439
234515
|
* * Optionally check for:
|
|
234440
234516
|
* * Same number of indices among all active index arrays -- point, normal, param, color
|
|
234441
|
-
* * All indices are within bounds of the respective data arrays.
|
|
234517
|
+
* * All indices for the latest facet are within bounds of the respective data arrays.
|
|
234442
234518
|
* * In error cases, all index arrays are trimmed back to the size when previous facet was terminated.
|
|
234443
234519
|
* * A return value of `undefined` is normal. Otherwise, a string array of error messages is returned.
|
|
234444
234520
|
*/
|
|
@@ -234452,22 +234528,7 @@ class IndexedPolyface extends Polyface {
|
|
|
234452
234528
|
const messages = [];
|
|
234453
234529
|
if (lengthB < lengthA + 2)
|
|
234454
234530
|
messages.push("Less than 3 indices in the last facet");
|
|
234455
|
-
|
|
234456
|
-
messages.push("normalIndex count must match pointIndex count");
|
|
234457
|
-
if (this.data.paramIndex && this.data.paramIndex.length !== lengthB)
|
|
234458
|
-
messages.push("paramIndex count must equal pointIndex count");
|
|
234459
|
-
if (this.data.colorIndex && this.data.colorIndex.length !== lengthB)
|
|
234460
|
-
messages.push("colorIndex count must equal pointIndex count");
|
|
234461
|
-
if (this.data.edgeVisible.length !== lengthB)
|
|
234462
|
-
messages.push("visibleIndex count must equal pointIndex count");
|
|
234463
|
-
if (!Polyface.areIndicesValid(this.data.pointIndex, lengthA, lengthB, this.data.point, this.data.point ? this.data.point.length : 0))
|
|
234464
|
-
messages.push("invalid point indices in the last facet");
|
|
234465
|
-
if (!Polyface.areIndicesValid(this.data.normalIndex, lengthA, lengthB, this.data.normal, this.data.normal ? this.data.normal.length : 0))
|
|
234466
|
-
messages.push("invalid normal indices in the last facet");
|
|
234467
|
-
if (!Polyface.areIndicesValid(this.data.paramIndex, lengthA, lengthB, this.data.param, this.data.param ? this.data.param.length : 0))
|
|
234468
|
-
messages.push("invalid param indices in the last facet");
|
|
234469
|
-
if (!Polyface.areIndicesValid(this.data.colorIndex, lengthA, lengthB, this.data.color, this.data.color ? this.data.color.length : 0))
|
|
234470
|
-
messages.push("invalid color indices in the last facet");
|
|
234531
|
+
this.validateAllIndices(lengthA, messages);
|
|
234471
234532
|
if (messages.length > 0) {
|
|
234472
234533
|
this.data.trimAllIndexArrays(lengthA);
|
|
234473
234534
|
return messages;
|
|
@@ -237699,10 +237760,11 @@ class PolyfaceData {
|
|
|
237699
237760
|
}
|
|
237700
237761
|
/**
|
|
237701
237762
|
* Compress the instance by equating duplicate data.
|
|
237702
|
-
* * Search for duplicates within
|
|
237763
|
+
* * Search for duplicates within vertices, normals, params, and colors.
|
|
237703
237764
|
* * Compress each data array.
|
|
237704
237765
|
* * Revise all indexing for the relocated data.
|
|
237705
|
-
*
|
|
237766
|
+
* * [[PolyfaceAuxData]] is compressed if and only if exactly one [[AuxChannelData]] is present.
|
|
237767
|
+
* @param tolerance (optional) tolerance for clustering mesh vertices only. Default value, and the tolerance used to cluster all other data, is [[Geometry.smallMetricDistance]].
|
|
237706
237768
|
*/
|
|
237707
237769
|
compress(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.smallMetricDistance) {
|
|
237708
237770
|
// more info can be found at geometry/internaldocs/Polyface.md
|
|
@@ -237725,6 +237787,20 @@ class PolyfaceData {
|
|
|
237725
237787
|
this.color = packedColors.packedNumbers;
|
|
237726
237788
|
packedColors.updateIndices(this.colorIndex);
|
|
237727
237789
|
}
|
|
237790
|
+
if (this.auxData && this.auxData.channels.length === 1 && this.auxData.channels[0].data.length === 1) {
|
|
237791
|
+
const dataSize = this.auxData.channels[0].entriesPerValue;
|
|
237792
|
+
if (1 === dataSize) {
|
|
237793
|
+
const packedData = _numerics_ClusterableArray__WEBPACK_IMPORTED_MODULE_9__.ClusterableArray.clusterNumberArray(this.auxData.channels[0].data[0].values);
|
|
237794
|
+
this.auxData.channels[0].data[0].values = packedData.packedNumbers;
|
|
237795
|
+
packedData.updateIndices(this.auxData.indices);
|
|
237796
|
+
}
|
|
237797
|
+
else if (3 === dataSize) {
|
|
237798
|
+
const blockedData = _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_0__.GrowableXYZArray.create(this.auxData.channels[0].data[0].values);
|
|
237799
|
+
const packedData = _numerics_ClusterableArray__WEBPACK_IMPORTED_MODULE_9__.ClusterableArray.clusterGrowablePoint3dArray(blockedData);
|
|
237800
|
+
this.auxData.channels[0].data[0].values = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.NumberArray.create(packedData.growablePackedPoints.float64Data());
|
|
237801
|
+
packedData.updateIndices(this.auxData.indices);
|
|
237802
|
+
}
|
|
237803
|
+
}
|
|
237728
237804
|
}
|
|
237729
237805
|
/**
|
|
237730
237806
|
* Test if `facetStartIndex` is (minimally) valid.
|
|
@@ -237937,6 +238013,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
237937
238013
|
* @module Polyface
|
|
237938
238014
|
*/
|
|
237939
238015
|
/* eslint-disable @typescript-eslint/naming-convention, no-empty */
|
|
238016
|
+
// cspell:word internaldocs
|
|
237940
238017
|
|
|
237941
238018
|
|
|
237942
238019
|
|
|
@@ -237979,8 +238056,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
237979
238056
|
* @public
|
|
237980
238057
|
*/
|
|
237981
238058
|
class SweepLineStringToFacetsOptions {
|
|
237982
|
-
/**
|
|
237983
|
-
*/
|
|
238059
|
+
/** Constructor. Captures fully-checked parameters from static create method. */
|
|
237984
238060
|
constructor(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets) {
|
|
237985
238061
|
this.vectorToEye = vectorToEye;
|
|
237986
238062
|
this.sideAngle = sideAngle;
|
|
@@ -237989,20 +238065,27 @@ class SweepLineStringToFacetsOptions {
|
|
|
237989
238065
|
this.collectOnSideFacets = collectOnSideFacets;
|
|
237990
238066
|
this.collectOnRearFacets = collectOnRearFacets;
|
|
237991
238067
|
}
|
|
237992
|
-
/**
|
|
237993
|
-
*
|
|
237994
|
-
* * Default
|
|
237995
|
-
* * Default
|
|
237996
|
-
* * Default
|
|
238068
|
+
/**
|
|
238069
|
+
* Create an options structure.
|
|
238070
|
+
* * Default `vectorToEye` is (0,0,1).
|
|
238071
|
+
* * Default `sideAngle` is `Geometry.smallAngleRadians`.
|
|
238072
|
+
* * Default `assembleChains` is `true`.
|
|
238073
|
+
* * Default `collectOnForwardFacets`, `collectOnSideFacets`, `collectOnRearFacets` are all `true`.
|
|
237997
238074
|
*/
|
|
237998
238075
|
static create(vectorToEye, sideAngle, assembleChains, collectOnForwardFacets, collectOnSideFacets, collectOnRearFacets) {
|
|
237999
238076
|
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));
|
|
238000
238077
|
}
|
|
238001
|
-
/** Return true if all outputs are requested */
|
|
238002
|
-
get collectAll() {
|
|
238003
|
-
|
|
238004
|
-
|
|
238005
|
-
|
|
238078
|
+
/** Return `true` if all outputs are requested. */
|
|
238079
|
+
get collectAll() {
|
|
238080
|
+
return this.collectOnForwardFacets === true &&
|
|
238081
|
+
this.collectOnSideFacets === true &&
|
|
238082
|
+
this.collectOnRearFacets === true;
|
|
238083
|
+
}
|
|
238084
|
+
/**
|
|
238085
|
+
* Decide if the instance collector flags accept a facet with the given normal.
|
|
238086
|
+
* * A facet whose facet normal has a positive, zero, or negative dot product with `vectorToEye` is classified
|
|
238087
|
+
* as forward, side, or rear, respectively.
|
|
238088
|
+
* * `undefined` facet normal returns `false`.
|
|
238006
238089
|
*/
|
|
238007
238090
|
collectFromThisFacetNormal(facetNormal) {
|
|
238008
238091
|
if (facetNormal === undefined)
|
|
@@ -238016,22 +238099,27 @@ class SweepLineStringToFacetsOptions {
|
|
|
238016
238099
|
/**
|
|
238017
238100
|
* Options carrier for [[PolyfaceQuery.cloneOffset]].
|
|
238018
238101
|
* * Default options are strongly recommended.
|
|
238019
|
-
* * The option most likely to be changed is
|
|
238102
|
+
* * The option most likely to be changed is `chamferAngleBetweenNormals`.
|
|
238020
238103
|
* @public
|
|
238021
238104
|
*/
|
|
238022
238105
|
class OffsetMeshOptions {
|
|
238023
|
-
/** Constructor -- CAPTURE parameters
|
|
238024
|
-
constructor(smoothSingleAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(25), smoothAccumulatedAngleBetweenNormals = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(60),
|
|
238106
|
+
/** Constructor -- CAPTURE parameters. */
|
|
238107
|
+
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)) {
|
|
238025
238108
|
this.smoothSingleAngleBetweenNormals = smoothSingleAngleBetweenNormals.clone();
|
|
238026
238109
|
this.smoothAccumulatedAngleBetweenNormals = smoothAccumulatedAngleBetweenNormals.clone();
|
|
238027
|
-
this.chamferAngleBetweenNormals =
|
|
238110
|
+
this.chamferAngleBetweenNormals = chamferAngleBetweenNormals.clone();
|
|
238028
238111
|
}
|
|
238029
|
-
/**
|
|
238112
|
+
/**
|
|
238113
|
+
* Construct and return an `OffsetMeshOptions` with given parameters.
|
|
238030
238114
|
* * Angles are forced to minimum values.
|
|
238031
238115
|
* * Clones of the angles are given to the constructor.
|
|
238032
|
-
* @param smoothSingleRadiansBetweenNormals an angle larger than this (between facets) is considered a sharp edge
|
|
238033
|
-
*
|
|
238034
|
-
* @param
|
|
238116
|
+
* @param smoothSingleRadiansBetweenNormals an angle larger than this (between facets) is considered a sharp edge.
|
|
238117
|
+
* Default value is `25` degrees.
|
|
238118
|
+
* @param smoothAccumulatedAngleBetweenNormals angles that sum to this much may be consolidated for average normal.
|
|
238119
|
+
* Default value is `60` degrees.
|
|
238120
|
+
* @param chamferTurnAngleBetweenNormals when facets meet and the turn angle (i.e., angle between facet normals)
|
|
238121
|
+
* is larger than `chamferTurnAngleBetweenNormals`, a chamfer edge may be added to prevent offset mesh from having
|
|
238122
|
+
* facets that extend out too far away from the source mesh. Default value is `120` degrees.
|
|
238035
238123
|
*/
|
|
238036
238124
|
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)) {
|
|
238037
238125
|
const mySmoothSingleRadiansBetweenNormals = smoothSingleAngleBetweenNormals.clone();
|
|
@@ -238047,25 +238135,27 @@ class OffsetMeshOptions {
|
|
|
238047
238135
|
}
|
|
238048
238136
|
}
|
|
238049
238137
|
/**
|
|
238050
|
-
* Enumeration of cases for retaining facets among duplicates
|
|
238138
|
+
* Enumeration of cases for retaining facets among duplicates.
|
|
238051
238139
|
* @public
|
|
238052
238140
|
*/
|
|
238053
238141
|
var DuplicateFacetClusterSelector;
|
|
238054
238142
|
(function (DuplicateFacetClusterSelector) {
|
|
238055
|
-
/**
|
|
238143
|
+
/** Retain none of the duplicates. */
|
|
238056
238144
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectNone"] = 0] = "SelectNone";
|
|
238057
|
-
/**
|
|
238145
|
+
/** Retain any one member among duplicates. */
|
|
238058
238146
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectAny"] = 1] = "SelectAny";
|
|
238059
|
-
/**
|
|
238147
|
+
/** Retain all members among duplicates. */
|
|
238060
238148
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectAll"] = 2] = "SelectAll";
|
|
238061
|
-
/**
|
|
238149
|
+
/** Retain one from any cluster with an odd number of faces. */
|
|
238062
238150
|
DuplicateFacetClusterSelector[DuplicateFacetClusterSelector["SelectOneByParity"] = 3] = "SelectOneByParity";
|
|
238063
238151
|
})(DuplicateFacetClusterSelector || (DuplicateFacetClusterSelector = {}));
|
|
238064
|
-
/**
|
|
238152
|
+
/**
|
|
238153
|
+
* PolyfaceQuery is a static class whose methods implement queries on a `Polyface` or `PolyfaceVisitor` provided as a
|
|
238154
|
+
* parameter to each method.
|
|
238065
238155
|
* @public
|
|
238066
238156
|
*/
|
|
238067
238157
|
class PolyfaceQuery {
|
|
238068
|
-
/**
|
|
238158
|
+
/** Copy the points from a visitor into a linestring loop. */
|
|
238069
238159
|
static visitorToLoop(visitor) {
|
|
238070
238160
|
const ls = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_3__.LineString3d.createPoints(visitor.point.getPoint3dArray());
|
|
238071
238161
|
return _curve_Loop__WEBPACK_IMPORTED_MODULE_4__.Loop.create(ls);
|
|
@@ -238080,11 +238170,15 @@ class PolyfaceQuery {
|
|
|
238080
238170
|
}
|
|
238081
238171
|
return result;
|
|
238082
238172
|
}
|
|
238083
|
-
/**
|
|
238084
|
-
*
|
|
238085
|
-
|
|
238173
|
+
/**
|
|
238174
|
+
* Sum all facet areas.
|
|
238175
|
+
* @param source polyface or visitor.
|
|
238176
|
+
* @param vectorToEye compute sum of (signed) facet areas projected to a view plane perpendicular to `vectorToEye`.
|
|
238177
|
+
* If `vectorToEye` is not provided, actual facet areas are calculated (without any projection).
|
|
238178
|
+
* @returns the sum of all facet areas. Return 0 if `source` is `undefined`.
|
|
238179
|
+
*/
|
|
238086
238180
|
static sumFacetAreas(source, vectorToEye) {
|
|
238087
|
-
let
|
|
238181
|
+
let sum = 0;
|
|
238088
238182
|
if (source !== undefined) {
|
|
238089
238183
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
238090
238184
|
return PolyfaceQuery.sumFacetAreas(source.createVisitor(1), vectorToEye);
|
|
@@ -238093,20 +238187,21 @@ class PolyfaceQuery {
|
|
|
238093
238187
|
unitVectorToEye = vectorToEye.normalize();
|
|
238094
238188
|
source.reset();
|
|
238095
238189
|
while (source.moveToNextFacet()) {
|
|
238096
|
-
const
|
|
238097
|
-
|
|
238190
|
+
const areaNormal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.areaNormal(source.point.getPoint3dArray());
|
|
238191
|
+
sum += unitVectorToEye ? areaNormal.dotProduct(unitVectorToEye) : areaNormal.magnitude();
|
|
238098
238192
|
}
|
|
238099
238193
|
}
|
|
238100
|
-
return
|
|
238194
|
+
return sum;
|
|
238101
238195
|
}
|
|
238102
|
-
/**
|
|
238103
|
-
*
|
|
238196
|
+
/**
|
|
238197
|
+
* Sum volumes of tetrahedra from origin to all facets.
|
|
238198
|
+
* * If origin is `undefined`, the first point encountered (by the visitor) is used as origin.
|
|
238104
238199
|
* * If the mesh is closed, this sum is the volume.
|
|
238105
|
-
* * If the mesh is not closed, this sum is the volume of a mesh with various additional facets
|
|
238106
|
-
*
|
|
238107
|
-
|
|
238200
|
+
* * If the mesh is not closed, this sum is the volume of a mesh with various additional facets from the origin
|
|
238201
|
+
* to facets.
|
|
238202
|
+
*/
|
|
238108
238203
|
static sumTetrahedralVolumes(source, origin) {
|
|
238109
|
-
let
|
|
238204
|
+
let sum = 0;
|
|
238110
238205
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
238111
238206
|
return PolyfaceQuery.sumTetrahedralVolumes(source.createVisitor(0), origin);
|
|
238112
238207
|
let myOrigin = origin;
|
|
@@ -238121,17 +238216,18 @@ class PolyfaceQuery {
|
|
|
238121
238216
|
for (let i = 1; i + 1 < source.point.length; i++) {
|
|
238122
238217
|
source.point.getPoint3dAtUncheckedPointIndex(i, targetA);
|
|
238123
238218
|
source.point.getPoint3dAtUncheckedPointIndex(i + 1, targetB);
|
|
238124
|
-
|
|
238219
|
+
sum += myOrigin.tripleProductToPoints(facetOrigin, targetA, targetB);
|
|
238125
238220
|
}
|
|
238126
238221
|
}
|
|
238127
|
-
return
|
|
238222
|
+
return sum / 6.0;
|
|
238128
238223
|
}
|
|
238129
|
-
/**
|
|
238224
|
+
/**
|
|
238225
|
+
* Sum (signed) volumes between facets and a plane.
|
|
238130
238226
|
* Return a structure with multiple sums:
|
|
238131
238227
|
* * volume = the sum of (signed) volumes between facets and the plane.
|
|
238132
|
-
* *
|
|
238133
|
-
*
|
|
238134
|
-
|
|
238228
|
+
* * positiveProjectedFacetAreaMoments, negativeProjectedFacetAreaMoments = moment data with centroid, area, and second
|
|
238229
|
+
* moments with respect to the centroid.
|
|
238230
|
+
*/
|
|
238135
238231
|
static sumVolumeBetweenFacetsAndPlane(source, plane) {
|
|
238136
238232
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
238137
238233
|
return PolyfaceQuery.sumVolumeBetweenFacetsAndPlane(source.createVisitor(0), plane);
|
|
@@ -238149,18 +238245,18 @@ class PolyfaceQuery {
|
|
|
238149
238245
|
const singleFacetProducts = _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__.Matrix4d.createZero();
|
|
238150
238246
|
const projectToPlane = plane.getProjectionToPlane();
|
|
238151
238247
|
source.reset();
|
|
238152
|
-
// For each facet
|
|
238153
|
-
//
|
|
238154
|
-
//
|
|
238155
|
-
// each
|
|
238156
|
-
// each volume contribution is
|
|
238248
|
+
// For each facet:
|
|
238249
|
+
// - form triangles from facet origin to each far edge.
|
|
238250
|
+
// - sum signed area and volume contributions.
|
|
238251
|
+
// each projected area contribution is twice the area of a triangle.
|
|
238252
|
+
// each volume contribution is 3 times the actual volume -- (1/3) of the altitude sums was the centroid altitude.
|
|
238157
238253
|
while (source.moveToNextFacet()) {
|
|
238158
238254
|
source.point.getPoint3dAtUncheckedPointIndex(0, facetOrigin);
|
|
238159
238255
|
h0 = plane.altitude(facetOrigin);
|
|
238160
238256
|
singleFacetArea = 0;
|
|
238161
238257
|
// within a single facets, the singleFacetArea sum is accumulated with signs of individual triangles.
|
|
238162
|
-
//
|
|
238163
|
-
//
|
|
238258
|
+
// for a non-convex facet, this can be a mixture of positive and negative areas.
|
|
238259
|
+
// the absoluteProjectedAreaSum contribution is forced positive after the sum for the facet.
|
|
238164
238260
|
for (let i = 1; i + 1 < source.point.length; i++) {
|
|
238165
238261
|
source.point.getPoint3dAtUncheckedPointIndex(i, targetA);
|
|
238166
238262
|
source.point.getPoint3dAtUncheckedPointIndex(i + 1, targetB);
|
|
@@ -238191,7 +238287,7 @@ class PolyfaceQuery {
|
|
|
238191
238287
|
negativeProjectedFacetAreaMoments: negativeAreaMoments,
|
|
238192
238288
|
};
|
|
238193
238289
|
}
|
|
238194
|
-
/** Return the inertia products [xx,xy,xz,xw,
|
|
238290
|
+
/** Return the inertia products [xx,xy,xz,xw,yw, etc] integrated over all all facets as viewed from origin. */
|
|
238195
238291
|
static sumFacetSecondAreaMomentProducts(source, origin) {
|
|
238196
238292
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
238197
238293
|
return PolyfaceQuery.sumFacetSecondAreaMomentProducts(source.createVisitor(0), origin);
|
|
@@ -238202,7 +238298,7 @@ class PolyfaceQuery {
|
|
|
238202
238298
|
}
|
|
238203
238299
|
return products;
|
|
238204
238300
|
}
|
|
238205
|
-
/** Return the inertia products [xx,xy,xz,xw,
|
|
238301
|
+
/** Return the inertia products [xx,xy,xz,xw,yw, etc] integrated over all tetrahedral volumes from origin. */
|
|
238206
238302
|
static sumFacetSecondVolumeMomentProducts(source, origin) {
|
|
238207
238303
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
238208
238304
|
return PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source.createVisitor(0), origin);
|
|
@@ -238213,10 +238309,11 @@ class PolyfaceQuery {
|
|
|
238213
238309
|
}
|
|
238214
238310
|
return products;
|
|
238215
238311
|
}
|
|
238216
|
-
/**
|
|
238217
|
-
*
|
|
238218
|
-
* *
|
|
238219
|
-
* *
|
|
238312
|
+
/**
|
|
238313
|
+
* Compute area moments for the mesh. In the returned `MomentData`:
|
|
238314
|
+
* * `origin` is the centroid.
|
|
238315
|
+
* * `localToWorldMap` has the origin and principal directions.
|
|
238316
|
+
* * `radiiOfGyration` radii for rotation around the x,y,z axes.
|
|
238220
238317
|
*/
|
|
238221
238318
|
static computePrincipalAreaMoments(source) {
|
|
238222
238319
|
const origin = source.data.getPoint(0);
|
|
@@ -238225,12 +238322,13 @@ class PolyfaceQuery {
|
|
|
238225
238322
|
const inertiaProducts = PolyfaceQuery.sumFacetSecondAreaMomentProducts(source, origin);
|
|
238226
238323
|
return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
|
|
238227
238324
|
}
|
|
238228
|
-
/**
|
|
238229
|
-
*
|
|
238230
|
-
* *
|
|
238231
|
-
* *
|
|
238325
|
+
/**
|
|
238326
|
+
* Compute area moments for the mesh. In the returned MomentData:
|
|
238327
|
+
* * `origin` is the centroid.
|
|
238328
|
+
* * `localToWorldMap` has the origin and principal directions.
|
|
238329
|
+
* * `radiiOfGyration` radii for rotation around the x,y,z axes.
|
|
238232
238330
|
* * The result is only valid if the mesh is closed.
|
|
238233
|
-
* * There is no test for closure.
|
|
238331
|
+
* * There is no test for closure. Use `PolyfaceQuery.isPolyfaceClosedByEdgePairing(polyface)` to test for closure.
|
|
238234
238332
|
*/
|
|
238235
238333
|
static computePrincipalVolumeMoments(source) {
|
|
238236
238334
|
const origin = source.data.getPoint(0);
|
|
@@ -238239,8 +238337,10 @@ class PolyfaceQuery {
|
|
|
238239
238337
|
const inertiaProducts = PolyfaceQuery.sumFacetSecondVolumeMomentProducts(source, origin);
|
|
238240
238338
|
return _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__.MomentData.inertiaProductsToPrincipalAxes(origin, inertiaProducts);
|
|
238241
238339
|
}
|
|
238242
|
-
/**
|
|
238243
|
-
*
|
|
238340
|
+
/**
|
|
238341
|
+
* Determine whether all facets are convex.
|
|
238342
|
+
* @param source polyface or visitor.
|
|
238343
|
+
* @returns `true` if all facets are convex; `false` otherwise.
|
|
238244
238344
|
*/
|
|
238245
238345
|
static areFacetsConvex(source) {
|
|
238246
238346
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -238256,56 +238356,50 @@ class PolyfaceQuery {
|
|
|
238256
238356
|
return true;
|
|
238257
238357
|
}
|
|
238258
238358
|
/**
|
|
238259
|
-
*
|
|
238260
|
-
* *
|
|
238261
|
-
*
|
|
238262
|
-
*
|
|
238263
|
-
*
|
|
238264
|
-
*
|
|
238265
|
-
*
|
|
238266
|
-
*
|
|
238267
|
-
*
|
|
238268
|
-
*
|
|
238269
|
-
*
|
|
238359
|
+
* Compute a number summarizing the dihedral angles in the mesh.
|
|
238360
|
+
* * A dihedral angle is the signed angle between adjacent facets' normals. This angle is positive when the cross
|
|
238361
|
+
* product `normalA x normalB` has the same direction as facetA's traversal of the facets' shared edge.
|
|
238362
|
+
* @param source mesh.
|
|
238363
|
+
* @param ignoreBoundaries if `true` ignore simple boundary edges, i.e., allow unclosed meshes. Default is `false`.
|
|
238364
|
+
* See [[isConvexByDihedralAngleCount]] for comments about passing true when there are multiple
|
|
238365
|
+
* connected components.
|
|
238366
|
+
* * Return `0` if all dihedral angles are zero (and `ignoreBoundaries === true`). The mesh is planar.
|
|
238367
|
+
* * Otherwise, return `1` if all dihedral angles are non-negative. The mesh probably encloses a convex volume and
|
|
238368
|
+
* has outward normals.
|
|
238369
|
+
* * Otherwise, return `-1` if all dihedral angles are non-positive. The mesh probably encloses a convex volume and
|
|
238370
|
+
* has inward normals.
|
|
238371
|
+
* * Otherwise, return `-2`. Also return `-2` if a non-manifold condition was detected, or a facet normal could not
|
|
238372
|
+
* be computed. A non-manifold condition is a positive-length edge adjacent to more than 2 facets or (if
|
|
238373
|
+
* `ignoreBoundaries` is false) adjacent to exactly one facet.
|
|
238270
238374
|
*/
|
|
238271
|
-
static isConvexByDihedralAngleCount(source, ignoreBoundaries = false) {
|
|
238272
|
-
return this.dihedralAngleSummary(source, ignoreBoundaries) > 0;
|
|
238273
|
-
}
|
|
238274
|
-
/**
|
|
238275
|
-
* Compute a number summarizing the dihedral angles in the mesh.
|
|
238276
|
-
* @see [[isConvexByDihedralAngleCount]] for comments about ignoreBoundaries===true when there are multiple connected components.
|
|
238277
|
-
* @param source mesh to examine
|
|
238278
|
-
* @param ignoreBoundaries if true, ignore simple boundary edges, i.e. allow unclosed meshes.
|
|
238279
|
-
* @returns a number summarizing the dihedral angles in the mesh.
|
|
238280
|
-
* * Return 1 if all angles are positive or planar. The mesh is probably convex with outward normals.
|
|
238281
|
-
* * Return -1 if all angles are negative or planar. The mesh is probably convex with inward normals.
|
|
238282
|
-
* * Return 0 if
|
|
238283
|
-
* * angles area mixed
|
|
238284
|
-
* * any edge has other than 1 incident facet or more than 2 incident facets.
|
|
238285
|
-
* * (but null edges are permitted -- These occur naturally at edges of quads at north or south pole)
|
|
238286
|
-
*/
|
|
238287
238375
|
static dihedralAngleSummary(source, ignoreBoundaries = false) {
|
|
238376
|
+
// more info can be found at geometry/internaldocs/Polyface.md
|
|
238288
238377
|
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
|
|
238289
238378
|
const visitor = source.createVisitor(1);
|
|
238290
238379
|
visitor.reset();
|
|
238380
|
+
// find centroid normals of all facets
|
|
238291
238381
|
const centroidNormal = [];
|
|
238292
238382
|
let normalCounter = 0;
|
|
238293
238383
|
while (visitor.moveToNextFacet()) {
|
|
238294
238384
|
const numEdges = visitor.pointCount - 1;
|
|
238295
238385
|
const normal = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_7__.PolygonOps.centroidAreaNormal(visitor.point);
|
|
238296
238386
|
if (normal === undefined)
|
|
238297
|
-
return
|
|
238387
|
+
return -2;
|
|
238298
238388
|
centroidNormal.push(normal);
|
|
238299
238389
|
for (let i = 0; i < numEdges; i++) {
|
|
238300
238390
|
edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), normalCounter);
|
|
238301
238391
|
}
|
|
238302
238392
|
normalCounter++;
|
|
238303
238393
|
}
|
|
238394
|
+
// find "manifold clusters" and "bad clusters"
|
|
238395
|
+
// manifold clusters are edges adjacent to 2 facets
|
|
238396
|
+
// bad clusters are edges adjacent to more than 2 facets or (if ignoreBoundaries is false) adjacent to 1 facet
|
|
238304
238397
|
const badClusters = [];
|
|
238305
238398
|
const manifoldClusters = [];
|
|
238306
238399
|
edges.sortAndCollectClusters(manifoldClusters, ignoreBoundaries ? undefined : badClusters, undefined, badClusters);
|
|
238307
238400
|
if (badClusters.length > 0)
|
|
238308
|
-
return
|
|
238401
|
+
return -2;
|
|
238402
|
+
// find angle between facet centroid normals (dihedral angles)
|
|
238309
238403
|
let numPositive = 0;
|
|
238310
238404
|
let numPlanar = 0;
|
|
238311
238405
|
let numNegative = 0;
|
|
@@ -238313,8 +238407,7 @@ class PolyfaceQuery {
|
|
|
238313
238407
|
for (const cluster of manifoldClusters) {
|
|
238314
238408
|
const sideA = cluster[0];
|
|
238315
238409
|
const sideB = cluster[1];
|
|
238316
|
-
if (sideA instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge
|
|
238317
|
-
&& sideB instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge
|
|
238410
|
+
if (sideA instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge && sideB instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge
|
|
238318
238411
|
&& source.data.point.vectorIndexIndex(sideA.vertexIndexA, sideA.vertexIndexB, edgeVector)) {
|
|
238319
238412
|
const dihedralAngle = centroidNormal[sideA.facetIndex].direction.signedAngleTo(centroidNormal[sideB.facetIndex].direction, edgeVector);
|
|
238320
238413
|
if (dihedralAngle.isAlmostZero)
|
|
@@ -238325,26 +238418,40 @@ class PolyfaceQuery {
|
|
|
238325
238418
|
numNegative++;
|
|
238326
238419
|
}
|
|
238327
238420
|
}
|
|
238421
|
+
// categorize the mesh
|
|
238328
238422
|
if (numPositive > 0 && numNegative === 0)
|
|
238329
238423
|
return 1;
|
|
238330
238424
|
if (numNegative > 0 && numPositive === 0)
|
|
238331
238425
|
return -1;
|
|
238332
|
-
|
|
238333
|
-
|
|
238334
|
-
|
|
238335
|
-
|
|
238426
|
+
if (numPlanar > 0 && numPositive === 0 && numNegative === 0) // planar mesh
|
|
238427
|
+
return 0;
|
|
238428
|
+
return -2;
|
|
238429
|
+
}
|
|
238430
|
+
/**
|
|
238431
|
+
* Test for convex volume by dihedral angle tests on all edges.
|
|
238432
|
+
* * This tests if all dihedral angles of the mesh are positive.
|
|
238433
|
+
* * In a closed solid, this is a strong test for overall mesh convexity with outward facing normals.
|
|
238434
|
+
* * See [[dihedralAngleSummary]] for the definition of "dihedral angle".
|
|
238435
|
+
* * With `ignoreBoundaries` true, this may be a useful test when all the facets are in a single edge-connected
|
|
238436
|
+
* component, such as a pyramid with no underside.
|
|
238437
|
+
* * It is not a correct test if there are multiple, disjoint components.
|
|
238438
|
+
* * Take the above-mentioned pyramid with no underside.
|
|
238439
|
+
* * Within the same mesh, have a second pyramid placed to the side, still facing upward.
|
|
238440
|
+
* * The angles will pass the dihedral convexity test, but the composite thing surely is not convex.
|
|
238441
|
+
* @param source mesh.
|
|
238442
|
+
* @param ignoreBoundaries if `true` ignore simple boundary edges, i.e., allow unclosed meshes. Default is `false`.
|
|
238443
|
+
* @returns true if all dihedral angles of the mesh are positive.
|
|
238444
|
+
*/
|
|
238445
|
+
static isConvexByDihedralAngleCount(source, ignoreBoundaries = false) {
|
|
238446
|
+
return this.dihedralAngleSummary(source, ignoreBoundaries) > 0;
|
|
238336
238447
|
}
|
|
238337
238448
|
/**
|
|
238338
|
-
* Test
|
|
238339
|
-
|
|
238340
|
-
|
|
238341
|
-
|
|
238342
|
-
|
|
238343
|
-
|
|
238344
|
-
* * for `allowSimpleBoundaries === false` true return means this is a closed 2-manifold surface
|
|
238345
|
-
* * for `allowSimpleBoundaries === true` true means this is a 2-manifold surface which may have boundary, but is still properly matched internally.
|
|
238346
|
-
* * Any edge with 3 or more incident facets triggers `false` return.
|
|
238347
|
-
* * Any edge with 2 incident facets in the same direction triggers a `false` return.
|
|
238449
|
+
* Test edges pairing in `source` mesh.
|
|
238450
|
+
* * For `allowSimpleBoundaries === false` true return means this is a closed 2-manifold surface.
|
|
238451
|
+
* * For `allowSimpleBoundaries === true` true means this is a 2-manifold surface which may have boundary, but is
|
|
238452
|
+
* still properly matched internally.
|
|
238453
|
+
* * Any edge with 3 or more adjacent facets triggers `false` return.
|
|
238454
|
+
* * Any edge with 2 adjacent facets in the same direction triggers a `false` return.
|
|
238348
238455
|
*/
|
|
238349
238456
|
static isPolyfaceManifold(source, allowSimpleBoundaries = false) {
|
|
238350
238457
|
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
|
|
@@ -238360,44 +238467,18 @@ class PolyfaceQuery {
|
|
|
238360
238467
|
edges.sortAndCollectClusters(undefined, allowSimpleBoundaries ? undefined : badClusters, undefined, badClusters);
|
|
238361
238468
|
return badClusters.length === 0;
|
|
238362
238469
|
}
|
|
238363
|
-
/**
|
|
238364
|
-
|
|
238365
|
-
|
|
238366
|
-
* @param source polyface or visitor
|
|
238367
|
-
* @param includeTypical true to in include typical boundary edges with a single incident facet
|
|
238368
|
-
* @param includeMismatch true to include edges with more than 2 incident facets
|
|
238369
|
-
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
238370
|
-
*/
|
|
238371
|
-
static boundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
238372
|
-
const result = new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_5__.BagOfCurves();
|
|
238373
|
-
const announceEdge = (pointA, pointB, _indexA, _indexB, _readIndex) => {
|
|
238374
|
-
result.tryAddChild(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(pointA, pointB));
|
|
238375
|
-
};
|
|
238376
|
-
PolyfaceQuery.announceBoundaryEdges(source, announceEdge, includeTypical, includeMismatch, includeNull);
|
|
238377
|
-
if (result.children.length === 0)
|
|
238378
|
-
return undefined;
|
|
238379
|
-
return result;
|
|
238380
|
-
}
|
|
238381
|
-
/**
|
|
238382
|
-
* Collect boundary edges.
|
|
238383
|
-
* * Return the edges as the simplest collection of chains of line segments.
|
|
238384
|
-
* @param source facets
|
|
238385
|
-
* @param includeTypical true to in include typical boundary edges with a single incident facet
|
|
238386
|
-
* @param includeMismatch true to include edges with more than 2 incident facets
|
|
238387
|
-
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
238388
|
-
*/
|
|
238389
|
-
static collectBoundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
238390
|
-
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);
|
|
238391
|
-
PolyfaceQuery.announceBoundaryEdges(source, (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(ptA, ptB)), includeTypical, includeMismatch, includeNull);
|
|
238392
|
-
return collector.grabResult(true);
|
|
238470
|
+
/** Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume. */
|
|
238471
|
+
static isPolyfaceClosedByEdgePairing(source) {
|
|
238472
|
+
return this.isPolyfaceManifold(source, false);
|
|
238393
238473
|
}
|
|
238394
238474
|
/**
|
|
238395
238475
|
* Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume.
|
|
238396
238476
|
* If not, extract the boundary edges as lines.
|
|
238397
|
-
* @param source polyface or visitor
|
|
238398
|
-
* @param announceEdge function to be called with each boundary edge. The announcement is start and end points,
|
|
238399
|
-
*
|
|
238400
|
-
* @param
|
|
238477
|
+
* @param source polyface or visitor.
|
|
238478
|
+
* @param announceEdge function to be called with each boundary edge. The announcement is start and end points,
|
|
238479
|
+
* start and end indices, and facet index.
|
|
238480
|
+
* @param includeTypical true to announce typical boundary edges with a single adjacent facet.
|
|
238481
|
+
* @param includeMismatch true to announce edges with more than 2 adjacent facets.
|
|
238401
238482
|
* @param includeNull true to announce edges with identical start and end vertex indices.
|
|
238402
238483
|
*/
|
|
238403
238484
|
static announceBoundaryEdges(source, announceEdge, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
@@ -238413,17 +238494,17 @@ class PolyfaceQuery {
|
|
|
238413
238494
|
edges.addEdge(visitor.clientPointIndex(i), visitor.clientPointIndex(i + 1), visitor.currentReadIndex());
|
|
238414
238495
|
}
|
|
238415
238496
|
}
|
|
238416
|
-
const
|
|
238417
|
-
const
|
|
238418
|
-
const
|
|
238419
|
-
edges.sortAndCollectClusters(undefined,
|
|
238497
|
+
const boundaryEdges = [];
|
|
238498
|
+
const nullEdges = [];
|
|
238499
|
+
const allOtherEdges = [];
|
|
238500
|
+
edges.sortAndCollectClusters(undefined, boundaryEdges, nullEdges, allOtherEdges);
|
|
238420
238501
|
const badList = [];
|
|
238421
|
-
if (includeTypical &&
|
|
238422
|
-
badList.push(
|
|
238423
|
-
if (
|
|
238424
|
-
badList.push(
|
|
238425
|
-
if (
|
|
238426
|
-
badList.push(
|
|
238502
|
+
if (includeTypical && boundaryEdges.length > 0)
|
|
238503
|
+
badList.push(boundaryEdges);
|
|
238504
|
+
if (includeNull && nullEdges.length > 0)
|
|
238505
|
+
badList.push(nullEdges);
|
|
238506
|
+
if (includeMismatch && allOtherEdges.length > 0)
|
|
238507
|
+
badList.push(allOtherEdges);
|
|
238427
238508
|
if (badList.length === 0)
|
|
238428
238509
|
return undefined;
|
|
238429
238510
|
const sourcePolyface = visitor.clientPolyface();
|
|
@@ -238440,12 +238521,61 @@ class PolyfaceQuery {
|
|
|
238440
238521
|
}
|
|
238441
238522
|
}
|
|
238442
238523
|
/**
|
|
238443
|
-
*
|
|
238524
|
+
* Construct a CurveCollection containing boundary edges.
|
|
238525
|
+
* * Each edge is a LineSegment3d.
|
|
238526
|
+
* @param source polyface or visitor.
|
|
238527
|
+
* @param includeTypical true to in include typical boundary edges with a single adjacent facet.
|
|
238528
|
+
* @param includeMismatch true to include edges with more than 2 adjacent facets.
|
|
238529
|
+
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
238530
|
+
*/
|
|
238531
|
+
static boundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
238532
|
+
const result = new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_5__.BagOfCurves();
|
|
238533
|
+
const announceEdge = (pointA, pointB, _indexA, _indexB, _readIndex) => {
|
|
238534
|
+
result.tryAddChild(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(pointA, pointB));
|
|
238535
|
+
};
|
|
238536
|
+
PolyfaceQuery.announceBoundaryEdges(source, announceEdge, includeTypical, includeMismatch, includeNull);
|
|
238537
|
+
if (result.children.length === 0)
|
|
238538
|
+
return undefined;
|
|
238539
|
+
return result;
|
|
238540
|
+
}
|
|
238541
|
+
/**
|
|
238542
|
+
* Collect boundary edges.
|
|
238543
|
+
* * Return the edges as the simplest collection of chains of line segments.
|
|
238544
|
+
* @param source polyface or visitor.
|
|
238545
|
+
* @param includeTypical true to in include typical boundary edges with a single adjacent facet.
|
|
238546
|
+
* @param includeMismatch true to include edges with more than 2 adjacent facets.
|
|
238547
|
+
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
238548
|
+
*/
|
|
238549
|
+
static collectBoundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
238550
|
+
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);
|
|
238551
|
+
PolyfaceQuery.announceBoundaryEdges(source, (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(ptA, ptB)), includeTypical, includeMismatch, includeNull);
|
|
238552
|
+
return collector.grabResult(true);
|
|
238553
|
+
}
|
|
238554
|
+
/**
|
|
238555
|
+
* Load all half edges from a mesh to an IndexedEdgeMatcher.
|
|
238556
|
+
* @param polyface a mesh or a visitor assumed to have numWrap === 1.
|
|
238557
|
+
*/
|
|
238558
|
+
static createIndexedEdges(polyface) {
|
|
238559
|
+
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
238560
|
+
return this.createIndexedEdges(polyface.createVisitor(1));
|
|
238561
|
+
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
|
|
238562
|
+
polyface.reset();
|
|
238563
|
+
while (polyface.moveToNextFacet()) {
|
|
238564
|
+
const numEdges = polyface.pointCount - 1;
|
|
238565
|
+
for (let i = 0; i < numEdges; i++) {
|
|
238566
|
+
edges.addEdge(polyface.clientPointIndex(i), polyface.clientPointIndex(i + 1), polyface.currentReadIndex());
|
|
238567
|
+
}
|
|
238568
|
+
}
|
|
238569
|
+
return edges;
|
|
238570
|
+
}
|
|
238571
|
+
/**
|
|
238572
|
+
* Invoke the callback on each manifold edge whose adjacent facet normals form vectorToEye dot products
|
|
238573
|
+
* with opposite sign.
|
|
238444
238574
|
* * The callback is not called on boundary edges.
|
|
238445
|
-
* @param source
|
|
238446
|
-
* @param announce callback function invoked on manifold silhouette edges
|
|
238447
|
-
* @param vectorToEye normal of plane in which to compute silhouette edges
|
|
238448
|
-
* @param sideAngle angular tolerance for perpendicularity test
|
|
238575
|
+
* @param source polyface or visitor.
|
|
238576
|
+
* @param announce callback function invoked on manifold silhouette edges.
|
|
238577
|
+
* @param vectorToEye normal of plane in which to compute silhouette edges.
|
|
238578
|
+
* @param sideAngle angular tolerance for perpendicularity test.
|
|
238449
238579
|
*/
|
|
238450
238580
|
static announceSilhouetteEdges(source, announce, vectorToEye, sideAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle()) {
|
|
238451
238581
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -238495,16 +238625,17 @@ class PolyfaceQuery {
|
|
|
238495
238625
|
* Collect manifold edges whose adjacent facet normals form vectorToEye dot products with opposite sign.
|
|
238496
238626
|
* * Does not return boundary edges.
|
|
238497
238627
|
* * Return the edges as chains of line segments.
|
|
238498
|
-
* @param source
|
|
238499
|
-
* @param vectorToEye normal of plane in which to compute silhouette edges
|
|
238500
|
-
* @param sideAngle angular tolerance for perpendicularity test
|
|
238628
|
+
* @param source polyface or visitor.
|
|
238629
|
+
* @param vectorToEye normal of plane in which to compute silhouette edges.
|
|
238630
|
+
* @param sideAngle angular tolerance for perpendicularity test.
|
|
238501
238631
|
*/
|
|
238502
238632
|
static collectSilhouetteEdges(source, vectorToEye, sideAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle()) {
|
|
238503
238633
|
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);
|
|
238504
238634
|
PolyfaceQuery.announceSilhouetteEdges(source, (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(ptA, ptB)), vectorToEye, sideAngle);
|
|
238505
238635
|
return collector.grabResult(true);
|
|
238506
238636
|
}
|
|
238507
|
-
/**
|
|
238637
|
+
/**
|
|
238638
|
+
* Find segments (within the linestring) which project to facets.
|
|
238508
238639
|
* * Announce each pair of linestring segment and on-facet segment through a callback.
|
|
238509
238640
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
238510
238641
|
*/
|
|
@@ -238517,7 +238648,24 @@ class PolyfaceQuery {
|
|
|
238517
238648
|
}
|
|
238518
238649
|
}
|
|
238519
238650
|
}
|
|
238520
|
-
/**
|
|
238651
|
+
/**
|
|
238652
|
+
* Set the limit on work during an async time blocks, and return the old value.
|
|
238653
|
+
* * This should be a large number -- default is 1.0e6
|
|
238654
|
+
* @internal
|
|
238655
|
+
*/
|
|
238656
|
+
static setAsyncWorkLimit(value) {
|
|
238657
|
+
const oldValue = this._asyncWorkLimit;
|
|
238658
|
+
this._asyncWorkLimit = value;
|
|
238659
|
+
return oldValue;
|
|
238660
|
+
}
|
|
238661
|
+
/**
|
|
238662
|
+
* Query the current limit on work during an async time block.
|
|
238663
|
+
* @internal
|
|
238664
|
+
*/
|
|
238665
|
+
static get asyncWorkLimit() {
|
|
238666
|
+
return this._asyncWorkLimit;
|
|
238667
|
+
}
|
|
238668
|
+
/** Execute `context.projectToPolygon` until its work estimates accumulate to workLimit. */
|
|
238521
238669
|
static async continueAnnounceSweepLinestringToConvexPolyfaceXY(context, visitor, announce) {
|
|
238522
238670
|
let workCount = 0;
|
|
238523
238671
|
while ((workCount < this.asyncWorkLimit) && visitor.moveToNextFacet()) {
|
|
@@ -238525,16 +238673,8 @@ class PolyfaceQuery {
|
|
|
238525
238673
|
}
|
|
238526
238674
|
return workCount;
|
|
238527
238675
|
}
|
|
238528
|
-
/**
|
|
238529
|
-
*
|
|
238530
|
-
* @internal
|
|
238531
|
-
*/
|
|
238532
|
-
static setAsyncWorkLimit(value) { const a = this._asyncWorkLimit; this._asyncWorkLimit = value; return a; }
|
|
238533
|
-
/** Query the current limit on work during an async time block.
|
|
238534
|
-
* @internal
|
|
238535
|
-
*/
|
|
238536
|
-
static get asyncWorkLimit() { return this._asyncWorkLimit; }
|
|
238537
|
-
/** Find segments (within the linestring) which project to facets.
|
|
238676
|
+
/**
|
|
238677
|
+
* Find segments (within the linestring) which project to facets.
|
|
238538
238678
|
* * Announce each pair of linestring segment and on-facet segment through a callback.
|
|
238539
238679
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
238540
238680
|
* * REMARK: Although this is public, the usual use is via slightly higher level public methods, viz:
|
|
@@ -238557,14 +238697,15 @@ class PolyfaceQuery {
|
|
|
238557
238697
|
// GeometryCoreTestIO.consoleLog({ myWorkTotal: workTotal, myBlockCount: this.awaitBlockCount });
|
|
238558
238698
|
return workTotal;
|
|
238559
238699
|
}
|
|
238560
|
-
/**
|
|
238700
|
+
/**
|
|
238701
|
+
* Search the facets for facet subsets that are connected with at least vertex contact.
|
|
238561
238702
|
* * Return array of arrays of facet indices.
|
|
238562
238703
|
*/
|
|
238563
238704
|
static partitionFacetIndicesByVertexConnectedComponent(polyface) {
|
|
238564
238705
|
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
238565
238706
|
return this.partitionFacetIndicesByVertexConnectedComponent(polyface.createVisitor(0));
|
|
238566
238707
|
}
|
|
238567
|
-
// The polyface is really a visitor
|
|
238708
|
+
// The polyface is really a visitor
|
|
238568
238709
|
const context = new _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_14__.UnionFindContext(this.visitorClientPointCount(polyface));
|
|
238569
238710
|
for (polyface.reset(); polyface.moveToNextFacet();) {
|
|
238570
238711
|
const firstVertexIndexOnThisFacet = polyface.pointIndex[0];
|
|
@@ -238592,9 +238733,9 @@ class PolyfaceQuery {
|
|
|
238592
238733
|
/**
|
|
238593
238734
|
* * Examine the normal orientation for each faces.
|
|
238594
238735
|
* * Separate to 3 partitions:
|
|
238595
|
-
* *
|
|
238596
|
-
* *
|
|
238597
|
-
* *
|
|
238736
|
+
* * Facets with normal in the positive direction of the vectorToEye (partition 0).
|
|
238737
|
+
* * Facets with normal in the negative direction of the vectorToEye (partition 1).
|
|
238738
|
+
* * Facets nearly perpendicular to the view vector (partition 2).
|
|
238598
238739
|
* * Return array of arrays of facet indices.
|
|
238599
238740
|
*/
|
|
238600
238741
|
static partitionFacetIndicesByVisibilityVector(polyface, vectorToEye, sideAngleTolerance) {
|
|
@@ -238629,13 +238770,13 @@ class PolyfaceQuery {
|
|
|
238629
238770
|
}
|
|
238630
238771
|
/**
|
|
238631
238772
|
* Return the boundary of facets that are facing the eye.
|
|
238632
|
-
* @param polyface
|
|
238773
|
+
* @param polyface the indexed polyface
|
|
238633
238774
|
* @param visibilitySubset selector among the visible facet sets extracted by partitionFacetIndicesByVisibilityVector
|
|
238634
238775
|
* * 0 ==> forward facing
|
|
238635
238776
|
* * 1 ==> rear facing
|
|
238636
238777
|
* * 2 ==> side facing
|
|
238637
|
-
* @param vectorToEye
|
|
238638
|
-
* @param sideAngleTolerance
|
|
238778
|
+
* @param vectorToEye the vector to eye
|
|
238779
|
+
* @param sideAngleTolerance the tolerance of side angle
|
|
238639
238780
|
*/
|
|
238640
238781
|
static boundaryOfVisibleSubset(polyface, visibilitySelect, vectorToEye, sideAngleTolerance = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(1.0e-3)) {
|
|
238641
238782
|
const partitionedIndices = this.partitionFacetIndicesByVisibilityVector(polyface, vectorToEye, sideAngleTolerance);
|
|
@@ -238645,10 +238786,9 @@ class PolyfaceQuery {
|
|
|
238645
238786
|
return this.boundaryEdges(visitor, true, false, false);
|
|
238646
238787
|
}
|
|
238647
238788
|
/**
|
|
238648
|
-
* Search for edges with only 1
|
|
238649
|
-
* *
|
|
238650
|
-
* *
|
|
238651
|
-
* @param mesh
|
|
238789
|
+
* Search for edges with only 1 adjacent facet.
|
|
238790
|
+
* * Chain them into loops.
|
|
238791
|
+
* * Emit the loops to the announceLoop function.
|
|
238652
238792
|
*/
|
|
238653
238793
|
static announceBoundaryChainsAsLineString3d(mesh, announceLoop) {
|
|
238654
238794
|
const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_12__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, 1000);
|
|
@@ -238659,9 +238799,9 @@ class PolyfaceQuery {
|
|
|
238659
238799
|
* Return a mesh with
|
|
238660
238800
|
* * clusters of adjacent, coplanar facets merged into larger facets.
|
|
238661
238801
|
* * other facets included unchanged.
|
|
238662
|
-
* @param mesh existing mesh or visitor
|
|
238663
|
-
* @param maxSmoothEdgeAngle maximum dihedral angle across an edge between facets deemed coplanar. If undefined,
|
|
238664
|
-
*
|
|
238802
|
+
* @param mesh existing mesh or visitor.
|
|
238803
|
+
* @param maxSmoothEdgeAngle maximum dihedral angle across an edge between facets deemed coplanar. If undefined,
|
|
238804
|
+
* uses `Geometry.smallAngleRadians`.
|
|
238665
238805
|
*/
|
|
238666
238806
|
static cloneWithMaximalPlanarFacets(mesh, maxSmoothEdgeAngle) {
|
|
238667
238807
|
if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -238720,14 +238860,14 @@ class PolyfaceQuery {
|
|
|
238720
238860
|
* * Unclosed chains are rejected.
|
|
238721
238861
|
* * Closed chains are triangulated and returned as a mesh.
|
|
238722
238862
|
* * The options structure enforces restrictions on how complicated the hole filling can be:
|
|
238723
|
-
* * maxEdgesAroundHole -- holes with more edges are skipped
|
|
238863
|
+
* * maxEdgesAroundHole -- holes with more edges are skipped.
|
|
238724
238864
|
* * maxPerimeter -- holes with larger summed edge lengths are skipped.
|
|
238725
238865
|
* * upVector -- holes that do not have positive area along this view are skipped.
|
|
238726
|
-
* * includeOriginalMesh -- includes the original mesh in the output mesh, so the composite mesh is a
|
|
238727
|
-
*
|
|
238866
|
+
* * includeOriginalMesh -- includes the original mesh in the output mesh, so the composite mesh is a
|
|
238867
|
+
* clone with holes filled.
|
|
238868
|
+
* @param mesh existing mesh.
|
|
238728
238869
|
* @param options options controlling the hole fill.
|
|
238729
238870
|
* @param unfilledChains optional array to receive the points around holes that were not filled.
|
|
238730
|
-
* @returns
|
|
238731
238871
|
*/
|
|
238732
238872
|
static fillSimpleHoles(mesh, options, unfilledChains) {
|
|
238733
238873
|
if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -238763,9 +238903,7 @@ class PolyfaceQuery {
|
|
|
238763
238903
|
}
|
|
238764
238904
|
return builder.claimPolyface(true);
|
|
238765
238905
|
}
|
|
238766
|
-
/** Clone the facets in each partition to a separate polyface.
|
|
238767
|
-
*
|
|
238768
|
-
*/
|
|
238906
|
+
/** Clone the facets in each partition to a separate polyface. */
|
|
238769
238907
|
static clonePartitions(polyface, partitions) {
|
|
238770
238908
|
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
238771
238909
|
return this.clonePartitions(polyface.createVisitor(0), partitions);
|
|
@@ -238788,7 +238926,7 @@ class PolyfaceQuery {
|
|
|
238788
238926
|
}
|
|
238789
238927
|
return polyfaces;
|
|
238790
238928
|
}
|
|
238791
|
-
/** Clone facets that pass a filter function */
|
|
238929
|
+
/** Clone facets that pass a filter function. */
|
|
238792
238930
|
static cloneFiltered(source, filter) {
|
|
238793
238931
|
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
238794
238932
|
return this.cloneFiltered(source.createVisitor(0), filter);
|
|
@@ -238858,46 +238996,44 @@ class PolyfaceQuery {
|
|
|
238858
238996
|
}
|
|
238859
238997
|
return builder.claimPolyface(true);
|
|
238860
238998
|
}
|
|
238861
|
-
/**
|
|
238862
|
-
|
|
238863
|
-
|
|
238864
|
-
|
|
238865
|
-
|
|
238866
|
-
return visitor.data.point.length;
|
|
238867
|
-
const polyface = visitor.clientPolyface();
|
|
238999
|
+
/** Return the point count of the `source`. */
|
|
239000
|
+
static visitorClientPointCount(source) {
|
|
239001
|
+
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
239002
|
+
return source.data.point.length;
|
|
239003
|
+
const polyface = source.clientPolyface();
|
|
238868
239004
|
if (polyface !== undefined)
|
|
238869
239005
|
return polyface.data.point.length;
|
|
238870
|
-
|
|
239006
|
+
source.reset();
|
|
238871
239007
|
let maxIndex = -1;
|
|
238872
|
-
while (
|
|
238873
|
-
for (const pointIndex of
|
|
239008
|
+
while (source.moveToNextFacet()) {
|
|
239009
|
+
for (const pointIndex of source.pointIndex)
|
|
238874
239010
|
if (pointIndex > maxIndex)
|
|
238875
239011
|
maxIndex = pointIndex;
|
|
238876
239012
|
}
|
|
238877
239013
|
return maxIndex + 1;
|
|
238878
239014
|
}
|
|
238879
|
-
/**
|
|
238880
|
-
|
|
238881
|
-
|
|
238882
|
-
|
|
238883
|
-
|
|
238884
|
-
|
|
238885
|
-
return visitor.facetCount;
|
|
238886
|
-
visitor = visitor.createVisitor(0);
|
|
239015
|
+
/** Return the facet count of the `source`. */
|
|
239016
|
+
static visitorClientFacetCount(source) {
|
|
239017
|
+
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
239018
|
+
if (source.facetCount !== undefined)
|
|
239019
|
+
return source.facetCount;
|
|
239020
|
+
source = source.createVisitor(0);
|
|
238887
239021
|
}
|
|
238888
|
-
const polyface =
|
|
239022
|
+
const polyface = source.clientPolyface();
|
|
238889
239023
|
if (polyface !== undefined && polyface.facetCount !== undefined)
|
|
238890
239024
|
return polyface.facetCount;
|
|
238891
239025
|
let facetCount = 0;
|
|
238892
|
-
|
|
238893
|
-
while (
|
|
239026
|
+
source.reset();
|
|
239027
|
+
while (source.moveToNextFacet())
|
|
238894
239028
|
++facetCount;
|
|
238895
239029
|
return facetCount;
|
|
238896
239030
|
}
|
|
238897
|
-
/**
|
|
239031
|
+
/**
|
|
239032
|
+
* Partition the facet set into connected components such that two adjacent facets are in the same component if and
|
|
239033
|
+
* only if they are adjacent across a clustered edge.
|
|
238898
239034
|
* @param edgeClusters sorted and clustered edges (cf. `IndexedEdgeMatcher.sortAndCollectClusters`).
|
|
238899
239035
|
* @param numFacets facet count in the parent mesh. In particular, `edge.facetIndex < numFacets` for every input edge.
|
|
238900
|
-
* @return collection of facet index arrays, one array per connected component
|
|
239036
|
+
* @return collection of facet index arrays, one array per connected component.
|
|
238901
239037
|
*/
|
|
238902
239038
|
static partitionFacetIndicesBySortableEdgeClusters(edgeClusters, numFacets) {
|
|
238903
239039
|
const context = new _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_14__.UnionFindContext(numFacets);
|
|
@@ -238928,10 +239064,12 @@ class PolyfaceQuery {
|
|
|
238928
239064
|
}
|
|
238929
239065
|
return facetsInComponent;
|
|
238930
239066
|
}
|
|
238931
|
-
/**
|
|
238932
|
-
*
|
|
238933
|
-
*
|
|
238934
|
-
* @
|
|
239067
|
+
/**
|
|
239068
|
+
* Partition the facet set into connected components. Each facet in a given component shares an edge only with
|
|
239069
|
+
* other facets in the component (or is a boundary edge).
|
|
239070
|
+
* @param polyface facets to partition.
|
|
239071
|
+
* @param stopAtVisibleEdges whether to further split connected components by visible edges of the polyface.
|
|
239072
|
+
* @return collection of facet index arrays, one per connected component.
|
|
238935
239073
|
*/
|
|
238936
239074
|
static partitionFacetIndicesByEdgeConnectedComponent(polyface, stopAtVisibleEdges = false) {
|
|
238937
239075
|
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface) {
|
|
@@ -238956,7 +239094,8 @@ class PolyfaceQuery {
|
|
|
238956
239094
|
matcher.sortAndCollectClusters(allEdges, allEdges, allEdges, allEdges);
|
|
238957
239095
|
return this.partitionFacetIndicesBySortableEdgeClusters(allEdges, numFacets);
|
|
238958
239096
|
}
|
|
238959
|
-
/**
|
|
239097
|
+
/**
|
|
239098
|
+
* Find segments (within the line string) which project to facets.
|
|
238960
239099
|
* * Assemble each input segment paired with its projected segment/point as a quad/triangle facet in a new polyface.
|
|
238961
239100
|
* * Input facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
238962
239101
|
*/
|
|
@@ -238970,7 +239109,7 @@ class PolyfaceQuery {
|
|
|
238970
239109
|
});
|
|
238971
239110
|
return builder.claimPolyface(true);
|
|
238972
239111
|
}
|
|
238973
|
-
/** @deprecated in 4.x. Use sweepLineStringToFacetsXYReturnSweptFacets instead. */
|
|
239112
|
+
/** @deprecated in 4.x. Use [[sweepLineStringToFacetsXYReturnSweptFacets]] instead. */
|
|
238974
239113
|
static sweepLinestringToFacetsXYreturnSweptFacets(linestringPoints, polyface) {
|
|
238975
239114
|
return this.sweepLineStringToFacetsXYReturnSweptFacets(linestringPoints, polyface);
|
|
238976
239115
|
}
|
|
@@ -238983,11 +239122,10 @@ class PolyfaceQuery {
|
|
|
238983
239122
|
*/
|
|
238984
239123
|
static sweepLineStringToFacets(linestringPoints, polyfaceOrVisitor, options) {
|
|
238985
239124
|
let result = [];
|
|
238986
|
-
// setup default options
|
|
239125
|
+
// setup default options
|
|
238987
239126
|
if (options === undefined)
|
|
238988
239127
|
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
|
|
238989
|
-
true,
|
|
238990
|
-
true, true, true); // accept all outputs
|
|
239128
|
+
true, true, true, true);
|
|
238991
239129
|
let chainContext;
|
|
238992
239130
|
if (options.assembleChains)
|
|
238993
239131
|
chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_25__.ChainMergeContext.create();
|
|
@@ -239018,9 +239156,9 @@ class PolyfaceQuery {
|
|
|
239018
239156
|
}
|
|
239019
239157
|
/**
|
|
239020
239158
|
* Sweep the line string in the z-direction to intersections with a mesh, using a search object for speedup.
|
|
239021
|
-
* @param lineStringPoints input line string to drape on the mesh
|
|
239022
|
-
* @param polyfaceOrVisitor mesh, or mesh visitor to traverse only part of a mesh
|
|
239023
|
-
* @param searchByReadIndex object for searching facet 2D ranges tagged by mesh read index
|
|
239159
|
+
* @param lineStringPoints input line string to drape on the mesh.
|
|
239160
|
+
* @param polyfaceOrVisitor mesh, or mesh visitor to traverse only part of a mesh.
|
|
239161
|
+
* @param searchByReadIndex object for searching facet 2D ranges tagged by mesh read index.
|
|
239024
239162
|
* @example Using a 5x5 indexed search grid:
|
|
239025
239163
|
* ```
|
|
239026
239164
|
* const xyRange = Range2d.createFrom(myPolyface.range());
|
|
@@ -239030,7 +239168,7 @@ class PolyfaceQuery {
|
|
|
239030
239168
|
* }
|
|
239031
239169
|
* const drapedLineStrings = PolyfaceQuery.sweepLineStringToFacetsXY(lineString, myPolyface, searcher);
|
|
239032
239170
|
* ```
|
|
239033
|
-
* @returns collected line strings
|
|
239171
|
+
* @returns the collected line strings.
|
|
239034
239172
|
*/
|
|
239035
239173
|
static sweepLineStringToFacetsXY(lineStringPoints, polyfaceOrVisitor, searchByReadIndex) {
|
|
239036
239174
|
const chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_25__.ChainMergeContext.create();
|
|
@@ -239064,32 +239202,36 @@ class PolyfaceQuery {
|
|
|
239064
239202
|
chainContext.clusterAndMergeVerticesXYZ();
|
|
239065
239203
|
return chainContext.collectMaximalChains();
|
|
239066
239204
|
}
|
|
239067
|
-
/**
|
|
239205
|
+
/**
|
|
239206
|
+
* Find segments (within the linestring) which project to facets.
|
|
239068
239207
|
* * Return collected line segments.
|
|
239069
239208
|
* * This calls [[sweepLineStringToFacets]] with options created by
|
|
239070
|
-
* `const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(),false, true, true, true);`
|
|
239071
|
-
* @deprecated in 4.x. Use [[sweepLineStringToFacets]] to get further options.
|
|
239209
|
+
* `const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(), false, true, true, true);`
|
|
239210
|
+
* @deprecated in 4.x. Use [[PolyfaceQuery.sweepLineStringToFacets]] to get further options.
|
|
239072
239211
|
*/
|
|
239073
239212
|
static sweepLinestringToFacetsXYReturnLines(linestringPoints, polyface) {
|
|
239074
239213
|
const options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle(), false, true, true, true);
|
|
239075
239214
|
const result = PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface, options);
|
|
239076
239215
|
return result;
|
|
239077
239216
|
}
|
|
239078
|
-
/**
|
|
239217
|
+
/**
|
|
239218
|
+
* Find segments (within the linestring) which project to facets.
|
|
239079
239219
|
* * Return chains.
|
|
239080
239220
|
* * This calls [[sweepLineStringToFacets]] with options created by
|
|
239081
239221
|
* `const options = SweepLineStringToFacetsOptions.create(Vector3d.unitZ(), Angle.createSmallAngle(),true, true, true, true);`
|
|
239082
|
-
* @deprecated in 4.x. Use [[sweepLineStringToFacets]] to get further options.
|
|
239222
|
+
* @deprecated in 4.x. Use [[PolyfaceQuery.sweepLineStringToFacets]] to get further options.
|
|
239083
239223
|
*/
|
|
239084
239224
|
static sweepLinestringToFacetsXYReturnChains(linestringPoints, polyface) {
|
|
239085
239225
|
const options = SweepLineStringToFacetsOptions.create(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.unitZ(), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle(), true, true, true, true);
|
|
239086
239226
|
const result = PolyfaceQuery.sweepLineStringToFacets(linestringPoints, polyface, options);
|
|
239087
239227
|
return result;
|
|
239088
239228
|
}
|
|
239089
|
-
/**
|
|
239229
|
+
/**
|
|
239230
|
+
* Find segments (within the linestring) which project to facets.
|
|
239090
239231
|
* * This is done as a sequence of "await" steps.
|
|
239091
|
-
* * Each "await" step deals with approximately PolyfaceQuery.asyncWorkLimit pairings of
|
|
239092
|
-
*
|
|
239232
|
+
* * Each "await" step deals with approximately PolyfaceQuery.asyncWorkLimit pairings of "linestring edge"
|
|
239233
|
+
* with "facet edge".
|
|
239234
|
+
* * PolyfaceQuery.setAsyncWorkLimit() to change work blocks from default.
|
|
239093
239235
|
* * Return chains.
|
|
239094
239236
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
239095
239237
|
*/
|
|
@@ -239103,7 +239245,7 @@ class PolyfaceQuery {
|
|
|
239103
239245
|
return chains;
|
|
239104
239246
|
}
|
|
239105
239247
|
/**
|
|
239106
|
-
*
|
|
239248
|
+
* Examine ranges of facets.
|
|
239107
239249
|
* * Return statistical summary of x,y,z ranges.
|
|
239108
239250
|
*/
|
|
239109
239251
|
static collectRangeLengthData(polyface) {
|
|
@@ -239111,17 +239253,18 @@ class PolyfaceQuery {
|
|
|
239111
239253
|
return this.collectRangeLengthData(polyface.createVisitor(0));
|
|
239112
239254
|
}
|
|
239113
239255
|
const rangeData = new _RangeLengthData__WEBPACK_IMPORTED_MODULE_28__.RangeLengthData();
|
|
239114
|
-
// polyface is a visitor
|
|
239256
|
+
// polyface is a visitor
|
|
239115
239257
|
for (polyface.reset(); polyface.moveToNextFacet();)
|
|
239116
239258
|
rangeData.accumulateGrowableXYZArrayRange(polyface.point);
|
|
239117
239259
|
return rangeData;
|
|
239118
239260
|
}
|
|
239119
|
-
/**
|
|
239120
|
-
*
|
|
239261
|
+
/**
|
|
239262
|
+
* Clone the facets, inserting vertices (within edges) where points not part of each facet's vertex indices
|
|
239263
|
+
* impinge within edges.
|
|
239121
239264
|
*/
|
|
239122
239265
|
static cloneWithTVertexFixup(polyface) {
|
|
239123
|
-
const oldFacetVisitor = polyface.createVisitor(1); //
|
|
239124
|
-
const newFacetVisitor = polyface.createVisitor(0); //
|
|
239266
|
+
const oldFacetVisitor = polyface.createVisitor(1); // this is to visit the existing facets
|
|
239267
|
+
const newFacetVisitor = polyface.createVisitor(0); // this is to build the new facets
|
|
239125
239268
|
const rangeSearcher = _multiclip_XYPointBuckets__WEBPACK_IMPORTED_MODULE_29__.XYPointBuckets.create(polyface.data.point, 30);
|
|
239126
239269
|
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
239127
239270
|
const edgeRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_26__.Range3d.createNull();
|
|
@@ -239132,7 +239275,7 @@ class PolyfaceQuery {
|
|
|
239132
239275
|
for (oldFacetVisitor.reset(); oldFacetVisitor.moveToNextFacet();) {
|
|
239133
239276
|
newFacetVisitor.clearArrays();
|
|
239134
239277
|
for (let i = 0; i + 1 < oldFacetVisitor.point.length; i++) {
|
|
239135
|
-
// each base vertex is part of the result
|
|
239278
|
+
// each base vertex is part of the result
|
|
239136
239279
|
oldFacetVisitor.point.getPoint3dAtUncheckedPointIndex(i, point0);
|
|
239137
239280
|
oldFacetVisitor.point.getPoint3dAtUncheckedPointIndex(i + 1, point1);
|
|
239138
239281
|
newFacetVisitor.pushDataFrom(oldFacetVisitor, i);
|
|
@@ -239143,12 +239286,12 @@ class PolyfaceQuery {
|
|
|
239143
239286
|
edgeRange.extend(point1);
|
|
239144
239287
|
edgeRange.ensureMinLengths(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance); // add some slop in case segment is axis-aligned
|
|
239145
239288
|
rangeSearcher.announcePointsInRange(edgeRange, (index, _x, _y, _z) => {
|
|
239146
|
-
// x,y,z has x,y within the range of the search
|
|
239289
|
+
// x,y,z has x,y within the range of the search; test for exact on (in full 3d)
|
|
239147
239290
|
polyface.data.point.getPoint3dAtUncheckedPointIndex(index, spacePoint);
|
|
239148
239291
|
const detail = segment.closestPoint(spacePoint, false);
|
|
239149
239292
|
if (undefined !== detail) {
|
|
239150
|
-
if (detail.fraction > 0.0 && detail.fraction < 1.0 && !detail.point.isAlmostEqual(point0) &&
|
|
239151
|
-
&& spacePoint.isAlmostEqual(detail.point)) {
|
|
239293
|
+
if (detail.fraction > 0.0 && detail.fraction < 1.0 && !detail.point.isAlmostEqual(point0) &&
|
|
239294
|
+
!detail.point.isAlmostEqual(point1) && spacePoint.isAlmostEqual(detail.point)) {
|
|
239152
239295
|
if (detailArray === undefined)
|
|
239153
239296
|
detailArray = [];
|
|
239154
239297
|
detail.a = index;
|
|
@@ -239169,14 +239312,13 @@ class PolyfaceQuery {
|
|
|
239169
239312
|
return builder.claimPolyface();
|
|
239170
239313
|
}
|
|
239171
239314
|
/**
|
|
239315
|
+
* Compare index arrays formatted as follows. Return 0 if arrays are the same.
|
|
239172
239316
|
* * Each array input structure is: [facetIndex, vertexIndex0, vertexIndex1, ....]
|
|
239173
|
-
* * Vertex indices assumed reversed so
|
|
239174
|
-
* * vertexIndex0 is the lowest index on the facet
|
|
239175
|
-
* * vertexIndex1 is the lowest neighbor of vertex0
|
|
239317
|
+
* * Vertex indices assumed reversed so:
|
|
239318
|
+
* * vertexIndex0 is the lowest index on the facet.
|
|
239319
|
+
* * vertexIndex1 is the lowest neighbor of vertex0.
|
|
239176
239320
|
* * first different entry among vertex indices determines lexical result.
|
|
239177
|
-
* *
|
|
239178
|
-
* @param arrayA
|
|
239179
|
-
* @param arrayB
|
|
239321
|
+
* * hence facets with duplicate indices (whether forward or reversed) are considered equal.
|
|
239180
239322
|
*/
|
|
239181
239323
|
static compareFacetIndexAndVertexIndices(arrayA, arrayB) {
|
|
239182
239324
|
if (arrayA.length !== arrayB.length)
|
|
@@ -239189,25 +239331,12 @@ class PolyfaceQuery {
|
|
|
239189
239331
|
return 0;
|
|
239190
239332
|
}
|
|
239191
239333
|
/**
|
|
239192
|
-
*
|
|
239193
|
-
* @
|
|
239194
|
-
*
|
|
239195
|
-
*/
|
|
239196
|
-
static collectDuplicateFacetIndices(polyface, includeSingletons = false) {
|
|
239197
|
-
const result = [];
|
|
239198
|
-
this.announceDuplicateFacetIndices(polyface, (clusterFacetIndices) => {
|
|
239199
|
-
if (includeSingletons || clusterFacetIndices.length > 1)
|
|
239200
|
-
result.push(clusterFacetIndices.slice());
|
|
239201
|
-
});
|
|
239202
|
-
return result;
|
|
239203
|
-
}
|
|
239204
|
-
/**
|
|
239205
|
-
* * Return an array of arrays describing facet duplication.
|
|
239206
|
-
* @param includeSingletons if true, non-duplicated facets are included in the output.
|
|
239207
|
-
* * Each array `entry` in the output contains read indices of a cluster of facets with the same vertex indices.
|
|
239334
|
+
* Announce facet duplicates.
|
|
239335
|
+
* @returns an array of arrays describing facet duplication. Each array `entry` in the output contains read
|
|
239336
|
+
* indices of a cluster of facets with the same vertex indices.
|
|
239208
239337
|
*/
|
|
239209
239338
|
static announceDuplicateFacetIndices(polyface, announceCluster) {
|
|
239210
|
-
const visitor = polyface.createVisitor(0); //
|
|
239339
|
+
const visitor = polyface.createVisitor(0); // this is to visit the existing facets
|
|
239211
239340
|
const facetIndexAndVertexIndices = [];
|
|
239212
239341
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
239213
239342
|
const facetIndex = visitor.currentReadIndex();
|
|
@@ -239215,12 +239344,12 @@ class PolyfaceQuery {
|
|
|
239215
239344
|
const pointIndex = visitor.pointIndex;
|
|
239216
239345
|
const numPointsThisFacet = pointIndex.length;
|
|
239217
239346
|
let lowIndex = 0;
|
|
239218
|
-
// find the lowest point index
|
|
239347
|
+
// find the lowest point index
|
|
239219
239348
|
for (let i = 1; i < visitor.pointIndex.length; i++) {
|
|
239220
239349
|
if (pointIndex[i] < pointIndex[lowIndex])
|
|
239221
239350
|
lowIndex = i;
|
|
239222
239351
|
}
|
|
239223
|
-
// find its lowest neighbor
|
|
239352
|
+
// find its lowest neighbor; assemble sort array in that direction
|
|
239224
239353
|
if (pointIndex[(lowIndex + 1) % numPointsThisFacet] < pointIndex[(lowIndex + numPointsThisFacet - 1) % numPointsThisFacet]) {
|
|
239225
239354
|
for (let i = 0; i < numPointsThisFacet; i++) {
|
|
239226
239355
|
entry.push(pointIndex[(lowIndex + i) % numPointsThisFacet]);
|
|
@@ -239248,9 +239377,26 @@ class PolyfaceQuery {
|
|
|
239248
239377
|
announceCluster(clusterArray);
|
|
239249
239378
|
}
|
|
239250
239379
|
}
|
|
239251
|
-
/**
|
|
239380
|
+
/**
|
|
239381
|
+
* Collect facet duplicates.
|
|
239382
|
+
* @param polyface the polyface.
|
|
239383
|
+
* @param includeSingletons if true, non-duplicated facets are included in the output.
|
|
239384
|
+
* @returns an array of arrays describing facet duplication. Each array `entry` in the output contains read
|
|
239385
|
+
* indices of a cluster of facets with the same vertex indices.
|
|
239386
|
+
*/
|
|
239387
|
+
static collectDuplicateFacetIndices(polyface, includeSingletons = false) {
|
|
239388
|
+
const result = [];
|
|
239389
|
+
this.announceDuplicateFacetIndices(polyface, (clusterFacetIndices) => {
|
|
239390
|
+
if (includeSingletons || clusterFacetIndices.length > 1)
|
|
239391
|
+
result.push(clusterFacetIndices.slice());
|
|
239392
|
+
});
|
|
239393
|
+
return result;
|
|
239394
|
+
}
|
|
239395
|
+
/**
|
|
239396
|
+
* Return a new facet set with a subset of facets in polyface.
|
|
239397
|
+
* @param source the polyface.
|
|
239252
239398
|
* @param includeSingletons true to copy facets that only appear once
|
|
239253
|
-
* @param clusterSelector indicates whether duplicate clusters are to have 0, 1, or all facets included
|
|
239399
|
+
* @param clusterSelector indicates whether duplicate clusters are to have 0, 1, or all facets included.
|
|
239254
239400
|
*/
|
|
239255
239401
|
static cloneByFacetDuplication(source, includeSingletons, clusterSelector) {
|
|
239256
239402
|
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
@@ -239276,25 +239422,23 @@ class PolyfaceQuery {
|
|
|
239276
239422
|
});
|
|
239277
239423
|
return builder.claimPolyface();
|
|
239278
239424
|
}
|
|
239279
|
-
/** Clone the facets,
|
|
239280
|
-
*
|
|
239281
|
-
*/
|
|
239425
|
+
/** Clone the facets, removing points that are simply within colinear edges. */
|
|
239282
239426
|
static cloneWithColinearEdgeFixup(polyface) {
|
|
239283
|
-
const oldFacetVisitor = polyface.createVisitor(2); //
|
|
239284
|
-
const newFacetVisitor = polyface.createVisitor(0); //
|
|
239427
|
+
const oldFacetVisitor = polyface.createVisitor(2); // this is to visit the existing facets
|
|
239428
|
+
const newFacetVisitor = polyface.createVisitor(0); // this is to build the new facets
|
|
239285
239429
|
const builder = _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__.PolyfaceBuilder.create();
|
|
239286
239430
|
const vector01 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
239287
239431
|
const vector12 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
239288
239432
|
const numPoint = polyface.data.point.length;
|
|
239289
239433
|
const pointState = new Int32Array(numPoint);
|
|
239290
|
-
// FIRST PASS
|
|
239291
|
-
//
|
|
239292
|
-
//
|
|
239293
|
-
//
|
|
239294
|
-
//
|
|
239434
|
+
// FIRST PASS: in each sector of each facet, determine if the sector has colinear incoming and outgoing vectors.
|
|
239435
|
+
// Mark each point as
|
|
239436
|
+
// 0 unvisited
|
|
239437
|
+
// -1 adjacent to a non-colinear sector
|
|
239438
|
+
// n adjacent to n colinear sectors
|
|
239295
239439
|
for (oldFacetVisitor.reset(); oldFacetVisitor.moveToNextFacet();) {
|
|
239296
239440
|
for (let i = 0; i + 2 < oldFacetVisitor.point.length; i++) {
|
|
239297
|
-
// each base vertex is part of the result
|
|
239441
|
+
// each base vertex is part of the result
|
|
239298
239442
|
oldFacetVisitor.point.vectorIndexIndex(i, i + 1, vector01);
|
|
239299
239443
|
oldFacetVisitor.point.vectorIndexIndex(i + 1, i + 2, vector12);
|
|
239300
239444
|
const pointIndex = oldFacetVisitor.clientPointIndex(i + 1);
|
|
@@ -239309,7 +239453,7 @@ class PolyfaceQuery {
|
|
|
239309
239453
|
}
|
|
239310
239454
|
}
|
|
239311
239455
|
}
|
|
239312
|
-
// SECOND PASS
|
|
239456
|
+
// SECOND PASS: make copies, omitting references to points at colinear sectors.
|
|
239313
239457
|
for (oldFacetVisitor.reset(); oldFacetVisitor.moveToNextFacet();) {
|
|
239314
239458
|
newFacetVisitor.clearArrays();
|
|
239315
239459
|
for (let i = 0; i + 2 < oldFacetVisitor.point.length; i++) {
|
|
@@ -239325,9 +239469,9 @@ class PolyfaceQuery {
|
|
|
239325
239469
|
}
|
|
239326
239470
|
/**
|
|
239327
239471
|
* Set the edge visibility for specified edges in the polyface.
|
|
239328
|
-
* @param polyface mesh to be edited
|
|
239329
|
-
* @param clusters array of edge references
|
|
239330
|
-
* @param value visibility value (true or false)
|
|
239472
|
+
* @param polyface mesh to be edited.
|
|
239473
|
+
* @param clusters array of edge references.
|
|
239474
|
+
* @param value visibility value (true or false).
|
|
239331
239475
|
*/
|
|
239332
239476
|
static setEdgeVisibility(polyface, clusters, value) {
|
|
239333
239477
|
for (const cluster of clusters) {
|
|
@@ -239342,9 +239486,9 @@ class PolyfaceQuery {
|
|
|
239342
239486
|
}
|
|
239343
239487
|
/**
|
|
239344
239488
|
* Set the visibility of a particular edge of a particular facet.
|
|
239345
|
-
* @param polyface containing polyface
|
|
239346
|
-
* @param facetIndex facet index
|
|
239347
|
-
* @param vertexIndex vertex index (in vertex array) at which the edge starts
|
|
239489
|
+
* @param polyface containing polyface.
|
|
239490
|
+
* @param facetIndex facet index.
|
|
239491
|
+
* @param vertexIndex vertex index (in vertex array) at which the edge starts.
|
|
239348
239492
|
* @param value visibility value.
|
|
239349
239493
|
*/
|
|
239350
239494
|
static setSingleEdgeVisibility(polyface, facetIndex, vertexIndex, value) {
|
|
@@ -239357,9 +239501,9 @@ class PolyfaceQuery {
|
|
|
239357
239501
|
}
|
|
239358
239502
|
/**
|
|
239359
239503
|
* Get the visibility of a particular edge of a particular facet.
|
|
239360
|
-
* @param polyface containing polyface
|
|
239361
|
-
* @param facetIndex facet index
|
|
239362
|
-
* @param vertexIndex vertex index (in vertex array) at which the edge starts
|
|
239504
|
+
* @param polyface containing polyface.
|
|
239505
|
+
* @param facetIndex facet index.
|
|
239506
|
+
* @param vertexIndex vertex index (in vertex array) at which the edge starts.
|
|
239363
239507
|
*/
|
|
239364
239508
|
static getSingleEdgeVisibility(polyface, facetIndex, vertexIndex) {
|
|
239365
239509
|
const data = polyface.data;
|
|
@@ -239370,29 +239514,13 @@ class PolyfaceQuery {
|
|
|
239370
239514
|
return data.edgeVisible[i]; // return visibility of first edge in the face that starts at this vertex
|
|
239371
239515
|
return undefined;
|
|
239372
239516
|
}
|
|
239373
|
-
/** Load all half edges from a mesh to an IndexedEdgeMatcher.
|
|
239374
|
-
* @param polyface a mesh, or a visitor assumed to have numWrap === 1
|
|
239375
|
-
*/
|
|
239376
|
-
static createIndexedEdges(polyface) {
|
|
239377
|
-
if (polyface instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
239378
|
-
return this.createIndexedEdges(polyface.createVisitor(1));
|
|
239379
|
-
const edges = new _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.IndexedEdgeMatcher();
|
|
239380
|
-
polyface.reset();
|
|
239381
|
-
while (polyface.moveToNextFacet()) {
|
|
239382
|
-
const numEdges = polyface.pointCount - 1;
|
|
239383
|
-
for (let i = 0; i < numEdges; i++) {
|
|
239384
|
-
edges.addEdge(polyface.clientPointIndex(i), polyface.clientPointIndex(i + 1), polyface.currentReadIndex());
|
|
239385
|
-
}
|
|
239386
|
-
}
|
|
239387
|
-
return edges;
|
|
239388
|
-
}
|
|
239389
239517
|
/**
|
|
239390
239518
|
* Return manifold edge pairs whose dihedral angle is bounded by the given angle.
|
|
239391
239519
|
* * The dihedral angle of a manifold edge is measured between the normals of its two adjacent faces.
|
|
239392
239520
|
* * Boundary edges are not returned as they are not manifold.
|
|
239393
|
-
* @param mesh existing polyface or visitor
|
|
239394
|
-
* @param maxSmoothEdgeAngle maximum dihedral angle of a smooth edge. If undefined
|
|
239395
|
-
* @param sharpEdges true to reverse the angle threshold test and return sharp edges; otherwise return smooth edges (default)
|
|
239521
|
+
* @param mesh existing polyface or visitor.
|
|
239522
|
+
* @param maxSmoothEdgeAngle maximum dihedral angle of a smooth edge. If `undefined`, uses `Geometry.smallAngleRadians`.
|
|
239523
|
+
* @param sharpEdges true to reverse the angle threshold test and return sharp edges; otherwise return smooth edges (default).
|
|
239396
239524
|
*/
|
|
239397
239525
|
static collectEdgesByDihedralAngle(mesh, maxSmoothEdgeAngle, sharpEdges = false) {
|
|
239398
239526
|
if (mesh instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -239427,13 +239555,13 @@ class PolyfaceQuery {
|
|
|
239427
239555
|
return outEdges;
|
|
239428
239556
|
}
|
|
239429
239557
|
/**
|
|
239558
|
+
* Make paired edges invisible.
|
|
239430
239559
|
* * Find mated pairs among facet edges.
|
|
239431
239560
|
* * Mated pairs have the same vertex indices appearing in opposite order.
|
|
239432
239561
|
* * Mark all non-mated pairs visible.
|
|
239433
239562
|
* * At mated pairs
|
|
239434
239563
|
* * if angle across the edge is larger than `sharpEdgeAngle`, mark visible
|
|
239435
239564
|
* * otherwise mark invisible.
|
|
239436
|
-
* @param mesh mesh to be marked
|
|
239437
239565
|
*/
|
|
239438
239566
|
static markPairedEdgesInvisible(mesh, sharpEdgeAngle) {
|
|
239439
239567
|
const visitor = mesh.createVisitor(1);
|
|
@@ -239462,7 +239590,8 @@ class PolyfaceQuery {
|
|
|
239462
239590
|
}
|
|
239463
239591
|
}
|
|
239464
239592
|
}
|
|
239465
|
-
/**
|
|
239593
|
+
/**
|
|
239594
|
+
* Try to compute a unit normal for a facet accessible through a visitor.
|
|
239466
239595
|
* * Unit normal is computed by `PolygonOps.unitNormal` with the points around the facet.
|
|
239467
239596
|
*/
|
|
239468
239597
|
static computeFacetUnitNormal(visitor, facetIndex, result) {
|
|
@@ -239475,18 +239604,18 @@ class PolyfaceQuery {
|
|
|
239475
239604
|
return undefined;
|
|
239476
239605
|
}
|
|
239477
239606
|
/**
|
|
239478
|
-
|
|
239479
|
-
|
|
239480
|
-
|
|
239481
|
-
|
|
239607
|
+
* * Mark all edge visibilities in the IndexedPolyface.
|
|
239608
|
+
* @param mesh mesh to be marked.
|
|
239609
|
+
* @param value true for visible, false for hidden.
|
|
239610
|
+
*/
|
|
239482
239611
|
static markAllEdgeVisibility(mesh, value) {
|
|
239483
239612
|
const data = mesh.data;
|
|
239484
239613
|
for (let i = 0; i < data.edgeVisible.length; i++)
|
|
239485
239614
|
data.edgeVisible[i] = value;
|
|
239486
239615
|
}
|
|
239487
239616
|
/**
|
|
239488
|
-
* Create a HalfEdgeGraph with a face for each facet of the IndexedPolyface
|
|
239489
|
-
* @param mesh mesh to convert
|
|
239617
|
+
* Create a HalfEdgeGraph with a face for each facet of the IndexedPolyface.
|
|
239618
|
+
* @param mesh mesh to convert.
|
|
239490
239619
|
* @internal
|
|
239491
239620
|
*/
|
|
239492
239621
|
static convertToHalfEdgeGraph(mesh) {
|
|
@@ -239505,28 +239634,22 @@ class PolyfaceQuery {
|
|
|
239505
239634
|
});
|
|
239506
239635
|
return graph;
|
|
239507
239636
|
}
|
|
239508
|
-
/**
|
|
239509
|
-
* * Examine adjacent facet orientations throughout the mesh
|
|
239510
|
-
* * If possible, reverse a subset to achieve proper pairing.
|
|
239511
|
-
* @param mesh
|
|
239512
|
-
*/
|
|
239637
|
+
/** Examine adjacent facet orientations throughout the mesh. If possible, reverse a subset to achieve proper pairing. */
|
|
239513
239638
|
static reorientVertexOrderAroundFacetsForConsistentOrientation(mesh) {
|
|
239514
239639
|
return _FacetOrientation__WEBPACK_IMPORTED_MODULE_31__.FacetOrientationFixup.doFixup(mesh);
|
|
239515
239640
|
}
|
|
239516
|
-
/**
|
|
239517
|
-
* Set up indexed normals with one normal in the plane of each facet of the mesh.
|
|
239518
|
-
* @param polyface
|
|
239519
|
-
*/
|
|
239641
|
+
/** Set up indexed normals with one normal in the plane of each facet of the mesh. */
|
|
239520
239642
|
static buildPerFaceNormals(polyface) {
|
|
239521
239643
|
_multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_32__.BuildAverageNormalsContext.buildPerFaceNormals(polyface);
|
|
239522
239644
|
}
|
|
239523
239645
|
/**
|
|
239524
|
-
* * At each vertex of the mesh
|
|
239525
|
-
* * Find clusters of almost parallel normals
|
|
239526
|
-
* * Compute simple average of those normals
|
|
239527
|
-
* * Index to the averages
|
|
239646
|
+
* * At each vertex of the mesh:
|
|
239647
|
+
* * Find clusters of almost parallel normals.
|
|
239648
|
+
* * Compute simple average of those normals.
|
|
239649
|
+
* * Index to the averages.
|
|
239528
239650
|
* * For typical meshes, this correctly clusters adjacent normals.
|
|
239529
|
-
* * One can imagine a vertex with multiple "smooth cone-like" sets of
|
|
239651
|
+
* * One can imagine a vertex with multiple "smooth cone-like" sets of adjacent facets such that averaging occurs
|
|
239652
|
+
* among two nonadjacent cones. But this does not seem to be a problem in practice.
|
|
239530
239653
|
* @param polyface polyface to update.
|
|
239531
239654
|
* @param toleranceAngle averaging is done between normals up to this angle.
|
|
239532
239655
|
*/
|
|
@@ -239535,9 +239658,9 @@ class PolyfaceQuery {
|
|
|
239535
239658
|
}
|
|
239536
239659
|
/**
|
|
239537
239660
|
* Offset the faces of the mesh.
|
|
239538
|
-
* @param source original mesh
|
|
239661
|
+
* @param source original mesh.
|
|
239539
239662
|
* @param signedOffsetDistance distance to offset
|
|
239540
|
-
* @param offsetOptions angle options.
|
|
239663
|
+
* @param offsetOptions angle options. The default options are recommended.
|
|
239541
239664
|
* @returns shifted mesh.
|
|
239542
239665
|
*/
|
|
239543
239666
|
static cloneOffset(source, signedOffsetDistance, offsetOptions = OffsetMeshOptions.create()) {
|
|
@@ -239546,16 +239669,22 @@ class PolyfaceQuery {
|
|
|
239546
239669
|
_multiclip_OffsetMeshContext__WEBPACK_IMPORTED_MODULE_33__.OffsetMeshContext.buildOffsetMeshWithEdgeChamfers(source, offsetBuilder, signedOffsetDistance, offsetOptions);
|
|
239547
239670
|
return offsetBuilder.claimPolyface();
|
|
239548
239671
|
}
|
|
239549
|
-
/**
|
|
239550
|
-
*
|
|
239551
|
-
*
|
|
239672
|
+
/**
|
|
239673
|
+
* Search facets for the first one that intersects the infinite line.
|
|
239674
|
+
* * To process _all_ intersections, callers can supply an `options.acceptIntersection` callback that always
|
|
239675
|
+
* returns `false`.
|
|
239676
|
+
* In this case, `intersectRay3d` will return `undefined`, but the callback will be invoked for each intersection.
|
|
239552
239677
|
* * Example callback logic:
|
|
239553
239678
|
* * Accept the first found facet that intersects the half-line specified by the ray: `return detail.a >= 0.0;`
|
|
239554
|
-
* * Collect all intersections: `myIntersections.push(detail.clone()); return false;` Then after `intersectRay3d`
|
|
239555
|
-
*
|
|
239556
|
-
* @param
|
|
239557
|
-
* @param
|
|
239558
|
-
*
|
|
239679
|
+
* * Collect all intersections: `myIntersections.push(detail.clone()); return false;` Then after `intersectRay3d`
|
|
239680
|
+
* returns, sort along `ray` with `myIntersections.sort((d0, d1) => d0.a - d1.a);`
|
|
239681
|
+
* @param visitor facet iterator.
|
|
239682
|
+
* @param ray infinite line parameterized as a ray. The returned `detail.a` is the intersection parameter on the
|
|
239683
|
+
* ray, e.g., zero at `ray.origin` and increasing in `ray.direction`.
|
|
239684
|
+
* @param options options for computing and populating an intersection detail, and an optional callback for
|
|
239685
|
+
* accepting one.
|
|
239686
|
+
* @return detail for the (accepted) intersection with `detail.IsInsideOrOn === true`, or `undefined` if no
|
|
239687
|
+
* (accepted) intersection.
|
|
239559
239688
|
* @see PolygonOps.intersectRay3d
|
|
239560
239689
|
*/
|
|
239561
239690
|
static intersectRay3d(visitor, ray, options) {
|
|
@@ -239598,7 +239727,8 @@ class PolyfaceQuery {
|
|
|
239598
239727
|
}
|
|
239599
239728
|
// amount of computation to do per step of async methods.
|
|
239600
239729
|
PolyfaceQuery._asyncWorkLimit = 1.e06;
|
|
239601
|
-
/**
|
|
239730
|
+
/**
|
|
239731
|
+
* Number of "await" steps executed in recent async calls.
|
|
239602
239732
|
* @internal
|
|
239603
239733
|
*/
|
|
239604
239734
|
PolyfaceQuery.awaitBlockCount = 0;
|
|
@@ -248962,44 +249092,45 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
248962
249092
|
/* harmony export */ "DgnSpiralTypeQueries": () => (/* binding */ DgnSpiralTypeQueries)
|
|
248963
249093
|
/* harmony export */ });
|
|
248964
249094
|
/* 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");
|
|
248965
|
-
/* harmony import */ var
|
|
248966
|
-
/* harmony import */ var
|
|
248967
|
-
/* harmony import */ var
|
|
248968
|
-
/* harmony import */ var
|
|
248969
|
-
/* harmony import */ var
|
|
248970
|
-
/* harmony import */ var
|
|
248971
|
-
/* harmony import */ var
|
|
248972
|
-
/* harmony import */ var
|
|
248973
|
-
/* harmony import */ var
|
|
248974
|
-
/* harmony import */ var
|
|
248975
|
-
/* harmony import */ var
|
|
248976
|
-
/* harmony import */ var
|
|
248977
|
-
/* harmony import */ var
|
|
248978
|
-
/* harmony import */ var
|
|
248979
|
-
/* harmony import */ var
|
|
248980
|
-
/* harmony import */ var
|
|
248981
|
-
/* harmony import */ var
|
|
248982
|
-
/* harmony import */ var
|
|
248983
|
-
/* harmony import */ var
|
|
248984
|
-
/* harmony import */ var
|
|
248985
|
-
/* harmony import */ var
|
|
248986
|
-
/* harmony import */ var
|
|
248987
|
-
/* harmony import */ var
|
|
248988
|
-
/* harmony import */ var
|
|
248989
|
-
/* harmony import */ var
|
|
248990
|
-
/* harmony import */ var
|
|
248991
|
-
/* harmony import */ var
|
|
248992
|
-
/* harmony import */ var
|
|
248993
|
-
/* harmony import */ var
|
|
248994
|
-
/* harmony import */ var
|
|
248995
|
-
/* harmony import */ var
|
|
248996
|
-
/* harmony import */ var
|
|
248997
|
-
/* harmony import */ var
|
|
248998
|
-
/* harmony import */ var
|
|
248999
|
-
/* harmony import */ var
|
|
249000
|
-
/* harmony import */ var
|
|
249001
|
-
/* harmony import */ var
|
|
249002
|
-
/* harmony import */ var
|
|
249095
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
249096
|
+
/* harmony import */ var _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../bspline/AkimaCurve3d */ "../../core/geometry/lib/esm/bspline/AkimaCurve3d.js");
|
|
249097
|
+
/* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
|
|
249098
|
+
/* harmony import */ var _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../bspline/BSplineCurve3dH */ "../../core/geometry/lib/esm/bspline/BSplineCurve3dH.js");
|
|
249099
|
+
/* harmony import */ var _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../bspline/BSplineSurface */ "../../core/geometry/lib/esm/bspline/BSplineSurface.js");
|
|
249100
|
+
/* harmony import */ var _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../bspline/InterpolationCurve3d */ "../../core/geometry/lib/esm/bspline/InterpolationCurve3d.js");
|
|
249101
|
+
/* harmony import */ var _curve_Arc3d__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../curve/Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
249102
|
+
/* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
249103
|
+
/* harmony import */ var _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../curve/GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
249104
|
+
/* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
249105
|
+
/* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
249106
|
+
/* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
249107
|
+
/* harmony import */ var _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../curve/ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
|
|
249108
|
+
/* harmony import */ var _curve_Path__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../curve/Path */ "../../core/geometry/lib/esm/curve/Path.js");
|
|
249109
|
+
/* harmony import */ var _curve_PointString3d__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../curve/PointString3d */ "../../core/geometry/lib/esm/curve/PointString3d.js");
|
|
249110
|
+
/* harmony import */ var _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../curve/spiral/DirectSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/DirectSpiral3d.js");
|
|
249111
|
+
/* harmony import */ var _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../curve/spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
|
|
249112
|
+
/* harmony import */ var _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../curve/spiral/TransitionSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/TransitionSpiral3d.js");
|
|
249113
|
+
/* harmony import */ var _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../curve/UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
|
|
249114
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
249115
|
+
/* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
249116
|
+
/* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
|
|
249117
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
249118
|
+
/* harmony import */ var _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/PointHelpers */ "../../core/geometry/lib/esm/geometry3d/PointHelpers.js");
|
|
249119
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
249120
|
+
/* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
|
|
249121
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
249122
|
+
/* harmony import */ var _polyface_AuxData__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../polyface/AuxData */ "../../core/geometry/lib/esm/polyface/AuxData.js");
|
|
249123
|
+
/* harmony import */ var _polyface_Polyface__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../polyface/Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
249124
|
+
/* harmony import */ var _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../polyface/TaggedNumericData */ "../../core/geometry/lib/esm/polyface/TaggedNumericData.js");
|
|
249125
|
+
/* harmony import */ var _solid_Box__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../solid/Box */ "../../core/geometry/lib/esm/solid/Box.js");
|
|
249126
|
+
/* harmony import */ var _solid_Cone__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../solid/Cone */ "../../core/geometry/lib/esm/solid/Cone.js");
|
|
249127
|
+
/* harmony import */ var _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../solid/LinearSweep */ "../../core/geometry/lib/esm/solid/LinearSweep.js");
|
|
249128
|
+
/* harmony import */ var _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../solid/RotationalSweep */ "../../core/geometry/lib/esm/solid/RotationalSweep.js");
|
|
249129
|
+
/* harmony import */ var _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../solid/RuledSweep */ "../../core/geometry/lib/esm/solid/RuledSweep.js");
|
|
249130
|
+
/* harmony import */ var _solid_Sphere__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../solid/Sphere */ "../../core/geometry/lib/esm/solid/Sphere.js");
|
|
249131
|
+
/* harmony import */ var _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../solid/TorusPipe */ "../../core/geometry/lib/esm/solid/TorusPipe.js");
|
|
249132
|
+
/* harmony import */ var _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BGFBAccessors */ "../../core/geometry/lib/esm/serialization/BGFBAccessors.js");
|
|
249133
|
+
/* harmony import */ var _SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SerializationHelpers */ "../../core/geometry/lib/esm/serialization/SerializationHelpers.js");
|
|
249003
249134
|
/*---------------------------------------------------------------------------------------------
|
|
249004
249135
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
249005
249136
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -249041,6 +249172,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
249041
249172
|
|
|
249042
249173
|
|
|
249043
249174
|
|
|
249175
|
+
|
|
249044
249176
|
|
|
249045
249177
|
|
|
249046
249178
|
/** * Context to write to a flatbuffer blob.
|
|
@@ -249058,8 +249190,8 @@ class BGFBReader {
|
|
|
249058
249190
|
readBSplineSurfaceFromVariant(variantHeader) {
|
|
249059
249191
|
let newSurface;
|
|
249060
249192
|
const geometryType = variantHeader.geometryType();
|
|
249061
|
-
if (geometryType ===
|
|
249062
|
-
const bsurfHeader = variantHeader.geometry(new
|
|
249193
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagBsplineSurface) {
|
|
249194
|
+
const bsurfHeader = variantHeader.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.BsplineSurface());
|
|
249063
249195
|
if (bsurfHeader !== null) {
|
|
249064
249196
|
const orderU = bsurfHeader.orderU();
|
|
249065
249197
|
const orderV = bsurfHeader.orderV();
|
|
@@ -249072,23 +249204,23 @@ class BGFBReader {
|
|
|
249072
249204
|
const closedU = bsurfHeader.closedU();
|
|
249073
249205
|
const closedV = bsurfHeader.closedV();
|
|
249074
249206
|
if (xyzArray !== null && knotArrayU !== null && knotArrayV !== null) {
|
|
249075
|
-
const myData =
|
|
249207
|
+
const myData = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.createBSplineSurfaceData(xyzArray, 3, knotArrayU, numPolesU, orderU, knotArrayV, numPolesV, orderV);
|
|
249076
249208
|
if (weightArray !== null)
|
|
249077
249209
|
myData.weights = weightArray;
|
|
249078
249210
|
if (closedU)
|
|
249079
249211
|
myData.uParams.closed = true;
|
|
249080
249212
|
if (closedV)
|
|
249081
249213
|
myData.vParams.closed = true;
|
|
249082
|
-
if (
|
|
249214
|
+
if (_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.Import.prepareBSplineSurfaceData(myData, { jsonPoles: false })) {
|
|
249083
249215
|
if (undefined === myData.weights)
|
|
249084
|
-
newSurface =
|
|
249216
|
+
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);
|
|
249085
249217
|
else
|
|
249086
|
-
newSurface =
|
|
249218
|
+
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);
|
|
249087
249219
|
if (undefined !== newSurface) {
|
|
249088
249220
|
if (undefined !== myData.uParams.wrapMode)
|
|
249089
|
-
newSurface.setWrappable(
|
|
249221
|
+
newSurface.setWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_4__.UVSelect.uDirection, myData.uParams.wrapMode);
|
|
249090
249222
|
if (undefined !== myData.vParams.wrapMode)
|
|
249091
|
-
newSurface.setWrappable(
|
|
249223
|
+
newSurface.setWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_4__.UVSelect.vDirection, myData.vParams.wrapMode);
|
|
249092
249224
|
}
|
|
249093
249225
|
}
|
|
249094
249226
|
}
|
|
@@ -249104,11 +249236,11 @@ class BGFBReader {
|
|
|
249104
249236
|
const xyzArray = header.fitPointsArray();
|
|
249105
249237
|
if (xyzArray instanceof Float64Array) {
|
|
249106
249238
|
const knots = header.knotsArray();
|
|
249107
|
-
const options = new
|
|
249239
|
+
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);
|
|
249108
249240
|
const startTangent = header.startTangent();
|
|
249109
249241
|
const endTangent = header.endTangent();
|
|
249110
|
-
options.captureOptionalProps(header.order(), header.closed(), header.isChordLenKnots(), header.isColinearTangents(), header.isChordLenTangents(), header.isNaturalTangents(), startTangent !== null ?
|
|
249111
|
-
return
|
|
249242
|
+
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);
|
|
249243
|
+
return _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_5__.InterpolationCurve3d.createCapture(options);
|
|
249112
249244
|
}
|
|
249113
249245
|
return undefined;
|
|
249114
249246
|
}
|
|
@@ -249119,8 +249251,8 @@ class BGFBReader {
|
|
|
249119
249251
|
readAkimaCurve3d(header) {
|
|
249120
249252
|
const xyzArray = header.pointsArray();
|
|
249121
249253
|
if (xyzArray instanceof Float64Array) {
|
|
249122
|
-
const options = new
|
|
249123
|
-
return
|
|
249254
|
+
const options = new _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_8__.AkimaCurve3dOptions(_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_6__.Point3dArray.clonePoint3dArray(xyzArray));
|
|
249255
|
+
return _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_8__.AkimaCurve3d.createCapture(options);
|
|
249124
249256
|
}
|
|
249125
249257
|
return undefined;
|
|
249126
249258
|
}
|
|
@@ -249137,17 +249269,17 @@ class BGFBReader {
|
|
|
249137
249269
|
const closed = header.closed();
|
|
249138
249270
|
if (xyzArray !== null && knots !== null) {
|
|
249139
249271
|
const numPoles = Math.floor(xyzArray.length / 3);
|
|
249140
|
-
const myData =
|
|
249272
|
+
const myData = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.createBSplineCurveData(xyzArray, 3, knots, numPoles, order);
|
|
249141
249273
|
if (closed)
|
|
249142
249274
|
myData.params.closed = true;
|
|
249143
249275
|
if (weightsArray === null) {
|
|
249144
|
-
if (
|
|
249145
|
-
newCurve =
|
|
249276
|
+
if (_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.Import.prepareBSplineCurveData(myData))
|
|
249277
|
+
newCurve = _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_9__.BSplineCurve3d.create(myData.poles, myData.params.knots, myData.params.order);
|
|
249146
249278
|
}
|
|
249147
249279
|
else {
|
|
249148
249280
|
myData.weights = weightsArray;
|
|
249149
|
-
if (
|
|
249150
|
-
newCurve =
|
|
249281
|
+
if (_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.Import.prepareBSplineCurveData(myData, { jsonPoles: false }))
|
|
249282
|
+
newCurve = _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_10__.BSplineCurve3dH.create({ xyz: myData.poles, weights: myData.weights }, myData.params.knots, myData.params.order);
|
|
249151
249283
|
}
|
|
249152
249284
|
if (undefined !== newCurve) {
|
|
249153
249285
|
if (undefined !== myData.params.wrapMode)
|
|
@@ -249171,17 +249303,17 @@ class BGFBReader {
|
|
|
249171
249303
|
const bearing0Radians = detailHeader.bearing0Radians();
|
|
249172
249304
|
const bearing1Radians = detailHeader.bearing1Radians();
|
|
249173
249305
|
const fbTransform = detailHeader.transform();
|
|
249174
|
-
const localToWorld = fbTransform ?
|
|
249175
|
-
|
|
249176
|
-
const activeFractionInterval =
|
|
249306
|
+
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()) :
|
|
249307
|
+
_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_11__.Transform.createIdentity();
|
|
249308
|
+
const activeFractionInterval = _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_12__.Segment1d.create(detailHeader.fractionA(), detailHeader.fractionB());
|
|
249177
249309
|
if (!directDetailHeader) {
|
|
249178
|
-
const integratedSpiral =
|
|
249310
|
+
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);
|
|
249179
249311
|
if (integratedSpiral)
|
|
249180
249312
|
return integratedSpiral;
|
|
249181
|
-
const radius0 =
|
|
249182
|
-
const radius1 =
|
|
249183
|
-
const arcLength =
|
|
249184
|
-
const directSpiral =
|
|
249313
|
+
const radius0 = _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_15__.TransitionSpiral3d.curvatureToRadius(curvature0);
|
|
249314
|
+
const radius1 = _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_15__.TransitionSpiral3d.curvatureToRadius(curvature1);
|
|
249315
|
+
const arcLength = _curve_spiral_TransitionSpiral3d__WEBPACK_IMPORTED_MODULE_15__.TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(radius0, radius1, bearing1Radians - bearing0Radians);
|
|
249316
|
+
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);
|
|
249185
249317
|
if (directSpiral)
|
|
249186
249318
|
return directSpiral;
|
|
249187
249319
|
}
|
|
@@ -249194,42 +249326,42 @@ class BGFBReader {
|
|
|
249194
249326
|
*/
|
|
249195
249327
|
readCurvePrimitiveFromVariant(variant) {
|
|
249196
249328
|
const geometryType = variant.geometryType();
|
|
249197
|
-
if (geometryType ===
|
|
249198
|
-
const offsetToLineSegment = variant.geometry(new
|
|
249329
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagLineSegment) {
|
|
249330
|
+
const offsetToLineSegment = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.LineSegment());
|
|
249199
249331
|
const offsetToCoordinates = offsetToLineSegment.segment();
|
|
249200
|
-
return
|
|
249332
|
+
return _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_18__.LineSegment3d.createXYZXYZ(offsetToCoordinates.point0X(), offsetToCoordinates.point0Y(), offsetToCoordinates.point0Z(), offsetToCoordinates.point1X(), offsetToCoordinates.point1Y(), offsetToCoordinates.point1Z());
|
|
249201
249333
|
}
|
|
249202
|
-
else if (geometryType ===
|
|
249203
|
-
const offsetToEllipticArc = variant.geometry(new
|
|
249334
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagEllipticArc) {
|
|
249335
|
+
const offsetToEllipticArc = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.EllipticArc());
|
|
249204
249336
|
const offsetToCoordinates = offsetToEllipticArc.arc();
|
|
249205
|
-
return
|
|
249337
|
+
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()));
|
|
249206
249338
|
}
|
|
249207
|
-
else if (geometryType ===
|
|
249208
|
-
const offsetToLineString = variant.geometry(new
|
|
249339
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagLineString) {
|
|
249340
|
+
const offsetToLineString = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.LineString());
|
|
249209
249341
|
const numCoordinates = offsetToLineString.pointsLength();
|
|
249210
|
-
const result =
|
|
249342
|
+
const result = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_20__.LineString3d.create();
|
|
249211
249343
|
for (let i = 0; i + 2 < numCoordinates; i += 3) {
|
|
249212
249344
|
result.packedPoints.pushXYZ(offsetToLineString.points(i), offsetToLineString.points(i + 1), offsetToLineString.points(i + 2));
|
|
249213
249345
|
}
|
|
249214
249346
|
return result;
|
|
249215
249347
|
}
|
|
249216
|
-
else if (geometryType ===
|
|
249217
|
-
const offsetToBCurve = variant.geometry(new
|
|
249348
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagBsplineCurve) {
|
|
249349
|
+
const offsetToBCurve = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.BsplineCurve());
|
|
249218
249350
|
if (offsetToBCurve !== null)
|
|
249219
249351
|
return this.readBSplineCurve(offsetToBCurve);
|
|
249220
249352
|
}
|
|
249221
|
-
else if (geometryType ===
|
|
249222
|
-
const offsetToTransitionSpiralTable = variant.geometry(new
|
|
249353
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagTransitionSpiral) {
|
|
249354
|
+
const offsetToTransitionSpiralTable = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.TransitionSpiral());
|
|
249223
249355
|
if (offsetToTransitionSpiralTable !== null)
|
|
249224
249356
|
return this.readTransitionSpiral(offsetToTransitionSpiralTable);
|
|
249225
249357
|
}
|
|
249226
|
-
else if (geometryType ===
|
|
249227
|
-
const offsetToInterpolationCurveTable = variant.geometry(new
|
|
249358
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagInterpolationCurve) {
|
|
249359
|
+
const offsetToInterpolationCurveTable = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.InterpolationCurve());
|
|
249228
249360
|
if (offsetToInterpolationCurveTable !== null)
|
|
249229
249361
|
return this.readInterpolationCurve3d(offsetToInterpolationCurveTable);
|
|
249230
249362
|
}
|
|
249231
|
-
else if (geometryType ===
|
|
249232
|
-
const offsetToAkimaCurveTable = variant.geometry(new
|
|
249363
|
+
else if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagAkimaCurve) {
|
|
249364
|
+
const offsetToAkimaCurveTable = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.AkimaCurve());
|
|
249233
249365
|
if (offsetToAkimaCurveTable !== null)
|
|
249234
249366
|
return this.readAkimaCurve3d(offsetToAkimaCurveTable);
|
|
249235
249367
|
}
|
|
@@ -249241,34 +249373,28 @@ class BGFBReader {
|
|
|
249241
249373
|
*/
|
|
249242
249374
|
readPointStringFromVariant(variant) {
|
|
249243
249375
|
const geometryType = variant.geometryType();
|
|
249244
|
-
if (geometryType ===
|
|
249245
|
-
const offsetToLineString = variant.geometry(new
|
|
249376
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagPointString) {
|
|
249377
|
+
const offsetToLineString = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.PointString());
|
|
249246
249378
|
const numCoordinates = offsetToLineString.pointsLength();
|
|
249247
|
-
const result =
|
|
249379
|
+
const result = _curve_PointString3d__WEBPACK_IMPORTED_MODULE_21__.PointString3d.create();
|
|
249248
249380
|
for (let i = 0; i + 2 < numCoordinates; i += 3) {
|
|
249249
|
-
result.points.push(
|
|
249381
|
+
result.points.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(offsetToLineString.points(i), offsetToLineString.points(i + 1), offsetToLineString.points(i + 2)));
|
|
249250
249382
|
}
|
|
249251
249383
|
return result;
|
|
249252
249384
|
}
|
|
249253
249385
|
return undefined;
|
|
249254
249386
|
}
|
|
249255
|
-
/**
|
|
249256
|
-
* Extract auxData for a mesh
|
|
249257
|
-
* @param variant read position in the flat buffer.
|
|
249258
|
-
*/
|
|
249387
|
+
/** Extract auxData channel data for a mesh */
|
|
249259
249388
|
readPolyfaceAuxChannelData(channelDataHeader) {
|
|
249260
249389
|
if (channelDataHeader !== null) {
|
|
249261
249390
|
const input = channelDataHeader.input();
|
|
249262
249391
|
const values = channelDataHeader.valuesArray();
|
|
249263
249392
|
if (values !== null)
|
|
249264
|
-
return new
|
|
249393
|
+
return new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_22__.AuxChannelData(input, values);
|
|
249265
249394
|
}
|
|
249266
249395
|
return undefined;
|
|
249267
249396
|
}
|
|
249268
|
-
/**
|
|
249269
|
-
* Extract auxData for a mesh
|
|
249270
|
-
* @param variant read position in the flat buffer.
|
|
249271
|
-
*/
|
|
249397
|
+
/** Extract auxData channel for a mesh */
|
|
249272
249398
|
readPolyfaceAuxChannel(channelHeader) {
|
|
249273
249399
|
if (channelHeader) {
|
|
249274
249400
|
const dataType = channelHeader.dataType();
|
|
@@ -249281,43 +249407,107 @@ class BGFBReader {
|
|
|
249281
249407
|
if (channelData)
|
|
249282
249408
|
channelDataArray.push(channelData);
|
|
249283
249409
|
}
|
|
249284
|
-
return new
|
|
249410
|
+
return new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_22__.AuxChannel(channelDataArray, dataType, name ? name : undefined, inputName ? inputName : undefined);
|
|
249285
249411
|
}
|
|
249286
249412
|
return undefined;
|
|
249287
249413
|
}
|
|
249288
|
-
/**
|
|
249289
|
-
|
|
249290
|
-
|
|
249291
|
-
|
|
249292
|
-
|
|
249293
|
-
if (
|
|
249294
|
-
|
|
249295
|
-
|
|
249296
|
-
|
|
249297
|
-
|
|
249298
|
-
|
|
249299
|
-
|
|
249300
|
-
|
|
249301
|
-
|
|
249302
|
-
|
|
249303
|
-
|
|
249304
|
-
|
|
249305
|
-
|
|
249306
|
-
|
|
249307
|
-
|
|
249308
|
-
|
|
249309
|
-
|
|
249310
|
-
|
|
249414
|
+
/** Compute the number of logical entries in every flat data array in the AuxData */
|
|
249415
|
+
static channelDataLength(fbAuxData) {
|
|
249416
|
+
if (fbAuxData.channelsLength() <= 0)
|
|
249417
|
+
return 0;
|
|
249418
|
+
const fbChannel0 = nullToUndefined(fbAuxData.channels(0));
|
|
249419
|
+
if (!fbChannel0)
|
|
249420
|
+
return 0;
|
|
249421
|
+
const numChannel0Data = fbChannel0.dataLength();
|
|
249422
|
+
if (numChannel0Data <= 0)
|
|
249423
|
+
return 0;
|
|
249424
|
+
const fbChannel0Data0 = nullToUndefined(fbChannel0.data(0));
|
|
249425
|
+
if (!fbChannel0Data0)
|
|
249426
|
+
return 0;
|
|
249427
|
+
const numChannelDataValues = fbChannel0Data0.valuesLength();
|
|
249428
|
+
if (numChannelDataValues <= 0)
|
|
249429
|
+
return 0;
|
|
249430
|
+
return numChannelDataValues / _polyface_AuxData__WEBPACK_IMPORTED_MODULE_22__.AuxChannel.entriesPerValue(fbChannel0.dataType());
|
|
249431
|
+
}
|
|
249432
|
+
/** Examine int array for range and zero count */
|
|
249433
|
+
countIntArray(ints) {
|
|
249434
|
+
let min = Infinity;
|
|
249435
|
+
let max = -Infinity;
|
|
249436
|
+
let numZeroes = 0;
|
|
249437
|
+
for (const i of ints) {
|
|
249438
|
+
if (min > i)
|
|
249439
|
+
min = i;
|
|
249440
|
+
if (max < i)
|
|
249441
|
+
max = i;
|
|
249442
|
+
if (0 === i)
|
|
249443
|
+
++numZeroes;
|
|
249444
|
+
}
|
|
249445
|
+
return { min, max, numZeroes };
|
|
249446
|
+
}
|
|
249447
|
+
/**
|
|
249448
|
+
* Extract auxData for a mesh.
|
|
249449
|
+
* Typescript object format for Polyface/PolyfaceAuxData indices is 0-based, unterminated.
|
|
249450
|
+
* FlatBuffer format for Polyface/PolyfaceAuxData indices is 1-based, 0-terminated/padded.
|
|
249451
|
+
* Typescript API previously wrote FlatBuffer PolyfaceAuxData indices as 0-based, unterminated;
|
|
249452
|
+
* heuristics are used herein to identify this legacy format so it can still be read.
|
|
249453
|
+
*/
|
|
249454
|
+
readPolyfaceAuxData(fbPolyface, fbAuxData) {
|
|
249455
|
+
if (!fbPolyface || !fbAuxData)
|
|
249456
|
+
return undefined;
|
|
249457
|
+
const fbPointIndices = nullToUndefined(fbPolyface.pointIndexArray());
|
|
249458
|
+
const fbAuxIndices = nullToUndefined(fbAuxData.indicesArray());
|
|
249459
|
+
const numChannels = fbAuxData.channelsLength();
|
|
249460
|
+
const fbNumData = BGFBReader.channelDataLength(fbAuxData);
|
|
249461
|
+
if (!fbPointIndices || !fbPointIndices.length || !fbAuxIndices || !fbAuxIndices.length || numChannels <= 0 || fbNumData <= 0)
|
|
249462
|
+
return undefined;
|
|
249463
|
+
const numPerFace = fbPolyface.numPerFace();
|
|
249464
|
+
// HEURISTICS to detect legacy AuxData indices, previously mistakenly serialized by BGFBWriter.writePolyfaceAsFBVariantGeometry as 0-based unblocked indices
|
|
249465
|
+
let isLegacy = false;
|
|
249466
|
+
const pointIndicesPadCount = fbPointIndices.filter((index) => index === 0).length;
|
|
249467
|
+
if (numPerFace > 1) {
|
|
249468
|
+
const auxIndexCounts = this.countIntArray(fbAuxIndices);
|
|
249469
|
+
if (auxIndexCounts.max > fbNumData) // auxIndices invalid
|
|
249470
|
+
return undefined;
|
|
249471
|
+
if (auxIndexCounts.max === fbNumData) // auxIndices 1-based
|
|
249472
|
+
isLegacy = false;
|
|
249473
|
+
else if (auxIndexCounts.max <= 0 || auxIndexCounts.min < 0) // auxIndices 1-based (signed)
|
|
249474
|
+
isLegacy = false;
|
|
249475
|
+
else if (auxIndexCounts.min === 0) // auxIndices likely legacy 0-based index, but could be modern with padding
|
|
249476
|
+
isLegacy = pointIndicesPadCount !== auxIndexCounts.numZeroes;
|
|
249477
|
+
else if (auxIndexCounts.min > 0) // auxIndices likely modern without padding, but could be legacy if first datum not indexed
|
|
249478
|
+
isLegacy = pointIndicesPadCount > 0;
|
|
249311
249479
|
}
|
|
249312
|
-
|
|
249480
|
+
else {
|
|
249481
|
+
isLegacy = (fbAuxIndices.length < fbPointIndices.length) && (fbAuxIndices.length + pointIndicesPadCount === fbPointIndices.length);
|
|
249482
|
+
}
|
|
249483
|
+
if (!isLegacy && fbAuxIndices.length !== fbPointIndices.length)
|
|
249484
|
+
return undefined; // auxIndices invalid
|
|
249485
|
+
const indices = [];
|
|
249486
|
+
if (isLegacy)
|
|
249487
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesWithExternalBlocking(fbAuxIndices, fbPointIndices, numPerFace, (i0) => { indices.push(i0); });
|
|
249488
|
+
else
|
|
249489
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(fbAuxIndices, numPerFace, (i0) => { indices.push(i0); });
|
|
249490
|
+
if (indices.length + pointIndicesPadCount !== fbPointIndices.length)
|
|
249491
|
+
return undefined;
|
|
249492
|
+
const maxIndex = Math.max(...indices);
|
|
249493
|
+
const channels = [];
|
|
249494
|
+
for (let i = 0; i < numChannels; i++) {
|
|
249495
|
+
const channelHeader = fbAuxData.channels(i);
|
|
249496
|
+
const channelContent = this.readPolyfaceAuxChannel(channelHeader);
|
|
249497
|
+
if (channelContent) {
|
|
249498
|
+
if (maxIndex >= channelContent.valueCount)
|
|
249499
|
+
return undefined; // invalid index
|
|
249500
|
+
channels.push(channelContent);
|
|
249501
|
+
}
|
|
249502
|
+
}
|
|
249503
|
+
if (!channels.length)
|
|
249504
|
+
return undefined;
|
|
249505
|
+
return new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_22__.PolyfaceAuxData(channels, indices);
|
|
249313
249506
|
}
|
|
249314
|
-
/**
|
|
249315
|
-
* Extract auxData for a mesh
|
|
249316
|
-
* @param variant read position in the flat buffer.
|
|
249317
|
-
*/
|
|
249507
|
+
/** Extract tagged numeric data for a mesh */
|
|
249318
249508
|
readTaggedNumericData(accessor) {
|
|
249319
249509
|
if (accessor) {
|
|
249320
|
-
const taggedNumericData = new
|
|
249510
|
+
const taggedNumericData = new _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_23__.TaggedNumericData(accessor.tagA(), accessor.tagB());
|
|
249321
249511
|
const intDataArray = nullToUndefined(accessor.intDataArray());
|
|
249322
249512
|
const doubleDataArray = nullToUndefined(accessor.doubleDataArray());
|
|
249323
249513
|
if (intDataArray) {
|
|
@@ -249335,13 +249525,13 @@ class BGFBReader {
|
|
|
249335
249525
|
return undefined;
|
|
249336
249526
|
}
|
|
249337
249527
|
/**
|
|
249338
|
-
|
|
249339
|
-
|
|
249340
|
-
|
|
249528
|
+
* Extract a mesh
|
|
249529
|
+
* @param variant read position in the flat buffer.
|
|
249530
|
+
*/
|
|
249341
249531
|
readPolyfaceFromVariant(variant) {
|
|
249342
249532
|
const geometryType = variant.geometryType();
|
|
249343
|
-
if (geometryType ===
|
|
249344
|
-
const polyfaceHeader = variant.geometry(new
|
|
249533
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagPolyface) {
|
|
249534
|
+
const polyfaceHeader = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.Polyface());
|
|
249345
249535
|
if (polyfaceHeader) {
|
|
249346
249536
|
const twoSided = polyfaceHeader.twoSided();
|
|
249347
249537
|
const expectedClosure = polyfaceHeader.expectedClosure();
|
|
@@ -249356,59 +249546,35 @@ class BGFBReader {
|
|
|
249356
249546
|
const normalIndexI32 = nullToUndefined(polyfaceHeader.normalIndexArray());
|
|
249357
249547
|
const colorIndexI32 = nullToUndefined(polyfaceHeader.colorIndexArray());
|
|
249358
249548
|
const taggedNumericDataOffset = polyfaceHeader.taggedNumericData();
|
|
249549
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_1__.assert)(meshStyle === 1, "Unrecognized flatbuffer mesh style");
|
|
249550
|
+
// The flatbuffer data is one based.
|
|
249551
|
+
// If numPerFace is less than 2, facets are variable size and zero terminated
|
|
249552
|
+
// If numPerFace is 2 or more, indices are blocked
|
|
249359
249553
|
if (meshStyle === 1 && pointF64 && pointIndexI32) {
|
|
249360
|
-
const polyface =
|
|
249554
|
+
const polyface = _polyface_Polyface__WEBPACK_IMPORTED_MODULE_24__.IndexedPolyface.create();
|
|
249555
|
+
polyface.twoSided = twoSided;
|
|
249361
249556
|
polyface.expectedClosure = expectedClosure;
|
|
249362
|
-
|
|
249363
|
-
|
|
249364
|
-
|
|
249365
|
-
|
|
249366
|
-
polyface.data.param.pushXY(paramF64[i], paramF64[i + 1]);
|
|
249557
|
+
if (normalF64 && normalIndexI32) {
|
|
249558
|
+
for (let i = 0; i + 2 < normalF64.length; i += 3)
|
|
249559
|
+
polyface.addNormalXYZ(normalF64[i], normalF64[i + 1], normalF64[i + 2]);
|
|
249560
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(normalIndexI32, numPerFace, (i) => { polyface.addNormalIndex(i); });
|
|
249367
249561
|
}
|
|
249368
|
-
if (
|
|
249369
|
-
for (let i = 0; i +
|
|
249370
|
-
polyface.
|
|
249562
|
+
if (paramF64 && paramIndexI32) {
|
|
249563
|
+
for (let i = 0; i + 1 < paramF64.length; i += 2)
|
|
249564
|
+
polyface.addParamUV(paramF64[i], paramF64[i + 1]);
|
|
249565
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(paramIndexI32, numPerFace, (i) => { polyface.addParamIndex(i); });
|
|
249371
249566
|
}
|
|
249372
|
-
if (intColorU32) {
|
|
249567
|
+
if (intColorU32 && colorIndexI32) {
|
|
249373
249568
|
for (const c of intColorU32)
|
|
249374
|
-
polyface.
|
|
249569
|
+
polyface.addColor(c);
|
|
249570
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(colorIndexI32, numPerFace, (i) => { polyface.addColorIndex(i); });
|
|
249375
249571
|
}
|
|
249376
|
-
|
|
249377
|
-
|
|
249378
|
-
|
|
249379
|
-
|
|
249380
|
-
|
|
249381
|
-
|
|
249382
|
-
const q = pointIndexI32[k];
|
|
249383
|
-
polyface.addPointIndex(Math.abs(q) - 1, q > 0);
|
|
249384
|
-
if (normalF64 && normalIndexI32) {
|
|
249385
|
-
polyface.addNormalIndex(Math.abs(normalIndexI32[k]) - 1);
|
|
249386
|
-
}
|
|
249387
|
-
if (paramF64 && paramIndexI32) {
|
|
249388
|
-
polyface.addParamIndex(Math.abs(paramIndexI32[k]) - 1);
|
|
249389
|
-
}
|
|
249390
|
-
if (intColorU32 && colorIndexI32) {
|
|
249391
|
-
polyface.addColorIndex(Math.abs(colorIndexI32[k]) - 1);
|
|
249392
|
-
}
|
|
249393
|
-
}
|
|
249394
|
-
};
|
|
249395
|
-
if (numPerFace > 1) {
|
|
249396
|
-
for (let i0 = 0; i0 + numPerFace <= numIndex; i0 += numPerFace) {
|
|
249397
|
-
addIndicesInBlock(i0, i0 + numPerFace);
|
|
249398
|
-
polyface.terminateFacet(true);
|
|
249399
|
-
}
|
|
249400
|
-
}
|
|
249401
|
-
else {
|
|
249402
|
-
let i0 = 0;
|
|
249403
|
-
for (let i1 = i0; i1 < numIndex; i1++) {
|
|
249404
|
-
if (pointIndexI32[i1] === 0) {
|
|
249405
|
-
addIndicesInBlock(i0, i1);
|
|
249406
|
-
polyface.terminateFacet(true);
|
|
249407
|
-
i0 = i1 + 1;
|
|
249408
|
-
}
|
|
249409
|
-
}
|
|
249410
|
-
}
|
|
249411
|
-
polyface.data.auxData = this.readPolyfaceAuxData(polyfaceHeader.auxData());
|
|
249572
|
+
for (let i = 0; i + 2 < pointF64.length; i += 3)
|
|
249573
|
+
polyface.addPointXYZ(pointF64[i], pointF64[i + 1], pointF64[i + 2]);
|
|
249574
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_3__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(pointIndexI32, numPerFace, (i, v) => { polyface.addPointIndex(i, v); }, () => { polyface.terminateFacet(false); });
|
|
249575
|
+
if (!polyface.validateAllIndices())
|
|
249576
|
+
return undefined;
|
|
249577
|
+
polyface.data.auxData = this.readPolyfaceAuxData(polyfaceHeader, polyfaceHeader.auxData());
|
|
249412
249578
|
if (taggedNumericDataOffset) {
|
|
249413
249579
|
const taggedNumericDataAccessor = nullToUndefined(taggedNumericDataOffset);
|
|
249414
249580
|
if (taggedNumericDataAccessor !== undefined) {
|
|
@@ -249448,8 +249614,8 @@ class BGFBReader {
|
|
|
249448
249614
|
*/
|
|
249449
249615
|
readCurveCollectionFromVariantGeometry(variant) {
|
|
249450
249616
|
const geometryType = variant.geometryType();
|
|
249451
|
-
if (geometryType ===
|
|
249452
|
-
const cvTable = variant.geometry(new
|
|
249617
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagCurveVector) {
|
|
249618
|
+
const cvTable = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.CurveVector());
|
|
249453
249619
|
return this.readCurveCollectionFromCurveVectorTable(cvTable);
|
|
249454
249620
|
}
|
|
249455
249621
|
return undefined;
|
|
@@ -249460,66 +249626,66 @@ class BGFBReader {
|
|
|
249460
249626
|
*/
|
|
249461
249627
|
readSolidPrimitiveFromVariant(variant) {
|
|
249462
249628
|
const geometryType = variant.geometryType();
|
|
249463
|
-
if (geometryType ===
|
|
249464
|
-
const header = variant.geometry(new
|
|
249629
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnBox) {
|
|
249630
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnBox());
|
|
249465
249631
|
const detail = header.detail();
|
|
249466
|
-
return
|
|
249632
|
+
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());
|
|
249467
249633
|
}
|
|
249468
|
-
if (geometryType ===
|
|
249469
|
-
const header = variant.geometry(new
|
|
249634
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnSphere) {
|
|
249635
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnSphere());
|
|
249470
249636
|
const detail = header.detail();
|
|
249471
249637
|
const lToWDetail = detail.localToWorld();
|
|
249472
|
-
const localToWorld =
|
|
249473
|
-
return
|
|
249638
|
+
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());
|
|
249639
|
+
return _solid_Sphere__WEBPACK_IMPORTED_MODULE_26__.Sphere.createEllipsoid(localToWorld, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_14__.AngleSweep.createStartSweepRadians(detail.startLatitudeRadians(), detail.latitudeSweepRadians()), detail.capped());
|
|
249474
249640
|
}
|
|
249475
|
-
if (geometryType ===
|
|
249476
|
-
const header = variant.geometry(new
|
|
249641
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnCone) {
|
|
249642
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnCone());
|
|
249477
249643
|
const detail = header.detail();
|
|
249478
|
-
const centerA =
|
|
249479
|
-
const centerB =
|
|
249480
|
-
const vector0 =
|
|
249481
|
-
const vector90 =
|
|
249644
|
+
const centerA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(detail.centerAX(), detail.centerAY(), detail.centerAZ());
|
|
249645
|
+
const centerB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(detail.centerBX(), detail.centerBY(), detail.centerBZ());
|
|
249646
|
+
const vector0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vector0X(), detail.vector0Y(), detail.vector0Z());
|
|
249647
|
+
const vector90 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vector90X(), detail.vector90Y(), detail.vector90Z());
|
|
249482
249648
|
const radiusA = detail.radiusA();
|
|
249483
249649
|
const radiusB = detail.radiusB();
|
|
249484
|
-
return
|
|
249650
|
+
return _solid_Cone__WEBPACK_IMPORTED_MODULE_27__.Cone.createBaseAndTarget(centerA, centerB, vector0, vector90, radiusA, radiusB, detail.capped());
|
|
249485
249651
|
}
|
|
249486
|
-
if (geometryType ===
|
|
249487
|
-
const header = variant.geometry(new
|
|
249652
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnTorusPipe) {
|
|
249653
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnTorusPipe());
|
|
249488
249654
|
const detail = header.detail();
|
|
249489
|
-
const center =
|
|
249490
|
-
const vectorX =
|
|
249491
|
-
const vectorY =
|
|
249655
|
+
const center = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create(detail.centerX(), detail.centerY(), detail.centerZ());
|
|
249656
|
+
const vectorX = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vectorXX(), detail.vectorXY(), detail.vectorXZ());
|
|
249657
|
+
const vectorY = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(detail.vectorYX(), detail.vectorYY(), detail.vectorYZ());
|
|
249492
249658
|
const sweepRadians = detail.sweepRadians();
|
|
249493
249659
|
const majorRadius = detail.majorRadius();
|
|
249494
249660
|
const minorRadius = detail.minorRadius();
|
|
249495
|
-
return
|
|
249661
|
+
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());
|
|
249496
249662
|
}
|
|
249497
|
-
if (geometryType ===
|
|
249498
|
-
const header = variant.geometry(new
|
|
249499
|
-
const dVector = new
|
|
249663
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnExtrusion) {
|
|
249664
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnExtrusion());
|
|
249665
|
+
const dVector = new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DVector3d();
|
|
249500
249666
|
header.extrusionVector(dVector);
|
|
249501
|
-
const extrusionVector =
|
|
249667
|
+
const extrusionVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Vector3d.create(dVector.x(), dVector.y(), dVector.z());
|
|
249502
249668
|
const baseCurve = header.baseCurve();
|
|
249503
249669
|
if (baseCurve !== null) {
|
|
249504
249670
|
const contour = this.readCurveCollectionFromCurveVectorTable(baseCurve);
|
|
249505
|
-
return
|
|
249671
|
+
return _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_29__.LinearSweep.create(contour, extrusionVector, header.capped());
|
|
249506
249672
|
}
|
|
249507
249673
|
}
|
|
249508
|
-
if (geometryType ===
|
|
249509
|
-
const header = variant.geometry(new
|
|
249510
|
-
const dAxis = new
|
|
249674
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnRotationalSweep) {
|
|
249675
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnRotationalSweep());
|
|
249676
|
+
const dAxis = new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DRay3d();
|
|
249511
249677
|
header.axis(dAxis);
|
|
249512
|
-
const axis =
|
|
249513
|
-
const sweepAngle =
|
|
249678
|
+
const axis = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_30__.Ray3d.createXYZUVW(dAxis.x(), dAxis.y(), dAxis.z(), dAxis.ux(), dAxis.uy(), dAxis.uz());
|
|
249679
|
+
const sweepAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_17__.Angle.createRadians(header.sweepRadians());
|
|
249514
249680
|
// const numVRules = header.numVRules();
|
|
249515
249681
|
const baseCurve = header.baseCurve();
|
|
249516
249682
|
if (baseCurve !== null) {
|
|
249517
249683
|
const contour = this.readCurveCollectionFromCurveVectorTable(baseCurve);
|
|
249518
|
-
return
|
|
249684
|
+
return _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_31__.RotationalSweep.create(contour, axis, sweepAngle, header.capped());
|
|
249519
249685
|
}
|
|
249520
249686
|
}
|
|
249521
|
-
if (geometryType ===
|
|
249522
|
-
const header = variant.geometry(new
|
|
249687
|
+
if (geometryType === _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnRuledSweep) {
|
|
249688
|
+
const header = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.DgnRuledSweep());
|
|
249523
249689
|
const numCurves = header.curvesLength();
|
|
249524
249690
|
const contours = [];
|
|
249525
249691
|
for (let i = 0; i < numCurves; i++) {
|
|
@@ -249531,7 +249697,7 @@ class BGFBReader {
|
|
|
249531
249697
|
}
|
|
249532
249698
|
}
|
|
249533
249699
|
if (contours.length > 0) {
|
|
249534
|
-
return
|
|
249700
|
+
return _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_32__.RuledSweep.create(contours, header.capped());
|
|
249535
249701
|
}
|
|
249536
249702
|
}
|
|
249537
249703
|
return undefined;
|
|
@@ -249543,43 +249709,43 @@ class BGFBReader {
|
|
|
249543
249709
|
readGeometryQueryFromVariant(variant) {
|
|
249544
249710
|
const rootType = variant.geometryType();
|
|
249545
249711
|
switch (rootType) {
|
|
249546
|
-
case
|
|
249547
|
-
case
|
|
249548
|
-
case
|
|
249549
|
-
case
|
|
249550
|
-
case
|
|
249551
|
-
case
|
|
249552
|
-
case
|
|
249712
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagLineSegment:
|
|
249713
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagLineString:
|
|
249714
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagEllipticArc:
|
|
249715
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagBsplineCurve:
|
|
249716
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagTransitionSpiral:
|
|
249717
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagInterpolationCurve:
|
|
249718
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagAkimaCurve:
|
|
249553
249719
|
{
|
|
249554
249720
|
return this.readCurvePrimitiveFromVariant(variant);
|
|
249555
249721
|
}
|
|
249556
|
-
case
|
|
249722
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagCurveVector:
|
|
249557
249723
|
{
|
|
249558
249724
|
return this.readCurveCollectionFromVariantGeometry(variant);
|
|
249559
249725
|
}
|
|
249560
|
-
case
|
|
249726
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagPolyface:
|
|
249561
249727
|
{
|
|
249562
249728
|
return this.readPolyfaceFromVariant(variant);
|
|
249563
249729
|
}
|
|
249564
|
-
case
|
|
249565
|
-
case
|
|
249566
|
-
case
|
|
249567
|
-
case
|
|
249568
|
-
case
|
|
249569
|
-
case
|
|
249570
|
-
case
|
|
249730
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnBox:
|
|
249731
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnCone:
|
|
249732
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnTorusPipe:
|
|
249733
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnSphere:
|
|
249734
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnExtrusion:
|
|
249735
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnRotationalSweep:
|
|
249736
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagDgnRuledSweep:
|
|
249571
249737
|
{
|
|
249572
249738
|
return this.readSolidPrimitiveFromVariant(variant);
|
|
249573
249739
|
}
|
|
249574
|
-
case
|
|
249740
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagVectorOfVariantGeometry:
|
|
249575
249741
|
{
|
|
249576
249742
|
const geometry = [];
|
|
249577
|
-
const offsetToVectorOfVariantGeometry = variant.geometry(new
|
|
249743
|
+
const offsetToVectorOfVariantGeometry = variant.geometry(new _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VectorOfVariantGeometry());
|
|
249578
249744
|
for (let i = 0; i < offsetToVectorOfVariantGeometry.membersLength(); i++) {
|
|
249579
249745
|
const child = offsetToVectorOfVariantGeometry.members(i);
|
|
249580
249746
|
if (child !== null) {
|
|
249581
249747
|
const childGeometry = this.readGeometryQueryFromVariant(child);
|
|
249582
|
-
if (childGeometry instanceof
|
|
249748
|
+
if (childGeometry instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_33__.GeometryQuery) {
|
|
249583
249749
|
geometry.push(childGeometry);
|
|
249584
249750
|
}
|
|
249585
249751
|
else if (Array.isArray(childGeometry)) {
|
|
@@ -249589,10 +249755,10 @@ class BGFBReader {
|
|
|
249589
249755
|
}
|
|
249590
249756
|
return geometry;
|
|
249591
249757
|
}
|
|
249592
|
-
case
|
|
249758
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagBsplineSurface: {
|
|
249593
249759
|
return this.readBSplineSurfaceFromVariant(variant);
|
|
249594
249760
|
}
|
|
249595
|
-
case
|
|
249761
|
+
case _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometryUnion.tagPointString:
|
|
249596
249762
|
{
|
|
249597
249763
|
return this.readPointStringFromVariant(variant);
|
|
249598
249764
|
}
|
|
@@ -249613,7 +249779,7 @@ class BGFBReader {
|
|
|
249613
249779
|
return undefined;
|
|
249614
249780
|
newByteBuffer.setPosition(signature.length);
|
|
249615
249781
|
}
|
|
249616
|
-
const root =
|
|
249782
|
+
const root = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_2__.BGFBAccessors.VariantGeometry.getRootAsVariantGeometry(newByteBuffer);
|
|
249617
249783
|
const reader = new BGFBReader();
|
|
249618
249784
|
return reader.readGeometryQueryFromVariant(root);
|
|
249619
249785
|
}
|
|
@@ -249629,14 +249795,14 @@ function nullToUndefined(data) {
|
|
|
249629
249795
|
}
|
|
249630
249796
|
function createTypedCurveCollection(collectionType) {
|
|
249631
249797
|
if (collectionType === 1)
|
|
249632
|
-
return new
|
|
249798
|
+
return new _curve_Path__WEBPACK_IMPORTED_MODULE_34__.Path();
|
|
249633
249799
|
if (collectionType === 2 || collectionType === 3)
|
|
249634
|
-
return new
|
|
249800
|
+
return new _curve_Loop__WEBPACK_IMPORTED_MODULE_35__.Loop();
|
|
249635
249801
|
if (collectionType === 4)
|
|
249636
|
-
return new
|
|
249802
|
+
return new _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_36__.ParityRegion();
|
|
249637
249803
|
if (collectionType === 5)
|
|
249638
|
-
return new
|
|
249639
|
-
return new
|
|
249804
|
+
return new _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_37__.UnionRegion();
|
|
249805
|
+
return new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_38__.BagOfCurves();
|
|
249640
249806
|
}
|
|
249641
249807
|
/**
|
|
249642
249808
|
* mappings between typescript spiral type strings and native integers.
|
|
@@ -249654,7 +249820,7 @@ class DgnSpiralTypeQueries {
|
|
|
249654
249820
|
/** Convert typescript string to native integer type */
|
|
249655
249821
|
static stringToTypeCode(s, defaultToClothoid = true) {
|
|
249656
249822
|
for (const entry of DgnSpiralTypeQueries.spiralTypeCodeMap) {
|
|
249657
|
-
if (
|
|
249823
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_39__.Geometry.equalStringNoCase(s, entry[1]))
|
|
249658
249824
|
return entry[0];
|
|
249659
249825
|
}
|
|
249660
249826
|
return defaultToClothoid ? 10 : undefined;
|
|
@@ -250158,14 +250324,15 @@ class BGFBWriter {
|
|
|
250158
250324
|
}
|
|
250159
250325
|
return undefined;
|
|
250160
250326
|
}
|
|
250161
|
-
writePolyfaceAuxDataAsFBVariantGeometry(data) {
|
|
250327
|
+
writePolyfaceAuxDataAsFBVariantGeometry(mesh, data) {
|
|
250162
250328
|
if (data instanceof _polyface_AuxData__WEBPACK_IMPORTED_MODULE_31__.PolyfaceAuxData) {
|
|
250163
250329
|
const channelOffsets = [];
|
|
250164
|
-
for (const channel of data.channels)
|
|
250330
|
+
for (const channel of data.channels)
|
|
250165
250331
|
channelOffsets.push(this.writePolyfaceAuxChannelAsFBVariantGeometry(channel));
|
|
250166
|
-
}
|
|
250167
250332
|
const channelOffsetsOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.PolyfaceAuxChannel.createDataVector(this.builder, channelOffsets);
|
|
250168
|
-
const
|
|
250333
|
+
const indexArray = [];
|
|
250334
|
+
this.fillOneBasedIndexArray(mesh, data.indices, undefined, 0, indexArray);
|
|
250335
|
+
const indicesOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.PolyfaceAuxData.createIndicesVector(this.builder, indexArray);
|
|
250169
250336
|
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.PolyfaceAuxData.createPolyfaceAuxData(this.builder, indicesOffset, channelOffsetsOffset);
|
|
250170
250337
|
}
|
|
250171
250338
|
return undefined;
|
|
@@ -250193,8 +250360,8 @@ class BGFBWriter {
|
|
|
250193
250360
|
let paramOffset = 0;
|
|
250194
250361
|
let auxDataOffset = 0;
|
|
250195
250362
|
let taggedNumericDataOffset = 0;
|
|
250196
|
-
const meshStyle = 1; // That is . . . MESH_ELM_STYLE_INDEXED_FACE_LOOPS
|
|
250197
|
-
const numPerFace = 0;
|
|
250363
|
+
const meshStyle = 1; // That is . . . MESH_ELM_STYLE_INDEXED_FACE_LOOPS
|
|
250364
|
+
const numPerFace = 0; // specifically, variable size with 0 terminators
|
|
250198
250365
|
this.fillOneBasedIndexArray(mesh, mesh.data.pointIndex, mesh.data.edgeVisible, 0, indexArray);
|
|
250199
250366
|
const twoSided = mesh.twoSided;
|
|
250200
250367
|
const pointIndexOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.Polyface.createPointIndexVector(this.builder, indexArray);
|
|
@@ -250213,12 +250380,6 @@ class BGFBWriter {
|
|
|
250213
250380
|
if (mesh.data.color !== undefined && mesh.data.color.length > 0) {
|
|
250214
250381
|
intColorOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.Polyface.createIntColorVector(this.builder, mesh.data.color);
|
|
250215
250382
|
}
|
|
250216
|
-
/*
|
|
250217
|
-
if (mesh.data.face !== undefined && mesh.data.face.length > 0) {
|
|
250218
|
-
this.writeOneBasedIndexArray(mesh, mesh.data.face, undefined, 0, indexArray);
|
|
250219
|
-
BGFBAccessors.Polyface.createFaceDataVector(this.builder, indexArray);
|
|
250220
|
-
}
|
|
250221
|
-
*/
|
|
250222
250383
|
if (mesh.data.normal) {
|
|
250223
250384
|
copyToPackedNumberArray(numberArray, mesh.data.normal.float64Data(), mesh.data.normal.float64Length);
|
|
250224
250385
|
normalOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.Polyface.createNormalVector(this.builder, numberArray);
|
|
@@ -250227,12 +250388,12 @@ class BGFBWriter {
|
|
|
250227
250388
|
copyToPackedNumberArray(numberArray, mesh.data.param.float64Data(), mesh.data.param.float64Length);
|
|
250228
250389
|
paramOffset = _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.Polyface.createPointVector(this.builder, numberArray);
|
|
250229
250390
|
}
|
|
250230
|
-
if (mesh.data.auxData)
|
|
250231
|
-
auxDataOffset = this.writePolyfaceAuxDataAsFBVariantGeometry(mesh.data.auxData);
|
|
250232
|
-
}
|
|
250391
|
+
if (mesh.data.auxData)
|
|
250392
|
+
auxDataOffset = this.writePolyfaceAuxDataAsFBVariantGeometry(mesh, mesh.data.auxData);
|
|
250233
250393
|
if (mesh.data.taggedNumericData)
|
|
250234
250394
|
taggedNumericDataOffset = this.writeTaggedNumericDataArray(mesh.data.taggedNumericData);
|
|
250235
250395
|
const expectedClosure = mesh.expectedClosure;
|
|
250396
|
+
// NOTE: mesh.data.face is not persistent
|
|
250236
250397
|
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);
|
|
250237
250398
|
return _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.VariantGeometry.createVariantGeometry(this.builder, _BGFBAccessors__WEBPACK_IMPORTED_MODULE_3__.BGFBAccessors.VariantGeometryUnion.tagPolyface, polyfaceOffset, 0);
|
|
250238
250399
|
}
|
|
@@ -253097,48 +253258,49 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
253097
253258
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
253098
253259
|
/* harmony export */ "IModelJson": () => (/* binding */ IModelJson)
|
|
253099
253260
|
/* harmony export */ });
|
|
253100
|
-
/* harmony import */ var
|
|
253101
|
-
/* harmony import */ var
|
|
253102
|
-
/* harmony import */ var
|
|
253103
|
-
/* harmony import */ var
|
|
253104
|
-
/* harmony import */ var
|
|
253105
|
-
/* harmony import */ var
|
|
253106
|
-
/* harmony import */ var
|
|
253107
|
-
/* harmony import */ var
|
|
253108
|
-
/* harmony import */ var
|
|
253109
|
-
/* harmony import */ var
|
|
253110
|
-
/* harmony import */ var
|
|
253111
|
-
/* harmony import */ var
|
|
253112
|
-
/* harmony import */ var
|
|
253113
|
-
/* harmony import */ var
|
|
253114
|
-
/* harmony import */ var
|
|
253115
|
-
/* harmony import */ var
|
|
253116
|
-
/* harmony import */ var
|
|
253117
|
-
/* harmony import */ var
|
|
253118
|
-
/* harmony import */ var
|
|
253119
|
-
/* harmony import */ var
|
|
253120
|
-
/* harmony import */ var
|
|
253121
|
-
/* harmony import */ var
|
|
253122
|
-
/* harmony import */ var
|
|
253123
|
-
/* harmony import */ var
|
|
253124
|
-
/* harmony import */ var
|
|
253125
|
-
/* harmony import */ var
|
|
253126
|
-
/* harmony import */ var
|
|
253127
|
-
/* harmony import */ var
|
|
253128
|
-
/* harmony import */ var
|
|
253129
|
-
/* harmony import */ var
|
|
253130
|
-
/* harmony import */ var
|
|
253131
|
-
/* harmony import */ var
|
|
253132
|
-
/* harmony import */ var
|
|
253133
|
-
/* harmony import */ var
|
|
253134
|
-
/* harmony import */ var
|
|
253135
|
-
/* harmony import */ var
|
|
253136
|
-
/* harmony import */ var
|
|
253137
|
-
/* harmony import */ var
|
|
253138
|
-
/* harmony import */ var
|
|
253139
|
-
/* harmony import */ var
|
|
253140
|
-
/* harmony import */ var
|
|
253141
|
-
/* harmony import */ var
|
|
253261
|
+
/* harmony import */ var _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @itwin/core-bentley */ "../../core/bentley/lib/esm/core-bentley.js");
|
|
253262
|
+
/* harmony import */ var _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../bspline/AkimaCurve3d */ "../../core/geometry/lib/esm/bspline/AkimaCurve3d.js");
|
|
253263
|
+
/* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
|
|
253264
|
+
/* harmony import */ var _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../bspline/BSplineCurve3dH */ "../../core/geometry/lib/esm/bspline/BSplineCurve3dH.js");
|
|
253265
|
+
/* harmony import */ var _bspline_BSplineCurveOps__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ../bspline/BSplineCurveOps */ "../../core/geometry/lib/esm/bspline/BSplineCurveOps.js");
|
|
253266
|
+
/* harmony import */ var _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../bspline/BSplineSurface */ "../../core/geometry/lib/esm/bspline/BSplineSurface.js");
|
|
253267
|
+
/* harmony import */ var _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../bspline/InterpolationCurve3d */ "../../core/geometry/lib/esm/bspline/InterpolationCurve3d.js");
|
|
253268
|
+
/* harmony import */ var _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../bspline/KnotVector */ "../../core/geometry/lib/esm/bspline/KnotVector.js");
|
|
253269
|
+
/* harmony import */ var _curve_Arc3d__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../curve/Arc3d */ "../../core/geometry/lib/esm/curve/Arc3d.js");
|
|
253270
|
+
/* harmony import */ var _curve_CoordinateXYZ__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../curve/CoordinateXYZ */ "../../core/geometry/lib/esm/curve/CoordinateXYZ.js");
|
|
253271
|
+
/* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
253272
|
+
/* harmony import */ var _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../curve/GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
|
|
253273
|
+
/* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
253274
|
+
/* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
253275
|
+
/* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
253276
|
+
/* harmony import */ var _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../curve/ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
|
|
253277
|
+
/* harmony import */ var _curve_Path__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../curve/Path */ "../../core/geometry/lib/esm/curve/Path.js");
|
|
253278
|
+
/* harmony import */ var _curve_PointString3d__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ../curve/PointString3d */ "../../core/geometry/lib/esm/curve/PointString3d.js");
|
|
253279
|
+
/* harmony import */ var _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../curve/spiral/DirectSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/DirectSpiral3d.js");
|
|
253280
|
+
/* harmony import */ var _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../curve/spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
|
|
253281
|
+
/* harmony import */ var _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ../curve/UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
|
|
253282
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
253283
|
+
/* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
|
|
253284
|
+
/* harmony import */ var _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/AngleSweep */ "../../core/geometry/lib/esm/geometry3d/AngleSweep.js");
|
|
253285
|
+
/* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
|
|
253286
|
+
/* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
|
|
253287
|
+
/* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
|
|
253288
|
+
/* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
|
|
253289
|
+
/* harmony import */ var _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/Ray3d */ "../../core/geometry/lib/esm/geometry3d/Ray3d.js");
|
|
253290
|
+
/* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
|
|
253291
|
+
/* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
|
|
253292
|
+
/* harmony import */ var _geometry3d_YawPitchRollAngles__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/YawPitchRollAngles */ "../../core/geometry/lib/esm/geometry3d/YawPitchRollAngles.js");
|
|
253293
|
+
/* harmony import */ var _polyface_AuxData__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../polyface/AuxData */ "../../core/geometry/lib/esm/polyface/AuxData.js");
|
|
253294
|
+
/* harmony import */ var _polyface_Polyface__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../polyface/Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
253295
|
+
/* harmony import */ var _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../polyface/TaggedNumericData */ "../../core/geometry/lib/esm/polyface/TaggedNumericData.js");
|
|
253296
|
+
/* harmony import */ var _solid_Box__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../solid/Box */ "../../core/geometry/lib/esm/solid/Box.js");
|
|
253297
|
+
/* harmony import */ var _solid_Cone__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../solid/Cone */ "../../core/geometry/lib/esm/solid/Cone.js");
|
|
253298
|
+
/* harmony import */ var _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../solid/LinearSweep */ "../../core/geometry/lib/esm/solid/LinearSweep.js");
|
|
253299
|
+
/* harmony import */ var _solid_RotationalSweep__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../solid/RotationalSweep */ "../../core/geometry/lib/esm/solid/RotationalSweep.js");
|
|
253300
|
+
/* harmony import */ var _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../solid/RuledSweep */ "../../core/geometry/lib/esm/solid/RuledSweep.js");
|
|
253301
|
+
/* harmony import */ var _solid_Sphere__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../solid/Sphere */ "../../core/geometry/lib/esm/solid/Sphere.js");
|
|
253302
|
+
/* harmony import */ var _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../solid/TorusPipe */ "../../core/geometry/lib/esm/solid/TorusPipe.js");
|
|
253303
|
+
/* harmony import */ var _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./SerializationHelpers */ "../../core/geometry/lib/esm/serialization/SerializationHelpers.js");
|
|
253142
253304
|
/*---------------------------------------------------------------------------------------------
|
|
253143
253305
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
253144
253306
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -253186,6 +253348,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
253186
253348
|
|
|
253187
253349
|
|
|
253188
253350
|
|
|
253351
|
+
|
|
253189
253352
|
|
|
253190
253353
|
|
|
253191
253354
|
// cspell:word bagof
|
|
@@ -253206,32 +253369,32 @@ var IModelJson;
|
|
|
253206
253369
|
static parseVector3dProperty(json, propertyName, defaultValue) {
|
|
253207
253370
|
if (json.hasOwnProperty(propertyName)) {
|
|
253208
253371
|
const value = json[propertyName];
|
|
253209
|
-
if (
|
|
253210
|
-
return
|
|
253211
|
-
if (
|
|
253212
|
-
return
|
|
253213
|
-
if (
|
|
253214
|
-
return
|
|
253372
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(value, 3))
|
|
253373
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(value[0], value[1], value[2]);
|
|
253374
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(value, 2))
|
|
253375
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(value[0], value[1]);
|
|
253376
|
+
if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.XYZ.isXAndY(value))
|
|
253377
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(value);
|
|
253215
253378
|
}
|
|
253216
253379
|
return defaultValue;
|
|
253217
253380
|
}
|
|
253218
253381
|
static parsePoint3dProperty(json, propertyName, defaultValue) {
|
|
253219
253382
|
if (json.hasOwnProperty(propertyName)) {
|
|
253220
253383
|
const value = json[propertyName];
|
|
253221
|
-
if (
|
|
253222
|
-
return
|
|
253223
|
-
if (
|
|
253224
|
-
return
|
|
253225
|
-
if (
|
|
253226
|
-
return
|
|
253384
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(value, 3))
|
|
253385
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(value[0], value[1], value[2]);
|
|
253386
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(value, 2))
|
|
253387
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(value[0], value[1]);
|
|
253388
|
+
if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.XYZ.isXAndY(value))
|
|
253389
|
+
return _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(value);
|
|
253227
253390
|
}
|
|
253228
253391
|
return defaultValue;
|
|
253229
253392
|
}
|
|
253230
253393
|
static parseSegment1dProperty(json, propertyName, defaultValue) {
|
|
253231
253394
|
if (json.hasOwnProperty(propertyName)) {
|
|
253232
253395
|
const value = json[propertyName];
|
|
253233
|
-
if (
|
|
253234
|
-
return
|
|
253396
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(value, 2))
|
|
253397
|
+
return _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_3__.Segment1d.create(value[0], value[1]);
|
|
253235
253398
|
}
|
|
253236
253399
|
return defaultValue;
|
|
253237
253400
|
}
|
|
@@ -253250,7 +253413,7 @@ var IModelJson;
|
|
|
253250
253413
|
const tagA = this.parseNumberProperty(json, "tagA");
|
|
253251
253414
|
const tagB = this.parseNumberProperty(json, "tagB", 0);
|
|
253252
253415
|
if (tagA !== undefined) {
|
|
253253
|
-
const result = new
|
|
253416
|
+
const result = new _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_4__.TaggedNumericData(tagA, tagB);
|
|
253254
253417
|
if (json.hasOwnProperty("intData"))
|
|
253255
253418
|
result.intData = this.parseNumberArrayProperty(json, "intData", 0, undefined);
|
|
253256
253419
|
if (json.hasOwnProperty("doubleData"))
|
|
@@ -253276,7 +253439,7 @@ var IModelJson;
|
|
|
253276
253439
|
static parseAngleProperty(json, propertyName, defaultValue) {
|
|
253277
253440
|
if (json.hasOwnProperty(propertyName)) {
|
|
253278
253441
|
const value = json[propertyName];
|
|
253279
|
-
return
|
|
253442
|
+
return _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_5__.Angle.fromJSON(value);
|
|
253280
253443
|
}
|
|
253281
253444
|
return defaultValue;
|
|
253282
253445
|
}
|
|
@@ -253286,7 +253449,7 @@ var IModelJson;
|
|
|
253286
253449
|
static parseAngleSweepProps(json, propertyName, defaultFunction) {
|
|
253287
253450
|
if (json.hasOwnProperty(propertyName)) {
|
|
253288
253451
|
const value = json[propertyName];
|
|
253289
|
-
return
|
|
253452
|
+
return _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_6__.AngleSweep.fromJSON(value);
|
|
253290
253453
|
}
|
|
253291
253454
|
if (defaultFunction === undefined)
|
|
253292
253455
|
return undefined;
|
|
@@ -253309,7 +253472,7 @@ var IModelJson;
|
|
|
253309
253472
|
const result = [];
|
|
253310
253473
|
for (const contourData of value) {
|
|
253311
253474
|
const contour = Reader.parse(contourData);
|
|
253312
|
-
if (contour instanceof
|
|
253475
|
+
if (contour instanceof _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_7__.CurveCollection) {
|
|
253313
253476
|
result.push(contour);
|
|
253314
253477
|
}
|
|
253315
253478
|
}
|
|
@@ -253320,7 +253483,7 @@ var IModelJson;
|
|
|
253320
253483
|
return undefined;
|
|
253321
253484
|
}
|
|
253322
253485
|
static parseYawPitchRollAnglesToMatrix3d(json) {
|
|
253323
|
-
const ypr =
|
|
253486
|
+
const ypr = _geometry3d_YawPitchRollAngles__WEBPACK_IMPORTED_MODULE_8__.YawPitchRollAngles.fromJSON(json);
|
|
253324
253487
|
return ypr.toMatrix3d();
|
|
253325
253488
|
}
|
|
253326
253489
|
static parseStringProperty(json, propertyName, defaultValue) {
|
|
@@ -253333,14 +253496,14 @@ var IModelJson;
|
|
|
253333
253496
|
}
|
|
253334
253497
|
static parseAxesFromVectors(json, axisOrder, createDefaultIdentity) {
|
|
253335
253498
|
if (Array.isArray(json) && json.length === 2) {
|
|
253336
|
-
const xVector =
|
|
253337
|
-
const yVector =
|
|
253338
|
-
const matrix =
|
|
253499
|
+
const xVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[0]);
|
|
253500
|
+
const yVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.fromJSON(json[1]);
|
|
253501
|
+
const matrix = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createRigidFromColumns(xVector, yVector, axisOrder);
|
|
253339
253502
|
if (matrix)
|
|
253340
253503
|
return matrix;
|
|
253341
253504
|
}
|
|
253342
253505
|
if (createDefaultIdentity)
|
|
253343
|
-
return
|
|
253506
|
+
return _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createIdentity();
|
|
253344
253507
|
return undefined;
|
|
253345
253508
|
}
|
|
253346
253509
|
/**
|
|
@@ -253357,13 +253520,13 @@ var IModelJson;
|
|
|
253357
253520
|
return Reader.parseYawPitchRollAnglesToMatrix3d(json.yawPitchRollAngles);
|
|
253358
253521
|
}
|
|
253359
253522
|
else if (json.xyVectors) {
|
|
253360
|
-
return Reader.parseAxesFromVectors(json.xyVectors,
|
|
253523
|
+
return Reader.parseAxesFromVectors(json.xyVectors, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.XYZ, createDefaultIdentity);
|
|
253361
253524
|
}
|
|
253362
253525
|
else if (json.zxVectors) {
|
|
253363
|
-
return Reader.parseAxesFromVectors(json.zxVectors,
|
|
253526
|
+
return Reader.parseAxesFromVectors(json.zxVectors, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.ZXY, createDefaultIdentity);
|
|
253364
253527
|
}
|
|
253365
253528
|
if (createDefaultIdentity)
|
|
253366
|
-
return
|
|
253529
|
+
return _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createIdentity();
|
|
253367
253530
|
return undefined;
|
|
253368
253531
|
}
|
|
253369
253532
|
static parseArcByVectorProps(data) {
|
|
@@ -253372,17 +253535,17 @@ var IModelJson;
|
|
|
253372
253535
|
&& data.vectorX !== undefined
|
|
253373
253536
|
&& data.vectorY !== undefined
|
|
253374
253537
|
&& data.sweepStartEnd !== undefined) {
|
|
253375
|
-
return
|
|
253538
|
+
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));
|
|
253376
253539
|
}
|
|
253377
253540
|
return undefined;
|
|
253378
253541
|
}
|
|
253379
253542
|
// remark: Returns LineString3d as last default when give points are colinear.
|
|
253380
253543
|
static parseArcBy3Points(data) {
|
|
253381
253544
|
if (Array.isArray(data) && data.length > 2) {
|
|
253382
|
-
const pointA =
|
|
253383
|
-
const pointB =
|
|
253384
|
-
const pointC =
|
|
253385
|
-
return
|
|
253545
|
+
const pointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(data[0]);
|
|
253546
|
+
const pointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(data[1]);
|
|
253547
|
+
const pointC = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(data[2]);
|
|
253548
|
+
return _curve_Arc3d__WEBPACK_IMPORTED_MODULE_10__.Arc3d.createCircularStartMiddleEnd(pointA, pointB, pointC);
|
|
253386
253549
|
}
|
|
253387
253550
|
return undefined;
|
|
253388
253551
|
}
|
|
@@ -253395,9 +253558,9 @@ var IModelJson;
|
|
|
253395
253558
|
}
|
|
253396
253559
|
/** Parse point content (right side) `[1,2,3]` to a CoordinateXYZ object. */
|
|
253397
253560
|
static parseCoordinate(data) {
|
|
253398
|
-
const point =
|
|
253561
|
+
const point = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(data);
|
|
253399
253562
|
if (point)
|
|
253400
|
-
return
|
|
253563
|
+
return _curve_CoordinateXYZ__WEBPACK_IMPORTED_MODULE_11__.CoordinateXYZ.create(point);
|
|
253401
253564
|
return undefined;
|
|
253402
253565
|
}
|
|
253403
253566
|
/** Parse TransitionSpiral content (right side) to TransitionSpiral3d. */
|
|
@@ -253421,10 +253584,10 @@ var IModelJson;
|
|
|
253421
253584
|
// REMARK: Our job is to parse and pass data along -- inscrutable validation happens in the implementation classes . . .
|
|
253422
253585
|
if (origin) {
|
|
253423
253586
|
let candidate;
|
|
253424
|
-
candidate =
|
|
253587
|
+
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));
|
|
253425
253588
|
if (candidate)
|
|
253426
253589
|
return candidate;
|
|
253427
|
-
candidate =
|
|
253590
|
+
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));
|
|
253428
253591
|
if (candidate)
|
|
253429
253592
|
return candidate;
|
|
253430
253593
|
}
|
|
@@ -253439,14 +253602,14 @@ var IModelJson;
|
|
|
253439
253602
|
&& data.hasOwnProperty("order") && Number.isFinite(data.order)
|
|
253440
253603
|
&& data.hasOwnProperty("points") && Array.isArray(data.points) && Array.isArray(data.points[0])
|
|
253441
253604
|
&& (dim = data.points[0].length) >= 3 && dim <= 4) {
|
|
253442
|
-
const myData =
|
|
253605
|
+
const myData = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.createBSplineCurveData(data.points, dim, data.knots, data.points.length, data.order);
|
|
253443
253606
|
if (data.hasOwnProperty("closed") && true === data.closed)
|
|
253444
253607
|
myData.params.closed = true;
|
|
253445
|
-
if (
|
|
253608
|
+
if (_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.Import.prepareBSplineCurveData(myData)) {
|
|
253446
253609
|
if (dim === 3)
|
|
253447
|
-
newCurve =
|
|
253610
|
+
newCurve = _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_16__.BSplineCurve3d.create(myData.poles, myData.params.knots, myData.params.order);
|
|
253448
253611
|
else
|
|
253449
|
-
newCurve =
|
|
253612
|
+
newCurve = _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_17__.BSplineCurve3dH.create(myData.poles, myData.params.knots, myData.params.order);
|
|
253450
253613
|
if (undefined !== newCurve) {
|
|
253451
253614
|
if (undefined !== myData.params.wrapMode)
|
|
253452
253615
|
newCurve.setWrappable(myData.params.wrapMode);
|
|
@@ -253459,13 +253622,13 @@ var IModelJson;
|
|
|
253459
253622
|
static parseInterpolationCurve(data) {
|
|
253460
253623
|
if (data === undefined)
|
|
253461
253624
|
return undefined;
|
|
253462
|
-
return
|
|
253625
|
+
return _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_18__.InterpolationCurve3d.create(data);
|
|
253463
253626
|
}
|
|
253464
253627
|
/** Parse `bcurve` content to an Akima curve object. */
|
|
253465
253628
|
static parseAkimaCurve3d(data) {
|
|
253466
253629
|
if (data === undefined)
|
|
253467
253630
|
return undefined;
|
|
253468
|
-
return
|
|
253631
|
+
return _bspline_AkimaCurve3d__WEBPACK_IMPORTED_MODULE_19__.AkimaCurve3d.create(data);
|
|
253469
253632
|
}
|
|
253470
253633
|
/** Parse array of json objects to array of instances. */
|
|
253471
253634
|
static parseArray(data) {
|
|
@@ -253481,24 +253644,6 @@ var IModelJson;
|
|
|
253481
253644
|
}
|
|
253482
253645
|
return undefined;
|
|
253483
253646
|
}
|
|
253484
|
-
// For each nonzero index, Announce Math.abs (value) -1
|
|
253485
|
-
static addZeroBasedIndicesFromSignedOneBased(data, numPerFace, f) {
|
|
253486
|
-
if (data && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isNumberArray(data)) {
|
|
253487
|
-
if (numPerFace > 1) {
|
|
253488
|
-
// all indices are used ...
|
|
253489
|
-
for (const value of data) {
|
|
253490
|
-
f(Math.abs(value) - 1);
|
|
253491
|
-
}
|
|
253492
|
-
}
|
|
253493
|
-
else {
|
|
253494
|
-
// ignore separator zeros ...
|
|
253495
|
-
for (const value of data) {
|
|
253496
|
-
if (value !== 0)
|
|
253497
|
-
f(Math.abs(value) - 1);
|
|
253498
|
-
}
|
|
253499
|
-
}
|
|
253500
|
-
}
|
|
253501
|
-
}
|
|
253502
253647
|
/** parse polyface aux data content to PolyfaceAuxData instance */
|
|
253503
253648
|
static parsePolyfaceAuxData(data = undefined, numPerFace = 0) {
|
|
253504
253649
|
if (!Array.isArray(data.channels) || !Array.isArray(data.indices))
|
|
@@ -253509,13 +253654,13 @@ var IModelJson;
|
|
|
253509
253654
|
const outChannelData = [];
|
|
253510
253655
|
for (const inChannelData of inChannel.data) {
|
|
253511
253656
|
if (inChannelData.hasOwnProperty("input") && Array.isArray(inChannelData.values))
|
|
253512
|
-
outChannelData.push(new
|
|
253657
|
+
outChannelData.push(new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_20__.AuxChannelData(inChannelData.input, inChannelData.values));
|
|
253513
253658
|
}
|
|
253514
|
-
outChannels.push(new
|
|
253659
|
+
outChannels.push(new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_20__.AuxChannel(outChannelData, inChannel.dataType, inChannel.name, inChannel.inputName));
|
|
253515
253660
|
}
|
|
253516
253661
|
}
|
|
253517
|
-
const auxData = new
|
|
253518
|
-
|
|
253662
|
+
const auxData = new _polyface_AuxData__WEBPACK_IMPORTED_MODULE_20__.PolyfaceAuxData(outChannels, []);
|
|
253663
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.indices, numPerFace, (x) => { auxData.indices.push(x); });
|
|
253519
253664
|
return auxData;
|
|
253520
253665
|
}
|
|
253521
253666
|
/** parse indexed mesh content to an IndexedPolyface instance */
|
|
@@ -253524,75 +253669,50 @@ var IModelJson;
|
|
|
253524
253669
|
// CoordIndex[1,2,3,0] -- zero-terminated, one based !!!
|
|
253525
253670
|
if (data.hasOwnProperty("point") && Array.isArray(data.point)
|
|
253526
253671
|
&& data.hasOwnProperty("pointIndex") && Array.isArray(data.pointIndex)) {
|
|
253527
|
-
const polyface =
|
|
253528
|
-
|
|
253529
|
-
// for normals, addNormal() is overeager to detect the (common) case of duplicate normals in sequence.
|
|
253530
|
-
// use addNormalXYZ which always creates a new one.
|
|
253531
|
-
// likewise for params
|
|
253532
|
-
for (const uvw of data.normal) {
|
|
253533
|
-
if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isNumberArray(uvw, 3))
|
|
253534
|
-
polyface.addNormalXYZ(uvw[0], uvw[1], uvw[2]);
|
|
253535
|
-
}
|
|
253536
|
-
}
|
|
253672
|
+
const polyface = _polyface_Polyface__WEBPACK_IMPORTED_MODULE_21__.IndexedPolyface.create();
|
|
253673
|
+
const numPerFace = data.hasOwnProperty("numPerFace") ? data.numPerFace : 0;
|
|
253537
253674
|
if (data.hasOwnProperty("twoSided")) {
|
|
253538
253675
|
const q = data.twoSided;
|
|
253539
253676
|
if (q === true || q === false) {
|
|
253540
253677
|
polyface.twoSided = q;
|
|
253541
253678
|
}
|
|
253542
253679
|
}
|
|
253543
|
-
const numPerFace = data.hasOwnProperty("numPerFace") ? data.numPerFace : 0;
|
|
253544
253680
|
if (data.hasOwnProperty("expectedClosure")) {
|
|
253545
253681
|
const q = data.expectedClosure;
|
|
253546
253682
|
if (Number.isFinite(q)) {
|
|
253547
253683
|
polyface.expectedClosure = q;
|
|
253548
253684
|
}
|
|
253549
253685
|
}
|
|
253550
|
-
if (data.hasOwnProperty("
|
|
253686
|
+
if (data.hasOwnProperty("normal") && Array.isArray(data.normal) && data.hasOwnProperty("normalIndex")) {
|
|
253687
|
+
// For normals, addNormal() is overeager to detect the (common) case of duplicate normals in sequence.
|
|
253688
|
+
// Use addNormalXYZ which always creates a new one. Likewise for params.
|
|
253689
|
+
for (const uvw of data.normal) {
|
|
253690
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(uvw, 3))
|
|
253691
|
+
polyface.addNormalXYZ(uvw[0], uvw[1], uvw[2]);
|
|
253692
|
+
}
|
|
253693
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.normalIndex, numPerFace, (x) => { polyface.addNormalIndex(x); });
|
|
253694
|
+
}
|
|
253695
|
+
if (data.hasOwnProperty("param") && Array.isArray(data.param) && data.hasOwnProperty("paramIndex")) {
|
|
253551
253696
|
for (const uv of data.param) {
|
|
253552
|
-
if (
|
|
253697
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(uv, 2))
|
|
253553
253698
|
polyface.addParamUV(uv[0], uv[1]);
|
|
253554
253699
|
}
|
|
253700
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.paramIndex, numPerFace, (x) => { polyface.addParamIndex(x); });
|
|
253555
253701
|
}
|
|
253556
|
-
if (data.hasOwnProperty("color") && Array.isArray(data.color)) {
|
|
253557
|
-
for (const c of data.color)
|
|
253702
|
+
if (data.hasOwnProperty("color") && Array.isArray(data.color) && data.hasOwnProperty("colorIndex")) {
|
|
253703
|
+
for (const c of data.color)
|
|
253558
253704
|
polyface.addColor(c);
|
|
253559
|
-
}
|
|
253705
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.colorIndex, numPerFace, (x) => { polyface.addColorIndex(x); });
|
|
253560
253706
|
}
|
|
253561
253707
|
for (const p of data.point)
|
|
253562
253708
|
polyface.addPointXYZ(p[0], p[1], p[2]);
|
|
253563
|
-
|
|
253564
|
-
|
|
253565
|
-
|
|
253566
|
-
const p0 = Math.abs(p) - 1;
|
|
253567
|
-
polyface.addPointIndex(p0, p > 0);
|
|
253568
|
-
if ((i + 1) % numPerFace === 0)
|
|
253569
|
-
polyface.terminateFacet(false);
|
|
253570
|
-
}
|
|
253571
|
-
}
|
|
253572
|
-
else {
|
|
253573
|
-
for (const p of data.pointIndex) {
|
|
253574
|
-
if (p === 0)
|
|
253575
|
-
polyface.terminateFacet(false); // we are responsible for index checking !!!
|
|
253576
|
-
else {
|
|
253577
|
-
const p0 = Math.abs(p) - 1;
|
|
253578
|
-
polyface.addPointIndex(p0, p > 0);
|
|
253579
|
-
}
|
|
253580
|
-
}
|
|
253581
|
-
}
|
|
253582
|
-
if (data.hasOwnProperty("normalIndex")) {
|
|
253583
|
-
Reader.addZeroBasedIndicesFromSignedOneBased(data.normalIndex, numPerFace, (x) => { polyface.addNormalIndex(x); });
|
|
253584
|
-
}
|
|
253585
|
-
if (data.hasOwnProperty("paramIndex")) {
|
|
253586
|
-
Reader.addZeroBasedIndicesFromSignedOneBased(data.paramIndex, numPerFace, (x) => { polyface.addParamIndex(x); });
|
|
253587
|
-
}
|
|
253588
|
-
if (data.hasOwnProperty("colorIndex")) {
|
|
253589
|
-
Reader.addZeroBasedIndicesFromSignedOneBased(data.colorIndex, numPerFace, (x) => { polyface.addColorIndex(x); });
|
|
253590
|
-
}
|
|
253709
|
+
_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices(data.pointIndex, numPerFace, (i, v) => { polyface.addPointIndex(i, v); }, () => { polyface.terminateFacet(false); });
|
|
253710
|
+
if (!polyface.validateAllIndices())
|
|
253711
|
+
return undefined;
|
|
253591
253712
|
if (data.hasOwnProperty("auxData"))
|
|
253592
253713
|
polyface.data.auxData = Reader.parsePolyfaceAuxData(data.auxData, numPerFace);
|
|
253593
|
-
if (data.hasOwnProperty("tags"))
|
|
253714
|
+
if (data.hasOwnProperty("tags"))
|
|
253594
253715
|
polyface.data.taggedNumericData = Reader.parseTaggedNumericProps(data.tags);
|
|
253595
|
-
}
|
|
253596
253716
|
return polyface;
|
|
253597
253717
|
}
|
|
253598
253718
|
return undefined;
|
|
@@ -253602,7 +253722,7 @@ var IModelJson;
|
|
|
253602
253722
|
if (data && Array.isArray(data)) {
|
|
253603
253723
|
for (const c of data) {
|
|
253604
253724
|
const g = Reader.parse(c);
|
|
253605
|
-
if (g instanceof
|
|
253725
|
+
if (g instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_22__.GeometryQuery && ("curveCollection" === g.geometryCategory || "curvePrimitive" === g.geometryCategory))
|
|
253606
253726
|
result.tryAddChild(g);
|
|
253607
253727
|
}
|
|
253608
253728
|
return result;
|
|
@@ -253620,21 +253740,21 @@ var IModelJson;
|
|
|
253620
253740
|
&& data.hasOwnProperty("orderV") && Number.isFinite(data.orderV)
|
|
253621
253741
|
&& data.hasOwnProperty("points") && Array.isArray(data.points) && Array.isArray(data.points[0]) && Array.isArray(data.points[0][0])
|
|
253622
253742
|
&& (dim = data.points[0][0].length) >= 3 && dim <= 4) {
|
|
253623
|
-
const myData =
|
|
253743
|
+
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);
|
|
253624
253744
|
if (data.hasOwnProperty("closedU") && true === data.closedU)
|
|
253625
253745
|
myData.uParams.closed = true;
|
|
253626
253746
|
if (data.hasOwnProperty("closedV") && true === data.closedV)
|
|
253627
253747
|
myData.vParams.closed = true;
|
|
253628
|
-
if (
|
|
253748
|
+
if (_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.Import.prepareBSplineSurfaceData(myData, { jsonPoles: true })) {
|
|
253629
253749
|
if (dim === 3)
|
|
253630
|
-
newSurface =
|
|
253750
|
+
newSurface = _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.BSplineSurface3d.createGrid(myData.poles, myData.uParams.order, myData.uParams.knots, myData.vParams.order, myData.vParams.knots);
|
|
253631
253751
|
else
|
|
253632
|
-
newSurface =
|
|
253752
|
+
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);
|
|
253633
253753
|
if (undefined !== newSurface) {
|
|
253634
253754
|
if (undefined !== myData.uParams.wrapMode)
|
|
253635
|
-
newSurface.setWrappable(
|
|
253755
|
+
newSurface.setWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.uDirection, myData.uParams.wrapMode);
|
|
253636
253756
|
if (undefined !== myData.vParams.wrapMode)
|
|
253637
|
-
newSurface.setWrappable(
|
|
253757
|
+
newSurface.setWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.vDirection, myData.vParams.wrapMode);
|
|
253638
253758
|
}
|
|
253639
253759
|
}
|
|
253640
253760
|
}
|
|
@@ -253654,14 +253774,14 @@ var IModelJson;
|
|
|
253654
253774
|
&& startRadius !== undefined
|
|
253655
253775
|
&& endRadius !== undefined) {
|
|
253656
253776
|
if (axes === undefined) {
|
|
253657
|
-
const axisVector =
|
|
253658
|
-
const frame =
|
|
253777
|
+
const axisVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(start, end);
|
|
253778
|
+
const frame = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.createRigidHeadsUp(axisVector, _Geometry__WEBPACK_IMPORTED_MODULE_1__.AxisOrder.ZXY);
|
|
253659
253779
|
const vectorX = frame.columnX();
|
|
253660
253780
|
const vectorY = frame.columnY();
|
|
253661
|
-
return
|
|
253781
|
+
return _solid_Cone__WEBPACK_IMPORTED_MODULE_24__.Cone.createBaseAndTarget(start, end, vectorX, vectorY, startRadius, endRadius, capped);
|
|
253662
253782
|
}
|
|
253663
253783
|
else {
|
|
253664
|
-
return
|
|
253784
|
+
return _solid_Cone__WEBPACK_IMPORTED_MODULE_24__.Cone.createBaseAndTarget(start, end, axes.columnX(), axes.columnY(), startRadius, endRadius, capped);
|
|
253665
253785
|
}
|
|
253666
253786
|
}
|
|
253667
253787
|
return undefined;
|
|
@@ -253675,14 +253795,14 @@ var IModelJson;
|
|
|
253675
253795
|
if (start
|
|
253676
253796
|
&& end
|
|
253677
253797
|
&& radius !== undefined) {
|
|
253678
|
-
return
|
|
253798
|
+
return _solid_Cone__WEBPACK_IMPORTED_MODULE_24__.Cone.createAxisPoints(start, end, radius, radius, capped);
|
|
253679
253799
|
}
|
|
253680
253800
|
return undefined;
|
|
253681
253801
|
}
|
|
253682
253802
|
/** Parse line segment (array of 2 points) properties to `LineSegment3d` instance */
|
|
253683
253803
|
static parseLineSegmentProps(value) {
|
|
253684
253804
|
if (Array.isArray(value) && value.length > 1)
|
|
253685
|
-
return
|
|
253805
|
+
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]));
|
|
253686
253806
|
else
|
|
253687
253807
|
return undefined;
|
|
253688
253808
|
}
|
|
@@ -253691,11 +253811,11 @@ var IModelJson;
|
|
|
253691
253811
|
const contour = Reader.parse(json.contour);
|
|
253692
253812
|
const capped = Reader.parseBooleanProperty(json, "capped");
|
|
253693
253813
|
const extrusionVector = Reader.parseVector3dProperty(json, "vector");
|
|
253694
|
-
if (contour instanceof
|
|
253814
|
+
if (contour instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_22__.GeometryQuery
|
|
253695
253815
|
&& "curveCollection" === contour.geometryCategory
|
|
253696
253816
|
&& capped !== undefined
|
|
253697
253817
|
&& extrusionVector) {
|
|
253698
|
-
return
|
|
253818
|
+
return _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_26__.LinearSweep.create(contour, extrusionVector, capped);
|
|
253699
253819
|
}
|
|
253700
253820
|
return undefined;
|
|
253701
253821
|
}
|
|
@@ -253708,13 +253828,13 @@ var IModelJson;
|
|
|
253708
253828
|
const axisVector = Reader.parseVector3dProperty(json, "axis");
|
|
253709
253829
|
const center = Reader.parsePoint3dProperty(json, "center");
|
|
253710
253830
|
const sweepDegrees = Reader.parseNumberProperty(json, "sweepAngle");
|
|
253711
|
-
if (contour instanceof
|
|
253831
|
+
if (contour instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_22__.GeometryQuery
|
|
253712
253832
|
&& "curveCollection" === contour.geometryCategory
|
|
253713
253833
|
&& sweepDegrees !== undefined
|
|
253714
253834
|
&& capped !== undefined
|
|
253715
253835
|
&& axisVector
|
|
253716
253836
|
&& center) {
|
|
253717
|
-
return
|
|
253837
|
+
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);
|
|
253718
253838
|
}
|
|
253719
253839
|
return undefined;
|
|
253720
253840
|
}
|
|
@@ -253732,7 +253852,7 @@ var IModelJson;
|
|
|
253732
253852
|
const height = Reader.parseNumberProperty(json, "height", baseX);
|
|
253733
253853
|
const axes = Reader.parseOrientation(json, true);
|
|
253734
253854
|
if (origin && !topOrigin && height)
|
|
253735
|
-
topOrigin =
|
|
253855
|
+
topOrigin = _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_9__.Matrix3d.xyzPlusMatrixTimesXYZ(origin, axes, _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, height));
|
|
253736
253856
|
if (capped !== undefined
|
|
253737
253857
|
&& baseX !== undefined
|
|
253738
253858
|
&& baseY !== undefined
|
|
@@ -253741,7 +253861,7 @@ var IModelJson;
|
|
|
253741
253861
|
&& axes
|
|
253742
253862
|
&& origin
|
|
253743
253863
|
&& topOrigin) {
|
|
253744
|
-
return
|
|
253864
|
+
return _solid_Box__WEBPACK_IMPORTED_MODULE_29__.Box.createDgnBoxWithAxes(origin, axes, topOrigin, baseX, baseY, topX, topY, capped);
|
|
253745
253865
|
}
|
|
253746
253866
|
return undefined;
|
|
253747
253867
|
}
|
|
@@ -253763,7 +253883,7 @@ var IModelJson;
|
|
|
253763
253883
|
&& radiusY !== undefined
|
|
253764
253884
|
&& radiusZ !== undefined
|
|
253765
253885
|
&& capped !== undefined) {
|
|
253766
|
-
return
|
|
253886
|
+
return _solid_Sphere__WEBPACK_IMPORTED_MODULE_30__.Sphere.createFromAxesAndScales(center, axes, radiusX, radiusY, radiusZ, latitudeStartEnd, capped);
|
|
253767
253887
|
}
|
|
253768
253888
|
return undefined;
|
|
253769
253889
|
}
|
|
@@ -253773,7 +253893,7 @@ var IModelJson;
|
|
|
253773
253893
|
const contours = this.loadContourArray(json, "contour");
|
|
253774
253894
|
if (contours !== undefined
|
|
253775
253895
|
&& capped !== undefined) {
|
|
253776
|
-
return
|
|
253896
|
+
return _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_31__.RuledSweep.create(contours, capped);
|
|
253777
253897
|
}
|
|
253778
253898
|
return undefined;
|
|
253779
253899
|
}
|
|
@@ -253788,7 +253908,7 @@ var IModelJson;
|
|
|
253788
253908
|
if (center
|
|
253789
253909
|
&& radiusA !== undefined
|
|
253790
253910
|
&& radiusB !== undefined) {
|
|
253791
|
-
return
|
|
253911
|
+
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);
|
|
253792
253912
|
}
|
|
253793
253913
|
return undefined;
|
|
253794
253914
|
}
|
|
@@ -253797,11 +253917,11 @@ var IModelJson;
|
|
|
253797
253917
|
const points = [];
|
|
253798
253918
|
if (json && Array.isArray(json)) {
|
|
253799
253919
|
for (const member of json) {
|
|
253800
|
-
if (
|
|
253801
|
-
points.push(
|
|
253920
|
+
if (_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.XYZ.isXAndY(member)) {
|
|
253921
|
+
points.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(member));
|
|
253802
253922
|
}
|
|
253803
|
-
else if (
|
|
253804
|
-
points.push(
|
|
253923
|
+
else if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isNumberArray(member, 2)) {
|
|
253924
|
+
points.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.fromJSON(member));
|
|
253805
253925
|
}
|
|
253806
253926
|
}
|
|
253807
253927
|
}
|
|
@@ -253814,7 +253934,7 @@ var IModelJson;
|
|
|
253814
253934
|
return Reader.parseLineSegmentProps(json.lineSegment);
|
|
253815
253935
|
}
|
|
253816
253936
|
else if (json.lineString !== undefined) {
|
|
253817
|
-
return
|
|
253937
|
+
return _curve_LineString3d__WEBPACK_IMPORTED_MODULE_33__.LineString3d.create(Reader.parsePointArray(json.lineString));
|
|
253818
253938
|
}
|
|
253819
253939
|
else if (json.arc !== undefined) {
|
|
253820
253940
|
return Reader.parseArcObject(json.arc);
|
|
@@ -253832,19 +253952,19 @@ var IModelJson;
|
|
|
253832
253952
|
return Reader.parseAkimaCurve3d(json.akimaCurve);
|
|
253833
253953
|
}
|
|
253834
253954
|
else if (json.hasOwnProperty("path")) {
|
|
253835
|
-
return Reader.parseCurveCollectionMembers(new
|
|
253955
|
+
return Reader.parseCurveCollectionMembers(new _curve_Path__WEBPACK_IMPORTED_MODULE_34__.Path(), json.path);
|
|
253836
253956
|
}
|
|
253837
253957
|
else if (json.hasOwnProperty("loop")) {
|
|
253838
|
-
return Reader.parseCurveCollectionMembers(new
|
|
253958
|
+
return Reader.parseCurveCollectionMembers(new _curve_Loop__WEBPACK_IMPORTED_MODULE_35__.Loop(), json.loop);
|
|
253839
253959
|
}
|
|
253840
253960
|
else if (json.hasOwnProperty("parityRegion")) {
|
|
253841
|
-
return Reader.parseCurveCollectionMembers(new
|
|
253961
|
+
return Reader.parseCurveCollectionMembers(new _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_36__.ParityRegion(), json.parityRegion);
|
|
253842
253962
|
}
|
|
253843
253963
|
else if (json.hasOwnProperty("unionRegion")) {
|
|
253844
|
-
return Reader.parseCurveCollectionMembers(new
|
|
253964
|
+
return Reader.parseCurveCollectionMembers(new _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_37__.UnionRegion(), json.unionRegion);
|
|
253845
253965
|
}
|
|
253846
253966
|
else if (json.hasOwnProperty("bagOfCurves")) {
|
|
253847
|
-
return Reader.parseCurveCollectionMembers(new
|
|
253967
|
+
return Reader.parseCurveCollectionMembers(new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_7__.BagOfCurves(), json.bagOfCurves);
|
|
253848
253968
|
}
|
|
253849
253969
|
else if (json.hasOwnProperty("indexedMesh")) {
|
|
253850
253970
|
return Reader.parseIndexedMesh(json.indexedMesh);
|
|
@@ -253877,7 +253997,7 @@ var IModelJson;
|
|
|
253877
253997
|
return Reader.parseTorusPipe(json.torusPipe);
|
|
253878
253998
|
}
|
|
253879
253999
|
else if (json.hasOwnProperty("pointString")) {
|
|
253880
|
-
return
|
|
254000
|
+
return _curve_PointString3d__WEBPACK_IMPORTED_MODULE_38__.PointString3d.create(Reader.parsePointArray(json.pointString));
|
|
253881
254001
|
}
|
|
253882
254002
|
else if (json.hasOwnProperty("transitionSpiral")) {
|
|
253883
254003
|
return Reader.parseTransitionSpiral(json.transitionSpiral);
|
|
@@ -253898,7 +254018,7 @@ var IModelJson;
|
|
|
253898
254018
|
* Class to deserialize json objects into GeometryQuery objects
|
|
253899
254019
|
* @public
|
|
253900
254020
|
*/
|
|
253901
|
-
class Writer extends
|
|
254021
|
+
class Writer extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_39__.GeometryHandler {
|
|
253902
254022
|
handleTaggedNumericData(data) {
|
|
253903
254023
|
const result = { tagA: data.tagA, tagB: data.tagB };
|
|
253904
254024
|
if (data.intData !== undefined && data.intData.length > 0)
|
|
@@ -253978,7 +254098,7 @@ var IModelJson;
|
|
|
253978
254098
|
// TODO: HANDLE NONRIGID TRANSFORM !!
|
|
253979
254099
|
// the spiral may have indication of how it was defined. If so, use defined/undefined state of the original data
|
|
253980
254100
|
// as indication of what current data to use. (Current data may have changed due to transforms.)
|
|
253981
|
-
if (data instanceof
|
|
254101
|
+
if (data instanceof _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_14__.DirectSpiral3d) {
|
|
253982
254102
|
const value = {
|
|
253983
254103
|
origin: data.localToWorld.origin.toJSON(),
|
|
253984
254104
|
type: data.spiralType,
|
|
@@ -253992,7 +254112,7 @@ var IModelJson;
|
|
|
253992
254112
|
value.length = data.nominalL1;
|
|
253993
254113
|
return { transitionSpiral: value };
|
|
253994
254114
|
}
|
|
253995
|
-
else if (data instanceof
|
|
254115
|
+
else if (data instanceof _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_12__.IntegratedSpiral3d) {
|
|
253996
254116
|
// TODO: HANDLE NONRIGID TRANSFORM !!
|
|
253997
254117
|
// the spiral may have indication of how it was defined. If so, use defined/undefined state of the original data
|
|
253998
254118
|
// as indication of what current data to use. (Current data may have changed due to transforms.)
|
|
@@ -254042,12 +254162,12 @@ var IModelJson;
|
|
|
254042
254162
|
const centerB = data.getCenterB();
|
|
254043
254163
|
const vectorX = data.getVectorX();
|
|
254044
254164
|
const vectorY = data.getVectorY();
|
|
254045
|
-
const axisVector =
|
|
254046
|
-
if (
|
|
254165
|
+
const axisVector = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createStartEnd(centerA, centerB);
|
|
254166
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(radiusA, radiusB)
|
|
254047
254167
|
&& vectorX.isPerpendicularTo(axisVector)
|
|
254048
254168
|
&& vectorY.isPerpendicularTo(axisVector)
|
|
254049
|
-
&&
|
|
254050
|
-
&&
|
|
254169
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(vectorX.magnitude(), 1.0)
|
|
254170
|
+
&& _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(vectorY.magnitude(), 1.0)) {
|
|
254051
254171
|
return {
|
|
254052
254172
|
cylinder: {
|
|
254053
254173
|
capped: data.capped,
|
|
@@ -254087,7 +254207,7 @@ var IModelJson;
|
|
|
254087
254207
|
const fullSweep = latitudeSweep.isFullLatitudeSweep;
|
|
254088
254208
|
if (data.capped && !fullSweep)
|
|
254089
254209
|
value.capped = data.capped;
|
|
254090
|
-
if (
|
|
254210
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(rX, rY) && _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(rX, rZ))
|
|
254091
254211
|
value.radius = rX;
|
|
254092
254212
|
else {
|
|
254093
254213
|
value.radiusX = rX;
|
|
@@ -254241,35 +254361,25 @@ var IModelJson;
|
|
|
254241
254361
|
};
|
|
254242
254362
|
const outBox = out.box;
|
|
254243
254363
|
Writer.insertXYOrientation(outBox, box.getVectorX(), box.getVectorY(), true);
|
|
254244
|
-
if (!
|
|
254364
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(box.getTopX(), box.getBaseX()))
|
|
254245
254365
|
outBox.topX = box.getTopX();
|
|
254246
|
-
if (!
|
|
254366
|
+
if (!_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.isSameCoordinate(box.getTopY(), box.getBaseY()))
|
|
254247
254367
|
outBox.topY = box.getTopY();
|
|
254248
254368
|
return out;
|
|
254249
254369
|
}
|
|
254250
254370
|
handlePolyfaceAuxData(auxData, pf) {
|
|
254251
|
-
|
|
254252
|
-
contents
|
|
254371
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(auxData === pf.data.auxData);
|
|
254372
|
+
const contents = { indices: [], channels: [] };
|
|
254253
254373
|
const visitor = pf.createVisitor(0);
|
|
254254
|
-
if (!visitor.auxData)
|
|
254255
|
-
return;
|
|
254256
254374
|
while (visitor.moveToNextFacet()) {
|
|
254257
|
-
for (let i = 0; i < visitor.indexCount; i++)
|
|
254375
|
+
for (let i = 0; i < visitor.indexCount; i++)
|
|
254258
254376
|
contents.indices.push(visitor.auxData.indices[i] + 1);
|
|
254259
|
-
}
|
|
254260
254377
|
contents.indices.push(0); // facet terminator.
|
|
254261
254378
|
}
|
|
254262
|
-
contents.channels = [];
|
|
254263
254379
|
for (const inChannel of auxData.channels) {
|
|
254264
|
-
const outChannel = {};
|
|
254265
|
-
outChannel.dataType = inChannel.dataType;
|
|
254266
|
-
outChannel.name = inChannel.name;
|
|
254267
|
-
outChannel.inputName = inChannel.inputName;
|
|
254268
|
-
outChannel.data = [];
|
|
254380
|
+
const outChannel = { data: [], dataType: inChannel.dataType, name: inChannel.name, inputName: inChannel.inputName };
|
|
254269
254381
|
for (const inData of inChannel.data) {
|
|
254270
|
-
const outData = {};
|
|
254271
|
-
outData.input = inData.input;
|
|
254272
|
-
outData.values = inData.values.slice(0);
|
|
254382
|
+
const outData = { input: inData.input, values: inData.values.slice(0) };
|
|
254273
254383
|
outChannel.data.push(outData);
|
|
254274
254384
|
}
|
|
254275
254385
|
contents.channels.push(outChannel);
|
|
@@ -254284,20 +254394,20 @@ var IModelJson;
|
|
|
254284
254394
|
const params = [];
|
|
254285
254395
|
const colors = [];
|
|
254286
254396
|
{
|
|
254287
|
-
const p =
|
|
254397
|
+
const p = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create();
|
|
254288
254398
|
for (let i = 0; pf.data.point.getPoint3dAtCheckedPointIndex(i, p); i++)
|
|
254289
254399
|
points.push(p.toJSON());
|
|
254290
254400
|
}
|
|
254291
254401
|
if (pf.data.normal) {
|
|
254292
254402
|
const numNormal = pf.data.normal.length;
|
|
254293
|
-
const normal =
|
|
254403
|
+
const normal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create();
|
|
254294
254404
|
for (let i = 0; i < numNormal; i++) {
|
|
254295
254405
|
pf.data.normal.getVector3dAtCheckedVectorIndex(i, normal);
|
|
254296
254406
|
normals.push(normal.toJSON());
|
|
254297
254407
|
}
|
|
254298
254408
|
}
|
|
254299
254409
|
if (pf.data.param) {
|
|
254300
|
-
const uv =
|
|
254410
|
+
const uv = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_40__.Point2d.create();
|
|
254301
254411
|
for (let i = 0; pf.data.param.getPoint2dAtCheckedPointIndex(i, uv); i++)
|
|
254302
254412
|
params.push(uv.toJSON());
|
|
254303
254413
|
}
|
|
@@ -254368,11 +254478,11 @@ var IModelJson;
|
|
|
254368
254478
|
return { indexedMesh: contents };
|
|
254369
254479
|
}
|
|
254370
254480
|
handleBSplineCurve(curve) {
|
|
254371
|
-
const data =
|
|
254481
|
+
const data = _SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.createBSplineCurveData(curve.polesRef, curve.poleDimension, curve.knotsRef, curve.numPoles, curve.order);
|
|
254372
254482
|
const wrapMode = curve.getWrappable();
|
|
254373
|
-
if (
|
|
254483
|
+
if (_bspline_KnotVector__WEBPACK_IMPORTED_MODULE_41__.BSplineWrapMode.None !== wrapMode)
|
|
254374
254484
|
data.params.wrapMode = wrapMode;
|
|
254375
|
-
if (!
|
|
254485
|
+
if (!_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.Export.prepareBSplineCurveData(data, { jsonPoles: true, jsonKnots: true }))
|
|
254376
254486
|
return undefined;
|
|
254377
254487
|
return {
|
|
254378
254488
|
bcurve: {
|
|
@@ -254390,7 +254500,7 @@ var IModelJson;
|
|
|
254390
254500
|
/** Convert strongly typed instance to tagged json */
|
|
254391
254501
|
handleInterpolationCurve3d(curve) {
|
|
254392
254502
|
const props = curve.cloneProps();
|
|
254393
|
-
|
|
254503
|
+
_bspline_BSplineCurveOps__WEBPACK_IMPORTED_MODULE_42__.BSplineCurveOps.C2CubicFit.convertToJsonKnots(props);
|
|
254394
254504
|
return { interpolationCurve: props };
|
|
254395
254505
|
}
|
|
254396
254506
|
/** Convert strongly typed instance to tagged json */
|
|
@@ -254439,14 +254549,14 @@ var IModelJson;
|
|
|
254439
254549
|
}
|
|
254440
254550
|
/** Convert strongly typed instance to tagged json */
|
|
254441
254551
|
handleBSplineSurface(surface) {
|
|
254442
|
-
const data =
|
|
254443
|
-
const wrapModeU = surface.getWrappable(
|
|
254444
|
-
const wrapModeV = surface.getWrappable(
|
|
254445
|
-
if (
|
|
254552
|
+
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));
|
|
254553
|
+
const wrapModeU = surface.getWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.uDirection);
|
|
254554
|
+
const wrapModeV = surface.getWrappable(_bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_23__.UVSelect.vDirection);
|
|
254555
|
+
if (_bspline_KnotVector__WEBPACK_IMPORTED_MODULE_41__.BSplineWrapMode.None !== wrapModeU)
|
|
254446
254556
|
data.uParams.wrapMode = wrapModeU;
|
|
254447
|
-
if (
|
|
254557
|
+
if (_bspline_KnotVector__WEBPACK_IMPORTED_MODULE_41__.BSplineWrapMode.None !== wrapModeV)
|
|
254448
254558
|
data.vParams.wrapMode = wrapModeV;
|
|
254449
|
-
if (!
|
|
254559
|
+
if (!_SerializationHelpers__WEBPACK_IMPORTED_MODULE_15__.SerializationHelpers.Export.prepareBSplineSurfaceData(data, { jsonPoles: true, jsonKnots: true }))
|
|
254450
254560
|
return undefined;
|
|
254451
254561
|
return {
|
|
254452
254562
|
bsurf: {
|
|
@@ -254477,10 +254587,10 @@ var IModelJson;
|
|
|
254477
254587
|
emit(data) {
|
|
254478
254588
|
if (Array.isArray(data))
|
|
254479
254589
|
return this.emitArray(data);
|
|
254480
|
-
if (data instanceof
|
|
254590
|
+
if (data instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_22__.GeometryQuery) {
|
|
254481
254591
|
return data.dispatchToGeometryHandler(this);
|
|
254482
254592
|
}
|
|
254483
|
-
else if (data instanceof
|
|
254593
|
+
else if (data instanceof _polyface_TaggedNumericData__WEBPACK_IMPORTED_MODULE_4__.TaggedNumericData) {
|
|
254484
254594
|
return this.handleTaggedNumericData(data);
|
|
254485
254595
|
}
|
|
254486
254596
|
return undefined;
|
|
@@ -254733,6 +254843,91 @@ var SerializationHelpers;
|
|
|
254733
254843
|
data.vParams.knots = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_0__.NumberArray.pack(data.vParams.knots);
|
|
254734
254844
|
}
|
|
254735
254845
|
}
|
|
254846
|
+
/**
|
|
254847
|
+
* Process 1-based blocked indices into 0-based indices.
|
|
254848
|
+
* @param sourceIndices signed, 1-based, 0-terminated/padded source indices, blocking specified by `numPerBlock`
|
|
254849
|
+
* @param numPerBlock index blocking: fixed blocks of size numPerBlock > 1, possibly 0-padded; otherwise, variable-sized blocks terminated by 0
|
|
254850
|
+
* @param announceZeroBasedIndex callback to receive a 0-based index and optional flag indicating whether the sign of the source index is positive
|
|
254851
|
+
* @param terminateBlock optional callback called after each index block has been announced
|
|
254852
|
+
*/
|
|
254853
|
+
function announceZeroBasedIndicesFromSignedOneBasedIndices(sourceIndices, numPerBlock, announceZeroBasedIndex, terminateBlock) {
|
|
254854
|
+
let numIndices = sourceIndices.length;
|
|
254855
|
+
if (!numIndices)
|
|
254856
|
+
return;
|
|
254857
|
+
if (numPerBlock > 1) {
|
|
254858
|
+
numIndices -= sourceIndices.length % numPerBlock;
|
|
254859
|
+
for (let i = 0; i < numIndices; i++) {
|
|
254860
|
+
const p = sourceIndices[i];
|
|
254861
|
+
if (p !== 0) // skip padding
|
|
254862
|
+
announceZeroBasedIndex(Math.abs(p) - 1, p > 0);
|
|
254863
|
+
if (terminateBlock && ((i + 1) % numPerBlock) === 0)
|
|
254864
|
+
terminateBlock();
|
|
254865
|
+
}
|
|
254866
|
+
}
|
|
254867
|
+
else {
|
|
254868
|
+
for (let i = 0; i < numIndices; i++) {
|
|
254869
|
+
const p = sourceIndices[i];
|
|
254870
|
+
if (p !== 0) // skip terminator
|
|
254871
|
+
announceZeroBasedIndex(Math.abs(p) - 1, p > 0);
|
|
254872
|
+
if (terminateBlock) {
|
|
254873
|
+
if (p === 0) {
|
|
254874
|
+
if (i + 1 === numIndices || sourceIndices[i + 1] !== 0) // skip extra terminators
|
|
254875
|
+
terminateBlock();
|
|
254876
|
+
}
|
|
254877
|
+
else {
|
|
254878
|
+
if (i + 1 === numIndices) // missing last terminator
|
|
254879
|
+
terminateBlock();
|
|
254880
|
+
}
|
|
254881
|
+
}
|
|
254882
|
+
}
|
|
254883
|
+
}
|
|
254884
|
+
}
|
|
254885
|
+
SerializationHelpers.announceZeroBasedIndicesFromSignedOneBasedIndices = announceZeroBasedIndicesFromSignedOneBasedIndices;
|
|
254886
|
+
/**
|
|
254887
|
+
* Process 0-based indices with blocking specified by another index array.
|
|
254888
|
+
* @param sourceIndices 0-based source indices. This array is compressed (has no blocking).
|
|
254889
|
+
* @param blockingIndices 1-based source indices, blocking specified by `numPerBlock`. Assumed to have length equal to its zero count plus `sourceIndices.length`.
|
|
254890
|
+
* @param numPerBlock index blocking: fixed blocks of size numPerBlock > 1, possibly 0-padded; otherwise, variable-sized blocks terminated by 0
|
|
254891
|
+
* @param announceZeroBasedIndex callback to receive a 0-based index
|
|
254892
|
+
* @param terminateBlock optional callback called after each index block has been announced
|
|
254893
|
+
*/
|
|
254894
|
+
function announceZeroBasedIndicesWithExternalBlocking(sourceIndices, blockingIndices, numPerBlock, announceZeroBasedIndex, terminateBlock) {
|
|
254895
|
+
if (!sourceIndices.length || !blockingIndices.length)
|
|
254896
|
+
return;
|
|
254897
|
+
const blockingZeroCount = blockingIndices.filter((i) => i === 0).length;
|
|
254898
|
+
if (sourceIndices.length + blockingZeroCount !== blockingIndices.length)
|
|
254899
|
+
return; // invalid input
|
|
254900
|
+
let iSource = 0;
|
|
254901
|
+
let numBlocking = blockingIndices.length;
|
|
254902
|
+
if (numPerBlock > 1) {
|
|
254903
|
+
numBlocking -= blockingIndices.length % numPerBlock;
|
|
254904
|
+
for (let iBlocking = 0; iBlocking < numBlocking && iSource < sourceIndices.length; iBlocking++) {
|
|
254905
|
+
const p = blockingIndices[iBlocking];
|
|
254906
|
+
if (p !== 0) // skip padding
|
|
254907
|
+
announceZeroBasedIndex(sourceIndices[iSource++]);
|
|
254908
|
+
if (terminateBlock && ((iBlocking + 1) % numPerBlock) === 0)
|
|
254909
|
+
terminateBlock();
|
|
254910
|
+
}
|
|
254911
|
+
}
|
|
254912
|
+
else {
|
|
254913
|
+
for (let iBlocking = 0; iBlocking < numBlocking && iSource < sourceIndices.length; iBlocking++) {
|
|
254914
|
+
const p = blockingIndices[iBlocking];
|
|
254915
|
+
if (p !== 0) // skip terminator
|
|
254916
|
+
announceZeroBasedIndex(sourceIndices[iSource++]);
|
|
254917
|
+
if (terminateBlock) {
|
|
254918
|
+
if (p === 0) {
|
|
254919
|
+
if (iBlocking + 1 === numBlocking || blockingIndices[iBlocking + 1] !== 0) // skip extra terminators
|
|
254920
|
+
terminateBlock();
|
|
254921
|
+
}
|
|
254922
|
+
else {
|
|
254923
|
+
if (iBlocking + 1 === numBlocking) // missing last terminator
|
|
254924
|
+
terminateBlock();
|
|
254925
|
+
}
|
|
254926
|
+
}
|
|
254927
|
+
}
|
|
254928
|
+
}
|
|
254929
|
+
}
|
|
254930
|
+
SerializationHelpers.announceZeroBasedIndicesWithExternalBlocking = announceZeroBasedIndicesWithExternalBlocking;
|
|
254736
254931
|
/** Helper class for preparing geometry data for import. */
|
|
254737
254932
|
class Import {
|
|
254738
254933
|
/** copy knots, with options to control destination type and extraneous knot removal */
|
|
@@ -256287,12 +256482,14 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
256287
256482
|
uFractionToRadians(u) {
|
|
256288
256483
|
return u * Math.PI * 2.0;
|
|
256289
256484
|
}
|
|
256485
|
+
/** Constructor CAPTURES inputs */
|
|
256290
256486
|
constructor(localToWorld, latitudeSweep, capped) {
|
|
256291
256487
|
super(capped);
|
|
256292
256488
|
/** String name for schema properties */
|
|
256293
256489
|
this.solidPrimitiveType = "sphere";
|
|
256294
256490
|
this._localToWorld = localToWorld;
|
|
256295
256491
|
this._latitudeSweep = latitudeSweep ? latitudeSweep : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_1__.AngleSweep.createFullLatitude();
|
|
256492
|
+
this._latitudeSweep.capLatitudeInPlace();
|
|
256296
256493
|
}
|
|
256297
256494
|
/** return a deep clone */
|
|
256298
256495
|
clone() {
|
|
@@ -256331,11 +256528,11 @@ class Sphere extends _SolidPrimitive__WEBPACK_IMPORTED_MODULE_0__.SolidPrimitive
|
|
|
256331
256528
|
/** Create from center and radius, with optional restricted latitudes. */
|
|
256332
256529
|
static createCenterRadius(center, radius, latitudeSweep) {
|
|
256333
256530
|
const localToWorld = _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_2__.Transform.createOriginAndMatrix(center, _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_3__.Matrix3d.createUniformScale(radius));
|
|
256334
|
-
return new Sphere(localToWorld, latitudeSweep ? latitudeSweep : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_1__.AngleSweep.createFullLatitude(), false);
|
|
256531
|
+
return new Sphere(localToWorld, latitudeSweep ? latitudeSweep.clone() : _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_1__.AngleSweep.createFullLatitude(), false);
|
|
256335
256532
|
}
|
|
256336
256533
|
/** Create an ellipsoid which is a unit sphere mapped to position by an (arbitrary, possibly skewed and scaled) transform. */
|
|
256337
256534
|
static createEllipsoid(localToWorld, latitudeSweep, capped) {
|
|
256338
|
-
return new Sphere(localToWorld, latitudeSweep, capped);
|
|
256535
|
+
return new Sphere(localToWorld.clone(), latitudeSweep.clone(), capped);
|
|
256339
256536
|
}
|
|
256340
256537
|
/** Create a sphere from the typical parameters of the Dgn file */
|
|
256341
256538
|
static createDgnSphere(center, vectorX, vectorZ, radiusXY, radiusZ, latitudeSweep, capped) {
|
|
@@ -297178,7 +297375,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
297178
297375
|
/***/ ((module) => {
|
|
297179
297376
|
|
|
297180
297377
|
"use strict";
|
|
297181
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.7.0-dev.
|
|
297378
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.7.0-dev.9","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.9","@itwin/core-bentley":"workspace:^4.7.0-dev.9","@itwin/core-common":"workspace:^4.7.0-dev.9","@itwin/core-geometry":"workspace:^4.7.0-dev.9","@itwin/core-orbitgt":"workspace:^4.7.0-dev.9","@itwin/core-quantity":"workspace:^4.7.0-dev.9"},"//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"}}');
|
|
297182
297379
|
|
|
297183
297380
|
/***/ })
|
|
297184
297381
|
|