@itwin/ecschema-rpcinterface-tests 5.12.0-dev.11 → 5.12.0-dev.13

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.
@@ -87584,14 +87584,13 @@ class DrawingViewState extends _ViewState__WEBPACK_IMPORTED_MODULE_14__.ViewStat
87584
87584
  let displaySpatialView = false;
87585
87585
  try {
87586
87586
  const ecsql = `
87587
- SELECT spatialView,
87587
+ SELECT spatialView.Id as spatialViewId,
87588
87588
  json_extract(jsonProperties, '$.drawingToSpatialTransform') as drawingToSpatialTransform,
87589
87589
  CAST(json_extract(jsonProperties, '$.displaySpatialView') as BOOLEAN) as displaySpatialView
87590
87590
  FROM bis.SectionDrawing
87591
87591
  WHERE ECInstanceId=${this.baseModelId}`;
87592
- // eslint-disable-next-line @typescript-eslint/no-deprecated
87593
- for await (const row of this.iModel.createQueryReader(ecsql, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames })) {
87594
- spatialView = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.fromJSON(row.spatialView?.id);
87592
+ for await (const row of this.iModel.createQueryReader(ecsql, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseECSqlPropertyNames })) {
87593
+ spatialView = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.Id64.fromJSON(row.spatialViewId);
87595
87594
  displaySpatialView = !!row.displaySpatialView;
87596
87595
  try {
87597
87596
  drawingToSpatialTransform = JSON.parse(row.drawingToSpatialTransform);
@@ -92814,24 +92813,24 @@ class SnapshotConnection extends IModelConnection {
92814
92813
  return [];
92815
92814
  const select3d = `
92816
92815
  SELECT
92817
- ECInstanceId,
92816
+ ECInstanceId as id,
92818
92817
  Origin.x as x, Origin.y as y, Origin.z as z,
92819
92818
  BBoxLow.x as lx, BBoxLow.y as ly, BBoxLow.z as lz,
92820
92819
  BBoxHigh.x as hx, BBoxHigh.y as hy, BBoxHigh.z as hz,
92821
- Yaw, Pitch, Roll,
92822
- NULL as Rotation
92820
+ Yaw as yaw, Pitch as pitch, Roll as roll,
92821
+ NULL as rotation
92823
92822
  FROM bis.GeometricElement3d
92824
92823
  WHERE Origin IS NOT NULL AND BBoxLow IS NOT NULL AND BBoxHigh IS NOT NULL`;
92825
92824
  // Note: For the UNION ALL statement, the column aliases in select2d are ignored - so they
92826
92825
  // must match those in select3d.
92827
92826
  const select2d = `
92828
92827
  SELECT
92829
- ECInstanceId,
92828
+ ECInstanceId as id,
92830
92829
  Origin.x as x, Origin.y as y, NULL as z,
92831
92830
  BBoxLow.x as lx, BBoxLow.y as ly, NULL as lz,
92832
92831
  BBoxHigh.x as hx, BBoxHigh.y as hy, NULL as hz,
92833
92832
  NULL as yaw, NULL as pitch, NULL as roll,
92834
- Rotation
92833
+ Rotation as rotation
92835
92834
  FROM bis.GeometricElement2d
92836
92835
  WHERE Origin IS NOT NULL AND BBoxLow IS NOT NULL AND BBoxHigh IS NOT NULL`;
92837
92836
  const idCriterion = `ECInstanceId IN (${ids.join(",")})`;
@@ -92853,8 +92852,7 @@ class SnapshotConnection extends IModelConnection {
92853
92852
  break;
92854
92853
  }
92855
92854
  const placements = new Array();
92856
- // eslint-disable-next-line @typescript-eslint/no-deprecated
92857
- for await (const queryRow of this._iModel.createQueryReader(ecsql, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames })) {
92855
+ for await (const queryRow of this._iModel.createQueryReader(ecsql, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseECSqlPropertyNames })) {
92858
92856
  const row = queryRow.toRow();
92859
92857
  const origin = [row.x, row.y, row.z];
92860
92858
  const bbox = {
@@ -99669,10 +99667,9 @@ class ViewCreator2d {
99669
99667
  async _addSheetViewProps(modelId, props) {
99670
99668
  let width = 0;
99671
99669
  let height = 0;
99672
- // eslint-disable-next-line @typescript-eslint/no-deprecated
99673
- for await (const row of this._imodel.createQueryReader(`SELECT Width, Height FROM bis.Sheet WHERE ECInstanceId = ?`, _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryBinder.from([modelId]), { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames })) {
99674
- width = row.width;
99675
- height = row.height;
99670
+ for await (const row of this._imodel.createQueryReader(`SELECT Width, Height FROM bis.Sheet WHERE ECInstanceId = ?`, _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryBinder.from([modelId]), { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseECSqlPropertyNames })) {
99671
+ width = row.Width;
99672
+ height = row.Height;
99676
99673
  break;
99677
99674
  }
99678
99675
  const sheetProps = {
@@ -99716,7 +99713,7 @@ class ViewCreator2d {
99716
99713
  * @param modelId of target model.
99717
99714
  */
99718
99715
  async _getViewDefinitionsIdForModel(modelId) {
99719
- const query = `SELECT ECInstanceId from Bis.ViewDefinition2D WHERE BaseModel.Id = ${modelId} AND isPrivate = false LIMIT 1`;
99716
+ const query = `SELECT ECInstanceId as id from Bis.ViewDefinition2D WHERE BaseModel.Id = ${modelId} AND isPrivate = false LIMIT 1`;
99720
99717
  const viewDefinitionsId = await this._executeQuery(query);
99721
99718
  return (viewDefinitionsId.length) > 0 ? viewDefinitionsId[0] : undefined;
99722
99719
  }
@@ -99724,7 +99721,7 @@ class ViewCreator2d {
99724
99721
  * Get all drawing categories
99725
99722
  */
99726
99723
  async _getAllCategories() {
99727
- const query = "SELECT ECInstanceId from BisCore.DrawingCategory";
99724
+ const query = "SELECT ECInstanceId as id from BisCore.DrawingCategory";
99728
99725
  const categories = await this._executeQuery(query);
99729
99726
  return categories;
99730
99727
  }
@@ -99733,7 +99730,7 @@ class ViewCreator2d {
99733
99730
  * @param modelId of target model.
99734
99731
  */
99735
99732
  async _getSheetAttachments(modelId) {
99736
- const query = `SELECT ECInstanceId FROM Bis.ViewAttachment WHERE Model.Id = ${modelId}`;
99733
+ const query = `SELECT ECInstanceId as id FROM Bis.ViewAttachment WHERE Model.Id = ${modelId}`;
99737
99734
  const attachments = await this._executeQuery(query);
99738
99735
  return attachments;
99739
99736
  }
@@ -99743,8 +99740,7 @@ class ViewCreator2d {
99743
99740
  */
99744
99741
  _executeQuery = async (query) => {
99745
99742
  const rows = [];
99746
- // eslint-disable-next-line @typescript-eslint/no-deprecated
99747
- for await (const row of this._imodel.createQueryReader(query, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames }))
99743
+ for await (const row of this._imodel.createQueryReader(query, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseECSqlPropertyNames }))
99748
99744
  rows.push(row.id);
99749
99745
  return rows;
99750
99746
  };
@@ -166246,6 +166242,9 @@ class GltfReader {
166246
166242
  }
166247
166243
  case _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfMeshMode.LineStrip: {
166248
166244
  (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.assert)(undefined !== bufferView); // compiler can't seem to infer this...
166245
+ // Per the KHR_mesh_primitive_restart extension (https://github.com/KhronosGroup/glTF/pull/2569), the indices accessor may contain
166246
+ // "primitive restart" values - the maximum value for the accessor's component type - each of which terminates the current line strip
166247
+ // and begins a new one. This permits many strips to be batched into a single primitive.
166249
166248
  const restart = _common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedByte === bufferView.type ? 0xff : (_common_gltf_GltfSchema__WEBPACK_IMPORTED_MODULE_12__.GltfDataType.UnsignedShort === bufferView.type ? 0xffff : 0xffffffff);
166250
166249
  for (const index of data.buffer) {
166251
166250
  if (index === restart) {
@@ -181956,8 +181955,7 @@ class ElementSetTool extends _PrimitiveTool__WEBPACK_IMPORTED_MODULE_9__.Primiti
181956
181955
  // When assembly parent is selected, pick all geometric elements with it as the parent.
181957
181956
  // When assembly member is selected, pick the parent as well as all the other members.
181958
181957
  const ecsql = `SELECT ECInstanceId as id, Parent.Id as parentId FROM BisCore.GeometricElement WHERE Parent.Id IN (SELECT Parent.Id as parentId FROM BisCore.GeometricElement WHERE (parent.Id IS NOT NULL AND ECInstanceId IN (${id})) OR parent.Id IN (${id}))`;
181959
- // eslint-disable-next-line @typescript-eslint/no-deprecated
181960
- for await (const row of this.iModel.createQueryReader(ecsql, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseJsPropertyNames })) {
181958
+ for await (const row of this.iModel.createQueryReader(ecsql, undefined, { rowFormat: _itwin_core_common__WEBPACK_IMPORTED_MODULE_1__.QueryRowFormat.UseECSqlPropertyNames })) {
181961
181959
  ids.add(row.parentId);
181962
181960
  ids.add(row.id);
181963
181961
  }
@@ -221619,12 +221617,14 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
221619
221617
  return true;
221620
221618
  }
221621
221619
  /** Test the fraction by strict parameter, but allow toleranced distance test at ends. */
221622
- acceptFractionOnLine(extend0, fraction, extend1, pointA, pointB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.smallMetricDistance) {
221620
+ acceptFractionOnLine(extend0, fraction, extend1, pointA, pointB) {
221623
221621
  if (!extend0 && fraction < 0) {
221624
- return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol(fraction * pointA.distanceXY(pointB), tolerance);
221622
+ return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol(fraction * fraction * pointA.distanceSquaredXY(pointB), this._coincidentGeometryContext.tolerance * this._coincidentGeometryContext.tolerance);
221623
+ }
221624
+ else if (!extend1 && fraction > 1.0) {
221625
+ const f = fraction - 1;
221626
+ return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol(f * f * pointA.distanceSquaredXY(pointB), this._coincidentGeometryContext.tolerance * this._coincidentGeometryContext.tolerance);
221625
221627
  }
221626
- else if (!extend1 && fraction > 1.0)
221627
- return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol((fraction - 1.0) * pointA.distanceXY(pointB), tolerance);
221628
221628
  return true;
221629
221629
  }
221630
221630
  /**
@@ -221638,7 +221638,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
221638
221638
  return result;
221639
221639
  }
221640
221640
  /**
221641
- * Record the pre-computed intersection between two curves. Filter by extension rules. Record with fraction mapping.
221641
+ * Record the pre-computed intersection between two curves. Record with fraction mapping.
221642
221642
  * @param localFractionA intersection fraction local to the subcurve of cpA between fractionA0 and fractionA1
221643
221643
  * @param cpA the first curve
221644
221644
  * @param fractionA0 start of the subcurve of cpA
@@ -221718,8 +221718,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
221718
221718
  computeSegmentSegment3D(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {
221719
221719
  const aDir = { x: pointA1.x - pointA0.x, y: pointA1.y - pointA0.y };
221720
221720
  const bDir = { x: pointB1.x - pointB0.x, y: pointB1.y - pointB0.y };
221721
- const tol = this._coincidentGeometryContext.tolerance;
221722
- const fractions = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegmentXYUVIntersectionUnbounded(pointA0, aDir, pointB0, bDir, tol);
221721
+ const fractions = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegmentXYUVIntersectionUnbounded(pointA0, aDir, pointB0, bDir, this._coincidentGeometryContext.tolerance);
221723
221722
  if (!fractions)
221724
221723
  return;
221725
221724
  if (fractions.f1) { // the lines are coincident
@@ -221732,8 +221731,8 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
221732
221731
  this.recordPointWithLocalFractions(overlap.detailA.fraction, cpA, fractionA0, fractionA1, overlap.detailB.fraction, cpB, fractionB0, fractionB1, reversed, overlap);
221733
221732
  }
221734
221733
  else { // the lines have a transverse intersection
221735
- if (this.acceptFractionOnLine(extendA0, fractions.f0.x, extendA1, pointA0, pointA1, tol)) {
221736
- if (this.acceptFractionOnLine(extendB0, fractions.f0.y, extendB1, pointB0, pointB1, tol))
221734
+ if (this.acceptFractionOnLine(extendA0, fractions.f0.x, extendA1, pointA0, pointA1)) {
221735
+ if (this.acceptFractionOnLine(extendB0, fractions.f0.y, extendB1, pointB0, pointB1))
221737
221736
  this.recordPointWithLocalFractions(fractions.f0.x, cpA, fractionA0, fractionA1, fractions.f0.y, cpB, fractionB0, fractionB1, reversed);
221738
221737
  }
221739
221738
  }
@@ -221798,10 +221797,6 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
221798
221797
  // solve for theta; evaluate points; project back to line
221799
221798
  if (this._worldToLocalPerspective) {
221800
221799
  const data = arc.toTransformedPoint4d(this._worldToLocalPerspective);
221801
- const radians0 = data.sweep.fractionToRadians(0);
221802
- const pointB0H = data.center.plus2Scaled(data.vector0, Math.cos(radians0), data.vector90, Math.sin(radians0));
221803
- const radians1 = data.sweep.fractionToRadians(1);
221804
- const pointB1H = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
221805
221800
  const pointA0H = this._worldToLocalPerspective.multiplyPoint3d(pointA0, 1);
221806
221801
  const pointA1H = this._worldToLocalPerspective.multiplyPoint3d(pointA1, 1);
221807
221802
  const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.center);
@@ -221810,35 +221805,49 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
221810
221805
  let numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_10__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians, tol2);
221811
221806
  const closeApproach = (0 === numRoots);
221812
221807
  if (closeApproach)
221813
- numRoots = 1; // we returned the arc's closest approach as the first "root"; if within tolerance and at endpoints, we record it
221814
- const acceptSolution = (iRoot, checkOnlyEndPointDistance = false) => {
221815
- const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(iRoot), data.vector90, sines.atUncheckedIndex(iRoot));
221816
- let fArc = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(iRoot), extendB0);
221817
- let fLine = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegment3dHXYClosestPointUnbounded(pointA0H, pointA1H, arcPoint);
221818
- if (fLine === undefined)
221819
- return undefined;
221820
- if (!checkOnlyEndPointDistance && this.acceptFraction(extendA0, fLine, extendA1) && this.acceptFraction(extendB0, fArc, extendB1))
221821
- return { fLine, fArc };
221822
- // check for an endpoint intersection that is beyond parametric tolerance but within point tolerance
221823
- fLine = fLine < 0.5 ? 0 : 1;
221824
- fArc = data.sweep.fractionToSignedPeriodicFraction(fArc) < 0.5 ? 0 : 1;
221825
- const pointAH = fLine ? pointA1H : pointA0H;
221826
- const pointBH = fArc ? pointB1H : pointB0H;
221827
- const dist2 = pointAH.realDistanceSquaredXY(pointBH);
221828
- return (dist2 !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol(dist2, tol2)) ? { fLine, fArc } : undefined;
221829
- };
221808
+ numRoots = 1; // arc closest approach is the first entry
221809
+ let numAccepted = 0;
221830
221810
  for (let i = 0; i < numRoots; i++) {
221831
- const result = acceptSolution(i, closeApproach);
221832
- if (result)
221833
- this.recordPointWithLocalFractions(result.fLine, cpA, fractionA0, fractionA1, result.fArc, arc, 0, 1, reversed);
221811
+ const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
221812
+ const fArc = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
221813
+ const fLine = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegment3dHXYClosestPointUnbounded(pointA0H, pointA1H, arcPoint);
221814
+ if (fLine === undefined)
221815
+ continue;
221816
+ if (closeApproach) {
221817
+ const linePoint = pointA0H.interpolate(fLine, pointA1H);
221818
+ const dist2 = arcPoint.realDistanceSquaredXY(linePoint);
221819
+ if (dist2 === undefined || !_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol(dist2, tol2))
221820
+ continue;
221821
+ }
221822
+ if (this.acceptFraction(extendA0, fLine, extendA1) && this.acceptFraction(extendB0, fArc, extendB1)) {
221823
+ this.recordPointWithLocalFractions(fLine, cpA, fractionA0, fractionA1, fArc, arc, 0, 1, reversed);
221824
+ numAccepted++;
221825
+ }
221826
+ }
221827
+ if (numAccepted === 0 && !arc.sweep.isFullCircle) {
221828
+ // check for endpoint intersection beyond parametric tolerance but within point tolerance
221829
+ const pointB0H = this._worldToLocalPerspective.multiplyPoint3d(arc.startPoint(), 1);
221830
+ const pointB1H = this._worldToLocalPerspective.multiplyPoint3d(arc.endPoint(), 1);
221831
+ const dist2 = [];
221832
+ let d2 = pointA0H.realDistanceSquaredXY(pointB0H);
221833
+ if (d2 !== undefined)
221834
+ dist2.push({ d2, fA: 0, fB: 0 });
221835
+ d2 = pointA0H.realDistanceSquaredXY(pointB1H);
221836
+ if (d2 !== undefined)
221837
+ dist2.push({ d2, fA: 0, fB: 1 });
221838
+ d2 = pointA1H.realDistanceSquaredXY(pointB0H);
221839
+ if (d2 !== undefined)
221840
+ dist2.push({ d2, fA: 1, fB: 0 });
221841
+ d2 = pointA1H.realDistanceSquaredXY(pointB1H);
221842
+ if (d2 !== undefined)
221843
+ dist2.push({ d2, fA: 1, fB: 1 });
221844
+ dist2.sort((a, b) => a.d2 - b.d2);
221845
+ if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol(dist2[0].d2, tol2))
221846
+ this.recordPointWithLocalFractions(dist2[0].fA, cpA, fractionA0, fractionA1, dist2[0].fB, arc, 0, 1, reversed);
221834
221847
  }
221835
221848
  }
221836
221849
  else {
221837
221850
  const data = arc.toTransformedVectors(this._worldToLocalAffine);
221838
- const radians0 = data.sweep.fractionToRadians(0);
221839
- const pointB0Local = data.center.plus2Scaled(data.vector0, Math.cos(radians0), data.vector90, Math.sin(radians0));
221840
- const radians1 = data.sweep.fractionToRadians(1);
221841
- const pointB1Local = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
221842
221851
  let pointA0Local = pointA0;
221843
221852
  let pointA1Local = pointA1;
221844
221853
  if (this._worldToLocalAffine) {
@@ -221851,27 +221860,40 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
221851
221860
  let numRoots = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_10__.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians, tol2);
221852
221861
  const closeApproach = (0 === numRoots);
221853
221862
  if (closeApproach)
221854
- numRoots = 1; // we returned the arc's closest approach as the first "root"; if within tolerance and at endpoints, we record it
221855
- const acceptSolution = (iRoot, checkOnlyEndPointDistance = false) => {
221856
- const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(iRoot), data.vector90, sines.atUncheckedIndex(iRoot));
221857
- let fArc = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(iRoot), extendB0);
221858
- let fLine = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
221859
- if (fLine === undefined)
221860
- return undefined;
221861
- if (!checkOnlyEndPointDistance && this.acceptFraction(extendA0, fLine, extendA1) && this.acceptFraction(extendB0, fArc, extendB1))
221862
- return { fLine, fArc };
221863
- // check for an endpoint intersection that is beyond parametric tolerance but within point tolerance
221864
- fLine = fLine < 0.5 ? 0 : 1;
221865
- fArc = data.sweep.fractionToSignedPeriodicFraction(fArc) < 0.5 ? 0 : 1;
221866
- const pointALocal = fLine ? pointA1Local : pointA0Local;
221867
- const pointBLocal = fArc ? pointB1Local : pointB0Local;
221868
- const dist2 = pointALocal.distanceSquaredXY(pointBLocal);
221869
- return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol(dist2, tol2) ? { fLine, fArc } : undefined;
221870
- };
221863
+ numRoots = 1; // arc closest approach is the first entry
221864
+ let numAccepted = 0;
221871
221865
  for (let i = 0; i < numRoots; i++) {
221872
- const result = acceptSolution(i, closeApproach);
221873
- if (result)
221874
- this.recordPointWithLocalFractions(result.fLine, cpA, fractionA0, fractionA1, result.fArc, arc, 0, 1, reversed);
221866
+ const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
221867
+ const fArc = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
221868
+ const fLine = _numerics_SmallSystem__WEBPACK_IMPORTED_MODULE_8__.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
221869
+ if (fLine === undefined)
221870
+ continue;
221871
+ if (closeApproach) {
221872
+ const linePoint = pointA0Local.interpolate(fLine, pointA1Local);
221873
+ if (!_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol(arcPoint.distanceSquaredXY(linePoint), tol2))
221874
+ continue;
221875
+ }
221876
+ if (this.acceptFraction(extendA0, fLine, extendA1) && this.acceptFraction(extendB0, fArc, extendB1)) {
221877
+ this.recordPointWithLocalFractions(fLine, cpA, fractionA0, fractionA1, fArc, arc, 0, 1, reversed);
221878
+ numAccepted++;
221879
+ }
221880
+ }
221881
+ if (numAccepted === 0 && !arc.sweep.isFullCircle) {
221882
+ // check for endpoint intersection beyond parametric tolerance but within point tolerance
221883
+ const pointB0Local = arc.startPoint();
221884
+ const pointB1Local = arc.endPoint();
221885
+ if (this._worldToLocalAffine) {
221886
+ this._worldToLocalAffine.multiplyXYAndZInPlace(pointB0Local);
221887
+ this._worldToLocalAffine.multiplyXYAndZInPlace(pointB1Local);
221888
+ }
221889
+ const dist2 = [];
221890
+ dist2.push({ d2: pointA0Local.distanceSquaredXY(pointB0Local), fA: 0, fB: 0 });
221891
+ dist2.push({ d2: pointA0Local.distanceSquaredXY(pointB1Local), fA: 0, fB: 1 });
221892
+ dist2.push({ d2: pointA1Local.distanceSquaredXY(pointB0Local), fA: 1, fB: 0 });
221893
+ dist2.push({ d2: pointA1Local.distanceSquaredXY(pointB1Local), fA: 1, fB: 1 });
221894
+ dist2.sort((a, b) => a.d2 - b.d2);
221895
+ if (_Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isDistanceWithinTol(dist2[0].d2, tol2))
221896
+ this.recordPointWithLocalFractions(dist2[0].fA, cpA, fractionA0, fractionA1, dist2[0].fB, arc, 0, 1, reversed);
221875
221897
  }
221876
221898
  }
221877
221899
  }
@@ -252818,10 +252840,7 @@ class Transform {
252818
252840
  // Tx = Mx + o so we return Mx + o
252819
252841
  return _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.xyzPlusMatrixTimesXYZ(this._origin, this._matrix, point, result);
252820
252842
  }
252821
- /**
252822
- * Transform the input 3d point in place (using `Tp = M*p + o`).
252823
- * Return as a new point or in the pre-allocated result (if result is given).
252824
- */
252843
+ /** Transform the input 3d point in place (using `Tp = M*p + o`). */
252825
252844
  multiplyXYAndZInPlace(point) {
252826
252845
  return _Matrix3d__WEBPACK_IMPORTED_MODULE_2__.Matrix3d.xyzPlusMatrixTimesXYZInPlace(this._origin, this._matrix, point);
252827
252846
  }
@@ -259828,11 +259847,11 @@ class AnalyticRoots {
259828
259847
  * * -2 -- all coefficients identically 0. The entire c, s plane-- and therefore the entire unit circle-- is a solution.
259829
259848
  * * -1 -- beta, gamma are zero, alpha is not.There is no line defined.There are no solutions.
259830
259849
  * * 0 -- the line is well defined, but passes completely outside the unit circle.
259831
- * * In this case, (c1, s1) is the circle point closest to the line and(c2, s2) is the line point closest to the circle.
259850
+ * * In this case, (c[0], s[0]) is the circle point closest to the line and (c[1], s[1]) is the line point closest to the circle.
259832
259851
  * * 1 -- the line is tangent to the unit circle.
259833
259852
  * * Tangency is determined by tolerances, which calls a "close approach" point a tangency.
259834
- * * (c1, s1) is the closest circle point
259835
- * * (c2, s2) is the line point.
259853
+ * * (c[0], s[0]) is the closest circle point
259854
+ * * (c[1], s[1]) is the line point.
259836
259855
  * * 2 -- two simple intersections.
259837
259856
  * @param alpha constant coefficient on line
259838
259857
  * @param beta x cosine coefficient on line
@@ -259863,15 +259882,15 @@ class AnalyticRoots {
259863
259882
  if (D2 < -twoTol) {
259864
259883
  const delta = Math.sqrt(delta2);
259865
259884
  const iota = (alpha < 0) ? (1.0 / delta) : (-1.0 / delta);
259866
- this.appendCosSinRadians(lambda * beta, lambda * gamma, cosValues, sinValues, radiansValues);
259867
259885
  this.appendCosSinRadians(beta * iota, gamma * iota, cosValues, sinValues, radiansValues);
259886
+ this.appendCosSinRadians(lambda * beta, lambda * gamma, cosValues, sinValues, radiansValues);
259868
259887
  solutionType = 0;
259869
259888
  }
259870
259889
  else if (D2 < twoTol) {
259871
259890
  const delta = Math.sqrt(delta2);
259872
259891
  const iota = (alpha < 0) ? (1.0 / delta) : (-1.0 / delta);
259873
- this.appendCosSinRadians(lambda * beta, lambda * gamma, cosValues, sinValues, radiansValues);
259874
259892
  this.appendCosSinRadians(beta * iota, gamma * iota, cosValues, sinValues, radiansValues);
259893
+ this.appendCosSinRadians(lambda * beta, lambda * gamma, cosValues, sinValues, radiansValues);
259875
259894
  solutionType = 1;
259876
259895
  }
259877
259896
  else {
@@ -333045,7 +333064,7 @@ var loadLanguages = instance.loadLanguages;
333045
333064
  /***/ ((module) => {
333046
333065
 
333047
333066
  "use strict";
333048
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.12.0-dev.11","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.10","@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/node":"~20.17.0","@types/sinon":"^17.0.2","@vitest/browser-playwright":"^4.1.8","@vitest/coverage-v8":"^4.1.8","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":"^4.1.8","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"}}');
333067
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.12.0-dev.13","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.10","@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/node":"~20.17.0","@types/sinon":"^17.0.2","@vitest/browser-playwright":"^4.1.8","@vitest/coverage-v8":"^4.1.8","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":"^4.1.8","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"}}');
333049
333068
 
333050
333069
  /***/ })
333051
333070