@itwin/core-geometry 5.3.0-dev.8 → 5.3.0

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 (162) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/lib/cjs/curve/Arc3d.d.ts +15 -1
  3. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  4. package/lib/cjs/curve/Arc3d.js +31 -2
  5. package/lib/cjs/curve/Arc3d.js.map +1 -1
  6. package/lib/cjs/curve/CurveFactory.d.ts +25 -8
  7. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  8. package/lib/cjs/curve/CurveFactory.js +51 -55
  9. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  10. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.d.ts +10 -13
  11. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.d.ts.map +1 -1
  12. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js +23 -22
  13. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  14. package/lib/cjs/curve/spiral/ClothoidSeries.d.ts +10 -6
  15. package/lib/cjs/curve/spiral/ClothoidSeries.d.ts.map +1 -1
  16. package/lib/cjs/curve/spiral/ClothoidSeries.js +36 -19
  17. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  18. package/lib/cjs/curve/spiral/CubicEvaluator.d.ts +7 -6
  19. package/lib/cjs/curve/spiral/CubicEvaluator.d.ts.map +1 -1
  20. package/lib/cjs/curve/spiral/CubicEvaluator.js +29 -14
  21. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  22. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.d.ts +34 -44
  23. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.d.ts.map +1 -1
  24. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js +47 -53
  25. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  26. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts +2 -2
  27. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts.map +1 -1
  28. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js +17 -7
  29. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  30. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +112 -104
  31. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  32. package/lib/cjs/curve/spiral/DirectSpiral3d.js +143 -117
  33. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  34. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +71 -53
  35. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  36. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +99 -66
  37. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  38. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts +8 -12
  39. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts.map +1 -1
  40. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +11 -13
  41. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  42. package/lib/cjs/curve/spiral/NormalizedTransition.d.ts +36 -29
  43. package/lib/cjs/curve/spiral/NormalizedTransition.d.ts.map +1 -1
  44. package/lib/cjs/curve/spiral/NormalizedTransition.js +62 -40
  45. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  46. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.d.ts +13 -18
  47. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.d.ts.map +1 -1
  48. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js +21 -24
  49. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  50. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts +41 -27
  51. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  52. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js +50 -33
  53. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  54. package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts +45 -34
  55. package/lib/cjs/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
  56. package/lib/cjs/curve/spiral/TransitionSpiral3d.js +56 -38
  57. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  58. package/lib/cjs/curve/spiral/XYCurveEvaluator.d.ts +27 -21
  59. package/lib/cjs/curve/spiral/XYCurveEvaluator.d.ts.map +1 -1
  60. package/lib/cjs/curve/spiral/XYCurveEvaluator.js +23 -18
  61. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  62. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +96 -98
  63. package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
  64. package/lib/cjs/geometry3d/GrowableXYArray.js +121 -110
  65. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  66. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +135 -142
  67. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  68. package/lib/cjs/geometry3d/GrowableXYZArray.js +165 -160
  69. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  70. package/lib/cjs/geometry3d/IndexedXYCollection.d.ts +51 -34
  71. package/lib/cjs/geometry3d/IndexedXYCollection.d.ts.map +1 -1
  72. package/lib/cjs/geometry3d/IndexedXYCollection.js +16 -6
  73. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  74. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +78 -77
  75. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  76. package/lib/cjs/geometry3d/IndexedXYZCollection.js +38 -35
  77. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  78. package/lib/cjs/geometry3d/PolygonOps.d.ts +27 -7
  79. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  80. package/lib/cjs/geometry3d/PolygonOps.js +30 -9
  81. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  82. package/lib/esm/curve/Arc3d.d.ts +15 -1
  83. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  84. package/lib/esm/curve/Arc3d.js +31 -2
  85. package/lib/esm/curve/Arc3d.js.map +1 -1
  86. package/lib/esm/curve/CurveFactory.d.ts +25 -8
  87. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  88. package/lib/esm/curve/CurveFactory.js +51 -55
  89. package/lib/esm/curve/CurveFactory.js.map +1 -1
  90. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.d.ts +10 -13
  91. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.d.ts.map +1 -1
  92. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js +23 -22
  93. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  94. package/lib/esm/curve/spiral/ClothoidSeries.d.ts +10 -6
  95. package/lib/esm/curve/spiral/ClothoidSeries.d.ts.map +1 -1
  96. package/lib/esm/curve/spiral/ClothoidSeries.js +36 -19
  97. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  98. package/lib/esm/curve/spiral/CubicEvaluator.d.ts +7 -6
  99. package/lib/esm/curve/spiral/CubicEvaluator.d.ts.map +1 -1
  100. package/lib/esm/curve/spiral/CubicEvaluator.js +29 -14
  101. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  102. package/lib/esm/curve/spiral/CzechSpiralEvaluator.d.ts +34 -44
  103. package/lib/esm/curve/spiral/CzechSpiralEvaluator.d.ts.map +1 -1
  104. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js +47 -53
  105. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  106. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts +2 -2
  107. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.d.ts.map +1 -1
  108. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js +17 -7
  109. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  110. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +112 -104
  111. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  112. package/lib/esm/curve/spiral/DirectSpiral3d.js +143 -117
  113. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  114. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +71 -53
  115. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  116. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +99 -66
  117. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  118. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts +8 -12
  119. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.d.ts.map +1 -1
  120. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +11 -13
  121. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  122. package/lib/esm/curve/spiral/NormalizedTransition.d.ts +36 -29
  123. package/lib/esm/curve/spiral/NormalizedTransition.d.ts.map +1 -1
  124. package/lib/esm/curve/spiral/NormalizedTransition.js +62 -40
  125. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  126. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.d.ts +13 -18
  127. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.d.ts.map +1 -1
  128. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js +21 -24
  129. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  130. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts +41 -27
  131. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  132. package/lib/esm/curve/spiral/TransitionConditionalProperties.js +50 -33
  133. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  134. package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts +45 -34
  135. package/lib/esm/curve/spiral/TransitionSpiral3d.d.ts.map +1 -1
  136. package/lib/esm/curve/spiral/TransitionSpiral3d.js +56 -38
  137. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  138. package/lib/esm/curve/spiral/XYCurveEvaluator.d.ts +27 -21
  139. package/lib/esm/curve/spiral/XYCurveEvaluator.d.ts.map +1 -1
  140. package/lib/esm/curve/spiral/XYCurveEvaluator.js +23 -18
  141. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  142. package/lib/esm/geometry3d/GrowableXYArray.d.ts +96 -98
  143. package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
  144. package/lib/esm/geometry3d/GrowableXYArray.js +122 -111
  145. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  146. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +135 -142
  147. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  148. package/lib/esm/geometry3d/GrowableXYZArray.js +165 -160
  149. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  150. package/lib/esm/geometry3d/IndexedXYCollection.d.ts +51 -34
  151. package/lib/esm/geometry3d/IndexedXYCollection.d.ts.map +1 -1
  152. package/lib/esm/geometry3d/IndexedXYCollection.js +14 -5
  153. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  154. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +78 -77
  155. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  156. package/lib/esm/geometry3d/IndexedXYZCollection.js +38 -35
  157. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  158. package/lib/esm/geometry3d/PolygonOps.d.ts +27 -7
  159. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  160. package/lib/esm/geometry3d/PolygonOps.js +30 -9
  161. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  162. package/package.json +3 -3
@@ -21,35 +21,40 @@ import { Ray3d } from "../../geometry3d/Ray3d";
21
21
  import { Plane3dByOriginAndVectors } from "../../geometry3d/Plane3dByOriginAndVectors";
22
22
  /**
23
23
  * An IntegratedSpiral3d is a curve defined by integrating its curvature.
24
- * * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians)
24
+ * * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians).
25
25
  * * Integrating (cos(theta), sin(theta)) gives displacement from the start point, and thus the actual curve position.
26
- * * The curvature functions of interest are all symmetric snap functions in the NormalizedTransition class.
27
- * * `TransitionConditionalProperties` implements the computations of the interrelationship of radii, bearing, and length.
26
+ * * The curvature functions of interest are all symmetric snap functions in the [[NormalizedTransition]] class.
27
+ * * [[TransitionConditionalProperties]] implements the computations of the interrelationship of radii, bearing, and length.
28
28
  * @public
29
29
  */
30
30
  export class IntegratedSpiral3d extends TransitionSpiral3d {
31
- /** String name for schema properties */
31
+ /** String name for schema properties. */
32
32
  curvePrimitiveType = "transitionSpiral";
33
- /** start and end radii as a Segment1d */
33
+ /** Start and end radii as a Segment1d. */
34
34
  radius01;
35
- /** start and end bearings as an AngleSweep */
35
+ /** Start and end bearings as an AngleSweep. */
36
36
  bearing01;
37
- /** stroked approximation of entire spiral. */
37
+ /** Stroked approximation of entire spiral. */
38
38
  _globalStrokes;
39
- /** stroked approximation of active spiral.
40
- * * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed as partial versus complete.
41
- * * If no trimming, this points to the same place as the _globalStrokes !!! Don't double transform!!!
39
+ /**
40
+ * Stroked approximation of active spiral.
41
+ * * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed
42
+ * as partial versus complete.
43
+ * * If no trimming, this points to the same place as the _globalStrokes. DO NOT double transform.
42
44
  */
43
45
  _activeStrokes;
44
- /** Return the internal stroked form of the (possibly partial) spiral */
45
- get activeStrokes() { return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes; }
46
+ /** Return the internal stroked form of the (possibly partial) spiral. */
47
+ get activeStrokes() {
48
+ return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes;
49
+ }
50
+ /** Evaluator for transition. */
46
51
  _evaluator;
47
- /** Total curve arc length (computed) */
52
+ /** Total curve arc length (computed). */
48
53
  _arcLength01;
49
- /** Curvatures (inverse radii) at start and end */
54
+ /** Curvatures (inverse radii) at start and end. */
50
55
  _curvature01;
51
- /** evaluator for transition */
52
- // constructor demands all bearing, radius, and length data -- caller determines usual dependency of "any 4 determine the 5th"
56
+ // constructor demands all bearing, radius, and length data.
57
+ // caller determines usual dependency of "any 4 determine the 5th".
53
58
  constructor(spiralType, evaluator, radius01, bearing01, activeFractionInterval, localToWorld, arcLength, properties) {
54
59
  super(spiralType, localToWorld, activeFractionInterval, properties);
55
60
  this._evaluator = evaluator;
@@ -57,29 +62,33 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
57
62
  this.bearing01 = bearing01;
58
63
  this._arcLength01 = arcLength;
59
64
  this._globalStrokes = LineString3d.create();
60
- // initialize for compiler -- but this will be recomputed in refreshComputeProperties ...
65
+ // initialize for compiler; but this will be recomputed in refreshComputeProperties
61
66
  this._curvature01 = Segment1d.create(0, 1);
62
67
  this.refreshComputedProperties();
63
68
  }
64
- /** default spiral type name. (clothoid) */
69
+ /** Default spiral type name: clothoid. */
65
70
  static defaultSpiralType = "clothoid";
66
- /** use the integrated function to return an angle at fractional position. */
71
+ /** Use the integrated function to return an angle at fractional position. */
67
72
  globalFractionToBearingRadians(fraction) {
68
73
  const areaFraction = this._evaluator.fractionToArea(fraction);
69
74
  const dx = this._arcLength01;
70
- return this.bearing01.startRadians + areaFraction * dx * this._curvature01.signedDelta() + fraction * this._curvature01.x0 * dx;
75
+ return this.bearing01.startRadians
76
+ + areaFraction * dx * this._curvature01.signedDelta()
77
+ + fraction * this._curvature01.x0 * dx;
71
78
  }
72
- /** use the integrated function to return an angle at fractional position. */
79
+ /** Use the integrated function to return an angle at fractional position. */
73
80
  globalFractionToCurvature(fraction) {
74
81
  const f = this._evaluator.fractionToCurvatureFraction(fraction);
75
82
  return this._curvature01.fractionToPoint(f);
76
83
  }
77
- /** Return the bearing at given fraction of the active interval .... */
84
+ /** Return the bearing at given fraction of the active interval. */
78
85
  fractionToBearingRadians(activeFraction) {
79
86
  const fraction = this.activeFractionInterval.fractionToPoint(activeFraction);
80
- return this.bearing01.startRadians + fraction * this._arcLength01 * (this._curvature01.x0 + 0.5 * fraction * (this._curvature01.x1 - this._curvature01.x0));
87
+ return this.bearing01.startRadians
88
+ + fraction * this._arcLength01 * (this._curvature01.x0 + 0.5 * fraction * (this._curvature01.x1 - this._curvature01.x0));
81
89
  }
82
- /** Return the curvature at given fraction of the active interval ...
90
+ /**
91
+ * Return the curvature at given fraction of the active interval.
83
92
  * * The `undefined` result is to match the abstract class -- it cannot actually occur.
84
93
  */
85
94
  fractionToCurvature(activeFraction) {
@@ -96,14 +105,15 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
96
105
  IntegratedSpiral3d._gaussWeight = new Float64Array(5);
97
106
  IntegratedSpiral3d._gaussMapper = (xA, xB, xMapped, wMapped) => Quadrature.setupGauss5(xA, xB, xMapped, wMapped);
98
107
  }
99
- /** Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference length.
100
- * (recall that theta is a nonlinear function of the fraction.)
108
+ /**
109
+ * Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference
110
+ * length (recall that theta is a nonlinear function of the fraction).
101
111
  * * This is a single interval of gaussian integration.
102
- * * The fraction is on the full spiral (not in the mapped active interval)
112
+ * * The fraction is on the full spiral (not in the mapped active interval).
103
113
  * @param xyz advancing integrated point.
104
- * @param fractionA fraction at start of interval
114
+ * @param fractionA fraction at start of interval.
105
115
  * @param fractionB fraction at end of interval.
106
- * @param unitArcLength length of curve for 0 to 1 fractional
116
+ * @param unitArcLength length of curve for 0 to 1 fractional.
107
117
  */
108
118
  fullSpiralIncrementalIntegral(xyz, fractionA, fractionB, applyMatrix) {
109
119
  const gaussFraction = IntegratedSpiral3d._gaussFraction;
@@ -124,7 +134,7 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
124
134
  else
125
135
  xyz.addXYZInPlace(dx, dy, 0.0);
126
136
  }
127
- /** Recompute strokes */
137
+ /** Recompute strokes. */
128
138
  refreshComputedProperties() {
129
139
  this._curvature01 = Segment1d.create(TransitionSpiral3d.radiusToCurvature(this.radius01.x0), TransitionSpiral3d.radiusToCurvature(this.radius01.x1));
130
140
  this._globalStrokes.clear();
@@ -143,8 +153,9 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
143
153
  if (this._activeStrokes === undefined)
144
154
  this._activeStrokes = LineString3d.create();
145
155
  this._activeStrokes.clear();
146
- // finer strokes in the active interval ... same fraction step, but mapped
147
- // This assumes factionToPoint acts normally within refreshComputedProperties -- that depends on the global strokes we just computed, but not on the active strokes
156
+ // The active interval has finer strokes: it's the same fraction step but mapped to a sub-interval.
157
+ // Below assumes fractionToPoint depends upon the global strokes we just computed, and not
158
+ // on the active strokes we are computing.
148
159
  for (let i = 0; i <= numInterval; i++) {
149
160
  const localFraction = i * fractionStep;
150
161
  this._activeStrokes.addPoint(this.fractionToPoint(localFraction));
@@ -153,10 +164,11 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
153
164
  }
154
165
  /**
155
166
  * Create a transition spiral with radius and bearing conditions.
156
- * @param radius01 radius (inverse curvature) at start and end. (radius of zero means straight line)
157
- * @param bearing01 bearing angles at start and end. bearings are measured from the x axis, positive clockwise towards y axis
167
+ * @param radius01 radius (inverse curvature) at start and end (radius of zero means straight line).
168
+ * @param bearing01 bearing angles at start and end. bearings are measured from the x axis, positive clockwise
169
+ * towards y axis.
158
170
  * @param activeFractionInterval fractional limits of the active portion of the spiral.
159
- * @param localToWorld placement frame. Fractional coordinate 0 is at the origin.
171
+ * @param localToWorld placement frame. Fractional coordinate 0 is at the origin.
160
172
  */
161
173
  static createRadiusRadiusBearingBearing(radius01, bearing01, activeFractionInterval, localToWorld, typeName) {
162
174
  const arcLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(radius01.x0, radius01.x1, bearing01.sweepRadians);
@@ -169,14 +181,15 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
169
181
  }
170
182
  /**
171
183
  * Create a transition spiral.
172
- * * Inputs must provide exactly 4 of the 5 values `[radius0,radius1,bearing0,bearing1,length`.
184
+ * * Inputs must provide exactly 4 of the 5 values `[radius0,radius1,bearing0,bearing1,length]`.
173
185
  * @param spiralType one of "clothoid", "bloss", "biquadratic", "cosine", "sine". If undefined, "clothoid" is used.
174
- * @param radius0 radius (or 0 for tangent to line) at start
175
- * @param radius1 radius (or 0 for tangent to line) at end
186
+ * @param radius0 radius (or 0 for tangent to line) at start.
187
+ * @param radius1 radius (or 0 for tangent to line) at end.
176
188
  * @param bearing0 bearing, measured CCW from x axis at start.
177
189
  * @param bearing1 bearing, measured CCW from x axis at end.
178
- * @param fractionInterval optional fractional interval for an "active" portion of the curve. if omitted, the full [0,1] is used.
179
- * @param localToWorld placement transform
190
+ * @param fractionInterval optional fractional interval for an "active" portion of the curve. If omitted, the full
191
+ * [0,1] is used.
192
+ * @param localToWorld placement transform.
180
193
  */
181
194
  static createFrom4OutOf5(spiralType, radius0, radius1, bearing0, bearing1, arcLength, fractionInterval, localToWorld) {
182
195
  if (spiralType === undefined)
@@ -203,11 +216,11 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
203
216
  this._arcLength01 = other._arcLength01;
204
217
  return this;
205
218
  }
206
- /** Deep clone of this spiral */
219
+ /** Deep clone of this spiral. */
207
220
  clone() {
208
221
  return new IntegratedSpiral3d(this._spiralType, this._evaluator, this.radius01.clone(), this.bearing01.clone(), this.activeFractionInterval.clone(), this.localToWorld.clone(), this._arcLength01, this._designProperties?.clone());
209
222
  }
210
- /** apply `transform` to this spiral's local to world transform. */
223
+ /** Apply `transform` to this spiral's local to world transform. */
211
224
  tryTransformInPlace(transformA) {
212
225
  const rigidData = this.applyRigidPartOfTransform(transformA);
213
226
  if (rigidData !== undefined) {
@@ -224,32 +237,50 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
224
237
  startPoint(result) {
225
238
  return this.activeStrokes.startPoint(result);
226
239
  }
227
- /** return the spiral end point. */
240
+ /** Return the spiral end point. */
228
241
  endPoint(result) {
229
242
  return this.activeStrokes.endPoint(result);
230
243
  }
231
- /** test if the local to world transform places the spiral xy plane into `plane` */
244
+ /** Test if the local to world transform places the spiral xy plane into `plane`. */
232
245
  isInPlane(plane) {
233
246
  return plane.isPointInPlane(this.localToWorld.origin)
234
247
  && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))
235
248
  && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));
236
249
  }
237
- /** Return length of the spiral. Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */
238
- quickLength() { return this.curveLength(); }
239
- /** Return length of the spiral. Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */
240
- curveLength() { return this._arcLength01 * (this._activeFractionInterval.absoluteDelta()); }
241
- /** Return (unsigned) length of the spiral between fractions. Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */
250
+ /**
251
+ * Return length of the spiral.
252
+ * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.
253
+ */
254
+ quickLength() {
255
+ return this.curveLength();
256
+ }
257
+ /**
258
+ * Return length of the spiral.
259
+ * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.
260
+ */
261
+ curveLength() {
262
+ return this._arcLength01 * (this._activeFractionInterval.absoluteDelta());
263
+ }
264
+ /**
265
+ * Return (unsigned) length of the spiral between fractions.
266
+ * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.
267
+ */
242
268
  curveLengthBetweenFractions(fraction0, fraction1) {
243
269
  return this._arcLength01 * (this._activeFractionInterval.absoluteDelta() * Math.abs(fraction1 - fraction0));
244
270
  }
245
- /** Test if `other` is an instance of `TransitionSpiral3d` */
246
- isSameGeometryClass(other) { return other instanceof TransitionSpiral3d; }
247
- /** Add strokes from this spiral to `dest`.
271
+ /** Test if `other` is an instance of `TransitionSpiral3d`. */
272
+ isSameGeometryClass(other) {
273
+ return other instanceof TransitionSpiral3d;
274
+ }
275
+ /**
276
+ * Add strokes from this spiral to `dest`.
248
277
  * * Linestrings will usually stroke as just their points.
249
278
  * * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.
250
279
  */
251
- emitStrokes(dest, options) { this.activeStrokes.emitStrokes(dest, options); }
252
- /** emit stroke fragments to `dest` handler. */
280
+ emitStrokes(dest, options) {
281
+ this.activeStrokes.emitStrokes(dest, options);
282
+ }
283
+ /** Emit stroke fragments to `dest` handler. */
253
284
  emitStrokableParts(dest, options) {
254
285
  const n = this.computeStrokeCountForOptions(options);
255
286
  dest.startParentCurvePrimitive(this);
@@ -264,8 +295,8 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
264
295
  dest.endParentCurvePrimitive(this);
265
296
  }
266
297
  /**
267
- * return the stroke count required for given options.
268
- * @param options StrokeOptions that determine count
298
+ * Return the stroke count required for given options.
299
+ * @param options StrokeOptions that determine count.
269
300
  */
270
301
  computeStrokeCountForOptions(options) {
271
302
  let numStroke;
@@ -280,8 +311,9 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
280
311
  }
281
312
  return numStroke;
282
313
  }
283
- /** Reverse the active interval and active strokes.
284
- * * Primary defining data remains unchanged !!!
314
+ /**
315
+ * Reverse the active interval and active strokes.
316
+ * * Primary defining data remains unchanged.
285
317
  */
286
318
  reverseInPlace() {
287
319
  this.activeFractionInterval.reverseInPlace();
@@ -319,10 +351,10 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
319
351
  }
320
352
  else {
321
353
  const clampedGlobalFraction = Geometry.clampToStartEnd(targetGlobalFraction, 0, 1);
322
- const index0 = Math.trunc(clampedGlobalFraction * numStrokes); // This indexes the point to the left of the query.
354
+ const index0 = Math.trunc(clampedGlobalFraction * numStrokes); // this indexes the point to the left of the query
323
355
  const globalFraction0 = index0 / numStrokes;
324
356
  result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(index0, result);
325
- // GeometryCoreTestIO.consoleLog(" fractionToPoint ", activeFraction, this.activeFractionInterval, "( global integration " + globalFraction0 + " to " + globalFraction + ")", index0);
357
+ // GeometryCoreTestIO.consoleLog("fractionToPoint ", activeFraction, this.activeFractionInterval, "( global integration " + globalFraction0 + " to " + globalFraction + ")", index0);
326
358
  this.fullSpiralIncrementalIntegral(result, globalFraction0, targetGlobalFraction, true);
327
359
  }
328
360
  return result;
@@ -349,10 +381,11 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
349
381
  result.matrix.applyGivensColumnOp(0, 1, c, s);
350
382
  return result;
351
383
  }
352
- /** Return a plane with
353
- *
354
- * * origin at fractional position along the curve
355
- * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to the fraction.
384
+ /**
385
+ * Return a plane with
386
+ * * origin at fractional position along the curve.
387
+ * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to
388
+ * the fraction.
356
389
  * * vectorV is the second derivative, i.e.derivative of vectorU.
357
390
  */
358
391
  fractionToPointAnd2Derivatives(activeFraction, result) {
@@ -369,11 +402,11 @@ export class IntegratedSpiral3d extends TransitionSpiral3d {
369
402
  vectorY.scaleInPlace(this.globalFractionToCurvature(globalFraction));
370
403
  return Plane3dByOriginAndVectors.createCapture(origin, vectorX, vectorY, result);
371
404
  }
372
- /** Second step of double dispatch: call `handler.handleTransitionSpiral(this)` */
405
+ /** Second step of double dispatch: call `handler.handleTransitionSpiral(this)`. */
373
406
  dispatchToGeometryHandler(handler) {
374
407
  return handler.handleTransitionSpiral(this);
375
408
  }
376
- /** compare various coordinate quantities */
409
+ /** Compare various coordinate quantities. */
377
410
  isAlmostEqual(other) {
378
411
  if (other instanceof IntegratedSpiral3d) {
379
412
  return this.radius01.isAlmostEqual(other.radius01)
@@ -1 +1 @@
1
- {"version":3,"file":"IntegratedSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/IntegratedSpiral3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAEvF;;;;;;;GAOG;AACH,MAAM,OAAO,kBAAmB,SAAQ,kBA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IACnF,CAAC;IACD,mFAAmF;IAC5E,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IAED,4CAA4C;IAC5B,aAAa,CAAC,KAAqB;QACjD,IAAI,KAAK,YAAY,kBAAkB,EAAE,CAAC;YACxC,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC;mBAC7C,IAAI,CAAC,SAAS,CAAC,6BAA6B,CAAC,KAAK,CAAC,SAAS,CAAC;mBAC7D,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC;mBACnD,QAAQ,CAAC,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC;mBAChE,IAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC,KAAK,CAAC,sBAAsB,CAAC;mBACvE,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;;AAEH,sDAAsD;AACtD,kBAAkB,CAAC,aAAa,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\nimport { AngleSweep } from \"../../geometry3d/AngleSweep\";\nimport { Transform } from \"../../geometry3d/Transform\";\nimport { LineString3d } from \"../LineString3d\";\nimport { NormalizedTransition } from \"./NormalizedTransition\";\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\nimport { Quadrature } from \"../../numerics/Quadrature\";\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\nimport { Angle } from \"../../geometry3d/Angle\";\nimport { Plane3dByOriginAndUnitNormal } from \"../../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { AxisOrder, Geometry } from \"../../Geometry\";\nimport { StrokeOptions } from \"../StrokeOptions\";\nimport { GeometryHandler, IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\nimport { GeometryQuery } from \"../GeometryQuery\";\n/**\n * An IntegratedSpiral3d is a curve defined by integrating its curvature.\n * * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians)\n * * Integrating (cos(theta), sin(theta)) gives displacement from the start point, and thus the actual curve position.\n * * The curvature functions of interest are all symmetric snap functions in the NormalizedTransition class.\n * * `TransitionConditionalProperties` implements the computations of the interrelationship of radii, bearing, and length.\n * @public\n */\nexport class IntegratedSpiral3d extends TransitionSpiral3d {\n /** String name for schema properties */\n public readonly curvePrimitiveType = \"transitionSpiral\";\n\n /** start and end radii as a Segment1d */\n public radius01: Segment1d;\n /** start and end bearings as an AngleSweep */\n public bearing01: AngleSweep;\n /** stroked approximation of entire spiral. */\n private _globalStrokes: LineString3d;\n /** stroked approximation of active spiral.\n * * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed as partial versus complete.\n * * If no trimming, this points to the same place as the _globalStrokes !!! Don't double transform!!!\n */\n private _activeStrokes?: LineString3d;\n /** Return the internal stroked form of the (possibly partial) spiral */\n public get activeStrokes(): LineString3d { return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes; }\n private _evaluator: NormalizedTransition;\n /** Total curve arc length (computed) */\n private _arcLength01: number;\n /** Curvatures (inverse radii) at start and end */\n private _curvature01: Segment1d;\n /** evaluator for transition */\n // constructor demands all bearing, radius, and length data -- caller determines usual dependency of \"any 4 determine the 5th\"\n private constructor(spiralType: string | undefined,\n evaluator: NormalizedTransition,\n radius01: Segment1d,\n bearing01: AngleSweep,\n activeFractionInterval: Segment1d,\n localToWorld: Transform,\n arcLength: number,\n properties: TransitionConditionalProperties | undefined) {\n super(spiralType, localToWorld, activeFractionInterval, properties);\n this._evaluator = evaluator;\n this.radius01 = radius01;\n this.bearing01 = bearing01;\n this._arcLength01 = arcLength;\n this._globalStrokes = LineString3d.create();\n // initialize for compiler -- but this will be recomputed in refreshComputeProperties ...\n this._curvature01 = Segment1d.create(0, 1);\n this.refreshComputedProperties();\n }\n /** default spiral type name. (clothoid) */\n public static readonly defaultSpiralType = \"clothoid\";\n\n /** use the integrated function to return an angle at fractional position. */\n\n public globalFractionToBearingRadians(fraction: number): number {\n const areaFraction = this._evaluator.fractionToArea(fraction);\n const dx = this._arcLength01;\n return this.bearing01.startRadians + areaFraction * dx * this._curvature01.signedDelta() + fraction * this._curvature01.x0 * dx;\n }\n /** use the integrated function to return an angle at fractional position. */\n public globalFractionToCurvature(fraction: number): number {\n const f = this._evaluator.fractionToCurvatureFraction(fraction);\n return this._curvature01.fractionToPoint(f);\n }\n\n /** Return the bearing at given fraction of the active interval .... */\n\n public fractionToBearingRadians(activeFraction: number): number {\n const fraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n return this.bearing01.startRadians + fraction * this._arcLength01 * (this._curvature01.x0 + 0.5 * fraction * (this._curvature01.x1 - this._curvature01.x0));\n }\n /** Return the curvature at given fraction of the active interval ...\n * * The `undefined` result is to match the abstract class -- it cannot actually occur.\n */\n public override fractionToCurvature(activeFraction: number): number | undefined {\n // BUG? active interval\n return this._curvature01.fractionToPoint(this.activeFractionInterval.fractionToPoint(activeFraction));\n }\n\n // These static variables are reused on calls to integrateFromStartFraction\n\n private static _gaussFraction: Float64Array;\n private static _gaussWeight: Float64Array;\n private static _gaussMapper: (xA: number, xB: number, arrayX: Float64Array, arrayW: Float64Array) => number;\n /** Initialize class level work arrays. */\n public static initWorkSpace() {\n IntegratedSpiral3d._gaussFraction = new Float64Array(5);\n IntegratedSpiral3d._gaussWeight = new Float64Array(5);\n IntegratedSpiral3d._gaussMapper = (xA, xB, xMapped, wMapped) => Quadrature.setupGauss5(xA, xB, xMapped, wMapped);\n }\n /** Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference length.\n * (recall that theta is a nonlinear function of the fraction.)\n * * This is a single interval of gaussian integration.\n * * The fraction is on the full spiral (not in the mapped active interval)\n * @param xyz advancing integrated point.\n * @param fractionA fraction at start of interval\n * @param fractionB fraction at end of interval.\n * @param unitArcLength length of curve for 0 to 1 fractional\n */\n private fullSpiralIncrementalIntegral(xyz: Point3d, fractionA: number, fractionB: number, applyMatrix: boolean) {\n const gaussFraction = IntegratedSpiral3d._gaussFraction;\n const gaussWeight = IntegratedSpiral3d._gaussWeight;\n const numEval = IntegratedSpiral3d._gaussMapper(fractionA, fractionB, gaussFraction, gaussWeight);\n const deltaL = this._arcLength01;\n let w = 0;\n let dx = 0.0;\n let dy = 0.0;\n for (let k = 0; k < numEval; k++) {\n const radians = this.globalFractionToBearingRadians(gaussFraction[k]);\n w = gaussWeight[k] * deltaL;\n dx += w * Math.cos(radians);\n dy += w * Math.sin(radians);\n }\n if (applyMatrix)\n Matrix3d.xyzPlusMatrixTimesXYZ(xyz, this.localToWorld.matrix, { x: dx, y: dy, z: 0.0 }, xyz);\n else\n xyz.addXYZInPlace(dx, dy, 0.0);\n\n }\n /** Recompute strokes */\n public override refreshComputedProperties() {\n this._curvature01 = Segment1d.create(\n TransitionSpiral3d.radiusToCurvature(this.radius01.x0),\n TransitionSpiral3d.radiusToCurvature(this.radius01.x1));\n this._globalStrokes.clear();\n const currentPoint = Point3d.create();\n this._globalStrokes.appendStrokePoint(currentPoint);\n const numInterval = 16;\n\n const fractionStep = 1.0 / numInterval;\n for (let i = 1; i <= numInterval; i++) {\n const fraction0 = (i - 1) * fractionStep;\n const fraction1 = i * fractionStep;\n this.fullSpiralIncrementalIntegral(currentPoint, fraction0, fraction1, false);\n this._globalStrokes.appendStrokePoint(currentPoint);\n }\n this._globalStrokes.tryTransformInPlace(this.localToWorld);\n if (!this.activeFractionInterval.isExact01) {\n if (this._activeStrokes === undefined)\n this._activeStrokes = LineString3d.create();\n this._activeStrokes.clear();\n // finer strokes in the active interval ... same fraction step, but mapped\n // This assumes factionToPoint acts normally within refreshComputedProperties -- that depends on the global strokes we just computed, but not on the active strokes\n for (let i = 0; i <= numInterval; i++) {\n const localFraction = i * fractionStep;\n this._activeStrokes.addPoint(this.fractionToPoint(localFraction));\n }\n }\n }\n /**\n * Create a transition spiral with radius and bearing conditions.\n * @param radius01 radius (inverse curvature) at start and end. (radius of zero means straight line)\n * @param bearing01 bearing angles at start and end. bearings are measured from the x axis, positive clockwise towards y axis\n * @param activeFractionInterval fractional limits of the active portion of the spiral.\n * @param localToWorld placement frame. Fractional coordinate 0 is at the origin.\n */\n public static createRadiusRadiusBearingBearing(radius01: Segment1d, bearing01: AngleSweep, activeFractionInterval: Segment1d, localToWorld: Transform, typeName?: string) {\n const arcLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(radius01.x0, radius01.x1, bearing01.sweepRadians);\n if (typeName === undefined)\n typeName = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(typeName);\n if (!evaluator)\n return undefined;\n return new IntegratedSpiral3d(typeName, evaluator,\n radius01.clone(),\n bearing01.clone(), activeFractionInterval.clone(), localToWorld.clone(), arcLength,\n new TransitionConditionalProperties(radius01.x0, radius01.x1,\n bearing01.startAngle.clone(), bearing01.endAngle.clone(),\n undefined));\n }\n /**\n * Create a transition spiral.\n * * Inputs must provide exactly 4 of the 5 values `[radius0,radius1,bearing0,bearing1,length`.\n * @param spiralType one of \"clothoid\", \"bloss\", \"biquadratic\", \"cosine\", \"sine\". If undefined, \"clothoid\" is used.\n * @param radius0 radius (or 0 for tangent to line) at start\n * @param radius1 radius (or 0 for tangent to line) at end\n * @param bearing0 bearing, measured CCW from x axis at start.\n * @param bearing1 bearing, measured CCW from x axis at end.\n * @param fractionInterval optional fractional interval for an \"active\" portion of the curve. if omitted, the full [0,1] is used.\n * @param localToWorld placement transform\n */\n public static createFrom4OutOf5(\n spiralType: string | undefined,\n radius0: number | undefined,\n radius1: number | undefined,\n bearing0: Angle | undefined,\n bearing1: Angle | undefined,\n arcLength: number | undefined,\n fractionInterval: undefined | Segment1d,\n localToWorld: Transform): IntegratedSpiral3d | undefined {\n if (spiralType === undefined)\n spiralType = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(spiralType);\n if (!evaluator)\n return undefined;\n const data = new TransitionConditionalProperties(radius0, radius1, bearing0, bearing1, arcLength);\n const data1 = data.clone();\n if (!data.tryResolveAnySingleUnknown())\n return undefined;\n if (fractionInterval === undefined)\n fractionInterval = Segment1d.create(0, 1);\n return new IntegratedSpiral3d(\n spiralType,\n evaluator,\n Segment1d.create(data.radius0, data.radius1),\n AngleSweep.createStartEnd(data.bearing0!, data.bearing1!),\n fractionInterval ? fractionInterval.clone() : Segment1d.create(0, 1),\n localToWorld, data.curveLength!, data1);\n }\n /** Copy all defining data from another spiral. */\n public setFrom(other: IntegratedSpiral3d): IntegratedSpiral3d {\n this.localToWorld.setFrom(other.localToWorld);\n this.radius01.setFrom(other.radius01);\n this._curvature01.setFrom(other._curvature01);\n this.bearing01.setFrom(other.bearing01);\n this.localToWorld.setFrom(other.localToWorld);\n this.activeFractionInterval.setFrom(other.activeFractionInterval);\n this._arcLength01 = other._arcLength01;\n return this;\n }\n /** Deep clone of this spiral */\n public override clone(): IntegratedSpiral3d {\n return new IntegratedSpiral3d(this._spiralType, this._evaluator,\n this.radius01.clone(), this.bearing01.clone(),\n this.activeFractionInterval.clone(), this.localToWorld.clone(), this._arcLength01,\n this._designProperties?.clone());\n }\n\n /** apply `transform` to this spiral's local to world transform. */\n public tryTransformInPlace(transformA: Transform): boolean {\n\n const rigidData = this.applyRigidPartOfTransform(transformA);\n if (rigidData !== undefined) {\n this._curvature01.x0 /= rigidData.scale;\n this._curvature01.x1 /= rigidData.scale;\n this.radius01.x0 *= rigidData.scale;\n this.radius01.x1 *= rigidData.scale;\n this._arcLength01 *= rigidData.scale;\n }\n this.refreshComputedProperties();\n return true;\n }\n\n /** Return the spiral start point. */\n public override startPoint(result?: Point3d): Point3d {\n return this.activeStrokes.startPoint(result);\n }\n /** return the spiral end point. */\n public override endPoint(result?: Point3d): Point3d {\n return this.activeStrokes.endPoint(result);\n }\n /** test if the local to world transform places the spiral xy plane into `plane` */\n public isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean {\n return plane.isPointInPlane(this.localToWorld.origin as Point3d)\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));\n }\n /** Return length of the spiral. Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */\n public quickLength() { return this.curveLength(); }\n /** Return length of the spiral. Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */\n public override curveLength() { return this._arcLength01 * (this._activeFractionInterval.absoluteDelta()); }\n /** Return (unsigned) length of the spiral between fractions. Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value. */\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number) {\n return this._arcLength01 * (this._activeFractionInterval.absoluteDelta() * Math.abs(fraction1 - fraction0));\n }\n /** Test if `other` is an instance of `TransitionSpiral3d` */\n public isSameGeometryClass(other: any): boolean { return other instanceof TransitionSpiral3d; }\n /** Add strokes from this spiral to `dest`.\n * * Linestrings will usually stroke as just their points.\n * * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.\n */\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void { this.activeStrokes.emitStrokes(dest, options); }\n /** emit stroke fragments to `dest` handler. */\n public emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void {\n const n = this.computeStrokeCountForOptions(options);\n dest.startParentCurvePrimitive(this);\n const activeStrokes = this.activeStrokes;\n const preferPrimary = dest.needPrimaryGeometryForStrokes === undefined ? false : dest.needPrimaryGeometryForStrokes();\n if (!preferPrimary && n <= activeStrokes.numPoints()) {\n this.activeStrokes.emitStrokableParts(dest, options);\n } else {\n dest.announceIntervalForUniformStepStrokes(this, n, 0.0, 1.0);\n }\n dest.endParentCurvePrimitive(this);\n }\n\n /**\n * return the stroke count required for given options.\n * @param options StrokeOptions that determine count\n */\n\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n let numStroke;\n if (options) {\n const rMin = Math.min(Math.abs(this.radius01.x0), Math.abs(this.radius01.x1));\n numStroke = options.applyTolerancesToArc(rMin, this.bearing01.sweepRadians);\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\n } else {\n numStroke = StrokeOptions.applyAngleTol(undefined, 4, this.bearing01.sweepRadians);\n }\n return numStroke;\n }\n\n /** Reverse the active interval and active strokes.\n * * Primary defining data remains unchanged !!!\n */\n\n public reverseInPlace(): void {\n this.activeFractionInterval.reverseInPlace();\n if (this._activeStrokes === undefined)\n this._activeStrokes = this._globalStrokes.clone();\n this._activeStrokes.reverseInPlace();\n }\n /** Evaluate curve point with respect to fraction. */\n public fractionToPoint(activeFraction: number, result?: Point3d): Point3d {\n const targetGlobalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n const numStrokes = this._globalStrokes.packedPoints.length - 1;\n if (activeFraction > 1.0) {\n result = this._globalStrokes.packedPoints.back(result)!;\n const integrationStep = 1.0 / numStrokes;\n let currentGlobalFraction = 1.0;\n let nextGlobalFraction = currentGlobalFraction + integrationStep;\n while (nextGlobalFraction < targetGlobalFraction) {\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\n currentGlobalFraction = nextGlobalFraction;\n nextGlobalFraction += integrationStep;\n }\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\n } else if (activeFraction < 0.0) {\n result = this._globalStrokes.packedPoints.front(result)!;\n const integrationStep = 1.0 / numStrokes;\n let currentGlobalFraction = 0.0;\n let nextGlobalFraction = currentGlobalFraction - integrationStep;\n while (nextGlobalFraction > targetGlobalFraction) {\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\n currentGlobalFraction = nextGlobalFraction;\n nextGlobalFraction -= integrationStep;\n }\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\n } else {\n const clampedGlobalFraction = Geometry.clampToStartEnd(targetGlobalFraction, 0, 1);\n const index0 = Math.trunc(clampedGlobalFraction * numStrokes); // This indexes the point to the left of the query.\n const globalFraction0 = index0 / numStrokes;\n result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(index0, result);\n // GeometryCoreTestIO.consoleLog(\" fractionToPoint \", activeFraction, this.activeFractionInterval, \"( global integration \" + globalFraction0 + \" to \" + globalFraction + \")\", index0);\n this.fullSpiralIncrementalIntegral(result, globalFraction0, targetGlobalFraction, true);\n\n }\n return result;\n }\n /** Evaluate curve point and derivative with respect to fraction. */\n public fractionToPointAndDerivative(activeFraction: number, result?: Ray3d): Ray3d {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n result = result ? result : Ray3d.createZero();\n this.fractionToPoint(activeFraction, result.origin);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const a = this._arcLength01 * this.activeFractionInterval.signedDelta();\n this.localToWorld.matrix.multiplyXY(a * Math.cos(radians), a * Math.sin(radians), result.direction);\n return result;\n }\n\n /** Return the frenet frame at fractional position. */\n public override fractionToFrenetFrame(activeFraction: number, result?: Transform): Transform {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n result = result ? result : Transform.createIdentity();\n result.origin.setFrom(this.fractionToPoint(activeFraction));\n Matrix3d.createRigidFromMatrix3d(this.localToWorld.matrix, AxisOrder.XYZ, result.matrix);\n\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n result.matrix.applyGivensColumnOp(0, 1, c, s);\n return result;\n }\n /** Return a plane with\n *\n * * origin at fractional position along the curve\n * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to the fraction.\n * * vectorV is the second derivative, i.e.derivative of vectorU.\n */\n public fractionToPointAnd2Derivatives(activeFraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors | undefined {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n const origin = this.fractionToPoint(activeFraction);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n const delta = this.activeFractionInterval.signedDelta();\n const a = delta;\n const b = a * delta;\n const vectorX = this.localToWorld.matrix.multiplyXY(a * c, a * s);\n const vectorY = this.localToWorld.matrix.multiplyXY(-b * s, b * c);\n vectorY.scaleInPlace(this.globalFractionToCurvature(globalFraction));\n return Plane3dByOriginAndVectors.createCapture(origin, vectorX, vectorY, result);\n }\n /** Second step of double dispatch: call `handler.handleTransitionSpiral(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleTransitionSpiral(this);\n }\n\n /** compare various coordinate quantities */\n public override isAlmostEqual(other?: GeometryQuery): boolean {\n if (other instanceof IntegratedSpiral3d) {\n return this.radius01.isAlmostEqual(other.radius01)\n && this.bearing01.isAlmostEqualAllowPeriodShift(other.bearing01)\n && this.localToWorld.isAlmostEqual(other.localToWorld)\n && Geometry.isSameCoordinate(this._arcLength01, other._arcLength01)\n && this.activeFractionInterval.isAlmostEqual(other.activeFractionInterval)\n && this._curvature01.isAlmostEqual(other._curvature01);\n }\n return false;\n }\n}\n// at load time, initialize gauss quadrature workspace\nIntegratedSpiral3d.initWorkSpace();\n"]}
1
+ {"version":3,"file":"IntegratedSpiral3d.js","sourceRoot":"","sources":["../../../../src/curve/spiral/IntegratedSpiral3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO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AC,gBAAgB,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC;mBAChE,IAAI,CAAC,sBAAsB,CAAC,aAAa,CAAC,KAAK,CAAC,sBAAsB,CAAC;mBACvE,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QAC3D,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;;AAEH,sDAAsD;AACtD,kBAAkB,CAAC,aAAa,EAAE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { TransitionSpiral3d } from \"./TransitionSpiral3d\";\nimport { Segment1d } from \"../../geometry3d/Segment1d\";\nimport { AngleSweep } from \"../../geometry3d/AngleSweep\";\nimport { Transform } from \"../../geometry3d/Transform\";\nimport { LineString3d } from \"../LineString3d\";\nimport { NormalizedTransition } from \"./NormalizedTransition\";\nimport { TransitionConditionalProperties } from \"./TransitionConditionalProperties\";\nimport { Quadrature } from \"../../numerics/Quadrature\";\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\nimport { Matrix3d } from \"../../geometry3d/Matrix3d\";\nimport { Angle } from \"../../geometry3d/Angle\";\nimport { Plane3dByOriginAndUnitNormal } from \"../../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport { AxisOrder, Geometry } from \"../../Geometry\";\nimport { StrokeOptions } from \"../StrokeOptions\";\nimport { GeometryHandler, IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\nimport { Plane3dByOriginAndVectors } from \"../../geometry3d/Plane3dByOriginAndVectors\";\nimport { GeometryQuery } from \"../GeometryQuery\";\n\n/**\n * An IntegratedSpiral3d is a curve defined by integrating its curvature.\n * * The first integral of curvature (with respect to distance along the curve) is the bearing angle (in radians).\n * * Integrating (cos(theta), sin(theta)) gives displacement from the start point, and thus the actual curve position.\n * * The curvature functions of interest are all symmetric snap functions in the [[NormalizedTransition]] class.\n * * [[TransitionConditionalProperties]] implements the computations of the interrelationship of radii, bearing, and length.\n * @public\n */\nexport class IntegratedSpiral3d extends TransitionSpiral3d {\n /** String name for schema properties. */\n public readonly curvePrimitiveType = \"transitionSpiral\";\n /** Start and end radii as a Segment1d. */\n public radius01: Segment1d;\n /** Start and end bearings as an AngleSweep. */\n public bearing01: AngleSweep;\n /** Stroked approximation of entire spiral. */\n private _globalStrokes: LineString3d;\n /**\n * Stroked approximation of active spiral.\n * * Same count as global -- possibly overly fine, but it gives some consistency between same clothoid constructed\n * as partial versus complete.\n * * If no trimming, this points to the same place as the _globalStrokes. DO NOT double transform.\n */\n private _activeStrokes?: LineString3d;\n /** Return the internal stroked form of the (possibly partial) spiral. */\n public get activeStrokes(): LineString3d {\n return this._activeStrokes !== undefined ? this._activeStrokes : this._globalStrokes;\n }\n /** Evaluator for transition. */\n private _evaluator: NormalizedTransition;\n /** Total curve arc length (computed). */\n private _arcLength01: number;\n /** Curvatures (inverse radii) at start and end. */\n private _curvature01: Segment1d;\n // constructor demands all bearing, radius, and length data.\n // caller determines usual dependency of \"any 4 determine the 5th\".\n private constructor(\n spiralType: string | undefined,\n evaluator: NormalizedTransition,\n radius01: Segment1d,\n bearing01: AngleSweep,\n activeFractionInterval: Segment1d,\n localToWorld: Transform,\n arcLength: number,\n properties: TransitionConditionalProperties | undefined,\n ) {\n super(spiralType, localToWorld, activeFractionInterval, properties);\n this._evaluator = evaluator;\n this.radius01 = radius01;\n this.bearing01 = bearing01;\n this._arcLength01 = arcLength;\n this._globalStrokes = LineString3d.create();\n // initialize for compiler; but this will be recomputed in refreshComputeProperties\n this._curvature01 = Segment1d.create(0, 1);\n this.refreshComputedProperties();\n }\n /** Default spiral type name: clothoid. */\n public static readonly defaultSpiralType = \"clothoid\";\n /** Use the integrated function to return an angle at fractional position. */\n public globalFractionToBearingRadians(fraction: number): number {\n const areaFraction = this._evaluator.fractionToArea(fraction);\n const dx = this._arcLength01;\n return this.bearing01.startRadians\n + areaFraction * dx * this._curvature01.signedDelta()\n + fraction * this._curvature01.x0 * dx;\n }\n /** Use the integrated function to return an angle at fractional position. */\n public globalFractionToCurvature(fraction: number): number {\n const f = this._evaluator.fractionToCurvatureFraction(fraction);\n return this._curvature01.fractionToPoint(f);\n }\n /** Return the bearing at given fraction of the active interval. */\n public fractionToBearingRadians(activeFraction: number): number {\n const fraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n return this.bearing01.startRadians\n + fraction * this._arcLength01 * (this._curvature01.x0 + 0.5 * fraction * (this._curvature01.x1 - this._curvature01.x0));\n }\n /**\n * Return the curvature at given fraction of the active interval.\n * * The `undefined` result is to match the abstract class -- it cannot actually occur.\n */\n public override fractionToCurvature(activeFraction: number): number | undefined {\n // BUG? active interval\n return this._curvature01.fractionToPoint(this.activeFractionInterval.fractionToPoint(activeFraction));\n }\n // These static variables are reused on calls to integrateFromStartFraction\n private static _gaussFraction: Float64Array;\n private static _gaussWeight: Float64Array;\n private static _gaussMapper: (xA: number, xB: number, arrayX: Float64Array, arrayW: Float64Array) => number;\n /** Initialize class level work arrays. */\n public static initWorkSpace() {\n IntegratedSpiral3d._gaussFraction = new Float64Array(5);\n IntegratedSpiral3d._gaussWeight = new Float64Array(5);\n IntegratedSpiral3d._gaussMapper = (xA, xB, xMapped, wMapped) => Quadrature.setupGauss5(xA, xB, xMapped, wMapped);\n }\n /**\n * Evaluate and sum the gauss quadrature formulas to integrate cos(theta), sin(theta) fractional subset of a reference\n * length (recall that theta is a nonlinear function of the fraction).\n * * This is a single interval of gaussian integration.\n * * The fraction is on the full spiral (not in the mapped active interval).\n * @param xyz advancing integrated point.\n * @param fractionA fraction at start of interval.\n * @param fractionB fraction at end of interval.\n * @param unitArcLength length of curve for 0 to 1 fractional.\n */\n private fullSpiralIncrementalIntegral(xyz: Point3d, fractionA: number, fractionB: number, applyMatrix: boolean) {\n const gaussFraction = IntegratedSpiral3d._gaussFraction;\n const gaussWeight = IntegratedSpiral3d._gaussWeight;\n const numEval = IntegratedSpiral3d._gaussMapper(fractionA, fractionB, gaussFraction, gaussWeight);\n const deltaL = this._arcLength01;\n let w = 0;\n let dx = 0.0;\n let dy = 0.0;\n for (let k = 0; k < numEval; k++) {\n const radians = this.globalFractionToBearingRadians(gaussFraction[k]);\n w = gaussWeight[k] * deltaL;\n dx += w * Math.cos(radians);\n dy += w * Math.sin(radians);\n }\n if (applyMatrix)\n Matrix3d.xyzPlusMatrixTimesXYZ(xyz, this.localToWorld.matrix, { x: dx, y: dy, z: 0.0 }, xyz);\n else\n xyz.addXYZInPlace(dx, dy, 0.0);\n }\n /** Recompute strokes. */\n public override refreshComputedProperties() {\n this._curvature01 = Segment1d.create(\n TransitionSpiral3d.radiusToCurvature(this.radius01.x0),\n TransitionSpiral3d.radiusToCurvature(this.radius01.x1),\n );\n this._globalStrokes.clear();\n const currentPoint = Point3d.create();\n this._globalStrokes.appendStrokePoint(currentPoint);\n const numInterval = 16;\n const fractionStep = 1.0 / numInterval;\n for (let i = 1; i <= numInterval; i++) {\n const fraction0 = (i - 1) * fractionStep;\n const fraction1 = i * fractionStep;\n this.fullSpiralIncrementalIntegral(currentPoint, fraction0, fraction1, false);\n this._globalStrokes.appendStrokePoint(currentPoint);\n }\n this._globalStrokes.tryTransformInPlace(this.localToWorld);\n if (!this.activeFractionInterval.isExact01) {\n if (this._activeStrokes === undefined)\n this._activeStrokes = LineString3d.create();\n this._activeStrokes.clear();\n // The active interval has finer strokes: it's the same fraction step but mapped to a sub-interval.\n // Below assumes fractionToPoint depends upon the global strokes we just computed, and not\n // on the active strokes we are computing.\n for (let i = 0; i <= numInterval; i++) {\n const localFraction = i * fractionStep;\n this._activeStrokes.addPoint(this.fractionToPoint(localFraction));\n }\n }\n }\n /**\n * Create a transition spiral with radius and bearing conditions.\n * @param radius01 radius (inverse curvature) at start and end (radius of zero means straight line).\n * @param bearing01 bearing angles at start and end. bearings are measured from the x axis, positive clockwise\n * towards y axis.\n * @param activeFractionInterval fractional limits of the active portion of the spiral.\n * @param localToWorld placement frame. Fractional coordinate 0 is at the origin.\n */\n public static createRadiusRadiusBearingBearing(\n radius01: Segment1d,\n bearing01: AngleSweep,\n activeFractionInterval: Segment1d,\n localToWorld: Transform,\n typeName?: string,\n ): IntegratedSpiral3d | undefined {\n const arcLength = TransitionSpiral3d.radiusRadiusSweepRadiansToArcLength(\n radius01.x0, radius01.x1, bearing01.sweepRadians,\n );\n if (typeName === undefined)\n typeName = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(typeName);\n if (!evaluator)\n return undefined;\n return new IntegratedSpiral3d(\n typeName,\n evaluator,\n radius01.clone(),\n bearing01.clone(),\n activeFractionInterval.clone(),\n localToWorld.clone(),\n arcLength,\n new TransitionConditionalProperties(\n radius01.x0, radius01.x1, bearing01.startAngle.clone(), bearing01.endAngle.clone(), undefined,\n ),\n );\n }\n /**\n * Create a transition spiral.\n * * Inputs must provide exactly 4 of the 5 values `[radius0,radius1,bearing0,bearing1,length]`.\n * @param spiralType one of \"clothoid\", \"bloss\", \"biquadratic\", \"cosine\", \"sine\". If undefined, \"clothoid\" is used.\n * @param radius0 radius (or 0 for tangent to line) at start.\n * @param radius1 radius (or 0 for tangent to line) at end.\n * @param bearing0 bearing, measured CCW from x axis at start.\n * @param bearing1 bearing, measured CCW from x axis at end.\n * @param fractionInterval optional fractional interval for an \"active\" portion of the curve. If omitted, the full\n * [0,1] is used.\n * @param localToWorld placement transform.\n */\n public static createFrom4OutOf5(\n spiralType: string | undefined,\n radius0: number | undefined,\n radius1: number | undefined,\n bearing0: Angle | undefined,\n bearing1: Angle | undefined,\n arcLength: number | undefined,\n fractionInterval: undefined | Segment1d,\n localToWorld: Transform,\n ): IntegratedSpiral3d | undefined {\n if (spiralType === undefined)\n spiralType = \"clothoid\";\n const evaluator = NormalizedTransition.findEvaluator(spiralType);\n if (!evaluator)\n return undefined;\n const data = new TransitionConditionalProperties(radius0, radius1, bearing0, bearing1, arcLength);\n const data1 = data.clone();\n if (!data.tryResolveAnySingleUnknown())\n return undefined;\n if (fractionInterval === undefined)\n fractionInterval = Segment1d.create(0, 1);\n return new IntegratedSpiral3d(\n spiralType,\n evaluator,\n Segment1d.create(data.radius0, data.radius1),\n AngleSweep.createStartEnd(data.bearing0!, data.bearing1!),\n fractionInterval ? fractionInterval.clone() : Segment1d.create(0, 1),\n localToWorld,\n data.curveLength!,\n data1,\n );\n }\n /** Copy all defining data from another spiral. */\n public setFrom(other: IntegratedSpiral3d): IntegratedSpiral3d {\n this.localToWorld.setFrom(other.localToWorld);\n this.radius01.setFrom(other.radius01);\n this._curvature01.setFrom(other._curvature01);\n this.bearing01.setFrom(other.bearing01);\n this.localToWorld.setFrom(other.localToWorld);\n this.activeFractionInterval.setFrom(other.activeFractionInterval);\n this._arcLength01 = other._arcLength01;\n return this;\n }\n /** Deep clone of this spiral. */\n public override clone(): IntegratedSpiral3d {\n return new IntegratedSpiral3d(\n this._spiralType,\n this._evaluator,\n this.radius01.clone(),\n this.bearing01.clone(),\n this.activeFractionInterval.clone(),\n this.localToWorld.clone(),\n this._arcLength01,\n this._designProperties?.clone(),\n );\n }\n /** Apply `transform` to this spiral's local to world transform. */\n public tryTransformInPlace(transformA: Transform): boolean {\n const rigidData = this.applyRigidPartOfTransform(transformA);\n if (rigidData !== undefined) {\n this._curvature01.x0 /= rigidData.scale;\n this._curvature01.x1 /= rigidData.scale;\n this.radius01.x0 *= rigidData.scale;\n this.radius01.x1 *= rigidData.scale;\n this._arcLength01 *= rigidData.scale;\n }\n this.refreshComputedProperties();\n return true;\n }\n /** Return the spiral start point. */\n public override startPoint(result?: Point3d): Point3d {\n return this.activeStrokes.startPoint(result);\n }\n /** Return the spiral end point. */\n public override endPoint(result?: Point3d): Point3d {\n return this.activeStrokes.endPoint(result);\n }\n /** Test if the local to world transform places the spiral xy plane into `plane`. */\n public isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean {\n return plane.isPointInPlane(this.localToWorld.origin as Point3d)\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnX(plane.getNormalRef()))\n && Geometry.isSameCoordinate(0.0, this.localToWorld.matrix.dotColumnY(plane.getNormalRef()));\n }\n /**\n * Return length of the spiral.\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\n */\n public quickLength() {\n return this.curveLength();\n }\n /**\n * Return length of the spiral.\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\n */\n public override curveLength() {\n return this._arcLength01 * (this._activeFractionInterval.absoluteDelta());\n }\n /**\n * Return (unsigned) length of the spiral between fractions.\n * * Because TransitionSpiral is parameterized directly in terms of distance along, this is a simple return value.\n */\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number) {\n return this._arcLength01 * (this._activeFractionInterval.absoluteDelta() * Math.abs(fraction1 - fraction0));\n }\n /** Test if `other` is an instance of `TransitionSpiral3d`. */\n public isSameGeometryClass(other: any): boolean {\n return other instanceof TransitionSpiral3d;\n }\n /**\n * Add strokes from this spiral to `dest`.\n * * Linestrings will usually stroke as just their points.\n * * If maxEdgeLength is given, this will sub-stroke within the linestring -- not what we want.\n */\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\n this.activeStrokes.emitStrokes(dest, options);\n }\n /** Emit stroke fragments to `dest` handler. */\n public emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void {\n const n = this.computeStrokeCountForOptions(options);\n dest.startParentCurvePrimitive(this);\n const activeStrokes = this.activeStrokes;\n const preferPrimary = dest.needPrimaryGeometryForStrokes === undefined ? false : dest.needPrimaryGeometryForStrokes();\n if (!preferPrimary && n <= activeStrokes.numPoints()) {\n this.activeStrokes.emitStrokableParts(dest, options);\n } else {\n dest.announceIntervalForUniformStepStrokes(this, n, 0.0, 1.0);\n }\n dest.endParentCurvePrimitive(this);\n }\n /**\n * Return the stroke count required for given options.\n * @param options StrokeOptions that determine count.\n */\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n let numStroke;\n if (options) {\n const rMin = Math.min(Math.abs(this.radius01.x0), Math.abs(this.radius01.x1));\n numStroke = options.applyTolerancesToArc(rMin, this.bearing01.sweepRadians);\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\n } else {\n numStroke = StrokeOptions.applyAngleTol(undefined, 4, this.bearing01.sweepRadians);\n }\n return numStroke;\n }\n /**\n * Reverse the active interval and active strokes.\n * * Primary defining data remains unchanged.\n */\n public reverseInPlace(): void {\n this.activeFractionInterval.reverseInPlace();\n if (this._activeStrokes === undefined)\n this._activeStrokes = this._globalStrokes.clone();\n this._activeStrokes.reverseInPlace();\n }\n /** Evaluate curve point with respect to fraction. */\n public fractionToPoint(activeFraction: number, result?: Point3d): Point3d {\n const targetGlobalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n const numStrokes = this._globalStrokes.packedPoints.length - 1;\n if (activeFraction > 1.0) {\n result = this._globalStrokes.packedPoints.back(result)!;\n const integrationStep = 1.0 / numStrokes;\n let currentGlobalFraction = 1.0;\n let nextGlobalFraction = currentGlobalFraction + integrationStep;\n while (nextGlobalFraction < targetGlobalFraction) {\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\n currentGlobalFraction = nextGlobalFraction;\n nextGlobalFraction += integrationStep;\n }\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\n } else if (activeFraction < 0.0) {\n result = this._globalStrokes.packedPoints.front(result)!;\n const integrationStep = 1.0 / numStrokes;\n let currentGlobalFraction = 0.0;\n let nextGlobalFraction = currentGlobalFraction - integrationStep;\n while (nextGlobalFraction > targetGlobalFraction) {\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, nextGlobalFraction, true);\n currentGlobalFraction = nextGlobalFraction;\n nextGlobalFraction -= integrationStep;\n }\n this.fullSpiralIncrementalIntegral(result, currentGlobalFraction, targetGlobalFraction, true);\n } else {\n const clampedGlobalFraction = Geometry.clampToStartEnd(targetGlobalFraction, 0, 1);\n const index0 = Math.trunc(clampedGlobalFraction * numStrokes); // this indexes the point to the left of the query\n const globalFraction0 = index0 / numStrokes;\n result = this._globalStrokes.packedPoints.getPoint3dAtUncheckedPointIndex(index0, result);\n // GeometryCoreTestIO.consoleLog(\"fractionToPoint \", activeFraction, this.activeFractionInterval, \"( global integration \" + globalFraction0 + \" to \" + globalFraction + \")\", index0);\n this.fullSpiralIncrementalIntegral(result, globalFraction0, targetGlobalFraction, true);\n\n }\n return result;\n }\n /** Evaluate curve point and derivative with respect to fraction. */\n public fractionToPointAndDerivative(activeFraction: number, result?: Ray3d): Ray3d {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n result = result ? result : Ray3d.createZero();\n this.fractionToPoint(activeFraction, result.origin);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const a = this._arcLength01 * this.activeFractionInterval.signedDelta();\n this.localToWorld.matrix.multiplyXY(a * Math.cos(radians), a * Math.sin(radians), result.direction);\n return result;\n }\n /** Return the frenet frame at fractional position. */\n public override fractionToFrenetFrame(activeFraction: number, result?: Transform): Transform {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n result = result ? result : Transform.createIdentity();\n result.origin.setFrom(this.fractionToPoint(activeFraction));\n Matrix3d.createRigidFromMatrix3d(this.localToWorld.matrix, AxisOrder.XYZ, result.matrix);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n result.matrix.applyGivensColumnOp(0, 1, c, s);\n return result;\n }\n /**\n * Return a plane with\n * * origin at fractional position along the curve.\n * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to\n * the fraction.\n * * vectorV is the second derivative, i.e.derivative of vectorU.\n */\n public fractionToPointAnd2Derivatives(\n activeFraction: number, result?: Plane3dByOriginAndVectors,\n ): Plane3dByOriginAndVectors | undefined {\n const globalFraction = this.activeFractionInterval.fractionToPoint(activeFraction);\n const origin = this.fractionToPoint(activeFraction);\n const radians = this.globalFractionToBearingRadians(globalFraction);\n const c = Math.cos(radians);\n const s = Math.sin(radians);\n const delta = this.activeFractionInterval.signedDelta();\n const a = delta;\n const b = a * delta;\n const vectorX = this.localToWorld.matrix.multiplyXY(a * c, a * s);\n const vectorY = this.localToWorld.matrix.multiplyXY(-b * s, b * c);\n vectorY.scaleInPlace(this.globalFractionToCurvature(globalFraction));\n return Plane3dByOriginAndVectors.createCapture(origin, vectorX, vectorY, result);\n }\n /** Second step of double dispatch: call `handler.handleTransitionSpiral(this)`. */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleTransitionSpiral(this);\n }\n /** Compare various coordinate quantities. */\n public override isAlmostEqual(other?: GeometryQuery): boolean {\n if (other instanceof IntegratedSpiral3d) {\n return this.radius01.isAlmostEqual(other.radius01)\n && this.bearing01.isAlmostEqualAllowPeriodShift(other.bearing01)\n && this.localToWorld.isAlmostEqual(other.localToWorld)\n && Geometry.isSameCoordinate(this._arcLength01, other._arcLength01)\n && this.activeFractionInterval.isAlmostEqual(other.activeFractionInterval)\n && this._curvature01.isAlmostEqual(other._curvature01);\n }\n return false;\n }\n}\n// at load time, initialize gauss quadrature workspace\nIntegratedSpiral3d.initWorkSpace();\n"]}
@@ -1,17 +1,12 @@
1
1
  import { CubicEvaluator } from "./CubicEvaluator";
2
2
  /**
3
3
  * MX Cubic along arc.
4
- * This is y= m*x^3 with
5
- * * x any point on the x axis
6
- * * `fraction` along the spiral goes to `x = fraction * Lx`
7
- * * m is (1/6RL)
4
+ * This is y = m*x^3 with
5
+ * * x any point on the x axis.
6
+ * * `fraction` along the spiral goes to `x = fraction * Lx`.
7
+ * * m is (1/6RL).
8
8
  * * construction length L is nominal along the curve.
9
9
  * * x length Lx is along the axis, determined by two terms of the clothoid x series.
10
- * *
11
- * @param localToWorld
12
- * @param nominalL1
13
- * @param nominalR1
14
- * @param activeInterval
15
10
  * @internal
16
11
  */
17
12
  export declare class MXCubicAlongArcEvaluator extends CubicEvaluator {
@@ -23,14 +18,15 @@ export declare class MXCubicAlongArcEvaluator extends CubicEvaluator {
23
18
  static computeCubicM(length1: number, radius1: number): number | undefined;
24
19
  static create(length1: number, radius1: number): MXCubicAlongArcEvaluator | undefined;
25
20
  scaleInPlace(scaleFactor: number): void;
26
- /** return a deep copy of the evaluator */
21
+ /** Return a deep copy of the evaluator. */
27
22
  clone(): MXCubicAlongArcEvaluator;
28
- /** Member by member matchup ... */
23
+ /** Member by member matchup. */
29
24
  isAlmostEqual(other: any): boolean;
30
25
  /**
31
26
  * Return a (fast but mediocre) approximation of spiral x position as function of approximate distance along the curve.
32
27
  * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.
33
- * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate CurvePrimitive measurements.
28
+ * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
29
+ * CurvePrimitive measurements.
34
30
  * @param x distance along the x axis.
35
31
  */
36
32
  static approximateDistanceAlongToX(nominalLength1: number, nominalRadius1: number, nominalDistanceAlong: number): number;
@@ -1 +1 @@
1
- {"version":3,"file":"MXCubicAlongArcSpiralEvaluator.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/MXCubicAlongArcSpiralEvaluator.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD;;;;;;;;;;;;;;GAcG;AACH,qBAAa,wBAAyB,SAAQ,cAAc;IACnD,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IAE9B,uEAAuE;IACvE,OAAO;IAMP,kCAAkC;WACpB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;WAKnE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS;IAQ5E,YAAY,CAAC,WAAW,EAAE,MAAM;IAKhD,0CAA0C;IACnC,KAAK,IAAI,wBAAwB;IACxC,mCAAmC;IAC5B,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;IAOzC;;;;;OAKG;WACW,2BAA2B,CAAC,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,GAAG,MAAM;CAMhI"}
1
+ {"version":3,"file":"MXCubicAlongArcSpiralEvaluator.d.ts","sourceRoot":"","sources":["../../../../src/curve/spiral/MXCubicAlongArcSpiralEvaluator.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;;;;;;;GASG;AACH,qBAAa,wBAAyB,SAAQ,cAAc;IACnD,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IAC9B,uEAAuE;IACvE,OAAO;IAKP,kCAAkC;WACpB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;WAInE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS;IAO5E,YAAY,CAAC,WAAW,EAAE,MAAM;IAKhD,2CAA2C;IACpC,KAAK,IAAI,wBAAwB;IAGxC,gCAAgC;IACzB,aAAa,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;IAOzC;;;;;;OAMG;WACW,2BAA2B,CACvC,cAAc,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,GAC3E,MAAM;CAMV"}
@@ -9,17 +9,12 @@ import { Geometry } from "../../Geometry";
9
9
  import { CubicEvaluator } from "./CubicEvaluator";
10
10
  /**
11
11
  * MX Cubic along arc.
12
- * This is y= m*x^3 with
13
- * * x any point on the x axis
14
- * * `fraction` along the spiral goes to `x = fraction * Lx`
15
- * * m is (1/6RL)
12
+ * This is y = m*x^3 with
13
+ * * x any point on the x axis.
14
+ * * `fraction` along the spiral goes to `x = fraction * Lx`.
15
+ * * m is (1/6RL).
16
16
  * * construction length L is nominal along the curve.
17
17
  * * x length Lx is along the axis, determined by two terms of the clothoid x series.
18
- * *
19
- * @param localToWorld
20
- * @param nominalL1
21
- * @param nominalR1
22
- * @param activeInterval
23
18
  * @internal
24
19
  */
25
20
  export class MXCubicAlongArcEvaluator extends CubicEvaluator {
@@ -48,9 +43,11 @@ export class MXCubicAlongArcEvaluator extends CubicEvaluator {
48
43
  this.nominalRadius1 *= scaleFactor;
49
44
  super.scaleInPlace(scaleFactor);
50
45
  }
51
- /** return a deep copy of the evaluator */
52
- clone() { return new MXCubicAlongArcEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM); }
53
- /** Member by member matchup ... */
46
+ /** Return a deep copy of the evaluator. */
47
+ clone() {
48
+ return new MXCubicAlongArcEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM);
49
+ }
50
+ /** Member by member matchup. */
54
51
  isAlmostEqual(other) {
55
52
  if (other instanceof MXCubicAlongArcEvaluator) {
56
53
  return Geometry.isSameCoordinate(this.nominalLength1, other.nominalLength1)
@@ -61,7 +58,8 @@ export class MXCubicAlongArcEvaluator extends CubicEvaluator {
61
58
  /**
62
59
  * Return a (fast but mediocre) approximation of spiral x position as function of approximate distance along the curve.
63
60
  * * This x-to-distance relation is not as precise as the CurvePrimitive method moveSignedDistanceFromFraction.
64
- * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate CurvePrimitive measurements.
61
+ * * It is supported here for users interested in replicating the Czech distance mapping rather than the more accurate
62
+ * CurvePrimitive measurements.
65
63
  * @param x distance along the x axis.
66
64
  */
67
65
  static approximateDistanceAlongToX(nominalLength1, nominalRadius1, nominalDistanceAlong) {