@itwin/ecschema-rpcinterface-tests 4.3.0-dev.17 → 4.3.0-dev.19
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/bundled-tests.js +167 -68
- 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_4_14_node_modules_loaders_gl_draco_d-aa4ff5.bundled-tests.js.map +1 -1
- package/package.json +15 -15
|
@@ -186094,7 +186094,7 @@ class CurveOps {
|
|
|
186094
186094
|
/**
|
|
186095
186095
|
* Construct a separate xy-offset for each input curve.
|
|
186096
186096
|
* * For best offset results, the inputs should be parallel to the xy-plane.
|
|
186097
|
-
* @param curves input curve(s), z-coordinates ignored. Only [[
|
|
186097
|
+
* @param curves input curve(s), z-coordinates ignored. Only curves of type [[AnyChain]] are handled.
|
|
186098
186098
|
* @param offset offset distance (positive to left of curve, negative to right)
|
|
186099
186099
|
* @param result array to collect offset curves
|
|
186100
186100
|
* @returns summed length of offset curves
|
|
@@ -197713,7 +197713,10 @@ class Joint {
|
|
|
197713
197713
|
return numOut++ < maxTest;
|
|
197714
197714
|
}, maxTest);
|
|
197715
197715
|
}
|
|
197716
|
-
/**
|
|
197716
|
+
/**
|
|
197717
|
+
* Execute `joint.annotateJointMode()` at all joints on the chain to set some of the joints' attributes,
|
|
197718
|
+
* such as whether to extend both curves to intersection or to fill the gap between curves.
|
|
197719
|
+
*/
|
|
197717
197720
|
static annotateChain(start, options, maxTest = 100) {
|
|
197718
197721
|
if (start)
|
|
197719
197722
|
Joint.visitJointsOnChain(start, (joint) => { joint.annotateJointMode(options); return true; }, maxTest);
|
|
@@ -197745,6 +197748,7 @@ class Joint {
|
|
|
197745
197748
|
if (this.curve0 && this.curve1) {
|
|
197746
197749
|
const ray0 = this.curve0.fractionToPointAndDerivative(1.0);
|
|
197747
197750
|
const ray1 = this.curve1.fractionToPointAndDerivative(0.0);
|
|
197751
|
+
ray0.direction.z = ray1.direction.z = 0.0; // xy-offset
|
|
197748
197752
|
const intersection = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__.Ray3d.closestApproachRay3dRay3d(ray0, ray1); // intersection of the 2 ray lines
|
|
197749
197753
|
if (intersection.approachType === _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_7__.CurveCurveApproachType.Intersection) {
|
|
197750
197754
|
if (intersection.detailA.fraction >= 0.0 && intersection.detailB.fraction <= 0.0) {
|
|
@@ -197823,7 +197827,7 @@ class Joint {
|
|
|
197823
197827
|
this.fraction0 = 1.0;
|
|
197824
197828
|
}
|
|
197825
197829
|
else if (this.curve0 && this.curve1) { // joints at the middle of the chain
|
|
197826
|
-
if (this.curve0.endPoint().
|
|
197830
|
+
if (this.curve0.endPoint().isAlmostEqualXY(this.curve1.startPoint())) { // joint between colinear xy-segments
|
|
197827
197831
|
this.fraction0 = 1.0;
|
|
197828
197832
|
this.fraction1 = 0.0;
|
|
197829
197833
|
this.flexure = JointMode.Trim;
|
|
@@ -197831,8 +197835,9 @@ class Joint {
|
|
|
197831
197835
|
else if (this.curve0 instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_4__.LineSegment3d && this.curve1 instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_4__.LineSegment3d) { // pair of lines
|
|
197832
197836
|
const ray0 = this.curve0.fractionToPointAndDerivative(0.0);
|
|
197833
197837
|
const ray1 = this.curve1.fractionToPointAndDerivative(0.0);
|
|
197838
|
+
ray0.direction.z = ray1.direction.z = 0.0; // xy-offset
|
|
197834
197839
|
const intersection = _geometry3d_Ray3d__WEBPACK_IMPORTED_MODULE_6__.Ray3d.closestApproachRay3dRay3d(ray0, ray1); // intersection of the 2 ray lines
|
|
197835
|
-
if (intersection.approachType === _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_7__.CurveCurveApproachType.Intersection) {
|
|
197840
|
+
if (intersection.approachType === _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_7__.CurveCurveApproachType.Intersection || intersection.approachType === _CurveLocationDetail__WEBPACK_IMPORTED_MODULE_7__.CurveCurveApproachType.PerpendicularChord) {
|
|
197836
197841
|
this.fraction0 = intersection.detailA.fraction;
|
|
197837
197842
|
this.fraction1 = intersection.detailB.fraction;
|
|
197838
197843
|
if (this.fraction0 >= 1.0 && this.fraction1 <= 0.0) { // need to extend
|
|
@@ -197953,7 +197958,7 @@ class Joint {
|
|
|
197953
197958
|
}
|
|
197954
197959
|
}
|
|
197955
197960
|
/**
|
|
197956
|
-
* Context for building a wire offset.
|
|
197961
|
+
* Context for building a wire xy-offset.
|
|
197957
197962
|
* @internal
|
|
197958
197963
|
*/
|
|
197959
197964
|
class PolygonWireOffsetContext {
|
|
@@ -197962,6 +197967,7 @@ class PolygonWireOffsetContext {
|
|
|
197962
197967
|
// Construct a single offset from base points
|
|
197963
197968
|
static createOffsetSegment(basePointA, basePointB, distance) {
|
|
197964
197969
|
_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createStartEnd(basePointA, basePointB, this._unitAlong);
|
|
197970
|
+
this._unitAlong.z = 0.0; // xy-offset
|
|
197965
197971
|
if (this._unitAlong.normalizeInPlace()) {
|
|
197966
197972
|
this._unitAlong.rotate90CCWXY(this._unitPerp);
|
|
197967
197973
|
const segment = _LineSegment3d__WEBPACK_IMPORTED_MODULE_4__.LineSegment3d.create(basePointA.plusScaled(this._unitPerp, distance, this._offsetA), basePointB.plusScaled(this._unitPerp, distance, this._offsetB));
|
|
@@ -197971,8 +197977,8 @@ class PolygonWireOffsetContext {
|
|
|
197971
197977
|
return undefined;
|
|
197972
197978
|
}
|
|
197973
197979
|
/**
|
|
197974
|
-
* Construct a wire (not area) that is offset from given polyline or polygon
|
|
197975
|
-
*
|
|
197980
|
+
* Construct a wire (not area) that is offset from given polyline or polygon.
|
|
197981
|
+
* * For best results, points should be in a horizontal plane because z-coordinates are ignored.
|
|
197976
197982
|
* * This is a simple wire offset (in the form of a line string), not an area.
|
|
197977
197983
|
* * If offsetDistance is given as a number, default OffsetOptions are applied.
|
|
197978
197984
|
* * See [[JointOptions]] class doc for offset construction rules.
|
|
@@ -197982,36 +197988,34 @@ class PolygonWireOffsetContext {
|
|
|
197982
197988
|
* object.
|
|
197983
197989
|
*/
|
|
197984
197990
|
constructPolygonWireXYOffset(points, wrap, leftOffsetDistanceOrOptions) {
|
|
197985
|
-
|
|
197986
|
-
|
|
197987
|
-
|
|
197988
|
-
*/
|
|
197989
|
-
if (wrap && !points[0].isAlmostEqual(points[points.length - 1])) {
|
|
197990
|
-
wrap = false;
|
|
197991
|
-
}
|
|
197992
|
-
/** create raw offsets as a linked list (joint0) */
|
|
197991
|
+
if (wrap && !points[0].isAlmostEqual(points[points.length - 1]))
|
|
197992
|
+
wrap = false; // no wrap possible for polylines
|
|
197993
|
+
// create raw offset segments as a linked list of Joints, starting with joint0
|
|
197993
197994
|
const options = _OffsetOptions__WEBPACK_IMPORTED_MODULE_9__.JointOptions.create(leftOffsetDistanceOrOptions);
|
|
197994
197995
|
const numPoints = points.length;
|
|
197995
|
-
let fragment0
|
|
197996
|
-
let joint0
|
|
197997
|
-
let
|
|
197998
|
-
|
|
197999
|
-
|
|
198000
|
-
|
|
198001
|
-
|
|
198002
|
-
|
|
198003
|
-
|
|
198004
|
-
|
|
198005
|
-
|
|
198006
|
-
|
|
198007
|
-
|
|
198008
|
-
|
|
198009
|
-
|
|
198010
|
-
|
|
197996
|
+
let fragment0;
|
|
197997
|
+
let joint0, previousJoint;
|
|
197998
|
+
for (let i = 0; i + 1 < numPoints; ++i) {
|
|
197999
|
+
if (!previousJoint) { // start the linked list at the first nontrivial xy-segment
|
|
198000
|
+
if (fragment0 = PolygonWireOffsetContext.createOffsetSegment(points[i], points[i + 1], options.leftOffsetDistance))
|
|
198001
|
+
previousJoint = joint0 = new Joint(undefined, fragment0, points[i]);
|
|
198002
|
+
}
|
|
198003
|
+
else {
|
|
198004
|
+
const fragment1 = PolygonWireOffsetContext.createOffsetSegment(points[i], points[i + 1], options.leftOffsetDistance);
|
|
198005
|
+
if (fragment1) { // append the next nontrivial xy-segment
|
|
198006
|
+
const newJoint = new Joint(fragment0, fragment1, points[i]);
|
|
198007
|
+
Joint.link(previousJoint, newJoint);
|
|
198008
|
+
previousJoint = newJoint;
|
|
198009
|
+
fragment0 = fragment1;
|
|
198010
|
+
}
|
|
198011
|
+
}
|
|
198011
198012
|
}
|
|
198012
|
-
|
|
198013
|
+
if (!fragment0 || !previousJoint || !joint0)
|
|
198014
|
+
return undefined; // no edge with positive xy-length
|
|
198015
|
+
const lastJoint = wrap ? joint0 : new Joint(fragment0, undefined, points[numPoints - 1]);
|
|
198016
|
+
Joint.link(previousJoint, lastJoint);
|
|
198013
198017
|
Joint.annotateChain(joint0, options, numPoints);
|
|
198014
|
-
|
|
198018
|
+
// make limited passes through the Joint chain until no self-intersections are removed
|
|
198015
198019
|
for (let pass = 0; pass++ < 5;) {
|
|
198016
198020
|
const state = Joint.removeDegeneratePrimitives(joint0, options, numPoints);
|
|
198017
198021
|
joint0 = state.newStart;
|
|
@@ -198024,10 +198028,8 @@ class PolygonWireOffsetContext {
|
|
|
198024
198028
|
}
|
|
198025
198029
|
*/
|
|
198026
198030
|
}
|
|
198027
|
-
// Joint.collectPrimitivesFromChain(joint0, result, numPoints);
|
|
198028
|
-
/** turn the Joint linked list into a CurveCollection (Loop or Path). trimming is done in collectStrokesFromChain */
|
|
198029
198031
|
const chain = _LineString3d__WEBPACK_IMPORTED_MODULE_5__.LineString3d.create();
|
|
198030
|
-
Joint.collectStrokesFromChain(joint0, chain, numPoints);
|
|
198032
|
+
Joint.collectStrokesFromChain(joint0, chain, numPoints); // compute offset corners (by extension/trim)
|
|
198031
198033
|
const n = chain.packedPoints.length;
|
|
198032
198034
|
if (n > 1) {
|
|
198033
198035
|
if (chain.packedPoints.front().isAlmostEqual(chain.packedPoints.back()))
|
|
@@ -198044,7 +198046,7 @@ PolygonWireOffsetContext._offsetA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTE
|
|
|
198044
198046
|
PolygonWireOffsetContext._offsetB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create();
|
|
198045
198047
|
|
|
198046
198048
|
/**
|
|
198047
|
-
* Context for building a wire offset from a Path or Loop of CurvePrimitives
|
|
198049
|
+
* Context for building a wire xy-offset from a Path or Loop of CurvePrimitives
|
|
198048
198050
|
* @internal
|
|
198049
198051
|
*/
|
|
198050
198052
|
class CurveChainWireOffsetContext {
|
|
@@ -213878,6 +213880,16 @@ class Vector3d extends XYZ {
|
|
|
213878
213880
|
angleFromPerpendicular(planeNormal) {
|
|
213879
213881
|
return _Angle__WEBPACK_IMPORTED_MODULE_2__.Angle.createAtan2(this.dotProduct(planeNormal), this.crossProductMagnitude(planeNormal));
|
|
213880
213882
|
}
|
|
213883
|
+
/**
|
|
213884
|
+
* Return the angle in radians (not as strongly typed Angle) from this vector to the plane perpendicular to planeNormal.
|
|
213885
|
+
* * The returned angle is between -PI/2 and PI/2.
|
|
213886
|
+
* * The returned angle is measured in the plane containing the two vectors.
|
|
213887
|
+
* * The function returns PI/2 - radiansTo(planeNormal).
|
|
213888
|
+
* @param planeNormal a normal vector to the plane.
|
|
213889
|
+
*/
|
|
213890
|
+
radiansFromPerpendicular(planeNormal) {
|
|
213891
|
+
return Math.atan2(this.dotProduct(planeNormal), this.crossProductMagnitude(planeNormal));
|
|
213892
|
+
}
|
|
213881
213893
|
/**
|
|
213882
213894
|
* Return the (strongly-typed) angle from this vector to vectorB, using only the xy parts.
|
|
213883
213895
|
* * The returned angle is between -180 and 180 degrees.
|
|
@@ -232754,8 +232766,12 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
232754
232766
|
*/
|
|
232755
232767
|
addTorusPipe(surface, phiStrokeCount, thetaStrokeCount) {
|
|
232756
232768
|
const thetaFraction = surface.getThetaFraction();
|
|
232757
|
-
|
|
232758
|
-
|
|
232769
|
+
let numU = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.clamp(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.resolveNumber(phiStrokeCount, 8), 4, 64);
|
|
232770
|
+
let numV = _Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.clamp(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.resolveNumber(thetaStrokeCount, Math.ceil(16 * thetaFraction)), 2, 64);
|
|
232771
|
+
if (this._options) {
|
|
232772
|
+
numU = this._options.applyTolerancesToArc(surface.getMinorRadius());
|
|
232773
|
+
numV = this._options.applyTolerancesToArc(surface.getMajorRadius(), surface.getSweepAngle().radians);
|
|
232774
|
+
}
|
|
232759
232775
|
this.toggleReversedFacetFlag();
|
|
232760
232776
|
const sizes = surface.maxIsoParametricDistance();
|
|
232761
232777
|
this.addUVGridBody(surface, numU, numV, _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_14__.Segment1d.create(0, sizes.x), _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_14__.Segment1d.create(0, sizes.y));
|
|
@@ -233225,6 +233241,12 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
|
|
|
233225
233241
|
addFacetFromVisitor(visitor) {
|
|
233226
233242
|
this.addFacetFromGrowableArrays(visitor.point, visitor.normal, visitor.param, visitor.color, visitor.edgeVisible);
|
|
233227
233243
|
}
|
|
233244
|
+
/** Add all visitor facets to the evolving polyface (in reverse order if indicated by the builder state) */
|
|
233245
|
+
addFacetsFromVisitor(visitor) {
|
|
233246
|
+
visitor.reset();
|
|
233247
|
+
for (; visitor.moveToNextFacet();)
|
|
233248
|
+
this.addFacetFromVisitor(visitor);
|
|
233249
|
+
}
|
|
233228
233250
|
/**
|
|
233229
233251
|
* Add the subset of visitor data indexed by the indices.
|
|
233230
233252
|
* * Ideally, the subset represents a sub-facet of the visited facet.
|
|
@@ -234875,7 +234897,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
234875
234897
|
/* harmony export */ });
|
|
234876
234898
|
/* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
234877
234899
|
/* harmony import */ var _curve_CurveOps__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../curve/CurveOps */ "../../core/geometry/lib/esm/curve/CurveOps.js");
|
|
234878
|
-
/* harmony import */ var
|
|
234900
|
+
/* harmony import */ var _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../curve/internalContexts/MultiChainCollector */ "../../core/geometry/lib/esm/curve/internalContexts/MultiChainCollector.js");
|
|
234879
234901
|
/* harmony import */ var _curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../curve/LineSegment3d */ "../../core/geometry/lib/esm/curve/LineSegment3d.js");
|
|
234880
234902
|
/* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
|
|
234881
234903
|
/* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
|
|
@@ -234891,7 +234913,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
234891
234913
|
/* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
|
|
234892
234914
|
/* harmony import */ var _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry4d/Matrix4d */ "../../core/geometry/lib/esm/geometry4d/Matrix4d.js");
|
|
234893
234915
|
/* harmony import */ var _geometry4d_MomentData__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry4d/MomentData */ "../../core/geometry/lib/esm/geometry4d/MomentData.js");
|
|
234894
|
-
/* harmony import */ var
|
|
234916
|
+
/* harmony import */ var _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../numerics/UnionFind */ "../../core/geometry/lib/esm/numerics/UnionFind.js");
|
|
234895
234917
|
/* harmony import */ var _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../topology/ChainMerge */ "../../core/geometry/lib/esm/topology/ChainMerge.js");
|
|
234896
234918
|
/* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
|
|
234897
234919
|
/* harmony import */ var _topology_HalfEdgeGraphFromIndexedLoopsContext__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../topology/HalfEdgeGraphFromIndexedLoopsContext */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js");
|
|
@@ -234901,10 +234923,10 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
234901
234923
|
/* harmony import */ var _FacetLocationDetail__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./FacetLocationDetail */ "../../core/geometry/lib/esm/polyface/FacetLocationDetail.js");
|
|
234902
234924
|
/* harmony import */ var _FacetOrientation__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./FacetOrientation */ "../../core/geometry/lib/esm/polyface/FacetOrientation.js");
|
|
234903
234925
|
/* harmony import */ var _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./IndexedEdgeMatcher */ "../../core/geometry/lib/esm/polyface/IndexedEdgeMatcher.js");
|
|
234904
|
-
/* harmony import */ var
|
|
234926
|
+
/* harmony import */ var _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./IndexedPolyfaceVisitor */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceVisitor.js");
|
|
234905
234927
|
/* harmony import */ var _multiclip_BuildAverageNormalsContext__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./multiclip/BuildAverageNormalsContext */ "../../core/geometry/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js");
|
|
234906
234928
|
/* harmony import */ var _multiclip_OffsetMeshContext__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./multiclip/OffsetMeshContext */ "../../core/geometry/lib/esm/polyface/multiclip/OffsetMeshContext.js");
|
|
234907
|
-
/* harmony import */ var
|
|
234929
|
+
/* harmony import */ var _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./multiclip/SweepLineStringToFacetContext */ "../../core/geometry/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js");
|
|
234908
234930
|
/* harmony import */ var _multiclip_XYPointBuckets__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./multiclip/XYPointBuckets */ "../../core/geometry/lib/esm/polyface/multiclip/XYPointBuckets.js");
|
|
234909
234931
|
/* harmony import */ var _Polyface__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
|
|
234910
234932
|
/* harmony import */ var _PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
|
|
@@ -235328,30 +235350,42 @@ class PolyfaceQuery {
|
|
|
235328
235350
|
* construct a CurveCollection containing boundary edges.
|
|
235329
235351
|
* * each edge is a LineSegment3d
|
|
235330
235352
|
* @param source polyface or visitor
|
|
235331
|
-
* @param
|
|
235353
|
+
* @param includeTypical true to in include typical boundary edges with a single incident facet
|
|
235332
235354
|
* @param includeMismatch true to include edges with more than 2 incident facets
|
|
235333
235355
|
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
235334
|
-
* @returns
|
|
235335
235356
|
*/
|
|
235336
|
-
static boundaryEdges(source,
|
|
235357
|
+
static boundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
235337
235358
|
const result = new _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_5__.BagOfCurves();
|
|
235338
235359
|
const announceEdge = (pointA, pointB, _indexA, _indexB, _readIndex) => {
|
|
235339
235360
|
result.tryAddChild(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(pointA, pointB));
|
|
235340
235361
|
};
|
|
235341
|
-
PolyfaceQuery.announceBoundaryEdges(source, announceEdge,
|
|
235362
|
+
PolyfaceQuery.announceBoundaryEdges(source, announceEdge, includeTypical, includeMismatch, includeNull);
|
|
235342
235363
|
if (result.children.length === 0)
|
|
235343
235364
|
return undefined;
|
|
235344
235365
|
return result;
|
|
235345
235366
|
}
|
|
235346
235367
|
/**
|
|
235347
|
-
|
|
235348
|
-
|
|
235349
|
-
|
|
235350
|
-
|
|
235351
|
-
|
|
235352
|
-
|
|
235353
|
-
|
|
235354
|
-
|
|
235368
|
+
* Collect boundary edges.
|
|
235369
|
+
* * Return the edges as the simplest collection of chains of line segments.
|
|
235370
|
+
* @param source facets
|
|
235371
|
+
* @param includeTypical true to in include typical boundary edges with a single incident facet
|
|
235372
|
+
* @param includeMismatch true to include edges with more than 2 incident facets
|
|
235373
|
+
* @param includeNull true to include edges with identical start and end vertex indices.
|
|
235374
|
+
*/
|
|
235375
|
+
static collectBoundaryEdges(source, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
235376
|
+
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);
|
|
235377
|
+
PolyfaceQuery.announceBoundaryEdges(source, (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(ptA, ptB)), includeTypical, includeMismatch, includeNull);
|
|
235378
|
+
return collector.grabResult(true);
|
|
235379
|
+
}
|
|
235380
|
+
/**
|
|
235381
|
+
* Test if the facets in `source` occur in perfectly mated pairs, as is required for a closed manifold volume.
|
|
235382
|
+
* If not, extract the boundary edges as lines.
|
|
235383
|
+
* @param source polyface or visitor
|
|
235384
|
+
* @param announceEdge function to be called with each boundary edge. The announcement is start and end points, start and end indices, and facet index.
|
|
235385
|
+
* @param includeTypical true to announce typical boundary edges with a single incident facet
|
|
235386
|
+
* @param includeMismatch true to announce edges with more than 2 incident facets
|
|
235387
|
+
* @param includeNull true to announce edges with identical start and end vertex indices.
|
|
235388
|
+
*/
|
|
235355
235389
|
static announceBoundaryEdges(source, announceEdge, includeTypical = true, includeMismatch = true, includeNull = true) {
|
|
235356
235390
|
if (source === undefined)
|
|
235357
235391
|
return undefined;
|
|
@@ -235379,24 +235413,89 @@ class PolyfaceQuery {
|
|
|
235379
235413
|
if (badList.length === 0)
|
|
235380
235414
|
return undefined;
|
|
235381
235415
|
const sourcePolyface = visitor.clientPolyface();
|
|
235416
|
+
const pointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
235417
|
+
const pointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
235382
235418
|
for (const list of badList) {
|
|
235383
235419
|
for (const e of list) {
|
|
235384
235420
|
const e1 = e instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge ? e : e[0];
|
|
235385
235421
|
const indexA = e1.vertexIndexA;
|
|
235386
235422
|
const indexB = e1.vertexIndexB;
|
|
235387
|
-
|
|
235388
|
-
|
|
235389
|
-
|
|
235390
|
-
|
|
235423
|
+
if (sourcePolyface.data.getPoint(indexA, pointA) && sourcePolyface.data.getPoint(indexB, pointB))
|
|
235424
|
+
announceEdge(pointA, pointB, indexA, indexB, e1.facetIndex);
|
|
235425
|
+
}
|
|
235426
|
+
}
|
|
235427
|
+
}
|
|
235428
|
+
/**
|
|
235429
|
+
* Invoke the callback on each manifold edge whose adjacent facet normals form vectorToEye dot products with opposite sign.
|
|
235430
|
+
* * The callback is not called on boundary edges.
|
|
235431
|
+
* @param source facets
|
|
235432
|
+
* @param announce callback function invoked on manifold silhouette edges
|
|
235433
|
+
* @param vectorToEye normal of plane in which to compute silhouette edges
|
|
235434
|
+
* @param sideAngle angular tolerance for perpendicularity test
|
|
235435
|
+
*/
|
|
235436
|
+
static announceSilhouetteEdges(source, announce, vectorToEye, sideAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle()) {
|
|
235437
|
+
if (source instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
235438
|
+
return this.announceSilhouetteEdges(source.createVisitor(1), announce, vectorToEye, sideAngle);
|
|
235439
|
+
const mesh = source.clientPolyface();
|
|
235440
|
+
if (undefined === mesh)
|
|
235441
|
+
return;
|
|
235442
|
+
source.setNumWrap(1);
|
|
235443
|
+
const allEdges = this.createIndexedEdges(source);
|
|
235444
|
+
const manifoldEdges = [];
|
|
235445
|
+
allEdges.sortAndCollectClusters(manifoldEdges);
|
|
235446
|
+
const sideAngleTol = sideAngle.radians < 0.0 ? -sideAngle.radians : sideAngle.radians;
|
|
235447
|
+
const pointA = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
235448
|
+
const pointB = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
|
|
235449
|
+
const normal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
|
|
235450
|
+
const analyzeFace = (iFacet) => {
|
|
235451
|
+
if (!PolyfaceQuery.computeFacetUnitNormal(source, iFacet, normal))
|
|
235452
|
+
return { isSideFace: false, perpAngle: 0.0 };
|
|
235453
|
+
const perpAngle = normal.radiansFromPerpendicular(vectorToEye);
|
|
235454
|
+
const isSideFace = Math.abs(perpAngle) <= sideAngleTol;
|
|
235455
|
+
return { isSideFace, perpAngle };
|
|
235456
|
+
};
|
|
235457
|
+
for (const pair of manifoldEdges) {
|
|
235458
|
+
if (!Array.isArray(pair) || pair.length !== 2)
|
|
235459
|
+
continue;
|
|
235460
|
+
const indexA = pair[0].vertexIndexA;
|
|
235461
|
+
const indexB = pair[0].vertexIndexB;
|
|
235462
|
+
if (!mesh.data.getPoint(indexA, pointA) || !mesh.data.getPoint(indexB, pointB))
|
|
235463
|
+
continue;
|
|
235464
|
+
const face0 = analyzeFace(pair[0].facetIndex);
|
|
235465
|
+
if (face0.isSideFace) {
|
|
235466
|
+
announce(pointA, pointB, indexA, indexB, pair[0].facetIndex);
|
|
235467
|
+
continue;
|
|
235468
|
+
}
|
|
235469
|
+
const face1 = analyzeFace(pair[1].facetIndex);
|
|
235470
|
+
if (face1.isSideFace) {
|
|
235471
|
+
announce(pointB, pointA, indexB, indexA, pair[1].facetIndex);
|
|
235472
|
+
continue;
|
|
235473
|
+
}
|
|
235474
|
+
if (face0.perpAngle * face1.perpAngle < 0.0) { // normals straddle plane
|
|
235475
|
+
announce(pointA, pointB, indexA, indexB, pair[0].facetIndex);
|
|
235476
|
+
continue;
|
|
235391
235477
|
}
|
|
235392
235478
|
}
|
|
235393
235479
|
}
|
|
235480
|
+
/**
|
|
235481
|
+
* Collect manifold edges whose adjacent facet normals form vectorToEye dot products with opposite sign.
|
|
235482
|
+
* * Does not return boundary edges.
|
|
235483
|
+
* * Return the edges as chains of line segments.
|
|
235484
|
+
* @param source facets
|
|
235485
|
+
* @param vectorToEye normal of plane in which to compute silhouette edges
|
|
235486
|
+
* @param sideAngle angular tolerance for perpendicularity test
|
|
235487
|
+
*/
|
|
235488
|
+
static collectSilhouetteEdges(source, vectorToEye, sideAngle = _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createSmallAngle()) {
|
|
235489
|
+
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);
|
|
235490
|
+
PolyfaceQuery.announceSilhouetteEdges(source, (ptA, ptB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(ptA, ptB)), vectorToEye, sideAngle);
|
|
235491
|
+
return collector.grabResult(true);
|
|
235492
|
+
}
|
|
235394
235493
|
/** Find segments (within the linestring) which project to facets.
|
|
235395
235494
|
* * Announce each pair of linestring segment and on-facet segment through a callback.
|
|
235396
235495
|
* * Facets are ASSUMED to be convex and planar, and not overlap in the z direction.
|
|
235397
235496
|
*/
|
|
235398
235497
|
static announceSweepLinestringToConvexPolyfaceXY(linestringPoints, polyface, announce) {
|
|
235399
|
-
const context =
|
|
235498
|
+
const context = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_13__.SweepLineStringToFacetContext.create(linestringPoints);
|
|
235400
235499
|
if (context) {
|
|
235401
235500
|
const visitor = polyface.createVisitor(0);
|
|
235402
235501
|
for (visitor.reset(); visitor.moveToNextFacet();) {
|
|
@@ -235429,7 +235528,7 @@ class PolyfaceQuery {
|
|
|
235429
235528
|
* @internal
|
|
235430
235529
|
*/
|
|
235431
235530
|
static async asyncAnnounceSweepLinestringToConvexPolyfaceXY(linestringPoints, polyface, announce) {
|
|
235432
|
-
const context =
|
|
235531
|
+
const context = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_13__.SweepLineStringToFacetContext.create(linestringPoints);
|
|
235433
235532
|
this.awaitBlockCount = 0;
|
|
235434
235533
|
let workTotal = 0;
|
|
235435
235534
|
if (context) {
|
|
@@ -235452,7 +235551,7 @@ class PolyfaceQuery {
|
|
|
235452
235551
|
return this.partitionFacetIndicesByVertexConnectedComponent(polyface.createVisitor(0));
|
|
235453
235552
|
}
|
|
235454
235553
|
// The polyface is really a visitor !!!
|
|
235455
|
-
const context = new
|
|
235554
|
+
const context = new _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_14__.UnionFindContext(this.visitorClientPointCount(polyface));
|
|
235456
235555
|
for (polyface.reset(); polyface.moveToNextFacet();) {
|
|
235457
235556
|
const firstVertexIndexOnThisFacet = polyface.pointIndex[0];
|
|
235458
235557
|
for (const vertexIndex of polyface.pointIndex)
|
|
@@ -235528,7 +235627,7 @@ class PolyfaceQuery {
|
|
|
235528
235627
|
const partitionedIndices = this.partitionFacetIndicesByVisibilityVector(polyface, vectorToEye, sideAngleTolerance);
|
|
235529
235628
|
if (partitionedIndices[visibilitySelect].length === 0)
|
|
235530
235629
|
return undefined;
|
|
235531
|
-
const visitor =
|
|
235630
|
+
const visitor = _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_15__.IndexedPolyfaceSubsetVisitor.createSubsetVisitor(polyface, partitionedIndices[visibilitySelect], 1);
|
|
235532
235631
|
return this.boundaryEdges(visitor, true, false, false);
|
|
235533
235632
|
}
|
|
235534
235633
|
/**
|
|
@@ -235538,7 +235637,7 @@ class PolyfaceQuery {
|
|
|
235538
235637
|
* @param mesh
|
|
235539
235638
|
*/
|
|
235540
235639
|
static announceBoundaryChainsAsLineString3d(mesh, announceLoop) {
|
|
235541
|
-
const collector = new
|
|
235640
|
+
const collector = new _curve_internalContexts_MultiChainCollector__WEBPACK_IMPORTED_MODULE_12__.MultiChainCollector(_Geometry__WEBPACK_IMPORTED_MODULE_2__.Geometry.smallMetricDistance, 1000);
|
|
235542
235641
|
PolyfaceQuery.announceBoundaryEdges(mesh, (pointA, pointB, _indexA, _indexB) => collector.captureCurve(_curve_LineSegment3d__WEBPACK_IMPORTED_MODULE_11__.LineSegment3d.create(pointA, pointB)), true, false, false);
|
|
235543
235642
|
collector.announceChainsAsLineString3d(announceLoop);
|
|
235544
235643
|
}
|
|
@@ -235780,7 +235879,7 @@ class PolyfaceQuery {
|
|
|
235780
235879
|
* @return collection of facet index arrays, one array per connected component
|
|
235781
235880
|
*/
|
|
235782
235881
|
static partitionFacetIndicesBySortableEdgeClusters(edgeClusters, numFacets) {
|
|
235783
|
-
const context = new
|
|
235882
|
+
const context = new _numerics_UnionFind__WEBPACK_IMPORTED_MODULE_14__.UnionFindContext(numFacets);
|
|
235784
235883
|
for (const cluster of edgeClusters) {
|
|
235785
235884
|
if (cluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_10__.SortableEdge) {
|
|
235786
235885
|
// this edge does not connect anywhere. Ignore it!!
|
|
@@ -235871,7 +235970,7 @@ class PolyfaceQuery {
|
|
|
235871
235970
|
let chainContext;
|
|
235872
235971
|
if (options.assembleChains)
|
|
235873
235972
|
chainContext = _topology_ChainMerge__WEBPACK_IMPORTED_MODULE_25__.ChainMergeContext.create();
|
|
235874
|
-
const context =
|
|
235973
|
+
const context = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_13__.ClipSweptLineStringContext.create(linestringPoints, options.vectorToEye);
|
|
235875
235974
|
if (context) {
|
|
235876
235975
|
let visitor;
|
|
235877
235976
|
if (polyfaceOrVisitor instanceof _Polyface__WEBPACK_IMPORTED_MODULE_6__.Polyface)
|
|
@@ -235929,7 +236028,7 @@ class PolyfaceQuery {
|
|
|
235929
236028
|
for (let i = 1; i < lineStringSource.length; i++) {
|
|
235930
236029
|
const point0 = lineStringSource.getPoint3dAtUncheckedPointIndex(i - 1);
|
|
235931
236030
|
const point1 = lineStringSource.getPoint3dAtUncheckedPointIndex(i);
|
|
235932
|
-
const edgeClipper =
|
|
236031
|
+
const edgeClipper = _multiclip_SweepLineStringToFacetContext__WEBPACK_IMPORTED_MODULE_13__.EdgeClipData.createPointPointSweep(point0, point1, sweepVector);
|
|
235933
236032
|
if (edgeClipper !== undefined) {
|
|
235934
236033
|
_geometry3d_Range__WEBPACK_IMPORTED_MODULE_26__.Range3d.createNull(searchRange);
|
|
235935
236034
|
searchRange.extendPoint(point0);
|
|
@@ -289494,7 +289593,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
|
289494
289593
|
/***/ ((module) => {
|
|
289495
289594
|
|
|
289496
289595
|
"use strict";
|
|
289497
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.3.0-dev.
|
|
289596
|
+
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.3.0-dev.19","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -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.3.0-dev.19","@itwin/core-bentley":"workspace:^4.3.0-dev.19","@itwin/core-common":"workspace:^4.3.0-dev.19","@itwin/core-geometry":"workspace:^4.3.0-dev.19","@itwin/core-orbitgt":"workspace:^4.3.0-dev.19","@itwin/core-quantity":"workspace:^4.3.0-dev.19"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^8.2.2","@types/node":"18.16.1","@types/sinon":"^10.0.15","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^15.0.4","source-map-loader":"^4.0.0","typescript":"~5.0.2","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.1.0","@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","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
|
|
289498
289597
|
|
|
289499
289598
|
/***/ })
|
|
289500
289599
|
|