@itwin/core-geometry 5.11.0-dev.5 → 5.11.0-dev.7

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.
@@ -294,14 +294,14 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
294
294
  const cosines = new GrowableFloat64Array_1.GrowableFloat64Array(2);
295
295
  const sines = new GrowableFloat64Array_1.GrowableFloat64Array(2);
296
296
  const radians = new GrowableFloat64Array_1.GrowableFloat64Array(2);
297
- // Arc: X = C + cU + sV
297
+ // Arc: X(theta) = C + cos(theta)·U + sin(theta)·V
298
298
  // Line: contains points A0,A1
299
- // Arc point colinear with line if det (A0, A1, X) = 0
300
- // with homogeneous xyw points and vectors.
301
- // With equational X: det (A0, A1, C) + c det (A0, A1,U) + s det (A0, A1, V) = 0.
302
- // solve for theta.
303
- // evaluate points.
304
- // project back to line.
299
+ // Arc point X is colinear (intersects) with line if det(A0, A1, X) = 0 with homogeneous xyw points and vectors
300
+ // This leads to
301
+ // det(A0, A1, C) + cos(theta) det(A0, A1, U) + sin(theta) det(A0, A1, V) = 0
302
+ // or
303
+ // alpha + beta cos(theta) + gamma sin(theta) = 0
304
+ // solve for theta; evaluate points; project back to line
305
305
  if (this._worldToLocalPerspective) {
306
306
  const data = arc.toTransformedPoint4d(this._worldToLocalPerspective);
307
307
  const radians0 = data.sweep.fractionToRadians(0);
@@ -313,7 +313,7 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
313
313
  const alpha = Geometry_1.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.center);
314
314
  const beta = Geometry_1.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.vector0);
315
315
  const gamma = Geometry_1.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.vector90);
316
- let numRoots = Polynomials_1.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
316
+ let numRoots = Polynomials_1.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians, tol2);
317
317
  const closeApproach = (0 === numRoots);
318
318
  if (closeApproach)
319
319
  numRoots = 1; // we returned the arc's closest approach as the first "root"; if within tolerance and at endpoints, we record it
@@ -354,7 +354,7 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
354
354
  const alpha = Geometry_1.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.center, 1);
355
355
  const beta = Geometry_1.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector0, 0);
356
356
  const gamma = Geometry_1.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector90, 0);
357
- let numRoots = Polynomials_1.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
357
+ let numRoots = Polynomials_1.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians, tol2);
358
358
  const closeApproach = (0 === numRoots);
359
359
  if (closeApproach)
360
360
  numRoots = 1; // we returned the arc's closest approach as the first "root"; if within tolerance and at endpoints, we record it