@itwin/core-geometry 5.8.0 → 5.9.0-dev.2

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/lib/cjs/Geometry.d.ts +2 -1
  3. package/lib/cjs/Geometry.d.ts.map +1 -1
  4. package/lib/cjs/Geometry.js.map +1 -1
  5. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  6. package/lib/cjs/curve/Arc3d.js +7 -6
  7. package/lib/cjs/curve/Arc3d.js.map +1 -1
  8. package/lib/cjs/curve/CurveFactory.d.ts +73 -1
  9. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  10. package/lib/cjs/curve/CurveFactory.js +228 -1
  11. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  12. package/lib/cjs/geometry3d/Point3dVector3d.js +1 -1
  13. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  14. package/lib/cjs/numerics/Polynomials.d.ts +1 -1
  15. package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
  16. package/lib/cjs/numerics/Polynomials.js +21 -9
  17. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  18. package/lib/esm/Geometry.d.ts +2 -1
  19. package/lib/esm/Geometry.d.ts.map +1 -1
  20. package/lib/esm/Geometry.js.map +1 -1
  21. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  22. package/lib/esm/curve/Arc3d.js +7 -6
  23. package/lib/esm/curve/Arc3d.js.map +1 -1
  24. package/lib/esm/curve/CurveFactory.d.ts +73 -1
  25. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  26. package/lib/esm/curve/CurveFactory.js +228 -1
  27. package/lib/esm/curve/CurveFactory.js.map +1 -1
  28. package/lib/esm/geometry3d/Point3dVector3d.js +1 -1
  29. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  30. package/lib/esm/numerics/Polynomials.d.ts +1 -1
  31. package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
  32. package/lib/esm/numerics/Polynomials.js +21 -9
  33. package/lib/esm/numerics/Polynomials.js.map +1 -1
  34. package/package.json +3 -3
@@ -683,7 +683,7 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
683
683
  const simpleLength = this.getFractionToDistanceScale();
684
684
  if (simpleLength !== undefined)
685
685
  return simpleLength * Math.abs(fraction1 - fraction0);
686
- // fall through for true ellipse . .. stroke and accumulate quadrature with typical count . ..
686
+ // fall through for true ellipse . .. stroke and accumulate quadrature with typical count
687
687
  let f0 = fraction0;
688
688
  let f1 = fraction1;
689
689
  if (fraction0 > fraction1) {
@@ -1308,21 +1308,22 @@ class Arc3d extends CurvePrimitive_1.CurvePrimitive {
1308
1308
  // const theta = vector12.angleTo(bisector);
1309
1309
  // vector10, vector12, and bisector are UNIT vectors
1310
1310
  // bisector splits the angle between vector10 and vector12
1311
- const perpendicular = vector12.minus(vector10);
1311
+ const perpendicular = vector12.minus(vector10); // perpendicular to bisector
1312
1312
  const perpendicularMagnitude = perpendicular.magnitude(); // == 2 * sin(theta)
1313
1313
  const sinTheta = 0.5 * perpendicularMagnitude;
1314
1314
  if (!Geometry_1.Geometry.isSmallAngleRadians(sinTheta)) { // for small theta, sinTheta is almost equal to theta
1315
1315
  const cosTheta = Math.sqrt(1 - sinTheta * sinTheta);
1316
1316
  const tanTheta = sinTheta / cosTheta;
1317
- const alphaRadians = Math.acos(sinTheta);
1318
- const distanceToCenter = radius / sinTheta;
1319
- const distanceToTangency = radius / tanTheta;
1317
+ // [arc center, arc start, point1] form a right triangle with angle theta at point1
1318
+ const alphaRadians = Math.acos(sinTheta); // == pi/2 - theta
1319
+ const distanceToCenter = radius / sinTheta; // distance from point1 to arc center along bisector
1320
+ const distanceToTangency = radius / tanTheta; // distance from point1 to start/end of arc along vector10/vector12
1320
1321
  const f10 = distanceToTangency / d10;
1321
1322
  const f12 = distanceToTangency / d12;
1322
1323
  const center = point1.plusScaled(bisector, distanceToCenter);
1323
1324
  bisector.scaleInPlace(-radius);
1324
1325
  perpendicular.scaleInPlace(radius / perpendicularMagnitude);
1325
- const arc02 = Arc3d.create(center, bisector, perpendicular, AngleSweep_1.AngleSweep.createStartEndRadians(-alphaRadians, alphaRadians));
1326
+ const arc02 = Arc3d.create(center, bisector, perpendicular, AngleSweep_1.AngleSweep.createStartEndRadians(-alphaRadians, alphaRadians)); // arc02 is a circle with the given radius because both bisector and perpendicular have length radius
1326
1327
  return { arc: arc02, fraction10: f10, fraction12: f12, point: point1.clone() };
1327
1328
  }
1328
1329
  }