@itwin/ecschema-rpcinterface-tests 5.9.0-dev.1 → 5.9.0-dev.3
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 +278 -21
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -30882,7 +30882,7 @@ class ECSqlReader extends _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.ECSqlRea
|
|
|
30882
30882
|
this.reset(options);
|
|
30883
30883
|
}
|
|
30884
30884
|
/**
|
|
30885
|
-
* @deprecated in 5.6. Will not be removed until 2027-02-18. Should not be used. Will be made private in a future release.
|
|
30885
|
+
* @deprecated in 5.6 - will not be removed until after 2027-04-02. Will not be removed until 2027-02-18. Should not be used. Will be made private in a future release.
|
|
30886
30886
|
*/
|
|
30887
30887
|
setParams(param) {
|
|
30888
30888
|
if (this._lockArgs) {
|
|
@@ -30891,7 +30891,7 @@ class ECSqlReader extends _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.ECSqlRea
|
|
|
30891
30891
|
this._param = param.serialize();
|
|
30892
30892
|
}
|
|
30893
30893
|
/**
|
|
30894
|
-
* @deprecated in 5.6. Will not be removed until 2027-02-18. Should not be used. Will be made private in a future release.
|
|
30894
|
+
* @deprecated in 5.6 - will not be removed until after 2027-04-02. Will not be removed until 2027-02-18. Should not be used. Will be made private in a future release.
|
|
30895
30895
|
*/
|
|
30896
30896
|
reset(options) {
|
|
30897
30897
|
if (options) {
|
|
@@ -30915,7 +30915,7 @@ class ECSqlReader extends _ECSqlReaderBase__WEBPACK_IMPORTED_MODULE_1__.ECSqlRea
|
|
|
30915
30915
|
}
|
|
30916
30916
|
/**
|
|
30917
30917
|
* Clear all bindings.
|
|
30918
|
-
* @deprecated in 5.6. Will not be removed until 2027-02-18. Should not be used. Will be made private in a future release.
|
|
30918
|
+
* @deprecated in 5.6 - will not be removed until after 2027-04-02. Will not be removed until 2027-02-18. Should not be used. Will be made private in a future release.
|
|
30919
30919
|
*/
|
|
30920
30920
|
resetBindings() {
|
|
30921
30921
|
this._param = new _ConcurrentQuery__WEBPACK_IMPORTED_MODULE_0__.QueryBinder().serialize();
|
|
@@ -35654,6 +35654,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
35654
35654
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
35655
35655
|
/* harmony export */ ChannelControlError: () => (/* binding */ ChannelControlError),
|
|
35656
35656
|
/* harmony export */ CloudSqliteError: () => (/* binding */ CloudSqliteError),
|
|
35657
|
+
/* harmony export */ ITwinSettingsError: () => (/* binding */ ITwinSettingsError),
|
|
35657
35658
|
/* harmony export */ SqliteError: () => (/* binding */ SqliteError),
|
|
35658
35659
|
/* harmony export */ ViewStoreError: () => (/* binding */ ViewStoreError),
|
|
35659
35660
|
/* harmony export */ WorkspaceError: () => (/* binding */ WorkspaceError)
|
|
@@ -35730,6 +35731,21 @@ var WorkspaceError;
|
|
|
35730
35731
|
WorkspaceError.throwError = throwError;
|
|
35731
35732
|
})(WorkspaceError || (WorkspaceError = {}));
|
|
35732
35733
|
/** @beta */
|
|
35734
|
+
var ITwinSettingsError;
|
|
35735
|
+
(function (ITwinSettingsError) {
|
|
35736
|
+
ITwinSettingsError.scope = "itwin-settings";
|
|
35737
|
+
/** Determine whether an error object is an ITwinSettingsError. */
|
|
35738
|
+
function isError(error, key) {
|
|
35739
|
+
return _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.ITwinError.isError(error, ITwinSettingsError.scope, key);
|
|
35740
|
+
}
|
|
35741
|
+
ITwinSettingsError.isError = isError;
|
|
35742
|
+
/** Instantiate and throw an ITwinSettingsError. */
|
|
35743
|
+
function throwError(key, e) {
|
|
35744
|
+
_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.ITwinError.throwError({ ...e, iTwinErrorId: { scope: ITwinSettingsError.scope, key } });
|
|
35745
|
+
}
|
|
35746
|
+
ITwinSettingsError.throwError = throwError;
|
|
35747
|
+
})(ITwinSettingsError || (ITwinSettingsError = {}));
|
|
35748
|
+
/** @beta */
|
|
35733
35749
|
var ChannelControlError;
|
|
35734
35750
|
(function (ChannelControlError) {
|
|
35735
35751
|
/** the ITwinError scope for `ChannelControlError`s. */
|
|
@@ -45480,6 +45496,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
45480
45496
|
/* harmony export */ IModelTileRpcInterface: () => (/* reexport safe */ _rpc_IModelTileRpcInterface__WEBPACK_IMPORTED_MODULE_142__.IModelTileRpcInterface),
|
|
45481
45497
|
/* harmony export */ IModelVersion: () => (/* reexport safe */ _IModelVersion__WEBPACK_IMPORTED_MODULE_72__.IModelVersion),
|
|
45482
45498
|
/* harmony export */ INSTANCE: () => (/* reexport safe */ _rpc_core_RpcRegistry__WEBPACK_IMPORTED_MODULE_134__.INSTANCE),
|
|
45499
|
+
/* harmony export */ ITwinSettingsError: () => (/* reexport safe */ _ITwinCoreErrors__WEBPACK_IMPORTED_MODULE_73__.ITwinSettingsError),
|
|
45483
45500
|
/* harmony export */ ImageBuffer: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_69__.ImageBuffer),
|
|
45484
45501
|
/* harmony export */ ImageBufferFormat: () => (/* reexport safe */ _Image__WEBPACK_IMPORTED_MODULE_69__.ImageBufferFormat),
|
|
45485
45502
|
/* harmony export */ ImageGraphic: () => (/* reexport safe */ _geometry_ImageGraphic__WEBPACK_IMPORTED_MODULE_54__.ImageGraphic),
|
|
@@ -202833,7 +202850,7 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
202833
202850
|
const simpleLength = this.getFractionToDistanceScale();
|
|
202834
202851
|
if (simpleLength !== undefined)
|
|
202835
202852
|
return simpleLength * Math.abs(fraction1 - fraction0);
|
|
202836
|
-
// fall through for true ellipse . .. stroke and accumulate quadrature with typical count
|
|
202853
|
+
// fall through for true ellipse . .. stroke and accumulate quadrature with typical count
|
|
202837
202854
|
let f0 = fraction0;
|
|
202838
202855
|
let f1 = fraction1;
|
|
202839
202856
|
if (fraction0 > fraction1) {
|
|
@@ -203458,21 +203475,22 @@ class Arc3d extends _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive
|
|
|
203458
203475
|
// const theta = vector12.angleTo(bisector);
|
|
203459
203476
|
// vector10, vector12, and bisector are UNIT vectors
|
|
203460
203477
|
// bisector splits the angle between vector10 and vector12
|
|
203461
|
-
const perpendicular = vector12.minus(vector10);
|
|
203478
|
+
const perpendicular = vector12.minus(vector10); // perpendicular to bisector
|
|
203462
203479
|
const perpendicularMagnitude = perpendicular.magnitude(); // == 2 * sin(theta)
|
|
203463
203480
|
const sinTheta = 0.5 * perpendicularMagnitude;
|
|
203464
203481
|
if (!_Geometry__WEBPACK_IMPORTED_MODULE_6__.Geometry.isSmallAngleRadians(sinTheta)) { // for small theta, sinTheta is almost equal to theta
|
|
203465
203482
|
const cosTheta = Math.sqrt(1 - sinTheta * sinTheta);
|
|
203466
203483
|
const tanTheta = sinTheta / cosTheta;
|
|
203467
|
-
|
|
203468
|
-
const
|
|
203469
|
-
const
|
|
203484
|
+
// [arc center, arc start, point1] form a right triangle with angle theta at point1
|
|
203485
|
+
const alphaRadians = Math.acos(sinTheta); // == pi/2 - theta
|
|
203486
|
+
const distanceToCenter = radius / sinTheta; // distance from point1 to arc center along bisector
|
|
203487
|
+
const distanceToTangency = radius / tanTheta; // distance from point1 to start/end of arc along vector10/vector12
|
|
203470
203488
|
const f10 = distanceToTangency / d10;
|
|
203471
203489
|
const f12 = distanceToTangency / d12;
|
|
203472
203490
|
const center = point1.plusScaled(bisector, distanceToCenter);
|
|
203473
203491
|
bisector.scaleInPlace(-radius);
|
|
203474
203492
|
perpendicular.scaleInPlace(radius / perpendicularMagnitude);
|
|
203475
|
-
const arc02 = Arc3d.create(center, bisector, perpendicular, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_4__.AngleSweep.createStartEndRadians(-alphaRadians, alphaRadians));
|
|
203493
|
+
const arc02 = Arc3d.create(center, bisector, perpendicular, _geometry3d_AngleSweep__WEBPACK_IMPORTED_MODULE_4__.AngleSweep.createStartEndRadians(-alphaRadians, alphaRadians)); // arc02 is a circle with the given radius because both bisector and perpendicular have length radius
|
|
203476
203494
|
return { arc: arc02, fraction10: f10, fraction12: f12, point: point1.clone() };
|
|
203477
203495
|
}
|
|
203478
203496
|
}
|
|
@@ -206062,7 +206080,7 @@ class CurveFactory {
|
|
|
206062
206080
|
continue;
|
|
206063
206081
|
const bA = blendArray[_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.modulo(i - 1, n)];
|
|
206064
206082
|
const bC = blendArray[_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.modulo(i + 1, n)];
|
|
206065
|
-
if (bB.fraction10 > 1 || bB.fraction12 > 1 ||
|
|
206083
|
+
if (bB.fraction10 > 1 || bB.fraction12 > 1 || bB.fraction10 + bA.fraction12 > 1 || bB.fraction12 + bC.fraction10 > 1) {
|
|
206066
206084
|
bB.fraction10 = bB.fraction12 = 0;
|
|
206067
206085
|
bB.arc = undefined;
|
|
206068
206086
|
}
|
|
@@ -206079,6 +206097,233 @@ class CurveFactory {
|
|
|
206079
206097
|
}
|
|
206080
206098
|
return path;
|
|
206081
206099
|
}
|
|
206100
|
+
/** If an open filletedLineString starts/ends with an arc, add a zero-length line segment to its start/end. */
|
|
206101
|
+
static validateOpenPathStartEnd(filletedLineString) {
|
|
206102
|
+
const numOfChildren = filletedLineString.children.length;
|
|
206103
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(numOfChildren > 0);
|
|
206104
|
+
const firstChild = filletedLineString.children[0];
|
|
206105
|
+
const lastChild = filletedLineString.children[numOfChildren - 1];
|
|
206106
|
+
if (firstChild instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d) {
|
|
206107
|
+
const startPoint = firstChild.startPoint();
|
|
206108
|
+
filletedLineString = _Path__WEBPACK_IMPORTED_MODULE_7__.Path.create(_LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d.create(startPoint, startPoint), ...filletedLineString.children);
|
|
206109
|
+
}
|
|
206110
|
+
if (lastChild instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d) {
|
|
206111
|
+
const endPoint = lastChild.endPoint();
|
|
206112
|
+
filletedLineString = _Path__WEBPACK_IMPORTED_MODULE_7__.Path.create(...filletedLineString.children, _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d.create(endPoint, endPoint));
|
|
206113
|
+
}
|
|
206114
|
+
return filletedLineString;
|
|
206115
|
+
}
|
|
206116
|
+
/**
|
|
206117
|
+
* Split `arc` according to the partition given by `fractions` and append the pieces to `output` with zero-length
|
|
206118
|
+
* line segments in between.
|
|
206119
|
+
* @param fractions a complete partition of the fractional parameter space, e.g., [0, 0.5, 1] splits the arc into
|
|
206120
|
+
* two pieces.
|
|
206121
|
+
*/
|
|
206122
|
+
static splitAndAppendArc(output, arc, fractions) {
|
|
206123
|
+
const pt = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.createZero();
|
|
206124
|
+
for (let k = 0; k < fractions.length - 1; k++) {
|
|
206125
|
+
output.tryAddChild(arc.clonePartialCurve(fractions[k], fractions[k + 1]));
|
|
206126
|
+
if (k + 1 < fractions.length - 1) {
|
|
206127
|
+
arc.fractionToPoint(fractions[k + 1], pt);
|
|
206128
|
+
output.tryAddChild(_LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d.create(pt, pt));
|
|
206129
|
+
}
|
|
206130
|
+
}
|
|
206131
|
+
}
|
|
206132
|
+
/**
|
|
206133
|
+
* Update the path for relaxed validation:
|
|
206134
|
+
* * If there are 2 connected arcs, add a zero-length line segment between them.
|
|
206135
|
+
* * If there is a pair of arc and line segment/string with non-parallel tangents, add a zero-length line segment
|
|
206136
|
+
* between them.
|
|
206137
|
+
* * If there is an arc with sweep degrees in [180, 360), break the arc into 2 pieces separated by a zero-length
|
|
206138
|
+
* line segment. Similarly, break a 360-degree arc into 3 pieces separated by 2 zero-length line segments. Return
|
|
206139
|
+
* `undefined` if there is an arc with sweep greater than 360 degrees.
|
|
206140
|
+
*/
|
|
206141
|
+
static updatePathForRelaxedValidation(filletedLineString, isClosed, parallelOptions) {
|
|
206142
|
+
const newFilletedLineString = new _Path__WEBPACK_IMPORTED_MODULE_7__.Path();
|
|
206143
|
+
const numOfChildren = filletedLineString.children.length;
|
|
206144
|
+
for (let i = 0; i < numOfChildren; i++) { // examine each child and its predecessor
|
|
206145
|
+
const child = filletedLineString.children[i];
|
|
206146
|
+
const arcSweep = child instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d ? Math.abs(child.sweep.sweepDegrees) : undefined;
|
|
206147
|
+
const sweepTol = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallAngleDegrees;
|
|
206148
|
+
if (arcSweep !== undefined && arcSweep > 360 + sweepTol)
|
|
206149
|
+
return undefined;
|
|
206150
|
+
if (!isClosed && i === 0) {
|
|
206151
|
+
newFilletedLineString.tryAddChild(child);
|
|
206152
|
+
continue; // skip first child for open path since it won't have a previous child
|
|
206153
|
+
}
|
|
206154
|
+
const prevChild = filletedLineString.cyclicCurvePrimitive(i - 1);
|
|
206155
|
+
(0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(prevChild !== undefined, "Cyclic neighbor is defined within loop extents");
|
|
206156
|
+
const childStartTangent = child.fractionToPointAndDerivative(0).direction;
|
|
206157
|
+
const prevChildEndTangent = prevChild.fractionToPointAndDerivative(1).direction;
|
|
206158
|
+
const childrenAreParallel = childStartTangent.isParallelTo(prevChildEndTangent, false, true, parallelOptions);
|
|
206159
|
+
const arcLineStringCorner = !childrenAreParallel &&
|
|
206160
|
+
((child instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d && (prevChild instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d || prevChild instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_5__.LineString3d)) ||
|
|
206161
|
+
((prevChild instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d && (child instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d || child instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_5__.LineString3d))));
|
|
206162
|
+
const twoConnectedArcs = child instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d && prevChild instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d;
|
|
206163
|
+
// apply relaxed validation rules
|
|
206164
|
+
if (twoConnectedArcs || arcLineStringCorner) {
|
|
206165
|
+
const linePoint = child.startPoint();
|
|
206166
|
+
newFilletedLineString.tryAddChild(_LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d.create(linePoint, linePoint));
|
|
206167
|
+
}
|
|
206168
|
+
if (arcSweep !== undefined && arcSweep > 180 - sweepTol && arcSweep <= 360 - sweepTol) {
|
|
206169
|
+
CurveFactory.splitAndAppendArc(newFilletedLineString, child, [0, 0.5, 1]); // 2 pieces
|
|
206170
|
+
}
|
|
206171
|
+
else if (arcSweep !== undefined && arcSweep > 360 - sweepTol && arcSweep <= 360 + sweepTol) {
|
|
206172
|
+
CurveFactory.splitAndAppendArc(newFilletedLineString, child, [0, 1 / 3, 2 / 3, 1]); // 3 pieces
|
|
206173
|
+
}
|
|
206174
|
+
else {
|
|
206175
|
+
newFilletedLineString.tryAddChild(child);
|
|
206176
|
+
}
|
|
206177
|
+
}
|
|
206178
|
+
return newFilletedLineString;
|
|
206179
|
+
}
|
|
206180
|
+
/**
|
|
206181
|
+
* Verify each neighboring curve to an arc is a line segment/string. Also verify arc tangents are parallel
|
|
206182
|
+
* (but not anti-parallel) to neighboring line segment/string tangents.
|
|
206183
|
+
*/
|
|
206184
|
+
static validateArcNeighbors(validatedFilletedLineString, i, perpOptions) {
|
|
206185
|
+
const child = validatedFilletedLineString.getChild(i);
|
|
206186
|
+
if (!child || !(child instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d))
|
|
206187
|
+
return false;
|
|
206188
|
+
// previous child before arc must be line segment/string
|
|
206189
|
+
const prevChild = validatedFilletedLineString.cyclicCurvePrimitive(i - 1); // ASSUME: i === 0 only if the path is closed
|
|
206190
|
+
if (!prevChild || (!(prevChild instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d) && !(prevChild instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_5__.LineString3d)))
|
|
206191
|
+
return false;
|
|
206192
|
+
// arc start tangent must be parallel (but not anti-parallel) to previous line segment
|
|
206193
|
+
const arcStartTangent = child.fractionToPointAndDerivative(0).direction;
|
|
206194
|
+
const prevChildEndTangent = prevChild.fractionToPointAndDerivative(1).direction;
|
|
206195
|
+
if (!arcStartTangent.isParallelTo(prevChildEndTangent, false, true, perpOptions))
|
|
206196
|
+
return false;
|
|
206197
|
+
// next child after arc must be line segment/string
|
|
206198
|
+
const nextChild = validatedFilletedLineString.cyclicCurvePrimitive(i + 1); // ASSUME: i === numOfChildren-1 only if the path is closed
|
|
206199
|
+
if (!nextChild || (!(nextChild instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d) && !(nextChild instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_5__.LineString3d)))
|
|
206200
|
+
return false;
|
|
206201
|
+
// arc end tangent must be parallel (and not anti-parallel) to next line segment
|
|
206202
|
+
const arcEndTangent = child.fractionToPointAndDerivative(1).direction;
|
|
206203
|
+
const nextChildStartTangent = nextChild.fractionToPointAndDerivative(0).direction;
|
|
206204
|
+
if (!arcEndTangent.isParallelTo(nextChildStartTangent, false, true, perpOptions))
|
|
206205
|
+
return false;
|
|
206206
|
+
return true;
|
|
206207
|
+
}
|
|
206208
|
+
/** Validate a filleted line string. */
|
|
206209
|
+
static validateFilletedLineString(filletedLineString, isClosed, options) {
|
|
206210
|
+
if (filletedLineString.children.length === 0)
|
|
206211
|
+
return undefined;
|
|
206212
|
+
const relaxedValidation = options?.relaxedValidation ?? false;
|
|
206213
|
+
let validatedFilletedLineString = filletedLineString;
|
|
206214
|
+
if (!isClosed)
|
|
206215
|
+
validatedFilletedLineString = this.validateOpenPathStartEnd(validatedFilletedLineString);
|
|
206216
|
+
if (relaxedValidation)
|
|
206217
|
+
validatedFilletedLineString = this.updatePathForRelaxedValidation(validatedFilletedLineString, isClosed, options?.parallelOptions);
|
|
206218
|
+
if (validatedFilletedLineString === undefined)
|
|
206219
|
+
return undefined;
|
|
206220
|
+
const numOfChildren = validatedFilletedLineString.children.length;
|
|
206221
|
+
// validate the children
|
|
206222
|
+
for (let i = 0; i < numOfChildren; i++) {
|
|
206223
|
+
const child = validatedFilletedLineString.children[i];
|
|
206224
|
+
if (!(child instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d) && !(child instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d) && !(child instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_5__.LineString3d))
|
|
206225
|
+
return undefined;
|
|
206226
|
+
if (child instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d) {
|
|
206227
|
+
if (child.circularRadius() === undefined || Math.abs(child.sweep.sweepDegrees) > 180 - _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallAngleDegrees)
|
|
206228
|
+
return undefined;
|
|
206229
|
+
if (!this.validateArcNeighbors(validatedFilletedLineString, i, options?.parallelOptions))
|
|
206230
|
+
return undefined;
|
|
206231
|
+
}
|
|
206232
|
+
}
|
|
206233
|
+
return validatedFilletedLineString;
|
|
206234
|
+
}
|
|
206235
|
+
/** If we have 2 connected arcs (with a zero-length line segment in between), add the joint with zero radius. */
|
|
206236
|
+
static addJointBetweenConnectedArcs(validatedFilletedLineString, i, isClosed, result) {
|
|
206237
|
+
if (!isClosed && i < 2) // for open path, skip the first 2 children
|
|
206238
|
+
return;
|
|
206239
|
+
const child = validatedFilletedLineString.getChild(i);
|
|
206240
|
+
if (!child || !(child instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d))
|
|
206241
|
+
return;
|
|
206242
|
+
const prevChild = validatedFilletedLineString.cyclicCurvePrimitive(i - 1);
|
|
206243
|
+
if (!prevChild || !(prevChild instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d) || prevChild.curveLength() > 0)
|
|
206244
|
+
return;
|
|
206245
|
+
const prevPrevChild = validatedFilletedLineString.cyclicCurvePrimitive(i - 2);
|
|
206246
|
+
if (!prevPrevChild || !(prevPrevChild instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d))
|
|
206247
|
+
return;
|
|
206248
|
+
result.push([prevChild.startPoint(), 0]);
|
|
206249
|
+
}
|
|
206250
|
+
/**
|
|
206251
|
+
* Extract points and radii from a valid filleted linestring.
|
|
206252
|
+
* * A valid filleted linestring is a `CurveChain` that satisfies the following conditions:
|
|
206253
|
+
* * Its children have type `Arc3d`, `LineSegment3d`, or `LineString3d`.
|
|
206254
|
+
* * Each `Arc3d` is circular.
|
|
206255
|
+
* * Each `Arc3d` sweep is less than 180 degrees.
|
|
206256
|
+
* * Each `Arc3d` cannot be adjacent to another `Arc3d`.
|
|
206257
|
+
* * Each `Arc3d` is G1 continuous with each of its neighbors, i.e., at their common point, the curves have the same
|
|
206258
|
+
* tangent direction.
|
|
206259
|
+
* * To treat more input chains as valid, pass `options.relaxedValidation = true`. Internally, this setting performs
|
|
206260
|
+
* several transformations on the input to produce a valid filleted linestring:
|
|
206261
|
+
* * Each `Arc3d` whose sweep is between 180 and 360 degrees is split into 2 arcs of equal sweep separated by a
|
|
206262
|
+
* zero-length `LineSegment3d`. A 360-degree arc is split into 3 arcs of equal sweep separated by 2 zero-length
|
|
206263
|
+
* `LineSegment3d`s. Arcs with sweep greater than 360 degrees are not allowed.
|
|
206264
|
+
* * Adjacent `Arc3d`s are separated by a zero-length `LineSegment3d`.
|
|
206265
|
+
* * An `Arc3d` that is not G1 continuous with its neighbor is separated from its neighbor by a zero-length
|
|
206266
|
+
* `LineSegment3d`.
|
|
206267
|
+
* @param filletedLineString A linestring with corner fillets, e.g., as created by {@link CurveFactory.createFilletsInLineString}.
|
|
206268
|
+
* @param options optional validation settings.
|
|
206269
|
+
* @returns Array of [point, radius] pairs extracted from input, or `undefined` if the input is not valid. A radius
|
|
206270
|
+
* of zero means no fillet at the vertex.
|
|
206271
|
+
*/
|
|
206272
|
+
static fromFilletedLineString(filletedLineString, options) {
|
|
206273
|
+
const path = filletedLineString instanceof _Loop__WEBPACK_IMPORTED_MODULE_8__.Loop
|
|
206274
|
+
? _Path__WEBPACK_IMPORTED_MODULE_7__.Path.create(...filletedLineString.children)
|
|
206275
|
+
: filletedLineString;
|
|
206276
|
+
const isClosed = path.isPhysicallyClosedCurve(options?.distanceTol);
|
|
206277
|
+
const validatedFilletedLineString = this.validateFilletedLineString(path, isClosed, options);
|
|
206278
|
+
if (!validatedFilletedLineString)
|
|
206279
|
+
return undefined;
|
|
206280
|
+
// Algorithm:
|
|
206281
|
+
// Each arc contributes a point with the arc's radius. If arc consumed the entire edge (2 points), we make sure to
|
|
206282
|
+
// add both points (one with the arc's radius and one with zero radius).
|
|
206283
|
+
// Each line segment contributes its start point with zero radius, except when it follows an arc, in which case
|
|
206284
|
+
// it is ignored since the arc already contributes that point with the correct radius.
|
|
206285
|
+
// For open validatedFilletedLineString (which is guaranteed to start and end with a line segment) we also add
|
|
206286
|
+
// start and end points with zero radius.
|
|
206287
|
+
const result = [];
|
|
206288
|
+
const numOfChildren = validatedFilletedLineString.children.length;
|
|
206289
|
+
const lastChild = validatedFilletedLineString.cyclicCurvePrimitive(-1);
|
|
206290
|
+
let ignoreLineSegment = isClosed && lastChild && lastChild instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d;
|
|
206291
|
+
for (let i = 0; i < numOfChildren; i++) {
|
|
206292
|
+
const child = validatedFilletedLineString.children[i];
|
|
206293
|
+
if (child instanceof _Arc3d__WEBPACK_IMPORTED_MODULE_3__.Arc3d) {
|
|
206294
|
+
this.addJointBetweenConnectedArcs(validatedFilletedLineString, i, isClosed, result);
|
|
206295
|
+
ignoreLineSegment = true; // ignore next line segment that follows this arc
|
|
206296
|
+
const tangIntersection = child.computeTangentIntersection();
|
|
206297
|
+
const radius = child.circularRadius();
|
|
206298
|
+
if (radius !== undefined && tangIntersection !== undefined)
|
|
206299
|
+
result.push([tangIntersection, radius]);
|
|
206300
|
+
else
|
|
206301
|
+
return undefined;
|
|
206302
|
+
}
|
|
206303
|
+
else if (child instanceof _LineSegment3d__WEBPACK_IMPORTED_MODULE_2__.LineSegment3d) {
|
|
206304
|
+
if (ignoreLineSegment)
|
|
206305
|
+
ignoreLineSegment = false;
|
|
206306
|
+
else
|
|
206307
|
+
result.push([child.startPoint(), 0]);
|
|
206308
|
+
}
|
|
206309
|
+
else if (child instanceof _LineString3d__WEBPACK_IMPORTED_MODULE_5__.LineString3d) {
|
|
206310
|
+
const j0 = ignoreLineSegment ? 1 : 0;
|
|
206311
|
+
ignoreLineSegment = false;
|
|
206312
|
+
for (let j = j0; j < child.numPoints() - 1; j++)
|
|
206313
|
+
result.push([child.pointAtUnchecked(j), 0]);
|
|
206314
|
+
}
|
|
206315
|
+
}
|
|
206316
|
+
if (isClosed) {
|
|
206317
|
+
if (result.length > 0 && !result[0][0].isAlmostEqual(result[result.length - 1][0], options?.distanceTol))
|
|
206318
|
+
result.push(result[0]);
|
|
206319
|
+
}
|
|
206320
|
+
else {
|
|
206321
|
+
const endPoint = validatedFilletedLineString.endPoint();
|
|
206322
|
+
if (endPoint)
|
|
206323
|
+
result.push([endPoint, 0]);
|
|
206324
|
+
}
|
|
206325
|
+
return result;
|
|
206326
|
+
}
|
|
206082
206327
|
/**
|
|
206083
206328
|
* Create a `Loop` with given xy corners and fixed z.
|
|
206084
206329
|
* * The corners always proceed counter clockwise from lower left.
|
|
@@ -240952,7 +241197,7 @@ class Vector3d extends XYZ {
|
|
|
240952
241197
|
*/
|
|
240953
241198
|
tryNormalizeInPlace(smallestMagnitude = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallFraction) {
|
|
240954
241199
|
const a = this.magnitude();
|
|
240955
|
-
if (a
|
|
241200
|
+
if (a <= Math.abs(smallestMagnitude))
|
|
240956
241201
|
return false;
|
|
240957
241202
|
this.scaleInPlace(1.0 / a);
|
|
240958
241203
|
return true;
|
|
@@ -255842,7 +256087,7 @@ class TrigPolynomial {
|
|
|
255842
256087
|
}
|
|
255843
256088
|
return radians.length > 0;
|
|
255844
256089
|
}
|
|
255845
|
-
static
|
|
256090
|
+
static _coefficientRelTolSquared = 1.0e-24;
|
|
255846
256091
|
/**
|
|
255847
256092
|
* Compute intersections of the unit circle `x^2 + y^2 = 1` with the general quadric (conic)
|
|
255848
256093
|
* `axx x^2 + axy xy + ayy y^2 + ax x + ay y + a = 0`.
|
|
@@ -255859,7 +256104,26 @@ class TrigPolynomial {
|
|
|
255859
256104
|
PowerPolynomial.zero(coffs);
|
|
255860
256105
|
let degree;
|
|
255861
256106
|
// see core\geometry\internaldocs\unitCircleEllipseIntersection.md for derivation of these coefficients
|
|
255862
|
-
|
|
256107
|
+
const degree1CoefficientSizeSquared = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseSquaredXYZ(ax, ay, a);
|
|
256108
|
+
const degree2CoefficientSizeSquared = _Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.hypotenuseSquaredXYZ(axx, axy, ayy);
|
|
256109
|
+
if (degree2CoefficientSizeSquared <= TrigPolynomial._coefficientRelTolSquared * degree1CoefficientSizeSquared) {
|
|
256110
|
+
// terms axx, axy, ayy are small compared to ax, ay, a so ignore them
|
|
256111
|
+
PowerPolynomial.accumulate(coffs, this.C, ax);
|
|
256112
|
+
PowerPolynomial.accumulate(coffs, this.S, ay);
|
|
256113
|
+
PowerPolynomial.accumulate(coffs, this.W, a);
|
|
256114
|
+
degree = 2;
|
|
256115
|
+
}
|
|
256116
|
+
else if (degree2CoefficientSizeSquared - 2 * axx * ayy <= 2 * TrigPolynomial._coefficientRelTolSquared * degree2CoefficientSizeSquared) {
|
|
256117
|
+
const c = 0.5 * (axx + ayy);
|
|
256118
|
+
// The lhs above is (axx - ayy)^2 + axy^2. When the inequality is satisfied, both terms are "zero" (quadric is a circle).
|
|
256119
|
+
// With c as a stable substitute for axx and ayy, we have on the unit circle x^2 + y^2 = 1:
|
|
256120
|
+
// 0 = c * (x^2 + y^2) + ax*x + ay*y + a = ax*x + ay*y + a + c
|
|
256121
|
+
PowerPolynomial.accumulate(coffs, this.C, ax);
|
|
256122
|
+
PowerPolynomial.accumulate(coffs, this.S, ay);
|
|
256123
|
+
PowerPolynomial.accumulate(coffs, this.W, a + c);
|
|
256124
|
+
degree = 2;
|
|
256125
|
+
}
|
|
256126
|
+
else {
|
|
255863
256127
|
PowerPolynomial.accumulate(coffs, this.CW, ax);
|
|
255864
256128
|
PowerPolynomial.accumulate(coffs, this.SW, ay);
|
|
255865
256129
|
PowerPolynomial.accumulate(coffs, this.WW, a);
|
|
@@ -255868,19 +256132,12 @@ class TrigPolynomial {
|
|
|
255868
256132
|
PowerPolynomial.accumulate(coffs, this.SC, axy);
|
|
255869
256133
|
degree = 4;
|
|
255870
256134
|
}
|
|
255871
|
-
else {
|
|
255872
|
-
PowerPolynomial.accumulate(coffs, this.C, ax);
|
|
255873
|
-
PowerPolynomial.accumulate(coffs, this.S, ay);
|
|
255874
|
-
PowerPolynomial.accumulate(coffs, this.W, a);
|
|
255875
|
-
degree = 2;
|
|
255876
|
-
}
|
|
255877
256135
|
const maxCoff = Math.max(Math.abs(axx), Math.abs(ayy), Math.abs(axy), Math.abs(ax), Math.abs(ay), Math.abs(a));
|
|
255878
256136
|
const b = this.solveAngles(coffs, degree, maxCoff, radians);
|
|
255879
256137
|
/**
|
|
255880
256138
|
for (const theta of radians) {
|
|
255881
256139
|
const c = Math.cos(theta)
|
|
255882
256140
|
const s = Math.sin(theta)
|
|
255883
|
-
|
|
255884
256141
|
console.log({
|
|
255885
256142
|
angle: theta, co: c, si: s,
|
|
255886
256143
|
f: axx * c * c + axy * c * s + ayy * s * s + ax * c + ay * s + a,
|
|
@@ -325024,7 +325281,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
325024
325281
|
/***/ ((module) => {
|
|
325025
325282
|
|
|
325026
325283
|
"use strict";
|
|
325027
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.9.0-dev.
|
|
325284
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.9.0-dev.3","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 && npm run -s copy:draco","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts && npm run -s extract","extract":"betools extract --fileExt=ts --extractFrom=./src/test/example-code --recursive --out=../../generated-docs/extract","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@bentley/aec-units-schema":"^1.0.3","@bentley/formats-schema":"^1.0.0","@bentley/units-schema":"^1.0.9","@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"^6.0.0","@types/chai-as-promised":"^7","@types/draco3d":"^1.4.10","@types/sinon":"^17.0.2","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.31.0","glob":"^10.5.0","playwright":"~1.56.1","rimraf":"^6.0.1","sinon":"^17.0.2","source-map-loader":"^5.0.0","typescript":"~5.6.2","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"~4.3.4","@loaders.gl/draco":"~4.3.4","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
325028
325285
|
|
|
325029
325286
|
/***/ })
|
|
325030
325287
|
|